From d87246a418a9aefd553fc2ae48380aedef90bdfb Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:59:24 +0800 Subject: [PATCH] conda: fix aarch64-linux (#363620) --- pkgs/by-name/co/conda/package.nix | 37 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/co/conda/package.nix b/pkgs/by-name/co/conda/package.nix index 00b55b26ab5c6..9fbfa31b90ca0 100644 --- a/pkgs/by-name/co/conda/package.nix +++ b/pkgs/by-name/co/conda/package.nix @@ -44,10 +44,26 @@ # $ conda install spyder let version = "24.9.2"; - src = fetchurl { - url = "https://repo.anaconda.com/miniconda/Miniconda3-py312_${version}-0-Linux-x86_64.sh"; - hash = "sha256-jZNrpgAwDgjso9h03uiMYcbzkwNZeytmuu5Ur097QSI="; - }; + selectSystem = + attrs: + attrs.${stdenv.hostPlatform.system} + or (throw "conda: ${stdenv.hostPlatform.system} is not supported"); + src = + let + arch = selectSystem { + x86_64-linux = "x86_64"; + aarch64-linux = "aarch64"; + }; + hash = selectSystem { + x86_64-linux = "sha256-jZNrpgAwDgjso9h03uiMYcbzkwNZeytmuu5Ur097QSI="; + aarch64-linux = "sha256-hrjfdIFkbPh+d4c+l4mtt1abWCSNOqYp6y2jXm8uLu0="; + }; + in + fetchurl { + url = "https://repo.anaconda.com/miniconda/Miniconda3-py312_${version}-0-Linux-${arch}.sh"; + inherit hash; + }; + conda = ( let libPath = lib.makeLibraryPath [ @@ -99,7 +115,7 @@ buildFHSEnv { # Some other required environment variables export FONTCONFIG_FILE=/etc/fonts/fonts.conf export QTCOMPOSE=${xorg.libX11}/share/X11/locale - export LIBARCHIVE=${libarchive.lib}/lib/libarchive.so + export LIBARCHIVE=${lib.getLib libarchive}/lib/libarchive.so # Allows `conda activate` to work properly condaSh=${installationPath}/etc/profile.d/conda.sh if [ ! -f $condaSh ]; then @@ -111,11 +127,14 @@ buildFHSEnv { runScript = "bash -l"; meta = { - description = "Conda is a package manager for Python"; + description = "Package manager for Python"; mainProgram = "conda-shell"; - homepage = "https://conda.io/"; - platforms = lib.platforms.linux; - license = lib.licenses.bsd3; + homepage = "https://conda.io"; + platforms = [ + "aarch64-linux" + "x86_64-linux" + ]; + license = with lib.licenses; [ bsd3 ]; maintainers = with lib.maintainers; [ jluttine ]; }; }