move fetch-llvm-clang.nix into llvm-hx.nix

This commit is contained in:
Sebastien Bourdeauducq 2019-04-06 15:20:49 +08:00
parent 1bf9b5eb2b
commit 298514fe0a
2 changed files with 21 additions and 26 deletions

View File

@ -1,22 +0,0 @@
{ runCommand, fetchFromGitHub, git }:
let
llvm-src = fetchFromGitHub {
rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7";
owner = "m-labs";
repo = "llvm-or1k";
sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa";
};
clang-src = fetchFromGitHub {
rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3";
owner = "m-labs";
repo = "clang-or1k";
sha256 = "0w5f450i76y162aswi2c7jip8x3arzljaxhbqp8qfdffm0rdbjp4";
};
in
runCommand "llvm_or1k_src" {}''
mkdir -p $out
mkdir -p $out/tools/clang
cp -r ${llvm-src}/* $out/
cp -r ${clang-src}/* $out/tools/clang
''

View File

@ -1,16 +1,33 @@
{ stdenv { stdenv
, git , fetchFromGitHub, runCommand
, callPackage
, perl, groff, cmake, libxml2, python, libffi, valgrind , perl, groff, cmake, libxml2, python, libffi, valgrind
, ... , ...
}: }:
let let
llvm-src = callPackage ./fetch-llvm-clang.nix {}; llvm-src = fetchFromGitHub {
rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7";
owner = "m-labs";
repo = "llvm-or1k";
sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa";
};
clang-src = fetchFromGitHub {
rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3";
owner = "m-labs";
repo = "clang-or1k";
sha256 = "0w5f450i76y162aswi2c7jip8x3arzljaxhbqp8qfdffm0rdbjp4";
};
combined-src = runCommand "llvm-clang-src" {}
''
mkdir -p $out
mkdir -p $out/tools/clang
cp -r ${llvm-src}/* $out/
cp -r ${clang-src}/* $out/tools/clang
'';
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "llvm-hx"; name = "llvm-hx";
src = llvm-src; src = combined-src;
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;