2020-03-27 10:08:22 +01:00
|
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
2020-03-24 13:47:30 +01:00
|
|
|
final: prev:
|
2020-05-07 21:45:55 +02:00
|
|
|
with prev;
|
|
|
|
let
|
|
|
|
overrideHostAttrs = drv: f:
|
|
|
|
if hostPlatform.isGenode then drv.overrideAttrs f else drv;
|
2020-03-24 13:47:30 +01:00
|
|
|
|
2020-05-07 21:45:55 +02:00
|
|
|
overrideTargetAttrs = drv: f:
|
|
|
|
if targetPlatform.isGenode then drv.overrideAttrs f else drv;
|
|
|
|
|
|
|
|
addPatches = drv: patch:
|
|
|
|
overrideTargetAttrs drv
|
|
|
|
(attrs: { patches = attrs.patches or [ ] ++ [ patch ]; });
|
|
|
|
|
|
|
|
in {
|
2020-03-24 13:47:30 +01:00
|
|
|
|
2020-05-07 21:45:55 +02:00
|
|
|
bash = overrideTargetAttrs bash (attrs: {
|
|
|
|
configureFlags = attrs.configureFlags
|
|
|
|
++ [ "--without-bash-malloc" ]; # no sbrk please
|
2020-06-08 08:55:57 +02:00
|
|
|
postPatch = "sed '/check_dev_tty/d' shell.c";
|
2020-03-24 13:47:30 +01:00
|
|
|
});
|
|
|
|
|
2020-05-30 20:50:44 +02:00
|
|
|
binutils-unwrapped = overrideTargetAttrs binutils-unwrapped (attrs: {
|
|
|
|
patches = attrs.patches ++ [ ./binutils/support-genode.patch ];
|
|
|
|
nativeBuildInputs = [ final.updateAutotoolsGnuConfigScriptsHook ];
|
|
|
|
});
|
2020-05-07 21:45:55 +02:00
|
|
|
|
|
|
|
cmake = overrideTargetAttrs cmake (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
|
|
|
|
'';
|
2020-04-19 17:37:51 +02:00
|
|
|
});
|
|
|
|
|
2020-05-07 21:45:55 +02:00
|
|
|
coreutils = if targetPlatform.isGenode then
|
|
|
|
(coreutils.override {
|
|
|
|
gmp = null;
|
|
|
|
libiconv = null;
|
|
|
|
}).overrideAttrs (attrs: {
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-acl"
|
|
|
|
"--disable-largefile"
|
|
|
|
"--disable-xattr"
|
|
|
|
"--disable-libcap"
|
|
|
|
"--disable-nls"
|
|
|
|
];
|
2020-05-28 08:09:20 +02:00
|
|
|
LDFLAGS = [ "-Wl,--no-as-needed" ];
|
|
|
|
# keep libposix NEEDED
|
2020-05-07 21:45:55 +02:00
|
|
|
})
|
|
|
|
else
|
|
|
|
coreutils;
|
|
|
|
|
|
|
|
gdb = addPatches gdb [ ./gdb/genode.patch ];
|
|
|
|
|
2020-04-05 18:50:52 +02:00
|
|
|
genodeLibcCross = callPackage ./libc { };
|
2020-04-02 09:06:18 +02:00
|
|
|
|
|
|
|
genodePackages = import ../packages { nixpkgs = final; };
|
|
|
|
|
2020-04-08 15:05:26 +02:00
|
|
|
genodeSources = buildPackages.callPackage ../packages/genodelabs { };
|
2020-03-27 08:33:50 +01:00
|
|
|
|
2020-03-24 13:47:30 +01:00
|
|
|
libcCrossChooser = name:
|
|
|
|
if stdenv.targetPlatform.isGenode then
|
2020-05-30 20:50:44 +02:00
|
|
|
targetPackages.genodeLibcCross
|
2020-03-24 13:47:30 +01:00
|
|
|
else
|
|
|
|
prev.libcCrossChooser name;
|
|
|
|
|
|
|
|
llvmPackages_8 = callPackage ./llvm-8 ({
|
|
|
|
inherit (stdenvAdapters) overrideCC;
|
2020-05-30 20:50:44 +02:00
|
|
|
inherit (targetPackages.genodeSources) genodeBase;
|
2020-03-24 13:47:30 +01:00
|
|
|
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
|
|
|
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
|
|
|
});
|
2020-03-21 17:08:37 +01:00
|
|
|
|
2020-05-27 14:22:36 +02:00
|
|
|
openssl = overrideHostAttrs openssl (attrs: {
|
|
|
|
outputs = [ "out" ]
|
|
|
|
++ builtins.filter (x: x != "bin" && x != "out") attrs.outputs;
|
|
|
|
patches = attrs.patches or [ ] ++ [ ./openssl/genode.patch ];
|
|
|
|
configureScript = {
|
|
|
|
x86_64-genode = "./Configure Genode-x86_64";
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw
|
|
|
|
"Not sure what configuration to use for ${stdenv.hostPlatform.config}");
|
|
|
|
configureFlags = attrs.configureFlags ++ [ "no-devcryptoeng" ];
|
|
|
|
postInstall =
|
|
|
|
"rm $out/bin/c_rehash"; # eliminate the perl runtime dependency
|
|
|
|
});
|
|
|
|
|
2020-04-02 12:24:40 +02:00
|
|
|
solo5-tools = callPackage ./solo5-tools { };
|
|
|
|
|
2020-04-22 13:46:02 +02:00
|
|
|
tup = prev.tup.overrideAttrs (attrs: { setupHook = ./tup/setup-hook.sh; });
|
|
|
|
|
2020-03-21 17:08:37 +01:00
|
|
|
}
|