-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to stack-specific build files, switch back to poppler from pdfium
The stacks are getting more and more native libraries that we depend on installed by Heroku. This allows us to remove them from our build and just include the -dev packages that match the runtime packages that Heroku installed.
- Loading branch information
Showing
7 changed files
with
135 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
ARG STACK_VERSION | ||
FROM heroku/heroku:$STACK_VERSION | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# generic build tools ... libgsf needs intltool | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
libtool \ | ||
wget \ | ||
python3-pip \ | ||
ninja-build \ | ||
intltool \ | ||
pkg-config | ||
|
||
RUN pip3 install meson | ||
|
||
# use the heroku platform libraries when we can | ||
# | ||
# see https://devcenter.heroku.com/articles/stack-packages | ||
# | ||
# libgsf needs libxml2 | ||
# | ||
# this should only pull in header files and should not create any extra run | ||
# time dependencies | ||
RUN apt-get install -y \ | ||
glib-2.0-dev \ | ||
libexpat1-dev \ | ||
libpango1.0-dev \ | ||
librsvg2-dev \ | ||
libpng-dev \ | ||
libwebp-dev \ | ||
libjpeg-turbo8-dev \ | ||
libtiff5-dev \ | ||
libexif-dev \ | ||
liblcms2-dev \ | ||
libxml2-dev \ | ||
libfftw3-dev \ | ||
libopenexr-dev \ | ||
libgirepository1.0-dev \ | ||
libmagickcore-dev \ | ||
libpoppler-glib-dev \ | ||
libimagequant-dev \ | ||
liborc-0.4-dev \ | ||
libgsf-1-dev \ | ||
libcgif-dev \ | ||
libheif-dev | ||
|
||
WORKDIR /usr/local/src | ||
|
||
# build to this prefix | ||
# - heroku has /usr/local/lib on the default ld.so.conf search path, so | ||
# this is convenient | ||
# - heroku has a basic dir structure in /usr/local, but no files | ||
ARG PREFIX=/usr/local | ||
ENV PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig | ||
|
||
# use libspng for PNG load and save | ||
ARG SPNG_VERSION=0.7.2 | ||
ARG SPNG_URL=https://github.com/randy408/libspng/archive/refs/tags | ||
|
||
RUN wget ${SPNG_URL}/v${SPNG_VERSION}.tar.gz \ | ||
&& tar xf v${SPNG_VERSION}.tar.gz \ | ||
&& cd libspng-${SPNG_VERSION} \ | ||
&& meson build --prefix=${PREFIX} --libdir=lib \ | ||
&& cd build \ | ||
&& ninja \ | ||
&& ninja install | ||
|
||
ARG VIPS_VERSION=8.14.3 | ||
ARG VIPS_URL=https://github.com/libvips/libvips/archive/refs/tags | ||
|
||
RUN wget ${VIPS_URL}/v${VIPS_VERSION}/v${VIPS_VERSION}.tar.gz \ | ||
&& tar xzf v${VIPS_VERSION}.tar.gz \ | ||
&& cd libvips-${VIPS_VERSION} \ | ||
&& meson setup build \ | ||
--prefix=$PREFIX \ | ||
--libdir=lib \ | ||
--buildtype=release \ | ||
# obscure file format that nobody will use \ | ||
-Dradiance=false \ | ||
# obscure file format that nobody will use \ | ||
-Danalyze=false \ | ||
# modules cause issues with loading heif files in ruby-vips \ | ||
-Dmodules=disabled \ | ||
# allows omitting gobject-introspection library \ | ||
-Dintrospection=false \ | ||
&& cd build \ | ||
&& meson compile \ | ||
&& meson install | ||
|
||
# clean and package | ||
ARG STACK_VERSION | ||
RUN cd $PREFIX \ | ||
&& rm -rf lib/*.a lib/*.la lib/python* \ | ||
&& strip lib/lib*.so* \ | ||
&& rm -rf build \ | ||
&& mkdir -p build \ | ||
&& tar czf "build/heroku-${STACK_VERSION}.tar.gz" bin include lib \ | ||
&& ls -l build/heroku-${STACK_VERSION}.tar.gz \ | ||
&& echo built heroku-${STACK_VERSION}.tar.gz | ||
|
||
# Update ldconfig cache | ||
RUN ldconfig | ||
|
||
# Store configuration for easy viewing in the repo | ||
ARG STACK_VERSION | ||
RUN cd $PREFIX \ | ||
&& echo "$ vips --vips-version" > "build/heroku-$STACK_VERSION.config.log" \ | ||
&& vips --vips-version >> "build/heroku-$STACK_VERSION.config.log" \ | ||
&& echo "" >> "build/heroku-$STACK_VERSION.config.log" \ | ||
&& echo "$ vips --vips-config" >> "build/heroku-$STACK_VERSION.config.log" \ | ||
&& vips --vips-config >> "build/heroku-$STACK_VERSION.config.log" | ||
|
||
# install and test ruby-vips to confirm we can pick up the libraries | ||
# correctly | ||
# we need ruby-dev to install ruby-ffi | ||
RUN apt-get install -y ruby-dev | ||
RUN gem install ruby-vips | ||
RUN ruby -e 'require "vips"; puts "ruby-vips: libvips #{Vips::LIBRARY_VERSION}"' |