mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-09 12:06:06 +01:00
WIP: compile proot dynamically with non-prebuilt SDK
This commit is contained in:
parent
a3f92c0e0d
commit
dda3bd3ef0
4 changed files with 28 additions and 15 deletions
|
|
@ -82,9 +82,8 @@ in
|
|||
environment.files = {
|
||||
inherit login loginInner;
|
||||
|
||||
prootStatic = "/nix/store/fmkdds5jp3ddx8mkb63fshkiiangw4ny-proot-termux-aarch64-unknown-linux-android-unstable-2021-11-21";
|
||||
prootStatic = "/nix/store/y19q9ax61119i0h2b2yyjdw9qy8qp25h-proot-termux-aarch64-unknown-linux-android-unstable-2021-11-21";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ let
|
|||
|
||||
# that one is cool because it could make its way on-device one day,
|
||||
# but it currently isn't static-friendly:
|
||||
# sdkVer = "30";
|
||||
# libc = "bionic";
|
||||
# useAndroidPrebuilt = false;
|
||||
# useLLVM = true;
|
||||
sdkVer = "30";
|
||||
libc = "bionic";
|
||||
useAndroidPrebuilt = false;
|
||||
useLLVM = true;
|
||||
|
||||
# use that one instead
|
||||
sdkVer = "29";
|
||||
useAndroidPrebuilt = true;
|
||||
#sdkVer = "29";
|
||||
#useAndroidPrebuilt = true;
|
||||
};
|
||||
in
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
let
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
|
||||
stdenv = pkgsCross.pkgsStatic.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
#stdenv = pkgsCross.pkgsStatic.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
stdenv = pkgsCross.stdenv;
|
||||
|
||||
in
|
||||
callPackage ../proot-termux {
|
||||
|
|
|
|||
|
|
@ -10,20 +10,33 @@ stdenv.mkDerivation {
|
|||
src = fetchFromGitHub {
|
||||
repo = "proot";
|
||||
owner = "termux";
|
||||
rev = "7d6bdd9f6cf31144e11ce65648dab2a1e495a7de";
|
||||
sha256 = "sha256-sbueMoqhOw0eChgp6KOZbhwRnSmDZhHq+jm06mGqxC4=";
|
||||
#rev = "7d6bdd9f6cf31144e11ce65648dab2a1e495a7de";
|
||||
#sha256 = "sha256-sbueMoqhOw0eChgp6KOZbhwRnSmDZhHq+jm06mGqxC4=";
|
||||
|
||||
# 1 step behind 6f12fbee "Implement shmat", use if ashmem.h is missing
|
||||
#rev = "ffd811ee726c62094477ed335de89fc107cadf17";
|
||||
#sha256 = "1zjblclsybvsrjmq2i0z6prhka268f0609w08dh9vdrbrng117f8";
|
||||
rev = "ffd811ee726c62094477ed335de89fc107cadf17";
|
||||
sha256 = "1zjblclsybvsrjmq2i0z6prhka268f0609w08dh9vdrbrng117f8";
|
||||
};
|
||||
|
||||
buildInputs = [ talloc ];
|
||||
LDFLAGS = [
|
||||
"-static"
|
||||
"${talloc}/lib/libtalloc.a"
|
||||
#"-ltalloc"
|
||||
#"-shared"
|
||||
"-Wl,-Bdynamic"
|
||||
];
|
||||
#LDFLAGS = [ "-static" "-ltalloc" "-shared" ];
|
||||
#buildInputs = [ talloc ];
|
||||
CFLAGS = [ "-I${talloc}/include" "-O3" ];
|
||||
#LDFLAGS = [ "${talloc}/lib/libtalloc.a" ];
|
||||
|
||||
patches = [ ./detranslate-empty.patch ];
|
||||
|
||||
makeFlags = [ "-Csrc" "V=1" ];
|
||||
CFLAGS = [ "-O3" ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/GNUmakefile --replace '-ltalloc' ""
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -D -m 0755 src/proot $out/bin/${outputBinaryName}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue