Bug 229061 - deskutils/gnome-screenshot: Update to 3.22.0
Summary: deskutils/gnome-screenshot: Update to 3.22.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Carlos J. Puga Medina
URL: https://gitlab.gnome.org/GNOME/gnome-...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-16 02:00 UTC by Carlos J. Puga Medina
Modified: 2018-06-30 18:50 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
patch-gnome-screenshot-3.22.0 (1.69 KB, patch)
2018-06-16 02:00 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch-gnome-screenshot-3.22.0 (12.15 KB, patch)
2018-06-18 09:31 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch-gnome-screenshot-3.22.0 (12.62 KB, patch)
2018-06-18 10:46 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch-gnome-screenshot-3.22.0 (14.01 KB, patch)
2018-06-18 11:08 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch-gnome-screenshot-3.22.0 (14.02 KB, patch)
2018-06-20 15:15 UTC, Carlos J. Puga Medina
no flags Details | Diff
screenshot-issue (613.45 KB, image/png)
2018-06-20 16:00 UTC, Carlos J. Puga Medina
no flags Details
patch-gnome-screenshot-3.22.0 (14.26 KB, patch)
2018-06-23 10:23 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch-gnome-screenshot-3.22.0 (14.22 KB, patch)
2018-06-29 17:48 UTC, Carlos J. Puga Medina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-16 02:00:58 UTC
Created attachment 194290 [details]
patch-gnome-screenshot-3.22.0

- Add LICENSE and LICENSE_FILE
- Register missing dependencies
- Switch to USES=localbase framework
Comment 1 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-18 09:31:45 UTC
Created attachment 194351 [details]
patch-gnome-screenshot-3.22.0

- Add NLS option
Comment 2 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-18 10:46:12 UTC
Created attachment 194352 [details]
patch-gnome-screenshot-3.22.0

- Provide more elaborate port description and add WWW line in pkg-descr
Comment 3 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-18 11:08:06 UTC
Created attachment 194353 [details]
patch-gnome-screenshot-3.22.0

Add patch to fix garbled screenshot when 3D hardware acceleration is enabled.
Comment 4 Ting-Wei Lan 2018-06-20 14:55:38 UTC
Comment on attachment 194353 [details]
patch-gnome-screenshot-3.22.0

>Index: deskutils/gnome-screenshot/Makefile
>===================================================================
>--- deskutils/gnome-screenshot/Makefile	(revision 472678)
>+++ deskutils/gnome-screenshot/Makefile	(working copy)
>@@ -2,7 +2,7 @@
> # $FreeBSD$
> 
> PORTNAME=	gnome-screenshot
>-PORTVERSION=	3.18.0
>+PORTVERSION=	3.22.0

Is there any reason that you want to update it to 3.22.0 instead of the latest 3.26.0 release?

> CATEGORIES=	deskutils gnome
> MASTER_SITES=	GNOME
> DIST_SUBDIR=	gnome3
>@@ -10,17 +10,26 @@
> MAINTAINER=	gnome@FreeBSD.org
> COMMENT=	GNOME 3 utility for making picutures of your screen
> 
>-LIB_DEPENDS=	libcanberra-gtk3.so:audio/libcanberra-gtk3
>+LICENSE=	GPLv2
>+LICENSE_FILE=	${WRKSRC}/COPYING
> 
>+LIB_DEPENDS=	libcanberra-gtk3.so:audio/libcanberra-gtk3 \
>+		libcanberra.so:audio/libcanberra
>+

OK, I found the same change is also committed to the FreeBSD GNOME development repository.

> CONFLICTS=	gnome-utils-2.[0-9]*
> PORTSCOUT=	limitw:1,even
> 
>-USES=		gettext gmake gnome pathfix pkgconfig tar:xz
>-USE_GNOME=	gtk30 intlhack
>+USES=		gettext-tools gmake gnome localbase pathfix pkgconfig tar:xz
>+USE_GNOME=	cairo gdkpixbuf2 gtk30 intlhack
>+USE_XORG=	x11 xext
> GNU_CONFIGURE=	yes
>-CPPFLAGS+=	-I${LOCALBASE}/include
>-LIBS+=		-L${LOCALBASE}/lib
> 
> GLIB_SCHEMAS=	org.gnome.gnome-screenshot.gschema.xml
> 
>+OPTIONS_DEFINE=	NLS
>+OPTIONS_SUB=	yes
>+
>+NLS_USES=		gettext-runtime
>+NLS_CONFIGURE_OFF=	--disable-nls
>+
> .include <bsd.port.mk>

