base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / xm / xml2 / package.nix
blobd469078c91dc07fb1d79cf99b8404d9cacea2786
1 { lib, stdenv, fetchurl, pkg-config, libxml2 }:
3 stdenv.mkDerivation rec {
4   pname = "xml2";
5   version = "0.5";
7   src = fetchurl {
8     url = "https://web.archive.org/web/20160427221603/http://download.ofb.net/gale/xml2-${version}.tar.gz";
9     sha256 = "01cps980m99y99cnmvydihga9zh3pvdsqag2fi1n6k2x7rfkl873";
10   };
12   nativeBuildInputs = [ pkg-config ];
13   buildInputs = [ libxml2 ];
15   doInstallCheck = true;
16   installCheckPhase = ''
17     runHook preInstallCheck
19     echo -n 'checking csv2 and 2csv...'
20     $out/bin/csv2 -f <<< $'a,b\n1,2' \
21       | $out/bin/2csv record a b \
22       | grep -qF '1,2'
23     echo ' ok'
25     echo -n 'checking xml2 and 2xml...'
26     $out/bin/xml2 <<< $'<a>abc</a>' \
27       | $out/bin/2xml \
28       | grep -qF '<a>abc</a>'
29     echo ' ok'
31     runHook postInstallCheck
32   '';
34   meta = with lib; {
35     homepage = "https://web.archive.org/web/20160515005047/http://dan.egnor.name:80/xml2";
36     description = "Tools for command line processing of XML, HTML, and CSV";
37     license = licenses.gpl2Plus;
38     platforms = platforms.all;
39     maintainers = [ maintainers.rycee ];
40   };