From aed166b85854f6c1289120ac37e26668c52ad4a5 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sat, 9 Jan 2021 16:58:25 +0100 Subject: [PATCH] Initial commit --- .gitignore | 4 ++ 0001-Use-AccessToken-auth-for-media.patch | 39 ++++++++++++++++++++ PKGBUILD | 45 +++++++++++++++++++++++ README.MD | 17 +++++++++ 4 files changed, 105 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Use-AccessToken-auth-for-media.patch create mode 100644 PKGBUILD create mode 100644 README.MD diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b49857d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +pkg/ +src/ +.SRCINFO +fractal* diff --git a/0001-Use-AccessToken-auth-for-media.patch b/0001-Use-AccessToken-auth-for-media.patch new file mode 100644 index 0000000..dcbeaa8 --- /dev/null +++ b/0001-Use-AccessToken-auth-for-media.patch @@ -0,0 +1,39 @@ +From 86a8d98413e6d4c97629d3ccdcbd7d0f8de3c6bb Mon Sep 17 00:00:00 2001 +From: Markus Koch +Date: Sat, 9 Jan 2021 16:39:57 +0100 +Subject: [PATCH] Use AccessToken auth for media + +--- + src/r0/media/get_content.rs | 2 +- + src/r0/media/get_content_thumbnail.rs | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/r0/media/get_content.rs b/src/r0/media/get_content.rs +index 9dd8464..5ae9125 100644 +--- a/src/r0/media/get_content.rs ++++ b/src/r0/media/get_content.rs +@@ -10,7 +10,7 @@ ruma_api! { + name: "get_media_content", + path: "/_matrix/media/r0/download/:server_name/:media_id", + rate_limited: false, +- authentication: None, ++ authentication: AccessToken, + } + + request: { +diff --git a/src/r0/media/get_content_thumbnail.rs b/src/r0/media/get_content_thumbnail.rs +index 06cd305..452683f 100644 +--- a/src/r0/media/get_content_thumbnail.rs ++++ b/src/r0/media/get_content_thumbnail.rs +@@ -23,7 +23,7 @@ ruma_api! { + name: "get_content_thumbnail", + path: "/_matrix/media/r0/thumbnail/:server_name/:media_id", + rate_limited: true, +- authentication: None, ++ authentication: AccessToken, + } + + request: { +-- +2.30.0 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..d8ac8af --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: Markus Koch + +pkgname=fractal-citadel +_gitname=fractal +pkgver=r2331.f9861e4b +pkgrel=1 +pkgdesc="GNOME Fractal adapted to work with Thales Citadel" +arch=('i686' 'x86_64' 'aarch64') +license=('GPL3') +url="https://gitlab.gnome.org/GNOME/fractal" +depends=('gtk3' 'libhandy' 'gtksourceview3' 'gstreamer' 'gst-plugins-base-libs' 'gst-plugins-bad' 'gst-editing-services' 'gst-libav' 'gspell') +optdepends=('gnome-keyring: secrets service') +conflics=('fractal' 'fractal-git') +provides=('fractal') +makedepends=('rust' 'gst-editing-services' 'pkg-config' 'git' 'meson') +source=("git+https://gitlab.gnome.org/World/fractal.git" "0001-Use-AccessToken-auth-for-media.patch") +md5sums=('SKIP' 'SKIP') + +pkgver() { + cd "${srcdir}/${_gitname}/" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + # Run vanilla build to download all crates + cd "${srcdir}/${_gitname}/" + arch-meson . _build + ninja -C _build + + # Then patch the API files + cd _build/target/cargo-home/git/checkouts/ruma-*/*/ruma-client-api/ + patch -p1 < ${srcdir}/0001-Use-AccessToken-auth-for-media.patch + cd "${srcdir}/${_gitname}/" + + # Force rebuild by "changing" a source file, which will also cause the + # dependencies that were downloaded with the first ninja command, and then + # modified through the patches, to be rebuilt. + touch fractal-gtk/src/main.rs + ninja -C _build +} + +package() { + cd "${srcdir}/${_gitname}/" + DESTDIR="${pkgdir}" ninja -C _build install +} diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..3b24fc4 --- /dev/null +++ b/README.MD @@ -0,0 +1,17 @@ +# GNOME Fractal for Thales Citadel +Patches to make GNOME Fractal compatible with [Thales' Citadel](https://citadel.team/). + +## How to use + +### ArchLinux + +* Run `makepkg` inside this repository. + +### Other + +* Download the fractal sources along with all of its crates +* Apply the 0001 patch to the `ruma-client-api` crate +* Build fractal + +## PS +Yes, this is a somewhat dirty way of doing it, but it works and it's quick ;D