Skip to content

Commit 17e9763

Browse files
2mazmaartenbreddels
authored andcommitted
pcre: install precompiled where possible
1 parent c129fa9 commit 17e9763

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ jobs:
8585
# # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
8686
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
8787
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
88-
- name: Install libpcre3-dev
89-
if: matrix.os == 'ubuntu-latest'
90-
run: |
91-
sudo apt update & sudo apt install -y libpcre3-dev
9288

9389
- name: Test with pytest
9490
run: |

bin/install_pcre.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,32 @@ function build_simple {
8585
fi
8686
# touch "${name}-stamp"
8787
}
88+
89+
8890
function build_pcre {
89-
echo "Build"
91+
echo "Build pcre"
9092
echo $ARCHFLAGS
9193
build_simple pcre $PCRE_VERSION http://ftp.exim.org/pub/pcre/
9294
}
93-
echo Build pcre
94-
build_pcre
95+
96+
function install_precompiled() {
97+
# Mac https://formulae.brew.sh/formula/pcre
98+
# DebianUbuntu https://packages.ubuntu.com/libpcre3-dev
99+
# Alpine https://pkgs.alpinelinux.org/package/edge/main/x86_64/pcre
100+
# RHEL https://git.almalinux.org/rpms/pcre
101+
if [ -n "$(which brew)" ]; then
102+
brew install pcre
103+
elif [ -n "$(which apt)" ]; then
104+
apt update
105+
apt install -y libpcre3-dev
106+
elif [ -n "$(which apk)" ]; then
107+
apk add --update pcre
108+
elif [ -n "$(which dnf)" ]; then
109+
dnf --setopt install_weak_deps=false -y install pcre
110+
else
111+
false
112+
fi
113+
}
114+
115+
echo "Install pcre"
116+
install_precompiled || build_pcre

0 commit comments

Comments
 (0)