Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ma / magpie / package.nix
blob176c81fae2b809fc92bdcbf6027652340397dcdf
2   fetchFromGitHub,
3   runCommand,
4   lib,
5   fetchpatch,
6   stdenv,
7   pkg-config,
8   gnome,
9   gettext,
10   gobject-introspection,
11   cairo,
12   colord,
13   lcms2,
14   pango,
15   json-glib,
16   libstartup_notification,
17   libcanberra,
18   ninja,
19   xvfb-run,
20   xkeyboard_config,
21   libxcvt,
22   libxkbfile,
23   libXdamage,
24   libxkbcommon,
25   libXtst,
26   libinput,
27   libdrm,
28   gsettings-desktop-schemas,
29   glib,
30   gtk3,
31   gnome-desktop,
32   pipewire,
33   libgudev,
34   libwacom,
35   mesa,
36   meson,
37   nix-update-script,
38   validatePkgConfig,
39   xorgserver,
40   python3,
41   wrapGAppsHook3,
42   gi-docgen,
43   sysprof,
44   testers,
45   libsysprof-capture,
46   desktop-file-utils,
47   libcap_ng,
48   graphene,
51 stdenv.mkDerivation (finalAttrs: {
52   pname = "magpie";
53   version = "0.9.3";
55   outputs = [
56     "out"
57     "dev"
58     "devdoc"
59   ];
61   src = fetchFromGitHub {
62     owner = "BuddiesOfBudgie";
63     repo = "magpie";
64     rev = "v${finalAttrs.version}";
65     hash = "sha256-A8FmW2o2p5B5pxTZ6twwufyhfppuMXjnMKopZRD+XdE=";
66   };
68   patches = [
69     # Fix build with separate sysprof.
70     # https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2572
71     (fetchpatch {
72       url = "https://gitlab.gnome.org/GNOME/mutter/-/commit/285a5a4d54ca83b136b787ce5ebf1d774f9499d5.patch";
73       hash = "sha256-/npUE3idMSTVlFptsDpZmGWjZ/d2gqruVlJKq4eF4xU=";
74     })
75   ];
77   mesonFlags = [
78     "-Degl_device=true"
79     "-Dprofiler=true"
80     "-Ddocs=true"
81   ];
83   propagatedBuildInputs = [
84     # required for pkg-config to detect magpie-clutter
85     json-glib
86     libXtst
87     libcap_ng
88     graphene
89   ];
91   nativeBuildInputs = [
92     desktop-file-utils
93     gettext
94     libxcvt
95     mesa # needed for gbm
96     meson
97     ninja
98     xvfb-run
99     pkg-config
100     python3
101     validatePkgConfig
102     wrapGAppsHook3
103     gi-docgen
104     xorgserver
105   ];
107   buildInputs = [
108     cairo
109     glib
110     gnome-desktop
111     gnome.gnome-settings-daemon
112     gobject-introspection
113     gsettings-desktop-schemas
114     gtk3
115     libcanberra
116     libdrm
117     libgudev
118     libinput
119     libstartup_notification
120     libwacom
121     libxkbcommon
122     libxkbfile
123     libXdamage
124     colord
125     lcms2
126     pango
127     pipewire
128     sysprof # for D-Bus interfaces
129     libsysprof-capture
130     xkeyboard_config
131   ];
133   postPatch = ''
134     patchShebangs src/backends/native/gen-default-modes.py
135     # Magpie does not install any .desktop files
136     substituteInPlace scripts/mesonPostInstall.sh --replace "update-desktop-database" "# update-desktop-database"
138     # https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3187
139     substituteInPlace meson.build \
140       --replace "dependency('sysprof-4')" "dependency('sysprof-6')"
141   '';
143   postFixup = ''
144     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
145     # TODO: Move this into a directory devhelp can find.
146     moveToOutput "share/magpie-0/doc" "$devdoc"
147   '';
149   # Install udev files into our own tree.
150   PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev";
152   separateDebugInfo = true;
154   passthru = {
155     libdir = "${finalAttrs.finalPackage}/lib/magpie-0";
157     tests = {
158       libdirExists = runCommand "magpie-libdir-exists" { } ''
159         if [[ ! -d ${finalAttrs.finalPackage.libdir} ]]; then
160           echo "passthru.libdir should contain a directory, “${finalAttrs.finalPackage.libdir}” is not one."
161           exit 1
162         fi
163         touch $out
164       '';
166       pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; };
167     };
169     updateScript = nix-update-script { };
170   };
172   meta = {
173     description = "Softish fork of Mutter 43.x";
174     homepage = "https://github.com/BuddiesOfBudgie/magpie";
175     changelog = "https://github.com/BuddiesOfBudgie/magpie/releases/tag/v${finalAttrs.version}";
176     license = lib.licenses.gpl2Plus;
177     maintainers = lib.teams.budgie.members;
178     platforms = lib.platforms.linux;
179     pkgConfigModules = [
180       "libmagpie-0"
181       "magpie-clutter-0"
182       "magpie-cogl-0"
183       "magpie-cogl-pango-0"
184     ];
185   };