2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2019-06-27 07:16:46 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, zlib
|
|
|
|
, expat
|
|
|
|
, cmake
|
|
|
|
, which
|
|
|
|
, libxml2
|
|
|
|
, python3
|
|
|
|
, gettext
|
2019-06-27 07:17:57 +00:00
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, libxslt
|
2021-07-17 12:04:41 +00:00
|
|
|
, libiconv
|
2021-07-28 19:06:16 +00:00
|
|
|
, removeReferencesTo
|
2019-06-27 07:16:46 +00:00
|
|
|
}:
|
2007-10-01 15:12:41 +00:00
|
|
|
|
2009-04-01 09:04:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-27 07:16:46 +00:00
|
|
|
pname = "exiv2";
|
2023-05-20 13:39:35 +00:00
|
|
|
version = "0.27.7";
|
2015-02-05 11:16:25 +00:00
|
|
|
|
2021-07-28 19:06:16 +00:00
|
|
|
outputs = [ "out" "lib" "dev" "doc" "man" "static" ];
|
2020-09-04 23:12:08 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
src = fetchFromGitHub {
|
2018-08-04 17:38:22 +00:00
|
|
|
owner = "exiv2";
|
|
|
|
repo = "exiv2";
|
2019-08-25 16:49:35 +00:00
|
|
|
rev = "v${version}";
|
2023-05-20 13:39:35 +00:00
|
|
|
sha256 = "sha256-xytVGrLDS22n2/yydFTT6CsDESmhO9mFbPGX4yk+b6g=";
|
2009-04-01 09:04:01 +00:00
|
|
|
};
|
2017-12-09 17:44:02 +00:00
|
|
|
|
2018-08-04 17:38:22 +00:00
|
|
|
nativeBuildInputs = [
|
2019-06-27 07:16:46 +00:00
|
|
|
cmake
|
2019-06-27 07:17:57 +00:00
|
|
|
doxygen
|
2018-08-04 17:38:22 +00:00
|
|
|
gettext
|
2019-06-27 07:17:57 +00:00
|
|
|
graphviz
|
|
|
|
libxslt
|
2021-07-28 19:06:16 +00:00
|
|
|
removeReferencesTo
|
2018-08-04 17:38:22 +00:00
|
|
|
];
|
2019-06-27 07:16:46 +00:00
|
|
|
|
2021-07-17 12:04:41 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin libiconv;
|
|
|
|
|
2019-06-27 07:16:46 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
expat
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2019-06-27 07:16:46 +00:00
|
|
|
libxml2.bin
|
|
|
|
python3
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
2020-09-04 23:12:08 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DEXIV2_ENABLE_NLS=ON"
|
|
|
|
"-DEXIV2_BUILD_DOC=ON"
|
2022-01-01 21:38:05 +00:00
|
|
|
"-DEXIV2_ENABLE_BMFF=ON"
|
2020-09-04 23:12:08 +00:00
|
|
|
];
|
|
|
|
|
2019-06-27 07:17:57 +00:00
|
|
|
buildFlags = [
|
2020-09-04 23:12:08 +00:00
|
|
|
"all"
|
2019-06-27 07:17:57 +00:00
|
|
|
"doc"
|
|
|
|
];
|
|
|
|
|
2019-08-26 10:02:45 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2019-06-27 07:16:46 +00:00
|
|
|
preCheck = ''
|
|
|
|
patchShebangs ../test/
|
|
|
|
mkdir ../test/tmp
|
|
|
|
|
2022-07-30 16:18:27 +00:00
|
|
|
${lib.optionalString stdenv.hostPlatform.isAarch ''
|
2020-05-02 04:33:29 +00:00
|
|
|
# Fix tests on arm
|
|
|
|
# https://github.com/Exiv2/exiv2/issues/933
|
2019-06-27 07:16:46 +00:00
|
|
|
rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py
|
|
|
|
''}
|
2019-08-26 13:31:31 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
${lib.optionalString stdenv.isDarwin ''
|
2020-09-13 04:20:00 +00:00
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
|
2019-08-26 13:31:31 +00:00
|
|
|
# Removing tests depending on charset conversion
|
|
|
|
substituteInPlace ../test/Makefile --replace "conversions.sh" ""
|
|
|
|
rm -f ../tests/bugfixes/redmine/test_issue_460.py
|
|
|
|
rm -f ../tests/bugfixes/redmine/test_issue_662.py
|
2020-09-13 04:20:00 +00:00
|
|
|
rm -f ../tests/bugfixes/github/test_issue_1046.py
|
2021-12-21 18:20:47 +00:00
|
|
|
|
2022-10-09 16:15:09 +00:00
|
|
|
rm ../tests/bugfixes/redmine/test_issue_683.py
|
2022-10-09 07:55:34 +00:00
|
|
|
|
2021-12-21 18:20:47 +00:00
|
|
|
# disable tests that requires loopback networking
|
|
|
|
substituteInPlace ../tests/bash_tests/testcases.py \
|
|
|
|
--replace "def io_test(self):" "def io_disabled(self):"
|
2019-08-26 13:31:31 +00:00
|
|
|
''}
|
2022-08-02 20:51:04 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
export LC_ALL=C
|
2019-06-27 07:16:46 +00:00
|
|
|
'';
|
|
|
|
|
2020-07-16 15:41:32 +00:00
|
|
|
# With CMake we have to enable samples or there won't be
|
2019-06-27 07:16:46 +00:00
|
|
|
# a tests target. This removes them.
|
|
|
|
postInstall = ''
|
|
|
|
( cd "$out/bin"
|
|
|
|
mv exiv2 .exiv2
|
|
|
|
rm *
|
|
|
|
mv .exiv2 exiv2
|
|
|
|
)
|
2021-07-28 19:06:16 +00:00
|
|
|
|
|
|
|
mkdir -p $static/lib
|
|
|
|
mv $lib/lib/*.a $static/lib/
|
|
|
|
|
|
|
|
remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 $static/lib/*.a
|
2019-06-27 07:16:46 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 16:56:01 +00:00
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace "$dev"/lib/cmake/exiv2/exiv2Config.cmake --replace \
|
|
|
|
"set(_IMPORT_PREFIX \"$out\")" \
|
|
|
|
"set(_IMPORT_PREFIX \"$static\")"
|
|
|
|
substituteInPlace "$dev"/lib/cmake/exiv2/exiv2Config-*.cmake --replace \
|
|
|
|
"$lib/lib/libexiv2-xmp.a" \
|
|
|
|
"$static/lib/libexiv2-xmp.a"
|
|
|
|
'';
|
|
|
|
|
2021-07-28 19:06:16 +00:00
|
|
|
disallowedReferences = [ stdenv.cc.cc ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2022-08-07 21:50:47 +00:00
|
|
|
homepage = "https://exiv2.org";
|
2009-04-01 09:04:01 +00:00
|
|
|
description = "A library and command-line utility to manage image metadata";
|
2018-08-05 18:14:27 +00:00
|
|
|
platforms = platforms.all;
|
2018-08-06 10:04:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2022-08-02 20:51:04 +00:00
|
|
|
maintainers = with maintainers; [ wegank ];
|
2009-04-01 09:04:01 +00:00
|
|
|
};
|
2007-10-01 15:12:41 +00:00
|
|
|
}
|