@@ -41,7 +41,7 @@ in stdenv.mkDerivation (finalAttrs: {
4141 "-DCMAKE_BUILD_TYPE=${ if debugVersion then "Debug" else "Release" } "
4242 "-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
4343 "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${ llvmNativeTarget } "
44- "-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt;clang-tools-extra "
44+ "-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt"
4545 ]
4646 ++ lib . optionals enableManpages [
4747 "-DLLVM_BINUTILS_INCDIR=${ libbfd . dev } /include"
@@ -52,34 +52,40 @@ in stdenv.mkDerivation (finalAttrs: {
5252 "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
5353 ] ;
5454
55- patches = [
56- ./install-symlinks.patch
57- ] ;
58-
5955 postPatch = ''
6056 patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh
6157 substituteInPlace ../clang/cmake/modules/CMakeLists.txt \
6258 --replace 'FILES_MATCHING' 'NO_SOURCE_PERMISSIONS FILES_MATCHING'
6359 '' ;
6460
65- updateScript = writeScript "update.sh" ''
66- #!/usr/bin/env nix-shell
67- #!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github
68-
69- version="$(curl '' ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} -sL "https://api.github.com/repos/RadeonOpenCompute/llvm-project/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
70- current_version="$(grep "version =" pkgs/development/compilers/llvm/rocm/default.nix | cut -d'"' -f2)"
71- if [[ "$version" != "$current_version" ]]; then
72- tarball_meta="$(nix-prefetch-github RadeonOpenCompute llvm-project --rev "rocm-$version")"
73- tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))"
74- sed -i "pkgs/development/compilers/llvm/rocm/default.nix" \
75- -e 's,version = "\(.*\)",version = "'"$version"'",' \
76- -e 's,hash = "\(.*\)",hash = "sha256-'"$tarball_hash"'",'
77- else
78- echo rocm-llvm already up-to-date
79- fi
80- '' ;
61+ passthru = {
62+ isClang = true ;
63+
64+ updateScript = writeScript "update.sh" ''
65+ #!/usr/bin/env nix-shell
66+ #!nix-shell -i bash -p curl jq common-updater-scripts nix-prefetch-github
67+
68+ version="$(curl '' ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
69+ -sL "https://api.github.com/repos/RadeonOpenCompute/llvm-project/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
70+
71+ IFS='.' read -a version_arr <<< "$version"
72+
73+ if [ "'' ${#version_arr[*]}" == 2 ]; then
74+ version="'' ${version}.0"
75+ fi
8176
82- passthru . isClang = true ;
77+ current_version="$(grep "version =" pkgs/development/compilers/llvm/rocm/default.nix | cut -d'"' -f2)"
78+ if [[ "$version" != "$current_version" ]]; then
79+ tarball_meta="$(nix-prefetch-github RadeonOpenCompute llvm-project --rev "rocm-$version")"
80+ tarball_hash="$(nix to-base64 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))"
81+ sed -i "pkgs/development/compilers/llvm/rocm/default.nix" \
82+ -e 's,version = "\(.*\)",version = "'"$version"'",' \
83+ -e 's,hash = "\(.*\)",hash = "sha256-'"$tarball_hash"'",'
84+ else
85+ echo rocm-llvm already up-to-date
86+ fi
87+ '' ;
88+ } ;
8389
8490 meta = with lib ; {
8591 description = "ROCm fork of the LLVM compiler infrastructure" ;
0 commit comments