From 0a74e0b66e49731b6ac1ba668846aa3f339c2724 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 17 Apr 2022 12:07:41 +0100 Subject: libarchive: enable tests --- pkgs/development/libraries/libarchive/default.nix | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix index 240371917f1..aabb471d9e3 100644 --- a/pkgs/development/libraries/libarchive/default.nix +++ b/pkgs/development/libraries/libarchive/default.nix @@ -37,6 +37,22 @@ stdenv.mkDerivation rec { hash = "sha256-G4wL5DDbX0FqaA4cnOlVLZ25ObN8dNsRtxyas29tpDA="; }; + postPatch = '' + substituteInPlace Makefile.am --replace '/bin/pwd' "$(type -P pwd)" + + declare -a skip_tests=( + # test won't work in nix sandbox + 'test_write_disk_perms' + # can't be sure builder will have sparse-capable fs + 'test_sparse_basic' + ) + + for test_name in "''${skip_tests[@]}" ; do + sed -i "/$test_name/d" Makefile.am + rm "libarchive/test/$test_name.c" + done + ''; + outputs = [ "out" "lib" "dev" ]; nativeBuildInputs = [ @@ -60,17 +76,12 @@ stdenv.mkDerivation rec { configureFlags = lib.optional (!xarSupport) "--without-xml2"; - postPatch = '' - substituteInPlace Makefile.am --replace '/bin/pwd' 'pwd' - ''; - preBuild = lib.optionalString stdenv.isCygwin '' echo "#include " >> config.h ''; - # 484: test_write_disk_perms FAIL - # TODO: how to disable it? Should it be reported upstream? - doCheck = false; + # https://github.com/libarchive/libarchive/issues/1475 + doCheck = !stdenv.hostPlatform.isMusl; preFixup = '' sed -i $lib/lib/libarchive.la \ -- cgit 1.4.1