From b0632f33a9a34123e027e91c44916235a5cd9494 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 1 Dec 2023 23:01:08 +0000 Subject: gentoo auto-resync : 01:12:2023 - 23:01:08 --- net-im/Manifest.gz | Bin 9407 -> 9403 bytes net-im/fractal/Manifest | 3 +- .../fractal/files/fractal-5-secret-service.patch | 168 +++++++++++++++++++++ net-im/fractal/fractal-5-r1.ebuild | 91 +++++++++++ net-im/fractal/fractal-5.ebuild | 86 ----------- 5 files changed, 261 insertions(+), 87 deletions(-) create mode 100644 net-im/fractal/files/fractal-5-secret-service.patch create mode 100644 net-im/fractal/fractal-5-r1.ebuild delete mode 100644 net-im/fractal/fractal-5.ebuild (limited to 'net-im') diff --git a/net-im/Manifest.gz b/net-im/Manifest.gz index c6cae885c9b6..14dd5a3b5431 100644 Binary files a/net-im/Manifest.gz and b/net-im/Manifest.gz differ diff --git a/net-im/fractal/Manifest b/net-im/fractal/Manifest index 2dd80030c3b5..0a6ba49aee47 100644 --- a/net-im/fractal/Manifest +++ b/net-im/fractal/Manifest @@ -1,6 +1,7 @@ +AUX fractal-5-secret-service.patch 6627 BLAKE2B 7b25e5ae17429deeafe5737c05b9ddd6bbf70d01d3769bafdf20372009a3820f3ed4407e15bb8059f1373e3a4978605bf49b69b6232631d09eddd4f9669d5fd5 SHA512 25f21fa1b8361471706f1500759042aef0308df36c08adb2f42d7d5e216f700a71f869628ae9e8caa1c3054aee1b598ac9d1f9a53ec79addf690a68c2be21d85 DIST fractal-5-crates.tar.xz 42625036 BLAKE2B c63f3b7b0029d9c0d6519463c233c7f46b4541e3bfd202cc906318342eca49889e848408dc718caa55311066423acbc6c4936e6dfc97939683a9f3b89e678add SHA512 d2cb81a61de4abec67999598750226e7d19d0f0e46bea509f17beb45c04bcef2996c20244d6b28489e3ef91d597d0f973f1b0dad5a501ca0d17d72fdef413af2 DIST fractal-5.tar.bz2 1362630 BLAKE2B 4fb7f638a535ae75c479d84730c5608165fe28c22b228b1ca2a69c340858cedc0fc5833a27d644804b62897f2466869af037a2634921915c5efd060e6e721277 SHA512 d7ed615edb16e30ad932d005298f72cf38b10f3f87c255622b2f8ec7551a8f0fc76bc54bc5e55538e07ff603a01355c7df86e56e63a0cbefa9e43843d9c9c3f7 DIST matrix-authentication-service-357481b52e6dc092178a16b8a7d86df036aac608.gh.tar.gz 1406414 BLAKE2B 6f00cc3c9db792b29911be9efae6dfbd4c5d80d1251953ccad4b4e4e863e18b84db2235636208efc48a8e84b83b3c4b4acfd6630263d178db9aa98e448bedd88 SHA512 b9dfa13f6479a330c0da8529ac2a723df87c044f306a66a5887e70ae2d4089ba8e7cae2d7c59e8cb0c3d7e6076eae6c2072d314dab208565891a4bcbfc511f54 DIST matrix-rust-sdk-8895ce40d13faa79012144c97044990284215758.gh.tar.gz 1677376 BLAKE2B 175062e6782fa9c435c5a9f32ed9e971762a7d387064faa0ffe59407235ea858028a200496d0f3ac2718814f1e5d36a7e5f3fa93c718a345b0ee8ed997442cd6 SHA512 6ed4601ca75d0182797a4036d61d0df6f99689ab7a77638863c697ba52395ca3ef35290c38871d4136e9f4406c8f0c527c57727d808328ec9401276bf024d88d -EBUILD fractal-5.ebuild 4024 BLAKE2B b598844060500fe3d455f03804a12aa9516bd2dfa718c8f4e7fad1bd21d1e80412b76dffa25353e93eb86960f92cb2eceeeee39a79985e0a3946418572d38558 SHA512 ea59b58af6d7709385e5fe9d834789e4978c71766cc274ed419379e17466573a1736f877d4f54bac615cdfbfc69acb875c0ba7fa1608728ff9a11c62c366315a +EBUILD fractal-5-r1.ebuild 4142 BLAKE2B f8248c13a0c15b5b765db6d019b5f0514c2f797a38ab0b414f460c8e483baa54d35bd7b7e3c82e2db0dc8c23b7813302854c128e34f029510a173e7ec41e7608 SHA512 e2cc8c443530c07428274c07b9e8905dc5de666ffbde72b0590fd4015c6f0729a9b3a751c24b01897a0dd0d08975845239099e44a9d52a7062d818c716b56212 MISC metadata.xml 332 BLAKE2B 569a289b8162fcaf4ea56281b75c2b61a6cb104779a518ae630c25479836b80741b27b526ba6b15fc7ded67f6857518fcfed6a1070612544ece16d1ce3a10c13 SHA512 f876529939b590a35ab9becc0e33c5c50dc7c1da0b10bda95a7ed8fe483b30141d2b8719b58e5080d6caebaf6d28691b6fa5a9f08f6fdbc5ae5fd131c3c881f0 diff --git a/net-im/fractal/files/fractal-5-secret-service.patch b/net-im/fractal/files/fractal-5-secret-service.patch new file mode 100644 index 000000000000..99d9554590ab --- /dev/null +++ b/net-im/fractal/files/fractal-5-secret-service.patch @@ -0,0 +1,168 @@ +From 2e867841619efc67e8d221b7d15833520d56f3be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?K=C3=A9vin=20Commaille?= +Date: Mon, 27 Nov 2023 13:10:22 +0100 +Subject: [PATCH] secret: Serialize secret as JSON + +MessagePack creates issues with Secret Service providers that expect a +valid string. +We don't really care about saving a few bytes when storing secrets. +--- + src/secret.rs | 80 ++++++++++++++++++++++++--------------------------- + 1 file changed, 38 insertions(+), 42 deletions(-) + +diff --git a/src/secret.rs b/src/secret.rs +index 1c7a6759f..88f757f5b 100644 +--- a/src/secret.rs ++++ b/src/secret.rs +@@ -13,14 +13,14 @@ use ruma::{DeviceId, OwnedDeviceId, OwnedUserId, UserId}; + use serde::{Deserialize, Serialize}; + use serde_json::error::Error as JsonError; + use thiserror::Error; +-use tracing::{debug, error, warn}; ++use tracing::{debug, error, info}; + use url::Url; + + use crate::{ + application::AppProfile, gettext_f, prelude::*, spawn_tokio, utils::matrix, APP_ID, PROFILE, + }; + +-pub const CURRENT_VERSION: u8 = 4; ++pub const CURRENT_VERSION: u8 = 5; + const SCHEMA_ATTRIBUTE: &str = "xdg:schema"; + + static DATA_PATH: Lazy = Lazy::new(|| { +@@ -275,21 +275,21 @@ impl StoredSession { + }; + let secret = match item.secret().await { + Ok(secret) => { +- if version == 0 { +- match Secret::from_utf8(&secret) { ++ if version <= 4 { ++ match rmp_serde::from_slice::(&secret) { + Ok(secret) => secret, + Err(error) => { +- error!("Could not parse secret in stored session: {error:?}"); ++ error!("Could not parse secret in stored session: {error}"); + return Err(SecretError::Invalid(gettext( + "Malformed secret in stored session", + ))); + } + } + } else { +- match rmp_serde::from_slice::(&secret) { ++ match serde_json::from_slice(&secret) { + Ok(secret) => secret, + Err(error) => { +- error!("Could not parse secret in stored session: {error}"); ++ error!("Could not parse secret in stored session: {error:?}"); + return Err(SecretError::Invalid(gettext( + "Malformed secret in stored session", + ))); +@@ -407,7 +407,7 @@ impl StoredSession { + + let attrs = self.attributes(); + let attributes = attrs.iter().map(|(k, v)| (*k, v.as_ref())).collect(); +- let secret = rmp_serde::to_vec_named(&self.secret).unwrap(); ++ let secret = serde_json::to_string(&self.secret).unwrap(); + + keyring + .create_item( +@@ -478,34 +478,30 @@ impl StoredSession { + Ok(()) + } + +- /// Migrate this session to version 4. +- /// +- /// This implies moving the database under Fractal's directory. +- pub async fn migrate_to_v4(&mut self, item: Item) { +- warn!( +- "Session {} with version {} found for user {}, migrating to version 4…", +- self.id(), +- self.version, +- self.user_id, +- ); ++ /// Migrate this session to the current version. ++ pub async fn apply_migrations(&mut self, item: Item) { ++ if self.version < 4 { ++ info!("Migrating to version 4…"); + +- let target_path = DATA_PATH.join(self.id()); ++ let target_path = DATA_PATH.join(self.id()); + +- if self.path != target_path { +- debug!("Moving database to: {}", target_path.to_string_lossy()); ++ if self.path != target_path { ++ debug!("Moving database to: {}", target_path.to_string_lossy()); + +- if let Err(error) = fs::create_dir_all(&target_path) { +- error!("Failed to create new directory: {error}"); +- } ++ if let Err(error) = fs::create_dir_all(&target_path) { ++ error!("Failed to create new directory: {error}"); ++ } + +- if let Err(error) = fs::rename(&self.path, &target_path) { +- error!("Failed to move database: {error}"); +- } ++ if let Err(error) = fs::rename(&self.path, &target_path) { ++ error!("Failed to move database: {error}"); ++ } + +- self.path = target_path; ++ self.path = target_path; ++ } + } + +- self.version = 4; ++ info!("Migrating to version 5…"); ++ self.version = 5; + + let clone = self.clone(); + spawn_tokio!(async move { +@@ -548,14 +544,6 @@ pub struct Secret { + pub passphrase: String, + } + +-impl Secret { +- /// Converts a vector of bytes to a `Secret`. +- pub fn from_utf8(slice: &[u8]) -> Result { +- let s = String::from_utf8(slice.to_owned())?; +- Ok(serde_json::from_str(&s)?) +- } +-} +- + /// Retrieves all sessions stored to the `SecretService` + pub async fn restore_sessions() -> Result, SecretError> { + let keyring = Keyring::new().await?; +@@ -575,15 +563,23 @@ pub async fn restore_sessions() -> Result, SecretError> { + Ok(session) => sessions.push(session), + Err(SecretError::OldVersion { item, mut session }) => { + if session.version == 0 { +- warn!( +- "Found old session for {} with sled store, removing…", ++ info!( ++ "Found old session for user {} with sled store, removing…", + session.user_id + ); + session.delete(Some(item), true).await; +- } else if session.version < 4 { +- session.migrate_to_v4(item).await; +- sessions.push(session); ++ continue; + } ++ ++ info!( ++ "Found session {} for user {} with old version {}, applying migrations…", ++ session.id(), ++ session.user_id, ++ session.version, ++ ); ++ session.apply_migrations(item).await; ++ ++ sessions.push(session); + } + Err(SecretError::WrongProfile) => {} + Err(error) => { +-- +GitLab + diff --git a/net-im/fractal/fractal-5-r1.ebuild b/net-im/fractal/fractal-5-r1.ebuild new file mode 100644 index 000000000000..5a675aac42dd --- /dev/null +++ b/net-im/fractal/fractal-5-r1.ebuild @@ -0,0 +1,91 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" + +declare -A GIT_CRATES=( + [mas-http]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/http' + [mas-iana]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/iana' + [mas-jose]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/jose' + [mas-keystore]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/keystore' + [mas-oidc-client]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/oidc-client' + [mas-tower]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/tower' + [matrix-sdk-base]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-base' + [matrix-sdk-common]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-common' + [matrix-sdk-crypto]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-crypto' + [matrix-sdk-indexeddb]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-indexeddb' + [matrix-sdk-qrcode]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-qrcode' + [matrix-sdk-sqlite]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-sqlite' + [matrix-sdk-store-encryption]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-store-encryption' + [matrix-sdk-ui]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-ui' + [matrix-sdk]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk' + [oauth2-types]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/oauth2-types' +) + +inherit cargo gnome2-utils meson + +DESCRIPTION="Matrix messaging app for GNOME written in Rust" +HOMEPAGE=" + https://wiki.gnome.org/Apps/Fractal + https://gitlab.gnome.org/GNOME/fractal/ +" +SRC_URI=" + https://gitlab.gnome.org/GNOME/fractal/-/archive/${PV}/${P}.tar.bz2 + https://dev.gentoo.org/~mgorny/dist/${P}-crates.tar.xz + ${CARGO_CRATE_URIS} +" + +LICENSE="GPL-3+" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD GPL-3+ ISC MIT + MPL-2.0 MPL-2.0 Unicode-DFS-2016 ZLIB +" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND=" + >=dev-libs/glib-2.72 + >=gui-libs/gtk-4.10.0:4 + >=gui-libs/libadwaita-1.4.0:1 + + >=media-libs/gstreamer-1.20:1.0 + >=media-libs/gst-plugins-bad-1.20:1.0 + >=media-libs/gst-plugins-base-1.20:1.0 + + >=gui-libs/gtksourceview-5.0.0:5 + >=media-video/pipewire-0.3.0:=[gstreamer] + >=dev-libs/openssl-1.0.1:= + >=media-libs/libshumate-1.0.0:1.0 + >=dev-db/sqlite-3.24.0:3 + >=sys-apps/xdg-desktop-portal-1.14.1 +" +RDEPEND=" + ${DEPEND} +" + +# Rust +QA_FLAGS_IGNORED="usr/bin/fractal" + +PATCHES=( + # https://gitlab.gnome.org/GNOME/fractal/-/merge_requests/1462 + "${FILESDIR}/${P}-secret-service.patch" +) + +src_configure() { + meson_src_configure + ln -s "${CARGO_HOME}" "${BUILD_DIR}/cargo-home" || die +} + +pkg_postinst() { + gnome2_schemas_update + xdg_icon_cache_update +} + +pkg_postrm() { + gnome2_schemas_update + xdg_icon_cache_update +} diff --git a/net-im/fractal/fractal-5.ebuild b/net-im/fractal/fractal-5.ebuild deleted file mode 100644 index ae658f2b7106..000000000000 --- a/net-im/fractal/fractal-5.ebuild +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -CRATES=" -" - -declare -A GIT_CRATES=( - [mas-http]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/http' - [mas-iana]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/iana' - [mas-jose]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/jose' - [mas-keystore]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/keystore' - [mas-oidc-client]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/oidc-client' - [mas-tower]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/tower' - [matrix-sdk-base]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-base' - [matrix-sdk-common]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-common' - [matrix-sdk-crypto]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-crypto' - [matrix-sdk-indexeddb]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-indexeddb' - [matrix-sdk-qrcode]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-qrcode' - [matrix-sdk-sqlite]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-sqlite' - [matrix-sdk-store-encryption]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-store-encryption' - [matrix-sdk-ui]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk-ui' - [matrix-sdk]='https://github.com/matrix-org/matrix-rust-sdk;8895ce40d13faa79012144c97044990284215758;matrix-rust-sdk-%commit%/crates/matrix-sdk' - [oauth2-types]='https://github.com/matrix-org/matrix-authentication-service;357481b52e6dc092178a16b8a7d86df036aac608;matrix-authentication-service-%commit%/crates/oauth2-types' -) - -inherit cargo gnome2-utils meson - -DESCRIPTION="Matrix messaging app for GNOME written in Rust" -HOMEPAGE=" - https://wiki.gnome.org/Apps/Fractal - https://gitlab.gnome.org/GNOME/fractal/ -" -SRC_URI=" - https://gitlab.gnome.org/GNOME/fractal/-/archive/${PV}/${P}.tar.bz2 - https://dev.gentoo.org/~mgorny/dist/${P}-crates.tar.xz - ${CARGO_CRATE_URIS} -" - -LICENSE="GPL-3+" -# Dependent crate licenses -LICENSE+=" - Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD GPL-3+ ISC MIT - MPL-2.0 MPL-2.0 Unicode-DFS-2016 ZLIB -" -SLOT="0" -KEYWORDS="~amd64" - -DEPEND=" - >=dev-libs/glib-2.72 - >=gui-libs/gtk-4.10.0:4 - >=gui-libs/libadwaita-1.4.0:1 - - >=media-libs/gstreamer-1.20:1.0 - >=media-libs/gst-plugins-bad-1.20:1.0 - >=media-libs/gst-plugins-base-1.20:1.0 - - >=gui-libs/gtksourceview-5.0.0:5 - >=media-video/pipewire-0.3.0:=[gstreamer] - >=dev-libs/openssl-1.0.1:= - >=media-libs/libshumate-1.0.0:1.0 - >=dev-db/sqlite-3.24.0:3 - >=sys-apps/xdg-desktop-portal-1.14.1 -" -RDEPEND=" - ${DEPEND} -" - -# Rust -QA_FLAGS_IGNORED="usr/bin/fractal" - -src_configure() { - meson_src_configure - ln -s "${CARGO_HOME}" "${BUILD_DIR}/cargo-home" || die -} - -pkg_postinst() { - gnome2_schemas_update - xdg_icon_cache_update -} - -pkg_postrm() { - gnome2_schemas_update - xdg_icon_cache_update -} -- cgit v1.2.3