1{ fetchFromGitHub, lib, stdenv, autoreconfHook, pkg-config, libxml2, gd, glib, getopt, libxslt, nix, bash}:
2
3stdenv.mkDerivation {
4 pname = "libnixxml";
5 version = "unstable-2020-06-25";
6
7 src = fetchFromGitHub {
8 owner = "svanderburg";
9 repo = "libnixxml";
10 rev = "54c04a5fdbc8661b2445a7527f499e0a77753a1a";
11 sha256 = "sha256-HKQnCkO1TDs1e0MDil0Roq4YRembqRHQvb7lK3GAftQ=";
12 };
13
14 prePatch = ''
15 # Remove broken test
16 substituteInPlace tests/draw/Makefile.am \
17 --replace "draw-wrong.sh" ""
18 rm tests/draw/draw-wrong.sh
19
20 # Fix bash path
21 substituteInPlace scripts/nixexpr2xml.in \
22 --replace "/bin/bash" "${bash}/bin/bash"
23 '';
24
25 preAutoreconf = ''
26 # Copied from bootstrap script
27 ln -s README.md README
28 mkdir -p config
29 '';
30
31 configureFlags = [ "--with-gd" "--with-glib" ];
32 CFLAGS = "-Wall";
33
34 strictDeps = true;
35 nativeBuildInputs = [
36 autoreconfHook
37 pkg-config
38 getopt
39 libxslt
40 ];
41 buildInputs = [
42 bash
43 libxml2
44 gd.dev
45 glib
46 nix
47 ];
48 nativeCheckInputs = [
49 nix
50 ];
51
52 doCheck = true;
53
54 meta = with lib; {
55 description = "XML-based Nix-friendly data integration library";
56 homepage = "https://github.com/svanderburg/libnixxml";
57 license = licenses.mit;
58 maintainers = with maintainers; [ tomberek ];
59 platforms = platforms.unix;
60 };
61}