17 stdenv.mkDerivation rec {
21 outputs = [ "out" "lib" "dev" "doc" "man" "static" ];
23 src = fetchFromGitHub {
27 sha256 = "sha256-5kdzw/YzpYldfHjUSPOzu3gW2TPgxt8Oxs0LZDFphgA=";
39 buildInputs = lib.optional stdenv.isDarwin libiconv;
41 propagatedBuildInputs = [
53 "-DEXIV2_ENABLE_NLS=ON"
54 "-DEXIV2_BUILD_DOC=ON"
55 "-DEXIV2_ENABLE_BMFF=ON"
65 # Test setup found by inspecting ${src}/.travis/run.sh; problems without cmake.
66 checkTarget = "tests";
69 patchShebangs ../test/
72 ${lib.optionalString stdenv.hostPlatform.isAarch ''
74 # https://github.com/Exiv2/exiv2/issues/933
75 rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py
78 ${lib.optionalString stdenv.isDarwin ''
79 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
80 # Removing tests depending on charset conversion
81 substituteInPlace ../test/Makefile --replace "conversions.sh" ""
82 rm -f ../tests/bugfixes/redmine/test_issue_460.py
83 rm -f ../tests/bugfixes/redmine/test_issue_662.py
84 rm -f ../tests/bugfixes/github/test_issue_1046.py
86 rm ../tests/bugfixes/redmine/test_issue_683.py
88 # disable tests that requires loopback networking
89 substituteInPlace ../tests/bash_tests/testcases.py \
90 --replace "def io_test(self):" "def io_disabled(self):"
92 '' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
96 # With CMake we have to enable samples or there won't be
97 # a tests target. This removes them.
106 mv $lib/lib/*.a $static/lib/
108 remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 $static/lib/*.a
112 substituteInPlace "$dev"/lib/cmake/exiv2/exiv2Config.cmake --replace \
113 "set(_IMPORT_PREFIX \"$out\")" \
114 "set(_IMPORT_PREFIX \"$static\")"
115 substituteInPlace "$dev"/lib/cmake/exiv2/exiv2Config-*.cmake --replace \
116 "$lib/lib/libexiv2-xmp.a" \
117 "$static/lib/libexiv2-xmp.a"
120 disallowedReferences = [ stdenv.cc.cc ];
123 homepage = "https://exiv2.org";
124 description = "A library and command-line utility to manage image metadata";
125 platforms = platforms.all;
126 license = licenses.gpl2Plus;
127 maintainers = with maintainers; [ wegank ];