From 9cadcd7e67c83c0f84879276467111ef16e1c33d Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 8 Apr 2020 15:07:43 +0200 Subject: [PATCH 01/28] Update to Qt 5.14.2 --- Dockerfile | 2 +- distribute.sh | 6 ++---- recipes/qgis/recipe.sh | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e1578d..6a4437a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM opengisch/qt-ndk:5.13.2 +FROM opengisch/qt-ndk:5.14.2 MAINTAINER Matthias Kuhn ARG ARCHES diff --git a/distribute.sh b/distribute.sh index a8bd2d3..9d0238c 100755 --- a/distribute.sh +++ b/distribute.sh @@ -159,7 +159,6 @@ function push_arm() { export TOOLCHAIN_PREFIX=i686-linux-android export TOOLCHAIN_BASEDIR=x86 export QT_ARCH_PREFIX=x86 - export QT_ANDROID=${QT_ANDROID_BASE}/android_x86 export ANDROID_SYSTEM=android elif [ "X${ARCH}" == "Xarmeabi-v7a" ]; then export TOOLCHAIN_FULL_PREFIX=armv7a-linux-androideabi${ANDROIDAPI} @@ -167,7 +166,6 @@ function push_arm() { export TOOLCHAIN_PREFIX=arm-linux-androideabi export TOOLCHAIN_BASEDIR=arm-linux-androideabi export QT_ARCH_PREFIX=armv7 - export QT_ANDROID=${QT_ANDROID_BASE}/android_armv7 export ANDROID_SYSTEM=android elif [ "X${ARCH}" == "Xarm64-v8a" ]; then export TOOLCHAIN_FULL_PREFIX=aarch64-linux-android${ANDROIDAPI} @@ -175,7 +173,6 @@ function push_arm() { export TOOLCHAIN_PREFIX=aarch64-linux-android export TOOLCHAIN_BASEDIR=aarch64-linux-android export QT_ARCH_PREFIX=arm64 # watch out when changing this, openssl depends on it - export QT_ANDROID=${QT_ANDROID_BASE}/android_arm64_v8a export ANDROID_SYSTEM=android64 elif [ "X${ARCH}" == "Xx86_64" ]; then export TOOLCHAIN_FULL_PREFIX=x86_64-linux-android${ANDROIDAPI} @@ -183,13 +180,14 @@ function push_arm() { export TOOLCHAIN_PREFIX=x86_64-linux-android export TOOLCHAIN_BASEDIR=x86_64-linux-android export QT_ARCH_PREFIX=x86_64 # watch out when changing this, openssl depends on it - export QT_ANDROID=${QT_ANDROID_BASE}/android_x86_64 export ANDROID_SYSTEM=android64 else echo "Error: Please report issue to enable support for arch (${ARCH})." exit 1 fi + export QT_ANDROID=${QT_ANDROID_BASE}/android + export CFLAGS="-DANDROID $OFLAG -fomit-frame-pointer --sysroot $NDKPLATFORM -I$STAGE_PATH/include" export CFLAGS="$CFLAGS -L$ANDROIDNDK/sources/cxx-stl/llvm-libc++/libs/$ARCH -isystem $ANDROIDNDK/sources/cxx-stl/llvm-libc++/include" export CFLAGS="$CFLAGS -isystem $ANDROIDNDK/sysroot/usr/include -isystem $ANDROIDNDK/sysroot/usr/include/$TOOLCHAIN_SHORT_PREFIX" diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index da5c43d..e6b34b6 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -65,6 +65,8 @@ function build_qgis() { -DGSL_INCLUDE_DIR=$STAGE_PATH/include/gsl \ -DICONV_INCLUDE_DIR=$STAGE_PATH/include \ -DICONV_LIBRARY=$STAGE_PATH/lib/libiconv.so \ + -DQCA_LIBRARY=$STAGE_PATH/lib/libqca-qt5_$ARCH.so \ + -DQTKEYCHAIN_LIBRARY=$STAGE_PATH/lib/libqt5keychain_$ARCH.so \ -DSQLITE3_INCLUDE_DIR=$STAGE_PATH/include \ -DSQLITE3_LIBRARY=$STAGE_PATH/lib/libsqlite3.so \ -DPOSTGRES_CONFIG= \ From 848fa380c9749508382fe21582d4bbd848f8247b Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 10 Apr 2020 07:12:33 +0200 Subject: [PATCH 02/28] Move qt ndk build into this repo --- .circleci/config.yml | 7 +- .docker/assemble/Dockerfile | 2 +- .docker/qt-ndk/Dockerfile | 106 +++++++++++++ .docker/qt-ndk/install-qt.sh | 292 +++++++++++++++++++++++++++++++++++ Dockerfile | 9 +- 5 files changed, 406 insertions(+), 10 deletions(-) create mode 100644 .docker/qt-ndk/Dockerfile create mode 100755 .docker/qt-ndk/install-qt.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 60f63df..df81668 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,8 @@ - run: name: Build Docker image command: | + docker build -t qt-ndk .docker/qt-ndk + case $CIRCLE_NODE_INDEX in 0) export ARCH='armeabi-v7a' @@ -47,6 +49,10 @@ at: /tmp/workspace - checkout - setup_remote_docker + - run: + name: Recreate qt base image + command: | + docker build -t qt-ndk .docker/qt-ndk - run: name: Recreate docker image command: | @@ -68,7 +74,6 @@ name: Publish SDK to Github Releases command: | rm /tmp/workspace/Dockerfile - echo "Built with https://github.com/opengisch/docker-qt-ndk/releases/tag/"$(awk -F ":" '/FROM/{print $2}' Dockerfile) >> /tmp/workspace/qt-ndk.txt tar -zcf /tmp/osgeo4a.tar.gz -C /tmp/workspace osgeo4a ./scripts/upload_release_asset.py /tmp/osgeo4a.tar.gz $CIRCLE_TAG workflows: diff --git a/.docker/assemble/Dockerfile b/.docker/assemble/Dockerfile index 10adde5..f77c0db 100644 --- a/.docker/assemble/Dockerfile +++ b/.docker/assemble/Dockerfile @@ -1,4 +1,4 @@ -FROM opengisch/qt-ndk:5.13.1-1 +FROM qt-ndk MAINTAINER Matthias Kuhn ENV DEBIAN_FRONTEND noninteractive diff --git a/.docker/qt-ndk/Dockerfile b/.docker/qt-ndk/Dockerfile new file mode 100644 index 0000000..d5c6955 --- /dev/null +++ b/.docker/qt-ndk/Dockerfile @@ -0,0 +1,106 @@ +FROM ubuntu:20.04 +MAINTAINER Matthias Kuhn +ARG QT_VERSION=5.14.2 +ARG NDK_VERSION=r21 +ARG SDK_PLATFORM=android-21 +ARG SDK_BUILD_TOOLS=28.0.3 +ARG SDK_PACKAGES="tools platform-tools" + +ENV DEBIAN_FRONTEND noninteractive +ENV QT_PATH /opt/Qt +ENV QT_ANDROID_BASE ${QT_PATH}/${QT_VERSION} +ENV ANDROID_HOME /opt/android-sdk +ENV ANDROID_SDK_ROOT ${ANDROID_HOME} +ENV ANDROID_NDK_ROOT /opt/android-ndk +ENV ANDROID_NDK_HOST linux-x86_64 +ENV ANDROID_NDK_PLATFORM android-21 +ENV QMAKESPEC android-clang +ENV PATH ${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH} + +# Install updates & requirements: +# * git, openssh-client, ca-certificates - clone & build +# * locales, sudo - useful to set utf-8 locale & sudo usage +# * curl - to download Qt bundle +# * make, default-jdk, ant - basic build requirements +# * libsm6, libice6, libxext6, libxrender1, libfontconfig1, libdbus-1-3 - dependencies of Qt bundle run-file +# * libc6:i386, libncurses5:i386, libstdc++6:i386, libz1:i386 - dependencides of android sdk binaries +RUN dpkg --add-architecture i386 && apt-get -qq update && apt-get -qq dist-upgrade && apt-get install -qq -y --no-install-recommends \ + git \ + openssh-client \ + ca-certificates \ + locales \ + sudo \ + curl \ + make \ + openjdk-8-jdk \ + ant \ + libarchive-tools \ + p7zip-full \ + libsm6 \ + libice6 \ + libxext6 \ + libxrender1 \ + libfontconfig1 \ + libdbus-1-3 \ + xz-utils \ + libc6:i386 \ + libncurses5:i386 \ + libstdc++6:i386 \ + libz1:i386 \ + libxkbcommon-x11-0 \ + && apt-get -qq clean + +RUN apt-get install -qq -y --no-install-recommends \ + bzip2 \ + unzip \ + gcc \ + g++ \ + cmake \ + patch \ + python3 \ + rsync \ + flex \ + bison \ + file \ + python3-six \ + zip \ + pkg-config \ + protobuf-compiler + +COPY install-qt.sh /tmp/qt/ + +RUN /tmp/qt/install-qt.sh --version ${QT_VERSION} --target android --directory "${QT_PATH}" --toolchain any \ + qtbase \ + qtsensors \ + qtquickcontrols2 \ + qtquickcontrols \ + qtmultimedia \ + qtlocation \ + qtimageformats \ + qtgraphicaleffects \ + qtdeclarative \ + qtandroidextras \ + qttools \ + qtimageformats \ + qtsvg + +# Download & unpack android SDK +# ENV JAVA_OPTS="-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee" +RUN apt-get remove -qq -y openjdk-11-jre-headless +RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip' \ + && mkdir -p ${ANDROID_HOME} \ + && unzip /tmp/sdk-tools.zip -d ${ANDROID_HOME} \ + && rm -f /tmp/sdk-tools.zip \ + && yes | sdkmanager --licenses && sdkmanager --verbose "platforms;${SDK_PLATFORM}" "build-tools;${SDK_BUILD_TOOLS}" ${SDK_PACKAGES} + +# Download & unpack android NDK & remove any platform which is not used +RUN mkdir /tmp/android \ + && curl -Lo /tmp/android/ndk.zip "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip" \ + && unzip /tmp/android/ndk.zip -d /tmp \ + && mv /tmp/android-ndk-${NDK_VERSION} ${ANDROID_NDK_ROOT} \ + && cd / \ + && rm -rf /tmp/android \ + && find ${ANDROID_NDK_ROOT}/platforms/* -maxdepth 0 ! -name "$ANDROID_NDK_PLATFORM" -type d -exec rm -r {} + + +# Reconfigure locale +RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales diff --git a/.docker/qt-ndk/install-qt.sh b/.docker/qt-ndk/install-qt.sh new file mode 100755 index 0000000..9a7b35b --- /dev/null +++ b/.docker/qt-ndk/install-qt.sh @@ -0,0 +1,292 @@ +#!/usr/bin/env bash +############################################################################# +## +## Copyright (C) 2019 Richard Weickelt. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of Qbs. +## +## $QT_BEGIN_LICENSE:LGPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU Lesser General Public License Usage +## Alternatively, this file may be used under the terms of the GNU Lesser +## General Public License version 3 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL3 included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 3 requirements +## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 2.0 or (at your option) the GNU General +## Public license version 3 or any later version approved by the KDE Free +## Qt Foundation. The licenses are as published by the Free Software +## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-2.0.html and +## https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# +set -eu + +function help() { + cat < + Root directory where to install the components. + Maps to C:/Qt on Windows, /opt/Qt on Linux, /usr/local/Qt on Mac + by default. + + --host + The host operating system. Can be one of linux_x64, mac_x64, + windows_x86. Auto-detected by default. + + --target + The desired target platform. Can be one of desktop, android, ios. + The default value is desktop. + + --toolchain + The toolchain that has been used to build the binaries. + Possible values depend on --host and --target, respectively: + + linux_x64 + android + any, android_armv7, android_arm64_v8a + desktop + gcc_64 (default) + + mac_x64 + android + any, android_armv7, android_arm64_v8a + desktop + clang_64 (default), + ios + ios + + windows_x86 + android + any, android_armv7, android_arm64_v8a + desktop + win64_mingw73, win64_msvc2017_64 (default) + + --version + The desired Qt version. Currently supported are all versions + above 5.9.0. + +EOF +} + +TARGET_PLATFORM=desktop +COMPONENTS= +VERSION= + +case "$OSTYPE" in + *linux*) + HOST_OS=linux_x64 + INSTALL_DIR=/opt/Qt + TOOLCHAIN=gcc_64 + ;; + *darwin*) + HOST_OS=mac_x64 + INSTALL_DIR=/usr/local/Qt + TOOLCHAIN=clang_64 + ;; + msys) + HOST_OS=windows_x86 + INSTALL_DIR=/c/Qt + TOOLCHAIN=win64_msvc2015_64 + ;; + *) + HOST_OS= + INSTALL_DIR= + ;; +esac + +while [ $# -gt 0 ]; do + case "$1" in + --directory|-d) + INSTALL_DIR="$2" + shift + ;; + --host) + HOST_OS="$2" + shift + ;; + --target) + TARGET_PLATFORM="$2" + shift + ;; + --toolchain) + TOOLCHAIN=$(echo $2 | tr '[A-Z]' '[a-z]') + shift + ;; + --version) + VERSION="$2" + shift + ;; + --help|-h) + help + exit 0 + ;; + *) + COMPONENTS="${COMPONENTS} $1" + ;; + esac + shift +done + +if [ -z "${HOST_OS}" ]; then + echo "No --host specified or auto-detection failed." >&2 + exit 1 +fi + +if [ -z "${INSTALL_DIR}" ]; then + echo "No --directory specified or auto-detection failed." >&2 + exit 1 +fi + +if [ -z "${VERSION}" ]; then + echo "No --version specified." >&2 + exit 1 +fi + +if [ -z "${COMPONENTS}" ]; then + echo "No components specified." >&2 + exit 1 +fi + +case "$TARGET_PLATFORM" in + android) + ;; + ios) + ;; + desktop) + ;; + *) + echo "Error: TARGET_PLATFORM=${TARGET_PLATFORM} is not valid." >&2 + exit 1 + ;; +esac + +DOWNLOAD_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'install-qt'` + +# +# The repository structure is a mess. Try different URL variants +# +function compute_url(){ + local COMPONENT=$1 + local CURL="curl -s -L" + local BASE_URL="http://download.qt.io/online/qtsdkrepository/${HOST_OS}/${TARGET_PLATFORM}" + + if [[ "${COMPONENT}" =~ "qtcreator" ]]; then + + REMOTE_BASE="tools_qtcreator/qt.tools.qtcreator" + REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "${VERSION}[0-9\-]*${COMPONENT}\.7z" | tail -1)" + + if [ ! -z "${REMOTE_PATH}" ]; then + echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}" + return 0 + fi + + else + REMOTE_BASES=( + # New repository format (>=5.9.6) + "qt5_${VERSION//./}/qt.qt5.${VERSION//./}.${TOOLCHAIN}" + "qt5_${VERSION//./}/qt.qt5.${VERSION//./}.${COMPONENT}.${TOOLCHAIN}" + # Multi-abi Android since 5.14 + "qt5_${VERSION//./}/qt.qt5.${VERSION//./}.${TARGET_PLATFORM}" + "qt5_${VERSION//./}/qt.qt5.${VERSION//./}.${COMPONENT}.${TARGET_PLATFORM}" + # Older repository format (<5.9.0) + "qt5_${VERSION//./}/qt.${VERSION//./}.${TOOLCHAIN}" + "qt5_${VERSION//./}/qt.${VERSION//./}.${COMPONENT}.${TOOLCHAIN}" + ) + + for REMOTE_BASE in ${REMOTE_BASES[*]}; do + REMOTE_PATH="$(${CURL} ${BASE_URL}/${REMOTE_BASE}/ | grep -o -E "[[:alnum:]_.\-]*7z" | grep "${COMPONENT}" | tail -1)" + if [ ! -z "${REMOTE_PATH}" ]; then + echo "${BASE_URL}/${REMOTE_BASE}/${REMOTE_PATH}" + return 0 + fi + done + fi + + echo "Could not determine a remote URL for ${COMPONENT} with version ${VERSION}">&2 + exit 1 +} + +mkdir -p ${INSTALL_DIR} + +for COMPONENT in ${COMPONENTS}; do + + URL="$(compute_url ${COMPONENT})" + echo "Downloading ${COMPONENT}..." >&2 + curl --progress-bar -L -o ${DOWNLOAD_DIR}/package.7z ${URL} >&2 + 7z x -y -o${INSTALL_DIR} ${DOWNLOAD_DIR}/package.7z 2>&1 + rm -f ${DOWNLOAD_DIR}/package.7z + + # + # conf file is needed for qmake + # + if [ "${COMPONENT}" == "qtbase" ]; then + if [[ "${TOOLCHAIN}" =~ "win64_mingw" ]]; then + SUBDIR="${TOOLCHAIN/win64_/}_64" + elif [[ "${TOOLCHAIN}" =~ "win32_mingw" ]]; then + SUBDIR="${TOOLCHAIN/win32_/}_32" + elif [[ "${TOOLCHAIN}" =~ "win64_msvc" ]]; then + SUBDIR="${TOOLCHAIN/win64_/}" + elif [[ "${TOOLCHAIN}" =~ "win32_msvc" ]]; then + SUBDIR="${TOOLCHAIN/win32_/}" + elif [[ "${TOOLCHAIN}" =~ "any" ]] && [[ "${TARGET_PLATFORM}" == "android" ]]; then + SUBDIR="android" + else + SUBDIR="${TOOLCHAIN}" + fi + + CONF_FILE="${INSTALL_DIR}/${VERSION}/${SUBDIR}/bin/qt.conf" + echo "[Paths]" > ${CONF_FILE} + echo "Prefix = .." >> ${CONF_FILE} + + # Adjust the license to be able to run qmake + # sed with -i requires intermediate file on Mac OS + PRI_FILE="${INSTALL_DIR}/${VERSION}/${SUBDIR}/mkspecs/qconfig.pri" + sed -i.bak 's/Enterprise/OpenSource/g' "${PRI_FILE}" + sed -i.bak 's/licheck.*//g' "${PRI_FILE}" + rm "${PRI_FILE}.bak" + echo "Done 1" + + # Print the directory so that the caller can + # adjust the PATH variable. + echo $(dirname "${CONF_FILE}") + elif [[ "${COMPONENT}" =~ "qtcreator" ]]; then + echo "${INSTALL_DIR}/Tools/QtCreator/bin" + fi + +done +echo "Done" diff --git a/Dockerfile b/Dockerfile index 6a4437a..f85233c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,6 @@ -FROM opengisch/qt-ndk:5.14.2 +FROM qt-ndk MAINTAINER Matthias Kuhn - ARG ARCHES -ENV DEBIAN_FRONTEND noninteractive - -USER root - -# For ndk-build (libzip) to work properly we need `file` installed -RUN apt update && apt install -y file python3-six zip pkg-config protobuf-compiler COPY .docker /usr/src/.docker COPY tools /usr/src/tools From 1ad93f5cbf79f1cd88abed748842f490cca9cc3d Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 1 May 2020 18:46:56 +0200 Subject: [PATCH 03/28] Make QT_VERSION configurable --- .circleci/config.yml | 4 ++-- .docker/qt-ndk/Dockerfile | 2 +- qt_version.txt | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 qt_version.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index df81668..1aa3710 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ - run: name: Build Docker image command: | - docker build -t qt-ndk .docker/qt-ndk + docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk case $CIRCLE_NODE_INDEX in 0) @@ -52,7 +52,7 @@ - run: name: Recreate qt base image command: | - docker build -t qt-ndk .docker/qt-ndk + docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk - run: name: Recreate docker image command: | diff --git a/.docker/qt-ndk/Dockerfile b/.docker/qt-ndk/Dockerfile index d5c6955..0674814 100644 --- a/.docker/qt-ndk/Dockerfile +++ b/.docker/qt-ndk/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 MAINTAINER Matthias Kuhn -ARG QT_VERSION=5.14.2 +ARG QT_VERSION ARG NDK_VERSION=r21 ARG SDK_PLATFORM=android-21 ARG SDK_BUILD_TOOLS=28.0.3 diff --git a/qt_version.txt b/qt_version.txt new file mode 100644 index 0000000..222951c --- /dev/null +++ b/qt_version.txt @@ -0,0 +1 @@ +5.14.2 From 90fd86da6763438fe1199ea7304b2bbf83673b14 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 25 May 2020 13:29:40 +0200 Subject: [PATCH 04/28] Create github workflow --- .github/workflows/docker.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..b45d128 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,32 @@ +name: Build OSGeo4A + +on: [push, pull_request, release] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: Extract tag + id: extract_tag + run: echo ::set-output name=ref::${GITHUB_REF/refs\/tags\//} + - name: Build + run: | + export ARCHES=(armeabi-v7a arm64-v8a x86 x86_64) + docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk + docker build --build-arg ARCHES=${ARCHES} -t opengisch/qfield-sdk:latest . + - name: Deploy + run: | + if: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + env: + DOCKERHUB_USERNAME: ${{ secrets.DockerhubUsername }} + DOCKERHUB_TOKEN: ${{ secrets.DockerhubToken }} + run: | + echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + docker push opengisch/qfield-sdk:latest + docker tag opengisch/qfield-sdk:latest opengisch/qfield-sdk:${{ steps.extract_tag.outputs.ref }} + docker push opengisch/qfield-sdk:${{ steps.extract_tag.outputs.ref }} + # TODO: fix uploading to github releases + #tar -zcf /tmp/osgeo4a.tar.gz -C /tmp/workspace osgeo4a + #./scripts/upload_release_asset.py /tmp/osgeo4a.tar.gz ${{ steps.extract_tag.outputs.ref }} From b4ff18061e51a813bcfbf6ac9a9d4e82140c808c Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 25 May 2020 15:16:02 +0200 Subject: [PATCH 05/28] Specify arches as array --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b45d128..49a9c10 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,10 +15,10 @@ jobs: run: | export ARCHES=(armeabi-v7a arm64-v8a x86 x86_64) docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk - docker build --build-arg ARCHES=${ARCHES} -t opengisch/qfield-sdk:latest . + docker build --build-arg ARCHES="${ARCHES}" -t opengisch/qfield-sdk:latest . - name: Deploy run: | - if: if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: DOCKERHUB_USERNAME: ${{ secrets.DockerhubUsername }} DOCKERHUB_TOKEN: ${{ secrets.DockerhubToken }} From 2befa305a50477621e325bf393182b9c6453cc0e Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 26 May 2020 15:34:45 +0200 Subject: [PATCH 06/28] Fix deploy step --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 49a9c10..9602103 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,8 +17,8 @@ jobs: docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk docker build --build-arg ARCHES="${ARCHES}" -t opengisch/qfield-sdk:latest . - name: Deploy + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} run: | - if: ${{ github.event_name == 'release' && github.event.action == 'created' }} env: DOCKERHUB_USERNAME: ${{ secrets.DockerhubUsername }} DOCKERHUB_TOKEN: ${{ secrets.DockerhubToken }} From 2b889c2db32af9a1b04fc85e495f0b31bf7d7a95 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 26 May 2020 15:35:13 +0200 Subject: [PATCH 07/28] Quote variable --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f85233c..b721b4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ COPY distribute.sh /usr/src/distribute.sh COPY scripts/build_arches.sh /usr/src/build_arches.sh RUN mv /usr/src/.docker/config.conf /usr/src/config.conf ENV ROOT_OUT_PATH=/usr/src/build -RUN ARCHES=$ARCHES /usr/src/build_arches.sh +RUN ARCHES="${ARCHES}" /usr/src/build_arches.sh From 8e074f2dc6f591190374b901fdf6459468b1e6ec Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 26 May 2020 18:27:53 +0200 Subject: [PATCH 08/28] Space separated array --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9602103..975de09 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,7 +13,7 @@ jobs: run: echo ::set-output name=ref::${GITHUB_REF/refs\/tags\//} - name: Build run: | - export ARCHES=(armeabi-v7a arm64-v8a x86 x86_64) + export ARCHES="armeabi-v7a arm64-v8a x86 x86_64" docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk docker build --build-arg ARCHES="${ARCHES}" -t opengisch/qfield-sdk:latest . - name: Deploy From 17f6545332888be08bfb43924e0d8f9a343b43eb Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 26 May 2020 22:17:06 +0200 Subject: [PATCH 09/28] Parallelize --- .github/workflows/docker.yml | 49 ++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 975de09..5e4bb32 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,6 +5,9 @@ on: [push, pull_request, release] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + arch: [armeabi-v7a, arm64-v8a, x86, x86_64] steps: - name: Checkout uses: actions/checkout@master @@ -12,10 +15,52 @@ jobs: id: extract_tag run: echo ::set-output name=ref::${GITHUB_REF/refs\/tags\//} - name: Build + env: + ARCH: ${{ matrix.arch }} run: | - export ARCHES="armeabi-v7a arm64-v8a x86 x86_64" docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk - docker build --build-arg ARCHES="${ARCHES}" -t opengisch/qfield-sdk:latest . + docker build --build-arg ARCHES="${ARCH}" -t opengisch/qfield-sdk:latest . + - name: Create target specific SDK + run: | + mkdir /tmp/osgeo4a + docker run --rm --entrypoint tar opengisch/qfield-sdk:latest cC /home/osgeo4a . | tar xvC /tmp/osgeo4a + - uses: actions/upload-artifact@master + with: + name: sdk-${{ matrix.arch }} + path: /tmp/osgeo4a + + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - uses: actions/download-artifact@master + with: + name: sdk-armeabi-v7a + path: /tmp/workspace/osgeo4a + - uses: actions/download-artifact@master + with: + name: sdk-arm64-v8a + path: /tmp/workspace/osgeo4a + - uses: actions/download-artifact@master + with: + name: sdk-x86 + path: /tmp/workspace/osgeo4a + - uses: actions/download-artifact@master + with: + name: sdk-x86_64 + path: /tmp/workspace/osgeo4a + + - name: Recreate qt base image + run: | + docker build --build-arg QT_VERSION=$(cat qt_version.txt) -t qt-ndk .docker/qt-ndk + - name: Recreate docker image + run: | + cp .docker/assemble/Dockerfile /tmp/workspace + docker build -t opengisch/qfield-sdk:latest /tmp/workspace + - name: Deploy if: ${{ github.event_name == 'release' && github.event.action == 'created' }} run: | From bb5ebb93df494782657762178c865e72e8c4b7c4 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 27 May 2020 00:18:23 +0200 Subject: [PATCH 10/28] Does it zip? --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5e4bb32..8c0a116 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,11 +23,11 @@ jobs: - name: Create target specific SDK run: | mkdir /tmp/osgeo4a - docker run --rm --entrypoint tar opengisch/qfield-sdk:latest cC /home/osgeo4a . | tar xvC /tmp/osgeo4a + docker run --rm --entrypoint tar opengisch/qfield-sdk:latest czC /home/osgeo4a . > /tmp/osgeo4a-${{ matrix.arch }}.tar.gz - uses: actions/upload-artifact@master with: name: sdk-${{ matrix.arch }} - path: /tmp/osgeo4a + path: /tmp/osgeo4a-${{ matrix.arch }}.tar.gz deploy: needs: build From 52980b51a8451eb0432c96991fbcd0779b9fdd99 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sat, 6 Jun 2020 21:11:40 +0200 Subject: [PATCH 11/28] Reassemble package --- .docker/assemble/Dockerfile | 5 ++++- .github/workflows/docker.yml | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.docker/assemble/Dockerfile b/.docker/assemble/Dockerfile index f77c0db..840d4d9 100644 --- a/.docker/assemble/Dockerfile +++ b/.docker/assemble/Dockerfile @@ -6,4 +6,7 @@ ENV DEBIAN_FRONTEND noninteractive USER root RUN apt update && apt install -y file zip -COPY osgeo4a /home/osgeo4a +ADD osgeo4a-armeabi-v7a.tar.gz /home/osgeo4a +ADD osgeo4a-arm64-v8a.tar.gz /home/osgeo4a +ADD osgeo4a-x86.tar.gz /home/osgeo4a +ADD osgeo4a-x86_64.tar.gz /home/osgeo4a diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8c0a116..b13e3b4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -39,19 +39,19 @@ jobs: - uses: actions/download-artifact@master with: name: sdk-armeabi-v7a - path: /tmp/workspace/osgeo4a + path: /tmp/workspace - uses: actions/download-artifact@master with: name: sdk-arm64-v8a - path: /tmp/workspace/osgeo4a + path: /tmp/workspace - uses: actions/download-artifact@master with: name: sdk-x86 - path: /tmp/workspace/osgeo4a + path: /tmp/workspace - uses: actions/download-artifact@master with: name: sdk-x86_64 - path: /tmp/workspace/osgeo4a + path: /tmp/workspace - name: Recreate qt base image run: | From ddf563f34cd066192872e79d21112b95753455d7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 17:24:37 +0200 Subject: [PATCH 12/28] Bump geos version --- recipes/geos/recipe.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/geos/recipe.sh b/recipes/geos/recipe.sh index 34442fc..64f47d0 100644 --- a/recipes/geos/recipe.sh +++ b/recipes/geos/recipe.sh @@ -1,7 +1,7 @@ #!/bin/bash # version of your package -VERSION_geos=3.7.3 +VERSION_geos=3.8.1 # dependencies of this recipe DEPS_geos=() @@ -10,7 +10,7 @@ DEPS_geos=() URL_geos=https://github.com/libgeos/geos/archive/${VERSION_geos}.tar.gz # md5 of the package -MD5_geos=f9d167151f37ff120271c8ca6af6f877 +MD5_geos=22d1bc7d276fecc7e1b5f55c47632d6a # default build path BUILD_geos=$BUILD_PATH/geos/$(get_directory $URL_geos) @@ -30,7 +30,6 @@ function prebuild_geos() { try cp $ROOT_OUT_PATH/.packages/config.sub $BUILD_geos try cp $ROOT_OUT_PATH/.packages/config.guess $BUILD_geos - try patch -p1 < $RECIPE_geos/patches/geos.patch touch .patched } @@ -50,6 +49,7 @@ function build_geos() { # -DANDROID_STL=gnustl_shared \ try $CMAKECMD \ -DCMAKE_INSTALL_PREFIX:PATH=$STAGE_PATH \ + -DDISABLE_GEOS_INLINE=ON \ $BUILD_geos echo '#define GEOS_SVN_REVISION 0' > $BUILD_PATH/geos/build-$ARCH/geos_svn_revision.h try $MAKESMP From fcb2c51bc8946225cf20346b3a2e066d3d95f6b7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 19:00:32 +0200 Subject: [PATCH 13/28] Deploy docker image and sdk files --- .github/workflows/docker.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b13e3b4..044a5c1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,9 +11,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@master - - name: Extract tag - id: extract_tag - run: echo ::set-output name=ref::${GITHUB_REF/refs\/tags\//} + - name: Extract branch or tag name + id: extract_ref + run: echo ::set-output name=ref::${${GITHUB_REF#refs/tags/}#refs/heads/} - name: Build env: ARCH: ${{ matrix.arch }} @@ -61,8 +61,7 @@ jobs: cp .docker/assemble/Dockerfile /tmp/workspace docker build -t opengisch/qfield-sdk:latest /tmp/workspace - - name: Deploy - if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + - name: Deploy to dockerhub run: | env: DOCKERHUB_USERNAME: ${{ secrets.DockerhubUsername }} @@ -70,8 +69,23 @@ jobs: run: | echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin docker push opengisch/qfield-sdk:latest - docker tag opengisch/qfield-sdk:latest opengisch/qfield-sdk:${{ steps.extract_tag.outputs.ref }} - docker push opengisch/qfield-sdk:${{ steps.extract_tag.outputs.ref }} + docker tag opengisch/qfield-sdk:latest opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} + docker push opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} + + - name: Create release sdk package + run: | + docker run --rm --entrypoint tar opengisch/qfield-sdk:latest cC /opt/ . | tar xvC /tmp/workspace + tar -zcvf qfield-sdk.tar.gz /tmp/workspace + + - name: Deploy to github release + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: qfield-sdk.tar.gz # TODO: fix uploading to github releases #tar -zcf /tmp/osgeo4a.tar.gz -C /tmp/workspace osgeo4a #./scripts/upload_release_asset.py /tmp/osgeo4a.tar.gz ${{ steps.extract_tag.outputs.ref }} From 6c3a1f75327d21999d8f2728bfaf70f081e8c99c Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 19:20:39 +0200 Subject: [PATCH 14/28] refactor tagorbranch pattern --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 044a5c1..e8e7114 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@master - name: Extract branch or tag name id: extract_ref - run: echo ::set-output name=ref::${${GITHUB_REF#refs/tags/}#refs/heads/} + run: echo ::set-output name=ref::${GITHUB_REF#refs/*/} - name: Build env: ARCH: ${{ matrix.arch }} From e4560f175233bf002c9f10c0253f707fcd7ad821 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 20:45:15 +0200 Subject: [PATCH 15/28] Fix dockerhub credential variable names --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e8e7114..63e15ab 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -64,8 +64,8 @@ jobs: - name: Deploy to dockerhub run: | env: - DOCKERHUB_USERNAME: ${{ secrets.DockerhubUsername }} - DOCKERHUB_TOKEN: ${{ secrets.DockerhubToken }} + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} run: | echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin docker push opengisch/qfield-sdk:latest From 0c3722b8d40078e14fc7612c543d67630108c883 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 22:16:20 +0200 Subject: [PATCH 16/28] Fix indentation --- .github/workflows/docker.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 63e15ab..fbac95c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -62,15 +62,14 @@ jobs: docker build -t opengisch/qfield-sdk:latest /tmp/workspace - name: Deploy to dockerhub + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} run: | - env: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - run: | - echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - docker push opengisch/qfield-sdk:latest - docker tag opengisch/qfield-sdk:latest opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} - docker push opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} + echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + docker push opengisch/qfield-sdk:latest + docker tag opengisch/qfield-sdk:latest opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} + docker push opengisch/qfield-sdk:${{ steps.extract_ref.outputs.ref }} - name: Create release sdk package run: | From 3825d3fd3d1a3ea1473956f77f8ab8cf48a2965e Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Jun 2020 23:58:15 +0200 Subject: [PATCH 17/28] Put ref where it's needed --- .github/workflows/docker.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fbac95c..1442a17 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,9 +11,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@master - - name: Extract branch or tag name - id: extract_ref - run: echo ::set-output name=ref::${GITHUB_REF#refs/*/} - name: Build env: ARCH: ${{ matrix.arch }} @@ -36,6 +33,10 @@ jobs: - name: Checkout uses: actions/checkout@master + - name: Extract branch or tag name + id: extract_ref + run: echo ::set-output name=ref::${GITHUB_REF#refs/*/} + - uses: actions/download-artifact@master with: name: sdk-armeabi-v7a From a38d931f97d5e2bcfa287c3516bca08745c971b6 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jun 2020 11:33:36 +0200 Subject: [PATCH 18/28] Bump libspatialindex to 1.9.3 --- recipes/libspatialindex/recipe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libspatialindex/recipe.sh b/recipes/libspatialindex/recipe.sh index 034db8b..c72c4a6 100644 --- a/recipes/libspatialindex/recipe.sh +++ b/recipes/libspatialindex/recipe.sh @@ -1,7 +1,7 @@ #!/bin/bash # version of your package -VERSION_libspatialindex=1.9.0 +VERSION_libspatialindex=1.9.3 # dependencies of this recipe DEPS_libspatialindex=() @@ -10,7 +10,7 @@ DEPS_libspatialindex=() URL_libspatialindex=https://github.com/libspatialindex/libspatialindex/archive/${VERSION_libspatialindex}.tar.gz # md5 of the package -MD5_libspatialindex=aa658bf627cd57b5277d204bac0605fc +MD5_libspatialindex=b0cad679ee475cce370d8731d47b174a # default build path BUILD_libspatialindex=$BUILD_PATH/libspatialindex/$(get_directory $URL_libspatialindex) From 4eed3daff054a08a3491a7b4947f63bb5a99a703 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jun 2020 11:45:59 +0200 Subject: [PATCH 19/28] Bump QGIS version --- recipes/qgis/recipe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index e6b34b6..c94d9cb 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -8,10 +8,10 @@ DEPS_qgis=(zlib gdal qca libspatialite libspatialindex expat gsl postgresql libz # DEPS_qgis=() # url of the package -URL_qgis=https://github.com/qgis/QGIS/archive/410ec85eb73cee873832668651e155faf4b3058b.tar.gz +URL_qgis=https://github.com/qgis/QGIS/archive/59ce5c8d653e8de0f2c4e92863d248ea23510b44.tar.gz # md5 of the package -MD5_qgis=3fb5baaf027ff398906d74ec2f6aba15 +MD5_qgis=10145d87cf49505c58295f76ce94c5c8 # default build path BUILD_qgis=$BUILD_PATH/qgis/$(get_directory $URL_qgis) From 0977a25db7c096c3df7492dcb9d2ce315015c063 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jun 2020 12:51:26 +0200 Subject: [PATCH 20/28] Disable QGIS_PROCESS --- recipes/qgis/recipe.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index c94d9cb..6d70441 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -93,6 +93,7 @@ function build_qgis() { -DWITH_ASTYLE=OFF \ -DWITH_QUICK=ON \ -DWITH_QT5SERIALPORT=OFF \ + -DWITH_QGIS_PROCESS=OFF \ -DProtobuf_PROTOC_EXECUTABLE=/usr/bin/protoc \ -DNATIVE_CRSSYNC_BIN=/usr/bin/true \ -DANDROID_LINKER_FLAGS="$ANDROID_CMAKE_LINKER_FLAGS -landroid -llog" \ From 6a4e7a78f479a0e9bbcefe7c827a45f426c2c24a Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jun 2020 15:26:01 +0200 Subject: [PATCH 21/28] Upload assets --- .github/workflows/docker.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1442a17..0f18d3b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -74,10 +74,21 @@ jobs: - name: Create release sdk package run: | - docker run --rm --entrypoint tar opengisch/qfield-sdk:latest cC /opt/ . | tar xvC /tmp/workspace - tar -zcvf qfield-sdk.tar.gz /tmp/workspace + rm -rf /tmp/workspace + docker run --rm --entrypoint tar opengisch/qfield-sdk:latest czC /opt/ . > buildchain.tar.gz + docker run --rm --entrypoint tar opengisch/qfield-sdk:latest czC /home/ . > qfield-sdk.tar.gz - - name: Deploy to github release + - name: Deploy buildchain to github release + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: buildchain.tar.gz + + - name: Deploy qfield-sdk to github release if: ${{ github.event_name == 'release' && github.event.action == 'created' }} uses: actions/upload-release-asset@v1 @@ -86,6 +97,3 @@ jobs: with: upload_url: ${{ github.event.release.upload_url }} asset_path: qfield-sdk.tar.gz - # TODO: fix uploading to github releases - #tar -zcf /tmp/osgeo4a.tar.gz -C /tmp/workspace osgeo4a - #./scripts/upload_release_asset.py /tmp/osgeo4a.tar.gz ${{ steps.extract_tag.outputs.ref }} From 5c3a3548df75f55466d0549e9e2b3400e4eba801 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 9 Jun 2020 08:25:08 +0200 Subject: [PATCH 22/28] Bump sqlite3 to 3.32.2 --- recipes/sqlite3/recipe.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/sqlite3/recipe.sh b/recipes/sqlite3/recipe.sh index 609051c..c7ecfbd 100644 --- a/recipes/sqlite3/recipe.sh +++ b/recipes/sqlite3/recipe.sh @@ -1,16 +1,16 @@ #!/bin/bash # version of your package -VERSION_sqlite3=3270100 +VERSION_sqlite3=3320200 # dependencies of this recipe DEPS_sqlite3=() # url of the package -URL_sqlite3=http://www.sqlite.org/2019/sqlite-autoconf-${VERSION_sqlite3}.tar.gz +URL_sqlite3=http://www.sqlite.org/2020/sqlite-autoconf-${VERSION_sqlite3}.tar.gz # md5 of the package -MD5_sqlite3=cb72c5f93235cd56b18ee2aa1504cdaf +MD5_sqlite3=eb498918a33159cdf8104997aad29e83 # default build path BUILD_sqlite3=$BUILD_PATH/sqlite3/$(get_directory $URL_sqlite3) From b315cc25a77d7935d8c2b36274326686ae2b05f8 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 9 Jun 2020 08:25:29 +0200 Subject: [PATCH 23/28] Revert https://github.com/qgis/QGIS/commit/07eca3e6702f16785f64686dcbf568de1564eb4f --- ...ert-Fix-segfault-when-adding-a-layer.patch | 37 +++++++++++++++++++ recipes/qgis/recipe.sh | 3 +- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch diff --git a/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch b/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch new file mode 100644 index 0000000..1f6f689 --- /dev/null +++ b/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch @@ -0,0 +1,37 @@ +From 946361345c646997e020566a43f2e64c10707fb6 Mon Sep 17 00:00:00 2001 +From: Matthias Kuhn +Date: Tue, 9 Jun 2020 08:23:22 +0200 +Subject: [PATCH] Revert "Fix segfault when adding a layer" + +This reverts commit 07eca3e6702f16785f64686dcbf568de1564eb4f. +--- + src/core/qgssqliteutils.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/core/qgssqliteutils.cpp b/src/core/qgssqliteutils.cpp +index 96db18daee..d00bf780e9 100644 +--- a/src/core/qgssqliteutils.cpp ++++ b/src/core/qgssqliteutils.cpp +@@ -126,7 +126,7 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & + QSet uniqueFieldsResults; + char *zErrMsg = 0; + std::vector rows; +- QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); ++ QString sql = sqlite3_mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); + auto cb = [ ]( + void *data /* Data provided in the 4th argument of sqlite3_exec() */, + int /* The number of columns in row */, +@@ -171,8 +171,8 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & + rows.clear(); + + // Search indexes: +- sql = QgsSqlite3Mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" +- " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); ++ sql = sqlite3_mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" ++ " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); + rc = sqlite3_exec( connection, sql.toUtf8(), cb, ( void * )&rows, &zErrMsg ); + if ( rc != SQLITE_OK ) + { +-- +2.25.4 + diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index 6d70441..0887eff 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -27,8 +27,7 @@ function prebuild_qgis() { if [ -f .patched ]; then return fi - # reintroduce with proj6 (but do not delete legacy.h file in the patch) - #patch -p1 < $RECIPE_qgis/patches/0001-Use-qrc-for-crs-mapping.patch + patch -p1 < $RECIPE_qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch touch .patched } From 7eea0864dd679cccac5ff032d0697127129cdd26 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 8 Jun 2020 14:30:26 +0200 Subject: [PATCH 24/28] QGIS Debug build --- recipes/qgis/recipe.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index 0887eff..f70ef39 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -40,6 +40,7 @@ function build_qgis() { push_arm try $CMAKECMD \ + -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_DISABLE_FIND_PACKAGE_HDF5=TRUE \ -DWITH_DESKTOP=OFF \ -DWITH_ANALYSIS=ON \ From 35fe97994553bf989df93cc735f57fae3e21a825 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 9 Jun 2020 14:05:35 +0200 Subject: [PATCH 25/28] Fix crash with unique column detection --- ...ert-Fix-segfault-when-adding-a-layer.patch | 37 ------------------- .../patches/0001-fix_missing_table_name.patch | 34 +++++++++++++++++ recipes/qgis/recipe.sh | 2 +- 3 files changed, 35 insertions(+), 38 deletions(-) delete mode 100644 recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch create mode 100644 recipes/qgis/patches/0001-fix_missing_table_name.patch diff --git a/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch b/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch deleted file mode 100644 index 1f6f689..0000000 --- a/recipes/qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 946361345c646997e020566a43f2e64c10707fb6 Mon Sep 17 00:00:00 2001 -From: Matthias Kuhn -Date: Tue, 9 Jun 2020 08:23:22 +0200 -Subject: [PATCH] Revert "Fix segfault when adding a layer" - -This reverts commit 07eca3e6702f16785f64686dcbf568de1564eb4f. ---- - src/core/qgssqliteutils.cpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/core/qgssqliteutils.cpp b/src/core/qgssqliteutils.cpp -index 96db18daee..d00bf780e9 100644 ---- a/src/core/qgssqliteutils.cpp -+++ b/src/core/qgssqliteutils.cpp -@@ -126,7 +126,7 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & - QSet uniqueFieldsResults; - char *zErrMsg = 0; - std::vector rows; -- QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); -+ QString sql = sqlite3_mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); - auto cb = [ ]( - void *data /* Data provided in the 4th argument of sqlite3_exec() */, - int /* The number of columns in row */, -@@ -171,8 +171,8 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & - rows.clear(); - - // Search indexes: -- sql = QgsSqlite3Mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" -- " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); -+ sql = sqlite3_mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" -+ " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); - rc = sqlite3_exec( connection, sql.toUtf8(), cb, ( void * )&rows, &zErrMsg ); - if ( rc != SQLITE_OK ) - { --- -2.25.4 - diff --git a/recipes/qgis/patches/0001-fix_missing_table_name.patch b/recipes/qgis/patches/0001-fix_missing_table_name.patch new file mode 100644 index 0000000..67cf3bd --- /dev/null +++ b/recipes/qgis/patches/0001-fix_missing_table_name.patch @@ -0,0 +1,34 @@ +From ff13e5b546bab9e2f7f949f3aba7a29d53379dd5 Mon Sep 17 00:00:00 2001 +From: Denis Rouzaud +Date: Tue, 9 Jun 2020 10:47:44 +0200 +Subject: [PATCH] fix missing table name + +this was causing a crash +--- + src/core/qgssqliteutils.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/core/qgssqliteutils.cpp b/src/core/qgssqliteutils.cpp +index 96db18daee78..a1c94ddd4048 100644 +--- a/src/core/qgssqliteutils.cpp ++++ b/src/core/qgssqliteutils.cpp +@@ -126,7 +126,9 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & + QSet uniqueFieldsResults; + char *zErrMsg = 0; + std::vector rows; +- QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); ++ QByteArray tableNameUtf8 = quotedIdentifier( tableName ).toUtf8(); ++ QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master " ++ "where type='table' and name=%q", tableNameUtf8.constData() ); + auto cb = [ ]( + void *data /* Data provided in the 4th argument of sqlite3_exec() */, + int /* The number of columns in row */, +@@ -172,7 +174,7 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & + + // Search indexes: + sql = QgsSqlite3Mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" +- " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); ++ " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'", tableNameUtf8.constData() ); + rc = sqlite3_exec( connection, sql.toUtf8(), cb, ( void * )&rows, &zErrMsg ); + if ( rc != SQLITE_OK ) + { diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index f70ef39..d5e04eb 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -27,7 +27,7 @@ function prebuild_qgis() { if [ -f .patched ]; then return fi - patch -p1 < $RECIPE_qgis/patches/0001-Revert-Fix-segfault-when-adding-a-layer.patch + patch -p1 < $RECIPE_qgis/patches/0001-fix_missing_table_name.patch touch .patched } From bca0a9e2c53aa7db23faad8d340288750b21fb3f Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Wed, 10 Jun 2020 11:22:06 +0200 Subject: [PATCH 26/28] update QGIS and remove patch --- .../patches/0001-fix_missing_table_name.patch | 34 ------------------- recipes/qgis/recipe.sh | 5 ++- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 recipes/qgis/patches/0001-fix_missing_table_name.patch diff --git a/recipes/qgis/patches/0001-fix_missing_table_name.patch b/recipes/qgis/patches/0001-fix_missing_table_name.patch deleted file mode 100644 index 67cf3bd..0000000 --- a/recipes/qgis/patches/0001-fix_missing_table_name.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ff13e5b546bab9e2f7f949f3aba7a29d53379dd5 Mon Sep 17 00:00:00 2001 -From: Denis Rouzaud -Date: Tue, 9 Jun 2020 10:47:44 +0200 -Subject: [PATCH] fix missing table name - -this was causing a crash ---- - src/core/qgssqliteutils.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/core/qgssqliteutils.cpp b/src/core/qgssqliteutils.cpp -index 96db18daee78..a1c94ddd4048 100644 ---- a/src/core/qgssqliteutils.cpp -+++ b/src/core/qgssqliteutils.cpp -@@ -126,7 +126,9 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & - QSet uniqueFieldsResults; - char *zErrMsg = 0; - std::vector rows; -- QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master where type='table' and name=%q", quotedIdentifier( tableName ).toStdString().c_str() ); -+ QByteArray tableNameUtf8 = quotedIdentifier( tableName ).toUtf8(); -+ QString sql = QgsSqlite3Mprintf( "select sql from sqlite_master " -+ "where type='table' and name=%q", tableNameUtf8.constData() ); - auto cb = [ ]( - void *data /* Data provided in the 4th argument of sqlite3_exec() */, - int /* The number of columns in row */, -@@ -172,7 +174,7 @@ QSet QgsSqliteUtils::uniqueFields( sqlite3 *connection, const QString & - - // Search indexes: - sql = QgsSqlite3Mprintf( "SELECT sql FROM sqlite_master WHERE type='index' AND" -- " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'" ); -+ " tbl_name='%q' AND sql LIKE 'CREATE UNIQUE INDEX%%'", tableNameUtf8.constData() ); - rc = sqlite3_exec( connection, sql.toUtf8(), cb, ( void * )&rows, &zErrMsg ); - if ( rc != SQLITE_OK ) - { diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index d5e04eb..8433489 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -8,10 +8,10 @@ DEPS_qgis=(zlib gdal qca libspatialite libspatialindex expat gsl postgresql libz # DEPS_qgis=() # url of the package -URL_qgis=https://github.com/qgis/QGIS/archive/59ce5c8d653e8de0f2c4e92863d248ea23510b44.tar.gz +URL_qgis=https://github.com/qgis/QGIS/archive/954ab15276bdf3f9dc3b3689f71565aab9ce2d4b.tar.gz # md5 of the package -MD5_qgis=10145d87cf49505c58295f76ce94c5c8 +MD5_qgis=93c774cb52c221f80d0d3a48069d37f3 # default build path BUILD_qgis=$BUILD_PATH/qgis/$(get_directory $URL_qgis) @@ -27,7 +27,6 @@ function prebuild_qgis() { if [ -f .patched ]; then return fi - patch -p1 < $RECIPE_qgis/patches/0001-fix_missing_table_name.patch touch .patched } From 9528ae3682e60c8e51725247478b4f4e4cc605c7 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Wed, 10 Jun 2020 18:33:16 +0200 Subject: [PATCH 27/28] Bump QGIS to a installable version --- recipes/qgis/recipe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qgis/recipe.sh b/recipes/qgis/recipe.sh index 8433489..710bebf 100755 --- a/recipes/qgis/recipe.sh +++ b/recipes/qgis/recipe.sh @@ -8,10 +8,10 @@ DEPS_qgis=(zlib gdal qca libspatialite libspatialindex expat gsl postgresql libz # DEPS_qgis=() # url of the package -URL_qgis=https://github.com/qgis/QGIS/archive/954ab15276bdf3f9dc3b3689f71565aab9ce2d4b.tar.gz +URL_qgis=https://github.com/qgis/QGIS/archive/7d58502b3b0a615ba1f6a4a8adab5465e18caf56.tar.gz # md5 of the package -MD5_qgis=93c774cb52c221f80d0d3a48069d37f3 +MD5_qgis=8d2e9bdf0d69b5b919ecd6174e64e4e5 # default build path BUILD_qgis=$BUILD_PATH/qgis/$(get_directory $URL_qgis) From 05845d20ff29a9b7e577d79df4d4e4844bd57e2c Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 9 Jun 2020 12:51:36 +0200 Subject: [PATCH 28/28] Add webp support --- recipes/gdal/recipe.sh | 2 +- recipes/webp/recipe.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 recipes/webp/recipe.sh diff --git a/recipes/gdal/recipe.sh b/recipes/gdal/recipe.sh index ee4e87b..91d02f3 100644 --- a/recipes/gdal/recipe.sh +++ b/recipes/gdal/recipe.sh @@ -4,7 +4,7 @@ VERSION_gdal=2.4.0 # dependencies of this recipe -DEPS_gdal=(iconv sqlite3 geos libtiff postgresql expat zlib openjpeg libspatialite) +DEPS_gdal=(iconv sqlite3 geos libtiff postgresql expat zlib openjpeg libspatialite webp) # url of the package URL_gdal=http://download.osgeo.org/gdal/$VERSION_gdal/gdal-${VERSION_gdal}.tar.gz diff --git a/recipes/webp/recipe.sh b/recipes/webp/recipe.sh new file mode 100644 index 0000000..af7a0fa --- /dev/null +++ b/recipes/webp/recipe.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# version of your package +VERSION_webp=1.1.0 + +# dependencies of this recipe +DEPS_webp=() + +# url of the package +URL_webp=https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${VERSION_webp}.tar.gz + +# md5 of the package +MD5_webp=7e047f2cbaf584dff7a8a7e0f8572f18 + +# default build path +BUILD_webp=$BUILD_PATH/webp/$(get_directory $URL_webp) + +# default recipe path +RECIPE_webp=$RECIPES_PATH/webp + +# function called for preparing source code if needed +# (you can apply patch etc here.) +function prebuild_webp() { + cd $BUILD_webp + + # check marker + if [ -f .patched ]; then + return + fi + + touch .patched +} + +function shouldbuild_webp() { + # If lib is newer than the sourcecode skip build + if [ $BUILD_PATH/webp/build-$ARCH/.libs/libwebp.so -nt $BUILD_webp/.patched ]; then + DO_BUILD=0 + fi +} + +# function called to build the source code +function build_webp() { + try mkdir -p $BUILD_PATH/webp/build-$ARCH + try cd $BUILD_PATH/webp/build-$ARCH + push_arm + try $CMAKECMD \ + -DCMAKE_INSTALL_PREFIX:PATH=$STAGE_PATH \ + $BUILD_webp + try $MAKESMP + try $MAKESMP install + pop_arm +} + +# function called after all the compile have been done +function postbuild_webp() { + true +}