2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2024-01-13 08:15:51 +00:00
|
|
|
, fetchpatch
|
2024-01-02 11:29:13 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "xmlstarlet";
|
|
|
|
version = "1.6.1";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-09-18 10:52:07 +00:00
|
|
|
url = "mirror://sourceforge/xmlstar/xmlstarlet-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1jp737nvfcf6wyb54fla868yrr39kcbijijmjpyk4lrpyg23in0m";
|
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libxml2 libxslt ];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
patches = [
|
2024-01-13 08:15:51 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "0001-Fix-build-with-libxml2-2.12.patch";
|
|
|
|
url = "https://sourceforge.net/p/xmlstar/patches/_discuss/thread/890e29655a/66ca/attachment/0001-Fix-build-with-libxml2-2.12.patch";
|
|
|
|
hash = "sha256-XEk7aFOdrzdec1j2ffERJQbLH0AUNJA52QwA9jf4XWA=";
|
|
|
|
})
|
2023-08-10 07:59:29 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export LIBXSLT_PREFIX=${libxslt.dev}
|
|
|
|
export LIBXML_PREFIX=${libxml2.dev}
|
|
|
|
export LIBXSLT_LIBS=$($PKG_CONFIG --libs libxslt libexslt)
|
|
|
|
export LIBXML_LIBS=$($PKG_CONFIG --libs libxml-2.0)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s xml $out/bin/xmlstarlet
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A command line tool for manipulating and querying XML data";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://xmlstar.sourceforge.net/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "xmlstarlet";
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|