From e9c07a8985670aab20991bb8d71542662ff7eba7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 9 Jun 2020 17:29:38 +0800 Subject: [PATCH] conda: build binutils --- artiq-fast/conda/builder-env.nix | 13 +++++++++++++ artiq-fast/default.nix | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/artiq-fast/conda/builder-env.nix b/artiq-fast/conda/builder-env.nix index eb211cb..edd0b09 100644 --- a/artiq-fast/conda/builder-env.nix +++ b/artiq-fast/conda/builder-env.nix @@ -16,11 +16,24 @@ let targetPkgs = pkgs: ([ condaSrcChmod ] ++ condaDeps); }; + libiconv-filename = "libiconv-1.15-h516909a_1006.tar.bz2"; + libiconv = pkgs.fetchurl { + url = "https://anaconda.org/conda-forge/libiconv/1.15/download/linux-64/${libiconv-filename}"; + sha256 = "1y1g807881j95f9s6mjinf6b7mqa51vc9jf0v7cx8hn7xx4d10ik"; + }; + condaInstalled = runCommand "conda-installed" { } '' ${condaInstallerEnv}/bin/conda-installer-env -c "${condaSrcChmod}/conda-installer.sh -p $out -b" substituteInPlace $out/lib/python3.7/site-packages/conda/gateways/disk/__init__.py \ --replace "os.chmod(path, 0o2775)" "pass" + + # The conda garbage breaks if the package filename is prefixed with the Nix store hash. + # Symptom is "WARNING conda.core.prefix_data:_load_single_record(167): Ignoring malformed + # prefix record at: /nix/store/[...].json", and the package is not registered in the conda + # list, even though its files are installed. + ln -s ${libiconv} ${libiconv-filename} + ${condaInstallerEnv}/bin/conda-installer-env -c "$out/bin/conda install ${libiconv-filename}" ''; in buildFHSUserEnv { diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index 1796cb7..1a44933 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -44,6 +44,16 @@ let dependencies = ["regex"]; }; }; + conda-binutils-or1k = import ./conda/binutils.nix { + inherit pkgs; + inherit (binutils-or1k) version src; + target = "or1k-linux"; + }; + conda-binutils-arm = import ./conda/binutils.nix { + inherit pkgs; + inherit (binutils-arm) version src; + target = "armv7-unknown-linux-gnueabihf"; + }; conda-sipyco = import ./conda/build.nix { inherit pkgs; } { name = "conda-sipyco"; src = import ./conda/fake-source.nix { inherit pkgs; } {