mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-05 22:14:26 +08:00
Fix: Update how SASL-XOAUTH2 is build (without DOCS) to (re)enable more architectures
This commit is contained in:
parent
888ec87871
commit
696422015a
5 changed files with 21 additions and 43 deletions
3
.github/workflows/master.yml
vendored
3
.github/workflows/master.yml
vendored
|
@ -93,8 +93,7 @@ jobs:
|
||||||
boky/postfix:edge-alpine
|
boky/postfix:edge-alpine
|
||||||
# linux/s390x: "rsyslog (no such package)"
|
# linux/s390x: "rsyslog (no such package)"
|
||||||
# Latest Alpine does not have all the packages for 386 anymore. :-(
|
# Latest Alpine does not have all the packages for 386 anymore. :-(
|
||||||
# Pandoc, which is required for SASL build, cannot be found in these images: linux/arm/v6,linux/arm/v7,linux/ppc64le
|
platforms: "linux/arm/v6,linux/arm/v7,linux/ppc64le,linux/amd64,linux/arm64"
|
||||||
platforms: "linux/amd64,linux/arm64"
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache/alpine,mode=max,compression=estargz
|
cache-from: type=local,src=/tmp/.buildx-cache/alpine,mode=max,compression=estargz
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new/alpine
|
cache-to: type=local,dest=/tmp/.buildx-cache-new/alpine
|
||||||
build-args: |
|
build-args: |
|
||||||
|
|
3
.github/workflows/tags.yml
vendored
3
.github/workflows/tags.yml
vendored
|
@ -99,8 +99,7 @@ jobs:
|
||||||
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-alpine
|
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-alpine
|
||||||
# linux/s390x: "rsyslog (no such package)"
|
# linux/s390x: "rsyslog (no such package)"
|
||||||
# Latest Alpine does not have all packages for 386 any more :-(
|
# Latest Alpine does not have all packages for 386 any more :-(
|
||||||
# Pandoc, which is required for SASL build, cannot be found in these images: linux/arm/v6,linux/arm/v7,linux/ppc64le
|
platforms: "linux/arm/v6,linux/arm/v7,linux/ppc64le,linux/amd64,linux/arm64"
|
||||||
platforms: "linux/amd64,linux/arm64"
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache/alpine,mode=max,compression=estargz
|
cache-from: type=local,src=/tmp/.buildx-cache/alpine,mode=max,compression=estargz
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache-new/alpine
|
cache-to: type=local,dest=/tmp/.buildx-cache-new/alpine
|
||||||
build-args: |
|
build-args: |
|
||||||
|
|
|
@ -1,47 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
build_pandoc() {
|
|
||||||
if [ -f /etc/alpine-release ]; then
|
|
||||||
if apk add --upgrade pandoc; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if apt-get install -y --no-install-recommends pandoc; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/alpine-release ]; then
|
|
||||||
apk add --upgrade cabal curl llvm
|
|
||||||
else
|
|
||||||
apt-get install -y --no-install-recommends cabal curl llvm
|
|
||||||
fi
|
|
||||||
mkdir pandoc
|
|
||||||
curl --retry 5 --max-time 300 --connect-timeout 10 -fsSL https://github.com/jgm/pandoc/archive/refs/tags/3.1.8.tar.gz | tar xvzf - --strip-components 1 -C pandoc
|
|
||||||
cd pandoc
|
|
||||||
cabal update
|
|
||||||
cabal install --only-dependencies --lib
|
|
||||||
cabal configure \
|
|
||||||
--enable-optimization=2 \
|
|
||||||
--disable-tests \
|
|
||||||
--disable-documentation \
|
|
||||||
--disable-benchmarks \
|
|
||||||
--disable-coverage \
|
|
||||||
--disable-library-stripping \
|
|
||||||
--disable-executable-stripping \
|
|
||||||
--disable-profiling \
|
|
||||||
--enable-static
|
|
||||||
cabal build
|
|
||||||
}
|
|
||||||
|
|
||||||
build_sasl2() {
|
build_sasl2() {
|
||||||
git clone --depth 1 --branch ${SASL_XOAUTH2_GIT_REF} ${SASL_XOAUTH2_REPO_URL} /sasl-xoauth2
|
git clone --depth 1 --branch ${SASL_XOAUTH2_GIT_REF} ${SASL_XOAUTH2_REPO_URL} /sasl-xoauth2
|
||||||
cd /sasl-xoauth2
|
cd /sasl-xoauth2
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
# Documentation build (now) requires pandoc, which is not available on multiple
|
||||||
|
# architectures. Since we're are building an image that we want it to be as slim as possible,
|
||||||
|
# we're removing the build of documentation instead of complicating things with pandoc.
|
||||||
|
patch -p1 -d .. < /build-scripts/sasl-xoauth2-01.patch
|
||||||
if [ -f /etc/alpine-release ]; then
|
if [ -f /etc/alpine-release ]; then
|
||||||
patch -p1 -d .. < /build-scripts/sasl-xoauth2.diff
|
patch -p1 -d .. < /build-scripts/sasl-xoauth2-02.patch
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=/ ..
|
cmake -DCMAKE_INSTALL_PREFIX=/ ..
|
||||||
else
|
else
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
|
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
|
||||||
|
@ -52,18 +22,16 @@ build_sasl2() {
|
||||||
update-ca-certificates
|
update-ca-certificates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -f /etc/lsb-release ] && . /etc/lsb-release
|
||||||
|
[ -f /etc/os-release ] && . /etc/os-release
|
||||||
if [ -f /etc/alpine-release ]; then
|
if [ -f /etc/alpine-release ]; then
|
||||||
apk add --upgrade --virtual .build-deps git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch
|
apk add --upgrade --virtual .build-deps git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch
|
||||||
build_pandoc
|
|
||||||
build_sasl2
|
build_sasl2
|
||||||
apk del .build-deps;
|
apk del .build-deps;
|
||||||
else
|
else
|
||||||
[ -f /etc/lsb-release ] && . /etc/lsb-release
|
|
||||||
[ -f /etc/os-release ] && . /etc/os-release
|
|
||||||
apt-get update -y -qq
|
apt-get update -y -qq
|
||||||
LIBS="git build-essential cmake pkg-config libcurl4-openssl-dev libssl-dev libjsoncpp-dev libsasl2-dev"
|
LIBS="git build-essential cmake pkg-config libcurl4-openssl-dev libssl-dev libjsoncpp-dev libsasl2-dev"
|
||||||
apt-get install -y --no-install-recommends ${LIBS}
|
apt-get install -y --no-install-recommends ${LIBS}
|
||||||
build_pandoc
|
|
||||||
build_sasl2
|
build_sasl2
|
||||||
apt-get remove --purge -y ${LIBS}
|
apt-get remove --purge -y ${LIBS}
|
||||||
apt-get autoremove --yes
|
apt-get autoremove --yes
|
||||||
|
|
12
build-scripts/sasl-xoauth2-01.patch
Normal file
12
build-scripts/sasl-xoauth2-01.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index da4dd69..3739e18 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -31,7 +31,6 @@ option(EnableTests "Enable tests." ON)
|
||||||
|
if(EnableTests)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
|
-add_subdirectory(docs)
|
||||||
|
add_subdirectory(scripts)
|
||||||
|
add_subdirectory(src)
|
||||||
|
|
Loading…
Add table
Reference in a new issue