depot/third_party/nixpkgs/pkgs/desktops/cinnamon/nemo-extensions/nemo-python/default.nix
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

62 lines
1.3 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, meson
, pkg-config
, ninja
, glib
, gtk3
, nemo
, python3
}:
let
srcs = import ../srcs.nix { inherit fetchFromGitHub; };
in
stdenv.mkDerivation rec {
pname = "nemo-python";
inherit (srcs) version src;
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;
maintainers = teams.cinnamon.members;
};
}