1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, bzip2
6, cli11
7, cmake
8, curl
9, ghc_filesystem
10, libarchive
11, libsolv
12, yaml-cpp
13, nlohmann_json
14, python3
15, reproc
16, spdlog
17, termcolor
18, tl-expected
19}:
20
21let
22 libsolv' = libsolv.overrideAttrs (oldAttrs: {
23 cmakeFlags = oldAttrs.cmakeFlags ++ [
24 "-DENABLE_CONDA=true"
25 ];
26
27 patches = [
28 # Apply the same patch as in the "official" boa-forge build:
29 # https://github.com/mamba-org/boa-forge/tree/master/libsolv
30 (fetchpatch {
31 url = "https://raw.githubusercontent.com/mamba-org/boa-forge/20530f80e2e15012078d058803b6e2c75ed54224/libsolv/conda_variant_priorization.patch";
32 sha256 = "1iic0yx7h8s662hi2jqx68w5kpyrab4fr017vxd4wyxb6wyk35dd";
33 })
34 ];
35 });
36in
37stdenv.mkDerivation rec {
38 pname = "micromamba";
39 version = "1.2.0";
40
41 src = fetchFromGitHub {
42 owner = "mamba-org";
43 repo = "mamba";
44 rev = "micromamba-" + version;
45 sha256 = "sha256-KGlH5i/lI6c1Jj1ttAOrip8BKECaea5D202TJMcFDmM=";
46 };
47
48 nativeBuildInputs = [ cmake ];
49
50 buildInputs = [
51 bzip2
52 cli11
53 nlohmann_json
54 curl
55 libarchive
56 yaml-cpp
57 libsolv'
58 reproc
59 spdlog
60 termcolor
61 ghc_filesystem
62 python3
63 tl-expected
64 ];
65
66 cmakeFlags = [
67 "-DBUILD_LIBMAMBA=ON"
68 "-DBUILD_SHARED=ON"
69 "-DBUILD_MICROMAMBA=ON"
70 # "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
71 ];
72
73 meta = with lib; {
74 description = "Reimplementation of the conda package manager";
75 homepage = "https://github.com/mamba-org/mamba";
76 license = licenses.bsd3;
77 platforms = platforms.all;
78 maintainers = with maintainers; [ mausch ];
79 };
80}