#cmake parent directory
1 messages · Page 1 of 1 (latest)
OK, so I tried this Arch PKGBUILD
# Maintainer: Brian Thompson <brianrobt@pm.me>
# Contributor: Daniel Maslowski <info@orangecms.org>
# Contributor: Ke Liu <specter119@gmail.com>
pkgname=python-libmamba
pkgver=2.0.0
_srcver=2024.09.25
_name=mamba-$_srcver
pkgrel=1
pkgdesc="The fast cross-platform package manager"
arch=('x86_64')
url="https://github.com/mamba-org/mamba"
license=('BSD-3-Clause')
depends=(
'fmt'
'libsolv'
'python>=3.9'
'reproc'
'yaml-cpp>=0.8.0'
'simdjson'
)
makedepends=(
# header-only libs
'cli11'
'spdlog'
'tl-expected'
'nlohmann-json'
# C++ build tools
'ccache'
'python-cmake>=3.18'
'doctest'
'python-ninja'
'pybind11'
# python build tools
'python-build'
'python-installer'
'python-scikit-build>=0.13'
'python-setuptools>=42'
'python-wheel'
)
provides=("libmamba=$pkgver")
conflicts=('micromamba')
#options=(!emptydirs)
#backup=(etc/conda/condarc)
source=("$_name-$pkgver.tar.gz::$url/archive/refs/tags/$_srcver.tar.gz")
sha512sums=('6b3e64255f8aa63723dd08f578f79195b46249a02002b6d0d77713fd181f0557e3b6044075a823e639b0240b07b4e17dd0c9c17790c9152a68992e3ca9a599fa')
prepare() {
cd $srcdir/${_name}/libmambapy
sed -i 's/cmake_args=/cmake_source_dir="..", cmake_args=/' setup.py
}
build() {
cd $srcdir/${_name}/libmambapy
export SKBUILD_CONFIGURE_OPTIONS="\
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-D BUILD_LIBMAMBA=ON \
-D BUILD_LIBMAMBAPY=ON \
-D BUILD_MICROMAMBA=OFF \
-D BUILD_MAMBA_PACKAGE=OFF \
-D CMAKE_JOB_POOLS:STRING=compile=5;link=2 \
--preset=mamba-unix-shared-release"
python -m build --wheel --no-isolation
}
package() {
cd $srcdir/${_name}
cmake --install build/ --prefix "$pkgdir/usr"
cd $srcdir/${_name}/libmambapy
python -m installer --destdir="$pkgdir" dist/*.whl
install -Dm 644 LICENSE $pkgdir/usr/share/licenses/${pkgname}/LICENSE.txt
}
and got this
replacing .. with the absolute path doesn’t change anything.
If you need any other info, I'm happy to provide it
I'll try to look into it tomorrow! Remind me if I forget.
Thanks!
Hia, reminding you as requested!
In general, you should always "install" to use something, and not run it from the build directory. If you set the install directory to where you want the build to be, then it should be able to find it. (There is a way to do this from the build directory, with export(PACKAGE), but I think it's better to "install" to a local dir)
cmake -S. -Bbuild \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DBUILD_LIBMAMBA=ON \
-DBUILD_LIBMAMBAPY=ON \
-DBUILD_MICROMAMBA=OFF \
-DBUILD_MAMBA_PACKAGE=OFF \
-DBUILD_SHARED=ON
cmake --build build --parallel 8
cmake --install build --prefix install
cd libmambapy
export SKBUILD_CONFIGURE_OPTIONS="\
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DBUILD_LIBMAMBA=ON \
-DBUILD_LIBMAMBAPY=ON \
-DBUILD_MICROMAMBA=OFF \
-DBUILD_MAMBA_PACKAGE=OFF \
-Dlibmamba_ROOT=$PWD/../install"
python -m build -x --wheel --no-isolation
should work. (I have a different mamba in my /usr/local, which I used to set up the build environment, so I can't actually complete the build, but that seems to be working up to that point)
micromamba create -n mamba --file dev/environment-micromamba-static.yml
micromamba activate mamba
micromamba install -c conda-forge scikit-build setuptools python-build
Is my setup to try it locally.