diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index f3629c4049..9fe480a32d 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -463,18 +463,31 @@ macro(libmamba_create_target target_name linkage output_name) 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 + if(PPC32) + 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 + simdjson + libsolv + libsolvext solv::cpp ) - + else() + 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 + ) + endif() if(UNIX) set( diff --git a/libmamba/ext/solv-cpp/CMakeLists.txt b/libmamba/ext/solv-cpp/CMakeLists.txt index 8934098b4b..641a883254 100644 --- a/libmamba/ext/solv-cpp/CMakeLists.txt +++ b/libmamba/ext/solv-cpp/CMakeLists.txt @@ -21,6 +21,8 @@ find_package(Libsolv REQUIRED) if(BUILD_SHARED) set(LIBSOLV_DEPS solv::libsolv solv::libsolvext) set_target_properties(solv-cpp PROPERTIES POSITION_INDEPENDENT_CODE ON) +elseif(BUILD_PPC32) + set(LIBSOLV_DEPS libsolv libsolvext) else() set(LIBSOLV_DEPS solv::libsolv_static solv::libsolvext_static) endif() diff --git a/libmamba/include/mamba/specs/platform.hpp b/libmamba/include/mamba/specs/platform.hpp index 3149296a80..1c0dc2e371 100644 --- a/libmamba/include/mamba/specs/platform.hpp +++ b/libmamba/include/mamba/specs/platform.hpp @@ -32,6 +32,7 @@ namespace mamba::specs linux_aarch64, linux_ppc64le, linux_ppc64, + linux_ppc, linux_s390x, linux_riscv32, linux_riscv64, @@ -181,6 +182,8 @@ namespace mamba::specs return "linux-ppc64"; case KnownPlatform::linux_ppc64le: return "linux-ppc64le"; + case KnownPlatform::linux_ppc: + return "linux-ppc"; case KnownPlatform::linux_s390x: return "linux-s390x"; case KnownPlatform::linux_riscv32: diff --git a/libmamba/src/specs/conda_url.cpp b/libmamba/src/specs/conda_url.cpp index 886731ea64..e1a43d4ab4 100644 --- a/libmamba/src/specs/conda_url.cpp +++ b/libmamba/src/specs/conda_url.cpp @@ -17,7 +17,9 @@ #include "mamba/util/encoding.hpp" #include "mamba/util/string.hpp" + namespace mamba::specs + { /** * Find the location of "/os-arch"-like subsring. @@ -377,10 +379,17 @@ namespace mamba::specs // Must not decode to find the meaningful '/' separators if (has_archive_extension(path(Decode::no))) { - auto l_path = clear_path(); - const auto pos = std::min(std::min(l_path.rfind('/'), l_path.size()) + 1ul, l_path.size()); - l_path.replace(pos, std::string::npos, pkg); - Base::set_path(std::move(l_path), Encode::no); +#ifdef __powerpc__ + //The other three lines from below result in a failed build on ppc32 + auto l_path = clear_path(); +#else + + + auto l_path = clear_path(); + const auto pos = std::min(std::min(l_path.rfind('/'), l_path.size()) + 1ul, l_path.size()); + l_path.replace(pos, std::string::npos, pkg); + Base::set_path(std::move(l_path), Encode::no); +#endif } else { @@ -540,6 +549,7 @@ namespace mamba::specs } } } +#undef PPC32 auto std::hash::operator()(const mamba::specs::CondaURL& u) const -> std::size_t diff --git a/libmamba/src/specs/platform.cpp b/libmamba/src/specs/platform.cpp index deaa1d0df6..5516fc8fa4 100644 --- a/libmamba/src/specs/platform.cpp +++ b/libmamba/src/specs/platform.cpp @@ -36,6 +36,7 @@ namespace mamba::specs || (plat == KnownPlatform::linux_aarch64) // || (plat == KnownPlatform::linux_ppc64le) // || (plat == KnownPlatform::linux_ppc64) // + || (plat == KnownPlatform::linux_ppc) // || (plat == KnownPlatform::linux_s390x) // || (plat == KnownPlatform::linux_riscv32) // || (plat == KnownPlatform::linux_riscv64); @@ -101,6 +102,8 @@ namespace mamba::specs #else return KnownPlatform::linux_ppc64le; #endif +#elif defined(__powerpc__) || defined(__ppc__) + return KnownPlatform::linux_ppc; #elif defined(__s390x__) return KnownPlatform::linux_s390x; #elif defined(__riscv) && defined(__riscv_xlen) && (__riscv_xlen == 32) diff --git a/libmambapy/src/libmambapy/bindings/specs.cpp b/libmambapy/src/libmambapy/bindings/specs.cpp index bbe1d74155..d25d245110 100644 --- a/libmambapy/src/libmambapy/bindings/specs.cpp +++ b/libmambapy/src/libmambapy/bindings/specs.cpp @@ -68,6 +68,7 @@ namespace mambapy .value("linux_aarch64", KnownPlatform::linux_aarch64) .value("linux_ppc64le", KnownPlatform::linux_ppc64le) .value("linux_ppc64", KnownPlatform::linux_ppc64) + .value("linux_ppc", KnownPlatform::linux_ppc) .value("linux_s390x", KnownPlatform::linux_s390x) .value("linux_riscv32", KnownPlatform::linux_riscv32) .value("linux_riscv64", KnownPlatform::linux_riscv64)