core/pkgs/by-name/ll/llvm/common/common-let.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-13 21:24:10 +00:00
{ lib, fetchFromGitHub ? null, release_version ? null, gitRelease ? null
, officialRelease ? null, monorepoSrc' ? null }:
2024-05-02 00:46:19 +00:00
rec {
llvm_meta = {
license = lib.licenses.ncsa;
# maintainers = lib.teams.llvm.members;
2024-05-02 00:46:19 +00:00
# See llvm/cmake/config-ix.cmake.
2024-05-13 21:24:10 +00:00
platforms = lib.platforms.aarch64 ++ lib.platforms.arm ++ lib.platforms.mips
++ lib.platforms.power ++ lib.platforms.s390x ++ lib.platforms.wasi
++ lib.platforms.x86
++ lib.optionals (lib.versionAtLeast release_version "7")
lib.platforms.riscv
++ lib.optionals (lib.versionAtLeast release_version "14")
lib.platforms.m68k;
2024-05-02 00:46:19 +00:00
};
2024-05-13 21:24:10 +00:00
releaseInfo = if gitRelease != null then rec {
original = gitRelease;
release_version = original.version;
version = gitRelease.rev-version;
} else rec {
original = officialRelease;
release_version = original.version;
version = if original ? candidate then
"${release_version}-${original.candidate}"
2024-05-02 00:46:19 +00:00
else
2024-05-13 21:24:10 +00:00
release_version;
};
monorepoSrc = if monorepoSrc' != null then
monorepoSrc'
else
let
sha256 = releaseInfo.original.sha256;
rev = if gitRelease != null then
gitRelease.rev
else
"llvmorg-${releaseInfo.version}";
in fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
inherit rev sha256;
};
2024-05-02 00:46:19 +00:00
}