Adding NLS option looks fine, but I think many GNOME ports don't do it. Is there a use case other than saving disk space?

>Index: deskutils/gnome-screenshot/distinfo
>===================================================================
>--- deskutils/gnome-screenshot/distinfo	(revision 472678)
>+++ deskutils/gnome-screenshot/distinfo	(working copy)
>@@ -1,2 +1,3 @@
>-SHA256 (gnome3/gnome-screenshot-3.18.0.tar.xz) = eba64dbf4acf0ab8222fec549d0a4f2dd7dbd51c255e7978dedf1f5c06a98841
>-SIZE (gnome3/gnome-screenshot-3.18.0.tar.xz) = 281752
>+TIMESTAMP = 1529110023
>+SHA256 (gnome3/gnome-screenshot-3.22.0.tar.xz) = 8a05f14b3c7c6cb42f9848ad0332034c7fe5c34a69742910203588fd60b00230
>+SIZE (gnome3/gnome-screenshot-3.22.0.tar.xz) = 258888
>Index: deskutils/gnome-screenshot/files/patch-src_screenshot-utils.c
>===================================================================
>--- deskutils/gnome-screenshot/files/patch-src_screenshot-utils.c	(nonexistent)
>+++ deskutils/gnome-screenshot/files/patch-src_screenshot-utils.c	(working copy)
>@@ -0,0 +1,20 @@
>+--- src/screenshot-utils.c.orig	2016-07-11 14:55:18 UTC
>++++ src/screenshot-utils.c
>+@@ -630,6 +630,9 @@ screenshot_get_pixbuf (GdkRectangle *rec
>+                                      filename);
>+     }
>+ 
>++  if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "GNOME"))
>++      screenshot = screenshot_fallback_get_pixbuf(rectangle);

Why is it needed? Does it mean the builtin screenshot function of GNOME Shell is broken on your system?

