From c34724f4211442b4668245c8495c45ccbcd10dd5 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Tue, 24 Jan 2023 21:29:05 +1300 Subject: [PATCH] Support newest libjpeg-turbo on Oracle --- builder/dockerfile.oracle_8.build | 5 ++++- builder/scripts/build-libjpeg-turbo | 10 +++++++++- builder/scripts/common.sh | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/builder/dockerfile.oracle_8.build b/builder/dockerfile.oracle_8.build index 60fc801..feec400 100644 --- a/builder/dockerfile.oracle_8.build +++ b/builder/dockerfile.oracle_8.build @@ -14,7 +14,6 @@ RUN dnf install -y \ gcc-c++ \ git \ gnutls-devel \ - libjpeg-turbo-devel \ libpng-devel \ libtiff-devel \ make \ @@ -53,6 +52,10 @@ RUN cd /tmp/libwebp-1.0.2 && \ ./configure --enable-static --disable-shared && \ make && make install +ENV SCRIPTS_DIR=/tmp/scripts +COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-libjpeg-turbo + RUN useradd -m docker && echo "docker:docker" | chpasswd COPY --chown=docker:docker . /src/ diff --git a/builder/scripts/build-libjpeg-turbo b/builder/scripts/build-libjpeg-turbo index e00384f..a60f5d5 100755 --- a/builder/scripts/build-libjpeg-turbo +++ b/builder/scripts/build-libjpeg-turbo @@ -4,7 +4,7 @@ set -euo pipefail build_and_install() { export MAKEFLAGS=-j`nproc` - export CFLAGS="-fpic -flto" + export CFLAGS="-fpic" cmake -DCMAKE_INSTALL_PREFIX=/usr/local -G"Unix Makefiles" make make install @@ -17,6 +17,10 @@ install_build_dependencies() { yum install -y cmake gcc return fi + if [ "$DISTRO" = oracle ]; then + dnf install -y cmake gcc + return + fi apt-get update apt-get install -y cmake gcc @@ -27,6 +31,10 @@ ensure_libjpeg_is_fast() { yum install -y nasm return fi + if [ "$DISTRO" = oracle ]; then + dnf install -y nasm + return + fi apt-get update apt-get install -y nasm diff --git a/builder/scripts/common.sh b/builder/scripts/common.sh index 1196a1b..9a2d6be 100644 --- a/builder/scripts/common.sh +++ b/builder/scripts/common.sh @@ -1,8 +1,10 @@ +#!/bin/bash + detect_distro() { if [ -f /etc/centos-release ]; then DISTRO=centos elif [ -f /etc/oracle-release ]; then - DISTRO=oracle7 + DISTRO=oracle elif [ -f /usr/bin/zypper ]; then DISTRO=opensuse else