1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

exiv2: 0.27.6 -> 0.28.0

This commit is contained in:
Weijia Wang 2023-09-05 00:18:18 +02:00
parent ed66c817ab
commit 62c6d285c8

View file

@ -1,30 +1,33 @@
{ lib, stdenv
{ lib
, stdenv
, fetchFromGitHub
, zlib
, expat
, cmake
, which
, libxml2
, python3
, gettext
, doxygen
, gettext
, graphviz
, libxslt
, libiconv
, removeReferencesTo
, libiconv
, brotli
, expat
, inih
, zlib
, libxml2
, python3
, which
}:
stdenv.mkDerivation rec {
pname = "exiv2";
version = "0.27.7";
version = "0.28.0";
outputs = [ "out" "lib" "dev" "doc" "man" "static" ];
outputs = [ "out" "lib" "dev" "doc" "man" ];
src = fetchFromGitHub {
owner = "exiv2";
repo = "exiv2";
repo = "exiv2";
rev = "v${version}";
sha256 = "sha256-xytVGrLDS22n2/yydFTT6CsDESmhO9mFbPGX4yk+b6g=";
hash = "sha256-nEoLJWxSJmAonCbW/iZKjLrKMj09mwEaSUXUcUu8GxU=";
};
nativeBuildInputs = [
@ -36,10 +39,14 @@ stdenv.mkDerivation rec {
removeReferencesTo
];
buildInputs = lib.optional stdenv.isDarwin libiconv;
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
];
propagatedBuildInputs = [
brotli
expat
inih
zlib
];
@ -60,68 +67,34 @@ stdenv.mkDerivation rec {
"doc"
];
doCheck = true;
# https://github.com/Exiv2/exiv2/issues/2762
doCheck = lib.versionOlder brotli.version "1.1.0";
preCheck = ''
patchShebangs ../test/
mkdir ../test/tmp
${lib.optionalString stdenv.hostPlatform.isAarch ''
# 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
# 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
rm -f ../tests/bugfixes/github/test_issue_1046.py
rm ../tests/bugfixes/redmine/test_issue_683.py
# disable tests that requires loopback networking
substituteInPlace ../tests/bash_tests/testcases.py \
--replace "def io_test(self):" "def io_disabled(self):"
''}
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
'' + 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
export LC_ALL=C
'' + lib.optionalString stdenv.isAarch32 ''
# these tests are fixed in 0.28, remove when updating to 0.28
rm -f ../tests/bugfixes/github/test_issue_1503.py
rm -f ../tests/bugfixes/github/test_pr1475_AVIF.py
rm -f ../tests/bugfixes/github/test_pr1475_HEIC.py
rm -f ../tests/bugfixes/github/test_pr1475_HIF.py
# disable tests that requires loopback networking
substituteInPlace ../tests/bash_tests/testcases.py \
--replace "def io_test(self):" "def io_disabled(self):"
'';
# With CMake we have to enable samples or there won't be
# a tests target. This removes them.
postInstall = ''
( cd "$out/bin"
mv exiv2 .exiv2
rm *
mv .exiv2 exiv2
)
mkdir -p $static/lib
mv $lib/lib/*.a $static/lib/
preFixup = ''
remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 $static/lib/*.a
'';
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"
'';
disallowedReferences = [ stdenv.cc.cc ];
# causes redefinition of _FORTIFY_SOURCE
hardeningDisable = [ "fortify3" ];
meta = with lib; {
homepage = "https://exiv2.org";
description = "A library and command-line utility to manage image metadata";