Page MenuHomePhorge

No OneTemporary

Size
16 KB
Referenced Files
None
Subscribers
None
diff --git a/.gitignore b/.gitignore
index bc6cafa..d94b87f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,13 @@
*~
\#*
.#*
build
node_modules
TAGS
+.flatpak-builder
+cargo-sources.json
+packaging/GNU-Linux/flatpak/*.flatpak
+packaging/GNU-Linux/flatpak/repo
+packaging/GNU-Linux/flatpak/venv
+packaging/GNU-Linux/flatpak/flatpak-build
+packaging/GNU-Linux/flatpak/vodozemac-bindings
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 02494f6..d6fe1ea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,110 +1,110 @@
# This file is part of libkazv.
# SPDX-FileCopyrightText: 2022-2023 tusooa <tusooa@kazv.moe>
# SPDX-License-Identifier: AGPL-3.0-or-later
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "trigger"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: $CI_COMMIT_BRANCH
- if: '$CI_COMMIT_TAG !~ /^phabricator\//'
stages:
- prepare
- lint
- build
- report
.report:
image:
name: 'reg.lily.kazv.moe/infra/phorge-ci-tools:servant'
rules:
- if: $TARGET_PHID
when: always
- when: never
before_script:
- pipelineUrl="$CI_PROJECT_URL"/-/pipelines/"$CI_PIPELINE_ID"
report-start:
extends: .report
stage: prepare
script:
- 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"work\", \"unit\": [{\"name\": \"GitLab CI (information only)\", \"result\": \"skip\", \"details\": \"$pipelineUrl\", \"format\": \"remarkup\"}]}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
'lint':
stage: lint
image: ubuntu
script:
- "echo 'Verify that no source file contains tabs'"
- "! egrep -R --exclude-dir=transformed-libs --exclude-dir=Intl.js --exclude-dir=node_modules $'\t' src"
- "echo 'Verify that no source file contains trailing spaces'"
- "! egrep -R --exclude-dir=transformed-libs --exclude-dir=Intl.js --exclude-dir=node_modules '\\s$' src"
rules: &build-rules
- changes: &src-chg
- Dockerfile.deps
- '**/*.cpp'
- '**/*.hpp'
- '**/CMakeLists.txt'
- '**/*.in'
- '**/*.qml'
- 'src/js/*.js'
- 'src/js/transformed-libs/*.js'
- - 'packaging/**'
- - 'icons/**'
+ - 'packaging/**/*'
+ - 'icons/**/*'
.build:
stage: build
rules: *build-rules
.build-debug:
extends: .build
script: |
env JOBS=2 ./packaging/GNU-Linux/appimage/build.sh
artifacts:
paths:
- kazv-Debug.AppImage
expire_in: 1 week
.build-prod:
extends: .build
script: |
env JOBS=2 ./packaging/GNU-Linux/appimage/build-prod.sh
artifacts:
paths:
- kazv-Release.AppImage
expire_in: 1 week
'build:GNU/Linux-amd64-debug:kf6':
extends: .build-debug
before_script:
- export KF_VER=6
image:
name: 'reg.lily.kazv.moe/kazv/libkazv/libkazv:servant-ubuntu22.04-debug'
'build:GNU/Linux-amd64-prod:kf6':
extends: .build-prod
before_script:
- export KF_VER=6
image:
name: 'reg.lily.kazv.moe/kazv/libkazv/libkazv:servant-ubuntu22.04-prod'
report-success:
extends: .report
rules:
- if: $TARGET_PHID
when: on_success
- when: never
stage: report
script:
- 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"pass\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
report-failure:
extends: .report
rules:
- if: $TARGET_PHID
when: on_failure
- when: never
stage: report
script:
- 'echo "{\"receiver\": \"$TARGET_PHID\", \"type\": \"fail\"}" | /tools/arcanist/bin/arc call-conduit --conduit-uri https://iron.lily-is.land/ --conduit-token "$CONDUIT_TOKEN" -- harbormaster.sendmessage'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b353df9..be62433 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,91 +1,91 @@
cmake_minimum_required(VERSION 3.16)
project(kazv)
include(FeatureSummary)
set(kazv_VERSION_MAJOR 0)
set(kazv_VERSION_MINOR 5)
set(kazv_VERSION_PATCH 0)
set(kazv_VERSION_STRING ${kazv_VERSION_MAJOR}.${kazv_VERSION_MINOR}.${kazv_VERSION_PATCH})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
if(NOT kazv_KF_QT_MAJOR_VERSION)
set(kazv_KF_QT_MAJOR_VERSION 6)
endif()
message(STATUS "KF/Qt major version: ${kazv_KF_QT_MAJOR_VERSION}")
if(NOT kazv_KF_QT_MAJOR_VERSION EQUAL 6)
message(FATAL_ERROR "KF/Qt major version must be 6")
endif()
set(QT_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
set(KF_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
set(QT_MIN_VERSION 6.5.0)
set(KF_MIN_VERSION 6.0.0)
option(kazv_LINK_BREEZE_ICONS "Link to Breeze icons library" OFF)
set(kazv_LINK_BREEZE_ICONS_MACRO 0)
if(kazv_LINK_BREEZE_ICONS)
set(kazv_LINK_BREEZE_ICONS_MACRO 1)
endif()
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
set(KDE_SKIP_NULLPTR_WARNINGS_SETTINGS ON)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMPoQmTools)
include(ECMAddTests)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(ECMQmlModule)
ecm_set_disabled_deprecation_versions(
QT 5.15.14
KF 5.116.0
KCOREADDONS 5.116.0
)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
Core Gui Qml QuickControls2 Svg Concurrent Widgets
Multimedia Test Network QuickTest
)
qt6_policy(SET QTP0001 NEW)
set(kazv_KF_EXTRA_MODULES)
if(kazv_LINK_BREEZE_ICONS)
list(APPEND kazv_KF_EXTRA_MODULES BreezeIcons)
endif()
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami Config KIO Notifications CoreAddons ${kazv_KF_EXTRA_MODULES})
find_package(KF6KirigamiAddons)
find_package(Threads REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(libkazv REQUIRED)
find_package(cmark)
set(CMARK_TARGET_NAME cmark::cmark)
if(NOT cmark_FOUND)
# CMark 0.29.0 on Ubuntu 20.04 has cmark.cmake instead of cmark-config.cmake
# But that is not usable, so we fall back to pkgconfig
find_package(PkgConfig REQUIRED)
pkg_search_module(cmark libcmark IMPORTED_TARGET GLOBAL)
set(CMARK_TARGET_NAME cmark)
endif()
kde_enable_exceptions()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -foperator-names -DQT_NO_EMIT")
add_subdirectory(src)
install(PROGRAMS moe.kazv.mxc.kazv.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES moe.kazv.mxc.kazv.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES kazv.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
-install(FILES icons/kazvlogo-256.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/256x256/apps)
+install(FILES icons/kazvlogo-256.png DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/256x256/apps RENAME moe.kazv.mxc.kazv.png)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/README.md b/README.md
index ae298cb..0024289 100644
--- a/README.md
+++ b/README.md
@@ -1,91 +1,99 @@
# Description
kazv is a convergent matrix client and instant messaging app.
# License
Copyright (C) 2020-2023 the Kazv Project <https://lily-is.land/kazv>
kazv is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
kazv is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with kazv. If not, see <https://www.gnu.org/licenses/>.
# Compiled executables
| Operating system | Architecture | Format | Download links |
|------------------|--------------|----------|----------------------------------------------------|
| GNU/Linux | amd64 | AppImage | [Debug][gl-amd64-ai-d] [Production][gl-amd64-ai-p] |
[gl-amd64-ai-d]: https://lily.kazv.moe/kazv/kazv/-/jobs/artifacts/servant/download?job=build:GNU/Linux-amd64-debug:kf6
[gl-amd64-ai-p]: https://lily.kazv.moe/kazv/kazv/-/jobs/artifacts/servant/download?job=build:GNU/Linux-amd64-prod:kf6
# Installation
## For Gentoo users
If you are using Gentoo, you can use [tusooa-overlay][tusooa-overlay]
to install kazv.
[tusooa-overlay]: https://gitlab.com/tusooa/tusooa-overlay
+## flatpak
+
+If you have flatpak, you can install kazv via flatpak. Because flatpak currently cannot be built in an unprivileged container, we are unfortunately unable to provide a built image as a part of CI/CD. See [this flatpak bug][flatpak-docker-bug] for more details. It seems that upstream is very uninterested in resolving this security issue, as this bug report has been open for more than five years with zero (0) comment from Collaborators of this repository.
+
+[flatpak-docker-bug]: https://github.com/flatpak/flatpak/issues/3027
+
+However, we will release *manually-built* flatpak packages from version 0.6.0 onwards. You can also build the flatpak via the instructions specified in the README file in the `packaging/GNU-Linux/flatpak` directory.
+
## Dependencies
- ECM
- Qt6: Core Gui Qml QuickControls2 Svg Concurrent Multimedia Network Widgets (ImageFormats is a recommended runtime dependency, without which formats like webp cannot be displayed) (Test and QuickTest if you want to build tests)
- KF6: Kirigami KConfig KIO Notifications CoreAddons KirigamiAddons (BreezeIcons is recommended)
- nlohmann_json
- libkazv
- cmark
## Build process
Normal build:
```
mkdir build && cd build
cmake ..
make install
```
Updating external JavaScript libraries (advanced, usually not needed):
You need to first have Node.js available.
```
cd src/js/Intl.js
npm install
cd ..
npm install
./transform.bash
```
Follow the instruction in [emoji.lisp](./tools/emoji.lisp) to update the emoji list (usually not needed)
# Contributing
## Dev chat
We use Matrix to communicate. Join the matrix room at [#kazv:tusooa.xyz](https://matrix.to/#/#kazv:tusooa.xyz).
## Bugs
Report bugs to [our repository on Lily Islands](https://lily-is.land/kazv/kazv) (chances are it is the page you are currently viewing), or email to [project-bugs@kazv.moe](mailto:project-bugs@kazv.moe).
Report security vulnerabilities using a confidential GitLab issue on Lily Islands, or email to [project-security@kazv.moe](mailto:project-security@kazv.moe).
## Write code
To contribute code to the Kazv Project, open a merge request on Lily Islands, or email your patch to [project-patch@kazv.moe](mailto:project-patch@kazv.moe).
## Donate
You can now donate to the Kazv Project on Liberapay: <https://liberapay.com/theKazvProject/>.
diff --git a/moe.kazv.mxc.kazv.desktop b/moe.kazv.mxc.kazv.desktop
index 5303ae5..8d239e4 100644
--- a/moe.kazv.mxc.kazv.desktop
+++ b/moe.kazv.mxc.kazv.desktop
@@ -1,9 +1,9 @@
[Desktop Entry]
Name=kazv
Comment=Matrix client built with Kirigami
Version=1.0
Exec=kazv
-Icon=kazvlogo-256
+Icon=moe.kazv.mxc.kazv
Type=Application
Terminal=false
Categories=Qt;KDE;Network;
diff --git a/packaging/GNU-Linux/flatpak/README.md b/packaging/GNU-Linux/flatpak/README.md
new file mode 100644
index 0000000..7a71935
--- /dev/null
+++ b/packaging/GNU-Linux/flatpak/README.md
@@ -0,0 +1,52 @@
+# Building flatpak for kazv
+
+All blocks are run from the repository root unless specified.
+
+Setup the environment:
+
+```
+cd packaging/GNU-Linux/flatpak
+python -m venv venv
+. ./venv/bin/activate
+pip3 install aiohttp toml
+wget -O./venv/bin/flatpak-cargo-generator https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py
+chmod +x ./venv/bin/flatpak-cargo-generator
+cd ../../..
+```
+
+Setup flatpak:
+
+```
+flatpak remote-add --user --if-not-exists flathub 'https://flathub.org/repo/flathub.flatpakrepo'
+```
+
+Fetch cargo sources (if you run into problems building vodozemac-bindings, run `git pull` in the `vodozemac-bindings` directory and rerun `flatpak-cargo-generator` command):
+
+```
+cd packaging/GNU-Linux/flatpak
+. ./venv/bin/activate
+git clone https://lily-is.land/kazv/vodozemac-bindings.git
+flatpak-cargo-generator vodozemac-bindings/Cargo.lock -o cargo-sources.json
+cd ../../..
+```
+
+Build:
+
+```
+cd packaging/GNU-Linux/flatpak
+flatpak-builder --jobs=NJOBS --user --install-deps-from=flathub --force-clean --ccache --repo=repo flatpak-build moe.kazv.mxc.kazv.yaml
+flatpak build-bundle repo kazv.flatpak --runtime-repo='https://flathub.org/repo/flathub.flatpakrepo' moe.kazv.mxc.kazv
+```
+
+Replace `NJOBS` with the number of parallel jobs you want to run.
+
+Install:
+
+```
+cd packaging/GNU-Linux/flatpak
+flatpak install --user --bundle ./kazv.flatpak
+```
+
+# See also
+
+[Upstream documentation about building a flatpak](https://docs.flatpak.org/en/latest/hosting-a-repository.html)
diff --git a/packaging/GNU-Linux/flatpak/moe.kazv.mxc.kazv.yaml b/packaging/GNU-Linux/flatpak/moe.kazv.mxc.kazv.yaml
new file mode 100644
index 0000000..dcf85f9
--- /dev/null
+++ b/packaging/GNU-Linux/flatpak/moe.kazv.mxc.kazv.yaml
@@ -0,0 +1,117 @@
+id: moe.kazv.mxc.kazv
+runtime: org.kde.Platform
+runtime-version: '6.7'
+sdk: org.kde.Sdk
+sdk-extensions:
+ - org.freedesktop.Sdk.Extension.rust-stable
+build-options:
+ append-path: /usr/lib/sdk/rust-stable/bin
+command: kazv
+finish-args:
+ - "--share=ipc"
+ - "--socket=fallback-x11"
+ - "--socket=wayland"
+ - "--share=network"
+ - "--filesystem=xdg-documents"
+modules:
+ - name: boost
+ buildsystem: simple
+ build-commands:
+ - "./bootstrap.sh --prefix=/app --with-libraries=system,regex,serialization"
+ - "./b2 -j $FLATPAK_BUILDER_N_JOBS install"
+ sources:
+ - type: "archive"
+ url: "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2"
+ sha256: "8681f175d4bdb26c52222665793eef08490d7758529330f98d3b29dd0735bccc"
+ - name: cryptopp
+ buildsystem: simple
+ build-commands:
+ - make
+ - make PREFIX=/ DESTDIR="${FLATPAK_DEST}" install
+ sources:
+ - type: archive
+ url: "https://github.com/weidai11/cryptopp/archive/refs/tags/CRYPTOPP_8_9_0.tar.gz"
+ sha256: ab5174b9b5c6236588e15a1aa1aaecb6658cdbe09501c7981ac8db276a24d9ab
+ - buildsystem: simple
+ name: vodozemac
+ build-commands:
+ - make -C cpp src/lib.rs
+ - CARGO_HOME=/run/build/vodozemac/cargo cargo --offline fetch --manifest-path Cargo.toml --verbose
+ - cd cpp && CARGO_HOME=/run/build/vodozemac/cargo make && CARGO_HOME=/run/build/vodozemac/cargo make PREFIX=/ DESTDIR="${FLATPAK_DEST}" install
+ sources:
+ - cargo-sources.json
+ - type: git
+ url: https://lily-is.land/kazv/vodozemac-bindings.git
+ tag: servant
+ - buildsystem: cmake-ninja
+ config-opts:
+ - '-DJSON_MultipleHeaders=ON'
+ - '-DJSON_BuildTests=OFF'
+ name: nlohmann-json
+ sources:
+ - type: archive
+ url: https://github.com/nlohmann/json/archive/v3.11.2.tar.gz
+ sha256: d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273
+ - buildsystem: cmake-ninja
+ name: immer
+ config-opts:
+ - '-Dimmer_BUILD_TESTS=OFF'
+ - '-Dimmer_BUILD_EXAMPLES=OFF'
+ - '-Dimmer_BUILD_DOCS=OFF'
+ - '-Dimmer_BUILD_EXTRAS=OFF'
+ sources:
+ - type: git
+ url: https://github.com/arximboldi/immer.git
+ - buildsystem: cmake-ninja
+ name: zug
+ config-opts:
+ - '-Dzug_BUILD_TESTS=OFF'
+ - '-Dzug_BUILD_EXAMPLES=OFF'
+ - '-Dzug_BUILD_DOCS=OFF'
+ sources:
+ - type: git
+ url: https://github.com/arximboldi/zug.git
+ - buildsystem: cmake-ninja
+ name: lager
+ config-opts:
+ - '-Dlager_BUILD_TESTS=OFF'
+ - '-Dlager_BUILD_EXAMPLES=OFF'
+ - '-Dlager_BUILD_DOCS=OFF'
+ sources:
+ - type: git
+ url: https://github.com/arximboldi/lager.git
+ - buildsystem: cmake-ninja
+ name: libkazv
+ config-opts:
+ - '-Dlibkazv_BUILD_KAZVJOB=OFF'
+ - '-Dlibkazv_BUILD_TESTS=OFF'
+ - '-Dlibkazv_BUILD_EXAMPLES=OFF'
+ sources:
+ - type: git
+ url: https://lily-is.land/kazv/libkazv.git
+ tag: servant
+ - buildsystem: cmake-ninja
+ name: cmark
+ builddir: true
+ sources:
+ - type: archive
+ url: https://github.com/commonmark/cmark/archive/refs/tags/0.31.1.tar.gz
+ sha256: 3da93db5469c30588cfeb283d9d62edfc6ded9eb0edc10a4f5bbfb7d722ea802
+ - buildsystem: cmake-ninja
+ name: kirigami-addons
+ builddir: true
+ sources:
+ - type: git
+ url: https://invent.kde.org/libraries/kirigami-addons.git
+ tag: v1.4.0
+ - buildsystem: cmake-ninja
+ name: kazv
+ sources:
+ - type: dir
+ path: ../../..
+ skip:
+ - packaging
+ - .git
+ - build
+ - node_modules
+ - TAGS

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 8:31 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55437
Default Alt Text
(16 KB)

Event Timeline