depot/third_party/nixpkgs/pkgs/tools/text/xml/xmlstarlet/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

45 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchurl
, autoreconfHook
, pkg-config
, libxml2
, libxslt
}:
stdenv.mkDerivation rec {
pname = "xmlstarlet";
version = "1.6.1";
src = fetchurl {
url = "mirror://sourceforge/xmlstar/xmlstarlet-${version}.tar.gz";
sha256 = "1jp737nvfcf6wyb54fla868yrr39kcbijijmjpyk4lrpyg23in0m";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libxml2 libxslt ];
patches = [
# Fixes an incompatible function pointer error with clang 16.
./fix-incompatible-function-pointer.patch
];
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)
'';
postInstall = ''
ln -s xml $out/bin/xmlstarlet
'';
meta = {
description = "A command line tool for manipulating and querying XML data";
homepage = "https://xmlstar.sourceforge.net/";
license = lib.licenses.mit;
mainProgram = "xmlstarlet";
platforms = lib.platforms.unix;
};
}