Created attachment 194290 [details] patch-gnome-screenshot-3.22.0 - Add LICENSE and LICENSE_FILE - Register missing dependencies - Switch to USES=localbase framework
Created attachment 194351 [details] patch-gnome-screenshot-3.22.0 - Add NLS option
Created attachment 194352 [details] patch-gnome-screenshot-3.22.0 - Provide more elaborate port description and add WWW line in pkg-descr
Created attachment 194353 [details] patch-gnome-screenshot-3.22.0 Add patch to fix garbled screenshot when 3D hardware acceleration is enabled.
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.
Created attachment 194430 [details] patch-gnome-screenshot-3.22.0 - Fix WWW in pkg-descr
(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.
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
Created attachment 194432 [details] screenshot-issue
(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.
Created attachment 194532 [details] patch-gnome-screenshot-3.22.0 Rework how the workaround should be applied.
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.
Created attachment 194734 [details] patch-gnome-screenshot-3.22.0 Add INTEL_FIX option.
(In reply to Ting-Wei Lan from comment #11) Yes, I made an option to apply the patch. Any other objection?
(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?
(In reply to Ting-Wei Lan from comment #14) Yes, the patch should be removed after upgrading gnome-shell to 3.28
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