From bf434ca1a1601ac790c5bde57a7d3af5ebd48d2a Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Sun, 2 May 2021 22:04:10 +0200 Subject: [PATCH] libnixxml: fix build + support cross + enable tests Run the symlinking of the ./bootstrap script in the preAutoreconf hook. Remove the tests that are broken and enable testing again. Put correct dependencies in nativeBuildInputs vs buildInputs vs checkInputs to support cross-compilation. --- .../libraries/libnixxml/default.nix | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libnixxml/default.nix b/pkgs/development/libraries/libnixxml/default.nix index 40459dbca22a..62440487e0fd 100644 --- a/pkgs/development/libraries/libnixxml/default.nix +++ b/pkgs/development/libraries/libnixxml/default.nix @@ -11,17 +11,40 @@ stdenv.mkDerivation { sha256 = "sha256-HKQnCkO1TDs1e0MDil0Roq4YRembqRHQvb7lK3GAftQ="; }; - preConfigure = '' - ./bootstrap + postPatch = '' + # Remove broken test + substituteInPlace tests/draw/Makefile.am \ + --replace "draw-wrong.sh" "" + rm tests/draw/draw-wrong.sh + ''; + + preAutoreconf = '' + # Copied from bootstrap script + ln -s README.md README + mkdir -p config ''; configureFlags = [ "--with-gd" "--with-glib" ]; CFLAGS = "-Wall"; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ libxml2 gd.dev glib getopt libxslt nix ]; + strictDeps = true; + nativeBuildInputs = [ + autoreconfHook + pkg-config + getopt + libxslt + ]; + buildInputs = [ + libxml2 + gd.dev + glib + nix + ]; + checkInputs = [ + nix + ]; - doCheck = false; + doCheck = true; meta = with lib; { description = "XML-based Nix-friendly data integration library";