Skip to content

Commit 85c7538

Browse files
authored
Update to version 0.2 (#11)
1 parent 0a7dd2c commit 85c7538

File tree

4 files changed

+64
-26
lines changed

4 files changed

+64
-26
lines changed

misc/packaging/flake.lock

Lines changed: 55 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

misc/packaging/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

misc/packaging/treeppl-python.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
let
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
@@ -15,7 +15,8 @@ let
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

treeppl/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)