nixpkgs/pkgs/development/libraries/exiv2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

113 lines
2.2 KiB
Nix
Raw Normal View History

2023-09-04 22:18:18 +00:00
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, doxygen
2023-09-04 22:18:18 +00:00
, gettext
, graphviz
, libxslt
, removeReferencesTo
2023-09-04 22:18:18 +00:00
, libiconv
, brotli
, expat
, inih
, zlib
, libxml2
, python3
, which
}:
stdenv.mkDerivation rec {
pname = "exiv2";
version = "0.28.1";
2023-09-04 22:18:18 +00:00
outputs = [ "out" "lib" "dev" "doc" "man" ];
2019-08-13 21:52:01 +00:00
src = fetchFromGitHub {
owner = "exiv2";
2023-09-04 22:18:18 +00:00
repo = "exiv2";
2019-08-25 16:49:35 +00:00
rev = "v${version}";
hash = "sha256-Jim8vYWyCa16LAJ1GuP8cCzhXIc2ouo6hVsHg3UQbdg=";
};
patches = [
(fetchpatch {
url = "https://github.com/Exiv2/exiv2/commit/c351c7cce317571934abf693055779a59df30d6e.patch";
hash = "sha256-fWJT4IUBrAELl6ku0M1iTzGFX74le8Z0UzTJLU/gYls=";
})
];
nativeBuildInputs = [
cmake
doxygen
gettext
graphviz
libxslt
removeReferencesTo
];
2023-09-04 22:18:18 +00:00
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
];
propagatedBuildInputs = [
2023-09-04 22:18:18 +00:00
brotli
expat
2023-09-04 22:18:18 +00:00
inih
zlib
];
nativeCheckInputs = [
libxml2.bin
python3
which
];
cmakeFlags = [
"-DEXIV2_ENABLE_NLS=ON"
"-DEXIV2_BUILD_DOC=ON"
2022-01-01 21:38:05 +00:00
"-DEXIV2_ENABLE_BMFF=ON"
];
buildFlags = [
"all"
"doc"
];
doCheck = true;
preCheck = ''
patchShebangs ../test/
mkdir ../test/tmp
2023-09-04 22:18:18 +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-02 20:51:04 +00:00
export LC_ALL=C
2023-09-04 22:18:18 +00:00
# disable tests that requires loopback networking
substituteInPlace ../tests/bash_tests/testcases.py \
--replace "def io_test(self):" "def io_disabled(self):"
'';
2023-09-04 22:18:18 +00:00
preFixup = ''
remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 $static/lib/*.a
'';
disallowedReferences = [ stdenv.cc.cc ];
2023-09-04 22:18:18 +00:00
# causes redefinition of _FORTIFY_SOURCE
hardeningDisable = [ "fortify3" ];
meta = with lib; {
2022-08-07 21:50:47 +00:00
homepage = "https://exiv2.org";
description = "A library and command-line utility to manage image metadata";
2018-08-05 18:14:27 +00:00
platforms = platforms.all;
license = licenses.gpl2Plus;
2022-08-02 20:51:04 +00:00
maintainers = with maintainers; [ wegank ];
};
}