From 8e3da427925781a2eaa2973bc39aef09b631d630 Mon Sep 17 00:00:00 2001 From: Ariel Abreu Date: Wed, 1 Nov 2023 18:29:48 -0400 Subject: [PATCH] [deb,rpm] Remove python2 dep [ci] Allow Dockerfiles to be reused for different base images --- ci/Debian.Dockerfile | 24 +++++++++++++++++++++--- ci/RPM.Dockerfile | 3 ++- debian/control | 2 +- rpm/SPECS/darling.spec | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ci/Debian.Dockerfile b/ci/Debian.Dockerfile index 9e31d85fc..5b53a5f68 100644 --- a/ci/Debian.Dockerfile +++ b/ci/Debian.Dockerfile @@ -1,15 +1,16 @@ # this Dockerfile must be built using the following command: # docker build -f ../ci/Debian.Dockerfile . # this command must be run while in the `debian` directory in the root of the repo. -FROM ubuntu:jammy +ARG BASE_IMAGE=ubuntu:jammy +FROM $BASE_IMAGE LABEL name=darling-build-image version=0.1.0 ARG DEBIAN_FRONTEND="noninteractive" ARG CI_UID=1111 ARG CI_GID=1111 RUN cp /etc/apt/sources.list /etc/apt/sources.list.d/sources-src.list && sed -i 's|deb http|deb-src http|g' /etc/apt/sources.list.d/sources-src.list RUN apt-get -y update -RUN apt-get -y install cmake clang bison flex libfuse-dev libudev-dev pkg-config libc6-dev-i386 gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev libfreetype6-dev git git-lfs libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev libavformat-dev libavcodec-dev libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev python2 llvm-dev libvulkan-dev && apt clean -y -RUN apt-get -y install lsb-release lsb-core && apt clean -y +RUN apt-get -y install cmake clang bison flex libfuse-dev libudev-dev pkg-config libc6-dev-i386 gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev libfreetype6-dev git git-lfs libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev libavformat-dev libavcodec-dev libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev llvm-dev libvulkan-dev && apt clean -y +RUN apt-get -y install lsb-release && apt clean -y RUN groupadd -g "${CI_GID}" ci RUN useradd -u "${CI_UID}" -g "${CI_GID}" -m ci RUN apt-get -y install devscripts equivs debhelper && apt clean -y @@ -17,6 +18,23 @@ COPY control /control RUN mk-build-deps -i -r -t "apt-get --no-install-recommends -y" /control && apt clean -y RUN rm /control RUN apt-get -y install ccache && apt clean -y +RUN apt-get -y install wget gpg ca-certificates && apt clean -y + +RUN if [ "$(clang --version | head -n 1 | cut -d ' ' -f 3 | cut -d '.' -f 1)" -lt 11 ]; then \ + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ + echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs) main" >> /etc/apt/sources.list.d/llvm.list && \ + echo "deb-src http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs) main" >> /etc/apt/sources.list.d/llvm.list && \ + apt-get update; \ + fi + +RUN if [ "$(cmake --version | head -n 1 | cut -d ' ' -f 3 | awk '{print $1"\n3.20"}' | sort -Vr | head -n 1)" = "3.20" ]; then \ + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ + apt-get update; \ + fi + +RUN apt-get install -y --only-upgrade clang cmake && apt clean -y + RUN mkdir -p /ccache RUN mkdir -p /src/mnt RUN chown -R ci:ci /src diff --git a/ci/RPM.Dockerfile b/ci/RPM.Dockerfile index 08b5e4e52..f96977aa6 100644 --- a/ci/RPM.Dockerfile +++ b/ci/RPM.Dockerfile @@ -1,7 +1,8 @@ # this Dockerfile must be built using the following command: # docker build -f ../ci/RPM.Dockerfile . # this command must be run while in the `rpm` directory in the root of the repo. -FROM fedora:37 +ARG BASE_IMAGE=fedora:37 +FROM $BASE_IMAGE LABEL name=darling-build-image-fedora version=0.1.0 ARG CI_UID=1111 ARG CI_GID=1111 diff --git a/debian/control b/debian/control index e27f1c850..d54f725cc 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Maintainer: Lubos Dolezel Section: misc Priority: optional Standards-Version: 4.4.0 -Build-Depends: cmake, clang | clang-9, bison, flex, libfuse-dev, libudev-dev, pkg-config, libc6-dev-i386, linux-headers-amd64|linux-headers-generic, gcc-multilib, libcairo2-dev, libgl1-mesa-dev, libtiff5-dev, libfreetype6-dev, libelf-dev, libxml2-dev, libegl1-mesa-dev, libglu1-mesa-dev, libfontconfig1-dev, libbsd-dev, debhelper, ninja-build, python2, libxrandr-dev, libxcursor-dev, libgif-dev, libavcodec-dev, libavformat-dev, libswresample-dev, libavutil-dev, libpulse-dev, libavformat-dev, libavcodec-dev, libdbus-1-dev, libxkbfile-dev, libcap-dev, llvm-dev, libvulkan-dev, libcap2-bin +Build-Depends: cmake, clang | clang-9, bison, flex, libfuse-dev, libudev-dev, pkg-config, libc6-dev-i386, linux-headers-amd64|linux-headers-generic, gcc-multilib, libcairo2-dev, libgl1-mesa-dev, libtiff5-dev, libfreetype6-dev, libelf-dev, libxml2-dev, libegl1-mesa-dev, libglu1-mesa-dev, libfontconfig1-dev, libbsd-dev, debhelper, ninja-build, libxrandr-dev, libxcursor-dev, libgif-dev, libavcodec-dev, libavformat-dev, libswresample-dev, libavutil-dev, libpulse-dev, libavformat-dev, libavcodec-dev, libdbus-1-dev, libxkbfile-dev, libcap-dev, llvm-dev, libvulkan-dev, libcap2-bin Package: darling Architecture: amd64 diff --git a/rpm/SPECS/darling.spec b/rpm/SPECS/darling.spec index 23c24b29e..5bbe105de 100644 --- a/rpm/SPECS/darling.spec +++ b/rpm/SPECS/darling.spec @@ -32,7 +32,7 @@ BuildRequires: fuse-devel systemd-devel BuildRequires: cairo-devel freetype-devel(x86-64) fontconfig-devel(x86-64) BuildRequires: freetype-devel(x86-32) fontconfig-devel(x86-32) make BuildRequires: libjpeg-turbo-devel(x86-64) libtiff-devel(x86-64) -BuildRequires: libjpeg-turbo-devel(x86-32) libtiff-devel(x86-32) +BuildRequires: libjpeg-turbo-devel(x86-32) BuildRequires: libglvnd-devel mesa-libGL-devel mesa-libEGL-devel BuildRequires: libxml2-devel elfutils-libelf-devel BuildRequires: libbsd-devel