Skip to content

Commit

Permalink
Patch APR to remove crypt dependency (#758)
Browse files Browse the repository at this point in the history
Motivation:

We dont use any APR features that uses libcrypt so we can safely not link against it. This resolves various issues as some distributions otherwise need the extra installation of libxcrypt-compat etc.

Modifications:

- Add patchfile for APR configure.in to remove linking against libcrypt
- Patch APR during build

Result:

Fixes #703
  • Loading branch information
normanmaurer authored Jan 10, 2023
1 parent a37760f commit 8d46f00
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
# uses a compiled language

- name: Install tools / libraries
run: sudo apt-get update && sudo apt-get -y install autoconf automake libtool make tar libapr1-dev libssl-dev cmake perl ninja-build
run: sudo apt-get update && sudo apt-get -y install autoconf automake libtool libtool-bin make tar libapr1-dev libssl-dev cmake perl ninja-build

- name: Build project
run: ./mvnw clean package -DskipTests=true
run: ./mvnw clean package -pl openssl-dynamic -DskipTests=true

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
1 change: 1 addition & 0 deletions docker/Dockerfile.centos6
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN yum install -y \
lsb-core \
make \
openssl-devel \
patch \
perl \
tar \
unzip \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cross_compile_aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-g
# Install requirements
RUN set -x && \
yum -y install epel-release && \
yum -y install wget tar git make autoconf automake libtool openssl-devel ninja-build gcc-c++
yum -y install wget tar git make autoconf automake libtool openssl-devel ninja-build gcc-c++ patch

# Install Java
RUN yum install -y java-1.8.0-openjdk-devel golang
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" >
libc-bin=2.13-38+deb7u10 \
libc6=2.13-38+deb7u10 libc6-dev \
make \
patch \
perl-base=5.14.2-21+deb7u3 \
tar \
unzip \
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.opensuse
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN zypper install --force-resolution --no-recommends --no-confirm \
lsb-release \
make \
ninja \
patch \
perl \
tar \
unzip \
Expand Down
10 changes: 10 additions & 0 deletions patches/apr_crypt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- configure.in.old 2023-01-09 14:22:19
+++ configure.in 2023-01-09 14:22:43
@@ -729,7 +729,6 @@
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(gethostname, nsl)
AC_SEARCH_LIBS(socket, socket)
- AC_SEARCH_LIBS(crypt, crypt ufc)
AC_CHECK_LIB(truerand, main)
AC_SEARCH_LIBS(modf, m)
;;
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@
</then>
</if>

<echo message="Patching APR to not link against libcrypt" />
<patch patchfile="../patches/apr_crypt.patch" strip="0" dir="${aprSourceDir}" />
<exec executable="buildconf" failonerror="true" dir="${aprSourceDir}" resolveexecutable="true" />

<if>
<equals arg1="${osxCrossCompile}" arg2="true" />
<then>
Expand Down

0 comments on commit 8d46f00

Please sign in to comment.