File tree Expand file tree Collapse file tree 4 files changed +64
-26
lines changed
Expand file tree Collapse file tree 4 files changed +64
-26
lines changed Original file line number Diff line number Diff line change 22 inputs = {
33 nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
44 flake-utils . url = "github:numtide/flake-utils" ;
5- treeppl . url = "github:elegios/ treeppl/nix-flake ?dir=misc/packaging" ;
5+ treeppl . url = "github:treeppl/treeppl ?dir=misc/packaging" ;
66 treeppl . inputs . nixpkgs . follows = "nixpkgs" ;
77 } ;
88
Original file line number Diff line number Diff line change 55
66let
77 distribution = "treeppl" ;
8- version = "0.1 " ;
8+ version = "0.2 " ;
99 os =
1010 if stdenv . hostPlatform . isLinux then "linux" else
1111 if stdenv . hostPlatform . isDarwin then "macosx_11_0" else
1515 if stdenv . hostPlatform . isAarch64 then "arm64" else
1616 throw "Unsupported host architecture" ;
1717 platform = "${ os } _${ architecture } " ;
18- selfcontainedDir = lib . strings . removeSuffix ".tar.gz" tpplc-tmp-tar-gz . name ;
18+ selfcontainedDir = tpplc-tmp-tar-gz . passthru . path ;
19+ tarName = tpplc-tmp-tar-gz . passthru . tarName ;
1920 args = {
2021 buildInputs = [ tinyxxd zip ] ;
2122 } ;
@@ -25,9 +26,10 @@ runCommand "treeppl-python" args ''
2526 # Actual content we care about
2627 cp -r ${ nix-gitignore . gitignoreSource [ ] ../.. } /treeppl .
2728 chmod +w treeppl
28- cp ${ tpplc-tmp-tar-gz } /${ tpplc-tmp-tar-gz . name } treeppl/${ tpplc-tmp-tar-gz . name }
29+ cp ${ tpplc-tmp-tar-gz } /${ tarName } treeppl/${ tarName }
2930 substituteInPlace treeppl/base.py \
30- --replace-fail "@DEPLOYED_BASENAME@" "${ selfcontainedDir } "
31+ --replace-fail "@DEPLOYED_BASENAME@" "${ selfcontainedDir } " \
32+ --replace-fail "@TARBALL_NAME@" "${ tarName } "
3133
3234 # Wheel stuff that's needed for it to be valid
3335 mkdir -p ${ distribution } -${ version } .dist-info
Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ def get_tpplc_binary():
3737 # differing deployed directories.
3838 tmp_dir = '/tmp'
3939 deployed_basename = "@DEPLOYED_BASENAME@" # This will be substituted by nix when building the wheel
40+ tarball_name = "@TARBALL_NAME@" # This will be substituted by nix when building the wheel
4041 tppl_dir_path = os .path .join (tmp_dir , deployed_basename )
4142 if not os .path .isdir (tppl_dir_path ):
42- with importlib .resources .path ('treeppl' , deployed_basename + ".tar.gz" ) as tarball :
43+ with importlib .resources .path ('treeppl' , tarball_name ) as tarball :
4344 with tarfile .open (tarball ) as tar :
4445 tar .extractall (tmp_dir )
4546 return os .path .join (tppl_dir_path , "tpplc" )
You can’t perform that action at this time.
0 commit comments