lol
1{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
2, cli11, nlohmann_json, curl, libarchive, libyamlcpp, libsolv, reproc
3}:
4
5let
6 libsolv' = libsolv.overrideAttrs (oldAttrs: {
7 cmakeFlags = oldAttrs.cmakeFlags ++ [
8 "-DENABLE_CONDA=true"
9 ];
10
11 patches = [
12 # Patch added by the mamba team
13 (fetchpatch {
14 url = "https://raw.githubusercontent.com/mamba-org/boa-forge/f766da0cc18701c4d107a41de22417a65b53cc2d/libsolv/add_strict_repo_prio_rule.patch";
15 sha256 = "19c47i5cpyy88nxskf7k6q6r43i55w61jvnz7fc2r84hpjkcrv7r";
16 })
17 # Patch added by the mamba team
18 (fetchpatch {
19 url = "https://raw.githubusercontent.com/mamba-org/boa-forge/f766da0cc18701c4d107a41de22417a65b53cc2d/libsolv/conda_variant_priorization.patch";
20 sha256 = "1iic0yx7h8s662hi2jqx68w5kpyrab4fr017vxd4wyxb6wyk35dd";
21 })
22 # Patch added by the mamba team
23 (fetchpatch {
24 url = "https://raw.githubusercontent.com/mamba-org/boa-forge/f766da0cc18701c4d107a41de22417a65b53cc2d/libsolv/memcpy_to_memmove.patch";
25 sha256 = "1c9ir40l6crcxllj5zwhzbrbgibwqaizyykd0vip61gywlfzss64";
26 })
27 ];
28 });
29
30 # fails linking with yaml-cpp 0.7.x
31 libyamlcpp' = libyamlcpp.overrideAttrs (oldAttrs: rec {
32
33 version = "0.6.3";
34
35 src = fetchFromGitHub {
36 owner = "jbeder";
37 repo = "yaml-cpp";
38 rev = "yaml-cpp-${version}";
39 sha256 = "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s";
40 };
41 });
42in
43stdenv.mkDerivation rec {
44 pname = "micromamba";
45 version = "0.15.0";
46
47 src = fetchFromGitHub {
48 owner = "mamba-org";
49 repo = "mamba";
50 rev = version;
51 sha256 = "1zksp4zqj4wn9p9jb1qx1acajaz20k9xnm80yi7bab2d37y18hcw";
52 };
53
54 nativeBuildInputs = [ cmake ];
55
56 buildInputs = [
57 cli11
58 nlohmann_json
59 curl
60 libarchive
61 libyamlcpp'
62 libsolv'
63 reproc
64 # python3Packages.pybind11 # Would be necessary if someone wants to build with bindings I guess.
65 ];
66
67 cmakeFlags = [
68 "-DBUILD_BINDINGS=OFF" # Fails to build, I don't think it's necessary for now.
69 "-DBUILD_EXE=ON"
70 ];
71
72 CXXFLAGS = "-DMAMBA_USE_STD_FS";
73
74 meta = with lib; {
75 description = "Reimplementation of the conda package manager";
76 homepage = "https://github.com/mamba-org/mamba";
77 license = licenses.bsd3;
78 maintainers = with maintainers; [ mausch ];
79 };
80}