1{
2 lib,
3 buildPythonPackage,
4 pythonRelaxDepsHook,
5 hostPlatform,
6 fetchFromGitHub,
7 # build dependencies
8 hatchling,
9 hatch-vcs,
10 # runtime dependencies
11 archspec,
12 conda-libmamba-solver,
13 conda-package-handling,
14 distro,
15 jsonpatch,
16 packaging,
17 platformdirs,
18 pluggy,
19 pycosat,
20 requests,
21 ruamel-yaml,
22 tqdm,
23 truststore,
24 # runtime options
25 defaultEnvPath ? "~/.conda/envs", # default path to store conda environments
26 defaultPkgPath ? "~/.conda/pkgs", # default path to store download conda packages
27}:
28buildPythonPackage rec {
29 pname = "conda";
30 version = "24.4.0";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 inherit pname version;
35 owner = "conda";
36 repo = "conda";
37 rev = "refs/tags/${version}";
38 hash = "sha256-LdoBlR5EFYd2mQIjOgp1MH3w6osfRfurPq+N5Y1iaFw=";
39 };
40
41 nativeBuildInputs = [ pythonRelaxDepsHook ];
42
43 build-system = [
44 hatchling
45 hatch-vcs
46 ];
47
48 dependencies = [
49 archspec
50 conda-libmamba-solver
51 conda-package-handling
52 distro
53 jsonpatch
54 packaging
55 platformdirs
56 pluggy
57 pycosat
58 requests
59 ruamel-yaml
60 tqdm
61 truststore
62 ];
63
64 patches = [ ./0001-conda_exe.patch ];
65
66 makeWrapperArgs = [
67 "--set CONDA_EXE ${placeholder "out"}/bin/conda"
68 ''--set-default CONDA_ENVS_PATH "${defaultEnvPath}"''
69 ''--set-default CONDA_PKGS_DIRS "${defaultPkgPath}"''
70 ];
71
72 pythonImportsCheck = [ "conda" ];
73
74 # menuinst is currently not packaged
75 pythonRemoveDeps = lib.optionals (!hostPlatform.isWindows) [ "menuinst" ];
76
77 meta = {
78 description = "OS-agnostic, system-level binary package manager";
79 homepage = "https://github.com/conda/conda";
80 license = lib.licenses.bsd3;
81 maintainers = [ lib.maintainers.ericthemagician ];
82 };
83}