Mercurial > vanilla
changeset 1266:340f62d6f172
lib/pcre2: upgrade to 10.39
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 10 Nov 2021 14:41:13 +0100 |
parents | f53aba657aa6 |
children | c22994927443 |
files | lib/pcre2/pcre2.sh lib/pcre2/pcre2.sha1 |
diffstat | 2 files changed, 55 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/pcre2/pcre2.sh Wed Nov 10 14:40:42 2021 +0100 +++ b/lib/pcre2/pcre2.sh Wed Nov 10 14:41:13 2021 +0100 @@ -16,46 +16,73 @@ # PKGNAME=pcre2 -PKGVERSION=10.32 +PKGVERSION=10.39 PKGREVISION=1 -PKGLICENSE="BSD" +PKGLICENSE="BSD-3-Clause" PKGSUMMARY="perl 5 regular expression library (2nd version)" -PKGDOWNLOAD="https://ftp.pcre.org/pub/pcre/$PKGNAME-$PKGVERSION.tar.gz" -PKGDEPENDS="zlib" +PKGWWW="http://pcre.org" +PKGDOWNLOAD="https://github.com/PhilipHazel/pcre2/archive/refs/tags/$PKGNAME-$PKGVERSION.tar.gz" +PKGOPTIONS="BZIP2 COMPLETION ZLIB" : ${CHOST:=$(uname -m)-linux-musl} : ${CBUILD:=$(uname -m)-linux-musl} : ${CC:=clang} : ${CFLAGS:=-O2} -: ${CXX:=clang++} -: ${CXXFLAGS:=-O2} : ${LDFLAGS:=} : ${LIBS:=} +: ${BZIP2:=yes} +: ${COMPLETION:=readline} # Select: readline|yes, libedit, no +: ${ZLIB:=yes} + +if [ "$BZIP2" = "yes" ]; then + PKGDEPENDS="bzip2 $PKGDEPENDS" + with_bzip2="-DPCRE2_SUPPORT_LIBBZ2=On" +else + with_bzip2="-DPCRE2_SUPPORT_LIBBZ2=Offn" +fi + +case $COMPLETION in +yes|readline) + PKGDEPENDS="readline $PKGDEPENDS" + with_completion="-DPCRE2_SUPPORT_LIBEDIT=Off -DPCRE2_SUPPORT_LIBREADLINE=On" + ;; +libedit) + PKGDEPENDS="libedit $PKGDEPENDS" + with_completion="-DPCRE2_SUPPORT_LIBEDIT=On -DPCRE2_SUPPORT_LIBREADLINE=Off" + ;; +no) + with_completion="-DPCRE2_SUPPORT_LIBEDIT=Off -DPCRE2_SUPPORT_LIBREADLINE=Off" + ;; +esac + +if [ "$ZLIB" = "yes" ]; then + PKGDEPENDS="zlib $PKGDEPENDS" + with_zlib="-DPCRE2_SUPPORT_LIBZ=On" +else + with_zlib="-DPCRE2_SUPPORT_LIBZ=Off" +fi build() { - rm -rf $PKGNAME-$PKGVERSION - tar xvf $PKGNAME-$PKGVERSION.tar.gz - cd $PKGNAME-$PKGVERSION + rm -rf $PKGNAME-$PKGNAME-$PKGVERSION + tar -xvf $PKGNAME-$PKGVERSION.tar.gz + cd $PKGNAME-$PKGNAME-$PKGVERSION - # --enable-pcre2-(16|32): some packages require this (e.g. qtbase) - CC="$CC" \ - CFLAGS="$CFLAGS" \ - CXX="$CXX" \ - CXXFLAGS="$CXXFLAGS" \ - LDFLAGS="$LDFLAGS" \ - LIBS="$LIBS" \ - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix= \ - --enable-shared \ - --enable-pcre2-16 \ - --enable-pcre2-32 - make - make install DESTDIR=$DESTDIR - find $DESTDIR -type f -name "*.la" -delete + # -DPCRE2_BUILD_PCRE2_(16|32): some packages require this (e.g. qtbase) + cmake -S . -B build \ + -DBUILD_SHARED_LIBS=On \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="$CC" \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + -DCMAKE_INSTALL_PREFIX= \ + -DPCRE2_BUILD_PCRE2_16=On \ + -DPCRE2_BUILD_PCRE2_32=On \ + $with_bzip2 \ + $with_completion \ + $with_zlib + cmake --build build + DESTDIR=$DESTDIR cmake --build build --target install cd .. - rm -rf $PKGNAME-$PKGVERSION + rm -rf $PKGNAME-$PKGNAME-$PKGVERSION }