2021-01-14 11:38:33 +00:00
{ stdenv
, lib
2021-11-14 04:22:23 +00:00
, fetchFromGitLab
, glib
2021-01-14 11:38:33 +00:00
, meson
, ninja
, pkg-config
2022-05-18 05:02:06 +00:00
, wrapGAppsHook4
2022-12-09 17:03:06 +00:00
, feedbackd
2021-05-11 18:07:20 +00:00
, gtk4
2022-12-09 17:03:06 +00:00
, libepoxy
, xorg
2021-03-11 16:41:47 +00:00
, zbar
2021-01-14 11:38:33 +00:00
, tiffSupport ? true
, libraw
, jpgSupport ? true
2021-03-11 16:41:47 +00:00
, graphicsmagick
2021-01-14 11:38:33 +00:00
, exiftool
} :
assert jpgSupport -> tiffSupport ;
let
inherit ( lib ) makeBinPath optional optionals optionalString ;
runtimePath = makeBinPath (
optional tiffSupport libraw
2021-03-11 16:41:47 +00:00
++ optionals jpgSupport [ graphicsmagick exiftool ]
2021-01-14 11:38:33 +00:00
) ;
in
2024-02-18 09:09:44 +00:00
stdenv . mkDerivation ( finalAttrs : {
2021-01-14 11:38:33 +00:00
pname = " m e g a p i x e l s " ;
2024-05-13 00:51:09 +00:00
version = " 1 . 8 . 2 " ;
2021-01-14 11:38:33 +00:00
2021-11-14 04:22:23 +00:00
src = fetchFromGitLab {
2024-02-12 12:06:24 +00:00
owner = " m e g a p i x e l s - o r g " ;
repo = " M e g a p i x e l s " ;
2024-02-18 09:09:44 +00:00
rev = finalAttrs . version ;
2024-05-13 00:51:09 +00:00
hash = " s h a 2 5 6 - o d s O Y r k / / Z h o d s u m L p J j h P D c w F 1 g k E / n o 1 6 6 u + I D x S Y = " ;
2021-01-14 11:38:33 +00:00
} ;
2021-09-02 21:13:01 +00:00
nativeBuildInputs = [
2021-11-14 04:22:23 +00:00
glib
2021-09-02 21:13:01 +00:00
meson
ninja
pkg-config
2022-05-18 05:02:06 +00:00
wrapGAppsHook4
2021-09-02 21:13:01 +00:00
] ;
2021-01-14 11:38:33 +00:00
2021-05-11 18:07:20 +00:00
buildInputs = [
2022-12-09 17:03:06 +00:00
feedbackd
2021-05-11 18:07:20 +00:00
gtk4
2022-12-09 17:03:06 +00:00
libepoxy
xorg . libXrandr
2021-05-11 18:07:20 +00:00
zbar
] ;
2021-01-14 11:38:33 +00:00
2024-08-27 19:37:05 +00:00
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
] ;
2021-09-02 21:13:01 +00:00
postInstall = ''
glib-compile-schemas $ out/share/glib-2.0/schemas
'' ;
2021-01-14 11:38:33 +00:00
preFixup = optionalString ( tiffSupport || jpgSupport ) ''
gappsWrapperArgs + = (
2022-05-06 16:27:02 +00:00
- - prefix PATH : $ { lib . escapeShellArg runtimePath }
2021-01-14 11:38:33 +00:00
)
'' ;
2024-02-18 09:09:44 +00:00
strictDeps = true ;
2021-01-14 11:38:33 +00:00
meta = with lib ; {
2021-08-05 20:09:01 +00:00
description = " G T K 4 c a m e r a a p p l i c a t i o n t h a t k n o w s h o w t o d e a l w i t h t h e m e d i a r e q u e s t a p i " ;
2024-02-12 12:06:24 +00:00
homepage = " h t t p s : / / g i t l a b . c o m / m e g a p i x e l s - o r g / M e g a p i x e l s " ;
changelog = " h t t p s : / / g i t l a b . c o m / m e g a p i x e l s - o r g / M e g a p i x e l s / - / t a g s / ${ finalAttrs . version } " ;
2021-01-14 11:38:33 +00:00
license = licenses . gpl3Only ;
2024-02-12 11:48:37 +00:00
maintainers = with maintainers ; [ dotlambda Luflosi ] ;
2021-01-14 11:38:33 +00:00
platforms = platforms . linux ;
2024-02-18 09:09:44 +00:00
mainProgram = " m e g a p i x e l s " ;
2021-01-14 11:38:33 +00:00
} ;
2024-02-18 09:09:44 +00:00
} )