btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libshumate / package.nix
blob98a3ea533bef4a4f5249017abb726d628df57f4a
1 { lib
2 , stdenv
3 , fetchurl
4 , gi-docgen
5 , meson
6 , ninja
7 , pkg-config
8 , vala
9 , gobject-introspection
10 , gperf
11 , glib
12 , cairo
13 , sqlite
14 , libsoup_3
15 , gtk4
16 , libsysprof-capture
17 , json-glib
18 , protobufc
19 , xvfb-run
20 , gnome
23 stdenv.mkDerivation (finalAttrs: {
24   pname = "libshumate";
25   version = "1.3.0";
27   outputs = [ "out" "dev" "devdoc" ];
28   outputBin = "devdoc"; # demo app
30   src = fetchurl {
31     url = "mirror://gnome/sources/libshumate/${lib.versions.majorMinor finalAttrs.version}/libshumate-${finalAttrs.version}.tar.xz";
32     hash = "sha256-giem6Cgc3hIjKJT++Ddg1E+maznvAzxh7ZNKhsbcddQ=";
33   };
35   depsBuildBuild = [
36     # required to find native gi-docgen when cross compiling
37     pkg-config
38   ];
40   nativeBuildInputs = [
41     gi-docgen
42     meson
43     ninja
44     pkg-config
45     vala
46     gobject-introspection
47     gperf
48   ];
50   buildInputs = [
51     glib
52     cairo
53     sqlite
54     libsoup_3
55     gtk4
56     libsysprof-capture
57     json-glib
58     protobufc
59   ];
61   nativeCheckInputs = [
62     xvfb-run
63   ];
65   mesonFlags = [
66     "-Ddemos=true"
67   ];
69   doCheck = !stdenv.hostPlatform.isDarwin;
71   checkPhase = ''
72     runHook preCheck
74     env \
75       HOME="$TMPDIR" \
76       GTK_A11Y=none \
77       xvfb-run meson test --print-errorlogs
79     runHook postCheck
80   '';
82   postFixup = ''
83     # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
84     moveToOutput share/doc/libshumate-1.0 "$devdoc"
85   '';
87   passthru = {
88     updateScript = gnome.updateScript {
89       packageName = "libshumate";
90     };
91   };
93   meta = with lib; {
94     description = "GTK toolkit providing widgets for embedded maps";
95     mainProgram = "shumate-demo";
96     homepage = "https://gitlab.gnome.org/GNOME/libshumate";
97     license = licenses.lgpl21Plus;
98     maintainers = teams.gnome.members;
99     platforms = platforms.unix;
100   };