packages/libs/oniguruma/patches/0001-Add-SOVERSION-info-to-library-when-using-cmake.patch
Eneas U de Queiroz fdc23942ab
oniguruma: bump to 6.9.5_rev1, switch to cmake
Besides the version bump, this backports a patch so that cmake uses the
same so version information as the current autotools, allowing the
switch over to cmake.

6.9.5_rev1 Changelog:

- Look-behind bug: if the look-behind contains a branch with a character
  length of 0 and an anchor is included in the branch, the whole
  look-behind is ignored
- POSIX API disabled by default -- enabled in openwrt, as at least
  libevhtp needs it
- Update Unicode version 13.0.0
- NEW: Code point sequence notation \x{HHHH HHHH ...}, \o{OOOO OOOO ...}
- NEW API: retry limit in search functions
- NEW API: maximum nesting level of subexp call
- Fixed behavior of isolated options in Perl and Java syntaxes.
  /...(?i).../

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2020-05-08 11:26:51 -03:00

35 lines
1.5 KiB
Diff

From afb2a1587a828bf7cd7ddd87b2e2609a9bb7fab0 Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Wed, 6 May 2020 08:59:54 -0300
Subject: [PATCH] Add SOVERSION info to library when using cmake
Currently the SOVERSION is different when building with cmake than the
value used by autotools.
This adds the version information from autotools to cmake.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29a1417..1c8a090 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,6 +67,19 @@ target_include_directories(onig PUBLIC
target_compile_definitions(onig PUBLIC
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:ONIG_STATIC>)
+if(BUILD_SHARED_LIBS)
+ # Parse SOVERSION information from LTVERSION in configure.ac
+ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" LTVERSION REGEX "^LTVERSION *= *\"?[0-9]+:[0-9]+:[0-9]+\"?")
+ string(REGEX REPLACE "^LTVERSION *= *\"?([0-9]+:[0-9]+:[0-9]+)\"?.*$" "\\1" LTVERSION "${LTVERSION}")
+ string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\1" LTCURRENT ${LTVERSION})
+ string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\2" LTREVISION ${LTVERSION})
+ string(REGEX REPLACE "^([0-9]+):([0-9]+):([0-9]+)" "\\3" LTAGE ${LTVERSION})
+ math(EXPR ONIG_SOVERSION "${LTCURRENT} - ${LTAGE}")
+ set_target_properties(onig PROPERTIES
+ SOVERSION "${ONIG_SOVERSION}"
+ VERSION "${ONIG_SOVERSION}.${LTAGE}.${LTREVISION}")
+endif()
+
if(MSVC)
target_compile_options(onig PRIVATE
#/W4