nixpkgs/pkgs/by-name/xm/xmlstarlet/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

50 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchurl
, fetchpatch
, 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 = [
(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=";
})
];
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 = "Command line tool for manipulating and querying XML data";
homepage = "https://xmlstar.sourceforge.net/";
license = lib.licenses.mit;
mainProgram = "xmlstarlet";
platforms = lib.platforms.unix;
};
}