|
|
|
@ -28,7 +28,7 @@ let
|
|
|
|
|
(attrs: { nativeBuildInputs = [ final.autoreconfHook ]; });
|
|
|
|
|
|
|
|
|
|
nullPkgs =
|
|
|
|
|
# Nullify this packages to find problems early
|
|
|
|
|
# Nullify these packages to find problems early.
|
|
|
|
|
if hostPlatform.isGenode then
|
|
|
|
|
builtins.listToAttrs (map (name: {
|
|
|
|
|
inherit name;
|
|
|
|
@ -46,23 +46,28 @@ in nullPkgs // {
|
|
|
|
|
}) bash;
|
|
|
|
|
|
|
|
|
|
binutils-unwrapped = overrideAttrsTarget (attrs: {
|
|
|
|
|
patches = attrs.patches ++ [ ./binutils/support-genode.patch ];
|
|
|
|
|
patches = attrs.patches ++ [
|
|
|
|
|
./binutils/support-genode.patch
|
|
|
|
|
# Upstreamed, remove at next release.
|
|
|
|
|
];
|
|
|
|
|
nativeBuildInputs = attrs.nativeBuildInputs
|
|
|
|
|
++ [ final.updateAutotoolsGnuConfigScriptsHook ];
|
|
|
|
|
}) binutils-unwrapped;
|
|
|
|
|
|
|
|
|
|
cmake = overrideAttrsTarget (attrs: {
|
|
|
|
|
postInstall = with stdenv; ''
|
|
|
|
|
local MODULE="$out/share/cmake-${
|
|
|
|
|
lib.versions.majorMinor attrs.version
|
|
|
|
|
}/Modules/Platform/Genode.cmake"
|
|
|
|
|
if [ -e "$MODULE" ]; then
|
|
|
|
|
echo "Upstream provides $MODULE!"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
cp ${./cmake/Genode.cmake} $MODULE
|
|
|
|
|
'';
|
|
|
|
|
}) cmake;
|
|
|
|
|
cmake =
|
|
|
|
|
# TODO: upstream
|
|
|
|
|
overrideAttrsTarget (attrs: {
|
|
|
|
|
postInstall = with stdenv; ''
|
|
|
|
|
local MODULE="$out/share/cmake-${
|
|
|
|
|
lib.versions.majorMinor attrs.version
|
|
|
|
|
}/Modules/Platform/Genode.cmake"
|
|
|
|
|
if [ -e "$MODULE" ]; then
|
|
|
|
|
echo "Upstream provides $MODULE!"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
cp ${./cmake/Genode.cmake} $MODULE
|
|
|
|
|
'';
|
|
|
|
|
}) cmake;
|
|
|
|
|
|
|
|
|
|
coreutils = overrideHost {
|
|
|
|
|
gmp = null;
|
|
|
|
@ -85,24 +90,26 @@ in nullPkgs // {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
gccForLibs = if targetPlatform.isGenode then
|
|
|
|
|
final.genodePackages.genodeSources.toolchain.cc
|
|
|
|
|
else
|
|
|
|
|
prev.gccForLibs;
|
|
|
|
|
|
|
|
|
|
gdb = addPatchesTarget [ ./gdb/genode.patch ] gdb;
|
|
|
|
|
gdb = addPatchesTarget [
|
|
|
|
|
./gdb/genode.patch
|
|
|
|
|
# Upstreamed, remove at next release.
|
|
|
|
|
] gdb;
|
|
|
|
|
|
|
|
|
|
genodeLibcCross = callPackage ./libc { };
|
|
|
|
|
|
|
|
|
|
genodePackages = import ../packages {
|
|
|
|
|
inherit flake;
|
|
|
|
|
pkgs = final;
|
|
|
|
|
};
|
|
|
|
|
genodePackages =
|
|
|
|
|
# The Genode-only packages.
|
|
|
|
|
import ../packages {
|
|
|
|
|
inherit flake;
|
|
|
|
|
pkgs = final;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
grub2 = if stdenv.targetPlatform.isGenode then
|
|
|
|
|
prev.buildPackages.grub2
|
|
|
|
|
else
|
|
|
|
|
prev.grub2;
|
|
|
|
|
grub2 =
|
|
|
|
|
# No need for a Genode build of GRUB.
|
|
|
|
|
if stdenv.targetPlatform.isGenode then
|
|
|
|
|
prev.buildPackages.grub2
|
|
|
|
|
else
|
|
|
|
|
prev.grub2;
|
|
|
|
|
|
|
|
|
|
libcCrossChooser = name:
|
|
|
|
|
if stdenv.targetPlatform.isGenode then
|
|
|
|
@ -111,52 +118,73 @@ in nullPkgs // {
|
|
|
|
|
prev.libcCrossChooser name;
|
|
|
|
|
|
|
|
|
|
libsodium = overrideAttrsHost (attrs: {
|
|
|
|
|
patches = (attrs.patches or [ ]) ++ [ ./libsodium/genode.patch ];
|
|
|
|
|
patches = (attrs.patches or [ ]) ++ [
|
|
|
|
|
./libsodium/genode.patch
|
|
|
|
|
# https://github.com/jedisct1/libsodium/pull/1006
|
|
|
|
|
];
|
|
|
|
|
}) libsodium;
|
|
|
|
|
|
|
|
|
|
libkrb5 = autoreconfHost libkrb5;
|
|
|
|
|
libkrb5 =
|
|
|
|
|
# Do not want.
|
|
|
|
|
autoreconfHost libkrb5;
|
|
|
|
|
|
|
|
|
|
libtool = overrideAttrsTarget (attrs: {
|
|
|
|
|
nativeBuildInputs = with final;
|
|
|
|
|
attrs.nativeBuildInputs ++ [ autoconf automake115x ];
|
|
|
|
|
patches = ./libtool/genode.patch;
|
|
|
|
|
}) libtool;
|
|
|
|
|
libtool =
|
|
|
|
|
# Autotools related nonesense. Better to compile
|
|
|
|
|
# everything static than to deal with this one.
|
|
|
|
|
overrideAttrsTarget (attrs: {
|
|
|
|
|
nativeBuildInputs = with final;
|
|
|
|
|
attrs.nativeBuildInputs ++ [ autoconf automake115x ];
|
|
|
|
|
patches = ./libtool/genode.patch;
|
|
|
|
|
}) libtool;
|
|
|
|
|
|
|
|
|
|
libtoxcore = overrideHost {
|
|
|
|
|
libopus = null;
|
|
|
|
|
libvpx = null;
|
|
|
|
|
} libtoxcore;
|
|
|
|
|
|
|
|
|
|
linuxPackages = if hostPlatform.isGenode then {
|
|
|
|
|
extend = _: final.linuxPackages;
|
|
|
|
|
features = { };
|
|
|
|
|
kernel.config = {
|
|
|
|
|
isEnabled = _: false;
|
|
|
|
|
isYes = _: false;
|
|
|
|
|
};
|
|
|
|
|
} else
|
|
|
|
|
linuxPackages;
|
|
|
|
|
|
|
|
|
|
llvmPackages_11 = callPackage ./llvm-11 ({
|
|
|
|
|
inherit (stdenvAdapters) overrideCC;
|
|
|
|
|
buildLlvmTools = buildPackages.llvmPackages_11.tools;
|
|
|
|
|
targetLlvmLibraries = targetPackages.llvmPackages_11.libraries;
|
|
|
|
|
} // lib.optionalAttrs
|
|
|
|
|
(stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
|
|
|
|
stdenv = gcc7Stdenv;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ncurses = addPatchesHost [ ./ncurses/genode.patch ] ncurses;
|
|
|
|
|
|
|
|
|
|
nim = overrideAttrsTarget (attrs: {
|
|
|
|
|
postInstall = ''
|
|
|
|
|
sed \
|
|
|
|
|
-e '/cc = gcc/d' \
|
|
|
|
|
-i $out/etc/nim/nim.cfg
|
|
|
|
|
'';
|
|
|
|
|
}) prev.nim;
|
|
|
|
|
|
|
|
|
|
nim-unwrapped = addPatchesTarget [ ./nim/genode.patch ] prev.nim-unwrapped;
|
|
|
|
|
linuxPackages =
|
|
|
|
|
# Dummy package.
|
|
|
|
|
if hostPlatform.isGenode then {
|
|
|
|
|
extend = _: final.linuxPackages;
|
|
|
|
|
features = { };
|
|
|
|
|
kernel.config = {
|
|
|
|
|
isEnabled = _: false;
|
|
|
|
|
isYes = _: false;
|
|
|
|
|
};
|
|
|
|
|
} else
|
|
|
|
|
linuxPackages;
|
|
|
|
|
|
|
|
|
|
llvmPackages_11 =
|
|
|
|
|
# A copy of the LLVM expressions from Nixpkgs.
|
|
|
|
|
# Nothing here is upstreamed.
|
|
|
|
|
callPackage ./llvm-11 ({
|
|
|
|
|
inherit (stdenvAdapters) overrideCC;
|
|
|
|
|
buildLlvmTools = buildPackages.llvmPackages_11.tools;
|
|
|
|
|
targetLlvmLibraries = targetPackages.llvmPackages_11.libraries;
|
|
|
|
|
} // lib.optionalAttrs
|
|
|
|
|
(stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) {
|
|
|
|
|
stdenv = gcc7Stdenv;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ncurses =
|
|
|
|
|
# https://invisible-island.net/autoconf/
|
|
|
|
|
# Stay clear of upstream on this one.
|
|
|
|
|
addPatchesHost [ ./ncurses/genode.patch ] ncurses;
|
|
|
|
|
|
|
|
|
|
nim =
|
|
|
|
|
# Nim is configured to build Genode with GCC.
|
|
|
|
|
overrideAttrsTarget (attrs: {
|
|
|
|
|
postInstall = ''
|
|
|
|
|
sed \
|
|
|
|
|
-e '/cc = gcc/d' \
|
|
|
|
|
-i $out/etc/nim/nim.cfg
|
|
|
|
|
'';
|
|
|
|
|
}) prev.nim;
|
|
|
|
|
|
|
|
|
|
nim-unwrapped = addPatchesTarget [
|
|
|
|
|
./nim/genode.patch
|
|
|
|
|
# Fixes to the compiler and standard libary.
|
|
|
|
|
] prev.nim-unwrapped;
|
|
|
|
|
|
|
|
|
|
openssl =
|
|
|
|
|
overrideHost { static = true; } # shared library comes out stupid big
|
|
|
|
@ -173,7 +201,10 @@ in nullPkgs // {
|
|
|
|
|
"rm $out/bin/c_rehash"; # eliminate the perl runtime dependency
|
|
|
|
|
}) openssl);
|
|
|
|
|
|
|
|
|
|
patchelf = addPatchesTarget [ ./patchelf/dynstr.patch ] prev.patchelf;
|
|
|
|
|
patchelf = addPatchesTarget [
|
|
|
|
|
./patchelf/dynstr.patch
|
|
|
|
|
# Patch to fix a bug in rewriting the .dynstr section.
|
|
|
|
|
] prev.patchelf;
|
|
|
|
|
|
|
|
|
|
rsync = overrideHost {
|
|
|
|
|
enableACLs = false;
|
|
|
|
@ -190,7 +221,10 @@ in nullPkgs // {
|
|
|
|
|
tor = overrideAttrsHost (attrs: {
|
|
|
|
|
configureFlags = attrs.configureFlags or [ ]
|
|
|
|
|
++ [ "--disable-tool-name-check" ];
|
|
|
|
|
patches = attrs.patches or [ ] ++ [ ./tor/genode.patch ];
|
|
|
|
|
patches = attrs.patches or [ ] ++ [
|
|
|
|
|
./tor/genode.patch
|
|
|
|
|
# We don't do users and groups here.
|
|
|
|
|
];
|
|
|
|
|
postPatch = null; # Avoid torsocks patching
|
|
|
|
|
}) tor;
|
|
|
|
|
|
|
|
|
|