>++  else {
>+   connection = g_application_get_dbus_connection (g_application_get_default ());
>+   g_dbus_connection_call_sync (connection,
>+                                "org.gnome.Shell.Screenshot",
>+@@ -659,6 +662,7 @@ screenshot_get_pixbuf (GdkRectangle *rec
>+ 
>+       screenshot = screenshot_fallback_get_pixbuf (rectangle);
>+     }
>++  }
>+ 
>+   g_free (path);
>+   g_free (tmpname);
>
>Property changes on: deskutils/gnome-screenshot/files/patch-src_screenshot-utils.c
>___________________________________________________________________
>Added: fbsd:nokeywords
>## -0,0 +1 ##
>+yes
>\ No newline at end of property
>Added: svn:eol-style
>## -0,0 +1 ##
>+native
>\ No newline at end of property
>Added: svn:mime-type
>## -0,0 +1 ##
>+text/plain
>\ No newline at end of property
>Index: deskutils/gnome-screenshot/pkg-descr
>===================================================================
>--- deskutils/gnome-screenshot/pkg-descr	(revision 472678)
>+++ deskutils/gnome-screenshot/pkg-descr	(working copy)
>@@ -1 +1,4 @@
>-GNOME 3.0 utility for taking pictures of your screen.
>+GNOME Screenshot is a small utility that takes a screenshot of the whole
>+desktop; the currently focused window; or an area of the screen.
>+
>+WWW: https://github.com/GNOME/gnome-screenshot

This link is not correct. GNOME uses its own GitLab instance for development. GitHub is just a read-only mirror.
I think you should put https://gitlab.gnome.org/GNOME/gnome-screenshot here.
Comment 5 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-20 15:15:43 UTC
Created attachment 194430 [details]
patch-gnome-screenshot-3.22.0

- Fix WWW in pkg-descr
Comment 6 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-20 15:26:19 UTC
(In reply to Ting-Wei Lan from comment #4)

Due to missing some up-to-date dependencies at this moment we can update to release 3.22.

Having NLS option doesn't harm and saves some additional space.

I added the patch to fix garbled screenshot when 3D hardware acceleration is enabled (using xf86-video-intel). Tested by me and it works properly.
Comment 7 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-20 15:34:13 UTC
gnome-screenshot works correctly when disabling 3D acceleration. After applying the patch it is no longer necessary.

It seems that it is a known bug:

https://bugs.launchpad.net/ubuntu/+source/gnome-screenshot/+bug/1005914
Comment 8 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-20 16:00:42 UTC
Created attachment 194432 [details]
screenshot-issue
Comment 9 Ting-Wei Lan 2018-06-23 03:17:45 UTC
(In reply to Carlos J. Puga Medina from comment #8)
I tested it on my laptop with GNOME 3.18 installed from pkg. Yes, it sometimes gives me screenshots with missing parts, so there should be a bug.

The patch you provided is not a fix but a workaround. It also looks like a GNOME Shell bug instead of a GNOME Screenshot bug because GNOME Screenshot uses D-Bus API provided by GNOME Shell on GNOME desktop. I believe this bug is already fixed in GNOME Shell upstream, as I cannot reproduce it on upstream master branch. GNOME Shell in FreeBSD ports is outdated and misses a lot of fixes. If you want to search for bug reports related to this issue, it is better to use GNOME Shell as a keyword.

I am not a FreeBSD GNOME maintainer. Personally I prefer a workaround patch to be placed under a non-default option, so it doesn't change the behavior of a program which can confuse users.
Comment 10 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-23 10:23:20 UTC
Created attachment 194532 [details]
patch-gnome-screenshot-3.22.0

Rework how the workaround should be applied.
Comment 11 Ting-Wei Lan 2018-06-27 13:15:49 UTC
Comment on attachment 194532 [details]
patch-gnome-screenshot-3.22.0

>+# Workaround garbled screenshot when 3D hardware acceleration is enabled
>+# via x11-drivers/xf86-video-intel port
>+.if exists(${LOCALBASE}/lib/xorg/modules/drivers/intel_drv.so)
>+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-intel
>+.endif

Do you think it will be better to make it an option which can be discovered and set by users with 'make config'? Having build results depend on the file on the host system is seldom an expected behaviour.
Comment 12 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-29 17:48:56 UTC
Created attachment 194734 [details]
patch-gnome-screenshot-3.22.0

Add INTEL_FIX option.
Comment 13 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-29 17:54:23 UTC
(In reply to Ting-Wei Lan from comment #11)

Yes, I made an option to apply the patch. Any other objection?
Comment 14 Ting-Wei Lan 2018-06-30 06:31:32 UTC
(In reply to Carlos J. Puga Medina from comment #13)
Attachment 194734 [details] looks fine to me. Do you want the workaround patch to be removed when GNOME Shell is upgraded to 3.28 or later releases?
Comment 15 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-06-30 09:09:03 UTC
(In reply to Ting-Wei Lan from comment #14)

Yes, the patch should be removed after upgrading gnome-shell to 3.28
Comment 16 commit-hook freebsd_committer freebsd_triage 2018-06-30 18:48:36 UTC
A commit references this bug:

Author: cpm
Date: Sat Jun 30 18:47:33 UTC 2018
New revision: 473628
URL: https://svnweb.freebsd.org/changeset/ports/473628

Log:
  deskutils/gnome-screenshot: Update to 3.22.0

  - Add LICENSE and LICENSE_FILE
  - Register missing dependencies
  - Switch to USES=localbase framework
  - Add NLS option
  - Add INTEL_FIX option to fix garbled screenshot when 3D hardware acceleration is enabled via x11-drivers/xf86-video-intel port
  - Provide more elaborate port description and add WWW line in pkg-descr

  Changelog: https://gitlab.gnome.org/GNOME/gnome-screenshot/blob/master/NEWS

  PR:		229061
  Submitted by:	cpm
  Reviewed by:	Ting-Wei Lan <lantw44@gmail.com>
  Approved by:	gnome (maintainer timeout, 2 weeks)

Changes:
  head/deskutils/gnome-screenshot/Makefile
  head/deskutils/gnome-screenshot/distinfo
  head/deskutils/gnome-screenshot/files/
  head/deskutils/gnome-screenshot/files/extra-patch-intel
  head/deskutils/gnome-screenshot/pkg-descr
  head/deskutils/gnome-screenshot/pkg-plist