Generate tarball for com.termux

It supports symlinks (yay)
This commit is contained in:
Kovacsics Robert 2023-03-12 06:44:18 +00:00
parent 5d88ff2519
commit 27867c79a7
4 changed files with 4 additions and 13 deletions

View file

@ -43,7 +43,7 @@ with lib;
config = { config = {
build.installationDir = "/data/data/com.termux.nix/files/usr"; build.installationDir = "/data/data/com.termux/files/usr";
}; };

View file

@ -91,7 +91,7 @@ in
user = { user = {
group = "nix-on-droid"; group = "nix-on-droid";
home = "/data/data/com.termux.nix/files/home"; home = "/data/data/com.termux/files/home";
userName = "nix-on-droid"; userName = "nix-on-droid";
}; };

View file

@ -1,6 +1,6 @@
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE. # Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
{ lib, runCommand, zip, bootstrap, targetSystem }: { lib, runCommand, gnutar, bootstrap, targetSystem }:
let let
arch = lib.strings.removeSuffix "-linux" targetSystem; arch = lib.strings.removeSuffix "-linux" targetSystem;
@ -8,5 +8,5 @@ in
runCommand "bootstrap-zip" { } '' runCommand "bootstrap-zip" { } ''
mkdir $out mkdir $out
cd ${bootstrap} cd ${bootstrap}
${zip}/bin/zip -q -9 -r $out/bootstrap-${arch} ./* ./.l2s ${gnutar}/bin/tar czf $out/bootstrap-${arch}.tar.gz ./* ./.l2s
'' ''

View file

@ -22,13 +22,4 @@ runCommand "bootstrap" { } ''
cp --dereference --recursive $out/etc/static $out/etc/.static.tmp cp --dereference --recursive $out/etc/static $out/etc/.static.tmp
rm $out/etc/static rm $out/etc/static
mv $out/etc/.static.tmp $out/etc/static mv $out/etc/.static.tmp $out/etc/static
find $out -executable -type f | sed s@^$out/@@ > $out/EXECUTABLES.txt
find $out -type l | while read -r LINK; do
LNK=''${LINK#$out/}
TGT=$(readlink "$LINK")
echo "$TGT$LNK" >> $out/SYMLINKS.txt
rm "$LINK"
done
'' ''