full cross compile using clickable

This commit is contained in:
Morgan McMillian 2021-03-09 22:27:12 -08:00
parent bd24d6416d
commit 1f4c5c3ec5
7 changed files with 101 additions and 24 deletions

View file

@ -80,7 +80,7 @@ Page {
Label { Label {
width: parent.width width: parent.width
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: i18n.tr("Copyright (c) 2020 Morgan McMillian &lt;<a href='mailto:thrrgilag@dreamfall.space'>thrrgilag@dreamfall.space</a>&gt;") text: i18n.tr("Copyright (c) 2021 Morgan McMillian &lt;<a href='mailto:thrrgilag@dreamfall.space'>thrrgilag@dreamfall.space</a>&gt;")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
@ -94,7 +94,7 @@ Page {
Label { Label {
width: parent.width width: parent.width
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: i18n.tr("Pantalaimon v0.7.0") text: i18n.tr("Pantalaimon v0.9.1")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
fontSize: "large" fontSize: "large"
} }
@ -102,7 +102,7 @@ Page {
Label { Label {
width: parent.width width: parent.width
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: i18n.tr("Copyright (c) 2020 The Matrix.org Foundation CIC") text: i18n.tr("Copyright (c) 2021 The Matrix.org Foundation CIC")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }

View file

@ -20,7 +20,7 @@ execute_process(
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
set(APP_NAME "Pantalaimon UT") set(APP_NAME "Pantalaimon UT")
set(APP_VERSION "0.4.0") set(APP_VERSION "0.5.0")
set(PROJECT_NAME "pantalaimon") set(PROJECT_NAME "pantalaimon")
set(FULL_PROJECT_NAME "pantalaimon.thrrgilag") set(FULL_PROJECT_NAME "pantalaimon.thrrgilag")
set(CMAKE_INSTALL_PREFIX /) set(CMAKE_INSTALL_PREFIX /)
@ -41,6 +41,7 @@ endif()
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
configure_file(AboutPage.qml.in ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml) configure_file(AboutPage.qml.in ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml)
configure_file(pantalaimon.sh.in ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR}) install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
install(DIRECTORY assets DESTINATION ${DATA_DIR}) install(DIRECTORY assets DESTINATION ${DATA_DIR})
@ -51,6 +52,11 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/AboutPage.qml DESTINATION ${DATA_DIR}q
# TODO: example config file for local testing # TODO: example config file for local testing
# install(FILES example.conf DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon.conf) # install(FILES example.conf DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon.conf)
file(GLOB_RECURSE OLM_SO_FILES "$ENV{OLM_LIB_INSTALL_DIR}/lib/libolm.so*")
install(FILES ${OLM_SO_FILES} DESTINATION ${QT_IMPORTS_DIR})
install(PROGRAMS build/${ARCH_TRIPLET}/pantalaimon/dist/pantalaimon DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimonexec)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pantalaimon.sh DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME pantalaimon)
# Translations # Translations
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js) file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h) list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h)
@ -72,9 +78,6 @@ add_custom_target(${DESKTOP_FILE_NAME} ALL
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})
# TODO: figure out how to cross compile this
install(PROGRAMS ${PROJECT_NAME}-${CLICK_ARCH} DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME ${PROJECT_NAME})
add_subdirectory(po) add_subdirectory(po)
# Make source files visible in qtcreator # Make source files visible in qtcreator

View file

@ -12,9 +12,9 @@ End-to-end encryption aware Matrix reverse proxy daemon for Ubuntu Touch.
- [x] About page - [x] About page
- [x] App icon - [x] App icon
- [x] Fix image fetching (fixed in fluffychat) - [x] Fix image fetching (fixed in fluffychat)
- [x] Cross compile python+pantalaimon
- [ ] Import/export keys - [ ] Import/export keys
- [ ] Ability to verify, ignore, or blacklist devices - [ ] Ability to verify, ignore, or blacklist devices
- [ ] Cross compile python+pantalaimon
- [ ] Release on open-store.io - [ ] Release on open-store.io
## Known Issues ## Known Issues
@ -22,19 +22,23 @@ End-to-end encryption aware Matrix reverse proxy daemon for Ubuntu Touch.
* Previously encrypted messages cannot be decrypted * Previously encrypted messages cannot be decrypted
* No user interaction to verify, ignore, or blacklist devices * No user interaction to verify, ignore, or blacklist devices
## Build ## Build for armhf
This project is not currently setup for cross building. A binary will need to ```sh
be compiled on a device for each target architecture. Make sure there is git clone https://git.sr.ht/~thrrgilag/pantalaimon-ut
enough space on the device to install the build tools and compile python, olm, git submodule update --init
and pantalaimon. clickable build-libs --arch armhf
clickable --arch armhf
```
* `git clone https://git.sr.ht/~thrrgilag/pantalaimon-ut` ## Build for arm64
* push dev-build.sh to /home/phablet
* run `dev-build.sh` ```sh
* pull /home/phablet/pantalaimon-build/dist/pantalaimon git clone https://git.sr.ht/~thrrgilag/pantalaimon-ut
* rename pantalaimon to pantalaimon-armhf (or pantalaimon-arm64) git submodule update --init
* run `clickable` clickable build-libs --arch arm64
clickable --arch arm64
```
## Contributing ## Contributing
@ -48,6 +52,6 @@ Bugs can be filed at https://todo.sr.ht/~thrrgilag/pantalaimon-ut
## License ## License
Copyright (C) 2020 Morgan McMillian Copyright (C) 2021 Morgan McMillian
Licensed under the Apache Software License 2.0 Licensed under the Apache Software License 2.0

45
build-python.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/bash
PYTHON_VERSION="3.7.7"
CRYPTOGRAPHY_VERSION="3.2.1"
echo "...building python..."
cd ${BUILD_DIR}
wget -qO- "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" | tar -xz
echo
echo "...building python..."
echo
cd Python-${PYTHON_VERSION}
./configure --prefix="${INSTALL_DIR}" --enable-shared
make
make install
cd ..
export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}
echo
echo "...installing pyinstaller..."
echo
${INSTALL_DIR}/bin/pip3 install --upgrade pyinstaller
export CRYPTOGRAPHY_ALLOW_OPENSSL_102="yes"
echo
echo "...installing cryptography..."
echo
${INSTALL_DIR}/bin/pip3 install --upgrade cryptography==${CRYPTOGRAPHY_VERSION}
export LD_LIBRARY_PATH=${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}:${LD_LIBRARY_PATH}
export CFLAGS=-I${ROOT}/build/${ARCH_TRIPLET}/olm/install/include
export LDFLAGS=-L${ROOT}/build/${ARCH_TRIPLET}/olm/install/lib/${ARCH_TRIPLET}
echo
echo "...installing pantalaimon..."
echo
${INSTALL_DIR}/bin/pip3 install --upgrade pantalaimon
export PATH=/usr/${ARCH_TRIPLET}/bin:${PATH}
echo
echo "...creating executable..."
echo
${INSTALL_DIR}/bin/pyinstaller --onefile ${INSTALL_DIR}/bin/pantalaimon

