diff --git a/docker/Dockerfile_raspbian_10_armhf b/docker/Dockerfile_raspbian_10_armhf index c3a4852984f315a1c714017a6034b364f2787ff1..8072df254c35b2e8b3cc41125588611597d401dd 100644 --- a/docker/Dockerfile_raspbian_10_armhf +++ b/docker/Dockerfile_raspbian_10_armhf @@ -1,5 +1,4 @@ -FROM arm32v7/debian:buster -# debian because no raspbian imgs +FROM debian:buster # FIXME: dirty qemu-static hack required because our Jenkins node runs Docker 17 # Remove next line as soon as we get Docker 18 + @@ -7,14 +6,27 @@ COPY qemu-static/qemu-arm-static /usr/bin/qemu-arm-static ENV DEBIAN_FRONTEND noninteractive -RUN apt-get clean -RUN apt-get update && \ - apt-get install -y vim devscripts +# Add armhf dpkg architecture and add cross-compiling toolchain and +# tools +RUN dpkg --add-architecture armhf + +RUN apt-get clean && \ + apt update && \ + apt install -y \ + devscripts \ + gcc-8-arm-linux-gnueabihf-base \ + gcc-arm-linux-gnueabihf \ + binutils-arm-linux-gnueabihf \ + g++-arm-linux-gnueabihf \ + cpp-arm-linux-gnueabihf \ + binutils-arm-linux-gnueabihf-dbg \ + crossbuild-essential-armhf \ + build-essential && \ + rm -rf /var/lib/apt/lists/* # Speed up mk-build-deps -RUN apt-get clean -RUN apt-get update && \ - apt-get install -y -o Acquire::Retires=10 \ +RUN apt update && \ + apt install -y -o Acquire::Retries=3 \ git \ autoconf \ automake \ @@ -25,9 +37,9 @@ RUN apt-get update && \ libdbus-1-dev \ libdbus-c++-dev \ libargon2-0-dev \ - libcanberra-gtk3-dev \ - libclutter-gtk-1.0-dev \ - libclutter-1.0-dev \ + libcanberra-gtk3-dev:armhf \ + libclutter-gtk-1.0-dev:armhf \ + libclutter-1.0-dev:armhf \ libglib2.0-dev \ libgtk-3-dev \ libnotify-dev \ @@ -66,7 +78,8 @@ RUN apt-get update && \ libcrypto++-dev \ libva-dev \ libvdpau-dev \ - libssl-dev + libssl-dev:armhf && \ + rm -rf /var/lib/apt/lists/* ADD scripts/build-package-debian.sh /opt/build-package-debian.sh diff --git a/packaging/rules/debian-one-click-install/rules b/packaging/rules/debian-one-click-install/rules index 377d568c4992fadf221fad9353a1cd9138df9bd4..32134cb276a748b4a9fb67a9cafbdd6f30dbb303 100755 --- a/packaging/rules/debian-one-click-install/rules +++ b/packaging/rules/debian-one-click-install/rules @@ -17,9 +17,15 @@ RING_ALL_IN_ONE_PKG_NAME="jami-all" # Bundled packages from contrib BUNDLED_PKGS = .ffmpeg -ifeq ($(DISTRIBUTION),raspbian_10_armhf) +ifeq (raspbian_10_armhf,$(findstring raspbian_10_armhf, $(DISTRIBUTION))) # Raspbian's yaml-cpp lib does not work properly BUNDLED_PKGS += .yaml-cpp +# Add host environment variables +CMAKE_OPTIONS=-DCHOST=${HOST_ARCH} \ + -DCMAKE_C_COMPILER=${HOST_ARCH}-gcc \ + -DCMAKE_CXX_COMPILER=${HOST_ARCH}-g++ \ + -DCMAKE_FIND_ROOT_PATH=/usr/${HOST_ARCH} \ + -DPKG_CONFIG_EXECUTABLE=/usr/bin/${HOST_ARCH}-pkg-config endif %: @@ -44,6 +50,7 @@ override_dh_auto_configure: mkdir -p daemon/contrib/native cd daemon/contrib/native && \ ../bootstrap \ + --host=${HOST_ARCH} \ --disable-downloads \ --no-checksums \ --disable-ogg \ @@ -63,7 +70,8 @@ override_dh_auto_configure: ./autogen.sh && \ ./configure \ --prefix=/usr \ - --disable-shared + --disable-shared \ + --host=${HOST_ARCH} ############################# ## libringclient configure ## @@ -75,6 +83,7 @@ override_dh_auto_configure: -DRING_BUILD_DIR=$(CURDIR)/daemon/src \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Debug \ + $(CMAKE_OPTIONS) \ .. ############################ @@ -87,6 +96,7 @@ override_dh_auto_configure: -DCMAKE_INSTALL_PREFIX=/usr \ -DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \ -DGSETTINGS_LOCALCOMPILE=OFF \ + $(CMAKE_OPTIONS) \ .. dh_auto_configure diff --git a/packaging/rules/debian/rules b/packaging/rules/debian/rules index ba6d33a86fccf5d4e25725a62de6ef1948b558d2..eeb1965ec390498293f3d12b10f17657b2e11733 100755 --- a/packaging/rules/debian/rules +++ b/packaging/rules/debian/rules @@ -19,9 +19,15 @@ RING_DAEMON_PKG_NAME="jami-daemon" # Bundled packages from contrib BUNDLED_PKGS = .ffmpeg -ifeq ($(DISTRIBUTION),raspbian_10_armhf) +ifeq (raspbian_10_armhf,$(findstring raspbian_10_armhf, $(DISTRIBUTION))) # Raspbian's yaml-cpp lib does not work properly BUNDLED_PKGS += .yaml-cpp +# Add host environment variables +CMAKE_OPTIONS=-DCHOST=${HOST_ARCH} \ + -DCMAKE_C_COMPILER=${HOST_ARCH}-gcc \ + -DCMAKE_CXX_COMPILER=${HOST_ARCH}-g++ \ + -DCMAKE_FIND_ROOT_PATH=/usr/${HOST_ARCH} \ + -DPKG_CONFIG_EXECUTABLE=/usr/bin/${HOST_ARCH}-pkg-config endif %: @@ -46,6 +52,7 @@ override_dh_auto_configure: mkdir -p daemon/contrib/native cd daemon/contrib/native && \ ../bootstrap \ + --host=${HOST_ARCH} \ --disable-downloads \ --no-checksums \ --disable-ogg \ @@ -65,7 +72,8 @@ override_dh_auto_configure: ./autogen.sh && \ ./configure \ --prefix=/usr \ - --disable-shared + --disable-shared \ + --host=${HOST_ARCH} ############################# ## libringclient configure ## @@ -77,6 +85,7 @@ override_dh_auto_configure: -DRING_BUILD_DIR=$(CURDIR)/daemon/src \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Debug \ + $(CMAKE_OPTIONS) \ .. ############################ @@ -89,6 +98,7 @@ override_dh_auto_configure: -DCMAKE_INSTALL_PREFIX=/usr \ -DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \ -DGSETTINGS_LOCALCOMPILE=OFF \ + $(CMAKE_OPTIONS) \ .. dh_auto_configure diff --git a/scripts/build-package-debian.sh b/scripts/build-package-debian.sh index 43733b4b28d934403735451e190dc400314f9432..85795a47b7b12b6461d78ecd065d1f90597f3b74 100755 --- a/scripts/build-package-debian.sh +++ b/scripts/build-package-debian.sh @@ -41,11 +41,23 @@ else cp -r ${DEBIAN_PACKAGING_OVERRIDE}/* debian/ fi +DPKG_BUILD_OPTIONS="" +MKBUILD_OPTIONS="" +# Set the host architecture as armhf and add some specific architecture +# options to the package builder. +if grep -q "raspbian_10_armhf" <<< "${DISTRIBUTION}"; then + echo "Adding armhf as the host architecture." + export HOST_ARCH=arm-linux-gnueabihf + dpkg --add-architecture armhf + DPKG_BUILD_OPTIONS="${DPKG_BUILD_OPTIONS} -a armhf" + MKBUILD_OPTIONS="${MKBUILD_OPTIONS} --host-arch armhf" +fi + # install build deps apt-get clean apt-get update -apt-get upgrade -o Acquire::Retires=10 -y -mk-build-deps --remove --install debian/control -t "apt-get -y --no-install-recommends" +apt-get upgrade -o Acquire::Retries=10 -y +mk-build-deps ${MKBUILD_OPTIONS} --remove --install debian/control -t "apt-get -y --no-install-recommends" # create changelog file DEBEMAIL="The Jami project <jami@gnu.org>" dch --create --package jami --newversion ${DEBIAN_VERSION} "Automatic nightly release" @@ -74,7 +86,7 @@ cd ring-project cp --verbose -r /opt/ring-project/debian . # create the package -dpkg-buildpackage -uc -us +dpkg-buildpackage -uc -us ${DPKG_BUILD_OPTIONS} # move the artifacts to output cd ..