2020-06-16 15:32:48 +08:00
|
|
|
{ pkgs, version, src }:
|
|
|
|
|
|
|
|
let
|
|
|
|
wfvm = import ../wfvm { inherit pkgs; };
|
|
|
|
build = wfvm.utils.wfvm-run {
|
|
|
|
name = "build-llvm-or1k";
|
2020-06-18 16:21:11 +08:00
|
|
|
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 cmake msvc ]; };
|
2020-06-16 15:32:48 +08:00
|
|
|
script = ''
|
|
|
|
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda create -n build --offline"
|
|
|
|
|
|
|
|
cat > meta.yaml << EOF
|
|
|
|
package:
|
|
|
|
name: llvm-or1k
|
|
|
|
version: ${version}
|
|
|
|
|
|
|
|
source:
|
|
|
|
url: ../src.tar
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > bld.bat << EOF
|
|
|
|
set BUILD_TYPE=Release
|
2020-06-18 16:21:11 +08:00
|
|
|
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
|
2020-06-16 15:32:48 +08:00
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake .. -G "%CMAKE_GENERATOR%" ^
|
2020-06-18 16:21:11 +08:00
|
|
|
-Thost=x64 ^
|
2020-06-16 15:32:48 +08:00
|
|
|
-DCMAKE_BUILD_TYPE="%BUILD_TYPE%" ^
|
|
|
|
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
|
|
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON ^
|
|
|
|
-DLLVM_TARGETS_TO_BUILD=X86;ARM ^
|
|
|
|
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K ^
|
|
|
|
-DLLVM_ENABLE_ASSERTIONS=OFF ^
|
|
|
|
-DLLVM_INSTALL_UTILS=ON ^
|
|
|
|
-DLLVM_INCLUDE_TESTS=OFF ^
|
|
|
|
-DLLVM_INCLUDE_DOCS=OFF ^
|
|
|
|
-DLLVM_INCLUDE_EXAMPLES=OFF
|
|
|
|
if errorlevel 1 exit 1
|
|
|
|
cmake --build . --config "%BUILD_TYPE%" --parallel 4
|
|
|
|
if errorlevel 1 exit 1
|
|
|
|
cmake --build . --config "%BUILD_TYPE%" --target install
|
|
|
|
if errorlevel 1 exit 1
|
|
|
|
EOF
|
|
|
|
|
|
|
|
${wfvm.utils.win-exec}/bin/win-exec "mkdir llvm-or1k"
|
2020-06-17 23:40:49 +08:00
|
|
|
${wfvm.utils.win-put}/bin/win-put meta.yaml llvm-or1k
|
|
|
|
${wfvm.utils.win-put}/bin/win-put bld.bat llvm-or1k
|
2020-06-16 15:32:48 +08:00
|
|
|
ln -s ${src} src
|
|
|
|
tar chf src.tar src
|
2020-06-17 23:40:49 +08:00
|
|
|
${wfvm.utils.win-put}/bin/win-put src.tar .
|
2020-06-16 15:32:48 +08:00
|
|
|
|
|
|
|
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate build && conda build --no-anaconda-upload --no-test llvm-or1k"
|
|
|
|
|
2020-06-18 00:10:33 +08:00
|
|
|
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/llvm-or1k-${version}-0.tar.bz2"
|
2020-06-16 15:32:48 +08:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.runCommand "conda-windows-llvm-or1k" { buildInputs = [ build ]; } ''
|
|
|
|
wfvm-run-build-llvm-or1k
|
|
|
|
mkdir -p $out/win-64 $out/nix-support
|
2020-06-18 00:10:57 +08:00
|
|
|
cp llvm-or1k-*.tar.bz2 $out/win-64
|
2020-06-16 15:32:48 +08:00
|
|
|
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
|
|
|
''
|