-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b65bdf
commit 44e5254
Showing
3 changed files
with
800 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
llvm_meta, | ||
src ? null, | ||
monorepoSrc ? null, | ||
version, | ||
release_version, | ||
runCommand, | ||
python3, | ||
python3Packages, | ||
patches ? [ ], | ||
cmake, | ||
ninja, | ||
isFullBuild ? true, | ||
}: | ||
let | ||
pname = "libc"; | ||
|
||
src' = | ||
if monorepoSrc != null then | ||
runCommand "${pname}-src-${version}" { } ('' | ||
mkdir -p "$out" | ||
cp -r ${monorepoSrc}/cmake "$out" | ||
cp -r ${monorepoSrc}/${pname} "$out" | ||
'') | ||
else | ||
src; | ||
in | ||
stdenv.mkDerivation (finalAttrs: { | ||
inherit pname version patches; | ||
|
||
src = src'; | ||
|
||
sourceRoot = | ||
if lib.versionOlder release_version "13" then null else "${finalAttrs.src.name}/${pname}"; | ||
|
||
nativeBuildInputs = | ||
[ cmake ] | ||
++ (lib.optional (lib.versionAtLeast release_version "15") ninja) | ||
++ (lib.optionals finalAttrs.passthru.isFullBuild [ | ||
python3 | ||
python3Packages.pyyaml | ||
]); | ||
|
||
postUnpack = lib.optionalString finalAttrs.passthru.isFullBuild '' | ||
patchShebangs --host $sourceRoot/hdrgen/yaml_to_classes.py | ||
chmod +x $sourceRoot/hdrgen/yaml_to_classes.py | ||
''; | ||
|
||
cmakeFlags = [ | ||
(lib.cmakeBool "LLVM_LIBC_FULL_BUILD" finalAttrs.passthru.isFullBuild) | ||
(lib.cmakeFeature "Python3_EXECUTABLE" (lib.getExe python3)) | ||
]; | ||
|
||
# For the update script: | ||
passthru = { | ||
monorepoSrc = monorepoSrc; | ||
inherit isFullBuild; | ||
}; | ||
|
||
meta = llvm_meta // { | ||
homepage = "https://libc.llvm.org/"; | ||
description = "Standard C library for LLVM"; | ||
}; | ||
}) |
Oops, something went wrong.