Browse Source

genodeSources: arch-independent ports

Do not apply the fixup phase to ports, patching script shebangs is
infecting the ports with the packages used to prepare the port.

Do not import the package versions from the genodeSources
derivation, this breaks "nix flake list".

Make the selection of packages from buildPackages more explicit.
remotes/server7/staging
Emery Hemingway 1 year ago
parent
commit
f9958ba64b
  1. 42
      packages/genodelabs/default.nix
  2. 98
      packages/genodelabs/port-versions.nix
  3. 45
      packages/genodelabs/ports.nix

42
packages/genodelabs/default.nix

@ -1,10 +1,10 @@
# SPDX-License-Identifier: CC0-1.0
{ buildPackages, targetPackages }:
with buildPackages;
let
version = "20.05";
# Update ./port-versions.nix bumping the version and updateing the sources.
platform = targetPackages.targetPlatform;
@ -16,6 +16,8 @@ let
else
throw "unknown Genode arch for platform ${platform.system}";
inherit (buildPackages) callPackage fetchurl lib;
genodeSources =
# The Genode source repository
let
@ -26,7 +28,8 @@ let
"genode-aarch64-"
else
throw "unknown tool prefix for Genode arch ${arch}";
in stdenvNoCC.mkDerivation {
in with buildPackages;
stdenvNoCC.mkDerivation {
pname = "genode-sources";
inherit version;
src = fetchurl {
@ -55,11 +58,6 @@ let
installPhase = "cp -a . $out";
};
toolchain = callPackage ./toolchain.nix { };
stdenv' =
targetPackages.stdenvAdapters.overrideCC targetPackages.stdenv toolchain;
preparePort =
# Prepare a "port" of source code declared in the Genode sources
name:
@ -67,8 +65,9 @@ let
, patches ? [ ], ... }@args:
let
havePatches = patches != [ ];
version = builtins.getAttr name (import "${genodeSources}/ports.nix");
in stdenvNoCC.mkDerivation (args // {
version = (import ./port-versions.nix).${name};
in with buildPackages;
stdenvNoCC.mkDerivation (args // {
name = name + "-port-" + version;
inherit version patches;
preferLocalBuild = true;
@ -79,7 +78,7 @@ let
VERBOSE = "";
# need to build in verbose mode because errors are hidden
impureEnvVars = stdenv'.lib.fetchers.proxyImpureEnvVars
impureEnvVars = lib.fetchers.proxyImpureEnvVars
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
src = if havePatches then genodeSources else null;
@ -117,10 +116,17 @@ let
cp -a $CONTRIB_DIR/* $out/
runHook postInstall
'';
dontFixup = true;
});
ports = stdenv.lib.mapAttrs preparePort
(import ./ports.nix { inherit buildPackages; });
ports =
lib.mapAttrs preparePort (import ./ports.nix { inherit buildPackages; });
toolchain = callPackage ./toolchain.nix { };
stdenv' =
targetPackages.stdenvAdapters.overrideCC targetPackages.stdenv toolchain;
buildUpstream =
# Build from the Genode sources
@ -136,8 +142,8 @@ let
src = if havePatches then genodeSources else null;
dontUnpack = !havePatches;
nativeBuildInputs = [ binutils bison flex stdenv.cc tcl which ]
++ nativeBuildInputs;
nativeBuildInputs = with buildPackages;
[ binutils bison flex stdenv.cc tcl which ] ++ nativeBuildInputs;
configurePhase = let
linkPorts = toString
@ -166,7 +172,7 @@ let
runHook postInstall
'';
meta = { platforms = stdenv.lib.platforms.genode; } // meta;
meta = { platforms = lib.platforms.genode; } // meta;
});
buildDepot =
@ -179,8 +185,8 @@ let
inherit (genodeSources) version;
enableParallelBuilding = true;
nativeBuildInputs = [ binutils bison flex stdenv.cc tcl which ]
++ nativeBuildInputs;
nativeBuildInputs = with buildPackages;
[ binutils bison flex stdenv.cc tcl which ] ++ nativeBuildInputs;
src = genodeSources;
# The genode source tree must be copied to the build directory
@ -222,7 +228,7 @@ let
runHook postInstall
'';
meta = { platforms = stdenv.lib.platforms.genode; } // meta;
meta = { platforms = lib.platforms.genode; } // meta;
});
buildOverrides = callPackage ./targets.nix { inherit ports; };

98
packages/genodelabs/port-versions.nix

@ -0,0 +1,98 @@
# The file is generated by the "genodeSources" derivation.
{
acpica = "5c1c54";
ada-runtime = "db8987";
arora = "e8f003";
bash = "02edac";
bbl = "b9358c";
binutils = "62d309";
bzip2 = "f755da";
ccid = "7a9fb9";
coreutils = "0c59a9";
curl = "782b9a";
dde_bsd = "823dbe";
dde_ipxe = "b68f4e";
dde_linux = "173719";
dde_rump = "9afe56";
dde_zircon = "49e3d9";
diffutils = "ee502a";
drm = "01858a";
e2fsprogs = "2a09cd";
e2fsprogs-lib = "9b9fa0";
egl_api = "783c19";
expat = "eff6ef";
fatfs = "973b91";
ffi = "f406cb";
fiasco = "386db7";
findutils = "6707e8";
foc = "ce2d3e";
freetype = "35b677";
fribidi = "389935";
gcc = "20345a";
gcov = "a6f852";
gdb = "8eddf0";
getdns = "030233";
gmp = "855680";
gnupg = "c784d4";
grep = "b96a88";
grub2 = "8cf62c";
icu = "62f13b";
jbig2dec = "682269";
jitterentropy = "6017e1";
jpeg = "5effdd";
less = "e7a42c";
libarchive = "7ce310";
libc = "2e544d";
libdrm = "c1cce0";
libgcrypt = "37159a";
libiconv = "3f5ca3";
libpng = "ac05f3";
libsparkcrypto = "d479dc";
libssh = "a475cc";
libusb = "633358";
libyaml = "1cde80";
lighttpd = "0665ee";
lua = "db8c61";
lwip = "6e0661";
lz4 = "d99c3d";
make = "c8beff";
mesa = "6835d6";
microcode_intel = "027883";
mpc = "989fb4";
mpfr = "923771";
muen = "6ee775";
mupdf = "5b4925";
ncurses = "7873b9";
netperf = "7b5692";
nova = "e1ea2d";
okl4 = "cbf5e3";
openjpeg = "721d10";
openssl = "82ec04";
pcg-c = "721366";
pcre = "11003e";
pcsc-lite = "405b75";
pistachio = "68c8c3";
qemu-usb = "2ff18f";
qoost = "014d68";
qt5 = "084385";
qt5-host = "ad5edc";
readline = "a0bfb0";
sanitizer = "181889";
sed = "459979";
sel4 = "793548";
sel4_tools = "4ee1b9";
seoul = "e8d696";
solo5 = "55dd4f";
stb = "ab8f50";
stdcxx = "79ad88";
tar = "19aea4";
tcl = "842b1a";
ttf-bitstream-vera = "cd3684";
uboot = "f3fd6b";
vim = "53caaa";
virtualbox5 = "e93407";
which = "91c953";
x86emu = "8a1c3a";
xz = "45203f";
zlib = "f7aef1";
}

45
packages/genodelabs/ports.nix

@ -3,39 +3,52 @@
{ buildPackages }:
with buildPackages; {
dde_bsd.hash = "sha256-2ilZs6JkcQAvU/sQYnHunGtGRZDt7qLTpKZxQxSOf2I=";
dde_ipxe.hash = "sha256-7J8Loy3e79LAAARQgNixN4NT8lUktgkvl3tZQK+OlMM=";
dde_linux.hash = "sha256-ePNLGyr9A9udzuV5RPaQYjCDc/yns89Yp3h7vQkeBg4=";
binutils = {
hash = "sha256-gTYP9YNx+x6KVfIMjTD+UAReWwUg93TCkJIWwAau9eA=";
nativeBuildInputs = [ autoconf ];
};
dde_bsd.hash = "sha256-Z2piyoOrNmXyEEp+kX5w/q4JTylYdSOocUrFeqjz13A=";
dde_ipxe.hash = "sha256-NJ129+DkxFg1fFHJBABBFRRjqEVNSz6v2hEB80AuEM4=";
dde_linux.hash = "sha256-aUp90z8dtn48QNUqGe1b08RzbESFmCJl7ECZf+lr0rg=";
dde_rump = {
hash = "sha256-Wr5otGkWEa+5xImsFHQzwap5LckNEbyWA/7xbNcOreI=";
nativeBuildInputs = [ subversion ];
patches = [ ./svn-trust-server-cert.patch ];
};
expat.hash = "sha256-wkqqtYTctVLYZoYbFP1iWL0Xx/mMec40gVxk9amSywU=";
expat.hash = "sha256-KpeM2ySmf+Ojx1mAj9n8lfX7iHaa7w5MPPKZcn4GpTc=";
gcc = {
hash = "sha256-ZF9P6xOHvSDN6oq4SN5jOEBBMGgGh6fXyDOgYdXHG1g=";
nativeBuildInputs = [ autoconf264 autogen ];
patches = [ ./gcc-port.patch ];
};
gdb.hash = "sha256-YfVWDdXSRt7rHMvlMxIL5ikbHDe/e6ryTt3V7FfsJ4M=";
gmp.hash = "sha256-ZOHMhhqMe8glpMEGg++uDjCxXksAXDiBKCchEPQKTCA=";
jitterentropy.hash = "sha256-6KS732GxtUMz0xPYKtshdn039DgdJq11vTDQesZn4Ds=";
jpeg.hash = "sha256-NRcaGchA0DH2g5OkWBOiFK5co6lMpAo1ELqtxRUR3do=";
jpeg.hash = "sha256-RLVnlrnYGrhqr3Feikoi/BNditCaKN0u3t9/UDpl2wQ=";
libc = {
hash = "sha256-U9DdP0yZIDptgFRNv3QCxWoC4P3N6bqVr4YZi730Fec=";
hash = "sha256-ONmUhqY7rVtH6Z+K7VCY0OMLNi1SF1XCHFjiVY3MW3c=";
nativeBuildInputs = [ buildPackages.gcc ];
};
libiconv.hash = "sha256-HR19++jiYBnCO03EsfryUmVzukS874pE658gYivnMnI=";
libpng.hash = "sha256-BZI9UcKjP8u1/x8iroqqOyS1VEUZJLuE560W7J5PRGo=";
libiconv.hash = "sha256-25YcW5zo1fE33ZolGQroR+KZO8wHEdN1QXa7+MhwS78=";
libpng.hash = "sha256-hNmSWN4gEk4UIjzkGD4j5qFooMCVXLwcBeOeFumvh+4=";
libssh.hash = "sha256-Z/1YdhISh2kqBjWiTOLkS+usoeeekJvAuYrVUgpxnQM=";
lwip.hash = "sha256-Zsz+zGFRz9oacWCOGtZrCnXjJM1fT+iwW/RxR4kUX2I=";
lz4.hash = "sha256-BBo/ZoX0om5OdN148pFUL1JnD5iL2f9dq9x0zsWjyKI=";
lwip.hash = "sha256-RZsqy9iKiUfQzQOrPw2QWiKS5BkVbGe4HseF2DzeWeQ=";
lz4.hash = "sha256-nydkAbexaqcKYDzp0TsECKMXyPaoY9rf3MAbU33VPrg=";
mesa = {
hash = "sha256-5SHU4m3kMmi6Nfj4SBq2tO3mzsIBrRPz64dexjV4pYA=";
hash = "sha256-8QVIEpN+mLG1XktdZM64sqz1fVeK1pLVlERtnVphW8Y=";
nativeBuildInputs = [ python ];
};
mupdf.hash = "sha256-Q9uZDIguJDXPOWrQutwJvoQI8ds1MmhMH17GpGAl+Pk=";
openssl.hash = "sha256-K/flYHGOabnRplSLk13qej2prX5oILyHknNgRHlNtIY=";
mpc.hash = "sha256-MOs51NYXkNYxBG4d97/fMCx/iYzrNum8jHe3QujF24o=";
mpfr.hash = "sha256-TSZCAHU7Vtuo9Pbi7v7oDV5Wc6YBVICriR4IbErYW4Q=";
mupdf.hash = "sha256-6NX7zvOwReBBdz83RxGW2FJWUkqI/DTBkSOCqukidYs=";
openssl.hash = "sha256-epRL3SobYQ7xf8qwp6D5xu/Ms2T/LhUjjs273ywWRWg=";
qemu-usb.hash = "sha256-F4ZXeH5sx3FOcD42zFOxKFMsqGookKdav1NJ7YgVw98=";
stb.hash = "sha256-9LSH1i8jcEvjRAmTvgtK+Axy9hO7uiSzmSgBvs0zkTc=";
stdcxx.hash = "sha256-3pGfDRE+MMgM/ARmgktyIMnhJ/poe6NOfueBwehHDXQ=";
stdcxx.hash = "sha256-iiE009fL1yE3XJ7HkaJakOiS++m7qONwwGrdJjBXQ7k=";
virtualbox5 = {
hash = "sha256-lMcZYL60t+4zOPog8idB8Hd9sFoa1f83caoN9Rw15WU=";
hash = "sha256-HLga/0pHQkjdMH7mU194B7pTFJoOoww69Yii4Ixmkxo=";
nativeBuildInputs = [ iasl libxslt unzip yasm ];
};
x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w=";
zlib.hash = "sha256-lq1VaD9huqW7pwrAbujoPosDK43xMKS++5HQstgMfa0=";
zlib.hash = "sha256-j3JXN0f8thrPCvLhYHIPjbGa0t3iynQ/gO7KMlgljq0=";
}

Loading…
Cancel
Save