btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / ge / gexiv2 / package.nix
blob7a0e61cbf2b05e277fd4be52393db2b0c6988149
1 { stdenv
2 , lib
3 , fetchurl
4 , meson
5 , mesonEmulatorHook
6 , ninja
7 , pkg-config
8 , exiv2
9 , glib
10 , gnome
11 , gobject-introspection
12 , vala
13 , gtk-doc
14 , docbook-xsl-nons
15 , docbook_xml_dtd_43
16 , python3
19 stdenv.mkDerivation rec {
20   pname = "gexiv2";
21   version = "0.14.3";
23   outputs = [ "out" "dev" "devdoc" ];
25   src = fetchurl {
26     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
27     sha256 = "IeZNLFbpszPUT+8/KkslZT2SLEGazZcvqW+raVIX4sg=";
28   };
30   nativeBuildInputs = [
31     meson
32     ninja
33     pkg-config
34     gobject-introspection
35     vala
36     gtk-doc
37     docbook-xsl-nons
38     docbook_xml_dtd_43
39     (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ]))
40   ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
41     mesonEmulatorHook
42   ];
44   buildInputs = [
45     glib
46   ];
48   propagatedBuildInputs = [
49     exiv2
50   ];
52   mesonFlags = [
53     "-Dgtk_doc=true"
54     "-Dtests=true"
55   ];
57   doCheck = true;
59   preCheck = let
60     libSuffix = if stdenv.hostPlatform.isDarwin then "2.dylib" else "so.2";
61   in ''
62     # Our gobject-introspection patches make the shared library paths absolute
63     # in the GIR files. When running unit tests, the library is not yet installed,
64     # though, so we need to replace the absolute path with a local one during build.
65     # We are using a symlink that will be overridden during installation.
66     mkdir -p $out/lib
67     ln -s $PWD/gexiv2/libgexiv2.${libSuffix} $out/lib/libgexiv2.${libSuffix}
68   '';
70   passthru = {
71     updateScript = gnome.updateScript {
72       packageName = pname;
73       versionPolicy = "odd-unstable";
74     };
75   };
77   meta = with lib; {
78     homepage = "https://gitlab.gnome.org/GNOME/gexiv2";
79     description = "GObject wrapper around the Exiv2 photo metadata library";
80     license = licenses.gpl2Plus;
81     platforms = platforms.unix;
82     maintainers = teams.gnome.members;
83   };