diff --git a/libmamba.yaml b/libmamba.yaml index c0fe081f5f0..7d7c4b4804f 100644 --- a/libmamba.yaml +++ b/libmamba.yaml @@ -1,7 +1,7 @@ package: name: libmamba - version: 2024.08.31 - epoch: 1 + version: 2024.09.30 + epoch: 0 description: Cross-Platform Package Manager copyright: - license: BSD-3-Clause @@ -25,8 +25,10 @@ environment: - nlohmann-json - openssf-compiler-options - openssl-dev + - py3-distro - py3-pip - py3-pybind11-dev + - py3-scikit-build - py3-wheel - python3-dev - reproc @@ -38,15 +40,19 @@ environment: - yaml-cpp-dev - zstd-dev - zstd-static + environment: + CXXFLAGS: "-fPIC" pipeline: - uses: git-checkout with: - expected-commit: 25cdc05ae56f96734d3e1b3cbd104405dedbddcd + expected-commit: 9fc7b99ea32daaf3019416e0a42141b23923fd82 repository: https://github.com/mamba-org/mamba tag: ${{package.version}} - cherry-picks: | - pull/3386/head/c1fabca58d05ac192466420659abd922b4481012: Backport fmt 11 support from main + + - uses: patch + with: + patches: support-shared-libs.patch - uses: cmake/configure with: @@ -71,10 +77,9 @@ subpackages: - libmamba pipeline: - runs: | - python -m pip install --root=${{targets.subpkgdir}} --no-deps --no-build-isolation --ignore-installed ./libmambapy/ - PYVER=$(python --version | awk '{print $2}' | awk -F. '{print $1"."$2}') - mkdir -p "${{targets.subpkgdir}}"/usr/lib/python${PYVER}/site-packages/libmambapy - mv ${{targets.destdir}}/home/build/libmambapy/libmambapy/bindings.*.so "${{targets.subpkgdir}}"/usr/lib/python${PYVER}/site-packages/libmambapy/ + CMAKE_PREFIX_PATH=${{targets.subpkgdir}}/usr \ + libmamba_DIR=${{targets.destdir}}/usr/lib/cmake/libmamba \ + python -m pip install --root=${{targets.subpkgdir}} --no-deps --no-build-isolation --ignore-installed ./libmambapy/ - name: libmamba-dev pipeline: diff --git a/libmamba/support-shared-libs.patch b/libmamba/support-shared-libs.patch new file mode 100644 index 00000000000..69129116193 --- /dev/null +++ b/libmamba/support-shared-libs.patch @@ -0,0 +1,199 @@ +diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt +index 16716339..72dcfd1f 100644 +--- a/libmamba/CMakeLists.txt ++++ b/libmamba/CMakeLists.txt +@@ -445,171 +445,29 @@ macro(libmamba_create_target target_name linkage output_name) + SPDLOG_FMT_EXTERNAL "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${BUILD_LOG_LEVEL}" + ) + +- if(${linkage_upper} STREQUAL "STATIC") +- message(" -> Statically linking against libmamba (static) dependencies") +- +- mamba_target_check_type(yaml-cpp::yaml-cpp STATIC_LIBRARY FATAL_ERROR) +- mamba_target_check_type(reproc STATIC_LIBRARY FATAL_ERROR) +- mamba_target_check_type(reproc++ STATIC_LIBRARY FATAL_ERROR) +- +- target_link_libraries( +- ${target_name} +- PUBLIC fmt::fmt-header-only spdlog::spdlog_header_only yaml-cpp::yaml-cpp +- PRIVATE +- reproc +- reproc++ +- simdjson::simdjson_static +- solv::libsolv_static +- solv::libsolvext_static +- solv::cpp +- ) +- +- if(UNIX) +- +- set( +- REQUIRED_STATIC_DEPS +- libcurl.a +- libssh2.a +- libgssapi_krb5.a +- libkrb5.a +- libk5crypto.a +- libkrb5support.a +- libcom_err.a +- libssl.a +- libcrypto.a +- libarchive.a +- libiconv.a +- libbz2.a +- liblz4.a +- libzstd.a +- libz.a +- liblzma.a +- libnghttp2.a +- ) +- if(APPLE) +- set(REQUIRED_STATIC_DEPS ${REQUIRED_STATIC_DEPS} libc++.a) +- endif() +- +- if(UNIX AND NOT APPLE) +- list(REMOVE_ITEM REQUIRED_STATIC_DEPS libiconv.a) +- endif() +- +- set(STATIC_DEPS "") +- foreach(LIB ${REQUIRED_STATIC_DEPS}) +- set(TMP_LIB "${LIB}-NOTFOUND") +- find_library(TMP_LIB NAMES "${LIB}") +- if(NOT ${TMP_LIB} STREQUAL "TMP_LIB-NOTFOUND") +- list(APPEND STATIC_DEPS "${TMP_LIB}") +- else() +- list(APPEND STATIC_DEPS "${LIB}-NOTFOUND") +- endif() +- endforeach(LIB) +- +- if(APPLE) +- find_library(SECURITY_LIBRARY Security) +- find_library(SYSTEMCONFIGURATION_LIBRARY SystemConfiguration) +- find_library(COREFOUNDATION_LIBRARY CoreFoundation) +- message("Found library: ${SECURITY_LIBRARY}\n${COREFOUNDATION_LIBRARY}") +- list( +- APPEND +- STATIC_DEPS +- ${COREFOUNDATION_LIBRARY} +- ${SECURITY_LIBRARY} +- ${SYSTEMCONFIGURATION_LIBRARY} +- ) +- endif() +- +- message(" -> Found static dependencies:") +- foreach(LIB ${STATIC_DEPS}) +- message(" - ${LIB}") +- endforeach(LIB) +- +- if(APPLE) +- set(MAMBA_FORCE_DYNAMIC_LIBS resolv c++abi) +- target_link_options(${target_name} PRIVATE -nostdlib++) +- elseif(UNIX) +- set(MAMBA_FORCE_DYNAMIC_LIBS rt dl resolv) +- target_link_options(${target_name} PUBLIC -static-libstdc++ -static-libgcc) +- endif() +- +- target_link_libraries(${target_name} PUBLIC ${STATIC_DEPS} ${MAMBA_FORCE_DYNAMIC_LIBS}) +- +- elseif(WIN32) +- +- set(CMAKE_PREFIX_PATH "$ENV{VCPKG_ROOT}/installed/x64-windows-static-md/") +- +- # For Windows we have a vcpkg based build system right now. +- find_package(LibArchive REQUIRED) +- find_package(CURL CONFIG REQUIRED) +- find_library(LIBLZMA_LIBRARIES lzma REQUIRED) +- find_library(LZ4_LIBRARY NAMES lz4) +- find_library(LZO2_LIBRARY NAMES lzo2) +- find_package(zstd CONFIG REQUIRED) +- find_library(BZIP2_LIBRARIES NAMES bz2) +- find_library(CRYPTO_LIBRARIES NAMES libcrypto) +- +- find_library(LIBXML2_LIBRARY NAMES libxml2) +- find_library(ICONV_LIBRARY NAMES libiconv iconv) +- find_library(CHARSET_LIBRARY NAMES libcharset charset) +- message("Found: ${LIBXML2_LIBRARY} ${ICONV_LIBRARY} ${CHARSET_LIBRARY}") +- +- target_link_libraries( +- ${target_name} +- PUBLIC +- ${CRYPTO_LIBRARIES} +- ${LibArchive_LIBRARY} +- ${LIBXML2_LIBRARY} +- ${ICONV_LIBRARY} +- ${CHARSET_LIBRARY} +- zstd::libzstd_static +- ${LZ4_LIBRARY} +- ${LZO2_LIBRARY} +- ${BZIP2_LIBRARIES} +- ${LIBLZMA_LIBRARIES} +- CURL::libcurl +- ${sodium_LIBRARY_RELEASE} +- ) +- +- add_compile_definitions(LIBARCHIVE_STATIC CURL_STATICLIB) +- include_directories($ENV{CONDA_PREFIX}/Library/include/) +- include_directories($ENV{VCPKG_ROOT}/installed/x64-windows-static-md/include/) +- endif() +- else() +- message(" -> Dynamically linking against libmamba (shared) dependencies") +- +- mamba_target_check_type(yaml-cpp::yaml-cpp SHARED_LIBRARY WARNING) +- +- find_package(CURL REQUIRED) +- find_package(LibArchive REQUIRED) +- find_package(zstd REQUIRED) +- find_package(BZip2 REQUIRED) +- find_package(OpenSSL REQUIRED) +- +- target_link_libraries( +- ${target_name} +- PUBLIC +- ${LIBSOLV_LIBRARIES} +- ${LIBSOLVEXT_LIBRARIES} +- yaml-cpp::yaml-cpp +- fmt::fmt +- # Since conda-forge spdlog is built with a bundled version of fmt we use the header +- # only version to avoid chasing after the correct fmt version matching the one used +- # in the bundle +- spdlog::spdlog_header_only +- PRIVATE +- ${LibArchive_LIBRARIES} +- ${CURL_LIBRARIES} +- ${OPENSSL_LIBRARIES} +- BZip2::BZip2 +- reproc +- reproc++ +- simdjson::simdjson +- zstd::libzstd_shared +- solv::libsolv +- solv::libsolvext +- solv::cpp +- ) +- endif() ++ message(" -> Using shared libraries for libmamba dependencies") ++ find_package(CURL REQUIRED) ++ find_package(LibArchive REQUIRED) ++ find_package(zstd REQUIRED) ++ find_package(BZip2 REQUIRED) ++ find_package(OpenSSL REQUIRED) ++ ++ target_link_libraries( ++ ${target_name} ++ PUBLIC ${LIBSOLV_LIBRARIES} ${LIBSOLVEXT_LIBRARIES} yaml-cpp::yaml-cpp fmt::fmt spdlog::spdlog_header_only ++ PRIVATE ++ ${LibArchive_LIBRARIES} ++ ${CURL_LIBRARIES} ++ ${OPENSSL_LIBRARIES} ++ BZip2::BZip2 ++ reproc ++ reproc++ ++ simdjson::simdjson ++ zstd::libzstd_shared ++ solv::libsolv ++ solv::libsolvext ++ solv::cpp ++ ) + + if(WIN32) + find_path(