Skip to content

Commit

Permalink
Add pcre2 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpux committed Jun 26, 2018
1 parent bfe94ff commit adde46f
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 0 deletions.
108 changes: 108 additions & 0 deletions pcre2/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgbase=pcre2
pkgname=('pcre2' 'libpcre2_8' 'libpcre2_16' 'libpcre2_32' 'libpcre2posix' 'pcre2-devel')
pkgver=10.31
pkgrel=1
pkgdesc="A library that implements Perl 5-style regular expressions"
arch=('i686' 'x86_64')
url="https://www.pcre.org/"
license=('BSD')
makedepends=('libreadline-devel' 'libbz2-devel' 'zlib-devel')
source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${pkgname}-${pkgver}.tar.bz2{,.sig}
pcre2-10.31-msys2.patch
cygwin-not-win32.patch)
sha256sums=('e07d538704aa65e477b6a392b32ff9fc5edf75ab9a40ddfc876186c4ff4d68ac'
'SKIP'
'5cce2b122c50837930abb7ddc54fc6af14399f8ba7e017e098a5eef9fc89d4a6'
'466f35da9c46e82e1d4d8462bec27e758ec10e5e7294cac4724635655909f09c')

prepare() {
cd "${srcdir}"/${pkgname}-${pkgver}

# MSYS2 patches
patch -p1 -i ${srcdir}/pcre2-10.31-msys2.patch
patch -p1 -i ${srcdir}/cygwin-not-win32.patch

autoreconf -fi
}

build() {
cd "${srcdir}"/${pkgname}-${pkgver}
./configure \
--build=${CHOST} \
--prefix=/usr \
--disable-jit \
--enable-pcre2-8 \
--enable-pcre2-16 \
--enable-pcre2-32 \
--enable-newline-is-anycrlf \
--enable-unicode \
--disable-pcre2grep-jit \
--enable-pcre2grep-libbz2 \
--enable-pcre2grep-libz \
--disable-pcre2test-libedit \
--enable-pcre2test-libreadline \
ac_cv_header_windows_h=no

make
make DESTDIR="${srcdir}/dest" install
}

check() {
cd "${srcdir}"/${pkgname}-${pkgver}
make -j1 check
}

package_pcre2() {
depends=('libreadline' 'libbz2' 'zlib' "libpcre2_8=${pkgver}" "libpcre2_16=${pkgver}" "libpcre2_32=${pkgver}" "libpcre2posix=${pkgver}")

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*.exe ${pkgdir}/usr/bin/
cp -rf ${srcdir}/dest/usr/share ${pkgdir}/usr/
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/LICENCE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

package_libpcre2_8() {
groups=('libraries')
depends=('gcc-libs')

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*pcre2-8-0.dll ${pkgdir}/usr/bin/
}

package_libpcre2_16() {
groups=('libraries')
depends=('gcc-libs')

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*pcre2-16-0.dll ${pkgdir}/usr/bin/
}

package_libpcre2_32() {
groups=('libraries')
depends=('gcc-libs')

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*pcre2-32-0.dll ${pkgdir}/usr/bin/
}

package_libpcre2posix() {
depends=("libpcre2_8=${pkgver}")
groups=('libraries')

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*pcre2-posix-2.dll ${pkgdir}/usr/bin/
}

package_pcre2-devel() {
pkgdesc="PCRE headers and libraries"
options=('staticlibs')
groups=('development')
depends=("libpcre2_8=${pkgver}" "libpcre2_16=${pkgver}" "libpcre2_32=${pkgver}" "libpcre2posix=${pkgver}")

mkdir -p ${pkgdir}/usr/bin
cp -f ${srcdir}/dest/usr/bin/*-config ${pkgdir}/usr/bin/
cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/
cp -rf ${srcdir}/dest/usr/lib ${pkgdir}/usr/
}
11 changes: 11 additions & 0 deletions pcre2/cygwin-not-win32.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- pcre2-10.31/src/pcre2grep.c.orig 2018-06-26 10:25:20.215288900 +0300
+++ pcre2-10.31/src/pcre2grep.c 2018-06-26 10:25:29.845302400 +0300
@@ -64,7 +64,7 @@
#endif

/* Some cmake's define it still */
-#if defined(__CYGWIN__) && !defined(WIN32)
+#if !defined(__CYGWIN__) && !defined(WIN32)
#define WIN32
#endif

67 changes: 67 additions & 0 deletions pcre2/pcre2-10.31-msys2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff -Naur pcre2-10.31-orig/ar-lib pcre2-10.31/ar-lib
--- pcre2-10.31-orig/ar-lib 2018-02-12 14:15:50.000000000 +0300
+++ pcre2-10.31/ar-lib 2018-06-26 10:00:07.074240500 +0300
@@ -53,7 +53,7 @@
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN*|MSYS*)
file_conv=cygwin
;;
*)
@@ -65,7 +65,7 @@
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin)
+ cygwin|msys)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
diff -Naur pcre2-10.31-orig/compile pcre2-10.31/compile
--- pcre2-10.31-orig/compile 2018-02-12 14:15:50.000000000 +0300
+++ pcre2-10.31/compile 2018-06-26 10:00:07.084240500 +0300
@@ -53,7 +53,7 @@
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN*|MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/*|msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
diff -Naur pcre2-10.31-orig/config.guess pcre2-10.31/config.guess
--- pcre2-10.31-orig/config.guess 2018-02-12 14:15:50.000000000 +0300
+++ pcre2-10.31/config.guess 2018-06-26 10:00:07.094240500 +0300
@@ -892,6 +892,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ echo x86_64-unknown-msys
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
diff -Naur pcre2-10.31-orig/configure.ac pcre2-10.31/configure.ac
--- pcre2-10.31-orig/configure.ac 2018-02-12 14:15:35.000000000 +0300
+++ pcre2-10.31/configure.ac 2018-06-26 10:00:07.094240500 +0300
@@ -787,7 +787,7 @@
NO_UNDEFINED=
EXPORT_ALL_SYMBOLS=
case $host_os in
- cygwin* | mingw* )
+ cygwin* | msys* | mingw* )
if test X"$enable_shared" = Xyes; then
NO_UNDEFINED="-no-undefined"
EXPORT_ALL_SYMBOLS="-Wl,--export-all-symbols"

0 comments on commit adde46f

Please sign in to comment.