From a0944d9cb8a8ea89422fab90719dc78e3662c802 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 24 Mar 2019 13:43:40 -0400 Subject: [PATCH] Reenable armhf builds for Ubuntu Bionic/Cosmic --- Dockerfile.in | 2 +- build | 4 ++-- build.yaml | 2 ++ debian/control | 1 + docker-build.sh | 26 +++++++++++++++++++++++--- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Dockerfile.in b/Dockerfile.in index bcc1c7634..912ee62a3 100644 --- a/Dockerfile.in +++ b/Dockerfile.in @@ -11,7 +11,7 @@ ENV DEB_BUILD_OPTIONS=noddebs # Prepare Debian build environment RUN apt-get update \ - && apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv equivs + && yes | apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv equivs # Link to docker-build script RUN ln -sf ${SOURCE_DIR}/docker-build.sh /docker-build.sh diff --git a/build b/build index 3f3290bda..cfd09a87d 100755 --- a/build +++ b/build @@ -28,7 +28,7 @@ case ${cli_release} in ;; 'xenial') release="ubuntu:xenial" - gcc_version="6" + gcc_version="5" ;; 'bionic') release="ubuntu:bionic" @@ -87,5 +87,5 @@ chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null \ || sudo chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null # Move the APKs to the parent directory mkdir ../bin &>/dev/null || true -mv "${package_temporary_dir}"/deb/*.deb ../bin/ +mmv "${package_temporary_dir}/deb/*.deb" "../bin/#1.deb" mmv "${package_temporary_dir}/deb/*_${arch}.*" "../bin/#1-${cli_release}_${arch}.#2" diff --git a/build.yaml b/build.yaml index 391caed1d..d5f9b3754 100644 --- a/build.yaml +++ b/build.yaml @@ -9,4 +9,6 @@ packages: - buster-armhf - xenial-amd64 - bionic-amd64 + - bionic-armhf - cosmic-amd64 + - cosmic-armhf diff --git a/debian/control b/debian/control index 040afe9bf..8ee6e5b78 100644 --- a/debian/control +++ b/debian/control @@ -50,6 +50,7 @@ Build-Depends: # --enable-nvenc/--enable-nvdec # [!armhf] is needed otherwise mk-build-deps creates an invalid build # dep list, targeting armhf specifically when the packge is any. +# The docker build guarantees this is installed for armhf crossbuild. nv-codec-headers [!armhf], # used to detect libraries pkg-config, diff --git a/docker-build.sh b/docker-build.sh index 8fe300be8..7803aec7a 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -9,16 +9,36 @@ set -o xtrace # Prepare the cross-toolchain prepare_crossbuild_env() { + # Prepare the Ubuntu-specific cross-build requirements + if [[ $( lsb_release -i -s ) == "Ubuntu" ]]; then + CODENAME="$( lsb_release -c -s )" + # Remove the default sources.list + rm /etc/apt/sources.list + # Add arch-specific list files + cat < /etc/apt/sources.list.d/amd64.list +deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME} main restricted universe multiverse +deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-updates main restricted universe multiverse +deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-backports main restricted universe multiverse +deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ ${CODENAME}-security main restricted universe multiverse +EOF + cat < /etc/apt/sources.list.d/armhf.list +deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME} main restricted universe multiverse +deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe multiverse +deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-backports main restricted universe multiverse +deb [arch=armhf] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe multiverse +EOF + fi # Add armhf architecture dpkg --add-architecture armhf # Update and install cross-gcc-dev apt-get update - apt-get install -y cross-gcc-dev + yes | apt-get install -y cross-gcc-dev # Generate gcc cross source TARGET_LIST="armhf" cross-gcc-gensource ${GCC_VER} # Install dependencies pushd cross-gcc-packages-amd64/cross-gcc-${GCC_VER}-armhf - apt-get install -y gcc-${GCC_VER}-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libcloog-isl-dev libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf + ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime + yes | apt-get install -y gcc-${GCC_VER}-source libstdc++6-armhf-cross binutils-arm-linux-gnueabihf bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev libgmp-dev systemtap-sdt-dev autogen expect chrpath zlib1g-dev zip libc6-dev:armhf linux-libc-dev:armhf libgcc1:armhf libcurl4-openssl-dev:armhf libfontconfig1-dev:armhf libfreetype6-dev:armhf liblttng-ust0:armhf libstdc++6:armhf popd } @@ -41,7 +61,7 @@ esac # Download and install the nvidia headers from deb-multimedia wget -O nv-codec-headers.deb https://www.deb-multimedia.org/pool/main/n/nv-codec-headers-dmo/nv-codec-headers_${NVCH_VERSION}_all.deb dpkg -i nv-codec-headers.deb -apt -f install +apt -yf install # Move to source directory pushd ${SOURCE_DIR}