depot/third_party/nixpkgs/pkgs/development/compilers/llvm/common/common-let.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

62 lines
1.6 KiB
Nix

{ lib
, fetchFromGitHub ? null
, release_version ? null
, gitRelease ? null
, officialRelease ? null
, monorepoSrc' ? null
, version ? null,
}@args:
rec {
llvm_meta = {
license = lib.licenses.ncsa;
maintainers = lib.teams.llvm.members;
# See llvm/cmake/config-ix.cmake.
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 ++
lib.optionals (lib.versionAtLeast release_version "16") lib.platforms.loongarch64;
};
releaseInfo =
if gitRelease != null then rec {
original = gitRelease;
release_version = args.version or original.version;
version = gitRelease.rev-version;
} else rec {
original = officialRelease;
release_version = args.version or original.version;
version =
if original ? candidate then
"${release_version}-${original.candidate}"
else
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;
};
}