audio/shortwave: Add missing patches from last commit

This commit is contained in:
Bernhard Froehlich 2025-04-13 22:21:57 +02:00
parent 996a1055df
commit b60be1185c
No known key found for this signature in database
GPG key ID: 4DD88C3F9F3B8333
3 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,10 @@
--- Cargo.toml.orig 2025-02-05 10:44:30 UTC
+++ Cargo.toml
@@ -17,7 +17,6 @@ futures-util = "0.3"
diesel = { version = "2.2", features = ["sqlite", "r2d2"] }
diesel_migrations = "2.2"
futures-util = "0.3"
-glycin = { version = "2.0", features = ["gdk4"] }
indexmap = "2.7"
Inflector = "0.11"
language-tags = "0.3"

View file

@ -0,0 +1,15 @@
--- meson.build.orig 2025-02-05 10:44:30 UTC
+++ meson.build
@@ -19,8 +19,10 @@ dependency('shumate-1.0', version: '>= 1.3')
dependency('shumate-1.0', version: '>= 1.3')
# Required by glycin crate
-dependency('lcms2', version: '>= 2.12.0')
-dependency('libseccomp', version: '>= 2.5.0')
+if host_machine.system() == 'linux'
+ dependency('lcms2', version: '>= 2.12.0')
+ dependency('libseccomp', version: '>= 2.5.0')
+endif
dependency('gstreamer-1.0', version: '>= 1.16')
dependency('gstreamer-base-1.0', version: '>= 1.16')

View file

@ -0,0 +1,40 @@
--- src/api/cover_loader.rs.orig 2025-02-05 10:44:30 UTC
+++ src/api/cover_loader.rs
@@ -22,7 +22,6 @@ use gdk::RGBA;
use async_compat::CompatExt;
use futures_util::StreamExt;
use gdk::RGBA;
-use glycin::Loader;
use gtk::gio::{Cancelled, File};
use gtk::graphene::Rect;
use gtk::prelude::TextureExt;
@@ -88,9 +87,7 @@ impl CoverRequest {
async fn cover_bytes(&self) -> Result<(gdk::Texture, Vec<u8>)> {
self.download_tmp_file().compat().await?;
- let loader = Loader::new(self.tmp_file.clone());
- let image = loader.load().await?;
- let texture = image.next_frame().await?.texture();
+ let texture = Self::load_texture(&self.tmp_file).await?;
let snapshot = gtk::Snapshot::new();
snapshot_thumbnail(&snapshot, texture, self.size as f32);
@@ -106,6 +103,18 @@ impl CoverRequest {
let png_bytes = texture.save_to_png_bytes().to_vec();
Ok((texture, png_bytes))
+ }
+
+ #[cfg(target_os = "linux")]
+ async fn load_texture(file: &gio::File) -> Result<gdk::Texture> {
+ let loader = glycin::Loader::new(file.clone());
+ let image = loader.load().await?;
+ Ok(image.next_frame().await?.texture())
+ }
+
+ #[cfg(target_os = "freebsd")]
+ async fn load_texture(file: &gio::File) -> Result<gdk::Texture> {
+ Ok(gdk::Texture::from_file(file)?)
}
async fn download_tmp_file(&self) -> Result<()> {