nixpkgs/pkgs/desktops/gnome/misc/nautilus-python/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.3 KiB
Nix
Raw Normal View History

2021-10-25 05:30:11 +00:00
{ stdenv
, lib
, fetchpatch
2021-10-25 05:30:11 +00:00
, substituteAll
2018-10-07 06:32:08 +00:00
, fetchurl
2021-01-17 02:21:50 +00:00
, pkg-config
2018-10-07 06:32:08 +00:00
, which
, autoreconfHook
2018-10-07 06:32:08 +00:00
, gtk-doc
, docbook_xsl
, docbook_xml_dtd_412
, python3
, ncurses
, nautilus
, gtk3
, gnome
2018-10-07 06:32:08 +00:00
}:
stdenv.mkDerivation rec {
pname = "nautilus-python";
version = "1.2.3";
2018-10-07 06:32:08 +00:00
outputs = [ "out" "dev" "doc" ];
src = fetchurl {
2021-01-15 13:21:58 +00:00
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "161050sx3sdxqcpjkjcpf6wl4kx0jydihga7mcvrj9c2f8ly0g07";
2018-10-07 06:32:08 +00:00
};
2021-10-25 05:30:11 +00:00
patches = [
# Make PyGObjects gi library available.
(substituteAll {
src = ./fix-paths.patch;
pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [
python3.pkgs.pygobject3
];
})
# Fix build with Nautilus 43.
# https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/9
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/nautilus-python/commit/1691b2eb88c8b9134c6fa06da0858f7b5bb74c72.patch";
sha256 = "dY9KrLorYlGTbKSLObRmffJwJfHwz48kCsInGGByIOI=";
})
2021-10-25 05:30:11 +00:00
];
2018-10-07 06:32:08 +00:00
nativeBuildInputs = [
2021-01-17 02:21:50 +00:00
pkg-config
2018-10-07 06:32:08 +00:00
which
autoreconfHook
2018-10-07 06:32:08 +00:00
gtk-doc
docbook_xsl
docbook_xml_dtd_412
];
buildInputs = [
python3
ncurses # required by python3
python3.pkgs.pygobject3
nautilus
gtk3 # required by libnautilus-extension
];
# Workaround build failure on -fno-common toolchains:
# ld: nautilus-python-object.o:src/nautilus-python.h:61: multiple definition of
# `_PyNautilusMenu_Type'; nautilus-python.o:src/nautilus-python.h:61: first defined here
# TODO: remove it once upstream fixes and releases:
# https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/7
NIX_CFLAGS_COMPILE = "-fcommon";
2018-10-07 06:32:08 +00:00
makeFlags = [
"PYTHON_LIB_LOC=${python3}/lib"
];
PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-4";
2018-10-07 06:32:08 +00:00
passthru = {
updateScript = gnome.updateScript {
2018-10-07 06:32:08 +00:00
packageName = pname;
attrPath = "gnome.${pname}";
versionPolicy = "odd-unstable";
2018-10-07 06:32:08 +00:00
};
};
meta = with lib; {
2018-10-07 06:32:08 +00:00
description = "Python bindings for the Nautilus Extension API";
homepage = "https://wiki.gnome.org/Projects/NautilusPython";
2018-10-07 06:32:08 +00:00
license = licenses.gpl2Plus;
maintainers = teams.gnome.members;
2018-10-07 06:32:08 +00:00
platforms = platforms.unix;
};
}