Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postprocessd: init at 0.3.0 #338795

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkgs/by-name/me/megapixels/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ stdenv.mkDerivation (finalAttrs: {
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 = ''
glib-compile-schemas $out/share/glib-2.0/schemas
'';
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
53 changes: 53 additions & 0 deletions pkgs/by-name/po/postprocessd/package.nix
Original file line number Diff line number Diff line change
@@ -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";
};
})