2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, doxygen
|
2023-10-09 19:29:22 +00:00
|
|
|
, gettext
|
2020-04-24 23:36:52 +00:00
|
|
|
, graphviz
|
|
|
|
, libxslt
|
2022-02-20 05:27:41 +00:00
|
|
|
, removeReferencesTo
|
2023-10-09 19:29:22 +00:00
|
|
|
, libiconv
|
|
|
|
, brotli
|
|
|
|
, expat
|
|
|
|
, inih
|
|
|
|
, zlib
|
|
|
|
, libxml2
|
|
|
|
, python3
|
|
|
|
, which
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "exiv2";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.28.0";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
outputs = [ "out" "lib" "dev" "doc" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "exiv2";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "exiv2";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-nEoLJWxSJmAonCbW/iZKjLrKMj09mwEaSUXUcUu8GxU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
doxygen
|
|
|
|
gettext
|
|
|
|
graphviz
|
|
|
|
libxslt
|
2022-02-20 05:27:41 +00:00
|
|
|
removeReferencesTo
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
|
|
|
];
|
2021-07-18 21:22:44 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-10-09 19:29:22 +00:00
|
|
|
brotli
|
2020-04-24 23:36:52 +00:00
|
|
|
expat
|
2023-10-09 19:29:22 +00:00
|
|
|
inih
|
2020-04-24 23:36:52 +00:00
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
libxml2.bin
|
|
|
|
python3
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DEXIV2_ENABLE_NLS=ON"
|
|
|
|
"-DEXIV2_BUILD_DOC=ON"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DEXIV2_ENABLE_BMFF=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildFlags = [
|
2020-09-25 04:45:31 +00:00
|
|
|
"all"
|
2020-04-24 23:36:52 +00:00
|
|
|
"doc"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# https://github.com/Exiv2/exiv2/issues/2762
|
|
|
|
doCheck = lib.versionOlder brotli.version "1.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs ../test/
|
|
|
|
mkdir ../test/tmp
|
2023-10-09 19:29:22 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isAarch32 ''
|
|
|
|
# Fix tests on arm
|
|
|
|
# https://github.com/Exiv2/exiv2/issues/933
|
|
|
|
rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
|
2022-08-12 12:06:08 +00:00
|
|
|
export LC_ALL=C
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# disable tests that requires loopback networking
|
|
|
|
substituteInPlace ../tests/bash_tests/testcases.py \
|
|
|
|
--replace "def io_test(self):" "def io_disabled(self):"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
preFixup = ''
|
|
|
|
remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 $static/lib/*.a
|
2022-03-05 16:20:37 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
disallowedReferences = [ stdenv.cc.cc ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# causes redefinition of _FORTIFY_SOURCE
|
|
|
|
hardeningDisable = [ "fortify3" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://exiv2.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library and command-line utility to manage image metadata";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2Plus;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ wegank ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|