diff --git a/pkgs/applications/graphics/snapshot/default.nix b/pkgs/applications/graphics/snapshot/default.nix index d05bfe3e349b..419f58095600 100644 --- a/pkgs/applications/graphics/snapshot/default.nix +++ b/pkgs/applications/graphics/snapshot/default.nix @@ -1,9 +1,12 @@ { stdenv , lib , fetchurl +, glycin-loaders , cargo , desktop-file-utils +, jq , meson +, moreutils , ninja , pkg-config , rustc @@ -12,23 +15,31 @@ , gst_all_1 , gtk4 , libadwaita +, libseccomp , pipewire , gnome }: stdenv.mkDerivation (finalAttrs: { pname = "snapshot"; - version = "46.3"; + version = "47.beta"; src = fetchurl { url = "mirror://gnome/sources/snapshot/${lib.versions.major finalAttrs.version}/snapshot-${finalAttrs.version}.tar.xz"; - hash = "sha256-RZV6BBX0VNY1MUkaoEeVzuDO1O3d1dj6DQAPXvBzW2c="; + hash = "sha256-0GxnNFes1huSi4pPZKC7S587QrTAOuOehzd2jZPRRrw="; }; + patches = [ + # Fix paths in glycin library + glycin-loaders.passthru.glycinPathsPatch + ]; + nativeBuildInputs = [ cargo desktop-file-utils + jq meson + moreutils # sponge is used in postPatch ninja pkg-config rustc @@ -40,16 +51,29 @@ stdenv.mkDerivation (finalAttrs: { gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-rs # for gtk4paintablesink gst_all_1.gstreamer gtk4 libadwaita + libseccomp pipewire # for device provider ]; + postPatch = '' + # Replace hash of file we patch in vendored glycin. + jq \ + --arg hash "$(sha256sum vendor/glycin/src/sandbox.rs | cut -d' ' -f 1)" \ + '.files."src/sandbox.rs" = $hash' \ + vendor/glycin/.cargo-checksum.json \ + | sponge vendor/glycin/.cargo-checksum.json + ''; + preFixup = '' gappsWrapperArgs+=( # vp8enc preset --prefix GST_PRESET_PATH : "${gst_all_1.gst-plugins-good}/share/gstreamer-1.0/presets" + # See https://gitlab.gnome.org/sophie-h/glycin/-/blob/0.1.beta.2/glycin/src/config.rs#L44 + --prefix XDG_DATA_DIRS : "${glycin-loaders}/share" ) '';