summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-libs/libsc/Manifest1
-rw-r--r--sci-libs/libsc/files/libsc-2.8.3-fix_build_system.patch41
-rw-r--r--sci-libs/libsc/files/libsc-2.8.3-set_version.patch44
-rw-r--r--sci-libs/libsc/libsc-2.8.3.ebuild65
4 files changed, 151 insertions, 0 deletions
diff --git a/sci-libs/libsc/Manifest b/sci-libs/libsc/Manifest
index f5ddaed8843..05ef5652e9e 100644
--- a/sci-libs/libsc/Manifest
+++ b/sci-libs/libsc/Manifest
@@ -1,2 +1,3 @@
DIST libsc-2.3.1.tar.gz 344456 BLAKE2B cee44d07372162aecc8104257d1c5d4935d60030ceae4041ae4c5110f491b48b7709c55af0286b2a1fc5df2d7883b2ab4499c3884162b779fb9aaa86fbc5822c SHA512 02e160ad6fb4e674a9de2a41cfef6727d470a17c184e7b0310fe3e39f1112f4c643ca35a62377562caf1e8cc753cd5c0f5f996fba24b115498b01d16c140080a
DIST libsc-2.3.3.tar.gz 345177 BLAKE2B c9077cfe7af3eb8bfb34cf655fa8e49658f1ce0b866b58398fc7bae305ac276b002c83d930a20df1bdf52a22645ebb1698d51a937ce56db993d36ef68d640e8a SHA512 b51d08a987d7c8a83eaae0be98a078a4a9160b9141b482015110534ddac075337c81f54f3efa4f8a8bce54e31565a6323aad37e35674c1d40686d4ab3747ed6b
+DIST libsc-2.8.3.tar.gz 360755 BLAKE2B 2d7e3a16b97de551678ebb33f362e1ef7ebb0bcbf8d00b1a5317bfbf6732cf7bb9be2d215c79395809f3c616c23da5236c4f0f436a7b8bb07171141aaf08bbb3 SHA512 9def8850898f2d7d7a6ffaffd0872bc18af28026407356a1fe10f2b4f6d4a32ae6febe59c91cfa8817969624f995d48f64e0d5424b475e3a4c501338f4de70de
diff --git a/sci-libs/libsc/files/libsc-2.8.3-fix_build_system.patch b/sci-libs/libsc/files/libsc-2.8.3-fix_build_system.patch
new file mode 100644
index 00000000000..b5bdc734ab5
--- /dev/null
+++ b/sci-libs/libsc/files/libsc-2.8.3-fix_build_system.patch
@@ -0,0 +1,41 @@
+https://github.com/cburstedde/libsc/pull/54
+https://github.com/cburstedde/libsc/pull/55
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2ce08e2..a588beb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,6 +8,8 @@ HOMEPAGE_URL https://www.p4est.org/
+ DESCRIPTION "The SC library supports parallel scientific applications."
+ VERSION ${PROJECT_VERSION})
+
++set(CMAKE_POSITION_INDEPENDENT_CODE ON)
++
+ include(CTest)
+
+ include(cmake/options.cmake)
+@@ -28,8 +30,7 @@ if(MPI_FOUND)
+ endif()
+
+ # --- libb64
+-add_library(libb64 OBJECT libb64/cencode.c libb64/cdecode.c
+- libb64/b64dec.c libb64/b64enc.c)
++add_library(libb64 OBJECT libb64/cencode.c libb64/cdecode.c)
+ target_include_directories(libb64 PRIVATE libb64)
+
+ # --- sc
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a588beb..aff0eca 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -64,8 +64,8 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ ${PROJECT_SOURCE_DIR}/src/sc_builti
+
+ install(TARGETS sc
+ EXPORT ${PROJECT_NAME}Targets
+- ARCHIVE DESTINATION lib
+- LIBRARY DESTINATION lib)
++ ARCHIVE DESTINATION ${library_reldir}
++ LIBRARY DESTINATION ${library_reldir})
+
+ add_subdirectory(src)
+
diff --git a/sci-libs/libsc/files/libsc-2.8.3-set_version.patch b/sci-libs/libsc/files/libsc-2.8.3-set_version.patch
new file mode 100644
index 00000000000..dcd63994cc6
--- /dev/null
+++ b/sci-libs/libsc/files/libsc-2.8.3-set_version.patch
@@ -0,0 +1,44 @@
+diff --git a/cmake/git.cmake b/cmake/git.cmake
+index dd6009e..7c5c8f3 100644
+--- a/cmake/git.cmake
++++ b/cmake/git.cmake
+@@ -1,36 +1,3 @@
+ # --- extract version from Git
+
+-set(PROJECT_VERSION 0.0.0)
+-find_program(GIT_VERSION_GEN NAMES git-version-gen
+- PATHS ${CMAKE_SOURCE_DIR}/build-aux NO_DEFAULT_PATH)
+-if(GIT_VERSION_GEN)
+- execute_process(COMMAND ${GIT_VERSION_GEN} .tarball_version
+- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+- RESULT_VARIABLE _err
+- OUTPUT_VARIABLE git_version
+- OUTPUT_STRIP_TRAILING_WHITESPACE)
+-endif()
+-if(_err EQUAL 0)
+- if(git_version MATCHES
+- "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.].*")
+- set(_major "${CMAKE_MATCH_1}")
+- set(_minor "${CMAKE_MATCH_2}")
+- set(_patch "${CMAKE_MATCH_3}")
+- set(PROJECT_VERSION ${_major}.${_minor}.${_patch}.999)
+- elseif(git_version MATCHES
+- "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)")
+- set(_major "${CMAKE_MATCH_1}")
+- set(_minor "${CMAKE_MATCH_2}")
+- set(_patch "${CMAKE_MATCH_3}")
+- set(PROJECT_VERSION ${_major}.${_minor}.${_patch})
+- elseif(git_version MATCHES
+- "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)")
+- set(_major "${CMAKE_MATCH_1}")
+- set(_minor "${CMAKE_MATCH_2}")
+- set(PROJECT_VERSION ${_major}.${_minor})
+- elseif(git_version MATCHES
+- "^(0|[1-9][0-9]*)")
+- set(_major "${CMAKE_MATCH_1}")
+- set(PROJECT_VERSION ${_major})
+- endif()
+-endif()
++set(PROJECT_VERSION 2.8.3)
+
+
diff --git a/sci-libs/libsc/libsc-2.8.3.ebuild b/sci-libs/libsc/libsc-2.8.3.ebuild
new file mode 100644
index 00000000000..9ed5ecf5c58
--- /dev/null
+++ b/sci-libs/libsc/libsc-2.8.3.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="Support for parallel scientific applications"
+HOMEPAGE="http://www.p4est.org/"
+
+if [[ ${PV} == *9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/cburstedde/${PN}.git"
+ EGIT_BRANCH="develop"
+else
+ SRC_URI="https://github.com/cburstedde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+IUSE="debug examples mpi openmp threads"
+
+RDEPEND="
+ sys-apps/util-linux
+ sys-libs/zlib
+ virtual/blas
+ virtual/lapack
+ mpi? ( virtual/mpi[romio] )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-set_version.patch
+ "${FILESDIR}"/${P}-fix_build_system.patch
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -Dmpi="$(usex mpi)"
+ -Dopenmp="$(usex openmp)"
+ -Dlibrary_reldir="$(get_libdir)"
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ rm -r "${ED}"/usr/include/getopt.h \
+ "${ED}"/usr/include/getopt_int.h \
+ "${ED}"/usr/include/sc_builtin || die "rm failed"
+
+ mv "${ED}"/usr/share/docs/SC/* "${ED}"/usr/share/doc/${P}/ || die "mv failed"
+ rm -r "${ED}"/usr/share/docs || die "rm failed"
+}