1
0
Fork 0

conda: add llvmlite-artiq

This commit is contained in:
Sebastien Bourdeauducq 2020-06-10 11:53:43 +08:00
parent c7fa00304b
commit f1742db24f
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,69 @@
{ pkgs, conda-llvm-or1k, version, src }:
let
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
fake-src = pkgs.runCommand "conda-fake-source-llvmlite-artiq" { }
''
mkdir -p $out/fake-conda;
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
cp --no-preserve=mode,ownership -R ${src} workaround-conda
pushd workaround-conda
tar cf $out/src.tar .
popd
rm -rf workaround-conda
cat << EOF > $out/fake-conda/meta.yaml
package:
name: llvmlite-artiq
version: ${version}
source:
url: ../src.tar
# Again, we don't specify build dependencies since the conda garbage mistakenly thinks
# that they are not there if they have been installed from files.
requirements:
run:
- python
- ncurses [linux]
EOF
cat << EOF > $out/fake-conda/build.sh
#!/bin/bash
set -e
export LD_LIBRARY_PATH=/lib
python setup.py install \
--prefix=\$PREFIX \
--single-version-externally-managed \
--record=record.txt \
--no-compile
EOF
chmod 755 $out/fake-conda/build.sh
'';
in
pkgs.stdenv.mkDerivation {
name = "conda-llvmlite-artiq";
src = fake-src;
buildCommand =
''
HOME=`pwd`
mkdir $out
cat << EOF > conda-commands.sh
set -e
conda create --prefix ./conda_tmp ${conda-llvm-or1k}/*/*.tar.bz2
conda init
source .bashrc
conda activate ./conda_tmp
conda build --no-anaconda-upload --no-test --output-folder $out $src/fake-conda
EOF
${condaBuilderEnv}/bin/conda-builder-env conda-commands.sh
mkdir -p $out/nix-support
echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
'';
}

View File

@ -59,6 +59,10 @@ let
inherit (llvm-or1k) version; inherit (llvm-or1k) version;
src = llvm-or1k.llvm-src; src = llvm-or1k.llvm-src;
}; };
conda-llvmlite-artiq = import ./conda/llvmlite-artiq.nix {
inherit pkgs conda-llvm-or1k;
inherit (llvmlite-artiq) version src;
};
conda-sipyco = import ./conda/build.nix { inherit pkgs; } { conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
name = "conda-sipyco"; name = "conda-sipyco";
src = import ./conda/fake-source.nix { inherit pkgs; } { src = import ./conda/fake-source.nix { inherit pkgs; } {

View File

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }: { stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {
name = "llvmlite-artiq"; name = "llvmlite-artiq";
version = "0.23.0.dev";
src = fetchFromGitHub { src = fetchFromGitHub {
rev = "158f9d3a898dbf055ca513d69505df288c681fea"; rev = "158f9d3a898dbf055ca513d69505df288c681fea";
owner = "m-labs"; owner = "m-labs";