Skip to content

Commit

Permalink
remove AGPL licensed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
acseko committed Oct 1, 2024
1 parent ea06cb8 commit 8647011
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
echo "imagemagick_release=$(cat ./release-version)" >> $GITHUB_OUTPUT
- name: Prepare image
run: docker build . -t buildenv --build-arg BASE_IMAGE=${{ matrix.base_image }}
run: docker build . -t buildenv --build-arg BASE_IMAGE=${{ matrix.base_image }} --build-arg NOAGPL=true
working-directory: rpms

- name: Build and Install
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repo is building ImageMagick v7 deb/rpm packages for multiple distributions

* RockyLinux 9 (x86_64 and aarch64)
* RockyLinux 8 (x86_64 and aarch64)
* RockyLinux 8 (x86_64 without AGPL licensed dependencies)
* Ubuntu 22.04 (x86_64 only)
* Ubuntu 20.04 (x86_64 only)
* Ubuntu 18.04 (x86_64 only)
Expand Down
17 changes: 1 addition & 16 deletions debs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,15 @@
"target_arch": "x86_64",
"nexus_classifier": "ub2204-amd64"
},
{
"base_image": "ubuntu:22.04",
"target_arch": "aarch64",
"nexus_classifier": "ub2204-arm64"
},
{
"base_image": "ubuntu:20.04",
"target_arch": "x86_64",
"nexus_classifier": "ub2004-amd64"
},
{
"base_image": "ubuntu:20.04",
"target_arch": "aarch64",
"nexus_classifier": "ub2004-arm64"
},
{
"base_image": "ubuntu:18.04",
"target_arch": "x86_64",
"nexus_classifier": "ub1804-amd64"
},
{
"base_image": "ubuntu:18.04",
"target_arch": "aarch64",
"nexus_classifier": "ub1804-arm64"
}
]
}
}
2 changes: 1 addition & 1 deletion release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
11
18 changes: 16 additions & 2 deletions rpms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ ARG BASE_IMAGE

FROM ${BASE_IMAGE}

RUN yum install -y epel-release git make yum-utils rpm-build && \
yum group install -y "Development Tools" && \
ARG NOAGPL
ENV NOAGPL=${NOAGPL:-true}

RUN if [ "$BASE_IMAGE" = "redhat/ubi8" ]; then \
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm; \
else \
yum install -y epel-release; \
fi && \

yum install -y git make yum-utils rpm-build && \

if [ "$NOAGPL" = "true" ]; then \
yum group install -y "Development Tools" --exclude asciidoc --exclude graphviz; \
else \
yum group install -y "Development Tools"; \
fi && \
yum clean all

ARG BASE_IMAGE
Expand Down
11 changes: 3 additions & 8 deletions rpms/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
"target_arch": "x86_64",
"nexus_classifier": "el9"
},
{
"base_image": "rockylinux:9",
"target_arch": "aarch64",
"nexus_classifier": "el9-aarch64"
},
{
"base_image": "rockylinux:8",
"target_arch": "x86_64",
"nexus_classifier": "el8"
},
{
"base_image": "rockylinux:8",
"target_arch": "aarch64",
"nexus_classifier": "el8-aarch64"
"base_image": "redhat/ubi8",
"target_arch": "x86_64",
"nexus_classifier": "el8-noagpl"
}
]
}
24 changes: 22 additions & 2 deletions rpms/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,33 @@ sed -i '/BuildRequires.*ghostscript-devel/d; s/--with-gslib/--without-gslib/' Im
# Drop LibRaw support which is not compatible with the current version of ImageMagick
sed -i '/BuildRequires.*LibRaw/d; /--with-raw/d' ImageMagick.spec.in

if ["${NOAGPL:-false}" == "true" ]; then
# Drop urw-base35-fonts support, which has AGPL license.
sed -i '/BuildRequires.*urw-base35-fonts/d; /--with-urw-base35-fonts/d; /urw-base35-fonts/d' ImageMagick.spec.in
# Drop graphviz, since it requires urw-base35-fonts
sed -i '/BuildRequires.*graphviz/d' ImageMagick.spec.in
fi;

AFTER_CHECKOUT_HOOK_SCRIPT="../after-checkout-${BASE_IMAGE//:/}-$IMAGEMAGICK_VERSION.sh"
if [ -x "$AFTER_CHECKOUT_HOOK_SCRIPT" ]; then
"$AFTER_CHECKOUT_HOOK_SCRIPT"
fi

# Generate updated src.rpm
./configure
if ["${NOAGPL:-false}" == "true" ]; then
./configure --with-gvc=no
else
./configure
fi
make dist-xz
make srpm

# Build it
yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm"
if ["${NOAGPL:-false}" == "true" ]; then
yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm" --exclude urw-base35-fonts --exclude graphviz
else
yum-builddep -y "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm"
fi
rpmbuild --rebuild --nocheck --target "$TARGET_ARCH" "ImageMagick-$IMAGEMAGICK_VERSION.src.rpm"

echo "Imagemagick $IMAGEMAGICK_VERSION for $TARGET_ARCH built successfully."
Expand All @@ -58,4 +73,9 @@ cd "/root/rpmbuild/RPMS/$TARGET_ARCH"
echo "Testing package for unexpected dependencies"
rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'libgs'

if ["${NOAGPL:-false}" == "true" ]; then
rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'urw-base35-fonts'
rpm -qp --requires ImageMagick-libs-$IMAGEMAGICK_VERSION.$TARGET_ARCH.rpm | grep -qEv 'graphviz'
fi;

exec /tests.sh $IMAGEMAGICK_VERSION $TARGET_ARCH

0 comments on commit 8647011

Please sign in to comment.