Fix genode detection in overlay
This commit is contained in:
parent
837b701018
commit
272f6c8277
|
@ -14,6 +14,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
portIncludes = ports:
|
portIncludes = ports:
|
||||||
|
with builtins;
|
||||||
listToAttrs (map (name:
|
listToAttrs (map (name:
|
||||||
let port = getAttr name ports;
|
let port = getAttr name ports;
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
self: super:
|
self: super:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (super) lib stdenv;
|
inherit (super) lib;
|
||||||
|
|
||||||
genodeTarget = stdenv.targetPlatform ? isGenode
|
hasGenode = with super.stdenv;
|
||||||
-> stdenv.targetPlatform.isGenode;
|
(if hostPlatform ? isGenode then hostPlatform.isGenode else false)
|
||||||
|
|| (if targetPlatform ? isGenode then targetPlatform.isGenode else false);
|
||||||
|
|
||||||
genodelibc = self.callPackage ./libc { stdenv = self.crossLibcStdenv; };
|
genodelibc = self.callPackage ./libc { stdenv = self.crossLibcStdenv; };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
binutils-unwrapped = super.binutils-unwrapped.overrideAttrs
|
binutils-unwrapped = super.binutils-unwrapped.overrideAttrs (attrs: {
|
||||||
(attrs: { patches = attrs.patches ++ [ ./binutils.patch ]; });
|
patches = attrs.patches ++ (lib.optional hasGenode ./binutils.patch);
|
||||||
|
});
|
||||||
|
|
||||||
cmake = super.cmake.overrideAttrs (attrs: {
|
cmake = super.cmake.overrideAttrs (attrs: {
|
||||||
postInstall = if genodeTarget then ''
|
postInstall = if hasGenode then ''
|
||||||
local MODULE="$out/share/cmake-${
|
local MODULE="$out/share/cmake-${
|
||||||
lib.versions.majorMinor attrs.version
|
lib.versions.majorMinor attrs.version
|
||||||
}/Modules/Platform/Genode.cmake"
|
}/Modules/Platform/Genode.cmake"
|
||||||
|
@ -43,7 +45,7 @@ in {
|
||||||
postUnpack = attrs.postUnpack + ''
|
postUnpack = attrs.postUnpack + ''
|
||||||
patch -p1 -d $(ls -d llvm-*) -i ${./llvm-genode.patch}
|
patch -p1 -d $(ls -d llvm-*) -i ${./llvm-genode.patch}
|
||||||
'';
|
'';
|
||||||
cmakeFlags = attrs.cmakeFlags ++ (lib.optionals genodeTarget [
|
cmakeFlags = attrs.cmakeFlags ++ (lib.optionals hasGenode [
|
||||||
"-DCMAKE_C_FLAGS=-nodefaultlibs"
|
"-DCMAKE_C_FLAGS=-nodefaultlibs"
|
||||||
"-DLIBCXXABI_USE_LLVM_UNWINDER=OFF"
|
"-DLIBCXXABI_USE_LLVM_UNWINDER=OFF"
|
||||||
"-DLIBCXXABI_ENABLE_THREADS=OFF"
|
"-DLIBCXXABI_ENABLE_THREADS=OFF"
|
||||||
|
@ -57,16 +59,16 @@ in {
|
||||||
libcxx = (super.llvmPackages_8.libcxx.override {
|
libcxx = (super.llvmPackages_8.libcxx.override {
|
||||||
enableShared = false;
|
enableShared = false;
|
||||||
}).overrideAttrs (attrs: {
|
}).overrideAttrs (attrs: {
|
||||||
patches = attrs.patches ++ (lib.optional genodeTarget ./libc++.patch);
|
patches = attrs.patches ++ (lib.optional hasGenode ./libc++.patch);
|
||||||
nativeBuildInputs = attrs.nativeBuildInputs
|
nativeBuildInputs = attrs.nativeBuildInputs
|
||||||
++ [ super.buildPackages.python ];
|
++ [ super.buildPackages.python ];
|
||||||
cmakeFlags = attrs.cmakeFlags
|
cmakeFlags = attrs.cmakeFlags
|
||||||
++ (lib.optional genodeTarget "-DLIBCXX_ENABLE_THREADS=OFF");
|
++ (lib.optional hasGenode "-DLIBCXX_ENABLE_THREADS=OFF");
|
||||||
});
|
});
|
||||||
|
|
||||||
clang-unwrapped = super.llvmPackages_8.clang-unwrapped.overrideAttrs
|
clang-unwrapped = super.llvmPackages_8.clang-unwrapped.overrideAttrs
|
||||||
(attrs: {
|
(attrs: {
|
||||||
patches = attrs.patches ++ (lib.optional genodeTarget ./clang.patch);
|
patches = attrs.patches ++ [ ./clang.patch ];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue