about summary refs log tree commit diff
path: root/pkgs/development/misc/resholve/default.nix
blob: c87f496792a4fc5131df5fd79f285c66be2d2865 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{ lib
, pkgs
, pkgsBuildHost
, ...
}:

let
  python27' = (pkgsBuildHost.python27.overrideAttrs (old:
    {
      # Overriding `meta.knownVulnerabilities` here, see #201859 for why it exists
      # In resholve case this should not be a security issue,
      # since it will only be used during build, not runtime
      meta = (old.meta or { }) // { knownVulnerabilities = [ ]; };
    }
  )).override {
    self = python27';
    pkgsBuildHost = pkgsBuildHost // { python27 = python27'; };
    # strip down that python version as much as possible
    openssl = null;
    bzip2 = null;
    readline = null;
    ncurses = null;
    gdbm = null;
    sqlite = null;
    libffi = null;
    rebuildBytecode = false;
    stripBytecode = true;
    strip2to3 = true;
    stripConfig = true;
    stripIdlelib = true;
    stripTests = true;
    stripLibs = [
      # directories
      "bsddb*"
      "curses"
      "compiler"
      "ensurepip"
      "hotshot"
      "lib-tk"
      "sqlite3"
      # files
      "aifc*"
      "antigravity*"
      "async*"
      "*audio*"
      "BaseHTTPServer*"
      "Bastion*"
      "binhex*"
      "bdb*"
      "CGIHTTPServer*"
      "cgitb*"
      "chunk*"
      "colorsys*"
      "dbhash*"
      "dircache*"
      "*dbm*"
      "ftplib*"
      "*hdr*"
      "imaplib*"
      "imputil*"
      "MimeWriter*"
      "mailbox*"
      "mhlib*"
      "mimify*"
      "multifile*"
      "netrc*"
      "nntplib*"
      "os2emxpath*"
      "pyclbr*"
      "pydoc*"
      "SimpleHTTPServer*"
      "sgmllib*"
      "smtp*"
      "ssl*"
      "sun*"
      "tabnanny*"
      "telnetlib*"
      "this*"
      "wave*"
      "webbrowser*"
      "whichdb*"
      "wsgiref*"
      "xdrlib*"
      "*XMLRPC*"
    ];
    enableOptimizations = false;
  };
  callPackage = lib.callPackageWith (pkgs // { python27 = python27'; });
  source = callPackage ./source.nix { };
  deps = callPackage ./deps.nix { };
in
rec {
  # resholve itself
  resholve = callPackage ./resholve.nix {
    inherit (source) rSrc version;
    inherit (deps.oil) oildev;
    inherit (deps) configargparse;
    inherit resholve-utils;
  };
  # funcs to validate and phrase invocations of resholve
  # and use those invocations to build packages
  resholve-utils = callPackage ./resholve-utils.nix {
    inherit resholve;
  };
}