mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
update nixpkgs; applyPatches to fix toolchain (nixpkgs!269077)
This commit is contained in:
parent
970a735f56
commit
6daee58791
13 changed files with 80 additions and 28 deletions
14
flake.lock
generated
14
flake.lock
generated
|
|
@ -45,11 +45,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1664019863,
|
"lastModified": 1708172716,
|
||||||
"narHash": "sha256-nXRRSPr2Jntx2hdZZMkds1fSDNUyw9N/wMtdcQ8VElU=",
|
"narHash": "sha256-3M94oln0b61m3dUmLyECCA9hYAHXZEszM4saE3CmQO4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9c64b91d14268cf20ea07ea7930479a75325af9f",
|
"rev": "5d874ac46894c896119bce68e758e9e80bdb28f1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -60,17 +60,17 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-for-bootstrap": {
|
"nixpkgs-for-bootstrap": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686921029,
|
"lastModified": 1708105575,
|
||||||
"narHash": "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=",
|
"narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04",
|
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04",
|
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||||
|
|
||||||
# for bootstrap zip ball creation and proot-termux builds, we use a fixed version of nixpkgs to ease maintanence.
|
# for bootstrap zip ball creation and proot-termux builds, we use a fixed version of nixpkgs to ease maintanence.
|
||||||
# head of nixos-23.05 as of 2023-06-18
|
# head of nixos-23.11 as of 2024-02-17
|
||||||
# note: when updating nixpkgs-for-bootstrap, update store paths of proot-termux in modules/environment/login/default.nix
|
# note: when updating nixpkgs-for-bootstrap, update store paths of proot-termux in modules/environment/login/default.nix
|
||||||
nixpkgs-for-bootstrap.url = "github:NixOS/nixpkgs/c7ff1b9b95620ce8728c0d7bd501c458e6da9e04";
|
nixpkgs-for-bootstrap.url = "github:NixOS/nixpkgs/1d1817869c47682a6bee85b5b0a6537b6c0fba26";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ in
|
||||||
environment.files = {
|
environment.files = {
|
||||||
inherit login loginInner;
|
inherit login loginInner;
|
||||||
|
|
||||||
prootStatic = "/nix/store/yrrs22jsl1y8niwzs2vvk0vblicr3903-proot-termux-static-aarch64-unknown-linux-android-unstable-2023-05-13";
|
prootStatic = "/nix/store/42q6yf0x0ka6jxxbprmrkzimqi4rvi6d-proot-termux-static-aarch64-unknown-linux-android-unstable-2023-05-13";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
|
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
# Inspired by
|
# Inspired by
|
||||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/networking.nix
|
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/networking.nix
|
||||||
|
|
@ -19,9 +19,9 @@ in
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
options.networking = {
|
||||||
|
|
||||||
networking.hosts = lib.mkOption {
|
hosts = lib.mkOption {
|
||||||
type = types.attrsOf (types.listOf types.str);
|
type = types.attrsOf (types.listOf types.str);
|
||||||
default = { };
|
default = { };
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
|
|
@ -35,7 +35,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostFiles = lib.mkOption {
|
hostFiles = lib.mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
defaultText = literalMD "Hosts from {option}`networking.hosts` and {option}`networking.extraHosts`";
|
defaultText = literalMD "Hosts from {option}`networking.hosts` and {option}`networking.extraHosts`";
|
||||||
example = literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
|
example = literalExpression ''[ "''${pkgs.my-blocklist-package}/share/my-blocklist/hosts" ]'';
|
||||||
|
|
@ -44,7 +44,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.extraHosts = lib.mkOption {
|
extraHosts = lib.mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
example = "192.168.0.1 lanlocalhost";
|
example = "192.168.0.1 lanlocalhost";
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
{ super }:
|
{ super }:
|
||||||
|
|
||||||
let
|
let
|
||||||
# head of nixos-23.05 as of 2023-06-18
|
# head of nixos-23.11 as of 2024-02-17
|
||||||
pinnedPkgsSrc = super.fetchFromGitHub {
|
pinnedPkgsSrc = super.fetchFromGitHub {
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
repo = "nixpkgs";
|
repo = "nixpkgs";
|
||||||
rev = "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04";
|
rev = "1d1817869c47682a6bee85b5b0a6537b6c0fba26";
|
||||||
sha256 = "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=";
|
sha256 = "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
||||||
16
pkgs/cross-compiling/compiler-rt.patch
Normal file
16
pkgs/cross-compiling/compiler-rt.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
diff --git a/pkgs/development/compilers/llvm/16/compiler-rt/default.nix b/pkgs/d
|
||||||
|
evelopment/compilers/llvm/16/compiler-rt/default.nix
|
||||||
|
index 0f15a9e12cde..a32533e5285c 100644
|
||||||
|
--- a/pkgs/development/compilers/llvm/16/compiler-rt/default.nix
|
||||||
|
+++ b/pkgs/development/compilers/llvm/16/compiler-rt/default.nix
|
||||||
|
@@ -130,8 +130,8 @@ stdenv.mkDerivation {
|
||||||
|
# The presence of crtbegin_shared has been added and removed; it's possible
|
||||||
|
# people have added/removed it to get it working on their platforms.
|
||||||
|
# Try each in turn for now.
|
||||||
|
- ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o
|
||||||
|
- ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o
|
||||||
|
+ #ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o
|
||||||
|
+ #ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o
|
||||||
|
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
|
||||||
|
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
|
||||||
|
'' + lib.optionalString doFakeLibgcc ''
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
{ config, nixpkgs, system }:
|
{ config, system }:
|
||||||
|
|
||||||
{
|
{
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
|
||||||
18
pkgs/cross-compiling/cross-pkgs.nix
Normal file
18
pkgs/cross-compiling/cross-pkgs.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
|
{ callPackage, nixpkgs, system }:
|
||||||
|
|
||||||
|
let
|
||||||
|
args = callPackage ./cross-pkgs-args.nix { };
|
||||||
|
pkgsCross-imported = import nixpkgs args;
|
||||||
|
pkgsCross-patched = pkgsCross-imported.applyPatches {
|
||||||
|
name = "nixpkgs-crosscompilation-patched";
|
||||||
|
src = nixpkgs;
|
||||||
|
patches = [
|
||||||
|
./compiler-rt.patch
|
||||||
|
./libunwind.patch
|
||||||
|
];
|
||||||
|
};
|
||||||
|
pkgsCross = import pkgsCross-patched args;
|
||||||
|
in
|
||||||
|
pkgsCross
|
||||||
13
pkgs/cross-compiling/libunwind.patch
Normal file
13
pkgs/cross-compiling/libunwind.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/pkgs/development/compilers/llvm/16/libunwind/default.nix b/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||||
|
index 1b677a7a2c0d..6c16e869a085 100644
|
||||||
|
--- a/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||||
|
+++ b/pkgs/development/compilers/llvm/16/libunwind/default.nix
|
||||||
|
@@ -49,6 +49,8 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ninja python3 ];
|
||||||
|
|
||||||
|
+ LDFLAGS = "-unwindlib=none";
|
||||||
|
+
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DLLVM_ENABLE_RUNTIMES=libunwind"
|
||||||
|
] ++ lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
{ callPackage, nixpkgs, tallocStatic }:
|
{ callPackage, tallocStatic }:
|
||||||
|
|
||||||
let
|
let
|
||||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||||
stdenv = pkgsCross.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
stdenv = pkgsCross.stdenvAdapters.makeStaticBinaries pkgsCross.stdenv;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
|
# Copyright (c) 2019-2023, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||||
|
|
||||||
{ callPackage
|
{ callPackage
|
||||||
, nixpkgs
|
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, python3
|
, python3
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
|
@ -9,7 +8,7 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
pkgsCross = import nixpkgs (callPackage ./cross-pkgs-args.nix { });
|
pkgsCross = callPackage ./cross-pkgs.nix { };
|
||||||
in
|
in
|
||||||
|
|
||||||
pkgsCross.stdenv.mkDerivation rec {
|
pkgsCross.stdenv.mkDerivation rec {
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,18 @@ stdenv.mkDerivation {
|
||||||
mkdir -p fake-ashmem/linux; cat > fake-ashmem/linux/ashmem.h << EOF
|
mkdir -p fake-ashmem/linux; cat > fake-ashmem/linux/ashmem.h << EOF
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
#include <linux/ioctl.h>
|
#include <linux/ioctl.h>
|
||||||
|
#include <string.h>
|
||||||
#define __ASHMEMIOC 0x77
|
#define __ASHMEMIOC 0x77
|
||||||
#define ASHMEM_NAME_LEN 256
|
#define ASHMEM_NAME_LEN 256
|
||||||
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
|
||||||
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
|
||||||
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
|
||||||
EOF
|
EOF
|
||||||
|
substituteInPlace src/arch.h --replace \
|
||||||
|
'#define HAS_LOADER_32BIT true' \
|
||||||
|
""
|
||||||
|
! (grep -F '#define HAS_LOADER_32BIT' src/arch.h)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ talloc ];
|
buildInputs = [ talloc ];
|
||||||
patches = [ ./detranslate-empty.patch ];
|
patches = [ ./detranslate-empty.patch ];
|
||||||
makeFlags = [ "-Csrc" "V=1" ];
|
makeFlags = [ "-Csrc" "V=1" ];
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
|
||||||
home-manager.url = "github:nix-community/home-manager/release-23.11";
|
home-manager.url = "github:nix-community/home-manager/release-23.11";
|
||||||
nix-on-droid.url = "<<FLAKE_URL>>";
|
nix-on-droid = {
|
||||||
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
|
url = "<<FLAKE_URL>>";
|
||||||
nix-on-droid.inputs.home-manager.follows = "home-manager";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.home-manager.follows = "home-manager";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nix-on-droid, ... }: {
|
outputs = { nix-on-droid, ... }: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue