2021-08-22 20:19:47 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
|
2021-12-23 22:36:41 +00:00
|
|
|
, cli11, nlohmann_json, curl, libarchive, libyamlcpp, libsolv, reproc, spdlog, termcolor, ghc_filesystem
|
2021-07-04 19:28:28 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
libsolv' = libsolv.overrideAttrs (oldAttrs: {
|
|
|
|
cmakeFlags = oldAttrs.cmakeFlags ++ [
|
2021-08-22 20:19:47 +01:00
|
|
|
"-DENABLE_CONDA=true"
|
2021-07-04 19:28:28 +01:00
|
|
|
];
|
2021-08-22 20:19:47 +01:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Patch added by the mamba team
|
|
|
|
(fetchpatch {
|
2021-12-23 22:36:41 +00:00
|
|
|
url = "https://raw.githubusercontent.com/mamba-org/boa-forge/20530f80e2e15012078d058803b6e2c75ed54224/libsolv/add_strict_repo_prio_rule.patch";
|
2021-08-22 20:19:47 +01:00
|
|
|
sha256 = "19c47i5cpyy88nxskf7k6q6r43i55w61jvnz7fc2r84hpjkcrv7r";
|
|
|
|
})
|
|
|
|
# Patch added by the mamba team
|
|
|
|
(fetchpatch {
|
2021-12-23 22:36:41 +00:00
|
|
|
url = "https://raw.githubusercontent.com/mamba-org/boa-forge/20530f80e2e15012078d058803b6e2c75ed54224/libsolv/conda_variant_priorization.patch";
|
2021-08-22 20:19:47 +01:00
|
|
|
sha256 = "1iic0yx7h8s662hi2jqx68w5kpyrab4fr017vxd4wyxb6wyk35dd";
|
|
|
|
})
|
2021-12-07 23:30:52 +00:00
|
|
|
];
|
2021-07-04 19:28:28 +01:00
|
|
|
});
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "micromamba";
|
2021-12-23 22:36:41 +00:00
|
|
|
version = "0.18.1";
|
2021-07-04 19:28:28 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mamba-org";
|
|
|
|
repo = "mamba";
|
|
|
|
rev = version;
|
2021-12-23 22:36:41 +00:00
|
|
|
sha256 = "1gr9r257l300hafp8zm61bn58rysdk9i4wv1879q96b6n6v8hwa6";
|
2021-07-04 19:28:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cli11
|
|
|
|
nlohmann_json
|
|
|
|
curl
|
|
|
|
libarchive
|
2021-12-23 22:36:41 +00:00
|
|
|
libyamlcpp
|
2021-07-04 19:28:28 +01:00
|
|
|
libsolv'
|
|
|
|
reproc
|
2021-12-23 22:36:41 +00:00
|
|
|
spdlog
|
|
|
|
termcolor
|
|
|
|
ghc_filesystem
|
2021-07-04 19:28:28 +01:00
|
|
|
];
|
|
|
|
|
2021-12-23 22:36:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
# See https://github.com/gabime/spdlog/issues/1897
|
|
|
|
sed -i '1a add_compile_definitions(SPDLOG_FMT_EXTERNAL)' CMakeLists.txt
|
|
|
|
echo 'target_link_libraries(micromamba PRIVATE -lspdlog -lfmt)' >> micromamba/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
2021-07-04 19:28:28 +01:00
|
|
|
cmakeFlags = [
|
2021-12-23 22:36:41 +00:00
|
|
|
"-DBUILD_LIBMAMBA=ON"
|
|
|
|
"-DBUILD_SHARED=ON"
|
|
|
|
"-DBUILD_MICROMAMBA=ON"
|
|
|
|
# "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
|
2021-07-04 19:28:28 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Reimplementation of the conda package manager";
|
|
|
|
homepage = "https://github.com/mamba-org/mamba";
|
|
|
|
license = licenses.bsd3;
|
2021-12-23 22:36:41 +00:00
|
|
|
platforms = platforms.linux;
|
2021-07-04 19:28:28 +01:00
|
|
|
maintainers = with maintainers; [ mausch ];
|
|
|
|
};
|
|
|
|
}
|