nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 makeWrapper,
5 dev_only_shellcheck ? null,
6 fetchFromGitHub,
7
8 fzf,
9 coreutils,
10 libxml2,
11 libxslt,
12 jing-trang,
13 findutils,
14 gnugrep,
15 gnused,
16 docbook5,
17}:
18stdenv.mkDerivation rec {
19 pname = "xmloscopy";
20 version = "0.1.3";
21
22 nativeBuildInputs = [
23 makeWrapper
24 dev_only_shellcheck
25 ];
26
27 spath = lib.makeBinPath [
28 fzf
29 coreutils
30 libxml2
31 libxslt
32 jing-trang
33 findutils
34 gnugrep
35 gnused
36 ];
37
38 src = fetchFromGitHub {
39 owner = "grahamc";
40 repo = "xmloscopy";
41 rev = "v${version}";
42 sha256 = "06y5bckrmnq7b5ny2hfvlmdws910jw3xbw5nzy3bcpqsccqnjxrc";
43 };
44
45 installPhase = ''
46 sed -i "s/hard to say/v${version}/" ./xmloscopy
47 type -P shellcheck && shellcheck ./xmloscopy
48 chmod +x ./xmloscopy
49 patchShebangs ./xmloscopy
50 mkdir -p $out/bin
51 cp ./xmloscopy $out/bin/
52 wrapProgram $out/bin/xmloscopy \
53 --set RNG "${docbook5}/xml/rng/docbook/docbook.rng" \
54 --set PATH "${spath}"
55 '';
56
57 meta = {
58 description = "XML debugger";
59 mainProgram = "xmloscopy";
60 homepage = "https://github.com/grahamc/xmloscopy";
61 license = lib.licenses.mit;
62 platforms = lib.platforms.all;
63 };
64}