2019-06-27 08:16:46 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
2020-03-20 12:00:00 +00:00
|
|
|
, fetchpatch
|
2019-06-27 08:16:46 +01:00
|
|
|
, zlib
|
|
|
|
, expat
|
|
|
|
, cmake
|
|
|
|
, which
|
|
|
|
, libxml2
|
|
|
|
, python3
|
|
|
|
, gettext
|
2019-06-27 08:17:57 +01:00
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, libxslt
|
2019-06-27 08:16:46 +01:00
|
|
|
}:
|
2007-10-01 16:12:41 +01:00
|
|
|
|
2009-04-01 10:04:01 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-27 08:16:46 +01:00
|
|
|
pname = "exiv2";
|
2020-08-30 03:37:25 +01:00
|
|
|
version = "0.27.3";
|
2015-02-05 11:16:25 +00:00
|
|
|
|
2020-09-10 20:19:16 +01:00
|
|
|
outputs = [ "out" "dev" "doc" "man" ];
|
2020-09-05 00:12:08 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
src = fetchFromGitHub {
|
2018-08-04 18:38:22 +01:00
|
|
|
owner = "exiv2";
|
|
|
|
repo = "exiv2";
|
2019-08-25 17:49:35 +01:00
|
|
|
rev = "v${version}";
|
2020-08-30 03:37:25 +01:00
|
|
|
sha256 = "0d294yhcdw8ziybyd4rp5hzwknzik2sm0cz60ff7fljacv75bjpy";
|
2009-04-01 10:04:01 +01:00
|
|
|
};
|
2017-12-09 17:44:02 +00:00
|
|
|
|
2020-03-20 12:00:00 +00:00
|
|
|
patches = [
|
2020-08-30 03:37:25 +01:00
|
|
|
# Fix aarch64 build https://github.com/Exiv2/exiv2/pull/1271
|
2020-03-20 12:00:00 +00:00
|
|
|
(fetchpatch {
|
2020-08-30 03:37:25 +01:00
|
|
|
name = "cmake-fix-aarch64.patch";
|
|
|
|
url = "https://github.com/Exiv2/exiv2/commit/bbe0b70840cf28b7dd8c0b7e9bb1b741aeda2efd.patch";
|
|
|
|
sha256 = "13zw1mn0ag0jrz73hqjhdsh1img7jvj5yddip2k2sb5phy04rzfx";
|
2020-03-20 12:00:00 +00:00
|
|
|
})
|
|
|
|
|
2020-09-05 00:12:08 +01:00
|
|
|
# Use correct paths with multiple outputs
|
|
|
|
# https://github.com/Exiv2/exiv2/pull/1275
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Exiv2/exiv2/commit/48f2c9dbbacc0ef84c8ebf4cb1a603327f0b8750.patch";
|
|
|
|
sha256 = "vjB3+Ld4c/2LT7nq6uatYwfHTh+HeU5QFPFXuNLpIPA=";
|
|
|
|
})
|
2020-09-10 20:19:16 +01:00
|
|
|
# https://github.com/Exiv2/exiv2/pull/1294
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Exiv2/exiv2/commit/306c8a6fd4ddd70e76043ab255734720829a57e8.patch";
|
|
|
|
sha256 = "0D/omxYxBPGUu3uSErlf48dc6Ukwc2cEN9/J3e7a9eU=";
|
|
|
|
})
|
2019-06-27 08:17:57 +01:00
|
|
|
];
|
|
|
|
|
2018-08-04 18:38:22 +01:00
|
|
|
nativeBuildInputs = [
|
2019-06-27 08:16:46 +01:00
|
|
|
cmake
|
2019-06-27 08:17:57 +01:00
|
|
|
doxygen
|
2018-08-04 18:38:22 +01:00
|
|
|
gettext
|
2019-06-27 08:17:57 +01:00
|
|
|
graphviz
|
|
|
|
libxslt
|
2018-08-04 18:38:22 +01:00
|
|
|
];
|
2019-06-27 08:16:46 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
expat
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
libxml2.bin
|
|
|
|
python3
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
2020-09-05 00:12:08 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DEXIV2_ENABLE_NLS=ON"
|
|
|
|
"-DEXIV2_BUILD_DOC=ON"
|
|
|
|
];
|
|
|
|
|
2019-06-27 08:17:57 +01:00
|
|
|
buildFlags = [
|
2020-09-05 00:12:08 +01:00
|
|
|
"all"
|
2019-06-27 08:17:57 +01:00
|
|
|
"doc"
|
|
|
|
];
|
|
|
|
|
2019-08-26 11:02:45 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2019-06-27 08:16:46 +01:00
|
|
|
# Test setup found by inspecting ${src}/.travis/run.sh; problems without cmake.
|
|
|
|
checkTarget = "tests";
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs ../test/
|
|
|
|
mkdir ../test/tmp
|
|
|
|
|
2020-05-02 05:33:29 +01:00
|
|
|
${stdenv.lib.optionalString (stdenv.isAarch64 || stdenv.isAarch32) ''
|
|
|
|
# Fix tests on arm
|
|
|
|
# https://github.com/Exiv2/exiv2/issues/933
|
2019-06-27 08:16:46 +01:00
|
|
|
rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py
|
|
|
|
''}
|
2019-08-26 14:31:31 +01:00
|
|
|
|
|
|
|
${stdenv.lib.optionalString stdenv.isDarwin ''
|
2020-09-13 05:20:00 +01:00
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
|
2019-08-26 14:31:31 +01: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 05:20:00 +01:00
|
|
|
rm -f ../tests/bugfixes/github/test_issue_1046.py
|
2019-08-26 14:31:31 +01:00
|
|
|
''}
|
2019-06-27 08:16:46 +01:00
|
|
|
'';
|
|
|
|
|
2020-07-16 16:41:32 +01:00
|
|
|
# With CMake we have to enable samples or there won't be
|
2019-06-27 08:16:46 +01:00
|
|
|
# a tests target. This removes them.
|
|
|
|
postInstall = ''
|
|
|
|
( cd "$out/bin"
|
|
|
|
mv exiv2 .exiv2
|
|
|
|
rm *
|
|
|
|
mv .exiv2 exiv2
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2018-08-05 19:14:27 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.exiv2.org/";
|
2009-04-01 10:04:01 +01:00
|
|
|
description = "A library and command-line utility to manage image metadata";
|
2018-08-05 19:14:27 +01:00
|
|
|
platforms = platforms.all;
|
2018-08-06 11:04:52 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2020-09-05 00:12:08 +01:00
|
|
|
maintainers = [ ];
|
2009-04-01 10:04:01 +01:00
|
|
|
};
|
2007-10-01 16:12:41 +01:00
|
|
|
}
|