Commit 84704f8f authored by Nicolas Fella's avatar Nicolas Fella Committed by Aleix Pol Gonzalez

[android] Add helper for building discount

parent 0b035567
Pipeline #13680 skipped with stage
From 295665cb626e09fe74859251afb6bcaaf981e5bd Mon Sep 17 00:00:00 2001
From: Nicolas Fella <nicolas.fella@gmx.de>
Date: Tue, 31 Dec 2019 02:15:00 +0100
Subject: [PATCH] [Hack] Use mktags from native build when crosscompiling
---
cmake/CMakeLists.txt | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index a9df796..9bb4cec 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -123,11 +123,16 @@ endif()
include_directories("${_ROOT}")
-add_executable(mktags
- "${_ROOT}/mktags.c")
+if(CMAKE_CROSSCOMPILING)
+ find_program(mktags_PROGRAM mktags PATHS "/opt/nativetooling/bin")
+else()
+ add_executable(mktags
+ "${_ROOT}/mktags.c")
+ set(mktags_PROGRAM mktags)
+endif()
add_custom_command(OUTPUT "${_ROOT}/blocktags"
- COMMAND mktags > blocktags
+ COMMAND ${mktags_PROGRAM} > blocktags
WORKING_DIRECTORY "${_ROOT}")
add_library(libmarkdown
@@ -221,6 +226,10 @@ if(${PROJECT_NAME}_MAKE_INSTALL)
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}")
unset(_TARGETS)
unset(_PACKAGE_NAME)
+
+ if(NOT CMAKE_CROSSCOMPILING)
+ install(TARGETS mktags)
+ endif()
endif()
unset(_ROOT)
--
2.24.1
......@@ -184,7 +184,7 @@ ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \
target-from-manifest.py target-from-appdata.py cp-with-prefix skip /opt/helpers/
target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-discount /opt/helpers/
RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_ANDROID/src/android/templates/AndroidManifest.xml \
&& sed -i.bak 's/|density//g' $QT_ANDROID/src/android/templates/AndroidManifest.xml
......
......@@ -184,7 +184,7 @@ ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \
target-from-manifest.py target-from-appdata.py cp-with-prefix skip /opt/helpers/
target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-discount /opt/helpers/
RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_ANDROID/src/android/templates/AndroidManifest.xml \
&& sed -i.bak 's/|density//g' $QT_ANDROID/src/android/templates/AndroidManifest.xml
......
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH=$DIR:$PATH
mkdir -p $HOME/src/
cd $HOME/src/
if [ ! -d discount ] ; then
git clone --depth 1 https://github.com/Orc/discount
fi
cd discount
# discount executes a previously build executable during build. Therefore we need to build it natively first and then use the built executable to cross-compile
git apply 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch
BUILD=build-native EXTRA_CMAKE_SUBDIR=cmake /opt/helpers/build-cmake-native discount https://github.com/Orc/discount -DDISCOUNT_ONLY_LIBRARY=On -DCMAKE_INSTALL_PREFIX=/opt/nativetooling
EXTRA_CMAKE_SUBDIR=cmake /opt/helpers/build-cmake discount https://github.com/Orc/discount -DDISCOUNT_ONLY_LIBRARY=On
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment