Skip to content

Commit

Permalink
dev-libs/hyperscan: bug fixes: #674218, #707486, #722802
Browse files Browse the repository at this point in the history
* support non-English locales; The patch is taken from
  intel/hyperscan#217 (comment)
* respect cpu_flags_x86 USE flags
* respect -O flags
* set release build type; CMAKE_BUILD_TYPE=Release disables -Werror flag
  which used to trigger false positive error in GCC-10.
  intel/hyperscan#239

Closes: https://bugs.gentoo.org/674218
Closes: https://bugs.gentoo.org/707486
Closes: https://bugs.gentoo.org/722802
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
  • Loading branch information
arkamar committed Jun 8, 2020
1 parent cc3917d commit 0ef4724
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
20 changes: 20 additions & 0 deletions dev-libs/hyperscan/files/hyperscan-5.2.1-locales.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83197af..297a3b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,9 +187,9 @@ else()
set (EXEC_ARGS ${CC_ARG1} -c -Q --help=target -march=native -mtune=native)
execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
OUTPUT_VARIABLE _GCC_OUTPUT)
- string(FIND "${_GCC_OUTPUT}" "Known" POS)
- string(SUBSTRING "${_GCC_OUTPUT}" 0 ${POS} _GCC_OUTPUT)
- string(REGEX REPLACE ".*march=[ \t]*([^ \n]*)[ \n].*" "\\1"
+ string(FIND "${_GCC_OUTPUT}" "march" POS)
+ string(SUBSTRING "${_GCC_OUTPUT}" ${POS} -1 _GCC_OUTPUT)
+ string(REGEX REPLACE "march=[ \t]*([^ \n]*)[ \n].*" "\\1"
GNUCC_ARCH "${_GCC_OUTPUT}")

# test the parsed flag
--
2.26.2

15 changes: 14 additions & 1 deletion dev-libs/hyperscan/hyperscan-5.2.1-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ HOMEPAGE="https://www.hyperscan.io/ https://github.com/intel/hyperscan"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+cpu_flags_x86_ssse3 static-libs"
IUSE="cpu_flags_x86_avx2 +cpu_flags_x86_ssse3 static-libs"

RDEPEND="dev-libs/boost"
DEPEND="${RDEPEND}"
Expand All @@ -25,16 +25,29 @@ BDEPEND="

REQUIRED_USE="cpu_flags_x86_ssse3"

PATCHES=(
"${FILESDIR}/${P}-locales.patch"
)

src_prepare() {
# Respect user -O flags
sed -i '/set(OPT_CX*_FLAG/d' CMakeLists.txt || die

# upstream workaround
append-cxxflags -Wno-redundant-move
cmake_src_prepare
}

src_configure() {
CMAKE_BUILD_TYPE=Release

use cpu_flags_x86_ssse3 && append-flags -mssse3
use cpu_flags_x86_avx2 && append-flags -mavx2

local mycmakeargs=(
-DBUILD_SHARED_LIBS=$(usex static-libs OFF ON)
-DBUILD_STATIC_AND_SHARED=$(usex static-libs ON OFF)
-DFAT_RUNTIME=false
)
cmake_src_configure
}
Expand Down

0 comments on commit 0ef4724

Please sign in to comment.