View file

@ -1,5 +1,24 @@
{ {
"clickable_minimum_required": "6.12.2", "clickable_minimum_required": "6.12.2",
"builder": "cmake", "builder": "cmake",
"libraries": {
"olm": {
"builder": "cmake",
"build_args": [ "-Bbuild",
"-DOLM_TESTS=OFF",
"-DBUILD_SHARED_LIBS=ON"
],
"prebuild": "git submodule update --init --recursive"
},
"pantalaimon": {
"builder": "custom",
"dependencies_target": [
"libffi-dev",
"libssl-dev",
"libsqlite3-dev"
],
"build": "${ROOT}/build-python.sh"
}
},
"kill": "qmlscene" "kill": "qmlscene"
} }

6
pantalaimon.sh.in Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
INSTALL_DIR=`dirname $0`
export LD_LIBRARY_PATH=$INSTALL_DIR/lib/${ARCH_TRIPLET}:$LD_LIBRARY_PATH
$INSTALL_DIR/pantalaimonexec $@

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: pantalaimon.thrrgilag\n" "Project-Id-Version: pantalaimon.thrrgilag\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-08 03:47+0000\n" "POT-Creation-Date: 2021-03-10 06:14+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -107,14 +107,14 @@ msgstr ""
msgid "LogLevel" msgid "LogLevel"
msgstr "" msgstr ""
#: ../qml/SettingsPage.qml:148 #: ../qml/SettingsPage.qml:146
msgid "Delete homeserver" msgid "Delete homeserver"
msgstr "" msgstr ""
#: ../qml/SettingsPage.qml:166 #: ../qml/SettingsPage.qml:164
msgid "No homeservers" msgid "No homeservers"
msgstr "" msgstr ""
#: ../qml/SettingsPage.qml:227 #: ../qml/SettingsPage.qml:225
msgid "Add Homeserver" msgid "Add Homeserver"
msgstr "" msgstr ""