From d62e8e07a67cb63325f397de8b175be12c4857a6 Mon Sep 17 00:00:00 2001 From: Sam James Date: Fri, 9 Dec 2022 15:00:14 +0000 Subject: dev-libs/libpcre2: backport pcreposix header fix Closes: https://bugs.gentoo.org/884705 Signed-off-by: Sam James --- .../files/libpcre2-10.41-pcre2posix-header.patch | 66 +++++++++++++++ dev-libs/libpcre2/libpcre2-10.41-r1.ebuild | 94 ++++++++++++++++++++++ dev-libs/libpcre2/libpcre2-10.41.ebuild | 93 --------------------- 3 files changed, 160 insertions(+), 93 deletions(-) create mode 100644 dev-libs/libpcre2/files/libpcre2-10.41-pcre2posix-header.patch create mode 100644 dev-libs/libpcre2/libpcre2-10.41-r1.ebuild delete mode 100644 dev-libs/libpcre2/libpcre2-10.41.ebuild diff --git a/dev-libs/libpcre2/files/libpcre2-10.41-pcre2posix-header.patch b/dev-libs/libpcre2/files/libpcre2-10.41-pcre2posix-header.patch new file mode 100644 index 000000000000..12d8bb609329 --- /dev/null +++ b/dev-libs/libpcre2/files/libpcre2-10.41-pcre2posix-header.patch @@ -0,0 +1,66 @@ +https://github.com/PCRE2Project/pcre2/commit/cd8dc40b901bdedf5bcc0b3acdd9eede16802f39 +https://github.com/PCRE2Project/pcre2/issues/173 +https://bugs.gentoo.org/884705 + +From cd8dc40b901bdedf5bcc0b3acdd9eede16802f39 Mon Sep 17 00:00:00 2001 +From: Philip Hazel +Date: Fri, 9 Dec 2022 09:40:52 +0000 +Subject: [PATCH] Move default of PCRE2_CALL_CONVENTION from pcre2posix.c to + pcre2posix.h + +--- a/src/pcre2posix.c ++++ b/src/pcre2posix.c +@@ -92,20 +92,6 @@ changed. This #define is a copy of the one in pcre2_internal.h. */ + #include "pcre2.h" + #include "pcre2posix.h" + +-/* When compiling with the MSVC compiler, it is sometimes necessary to include +-a "calling convention" before exported function names. (This is secondhand +-information; I know nothing about MSVC myself). For example, something like +- +- void __cdecl function(....) +- +-might be needed. In order to make this easy, all the exported functions have +-PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not +-set, we ensure here that it has no effect. */ +- +-#ifndef PCRE2_CALL_CONVENTION +-#define PCRE2_CALL_CONVENTION +-#endif +- + /* Table to translate PCRE2 compile time error codes into POSIX error codes. + Only a few PCRE2 errors with a value greater than 23 turn into special POSIX + codes: most go to REG_BADPAT. The second table lists, in pairs, those that +--- a/src/pcre2posix.h ++++ b/src/pcre2posix.h +@@ -9,7 +9,7 @@ POSIX wrapper interface. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge +- New API code Copyright (c) 2016-2019 University of Cambridge ++ New API code Copyright (c) 2016-2022 University of Cambridge + + ----------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without +@@ -116,6 +116,20 @@ typedef struct { + regoff_t rm_eo; + } regmatch_t; + ++/* When compiling with the MSVC compiler, it is sometimes necessary to include ++a "calling convention" before exported function names. (This is secondhand ++information; I know nothing about MSVC myself). For example, something like ++ ++ void __cdecl function(....) ++ ++might be needed. In order to make this easy, all the exported functions have ++PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not ++set, we ensure here that it has no effect. */ ++ ++#ifndef PCRE2_CALL_CONVENTION ++#define PCRE2_CALL_CONVENTION ++#endif ++ + /* When an application links to a PCRE2 DLL in Windows, the symbols that are + imported have to be identified as such. When building PCRE2, the appropriate + export settings are needed, and are set in pcre2posix.c before including this + diff --git a/dev-libs/libpcre2/libpcre2-10.41-r1.ebuild b/dev-libs/libpcre2/libpcre2-10.41-r1.ebuild new file mode 100644 index 000000000000..e4703e3a15ea --- /dev/null +++ b/dev-libs/libpcre2/libpcre2-10.41-r1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/philiphazel.asc +inherit libtool multilib-minimal usr-ldscript verify-sig + +MY_P="pcre2-${PV/_rc/-RC}" + +DESCRIPTION="Perl-compatible regular expression library" +HOMEPAGE="https://www.pcre.org/" +if [[ ${PV} != *_rc* ]] ; then + # Only the final releases are available here. + SRC_URI="https://github.com/PCRE2Project/pcre2/releases/download/${MY_P}/${MY_P}.tar.bz2 + https://ftp.pcre.org/pub/pcre/${MY_P}.tar.bz2 + verify-sig? ( https://github.com/PhilipHazel/pcre2/releases/download/${MY_P}/${MY_P}.tar.bz2.sig )" +else + SRC_URI="https://ftp.pcre.org/pub/pcre/Testing/${MY_P}.tar.bz2" +fi + +S="${WORKDIR}/${MY_P}" + +LICENSE="BSD" +SLOT="0/3" # libpcre2-posix.so version +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="bzip2 +jit libedit +pcre16 pcre32 +readline static-libs unicode zlib" +REQUIRED_USE="?? ( libedit readline )" + +RDEPEND=" + bzip2? ( app-arch/bzip2 ) + libedit? ( dev-libs/libedit ) + readline? ( sys-libs/readline:= ) + zlib? ( sys-libs/zlib ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig + verify-sig? ( sec-keys/openpgp-keys-philiphazel ) +" + +MULTILIB_CHOST_TOOLS=( + /usr/bin/pcre2-config +) + +PATCHES=( + "${FILESDIR}"/${PN}-10.10-000-Fix-multilib.patch + "${FILESDIR}"/${P}-pcre2posix-header.patch +) + +src_prepare() { + default + + elibtoolize +} + +multilib_src_configure() { + local myeconfargs=( + --enable-pcre2-8 + --enable-shared + $(multilib_native_use_enable bzip2 pcre2grep-libbz2) + $(multilib_native_use_enable libedit pcre2test-libedit) + $(multilib_native_use_enable readline pcre2test-libreadline) + $(multilib_native_use_enable zlib pcre2grep-libz) + $(use_enable jit) + $(use_enable jit pcre2grep-jit) + $(use_enable pcre16 pcre2-16) + $(use_enable pcre32 pcre2-32) + $(use_enable static-libs static) + $(use_enable unicode) + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=") +} + +multilib_src_test() { + emake check VERBOSE=yes +} + +multilib_src_install() { + emake \ + DESTDIR="${D}" \ + $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \ + install + multilib_is_native_abi && gen_usr_ldscript -a pcre2-posix +} + +multilib_src_install_all() { + find "${ED}" -type f -name "*.la" -delete || die +} diff --git a/dev-libs/libpcre2/libpcre2-10.41.ebuild b/dev-libs/libpcre2/libpcre2-10.41.ebuild deleted file mode 100644 index c8948edf597e..000000000000 --- a/dev-libs/libpcre2/libpcre2-10.41.ebuild +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/philiphazel.asc -inherit libtool multilib-minimal usr-ldscript verify-sig - -MY_P="pcre2-${PV/_rc/-RC}" - -DESCRIPTION="Perl-compatible regular expression library" -HOMEPAGE="https://www.pcre.org/" -if [[ ${PV} != *_rc* ]] ; then - # Only the final releases are available here. - SRC_URI="https://github.com/PCRE2Project/pcre2/releases/download/${MY_P}/${MY_P}.tar.bz2 - https://ftp.pcre.org/pub/pcre/${MY_P}.tar.bz2 - verify-sig? ( https://github.com/PhilipHazel/pcre2/releases/download/${MY_P}/${MY_P}.tar.bz2.sig )" -else - SRC_URI="https://ftp.pcre.org/pub/pcre/Testing/${MY_P}.tar.bz2" -fi - -S="${WORKDIR}/${MY_P}" - -LICENSE="BSD" -SLOT="0/3" # libpcre2-posix.so version -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="bzip2 +jit libedit +pcre16 pcre32 +readline static-libs unicode zlib" -REQUIRED_USE="?? ( libedit readline )" - -RDEPEND=" - bzip2? ( app-arch/bzip2 ) - libedit? ( dev-libs/libedit ) - readline? ( sys-libs/readline:= ) - zlib? ( sys-libs/zlib ) -" -DEPEND="${RDEPEND}" -BDEPEND=" - virtual/pkgconfig - verify-sig? ( sec-keys/openpgp-keys-philiphazel ) -" - -MULTILIB_CHOST_TOOLS=( - /usr/bin/pcre2-config -) - -PATCHES=( - "${FILESDIR}"/${PN}-10.10-000-Fix-multilib.patch -) - -src_prepare() { - default - - elibtoolize -} - -multilib_src_configure() { - local myeconfargs=( - --enable-pcre2-8 - --enable-shared - $(multilib_native_use_enable bzip2 pcre2grep-libbz2) - $(multilib_native_use_enable libedit pcre2test-libedit) - $(multilib_native_use_enable readline pcre2test-libreadline) - $(multilib_native_use_enable zlib pcre2grep-libz) - $(use_enable jit) - $(use_enable jit pcre2grep-jit) - $(use_enable pcre16 pcre2-16) - $(use_enable pcre32 pcre2-32) - $(use_enable static-libs static) - $(use_enable unicode) - ) - - ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" -} - -multilib_src_compile() { - emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=") -} - -multilib_src_test() { - emake check VERBOSE=yes -} - -multilib_src_install() { - emake \ - DESTDIR="${D}" \ - $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \ - install - multilib_is_native_abi && gen_usr_ldscript -a pcre2-posix -} - -multilib_src_install_all() { - find "${ED}" -type f -name "*.la" -delete || die -} -- cgit v1.2.3-65-gdbad