1{
2 stdenv,
3 lib,
4 fetchurl,
5 replaceVars,
6 meson,
7 ninja,
8 pkg-config,
9 gettext,
10 gi-docgen,
11 gnome,
12 glib,
13 gtk3,
14 gobject-introspection,
15 python3,
16 ncurses,
17 wrapGAppsHook3,
18}:
19
20stdenv.mkDerivation rec {
21 pname = "libpeas";
22 version = "1.36.0";
23
24 outputs = [
25 "out"
26 "dev"
27 "devdoc"
28 ];
29
30 src = fetchurl {
31 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
32 sha256 = "KXy5wszNjoYXYj0aPoQVtFMLjlqJPjUnu/0e3RMje0w=";
33 };
34
35 patches = [
36 # Make PyGObject’s gi library available.
37 (replaceVars ./fix-paths.patch {
38 pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [
39 python3.pkgs.pygobject3
40 ];
41 })
42 ];
43
44 depsBuildBuild = [
45 pkg-config
46 ];
47
48 nativeBuildInputs = [
49 pkg-config
50 meson
51 ninja
52 gettext
53 gi-docgen
54 gobject-introspection
55 wrapGAppsHook3
56 ];
57
58 buildInputs = [
59 glib
60 gtk3
61 ncurses
62 python3
63 python3.pkgs.pygobject3
64 ];
65
66 propagatedBuildInputs = [
67 # Required by libpeas-1.0.pc
68 gobject-introspection
69 ];
70
71 mesonFlags = [
72 "-Dgtk_doc=true"
73 ];
74
75 postFixup = ''
76 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
77 moveToOutput "share/doc" "$devdoc"
78 '';
79
80 passthru = {
81 updateScript = gnome.updateScript {
82 packageName = pname;
83 versionPolicy = "odd-unstable";
84 freeze = true;
85 };
86 };
87
88 meta = with lib; {
89 description = "GObject-based plugins engine";
90 mainProgram = "peas-demo";
91 homepage = "https://gitlab.gnome.org/GNOME/libpeas";
92 license = licenses.gpl2Plus;
93 platforms = platforms.unix;
94 teams = [ teams.gnome ];
95 };
96}