2
0
Fork 0
genodepkgs/overlay/default.nix

135 lines
3.7 KiB
Nix
Raw Normal View History

{ flake }:
final: prev:
with prev;
let
2020-10-19 23:04:41 +02:00
overrideHost = drv: attrs:
if hostPlatform.isGenode then drv.override attrs else drv;
overrideHostAttrs = drv: f:
if hostPlatform.isGenode then drv.overrideAttrs f else drv;
2020-03-24 13:47:30 +01:00
overrideTarget = drv: f:
if targetPlatform.isGenode then drv.override 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 {
2020-03-24 13:47:30 +01: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
});
binutils-unwrapped = overrideTargetAttrs binutils-unwrapped (attrs: {
patches = attrs.patches ++ [ ./binutils/support-genode.patch ];
nativeBuildInputs = [ final.updateAutotoolsGnuConfigScriptsHook ];
});
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
});
coreutils = if targetPlatform.isGenode then
(coreutils.override {
gmp = null;
libiconv = null;
}).overrideAttrs (attrs: {
configureFlags = [
"--disable-acl"
"--disable-largefile"
"--disable-xattr"
"--disable-libcap"
"--disable-nls"
];
LDFLAGS = [ "-Wl,--no-as-needed" ];
# keep libposix NEEDED
})
else
coreutils;
gdb = addPatches gdb [ ./gdb/genode.patch ];
2020-04-05 18:50:52 +02:00
genodeLibcCross = callPackage ./libc { };
genodePackages = import ../packages {
inherit flake;
nixpkgs = final;
2020-10-19 23:04:41 +02:00
};
genodeSources =
buildPackages.callPackage ../packages/genodelabs { inherit flake; };
2020-11-01 20:23:01 +01:00
libconfig = overrideHostAttrs libconfig
(attrs: { configureFlags = [ "--disable-examples" ]; });
2020-03-24 13:47:30 +01:00
libcCrossChooser = name:
if stdenv.targetPlatform.isGenode then
targetPackages.genodeLibcCross
2020-03-24 13:47:30 +01:00
else
prev.libcCrossChooser name;
2020-11-01 20:23:01 +01:00
libsodium = overrideHostAttrs libsodium (attrs: {
patches = (attrs.patches or [ ]) ++ [ ./libsodium/genode.patch ];
});
libtool = overrideTargetAttrs libtool (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoconf automake115x ];
patches = ./libtool/genode.patch;
});
2020-11-01 20:23:01 +01:00
libtoxcore = overrideHost libtoxcore {
libopus = null;
libvpx = null;
ncurses = null;
};
2020-03-24 13:47:30 +01:00
llvmPackages_8 = callPackage ./llvm-8 ({
inherit (stdenvAdapters) overrideCC;
inherit (targetPackages.genodeSources) genodeBase;
2020-03-24 13:47:30 +01:00
buildLlvmTools = buildPackages.llvmPackages_8.tools;
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
});
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
});
rsync = overrideHost rsync { enableACLs = false; };
solo5-tools = callPackage ./solo5-tools { };
2020-06-10 18:21:26 +02:00
zlib = overrideHostAttrs zlib (attrs: {
postInstall = attrs.postInstall or "" + ''
pushd ''${!outputLib}/lib
find . -type l -delete
mv libz.so.* libz.so
popd
'';
});
}