Skip to content

Commit ae0b76b

Browse files
committed
Get build working
1 parent bb7d2b8 commit ae0b76b

16 files changed

+672
-75
lines changed

.github/workflows/build.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
push:
3+
pull_request:
4+
jobs:
5+
build:
6+
name: Build and package
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Setup Python
11+
uses: actions/setup-python@v4
12+
with:
13+
python-version: '3.11'
14+
- name: Install toltecmk
15+
run: pip install toltecmk
16+
- name: Build package
17+
run: |
18+
tar -czvf src.tar.gz src
19+
toltecmk
20+
- name: Save packages
21+
uses: actions/upload-artifact@v3
22+
with:
23+
name: packages
24+
path: release

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.build/
2+
dist/
23
*.pro.user
4+
src.tar.gz
5+
build/

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[![rm1](https://img.shields.io/badge/rM1-supported-green)](https://remarkable.com/store/remarkable) [![rm2](https://img.shields.io/badge/rM2-supported-green)](https://remarkable.com/store/remarkable-2) [![Discord](https://img.shields.io/discord/385916768696139794.svg?label=reMarkable&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/ATqQGfu)
2+
reMarkable Template Qt Application
3+
==================================
4+
5+
Building
6+
========
7+
8+
This will result in a `dist` folder that you can copy to your device.
9+
10+
```bash
11+
# Source the correct toolchain
12+
source /opt/codex/rm11x/3.1.15/environment-setup-cortexa7hf-neon-remarkable-linux-gnueabi
13+
mkdir .build
14+
cd .build
15+
qmake ..
16+
make
17+
INSTALL_ROOT="$(pwd)/../dist" make install
18+
cd ..
19+
```
20+
This will create
21+
22+
Build toltec package
23+
====================
24+
25+
https://remarkable.guide/devel/package.html
26+
27+
```bash
28+
tar -czvf src.tar.gz src
29+
toltecmk
30+
```

myapp.pro

+3-73
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,3 @@
1-
# Change this to rename the built application
2-
TARGET = myapp
3-
VERSION = 1.0
4-
5-
QT += gui
6-
QT += quick
7-
8-
CONFIG += ltcg
9-
CONFIG += c++11
10-
CONFIG += c++17
11-
CONFIG += c++20
12-
CONFIG += c++latest
13-
CONFIG += qml_debug
14-
CONFIG += qtquickcompiler
15-
16-
DEFINES += QT_DEPRECATED_WARNINGS
17-
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x051510
18-
19-
SOURCES += \
20-
main.cpp
21-
22-
# This provides more context on crashes when built in debug mode
23-
CONFIG(debug, debug|release){
24-
LIBS += -lunwind
25-
contains(DEFINES, SANITIZER){
26-
QMAKE_LFLAGS += -fno-omit-frame-pointer
27-
QMAKE_LFLAGS += -fsanitize-recover=address
28-
29-
QMAKE_LFLAGS += -fsanitize=address
30-
QMAKE_LFLAGS += -fsanitize=leak
31-
# QMAKE_LFLAGS += -fsanitize=thread # Incompatible with address and leak
32-
QMAKE_LFLAGS += -fsanitize=undefined
33-
QMAKE_LFLAGS += -fsanitize=pointer-compare
34-
QMAKE_LFLAGS += -fsanitize=pointer-subtract
35-
}
36-
}
37-
38-
# This makes sure that libraries installed by toltec can be loaded by the application
39-
QMAKE_RPATHDIR += /lib /usr/lib /opt/lib /opt/usr/lib
40-
41-
# This allows you to use APP_VERSION in your code to output the application version
42-
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
43-
44-
QMAKE_LFLAGS += -flto
45-
QMAKE_CFLAGS += -fPIC
46-
QMAKE_CXXFLAGS += -fPIC
47-
48-
# The application will be installed to /opt/bin on the device
49-
target.path = /opt/bin
50-
INSTALLS += target
51-
52-
# This installs the oxide application registration file
53-
applications.files = $$_PRO_FILE_PWD_/myapp.oxide
54-
applications.path = /opt/usr/share/applications/
55-
INSTALLS += applications
56-
57-
# This installs the application icon
58-
# icons.files += $$_PRO_FILE_PWD_/myapp.png
59-
# icons.path = /opt/usr/share/icons/oxide/48x48/apps
60-
# INSTALLS += icons
61-
62-
# this installs the application splashscreen
63-
# splash.files += $$_PRO_FILE_PWD_/splash.png
64-
# splash.path = /opt/usr/share/icons/oxide/702x702/splash
65-
# INSTALLS += splash
66-
67-
HEADERS += \
68-
controller.h
69-
70-
RESOURCES += \
71-
qml.qrc
72-
73-
include(vendor/epaper.pri)
1+
TEMPLATE = subdirs
2+
SUBDIRS = src
3+
INSTALLS += $$SUBDIRS

package

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pkgnames=(my-app)
2+
pkgdesc="An example application package"
3+
url=https://example.com
4+
pkgver=0.0.1-1
5+
timestamp=2020-10-09T18:15Z
6+
section=util
7+
maintainer="My Name <[email protected]>"
8+
license=MIT
9+
10+
image=qt:v3.1
11+
source=(src.tar.gz)
12+
sha256sums=(SKIP)
13+
14+
build() {
15+
find . -name "*.pro" -type f -print0 \
16+
| xargs -r -0 sed -i 's/linux-oe-g++/linux-arm-remarkable-g++/g'
17+
qmake
18+
make -j$(nproc)
19+
INSTALL_ROOT="dist" make install
20+
}
21+
22+
package() {
23+
cp -ar "${srcdir}/dist/." "${pkgdir}"
24+
}
File renamed without changes.

main.cpp renamed to src/main.cpp

File renamed without changes.

main.qml renamed to src/main.qml

File renamed without changes.
File renamed without changes.

qml.qrc renamed to src/qml.qrc

File renamed without changes.

src/src.pro

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Change this to rename the built application
2+
TARGET = myapp
3+
VERSION = 1.0
4+
5+
QT += gui
6+
QT += quick
7+
8+
CONFIG += ltcg
9+
CONFIG += c++11
10+
CONFIG += c++17
11+
CONFIG += c++20
12+
CONFIG += c++latest
13+
CONFIG += qml_debug
14+
CONFIG += qtquickcompiler
15+
16+
DEFINES += QT_DEPRECATED_WARNINGS
17+
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x051510
18+
19+
SOURCES += \
20+
main.cpp
21+
22+
# This provides more context on crashes when built in debug mode
23+
CONFIG(debug, debug|release){
24+
LIBS += -lunwind
25+
contains(DEFINES, SANITIZER){
26+
QMAKE_LFLAGS += -fno-omit-frame-pointer
27+
QMAKE_LFLAGS += -fsanitize-recover=address
28+
29+
QMAKE_LFLAGS += -fsanitize=address
30+
QMAKE_LFLAGS += -fsanitize=leak
31+
# QMAKE_LFLAGS += -fsanitize=thread # Incompatible with address and leak
32+
QMAKE_LFLAGS += -fsanitize=undefined
33+
QMAKE_LFLAGS += -fsanitize=pointer-compare
34+
QMAKE_LFLAGS += -fsanitize=pointer-subtract
35+
}
36+
}
37+
38+
# This makes sure that libraries installed by toltec can be loaded by the application
39+
QMAKE_RPATHDIR += /lib /usr/lib /opt/lib /opt/usr/lib
40+
41+
# This allows you to use APP_VERSION in your code to output the application version
42+
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
43+
44+
QMAKE_LFLAGS += -flto
45+
QMAKE_CFLAGS += -fPIC
46+
QMAKE_CXXFLAGS += -fPIC
47+
48+
# The application will be installed to /opt/bin on the device
49+
target.path = /opt/bin
50+
INSTALLS += target
51+
52+
# This installs the oxide application registration file
53+
applications.files = $$_PRO_FILE_PWD_/myapp.oxide
54+
applications.path = /opt/usr/share/applications/
55+
INSTALLS += applications
56+
57+
# This installs the application icon
58+
# icons.files += $$_PRO_FILE_PWD_/myapp.png
59+
# icons.path = /opt/usr/share/icons/oxide/48x48/apps
60+
# INSTALLS += icons
61+
62+
# this installs the application splashscreen
63+
# splash.files += $$_PRO_FILE_PWD_/splash.png
64+
# splash.path = /opt/usr/share/icons/oxide/702x702/splash
65+
# INSTALLS += splash
66+
67+
HEADERS += \
68+
controller.h
69+
70+
RESOURCES += \
71+
qml.qrc
72+
73+
include(vendor/epaper.pri)

0 commit comments

Comments
 (0)