Skip to content

Commit

Permalink
Reenable armhf builds for Ubuntu Bionic/Cosmic
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Mar 26, 2019
1 parent 313f98b commit a0944d9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ case ${cli_release} in
;;
'xenial')
release="ubuntu:xenial"
gcc_version="6"
gcc_version="5"
;;
'bionic')
release="ubuntu:bionic"
Expand Down Expand Up @@ -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"
2 changes: 2 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ packages:
- buster-armhf
- xenial-amd64
- bionic-amd64
- bionic-armhf
- cosmic-amd64
- cosmic-armhf
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
26 changes: 23 additions & 3 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > /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 <<EOF > /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
}

Expand All @@ -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}
Expand Down

0 comments on commit a0944d9

Please sign in to comment.