diff --git a/.gitignore b/.gitignore index 58aab44..fdf8eaf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ *.tar .idea .DS_Store -*.log \ No newline at end of file +*.log +/cache/ +/dist/ diff --git a/README.md b/README.md index dcbf942..d17b8cc 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ We use libvips for image manipulation, primarily tiling image pyramids for bluep In the fall of 2016, I had a good chat with [@jcupitt](https://github.com/jcupitt) and [@lovell](https://github.com/lovell) about the issue in [jcupitt/libvips#492](https://github.com/jcupitt/libvips/issues/492) and @lovell pointed out that they were building vips libraries for the Node.js module [Sharp](https://github.com/lovell/sharp). Sharp builds the shared libraries that have a single runtime dependency of `glibc v2.13+` and the latest Amazon Linux is further along than that. -If we were looking for a Node.js solution in AWS Lambda, we could have simply used the sharp module. If you are using Node.js, you should probably stop here and just go use Sharp. However, we required an executable that we could call directly. So I adapted the [sharp vips build tools](https://github.com/lovell/sharp/tree/master/packaging) to allow us to get what we are after, an executable. +If we were looking for a Node.js solution in AWS Lambda, we could have simply used the sharp module. If you are using Node.js, you should probably stop here and just go use Sharp. However, we required an executable that we could call directly. So I adapted the [sharp libvips packaging scripts](https://github.com/lovell/sharp-libvips) to allow us to get what we are after, an executable. It really didn't take much once I dug around the Sharp Repository a bit and found how they are building for the latest vips. We are ultimately just adding the `/bin` directory to the resulting archive. @@ -77,7 +77,7 @@ creating your lambda package. Not all operating systems nor zipping programs pro In your code you can reference `/var/task/bin/vips` and you will need to ensure you customize the Lambda Function Environment Variables: ```bash -LD_LIBRARY_PATH=${LAMBDA_TASK_ROOT}/lib:LD_LIBRARY_PATH +LD_LIBRARY_PATH=${LAMBDA_TASK_ROOT}/lib:${LD_LIBRARY_PATH} PATH=${LAMBDA_TASK_ROOT}/bin:${LAMBDA_TASK_ROOT}:${PATH} ``` diff --git a/build/dependencies/cairo.sh b/build/dependencies/cairo.sh old mode 100755 new mode 100644 index 77da0b7..e2adc03 --- a/build/dependencies/cairo.sh +++ b/build/dependencies/cairo.sh @@ -29,7 +29,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/croco.sh b/build/dependencies/croco.sh old mode 100755 new mode 100644 index a2f25bd..2fdc585 --- a/build/dependencies/croco.sh +++ b/build/dependencies/croco.sh @@ -17,7 +17,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/curl.sh b/build/dependencies/curl.sh old mode 100755 new mode 100644 index 16a566a..874edba --- a/build/dependencies/curl.sh +++ b/build/dependencies/curl.sh @@ -21,7 +21,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/exif.sh b/build/dependencies/exif.sh old mode 100755 new mode 100644 index d42861c..23eac6b --- a/build/dependencies/exif.sh +++ b/build/dependencies/exif.sh @@ -17,7 +17,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/expat.sh b/build/dependencies/expat.sh old mode 100755 new mode 100644 index d6abc33..5a108ff --- a/build/dependencies/expat.sh +++ b/build/dependencies/expat.sh @@ -15,7 +15,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/ffi.sh b/build/dependencies/ffi.sh old mode 100755 new mode 100644 index 46aeb86..8787295 --- a/build/dependencies/ffi.sh +++ b/build/dependencies/ffi.sh @@ -18,7 +18,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/fftw3.sh b/build/dependencies/fftw3.sh old mode 100755 new mode 100644 index 41d432e..eb97e30 --- a/build/dependencies/fftw3.sh +++ b/build/dependencies/fftw3.sh @@ -15,7 +15,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/fontconfig.sh b/build/dependencies/fontconfig.sh old mode 100755 new mode 100644 index 49ceb78..6fd76be --- a/build/dependencies/fontconfig.sh +++ b/build/dependencies/fontconfig.sh @@ -1,6 +1,6 @@ #!/bin/sh -fetchSource fontconfig https://www.freedesktop.org/software/fontconfig/release/fontconfig-${VERSION_FONTCONFIG}.tar.bz2 +fetchSource fontconfig https://www.freedesktop.org/software/fontconfig/release/fontconfig-${VERSION_FONTCONFIG}.tar.gz export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_FONTCONFIG}\"" if [ ! -f "configured.sts" ]; then @@ -20,7 +20,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/freetype.sh b/build/dependencies/freetype.sh old mode 100755 new mode 100644 index a1babfc..5a4c6c7 --- a/build/dependencies/freetype.sh +++ b/build/dependencies/freetype.sh @@ -16,7 +16,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/gdkpixbuf.sh b/build/dependencies/gdkpixbuf.sh old mode 100755 new mode 100644 index 8d8ecf7..877a5d5 --- a/build/dependencies/gdkpixbuf.sh +++ b/build/dependencies/gdkpixbuf.sh @@ -24,7 +24,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/ghostscript.sh b/build/dependencies/ghostscript.sh old mode 100755 new mode 100644 index d69a490..dfe8b5e --- a/build/dependencies/ghostscript.sh +++ b/build/dependencies/ghostscript.sh @@ -1,20 +1,16 @@ #!/bin/sh -#fetchSource ghostscript https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs921/ghostscript-${VERSION_GHOSTSCRIPT}.tar.gz - -export DEP_NAME=ghostscript -build_dir=${DEPS}/${DEP_NAME} -git clone http://git.ghostscript.com/ghostpdl.git ${build_dir} -cd ${build_dir} -VERSION_GHOSTSCRIPT=$(git rev-parse --short HEAD) - +fetchSource ghostscript \ + https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$( + echo "${VERSION_GHOSTSCRIPT}" | tr -d '.' + )/ghostscript-${VERSION_GHOSTSCRIPT}.tar.gz export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_GHOSTSCRIPT}\"" if [ ! -f "configured.sts" ]; then printf "\tConfiguring\n" rm -rf freetype lcms2 jpeg libpng - ./autogen.sh \ + ./configure \ --prefix=${TARGET} \ --disable-compile-inits \ --enable-dynamic \ @@ -27,14 +23,22 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - mkdir -p ${TARGET}/include/ghostscript - install -v -m644 base/*.h ${TARGET}/include/ghostscript >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - - mkdir -p ${TARGET}/share/ghostscript - curl -Ls http://downloads.sourceforge.net/gs-fonts/ghostscript-fonts-std-8.11.tar.gz | tar xzC ${TARGET}/share/ghostscript >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - curl -Ls http://downloads.sourceforge.net/gs-fonts/gnu-gs-fonts-other-6.0.tar.gz | tar xzC ${TARGET}/share/ghostscript >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - /usr/bin/fc-cache -v ${TARGET}/share/ghostscript/fonts/ >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + ( + # Ghostscript doesn't build reliably with multiple jobs. + unset MAKEFLAGS + + make so + make install + make soinstall + install -v -m644 base/*.h ${TARGET}/include/ghostscript + + mkdir -p ${TARGET}/share/ghostscript + curl -Ls http://downloads.sourceforge.net/gs-fonts/ghostscript-fonts-std-8.11.tar.gz | \ + tar xzC ${TARGET}/share/ghostscript + curl -Ls http://downloads.sourceforge.net/gs-fonts/gnu-gs-fonts-other-6.0.tar.gz | \ + tar xzC ${TARGET}/share/ghostscript + ${TARGET}/bin/fc-cache -v ${TARGET}/share/ghostscript/fonts/ + ) >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else diff --git a/build/dependencies/gif.sh b/build/dependencies/gif.sh old mode 100755 new mode 100644 index 0c27a15..3bde4f9 --- a/build/dependencies/gif.sh +++ b/build/dependencies/gif.sh @@ -16,7 +16,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/glib.sh b/build/dependencies/glib.sh old mode 100755 new mode 100644 index 0fc3ee0..ac522b6 --- a/build/dependencies/glib.sh +++ b/build/dependencies/glib.sh @@ -1,6 +1,9 @@ #!/bin/sh -fetchSource glib https://download.gnome.org/sources/glib/2.52/glib-${VERSION_GLIB}.tar.xz +fetchSource glib \ + https://download.gnome.org/sources/glib/$( + echo ${VERSION_GLIB} | cut -d '.' -f 1-2 + )/glib-${VERSION_GLIB}.tar.xz export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_GLIB}\"" if [ ! -f "configured.sts" ]; then @@ -22,7 +25,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/gsf.sh b/build/dependencies/gsf.sh old mode 100755 new mode 100644 index d100887..2476b53 --- a/build/dependencies/gsf.sh +++ b/build/dependencies/gsf.sh @@ -16,7 +16,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/harfbuzz.sh b/build/dependencies/harfbuzz.sh old mode 100755 new mode 100644 index 36ee753..1f7325d --- a/build/dependencies/harfbuzz.sh +++ b/build/dependencies/harfbuzz.sh @@ -17,7 +17,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/icu.sh b/build/dependencies/icu.sh old mode 100755 new mode 100644 index 0c37519..3f908d3 --- a/build/dependencies/icu.sh +++ b/build/dependencies/icu.sh @@ -20,7 +20,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/imagemagick.sh b/build/dependencies/imagemagick.sh old mode 100755 new mode 100644 index 7afb4cf..c409d60 --- a/build/dependencies/imagemagick.sh +++ b/build/dependencies/imagemagick.sh @@ -18,7 +18,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/imagick.sh b/build/dependencies/imagick.sh old mode 100755 new mode 100644 index 9b21e3c..c2dc1b2 --- a/build/dependencies/imagick.sh +++ b/build/dependencies/imagick.sh @@ -17,7 +17,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 mkdir -p ${TARGET}/modules cp rpm/imagick.ini ${TARGET}/modules/imagick.ini touch made.sts diff --git a/build/dependencies/jpeg-turbo.sh b/build/dependencies/jpeg-turbo.sh old mode 100755 new mode 100644 index 5f07494..eacdfc8 --- a/build/dependencies/jpeg-turbo.sh +++ b/build/dependencies/jpeg-turbo.sh @@ -19,7 +19,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/lcms2.sh b/build/dependencies/lcms2.sh old mode 100755 new mode 100644 index bafc1cd..e806084 --- a/build/dependencies/lcms2.sh +++ b/build/dependencies/lcms2.sh @@ -26,7 +26,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/nasm.sh b/build/dependencies/nasm.sh old mode 100755 new mode 100644 index 8f9cc49..b4e90e8 --- a/build/dependencies/nasm.sh +++ b/build/dependencies/nasm.sh @@ -15,7 +15,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/openjpeg.sh b/build/dependencies/openjpeg.sh old mode 100755 new mode 100644 index 5b6f837..1e9f035 --- a/build/dependencies/openjpeg.sh +++ b/build/dependencies/openjpeg.sh @@ -21,7 +21,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/openssl.sh b/build/dependencies/openssl.sh old mode 100755 new mode 100644 index 531cf15..016a58b --- a/build/dependencies/openssl.sh +++ b/build/dependencies/openssl.sh @@ -19,8 +19,15 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - curl -o ${TARGET}/etc/ssl/certdata.txt https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + ( + # OpenSSL doesn't build reliably with multiple jobs. + unset MAKEFLAGS + make + echo -e "\make install\n" + make install + curl -o ${TARGET}/etc/ssl/certdata.txt \ + https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt + ) >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/orc.sh b/build/dependencies/orc.sh old mode 100755 new mode 100644 index 36b0a35..3822387 --- a/build/dependencies/orc.sh +++ b/build/dependencies/orc.sh @@ -16,10 +16,13 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 cd ${TARGET}/lib rm -rf liborc-test-* - cd - >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + cd - touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/pango.sh b/build/dependencies/pango.sh old mode 100755 new mode 100644 index 649528c..787def9 --- a/build/dependencies/pango.sh +++ b/build/dependencies/pango.sh @@ -17,7 +17,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/pcre.sh b/build/dependencies/pcre.sh old mode 100755 new mode 100644 index fcbd77d..83fb63f --- a/build/dependencies/pcre.sh +++ b/build/dependencies/pcre.sh @@ -1,6 +1,6 @@ #!/bin/sh -fetchSource pcre ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${VERSION_PCRE}.tar.bz2 +fetchSource pcre https://downloads.sourceforge.net/project/pcre/pcre/${VERSION_PCRE}/pcre-${VERSION_PCRE}.tar.bz2 export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_PCRE}\"" if [ ! -f "configured.sts" ]; then @@ -19,7 +19,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/php.sh b/build/dependencies/php.sh old mode 100755 new mode 100644 index 51dbfad..712dace --- a/build/dependencies/php.sh +++ b/build/dependencies/php.sh @@ -48,8 +48,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 mkdir -p ${TARGET}/etc/php cp php.ini-production ${TARGET}/etc/php/php.ini touch made.sts diff --git a/build/dependencies/phpvips.sh b/build/dependencies/phpvips.sh old mode 100755 new mode 100644 index 914f93d..ae91761 --- a/build/dependencies/phpvips.sh +++ b/build/dependencies/phpvips.sh @@ -17,7 +17,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 mkdir -p ${TARGET}/modules echo "extension=vips.so" > ${TARGET}/modules/ext-phpvips.ini touch made.sts diff --git a/build/dependencies/pixman.sh b/build/dependencies/pixman.sh old mode 100755 new mode 100644 index 7c1080d..1489764 --- a/build/dependencies/pixman.sh +++ b/build/dependencies/pixman.sh @@ -18,7 +18,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/png16.sh b/build/dependencies/png16.sh old mode 100755 new mode 100644 index cd975e1..b32e7a8 --- a/build/dependencies/png16.sh +++ b/build/dependencies/png16.sh @@ -16,7 +16,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/poppler.sh b/build/dependencies/poppler.sh old mode 100755 new mode 100644 index a39d14f..ec61182 --- a/build/dependencies/poppler.sh +++ b/build/dependencies/poppler.sh @@ -28,8 +28,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/svg.sh b/build/dependencies/svg.sh old mode 100755 new mode 100644 index 89cc79d..41a180f --- a/build/dependencies/svg.sh +++ b/build/dependencies/svg.sh @@ -20,7 +20,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/swig.sh b/build/dependencies/swig.sh old mode 100755 new mode 100644 index b4eb212..f25d7a0 --- a/build/dependencies/swig.sh +++ b/build/dependencies/swig.sh @@ -17,8 +17,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/tiff.sh b/build/dependencies/tiff.sh old mode 100755 new mode 100644 index 48fb706..d4bbaa7 --- a/build/dependencies/tiff.sh +++ b/build/dependencies/tiff.sh @@ -31,7 +31,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/vips.sh b/build/dependencies/vips.sh old mode 100755 new mode 100644 index 024a60a..99a63dd --- a/build/dependencies/vips.sh +++ b/build/dependencies/vips.sh @@ -1,17 +1,8 @@ #!/bin/sh -fetchSource vips https://github.com/jcupitt/libvips/releases/download/v${VERSION_VIPS}/vips-${VERSION_VIPS}.tar.gz +fetchSource vips https://github.com/libvips/libvips/releases/download/v${VERSION_VIPS}/vips-${VERSION_VIPS}.tar.gz export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_VIPS}\"" -if [ ! -f "patched.sts" ]; then - printf "\tPatching\n" - curl -o libvips/foreign/pdfload.c https://raw.githubusercontent.com/jcupitt/libvips/61d5ba7b58af0bbd51ef26fa875713a0014e457b/libvips/foreign/pdfload.c >> ${BUILD_LOGS}/${DEP_NAME}.config.log 2>&1 - touch patched.sts -else - printf "\tAlready Patched\n" -fi - - if [ ! -f "configured.sts" ]; then printf "\tConfiguring\n" ./configure \ @@ -39,7 +30,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/webp.sh b/build/dependencies/webp.sh old mode 100755 new mode 100644 index 5e952dc..9405a42 --- a/build/dependencies/webp.sh +++ b/build/dependencies/webp.sh @@ -21,7 +21,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/xlst.sh b/build/dependencies/xlst.sh old mode 100755 new mode 100644 index 5f259b5..baad489 --- a/build/dependencies/xlst.sh +++ b/build/dependencies/xlst.sh @@ -15,7 +15,10 @@ else fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install-strip >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install-strip + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 touch made.sts else printf "\tAlready Built\n" diff --git a/build/dependencies/xml2.sh b/build/dependencies/xml2.sh index e69de29..f77ef9d 100644 --- a/build/dependencies/xml2.sh +++ b/build/dependencies/xml2.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +fetchSource xml2 http://xmlsoft.org/sources/libxml2-${VERSION_XML2}.tar.gz +export JSON_VERSIONS="${JSON_VERSIONS}, \"${DEP_NAME}\": \"${VERSION_XML2}\"" + +if [ ! -f "configured.sts" ]; then + printf "\tConfiguring\n" + ./configure \ + --prefix=${TARGET} \ + --exec-prefix=${TARGET} \ + --with-sysroot=${TARGET} \ + --enable-shared \ + --disable-static \ + --with-html \ + --with-history \ + --enable-ipv6=no \ + --with-icu \ + --with-zlib=${TARGET} >> ${BUILD_LOGS}/${DEP_NAME}.config.log 2>&1 + touch configured.sts +else + printf "\tAlready Configured\n" +fi +if [ ! -f "made.sts" ]; then + printf "\tBuilding\n" + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + cp xml2-config ${TARGET}/bin/xml2-config + touch made.sts +else + printf "\tAlready Built\n" +fi diff --git a/build/dependencies/zlib.sh b/build/dependencies/zlib.sh old mode 100755 new mode 100644 index 21fbed7..9bdecf0 --- a/build/dependencies/zlib.sh +++ b/build/dependencies/zlib.sh @@ -15,7 +15,10 @@ fi if [ ! -f "made.sts" ]; then printf "\tBuilding\n" - make install >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 + { + make + make install + } >> ${BUILD_LOGS}/${DEP_NAME}.make.log 2>&1 rm ${TARGET}/lib/libz.a touch made.sts else diff --git a/build/exports.sh b/build/exports.sh index 9bfe5f0..b24cf31 100644 --- a/build/exports.sh +++ b/build/exports.sh @@ -1,12 +1,14 @@ #!/bin/sh +export CACHE="/packaging/cache" export DEPS="/deps" export TARGET="/var/task" export BUILD_LOGS="/packaging/logs" -mkdir -p ${DEPS} -mkdir -p ${TARGET} -mkdir -p ${BUILD_LOGS} +mkdir -p "${CACHE}" +mkdir -p "${DEPS}" +mkdir -p "${TARGET}" +mkdir -p "${BUILD_LOGS}" # Common build paths and flags export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${TARGET}/lib/pkgconfig" @@ -22,4 +24,6 @@ export CXXFLAGS="${FLAGS}" export LD_LIBRARY_PATH=${TARGET}/lib -export JSON_VERSIONS="\"name\": \"version\"" \ No newline at end of file +export JSON_VERSIONS="\"name\": \"version\"" + +export MAKEFLAGS="-j $(nproc)" diff --git a/build/functions.sh b/build/functions.sh index 824f785..8126ed1 100644 --- a/build/functions.sh +++ b/build/functions.sh @@ -4,32 +4,37 @@ fetchSource () { export DEP_NAME=$1 url=$2 + file_name="${CACHE}/${url##*/}" build_dir=${DEPS}/${DEP_NAME} if [ ! -f ${build_dir}/downloaded.sts ]; then - printf "\tDownloading to ${build_dir}\n" mkdir -p ${build_dir} case "$url" in *.tar.xz) - tar_args=xJC + tar_arg=J ;; *.tar.gz) - tar_args=xzC + tar_arg=z ;; *.tgz) - tar_args=xzC + tar_arg=z ;; *.tar.bz2) - tar_args=xjC + tar_arg=j ;; *) echo "I can only handle .xz, .bz2, or .gz" exit 1 esac - - curl -Ls ${url} | tar ${tar_args} ${build_dir} --strip-components=1 + if [ ! -f "${file_name}" ] + then + printf "Downloading ${url}\n" + curl -L -s -o "${file_name}" "${url}" + fi + printf "Extracting to ${build_dir}\n" + tar "${tar_arg}xf" "${file_name}" -C ${build_dir} --strip-components=1 touch ${build_dir}/downloaded.sts else printf "\tAlready Downloaded\n" @@ -67,8 +72,18 @@ packageVips () { echo "| ${PACKAGE} " echo "-------------------------------------------------------------------------------------------------" - [[ -f "${PACKAGE}" ]] && rm "${PACKAGE}" - tar czf ${PACKAGE} include lib bin modules etc + if [ -f "${PACKAGE}" ] + then + rm -f "${PACKAGE}" + fi + tar zcf "${PACKAGE}" include lib bin etc + + # The modules directory only exists if building the PHP modules. + if [ "${BUILD_PHP}" = "YES" ] + then + tar zrf "${PACKAGE}" modules + fi + advdef --recompress --shrink-insane ${PACKAGE} } diff --git a/build/versions.sh b/build/versions.sh index 39845ba..7f1ff4c 100644 --- a/build/versions.sh +++ b/build/versions.sh @@ -26,7 +26,7 @@ export VERSION_FREETYPE=2.8 # https://sourceforge.net/projects/freetype/ export VERSION_GDKPIXBUF=2.36.6 # https://github.com/GNOME/gdk-pixbuf/releases export VERSION_GIF=5.1.4 # https://sourceforge.net/projects/giflib/files/?source=navbar export VERSION_GLIB=2.52.0 # https://github.com/GNOME/glib/releases -export VERSION_GHOSTSCRIPT=9.21 # http://www.linuxfromscratch.org/blfs/view/cvs/pst/gs.html +export VERSION_GHOSTSCRIPT=9.50 # http://www.linuxfromscratch.org/blfs/view/cvs/pst/gs.html export VERSION_GSF=1.14.41 # https://github.com/GNOME/libgsf/releases export VERSION_HARFBUZZ=1.4.5 # https://github.com/behdad/harfbuzz/releases export VERSION_ICU=59.1 # http://www.linuxfromscratch.org/blfs/view/svn/general/icu.html @@ -43,7 +43,7 @@ export VERSION_PANGO=1.40.6 # https://github.com/GNOME/pango/releases export VERSION_PCRE=8.40 # http://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html export VERSION_PHPVIPS=1.0.7 # https://github.com/jcupitt/php-vips-ext/releases export VERSION_PIXMAN=0.34.0 # https://www.cairographics.org/releases/ -export VERSION_PNG16=1.6.30 # https://libpng.sourceforge.io/ +export VERSION_PNG16=1.6.37 # https://libpng.sourceforge.io/ export VERSION_POPPLER=0.56.0 # https://poppler.freedesktop.org/ export VERSION_SVG=2.40.17 # https://github.com/GNOME/librsvg/releases export VERSION_SWIG=3.0.12 # http://www.linuxfromscratch.org/blfs/view/cvs/general/swig.html