@@ -13,49 +13,54 @@ export default async function (
1313 await env_include ( "llvm.org" ) ;
1414 }
1515
16- if ( version . lt ( new SemVer ( "3.12" ) ) ) {
17- inreplace (
18- Path . cwd ( ) . join ( "setup.py" ) ,
19- / s y s t e m _ l i b _ d i r s = .* / g,
20- `system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")` ,
21- ) ;
22- inreplace (
23- Path . cwd ( ) . join ( "setup.py" ) ,
24- / s y s t e m _ i n c l u d e _ d i r s = .* / g,
25- `system_include_dirs = os.getenv("CPATH").split(":")` ,
26- ) ;
27- }
16+ if ( Deno . build . os != 'windows' ) {
17+ if ( version . lt ( new SemVer ( "3.12" ) ) ) {
18+ inreplace (
19+ Path . cwd ( ) . join ( "setup.py" ) ,
20+ / s y s t e m _ l i b _ d i r s = .* / g,
21+ `system_lib_dirs = os.getenv("LIBRARY_PATH").split(":")` ,
22+ ) ;
23+ inreplace (
24+ Path . cwd ( ) . join ( "setup.py" ) ,
25+ / s y s t e m _ i n c l u d e _ d i r s = .* / g,
26+ `system_include_dirs = os.getenv("CPATH").split(":")` ,
27+ ) ;
28+ }
2829
29- //NOTE clang required for --enable-optimizations
30- //TODO --enable-bolt reduces end filesize (requires llvm-bolt)
31- run `./configure
32- --prefix=${ prefix }
33- --with-openssl=${ deps [ "openssl.org" ] . prefix }
34- --with-system-expat
35- --with-system-ffi
36- --with-system-libmpdec
37- --enable-shared
38- --enable-optimizations
39- --with-lto=full
40- --without-ensurepip
41- --disable-test-modules
42- --enable-loadable-sqlite-extensions
43- --with-configdir=/etc/python
44- CC=clang
45- ` ;
46- run `make --jobs ${ navigator . hardwareConcurrency } ` ;
47- run `make install` ;
30+ //NOTE clang required for --enable-optimizations
31+ //TODO --enable-bolt reduces end filesize (requires llvm-bolt)
32+ run `./configure
33+ --prefix=${ prefix }
34+ --with-openssl=${ deps [ "openssl.org" ] . prefix }
35+ --with-system-expat
36+ --with-system-ffi
37+ --with-system-libmpdec
38+ --enable-shared
39+ --enable-optimizations
40+ --with-lto=full
41+ --without-ensurepip
42+ --disable-test-modules
43+ --enable-loadable-sqlite-extensions
44+ --with-configdir=/etc/python
45+ CC=clang
46+ ` ;
47+ run `make --jobs ${ navigator . hardwareConcurrency } ` ;
48+ run `make install` ;
4849
49- props . join ( "sitecustomize.py" ) . cp ( { into : prefix . lib . join ( `python${ version . marketing } ` ) } ) ;
50+ props . join ( "sitecustomize.py" ) . cp ( { into : prefix . lib . join ( `python${ version . marketing } ` ) } ) ;
5051
51- // provide unversioned binaries
52- const v = `${ version . major } .${ version . minor } ` ;
53- prefix . join ( "bin/python" ) . ln ( "s" , { target : `python${ v } ` } ) ;
54- prefix . join ( "bin/pydoc" ) . ln ( "s" , { target : `pydoc${ v } ` } ) ;
55- prefix . join ( "bin/python-config" ) . ln ( "s" , { target : `python${ v } -config` } ) ;
52+ // provide unversioned binaries
53+ const v = `${ version . major } .${ version . minor } ` ;
54+ prefix . join ( "bin/python" ) . ln ( "s" , { target : `python${ v } ` } ) ;
55+ prefix . join ( "bin/pydoc" ) . ln ( "s" , { target : `pydoc${ v } ` } ) ;
56+ prefix . join ( "bin/python-config" ) . ln ( "s" , { target : `python${ v } -config` } ) ;
5657
57- // idle is prehistoric and nobody wants it
58- prefix . join ( `bin/idle${ v } ` ) . rm ( ) ;
59- prefix . join ( `bin/idle${ version . major } ` ) . rm ( ) ;
60- prefix . join ( `lib/python${ v } /idlelib` ) . rm ( "rf" ) ;
58+ // idle is prehistoric and nobody wants it
59+ prefix . join ( `bin/idle${ v } ` ) . rm ( ) ;
60+ prefix . join ( `bin/idle${ version . major } ` ) . rm ( ) ;
61+ prefix . join ( `lib/python${ v } /idlelib` ) . rm ( "rf" ) ;
62+ } else {
63+ env_include ( "nasm.us" ) ;
64+ run `PCBuild\build.bat -p x64`
65+ }
6166}
0 commit comments