push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
diff --git a/src/nemo-python.c b/src/nemo-python.c
index 8d2acdb..900811b 100644
--- a/src/nemo-python.c
+++ b/src/nemo-python.c
@@ -255,6 +255,7 @@ nemo_module_initialize(GTypeModule *module)
{
gchar *user_extensions_dir;
const gchar *env_string;
+ const gchar *python_extensiondir;
env_string = g_getenv("NEMO_PYTHON_DEBUG");
if (env_string != NULL)
@@ -269,8 +270,12 @@ nemo_module_initialize(GTypeModule *module)
all_types = g_array_new(FALSE, FALSE, sizeof(GType));
- // Look in the new global path, $DATADIR/nemo-python/extensions
- nemo_python_load_dir(module, PYTHON_EXTENSION_DIR);
+ // Look in NEMO_PYTHON_EXTENSION_DIR
+ python_extensiondir = g_getenv("NEMO_PYTHON_EXTENSION_DIR");
+ if (python_extensiondir == NULL) {
+ python_extensiondir = PYTHON_EXTENSION_DIR;
+ }
+ nemo_python_load_dir(module, python_extensiondir);
// Look in XDG_DATA_DIR, ~/.local/share/nemo-python/extensions
user_extensions_dir = g_build_filename(g_get_user_data_dir(),

View File

@@ -0,0 +1,67 @@
{
stdenv,
lib,
fetchFromGitHub,
meson,
pkg-config,
ninja,
glib,
gtk3,
nemo,
python3,
}:
stdenv.mkDerivation rec {
pname = "nemo-python";
version = "6.4.0";
src = fetchFromGitHub {
owner = "linuxmint";
repo = "nemo-extensions";
rev = version;
hash = "sha256-39hWA4SNuEeaPA6D5mWMHjJDs4hYK7/ZdPkTyskvm5Y=";
};
sourceRoot = "${src.name}/nemo-python";
patches = [
# Load extensions from NEMO_PYTHON_EXTENSION_DIR environment variable
# https://github.com/NixOS/nixpkgs/issues/78327
./load-extensions-from-env.patch
# Pick up all passthru.nemoPythonExtensionDeps via nemo-with-extensions wrapper
./python-path.patch
];
nativeBuildInputs = [
meson
pkg-config
ninja
];
buildInputs = [
glib
gtk3
nemo
python3
python3.pkgs.pygobject3
];
postPatch = ''
# Tries to load libpython3.so via g_module_open ().
substituteInPlace meson.build \
--replace "get_option('prefix'), get_option('libdir')" "'${python3}/lib'"
'';
PKG_CONFIG_LIBNEMO_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/${nemo.extensiondir}";
passthru.nemoPythonExtensionDeps = [ python3.pkgs.pygobject3 ];
meta = with lib; {
homepage = "https://github.com/linuxmint/nemo-extensions/tree/master/nemo-python";
description = "Python bindings for the Nemo extension library";
license = licenses.gpl2Plus;
platforms = platforms.linux;
teams = [ teams.cinnamon ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/src/nemo-python.c b/src/nemo-python.c
index 8d2acdb..ee24143 100644
--- a/src/nemo-python.c
+++ b/src/nemo-python.c
@@ -197,7 +197,7 @@ nemo_python_init_python (void)
}
debug("Sanitize the python search path");
- PyRun_SimpleString("import sys; sys.path = [path for path in sys.path if path]");
+ PyRun_SimpleString("import sys; import os; sys.path = [path for path in sys.path if path]; sys.path += os.getenv(\"NEMO_PYTHON_SEARCH_PATH\").split(os.pathsep)");
if (PyErr_Occurred())
{
PyErr_Print();