nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, pkg-config, libxml2, libxslt }:
2
3stdenv.mkDerivation rec {
4 pname = "xmlstarlet";
5 version = "1.6.1";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/xmlstar/xmlstarlet-${version}.tar.gz";
9 sha256 = "1jp737nvfcf6wyb54fla868yrr39kcbijijmjpyk4lrpyg23in0m";
10 };
11
12 nativeBuildInputs = [ pkg-config ];
13 buildInputs = [ libxml2 libxslt ];
14
15 preConfigure =
16 ''
17 export LIBXSLT_PREFIX=${libxslt.dev}
18 export LIBXML_PREFIX=${libxml2.dev}
19 export LIBXSLT_LIBS=$(pkg-config --libs libxslt libexslt)
20 export LIBXML_LIBS=$(pkg-config --libs libxml-2.0)
21 '';
22
23 postInstall =
24 ''
25 ln -s xml $out/bin/xmlstarlet
26 '';
27
28 meta = {
29 description = "A command line tool for manipulating and querying XML data";
30 homepage = "https://xmlstar.sourceforge.net/";
31 license = lib.licenses.mit;
32 platforms = lib.platforms.unix;
33 };
34}