app-i18n/zh-autoconvert: update nvchecker
[gentoo-zh.git] / dev-util / mamba / mamba-1.5.8.ebuild
blobbf1b150651d5ea7dd6b8d4cfd48dbf44fcad1277
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 #DISTUTILS_USE_PEP517=no
7 DISTUTILS_EXT=1
8 DISTUTILS_OPTIONAL=1
9 DISTUTILS_SINGLE_IMPL=1
10 PYTHON_COMPAT=( python3_{10..12} )
12 inherit distutils-r1 cmake multilib
14 DESCRIPTION="The Fast Cross-Platform Package Manager"
15 HOMEPAGE="https://github.com/mamba-org/mamba"
16 SRC_URI="https://github.com/mamba-org/mamba/archive/refs/tags/${P}.tar.gz"
18 LICENSE="BSD"
19 SLOT="0/2"
20 KEYWORDS="~amd64"
21 IUSE="python micromamba"
22 # PROPERTIES="test_network"
23 RESTRICT="test"
24 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26 DEPEND="app-arch/libarchive:=
27         app-arch/zstd:=
28         dev-cpp/cli11
29         dev-cpp/nlohmann_json
30         dev-cpp/reproc:=
31         dev-cpp/tl-expected
32         dev-cpp/yaml-cpp:=
33         dev-libs/libfmt:=
34         dev-libs/spdlog
35         net-misc/curl
36         sys-libs/libsolv:=[conda]
37         python? ( ${PYTHON_DEPS} )
39 # conflict to micromamba from benzene-overlay
40 RDEPEND="${DEPEND}
41         !dev-util/micromamba-bin
42         !dev-util/micromamba
44 BDEPEND="python? (
45                 ${PYTHON_DEPS}
46                 ${DISTUTILS_DEPS}
47                 $(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]')
48         )
50 #       test? (
51 #               app-shells/dash
52 #               app-shells/tcsh
53 #               app-shells/zsh
54 #               $(python_gen_cond_dep '
55 #                       dev-python/pytest-lazy-fixture[${PYTHON_USEDEP}]
56 #                       dev-python/pytest-xprocess[${PYTHON_USEDEP}]
57 #               ')
58 #       )
60 S="${WORKDIR}/${PN}-${P}"
62 # distutils_enable_tests pytest
64 # EPYTEST_IGNORE=(
65         # No module named 'conda_package_handling'
66         # Depends on dev-python/zstandard[${PYTHON_USEDEP}]
67 #       micromamba/tests/test_package.py
68 # )
70 src_prepare() {
71         cmake_src_prepare
72         use python && { sed -i \
73                 "s|\${CMAKE_CURRENT_SOURCE_DIR}|\${CMAKE_INSTALL_PREFIX}\/$(python_get_sitedir | sed -e 's|/usr/||')|" \
74                 libmambapy/CMakeLists.txt || die ; pushd libmambapy || die ; distutils-r1_src_prepare ;
75         }
78 src_configure() {
79         cat > "${T}"/zstdConfig.cmake <<-EOF || die
80                 add_library(zstd::libzstd_shared SHARED IMPORTED)
81                 set_target_properties(zstd::libzstd_shared PROPERTIES
82                         IMPORTED_LOCATION "${EPREFIX}/usr/$(get_libdir)/libzstd$(get_libname)")
83         EOF
84         local mycmakeargs=(
85                 -DCMAKE_BUILD_TYPE=Release
86                 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
87                 -DCMAKE_POSITION_INDEPENDENT_CODE=ON
88                 -DBUILD_LIBMAMBA=ON
89                 -DBUILD_LIBMAMBAPY=$(usex python)
90                 -DBUILD_LIBMAMBA_TESTS=NO
91                 -DBUILD_MAMBA_PACKAGE=OFF
92                 -DBUILD_MICROMAMBA=$(usex micromamba)
93                 -DBUILD_SHARED=ON
94                 -DBUILD_STATIC=OFF
95                 -Dzstd_DIR="${T}"
96         )
97         cmake_src_configure
100 src_compile() {
101         cmake_src_compile
102         use python && { pushd libmambapy || die ; distutils-r1_src_compile ; }
105 src_install() {
106         cmake_src_install
107         use python && { pushd libmambapy || die ; distutils-r1_src_install ; }