-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTERNAL: Add support for Heroku-24 stack #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
build: build-heroku-16 build-heroku-20 | ||
build: build-heroku-24 | ||
|
||
build-heroku-16: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heroku hasn't supported this stack since April 2021 |
||
@echo "Building imagemagick in Docker for heroku-16..." | ||
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-16" -w /buildpack heroku/heroku:16-build scripts/build_imagemagick imagemagick-heroku-16.tar.gz | ||
|
||
build-heroku-20: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This stack reaches end of life April 30, 2025 |
||
@echo "Building imagemagick in Docker for heroku-20..." | ||
@docker run -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-20" -w /buildpack heroku/heroku:20-build scripts/build_imagemagick imagemagick-heroku-20.tar.gz | ||
build-heroku-24: | ||
@echo "Building imagemagick in Docker for heroku-24..." | ||
@docker run --user root -v $(shell pwd):/buildpack --rm -it -e "STACK=heroku-24" -w /buildpack heroku/heroku:24-build scripts/build_imagemagick imagemagick-heroku-24.tar.gz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unlike past heroku/heroku:N-build images, "heroku/heroku:24-build" sets the default user to "heroku" as its last step. That means the |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,56 +13,23 @@ function handle_error() { | |
} | ||
trap handle_error EXIT SIGINT | ||
|
||
function add_xenial_repositories() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even when building for Heroku-20, this script was reaching back to $ ldconfig -p | grep libopenjp2
libopenjp2.so.7 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopenjp2.so.7
libopenjp2.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libopenjp2.so |
||
cat <<-EOT >> /etc/apt/sources.list | ||
deb http://archive.ubuntu.com/ubuntu/ xenial main universe | ||
deb http://security.ubuntu.com/ubuntu xenial-security main | ||
EOT | ||
} | ||
# avoid error: E: You must put some 'deb-src' URIs in your sources.list | ||
echo "deb-src http://archive.ubuntu.com/ubuntu noble main universe" >> /etc/apt/sources.list | ||
|
||
# add source packages repository to sources.list | ||
function add_source_repositories() { | ||
echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main universe" >> /etc/apt/sources.list | ||
if [[ $STACK == "heroku-20" ]]; then | ||
add_xenial_repositories | ||
fi | ||
} | ||
|
||
add_source_repositories | ||
|
||
echo "⚙️ Getting libraries and dependencies..." | ||
apt-get update -y | ||
apt-get install -y build-essential autoconf libtool git-core | ||
if [[ $STACK == "heroku-20" ]]; then | ||
echo "⚙️ Getting additional dependencies for the selected stack..." | ||
apt-get install -y libomp5 libomp-10-dev libjasper-dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment about libjasper-dev.. libomp5 libomp-10-dev are for OpenMP support. "heroku/heroku:24-build" uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. $ apt show libomp-dev
Package: libomp-dev
Version: 1:18.0-59~exp2
Priority: extra
Section: universe/libdevel
Source: llvm-defaults (0.59~exp2)
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: LLVM Packaging Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 11.3 kB
Depends: libomp-18-dev (>= 18~)
Download-Size: 5366 B
APT-Sources: http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: LLVM OpenMP runtime - dev package
$ apt show libomp5
Package: libomp5
Version: 1:18.0-59~exp2
Priority: extra
Section: universe/libs
Source: llvm-defaults (0.59~exp2)
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: LLVM Packaging Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 11.3 kB
Depends: libomp5-18 (>= 18~)
Download-Size: 5348 B
APT-Sources: http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: LLVM OpenMP runtime |
||
fi | ||
apt-get build-dep -y imagemagick libmagickcore-dev | ||
|
||
# install the libde265 library | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This lib is now part of heroku-24 $ ldconfig -p | grep libde265
libde265.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libde265.so.0
libde265.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libde265.so |
||
echo "⚙️ Installing and configuring libde265..." | ||
git clone https://github.com/strukturag/libde265.git $WORK_DIR/libde265 | ||
cd $WORK_DIR/libde265 | ||
./autogen.sh && ./configure && make && make install | ||
|
||
# install the libheif library | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This lib is now part of heroku-24 $ ldconfig -p | grep libheif
libheif.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libheif.so.1
libheif.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libheif.so |
||
echo "⚙️ Installing and configuring libheif..." | ||
git clone https://github.com/strukturag/libheif.git $WORK_DIR/libheif | ||
cd $WORK_DIR/libheif | ||
./autogen.sh && ./configure && make && make install | ||
|
||
# get, configure and install newest imagemagick | ||
echo "⚙️ Installing latest imagemagick..." | ||
git clone https://github.com/ImageMagick/ImageMagick.git $WORK_DIR/imagemagick | ||
# get, configure and install imagemagick | ||
echo "⚙️ Installing imagemagick version 7.0.11-5..." | ||
git clone --depth 1 --branch 7.0.11-5 https://github.com/ImageMagick/ImageMagick.git $WORK_DIR/imagemagick | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
cd $WORK_DIR/imagemagick | ||
./configure --with-heic=yes --prefix=$WORK_DIR/imagemagick --without-gvc | ||
make && make install | ||
|
||
# copy the dependencies into imagemagick lib directory | ||
cp /usr/local/lib/libde265.so.0 $WORK_DIR/imagemagick/lib | ||
cp /usr/local/lib/libheif.so.1 $WORK_DIR/imagemagick/lib | ||
cp /usr/lib/x86_64-linux-gnu/libomp.so.5 $WORK_DIR/imagemagick/lib | ||
cp /usr/lib/x86_64-linux-gnu/libiomp5.so $WORK_DIR/imagemagick/lib | ||
Comment on lines
-62
to
-65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these ship with the heroku-24 image |
||
|
||
# clean up the build and get ready for packaging | ||
echo "🧹 Cleaning up..." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn macOS litter