mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
pkgs: use non-prebuilt SDK
This commit is contained in:
parent
0de95f9e9f
commit
0ad6321f79
5 changed files with 38 additions and 42 deletions
|
|
@ -82,7 +82,7 @@ in
|
|||
environment.files = {
|
||||
inherit login loginInner;
|
||||
|
||||
prootStatic = "/nix/store/scj2cqyvcra7dcan4y73n0459ac7fms7-proot-termux-aarch64-unknown-linux-android-unstable-2022-05-03";
|
||||
prootStatic = "/nix/store/wsgnxpmrdmjy7qrsxvp7r5jandbabzjl-proot-termux-static-aarch64-unknown-linux-android-unstable-2022-05-03";
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,25 +1,19 @@
|
|||
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ config, path }:
|
||||
{ config }:
|
||||
|
||||
let
|
||||
loadNixpkgs = import ../lib/load-nixpkgs.nix;
|
||||
|
||||
crossSystem = {
|
||||
config = "${config.build.arch}-unknown-linux-android";
|
||||
ndkVer = "21";
|
||||
|
||||
# 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;
|
||||
|
||||
# use that one instead
|
||||
sdkVer = "29";
|
||||
useAndroidPrebuilt = true;
|
||||
sdkVer = "32";
|
||||
libc = "bionic";
|
||||
useAndroidPrebuilt = false;
|
||||
useLLVM = true;
|
||||
isStatic = true;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
loadNixpkgs { inherit crossSystem; }
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ callPackage, tallocStatic }:
|
||||
|
||||
let
|
||||
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||
|
||||
stdenv = pkgsCross.pkgsStatic.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
stdenv = pkgsCross.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||
|
||||
in
|
||||
callPackage ../proot-termux {
|
||||
pkgs = pkgsCross;
|
||||
pkgsCross.callPackage ../proot-termux {
|
||||
talloc = tallocStatic;
|
||||
inherit stdenv;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ pkgs, stdenv, callPackage, fetchFromGitHub,
|
||||
talloc, outputBinaryName ? "proot-static" }:
|
||||
{ stdenv, fetchFromGitHub, talloc,
|
||||
static ? true, outputBinaryName ? "proot-static" }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "proot-termux";
|
||||
|
|
@ -12,20 +12,26 @@ stdenv.mkDerivation {
|
|||
owner = "termux";
|
||||
rev = "5c462a6ecfddd629b1439f38fbb61216d6fcb359";
|
||||
sha256 = "sha256-XS4js80NsAN2C4jMuISSqMm/DwYpH/stbABaxzoqZcE=";
|
||||
|
||||
# 1 step behind 6f12fbee "Implement shmat", use if ashmem.h is missing
|
||||
#rev = "ffd811ee726c62094477ed335de89fc107cadf17";
|
||||
#sha256 = "1zjblclsybvsrjmq2i0z6prhka268f0609w08dh9vdrbrng117f8";
|
||||
};
|
||||
|
||||
buildInputs = [ talloc ];
|
||||
|
||||
patches = [ ./detranslate-empty.patch ];
|
||||
|
||||
makeFlags = [ "-Csrc" "V=1" ];
|
||||
CFLAGS = [ "-O3" ];
|
||||
|
||||
installPhase = ''
|
||||
install -D -m 0755 src/proot $out/bin/${outputBinaryName}
|
||||
# ashmem.h is rather small, our needs are even smaller, so just define these:
|
||||
preConfigure = ''
|
||||
mkdir -p fake-ashmem/linux; cat > fake-ashmem/linux/ashmem.h << EOF
|
||||
#include <linux/limits.h>
|
||||
#include <linux/ioctl.h>
|
||||
#define __ASHMEMIOC 0x77
|
||||
#define ASHMEM_NAME_LEN 256
|
||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||
EOF
|
||||
'';
|
||||
|
||||
buildInputs = [ talloc ];
|
||||
patches = [ ./detranslate-empty.patch ];
|
||||
makeFlags = [ "-Csrc" "V=1" ];
|
||||
CFLAGS = [ "-O3" "-I../fake-ashmem" ] ++
|
||||
(if static then [ "-static" ] else []);
|
||||
LDFLAGS = if static then [ "-static" ] else [];
|
||||
preInstall = "${stdenv.cc.targetPrefix}strip src/proot";
|
||||
installPhase = "install -D -m 0755 src/proot $out/bin/${outputBinaryName}";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
{ pkgs ? (import ../pkgs/lib/load-nixpkgs.nix {}) }:
|
||||
|
||||
let
|
||||
pkgs.callPackage ../pkgs/proot-termux {
|
||||
stdenv = pkgs.stdenv;
|
||||
in
|
||||
pkgs.callPackage ../pkgs/proot-termux {
|
||||
static = false;
|
||||
outputBinaryName = "proot";
|
||||
inherit pkgs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue