Skip to content

Commit 5ab4287

Browse files
bhippleFRidh
authored andcommittedFeb 18, 2018
conda: init at miniconda3 4.3.31 (#34872)
* conda: init at miniconda3 4.3.31
1 parent c64639b commit 5ab4287

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{ lib
2+
, stdenv
3+
, fetchurl
4+
, runCommand
5+
, makeWrapper
6+
, buildFHSUserEnv
7+
, libselinux
8+
, xorg
9+
# Conda installs its packages and environments under this directory
10+
, installationPath ? "~/.conda"
11+
# Conda manages most pkgs itself, but expects a few to be on the system.
12+
, condaDeps ? [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ]
13+
# Any extra nixpkgs you'd like available in the FHS env for Conda to use
14+
, extraPkgs ? [ ]
15+
}:
16+
17+
# How to use this package?
18+
#
19+
# First-time setup: this nixpkg downloads the conda installer and provides a FHS
20+
# env in which it can run. On first use, the user will need to install conda to
21+
# the installPath using the installer:
22+
# $ nix-env -iA conda
23+
# $ conda-shell
24+
# $ conda-install
25+
#
26+
# Under normal usage, simply call `conda-shell` to activate the FHS env,
27+
# and then use conda commands as normal:
28+
# $ conda-shell
29+
# $ conda install spyder
30+
let
31+
version = "4.3.31";
32+
src = fetchurl {
33+
url = "https://repo.continuum.io/miniconda/Miniconda3-${version}-Linux-x86_64.sh";
34+
sha256 = "1rklq81s9v7xz1q0ha99w2sl6kyc5vhk6b21cza0jr3b8cgz0lam";
35+
};
36+
37+
conda = runCommand "conda-install" { buildInputs = [ makeWrapper ]; }
38+
''
39+
mkdir -p $out/bin
40+
cp ${src} $out/bin/miniconda-installer.sh
41+
chmod +x $out/bin/miniconda-installer.sh
42+
43+
makeWrapper \
44+
$out/bin/miniconda-installer.sh \
45+
$out/bin/conda-install \
46+
--add-flags "-p ${installationPath}" \
47+
--add-flags "-b"
48+
'';
49+
in
50+
buildFHSUserEnv {
51+
name = "conda-shell";
52+
targetPkgs = pkgs: (builtins.concatLists [ [ conda ] condaDeps extraPkgs]);
53+
profile = ''
54+
# Add conda to PATH
55+
export PATH=${installationPath}/bin:$PATH
56+
# Paths for gcc if compiling some C sources with pip
57+
export NIX_CFLAGS_COMPILE="-I${installationPath}/include"
58+
export NIX_CFLAGS_LINK="-L${installationPath}lib"
59+
# Some other required environment variables
60+
export FONTCONFIG_FILE=/etc/fonts/fonts.conf
61+
export QTCOMPOSE=${xorg.libX11}/share/X11/locale
62+
'';
63+
64+
meta = {
65+
description = "Conda is a package manager for Python";
66+
homepage = https://conda.io/;
67+
platforms = lib.platforms.linux;
68+
license = lib.licenses.bsd3;
69+
maintainers = with lib.maintainers; [ jluttine bhipple ];
70+
};
71+
}

‎pkgs/top-level/all-packages.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,8 @@ with pkgs;
16811681

16821682
checkbashisms = callPackage ../development/tools/misc/checkbashisms { };
16831683

1684+
ckb = libsForQt5.callPackage ../tools/misc/ckb { };
1685+
16841686
clamav = callPackage ../tools/security/clamav { };
16851687

16861688
clex = callPackage ../tools/misc/clex { };
@@ -1703,10 +1705,10 @@ with pkgs;
17031705

17041706
cloud-utils = callPackage ../tools/misc/cloud-utils { };
17051707

1706-
ckb = libsForQt5.callPackage ../tools/misc/ckb { };
1707-
17081708
compass = callPackage ../development/tools/compass { };
17091709

1710+
conda = callPackage ../tools/package-management/conda { };
1711+
17101712
convmv = callPackage ../tools/misc/convmv { };
17111713

17121714
convoy = callPackage ../tools/filesystems/convoy { };

0 commit comments

Comments
 (0)
Please sign in to comment.