postprocessd: init at 0.3.0 (#338795)

This commit is contained in:
Matthew Croughan 2024-11-06 12:56:31 +00:00 committed by GitHub
commit 7845645928
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 86 additions and 0 deletions

View File

@ -54,6 +54,12 @@ stdenv.mkDerivation (finalAttrs: {
zbar zbar
]; ];
patches = [
# In the settings menu of Megapixels the user can select a different postprocessing script. The path to the script is then stored in a dconf setting. If the path changes, for example because it is in the Nix store and a dependency of the postprocessor changes, Megapixels will try to use this now non-existing old path. This will cause Megapixels to not save any images that were taken until the user opens the settings again and selects a postprocessor again. Using a global path allows the setting to keep working.
# Note that this patch only fixes the issue for external postprocessors like postprocessd but the postprocessor script that comes with Megapixels is still refered to by the Nix store path.
./search-for-postprocessors-in-NixOS-specific-global-location.patch
];
postInstall = '' postInstall = ''
glib-compile-schemas $out/share/glib-2.0/schemas glib-compile-schemas $out/share/glib-2.0/schemas
''; '';

View File

@ -0,0 +1,27 @@
--- a/src/process_pipeline.c
+++ b/src/process_pipeline.c
@@ -179,10 +179,10 @@ mp_process_find_all_processors(GtkListStore *store)
store, &iter, 0, buffer, 1, "(built-in) postprocess.sh", -1);
}
- // Find extra packaged postprocessor scripts
- // These should be packaged in
- // /usr/share/megapixels/postprocessor.d/executable
- sprintf(buffer, "%s/megapixels/postprocessor.d", DATADIR);
+ // Find extra system postprocessor scripts
+ // These should be accessible in
+ // /run/current-system/sw/share/megapixels/postprocessor.d/executable
+ sprintf(buffer, "/run/current-system/sw/share/megapixels/postprocessor.d");
DIR *d;
struct dirent *dir;
d = opendir(buffer);
@@ -192,8 +192,7 @@ mp_process_find_all_processors(GtkListStore *store)
continue;
}
sprintf(buffer,
- "%s/megapixels/postprocessor.d/%s",
- DATADIR,
+ "/run/current-system/sw/share/megapixels/postprocessor.d/%s",
dir->d_name);
gtk_list_store_insert(store, &iter, -1);
gtk_list_store_set(

View File

@ -0,0 +1,53 @@
{
lib,
fetchFromSourcehut,
libexif,
libraw,
meson,
ninja,
opencv4,
pkg-config,
scdoc,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "postprocessd";
version = "0.3.0";
src = fetchFromSourcehut {
owner = "~martijnbraam";
repo = "postprocessd";
rev = finalAttrs.version;
hash = "sha256-xqEjjAv27TUrEU/5j8Um7fTFjmIYZovyJCccbtHPuGo=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
scdoc
];
depsBuildBuild = [
pkg-config
];
buildInputs = [
libexif
libraw
opencv4
];
strictDeps = true;
meta = {
description = "Queueing megapixels post-processor";
homepage = "https://git.sr.ht/~martijnbraam/postprocessd";
changelog = "https://git.sr.ht/~martijnbraam/postprocessd/refs/${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ Luflosi ];
platforms = lib.platforms.linux;
mainProgram = "postprocess-single";
};
})