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