glycin-loaders: init at 0.1.beta.2

https://gitlab.gnome.org/sophie-h/glycin/-/commits/0.1.beta.2

This builds the "loaders" part of the project. This will be needed
for "glycin" the library, and will be needed for new loupe to actually
open any images.

Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
This commit is contained in:
Bobby Rong 2023-08-18 17:05:59 +08:00 committed by Jan Tojnar
parent d052d2659a
commit 449c35bd5c
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,13 @@
diff --git a/vendor/glycin/src/dbus.rs b/vendor/glycin/src/dbus.rs
index aa5a876..4f37420 100644
--- a/vendor/glycin/src/dbus.rs
+++ b/vendor/glycin/src/dbus.rs
@@ -43,7 +43,7 @@ impl<'a> DecoderProcess<'a> {
let (bin, args, final_arg) = match sandbox_mechanism {
SandboxMechanism::Bwrap => (
- "bwrap".into(),
+ "@bwrap@".into(),
vec![
"--unshare-all",
"--die-with-parent",

View file

@ -0,0 +1,70 @@
{ stdenv
, lib
, fetchurl
, substituteAll
, bubblewrap
, cargo
, git
, meson
, ninja
, pkg-config
, rustc
, gtk4
, cairo
, libheif
, libxml2
, gnome
}:
stdenv.mkDerivation (finalAttrs: {
pname = "glycin-loaders";
version = "0.1.beta.2";
src = fetchurl {
url = "mirror://gnome/sources/glycin-loaders/${lib.versions.majorMinor finalAttrs.version}/glycin-loaders-${finalAttrs.version}.tar.xz";
hash = "sha256-GwxwHzMDVFWJTfmK/CEoICSLExJyuDv72/g1EOGciBM=";
};
patches = [
# Fix paths in glycin library.
# Not actually needed for this package since we are only building loaders
# and this patch is relevant just to apps that use the loaders
# but apply it here to ensure the patch continues to apply.
finalAttrs.passthru.glycinPathsPatch
];
nativeBuildInputs = [
cargo
git
meson
ninja
pkg-config
rustc
];
buildInputs = [
gtk4 # for GdkTexture
cairo
libheif
libxml2 # for librsvg crate
];
passthru = {
updateScript = gnome.updateScript {
packageName = "glycin-loaders";
};
glycinPathsPatch = substituteAll {
src = ./fix-glycin-paths.patch;
bwrap = "${bubblewrap}/bin/bwrap";
};
};
meta = with lib; {
description = "Glycin loaders for several formats";
homepage = "https://gitlab.gnome.org/sophie-h/glycin";
maintainers = teams.gnome.members;
license = licenses.lgpl21Only;
platforms = platforms.linux;
};
})