Skip to content
Snippets Groups Projects
Commit 5e01a5b1 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Cleanup spec and documentation after converting to meson

parent 62661cc0
No related branches found
No related tags found
No related merge requests found
......@@ -3,3 +3,5 @@ harbour-matrix.pro.user
/lib/
/rpm/harbour-matrix.spec.*
*.autosave
RPMS
documentation.list
......@@ -6,57 +6,17 @@ connect to mersdk:
ssh -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk mersdk@localhost
install cmake:
building:
sdk-assistant list # choose sdk you need
sb2 -t <sdk> -m sdk-install -R zypper in cmake openssl-devel boost-devel
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-install -R zypper openssl-devel boost-devel make
mb2 -t SailfishOS-3.0.2.8-armv7hl build
build libolm && sodium && nlohmann json && spdlog
Building using docker:
cd ~/
mkdir deps
cd deps
https://git.matrix.org/git/olm.git
cd olm
git checkout 3.0.0
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake . -Bbuild -DBUILD_SHARED_LIBS=NO -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/deps/olm-i486
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build -- install
docker run -it -d --name sailsdk --mount type=bind,source="$(pwd)",target=/home/nemo/build sailsdk:latest /bin/bash
# or
docker start sailsdk
docker exec sailsdk mb2 -t SailfishOS-3.0.2.8-armv7hl build
curl -LO https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz
tar -xf libsodium-1.0.17.tar.gz
cd libsodium-1.0.17/
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build ./configure --prefix=/home/mersdk/deps/sodium-i486
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build make
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build make check
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build make install
git clone https://github.com/nlohmann/json.git
cd json
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake . -Bbuild -DBUILD_SHARED_LIBS=NO -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/deps/json-i486
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build -- install
https://github.com/gabime/spdlog/archive/v1.3.1.tar.gz
tar -xf v1.3.1.tar.gz
cd spdlog-1.3.1
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake . -DCMAKE_BUILD_TYPE=Release -DSPDLOG_BUILD_BENCH=OFF -DSPDLOG_BUILD_EXAMPLES=OFF -DSPDLOG_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/mersdk/deps/spdlog -Bbuild
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build -- install
build mtxclient
git clone https://github.com/Nheko-Reborn/mtxclient.git
cd mtxclient/
sed -i '/sized-deallocation/d' CMakeLists.txt
sed -i '/diagnostics-color/d' CMakeLists.txt
CXX=/opt/gcc6/bin/g++ CC=/opt/gcc6/bin/gcc LINK=/opt/gcc6/bin/g++ PKG_CONFIG_PATH=/home/mersdk/deps/sodium-i486/lib/pkgconfig/ sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/mtxclient/mtxclient-inst-i486 -DSPDLOG_DIR=/home/mersdk/deps/spdlog -Dnlohmann_json_DIR=/home/mersdk/deps/json-i486/lib/cmake/nlohmann_json -Dsodium_USE_STATIC_LIBS=ON -DOLM_INCLUDE_DIR=/home/mersdk/deps/olm-i486/include/ -DOLM_LIBRARY=/home/mersdk/deps/olm-i486/lib/libolm.a -DBUILD_LIB_EXAMPLES=off -DBUILD_LIB_TESTS=OFF -Bbuild
CXX=/opt/gcc6/bin/g++ CC=/opt/gcc6/bin/gcc LINK=/opt/gcc6/bin/g++ PKG_CONFIG_PATH=/home/mersdk/deps/sodium-armv7hl/lib/pkgconfig/ sb2 -t SailfishOS-3.0.2.8-armv7hl -m sdk-build cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/mersdk/mtxclient/mtxclient-inst-armv7hl -DSPDLOG_DIR=/home/mersdk/deps/spdlog -Dnlohmann_json_DIR=/home/mersdk/deps/json-arm7hl/lib/cmake/nlohmann_json -Dsodium_USE_STATIC_LIBS=ON -DOLM_INCLUDE_DIR=/home/mersdk/deps/olm-arm7hl/include/ -DOLM_LIBRARY=/home/mersdk/deps/olm-arm7hl/lib/libolm.a -DBUILD_LIB_EXAMPLES=off -DBUILD_LIB_TESTS=OFF -Bbuild2
sb2 -t SailfishOS-3.0.2.8-i486 -m sdk-build cmake --build build -- install
copy mtxclient to the lib subfolder, ie, lib/mtxclient-inst-i486, also copy nlohmann_json to the lib subfolder
# NOTICE:
#
# Application name defined in TARGET has a corresponding QML filename.
# If name defined in TARGET is changed, the following needs to be done
# to match new name:
# - corresponding QML filename must be changed
# - desktop icon filename must be changed
# - desktop filename must be changed
# - icon definition filename in desktop file must be changed
# - translation filenames have to be changed
# The name of your application
TARGET = harbour-matrix
QMAKE_CXX=/opt/gcc6/bin/g++
QMAKE_CC=/opt/gcc6/bin/gcc
QMAKE_LINK=/opt/gcc6/bin/g++
#CONFIG(debug,debug|release){ MTXCLIENT_PATH = lib/mtxclient-inst-armv7hl }
#CONFIG(release,debug|release){ MTXCLIENT_PATH = lib/mtxclient-inst-i486 }
INCLUDEPATH += lib/mtxclient-inst-i486/include
INCLUDEPATH += lib/
LIBS += -L$$PWD/lib/mtxclient-inst-armv7hl/lib -L$$PWD/lib/mtxclient-inst-i486/lib -lmatrix_client -L/opt/gcc6/lib -lboost_system-mt -lboost_iostreams-mt -lboost_random-mt -lboost_thread-mt -lssl -lcrypto -lz
lib.files += lib/mtxclient-inst-armv7hl/lib/libmatrix_client.a
lib.files += lib/mtxclient-inst-i486/lib/libmatrix_client.a
DEFINES += BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
DEFINES += "BOOST_MPL_LIMIT_LIST_SIZE=30"
CONFIG += sailfishapp
CONFIG += c++14
CONFIG += object_parallel_to_source
SOURCES += src/harbour-matrix.cpp \
src/login.cpp \
src/client.cpp \
src/settings.cpp \
src/models/roommodel.cpp
DISTFILES += qml/harbour-matrix.qml \
qml/cover/CoverPage.qml \
rpm/harbour-matrix.changes.in \
rpm/harbour-matrix.changes.run.in \
rpm/harbour-matrix.spec \
rpm/harbour-matrix.yaml \
translations/*.ts \
harbour-matrix.desktop \
qml/pages/LoginPage.qml \
qml/pages/AboutPage.qml \
README.md \
qml/pages/MainView.qml \
CMakeLists.txt
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
# German translation is enabled as an example. If you aren't
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-matrix-de.ts
HEADERS += \
src/login.h \
src/client.h \
src/settings.h \
src/models/roommodel.h
......@@ -45,36 +45,19 @@ Short description of my Sailfish OS Application
mkdir -p %{bdir}
python3 -m pip install --user cget meson
CFLAGS="${CFLAGS} -fPIC"
CXXFLAGS="${CXXFLAGS} -fPIC"
#~/.local/bin/cget --help
export CFLAGS="${CFLAGS} -fPIC"
export CXXFLAGS="${CXXFLAGS} -fPIC"
~/.local/bin/cget install -DCMAKE_CXX_COMPILER=/opt/gcc6/bin/g++ -DCMAKE_C_COMPILER=/opt/gcc6/bin/gcc -DCMAKE_SHARED_LINKER_FLAGS="-L/opt/gcc6/lib -static-libstdc++" -p %{bdir}/%{name}-cget
export CMAKE_PREFIX_PATH=%{bdir}/%{name}-cget/lib/cmake/
export BOOST_ROOT=%{bdir}/%{name}-cget/
#-DCMAKE_TOOLCHAIN_FILE=%{bdir}/%{name}-cget/cget/cget.cmake \
export CXX=/opt/gcc6/bin/g++
export LDFLAGS="${LDFLAGS} -L/opt/gcc6/lib -static-libstdc++"
#cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -H/home/nemo/build/ -B%{bdir}/build
#-DCMAKE_CXX_COMPILER=/opt/gcc6/bin/g++ \
#-DCMAKE_SHARED_LINKER_FLAGS="-L/opt/gcc6/lib -static-libstdc++" \
#-DCMAKE_INSTALL_PREFIX=%{_prefix} \
#-DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
#-DCMAKE_INSTALL_DATADIR=%{_datadir}
~/.local/bin/meson --prefix=/usr %{bdir}/build
ninja -C %{bdir}/build
#cmake --build %{bdir}/build -- %{?_smp_mflags}
#make -C %{bdir} VERBOSE=1 %{?_smp_mflags}
#%cmake -B%{buildroot}%{_datadir}/%{name} -H$(pwd) \
#-DCMAKE_CXX_COMPILER=/opt/gcc6/bin/g++ \
#-DCMAKE_SHARED_LINKER_FLAGS="-L/opt/gcc6/lib -static-libstdc++" \
#-DCMAKE_INSTALL_PREFIX=%{_prefix} \
#-DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \
#-DCMAKE_INSTALL_DATADIR=%{_datadir} \
#-DCMAKE_TOOLCHAIN_FILE=%{bdir}/%{name}-cget/cget/cget.cmake
# << build pre
......@@ -85,9 +68,9 @@ ninja -C %{bdir}/build
%install
rm -rf %{buildroot}
# >> install pre
#DESTDIR=%{buildroot} make -C %{bdir} install
DESTDIR=%{buildroot} ninja -C %{bdir}/build install
#cmake --build %{bdir}/build --target install
# << install pre
# >> install post
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment