61 lines
2.3 KiB
Nix
61 lines
2.3 KiB
Nix
# FHS build environment for the LineageOS 14.1 (rubenslte) build.
|
|
# Same package set as shell.nix (TWRP env) plus a host gcc: the kernel kconfig
|
|
# host tools (`conf`) and kernel/scripts are compiled with the host compiler
|
|
# during the LOS build, while the omni 5.1 TWRP build only needs them from the
|
|
# device's arm-eabi toolchain.
|
|
#
|
|
# Intentionally kept as a separate file: the TWRP build is device-tested, so
|
|
# shell.nix is not touched. Keep the two packages sets in sync where possible.
|
|
let
|
|
pkgs = import (fetchTarball {
|
|
url = "https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz";
|
|
}) {};
|
|
|
|
fhs = pkgs.buildFHSUserEnv {
|
|
name = "android-env";
|
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
git # the device/kernel clones (and `repo` plumbing)
|
|
gitRepo # AOSP `repo` multi-repo tool
|
|
gnumake # `mka` -> make for the bacon build
|
|
gcc # host C compiler for kernel kconfig host tools
|
|
python2 # cm-14.1 era build scripts expect python2
|
|
python3 # modern `repo` runs under python3
|
|
curl # tarball downloads
|
|
openssl # used by a few AOSP host tools
|
|
procps # `ps`/`pidof` referenced by build scripts
|
|
util-linux # uuidgen and friends used during image building
|
|
android-tools # adb / fastboot for flashing and testing
|
|
jdk8 # 14.1 needs java <=8 (signapk, dx, jack)
|
|
schedtool # legacy tool invoked by some build scripts
|
|
m4 gperf bison flex # classic AOSP host toolchain
|
|
which # jack-admin / diagnose helpers probe PATH
|
|
perl # kernel/scripting helper (timeconst.pl, etc.)
|
|
libxml2 # xml libs used by host tools
|
|
zip unzip # packaging
|
|
lzop # legacy lzo support
|
|
xz # LZMA ramdisk compression
|
|
gnupg # gpg for repo manifest verification (optional)
|
|
nettools # minor networking helpers used by host scripts
|
|
];
|
|
|
|
multiPkgs = pkgs: with pkgs; [
|
|
zlib
|
|
ncurses5
|
|
pkgsi686Linux.gcc9
|
|
pkgsi686Linux.libstdcxx5
|
|
];
|
|
|
|
runScript = "bash";
|
|
profile = "export ANDROID_JAVA_HOME=${pkgs.jdk8.home}";
|
|
};
|
|
in pkgs.stdenv.mkDerivation {
|
|
name = "android-env-shell";
|
|
nativeBuildInputs = [ fhs ];
|
|
shellHook = ''
|
|
if [ -n "$BASH_EXECUTION_STRING" ]; then
|
|
exec android-env -c "$BASH_EXECUTION_STRING"
|
|
fi
|
|
exec android-env
|
|
'';
|
|
} |