commit:     98811d8232be969c0fb7003456cabcd3cd231f57
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sun Oct 24 02:55:49 2021 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sun Oct 24 02:56:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=98811d82

dev-cpp/highway: add versioned ebuild, EAPI 8

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-cpp/highway/Manifest                            |  1 +
 .../highway/files/highway-shared-libraries.patch    | 21 +++++++++++++++++++++
 .../{highway-9999.ebuild => highway-0.14.2.ebuild}  | 16 +++++++++-------
 dev-cpp/highway/highway-9999.ebuild                 | 16 +++++++++-------
 4 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/dev-cpp/highway/Manifest b/dev-cpp/highway/Manifest
new file mode 100644
index 000000000..1512a640d
--- /dev/null
+++ b/dev-cpp/highway/Manifest
@@ -0,0 +1 @@
+DIST highway-0.14.2.tar.gz 1545892 BLAKE2B 
c19d040ea7bf6d5ee0ff87213f36bfe77759cc4cec514b972379490dbac5e8d55f99490b998f73133ca0ba3b34a98f2684b85206ae32d655aa574aeaabeaeb27
 SHA512 
fc1a35463c95c45b646c53f91a9996112726de1d588dcd4d25a7d366840f704ad9a4c0bb6e0a001e929409f04aad6922cbffcf93774a0c360aff875956c7cc8d

diff --git a/dev-cpp/highway/files/highway-shared-libraries.patch 
b/dev-cpp/highway/files/highway-shared-libraries.patch
new file mode 100644
index 000000000..28149eba8
--- /dev/null
+++ b/dev-cpp/highway/files/highway-shared-libraries.patch
@@ -0,0 +1,21 @@
+--- a/CMakeLists.txt   2021-10-24 04:46:57.475685128 +0200
++++ b/CMakeLists.txt   2021-10-24 04:45:56.218467838 +0200
+@@ -182,15 +182,16 @@
+ 
+ endif()  # !MSVC
+ 
+-add_library(hwy STATIC ${HWY_SOURCES})
++add_library(hwy SHARED ${HWY_SOURCES})
+ target_compile_options(hwy PRIVATE ${HWY_FLAGS})
+ set_property(TARGET hwy PROPERTY POSITION_INDEPENDENT_CODE ON)
+ target_include_directories(hwy PUBLIC ${CMAKE_CURRENT_LIST_DIR})
+ 
+-add_library(hwy_contrib STATIC ${HWY_CONTRIB_SOURCES})
++add_library(hwy_contrib SHARED ${HWY_CONTRIB_SOURCES})
+ target_compile_options(hwy_contrib PRIVATE ${HWY_FLAGS})
+ set_property(TARGET hwy_contrib PROPERTY POSITION_INDEPENDENT_CODE ON)
+ target_include_directories(hwy_contrib PUBLIC ${CMAKE_CURRENT_LIST_DIR})
++target_link_libraries(hwy_contrib hwy)
+ 
+ # -------------------------------------------------------- hwy_list_targets
+ # Generate a tool to print the compiled-in targets as defined by the current

diff --git a/dev-cpp/highway/highway-9999.ebuild 
b/dev-cpp/highway/highway-0.14.2.ebuild
similarity index 69%
copy from dev-cpp/highway/highway-9999.ebuild
copy to dev-cpp/highway/highway-0.14.2.ebuild
index 8d96668d7..683729d58 100644
--- a/dev-cpp/highway/highway-9999.ebuild
+++ b/dev-cpp/highway/highway-0.14.2.ebuild
@@ -1,7 +1,7 @@
 # Copyright 2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=8
 
 inherit cmake
 
@@ -18,18 +18,20 @@ fi
 
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE=""
+IUSE="test"
 
-DEPEND=""
+DEPEND="test? ( dev-cpp/gtest )"
 
-BDEPEND=""
-
-RDEPEND="${DEPEND}"
+PATCHES=( "${FILESDIR}/${PN}-shared-libraries.patch" )
+RESTRICT="!test? ( test )"
 
 src_configure() {
        local mycmakeargs=(
-               -DBUILD_TESTING=OFF
+               -DBUILD_TESTING=$(usex test)
+               -DHWY_WARNINGS_ARE_ERRORS=OFF
        )
 
+       use test && mycmakeargs+=( "-DHWY_SYSTEM_GTEST=ON" )
+
        cmake_src_configure
 }

diff --git a/dev-cpp/highway/highway-9999.ebuild 
b/dev-cpp/highway/highway-9999.ebuild
index 8d96668d7..683729d58 100644
--- a/dev-cpp/highway/highway-9999.ebuild
+++ b/dev-cpp/highway/highway-9999.ebuild
@@ -1,7 +1,7 @@
 # Copyright 2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=8
 
 inherit cmake
 
@@ -18,18 +18,20 @@ fi
 
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE=""
+IUSE="test"
 
-DEPEND=""
+DEPEND="test? ( dev-cpp/gtest )"
 
-BDEPEND=""
-
-RDEPEND="${DEPEND}"
+PATCHES=( "${FILESDIR}/${PN}-shared-libraries.patch" )
+RESTRICT="!test? ( test )"
 
 src_configure() {
        local mycmakeargs=(
-               -DBUILD_TESTING=OFF
+               -DBUILD_TESTING=$(usex test)
+               -DHWY_WARNINGS_ARE_ERRORS=OFF
        )
 
+       use test && mycmakeargs+=( "-DHWY_SYSTEM_GTEST=ON" )
+
        cmake_src_configure
 }

Reply via email to