deduplicate proot for device and proot for fakedroid

This commit is contained in:
Alexander Sosedkin 2021-12-12 16:23:37 +01:00
parent a6b8efbae3
commit 856d931972
5 changed files with 45 additions and 59 deletions

View file

@ -85,8 +85,8 @@ in
prootStatic =
let
crossCompiledPaths = {
aarch64 = "/nix/store/45jqhgc0cg1l6vrl95p3qg3j4wh6w59y-proot-termux-aarch64-unknown-linux-android-unstable-2021-11-21";
i686 = "/nix/store/8nww78ndkbxqhi4h9f0ly9zkwixa0cd9-proot-termux-i686-unknown-linux-android-unstable-2021-11-21";
aarch64 = "/nix/store/dapbgzbpl426jrhz4a2sdl096a8l98ad-proot-termux-aarch64-unknown-linux-android-unstable-2021-11-21";
i686 = "/nix/store/6nnjhrh8pgyxjnya72irahxpkbnxai1w-proot-termux-i686-unknown-linux-android-unstable-2021-11-21";
};
in
"${crossCompiledPaths.${config.build.arch}}";

View file

@ -1,36 +1,15 @@
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
{ callPackage, fetchFromGitHub, tallocStatic }:
{ callPackage, tallocStatic }:
let
pkgsCross = callPackage ./cross-pkgs.nix { };
stdenv = pkgsCross.pkgsStatic.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
in
stdenv.mkDerivation {
pname = "proot-termux";
version = "unstable-2021-11-21";
src = fetchFromGitHub {
repo = "proot";
owner = "termux";
rev = "7d6bdd9f6cf31144e11ce65648dab2a1e495a7de";
sha256 = "sha256-sbueMoqhOw0eChgp6KOZbhwRnSmDZhHq+jm06mGqxC4=";
# 1 step behind 6f12fbee "Implement shmat", use if ashmem.h is missing
#rev = "ffd811ee726c62094477ed335de89fc107cadf17";
#sha256 = "1zjblclsybvsrjmq2i0z6prhka268f0609w08dh9vdrbrng117f8";
};
buildInputs = [ tallocStatic ];
patches = [ ./proot-detranslate-empty.patch ];
makeFlags = [ "-Csrc" "V=1" ];
installPhase = ''
install -D -m 0755 src/proot $out/bin/proot-static
'';
}
callPackage ../proot-termux {
pkgs = pkgsCross;
talloc = tallocStatic;
inherit stdenv;
}

View file

@ -0,0 +1,31 @@
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
{ pkgs, stdenv, callPackage, fetchFromGitHub,
talloc, outputBinaryName ? "proot-static" }:
stdenv.mkDerivation {
pname = "proot-termux";
version = "unstable-2021-11-21";
src = fetchFromGitHub {
repo = "proot";
owner = "termux";
rev = "7d6bdd9f6cf31144e11ce65648dab2a1e495a7de";
sha256 = "sha256-sbueMoqhOw0eChgp6KOZbhwRnSmDZhHq+jm06mGqxC4=";
# 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}
'';
}

View file

@ -1,35 +1,11 @@
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
{ pkgs ? import <nixpkgs> { } }:
{ pkgs ? (import ../pkgs/lib/load-nixpkgs.nix {}) }:
let
#stdenv = pkgs.pkgsStatic.stdenvAdapters.makeStatic pkgs.stdenv;
stdenv = pkgs.stdenv;
in
stdenv.mkDerivation {
pname = "proot-termux";
version = "unstable-2021-11-21";
src = pkgs.fetchFromGitHub {
repo = "proot";
owner = "termux";
rev = "7d6bdd9f6cf31144e11ce65648dab2a1e495a7de";
sha256 = "sha256-sbueMoqhOw0eChgp6KOZbhwRnSmDZhHq+jm06mGqxC4=";
# 1 step behind 6f12fbee "Implement shmat", use if ashmem.h is missing
#rev = "ffd811ee726c62094477ed335de89fc107cadf17";
#sha256 = "1zjblclsybvsrjmq2i0z6prhka268f0609w08dh9vdrbrng117f8";
};
buildInputs = [ pkgs.talloc ];
patches = [ ../pkgs/cross-compiling/proot-detranslate-empty.patch ];
makeFlags = [ "-Csrc" "V=1" "CFLAGS=-O3" ];
installPhase = ''
install -D -m 0755 src/proot $out/bin/proot
'';
}
pkgs.callPackage ../pkgs/proot-termux {
outputBinaryName = "proot";
inherit pkgs;
}