This repository was archived by the owner on Oct 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +67
-4
lines changed Expand file tree Collapse file tree 4 files changed +67
-4
lines changed Original file line number Diff line number Diff line change 77env :
88 - EXAMPLE=awscli_and_requests
99 - EXAMPLE=empy
10+ - EXAMPLE=ldap
1011 - EXAMPLE=lektor
1112 - EXAMPLE=rss2email
1213 - EXAMPLE=scipy
Original file line number Diff line number Diff line change @@ -15,23 +15,26 @@ endif
1515all : \
1616 awscli_and_requests \
1717 empy \
18+ ldap \
1819 lektor \
1920 rss2email \
2021 scipy \
2122 sentry \
22- vulnix \
23- tornado
23+ tornado \
24+ vulnix
2425
2526clear : \
2627 awscli_and_requests-clear \
2728 empy-clear \
29+ ldap_clear \
2830 lektor-clear \
2931 pypi2nix-clear \
3032 rss2email-clear \
3133 scipy-clear \
3234 sentry-clear \
33- vulnix-clear \
34- tornado-clear
35+ tornado-clear \
36+ vulnix-clear
37+
3538
3639pypi2nix-clear :
3740 @rm -f ../result
@@ -238,3 +241,32 @@ tornado-clear:
238241 @rm -f tornado.nix
239242 @rm -f tornado_generated.nix
240243 @rm -f tornado_frozen.txt
244+
245+
246+ ldap : ldap.nix
247+ @echo " building and testing ldap..."
248+ @nix-build ldap.nix -o ldap -A interpreter --show-trace
249+ @./ldap/bin/python -c ' import ldap'
250+ @nix-shell ldap.nix -A interpreter --run " python -c 'import ldap'"
251+
252+ ldap.nix : ldap.txt $(PYPI2NIX )
253+ @echo " generating ldap.nix expressions ..."
254+ @$(PYPI2NIX ) \
255+ -v \
256+ --basename ldap \
257+ -N " NIX_CFLAGS_COMPILE=\" -I\$ ${pkgs.cyrus_sasl.dev} /include/sasl \$ $NIX_CFLAGS_COMPILE \" " \
258+ -E " openldap cyrus_sasl openssl" \
259+ --setup-requires " six packaging appdirs" \
260+ -r ldap.txt \
261+ -I $(NIX_PATH ) \
262+ -V " 2.7"
263+
264+ ldap.txt : ldap-clear
265+ @echo " python-ldap" > ldap.txt
266+
267+ ldap-clear :
268+ @rm -f ldap
269+ @rm -f ldap.txt
270+ @rm -f ldap.nix
271+ @rm -f ldap_generated.nix
272+ @rm -f ldap_frozen.txt
Original file line number Diff line number Diff line change 1+ { pkgs , python } :
2+
3+ self : super : {
4+
5+ "python-ldap" = python . overrideDerivation super . "python-ldap" ( old : {
6+ NIX_CFLAGS_COMPILE = "-I${ pkgs . cyrus_sasl . dev } /include/sasl" ;
7+ } ) ;
8+
9+ }
Original file line number Diff line number Diff line change @@ -27,6 +27,27 @@ def main(verbose,
2727 a user provided requirements.txt.
2828 """
2929
30+
31+ if extra_env :
32+ nix_instantiate = 'nix-instantiate'
33+ if os .path .exists (nix_shell ):
34+ nix_instantiate = \
35+ os .path .abspath (os .path .join (
36+ os .path .dirname (nix_path ),
37+ nix_instantiate
38+ ))
39+ command_env = '%s --eval --expr \' let pkgs = import <nixpkgs> {}; in "%s"\' ' % (
40+
41+ nix_instantiate ,
42+ extra_env .replace ('"' , '\\ "' )
43+ )
44+ returncode , output = pypi2nix .utils .cmd (command_env , verbose != 0 )
45+ if returncode != 0 :
46+ if verbose == 0 :
47+ click .echo (output )
48+ raise click .ClickException ('Failed to interpret extra_env' )
49+ extra_env = output .split ('\n ' )[- 2 ].strip ()[1 :- 1 ]
50+
3051 command = '{nix_shell} {nix_file} {options} {nix_path} --show-trace --pure --run exit' .format ( # noqa
3152 nix_shell = nix_shell ,
3253 nix_file = os .path .join (os .path .dirname (__file__ ), 'pip.nix' ),
You can’t perform that action at this time.
0 commit comments