nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 callPackage,
4 python27,
5 fetchFromGitHub,
6 installShellFiles,
7 rSrc,
8 version,
9 oildev,
10 configargparse,
11 gawk,
12 binlore,
13 resholve,
14 resholve-utils,
15}:
16
17let
18 sedparse = python27.pkgs.buildPythonPackage {
19 pname = "sedparse";
20 version = "0.1.2";
21 format = "setuptools";
22 src = fetchFromGitHub {
23 owner = "aureliojargas";
24 repo = "sedparse";
25 rev = "0.1.2";
26 hash = "sha256-Q17A/oJ3GZbdSK55hPaMdw85g43WhTW9tuAuJtDfHHU=";
27 };
28 };
29
30in
31python27.pkgs.buildPythonApplication {
32 pname = "resholve";
33 inherit version;
34 src = rSrc;
35
36 nativeBuildInputs = [ installShellFiles ];
37
38 propagatedBuildInputs = [
39 oildev
40 configargparse
41 sedparse
42 ];
43
44 makeWrapperArgs = [
45 "--prefix"
46 "PATH"
47 ":"
48 (lib.makeBinPath [ gawk ])
49 ];
50
51 postPatch = ''
52 for file in setup.cfg _resholve/version.py; do
53 substituteInPlace $file --subst-var-by version ${version}
54 done
55 '';
56
57 postInstall = ''
58 installManPage resholve.1
59 '';
60
61 # Do not propagate Python; may be obsoleted by nixos/nixpkgs#102613
62 # for context on why, see abathur/resholve#20
63 postFixup = ''
64 rm $out/nix-support/propagated-build-inputs
65 '';
66
67 passthru = {
68 inherit (resholve-utils)
69 mkDerivation
70 phraseSolution
71 writeScript
72 writeScriptBin
73 ;
74 tests = callPackage ./test.nix {
75 inherit
76 rSrc
77 binlore
78 python27
79 resholve
80 ;
81 };
82 };
83
84 __structuredAttrs = true;
85
86 meta = {
87 description = "Resolve external shell-script dependencies";
88 homepage = "https://github.com/abathur/resholve";
89 changelog = "https://github.com/abathur/resholve/blob/v${version}/CHANGELOG.md";
90 license = with lib.licenses; [ mit ];
91 maintainers = with lib.maintainers; [ abathur ];
92 platforms = lib.platforms.all;
93 knownVulnerabilities = [
94 ''
95 resholve depends on python27 (EOL). While it's safe to
96 run on trusted input in the build sandbox, you should
97 avoid running it on untrusted input.
98 ''
99 ];
100 };
101}