92 lines
2.4 KiB
Nix
92 lines
2.4 KiB
Nix
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
final: prev:
|
|
with prev;
|
|
let
|
|
overrideHostAttrs = drv: f:
|
|
if hostPlatform.isGenode then drv.overrideAttrs f else drv;
|
|
|
|
overrideTargetAttrs = drv: f:
|
|
if targetPlatform.isGenode then drv.overrideAttrs f else drv;
|
|
|
|
addPatches = drv: patch:
|
|
overrideTargetAttrs drv
|
|
(attrs: { patches = attrs.patches or [ ] ++ [ patch ]; });
|
|
|
|
in {
|
|
|
|
bash = overrideTargetAttrs bash (attrs: {
|
|
configureFlags = attrs.configureFlags
|
|
++ [ "--without-bash-malloc" ]; # no sbrk please
|
|
});
|
|
|
|
boehmgc = overrideHostAttrs boehmgc (attrs: {
|
|
patches = [ ./boehmgc/genode.patch ];
|
|
configureFlags = attrs.configureFlags ++ [ "--enable-threads=none" ];
|
|
});
|
|
|
|
binutils-unwrapped =
|
|
addPatches binutils-unwrapped [ ./binutils/support-genode.patch ];
|
|
|
|
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
|
|
'';
|
|
});
|
|
|
|
coreutils = if targetPlatform.isGenode then
|
|
(coreutils.override {
|
|
gmp = null;
|
|
libiconv = null;
|
|
}).overrideAttrs (attrs: {
|
|
configureFlags = [
|
|
"--disable-acl"
|
|
"--disable-largefile"
|
|
"--disable-xattr"
|
|
"--disable-libcap"
|
|
"--disable-nls"
|
|
];
|
|
})
|
|
else
|
|
coreutils;
|
|
|
|
gdb = addPatches gdb [ ./gdb/genode.patch ];
|
|
|
|
inherit (final.genodeSources) genodeBase;
|
|
|
|
genodeLibcCross = callPackage ./libc { };
|
|
|
|
genodePackages = import ../packages { nixpkgs = final; };
|
|
|
|
genodeSources = buildPackages.callPackage ../packages/genodelabs { };
|
|
|
|
libcCrossChooser = name:
|
|
if stdenv.targetPlatform.isGenode then
|
|
targetPackages.genodeLibcCross or genodeLibcCross
|
|
else
|
|
prev.libcCrossChooser name;
|
|
|
|
llvmPackages_8 = callPackage ./llvm-8 ({
|
|
inherit (stdenvAdapters) overrideCC;
|
|
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
|
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
|
});
|
|
|
|
openssl = overrideHostAttrs openssl (attrs: {
|
|
configureScript = "./Configure BSD-generic64";
|
|
configureFlags = attrs.configureFlags ++ [ "no-devcryptoeng" "no-tests" ];
|
|
});
|
|
|
|
solo5-tools = callPackage ./solo5-tools { };
|
|
|
|
tup = prev.tup.overrideAttrs (attrs: { setupHook = ./tup/setup-hook.sh; });
|
|
|
|
}
|