serene/nix/llvm_source.nix

42 lines
1.2 KiB
Nix

# Serene Programming Language
#
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
lib,
stdenv,
fetchgit,
url ? "https://github.com/llvm/llvm-project.git",
hash ? "sha256-8MEDLLhocshmxoEBRSKlJ/GzJ8nfuzQ8qn0X/vLA+ag=",
version ? "17.0.6",
ref ? "refs/tags/llvmorg-${version}"
}:
stdenv.mkDerivation rec{
pname = "llvm_source";
inherit version;
major = lib.versions.major version;
src = fetchgit {
inherit url hash;
rev = ref;
};
unpackPhase = "true";
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p "$out"
cp -rv "$src"/* "$out/"
'';
}