Merge pull request #132565 from Artturin/shutter

This commit is contained in:
Sandro 2021-08-04 16:49:27 +02:00 committed by GitHub
commit 3a0047ac27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 109 additions and 31 deletions

View file

@ -1,39 +1,103 @@
{ lib, stdenv, fetchurl, perlPackages, makeWrapper, imagemagick, gdk-pixbuf, librsvg
, hicolor-icon-theme, procps
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
, wrapGAppsHook
, imagemagick
, gdk-pixbuf
, librsvg
, hicolor-icon-theme
, procps
, libwnck
, libappindicator-gtk3
}:
let
perlModules = with perlPackages;
[ Gnome2 Gnome2Canvas Gtk2 Glib Pango Gnome2VFS Gnome2Wnck Gtk2ImageView
Gtk2Unique FileBaseDir FileWhich FileCopyRecursive XMLSimple NetDBus XMLTwig
XMLParser HTTPMessage ProcSimple SortNaturally LocaleGettext
ProcProcessTable URI ImageExifTool Gtk2AppIndicator LWP JSON
ImageMagick WWWMechanize HTTPDate HTMLForm HTMLParser HTMLTagset JSONMaybeXS
commonsense HTTPCookies NetOAuth PathClass GooCanvas X11Protocol Cairo
EncodeLocale TryTiny TypesSerialiser LWPMediaTypes
perlModules = with perlPackages; [
# Not sure if these are needed
# Gnome2 Gnome2Canvas Gnome2VFS Gtk2AppIndicator Gtk2Unique
ImageMagick
Cairo
FileBaseDir
FileWhich
FileCopyRecursive
XMLSimple
XMLTwig
XMLParser
SortNaturally
LocaleGettext
ProcProcessTable
X11Protocol
ProcSimple
ImageExifTool
JSON
JSONMaybeXS
NetOAuth
PathClass
LWP
LWPProtocolHttps
NetDBus
TryTiny
WWWMechanize
HTTPMessage
HTTPDate
HTMLForm
HTMLParser
HTMLTagset
HTTPCookies
EncodeLocale
URI
CarpAlways
GlibObjectIntrospection
NumberBytesHuman
CairoGObject
Readonly
Gtk3ImageView
Gtk3
Glib
Pango
GooCanvas2
GooCanvas2CairoTypes
commonsense
TypesSerialiser
];
in
stdenv.mkDerivation {
name = "shutter-0.94.3";
stdenv.mkDerivation rec {
pname = "shutter";
version = "0.97";
src = fetchurl {
url = "https://launchpad.net/shutter/0.9x/0.94.3/+download/shutter-0.94.3.tar.gz";
sha256 = "01wv5k6zqfqa2rss461lpdpjxpfk4awzfdc6j2qk6bh4g4zgmgl5";
src = fetchFromGitHub {
owner = "shutter-project";
repo = "shutter";
rev = "v${version}";
sha256 = "sha256-/2eQLJJZP0ArQUrxcFdogv/4wy+O021hODkJYLQmLY8=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perlPackages.perl procps gdk-pixbuf librsvg ] ++ perlModules;
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs = [
perlPackages.perl
procps
gdk-pixbuf
librsvg
libwnck
libappindicator-gtk3
] ++ perlModules;
installPhase = ''
mkdir -p "$out"
cp -a . "$out"
(cd "$out" && mv CHANGES README COPYING "$out/share/doc/shutter")
makeFlags = [
"prefix=${placeholder "out"}"
];
wrapProgram $out/bin/shutter \
--set PERL5LIB "${perlPackages.makePerlPath perlModules}" \
--prefix PATH : "${imagemagick.out}/bin" \
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
postPatch = ''
patchShebangs po2mo.sh
'';
preFixup = ''
gappsWrapperArgs+=(
--set PERL5LIB ${perlPackages.makePerlPath perlModules} \
--prefix PATH : ${lib.makeBinPath [ imagemagick ] } \
--suffix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
--set GDK_PIXBUF_MODULE_FILE $GDK_PIXBUF_MODULE_FILE
)
'';
meta = with lib; {

View file

@ -9008,6 +9008,20 @@ let
};
};
GooCanvas2CairoTypes = buildPerlPackage rec {
pname = "GooCanvas2-CairoTypes";
version = "0.001";
src = fetchurl {
url = "mirror://cpan/authors/id/A/AS/ASOKOLOV/GooCanvas2-CairoTypes-${version}.tar.gz";
sha256 = "sha256-uoBnNuvMnePYFBp2Omgr3quxy4cCveKZrf1XSs6HUFI=";
};
propagatedBuildInputs = [ pkgs.goocanvas2 Gtk3 ];
meta = {
description = "Bridge between GooCanvas2 and Cairo types";
license = with lib.licenses; [ artistic1 gpl1Plus ];
};
};
GoogleProtocolBuffers = buildPerlPackage {
pname = "Google-ProtocolBuffers";
version = "0.12";
@ -9237,16 +9251,16 @@ let
};
};
Gtk3ImageView = buildPerlPackage {
Gtk3ImageView = buildPerlPackage rec {
pname = "Gtk3-ImageView";
version = "6";
version = "9";
src = fetchurl {
url = "mirror://cpan/authors/id/R/RA/RATCLIFFE/Gtk3-ImageView-6.tar.gz";
sha256 = "0krkif9i3hrgjdskw05pcks40fmb43d21lxf4h8aclv0g8z647f0";
url = "mirror://cpan/authors/id/A/AS/ASOKOLOV/Gtk3-ImageView-${version}.tar.gz";
sha256 = "sha256-0dxe0p1UQglq+xok7g4l2clJ9WqOHxCeAzWD65E0H9w=";
};
buildInputs = [ pkgs.gtk3 ];
propagatedBuildInputs = [ Readonly Gtk3 ];
checkInputs = [ TestDifferences ImageMagick TryTiny TestMockObject CarpAlways pkgs.librsvg ];
checkInputs = [ TestDifferences TestDeep ImageMagick TryTiny TestMockObject CarpAlways pkgs.librsvg ];
checkPhase = ''
${pkgs.xvfb-run}/bin/xvfb-run -s '-screen 0 800x600x24' \
make test