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
17}:
18
19stdenv.mkDerivation rec {
20 pname = "gexiv2";
21 version = "0.14.3";
22
23 outputs = [ "out" "dev" "devdoc" ];
24
25 src = fetchurl {
26 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
27 sha256 = "IeZNLFbpszPUT+8/KkslZT2SLEGazZcvqW+raVIX4sg=";
28 };
29
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 ];
43
44 buildInputs = [
45 glib
46 ];
47
48 propagatedBuildInputs = [
49 exiv2
50 ];
51
52 mesonFlags = [
53 "-Dgtk_doc=true"
54 "-Dtests=true"
55 ];
56
57 doCheck = true;
58
59 preCheck = let
60 libSuffix = if stdenv.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 '';
69
70 passthru = {
71 updateScript = gnome.updateScript {
72 packageName = pname;
73 versionPolicy = "odd-unstable";
74 };
75 };
76
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 };
84}