From 9e900d321e63a2bd03a9406dbbd3fcced2be40dd Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 9 Jun 2020 17:30:40 +0800 Subject: [PATCH] conda: add binutils.nix --- artiq-fast/conda/binutils.nix | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 artiq-fast/conda/binutils.nix diff --git a/artiq-fast/conda/binutils.nix b/artiq-fast/conda/binutils.nix new file mode 100644 index 0000000..823ea75 --- /dev/null +++ b/artiq-fast/conda/binutils.nix @@ -0,0 +1,45 @@ +{ pkgs, version, src, target }: + +let + fake-src = pkgs.runCommand "conda-fake-source-binutils-${target}" { } + '' + mkdir -p $out/fake-conda; + + cat << EOF > $out/fake-conda/meta.yaml + package: + name: binutils-${target} + version: ${version} + + source: + url: ${src} + + # Note: libiconv is also a build dependency, but the conda garbage won't find it + # if installed from a file (even if it shows up in conda list), as is the case + # when using this script. + requirements: + run: + - libiconv + + EOF + + cat << EOF > $out/fake-conda/build.sh + #!/bin/bash + set -e + + mkdir build + cd build + ../configure --target=${target} --prefix=\$PREFIX + make + make install + + # this is a copy of prefixed executables + rm -rf $PREFIX/${target} + + EOF + chmod 755 $out/fake-conda/build.sh + ''; +in + import ./build.nix { inherit pkgs; } { + name = "conda-binutils-${target}"; + src = fake-src; + }