Re: [update] graphics/scrot 0.8 to 1.4

2021-01-23 Thread Stefan Hagen
Stefan Hagen wrote:
> Stefan Hagen wrote:
>> Scrots new home:
>> https://github.com/resurrecting-open-source-projects/scrot
>
> It's probably relevant to say that this new upstream is also used
> by Debian, Arch and FreeBSD (I did not check others).
>
> Here is an updated patch with the following additions:
>
>+ added pledge similiar to solenes scrot update in 2019
>+ removed -g cflag
>+ subst /usr/X11R6 with ${X11BASE} in Makefile.am

I've sent a fix upstream to unbreak scrot on sparc64
https://github.com/resurrecting-open-source-projects/scrot/pull/64

The diff again with the fix included  and sorry for the noise :/

Index: graphics/scrot/Makefile
===
RCS file: /cvs/ports/graphics/scrot/Makefile,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 Makefile
--- graphics/scrot/Makefile 12 Jul 2019 20:47:10 -  1.17
+++ graphics/scrot/Makefile 23 Jan 2021 16:56:31 -
@@ -2,25 +2,29 @@
 
 COMMENT=   commandline screen capture util
 
-DISTNAME=  scrot-0.8
-REVISION = 4
-CATEGORIES=graphics
+GH_ACCOUNT =   resurrecting-open-source-projects
+GH_PROJECT =   scrot
+GH_TAGNAME =   1.4
 
-HOMEPAGE=  http://www.linuxbrit.co.uk/scrot/
+CATEGORIES =   graphics
+
+HOMEPAGE=  
https://github.com/resurrecting-open-source-projects/scrot
 
 # BSD
 PERMIT_PACKAGE=Yes
 
-WANTLIB=   X11 Xext c freetype m z \
-   giblib>=1 Imlib2>=1
-
-MASTER_SITES=  http://www.linuxbrit.co.uk/downloads/
+# pledge
+WANTLIB =  c m Imlib2 giblib X11 Xcomposite Xfixes
 
-LIB_DEPENDS=devel/giblib \
+LIB_DEPENDS =  devel/giblib \
graphics/imlib2
 
-CONFIGURE_STYLE=   gnu
+AUTOMAKE_VERSION = 1.16
+AUTOCONF_VERSION = 2.69
+
+AUTORECONF =   sh autogen.sh
+CONFIGURE_STYLE=   autoreconf
 
-FAKE_FLAGS+=   docsdir=${PREFIX}/share/doc/scrot/
+BUILD_DEPENDS =devel/autoconf-archive
 
 .include 
Index: graphics/scrot/distinfo
===
RCS file: /cvs/ports/graphics/scrot/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- graphics/scrot/distinfo 18 Jan 2015 03:14:14 -  1.4
+++ graphics/scrot/distinfo 23 Jan 2021 16:56:31 -
@@ -1,2 +1,2 @@
-SHA256 (scrot-0.8.tar.gz) = YT0c9STCtizjxl8SMupPBcfa8kjV6C/ypoksmAk5lPI=
-SIZE (scrot-0.8.tar.gz) = 74324
+SHA256 (scrot-1.4.tar.gz) = 4Z7sabzcJJkXxFInDhyPKBiAA7BSw1LiWZmygcsDUQw=
+SIZE (scrot-1.4.tar.gz) = 157779
Index: graphics/scrot/patches/patch-Makefile_am
===
RCS file: graphics/scrot/patches/patch-Makefile_am
diff -N graphics/scrot/patches/patch-Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ graphics/scrot/patches/patch-Makefile_am23 Jan 2021 16:56:31 -
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: Makefile.am
+--- Makefile.am.orig
 Makefile.am
+@@ -31,8 +31,8 @@ AUTOMAKE_OPTIONS = 1.4 foreign
+ # A list of all the files in the current directory which can be regenerated
+ MAINTAINERCLEANFILES = Makefile.in
+ 
+-AM_LDFLAGS= -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib
+-AM_CPPFLAGS   = -I/usr/X11R6/include \
++AM_LDFLAGS= -L${X11BASE}/lib -L/usr/lib -L/usr/local/lib
++AM_CPPFLAGS   = -I${X11BASE}/include \
+ $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I.
+ 
+ man_MANS = man/scrot.1
Index: graphics/scrot/patches/patch-src_Makefile_am
===
RCS file: graphics/scrot/patches/patch-src_Makefile_am
diff -N graphics/scrot/patches/patch-src_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ graphics/scrot/patches/patch-src_Makefile_am23 Jan 2021 16:56:31 
-
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+no need for debug symbols
+
+Index: src/Makefile.am
+--- src/Makefile.am.orig
 src/Makefile.am
+@@ -28,7 +28,7 @@
+ MAINTAINERCLEANFILES = Makefile.in
+ 
+ AM_LDFLAGS= -L/usr/X11R6/lib
+-AM_CPPFLAGS   = -g -O3 -Wall -I/usr/X11R6/include \
++AM_CPPFLAGS   = -O3 -Wall -I/usr/X11R6/include \
+ $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I. \
+ -DPREFIX=\""$(prefix)"\" @GIBLIB_CFLAGS@
+ LIBOBJS = @LIBOBJS@
Index: graphics/scrot/patches/patch-src_Makefile_in
===
RCS file: graphics/scrot/patches/patch-src_Makefile_in
diff -N graphics/scrot/patches/patch-src_Makefile_in
--- graphics/scrot/patches/patch-src_Makefile_in8 Jul 2011 11:25:47 
-   1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,44 +0,0 @@
-$OpenBSD: patch-src_Makefile_in,v 1.2 2011/07/08 11:25:47 jasper Exp $
 src/Makefile.in.orig   Mon Jun 23 14:13:34 2003
-+++ src/Makefile.inFri Jul  8 13:22:30 2011
-@@ -73,13 +73,13 @@ VERSION = @VERSION@
- 
- 

Re: [update] graphics/scrot 0.8 to 1.4

2021-01-23 Thread Stefan Hagen
Stefan Hagen wrote:
> Scrots new home:
> https://github.com/resurrecting-open-source-projects/scrot

It's probably relevant to say that this new upstream is also used
by Debian, Arch and FreeBSD (I did not check others).

Here is an updated patch with the following additions:

+ added pledge similiar to solenes scrot update in 2019
+ removed -g cflag
+ subst /usr/X11R6 with ${X11BASE} in Makefile.am

Note: I'm not super comfortable yet with selecting pledge promises.
I removed all promises and then ktraced the command below and added
pledge promises according to the trace output.

scrot '%Y-%m-%d_$wx$h-TEST.png' \
-e 'mv $f ~/work/' -s -d 2 -f -c -b -l style=dash,width=3,color="red" \
-p -o -n "-f '~/.fonts/AnonymiceNerdFontComplete.ttf/24'

I think this command should tick all boxes and I ended up with the same
set of promises as solene did. So I assume I did it right.

Best Regards,
Stefan

Index: graphics/scrot/Makefile
===
RCS file: /cvs/ports/graphics/scrot/Makefile,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 Makefile
--- graphics/scrot/Makefile 12 Jul 2019 20:47:10 -  1.17
+++ graphics/scrot/Makefile 23 Jan 2021 10:01:58 -
@@ -2,25 +2,29 @@
 
 COMMENT=   commandline screen capture util
 
-DISTNAME=  scrot-0.8
-REVISION = 4
-CATEGORIES=graphics
+GH_ACCOUNT =   resurrecting-open-source-projects
+GH_PROJECT =   scrot
+GH_TAGNAME =   1.4
 
-HOMEPAGE=  http://www.linuxbrit.co.uk/scrot/
+CATEGORIES =   graphics
+
+HOMEPAGE=  
https://github.com/resurrecting-open-source-projects/scrot
 
 # BSD
 PERMIT_PACKAGE=Yes
 
-WANTLIB=   X11 Xext c freetype m z \
-   giblib>=1 Imlib2>=1
-
-MASTER_SITES=  http://www.linuxbrit.co.uk/downloads/
+# pledge
+WANTLIB =  c m Imlib2 giblib X11 Xcomposite Xfixes
 
-LIB_DEPENDS=devel/giblib \
+LIB_DEPENDS =  devel/giblib \
graphics/imlib2
 
-CONFIGURE_STYLE=   gnu
+AUTOMAKE_VERSION = 1.16
+AUTOCONF_VERSION = 2.69
+
+AUTORECONF =   sh autogen.sh
+CONFIGURE_STYLE=   autoreconf
 
-FAKE_FLAGS+=   docsdir=${PREFIX}/share/doc/scrot/
+BUILD_DEPENDS =devel/autoconf-archive
 
 .include 
Index: graphics/scrot/distinfo
===
RCS file: /cvs/ports/graphics/scrot/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- graphics/scrot/distinfo 18 Jan 2015 03:14:14 -  1.4
+++ graphics/scrot/distinfo 23 Jan 2021 10:01:58 -
@@ -1,2 +1,2 @@
-SHA256 (scrot-0.8.tar.gz) = YT0c9STCtizjxl8SMupPBcfa8kjV6C/ypoksmAk5lPI=
-SIZE (scrot-0.8.tar.gz) = 74324
+SHA256 (scrot-1.4.tar.gz) = 4Z7sabzcJJkXxFInDhyPKBiAA7BSw1LiWZmygcsDUQw=
+SIZE (scrot-1.4.tar.gz) = 157779
Index: graphics/scrot/patches/patch-Makefile_am
===
RCS file: graphics/scrot/patches/patch-Makefile_am
diff -N graphics/scrot/patches/patch-Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ graphics/scrot/patches/patch-Makefile_am23 Jan 2021 10:01:58 -
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: Makefile.am
+--- Makefile.am.orig
 Makefile.am
+@@ -31,8 +31,8 @@ AUTOMAKE_OPTIONS = 1.4 foreign
+ # A list of all the files in the current directory which can be regenerated
+ MAINTAINERCLEANFILES = Makefile.in
+ 
+-AM_LDFLAGS= -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib
+-AM_CPPFLAGS   = -I/usr/X11R6/include \
++AM_LDFLAGS= -L${X11BASE}/lib -L/usr/lib -L/usr/local/lib
++AM_CPPFLAGS   = -I${X11BASE}/include \
+ $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I.
+ 
+ man_MANS = man/scrot.1
Index: graphics/scrot/patches/patch-src_Makefile_am
===
RCS file: graphics/scrot/patches/patch-src_Makefile_am
diff -N graphics/scrot/patches/patch-src_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ graphics/scrot/patches/patch-src_Makefile_am23 Jan 2021 10:01:58 
-
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+no need for debug symbols
+
+Index: src/Makefile.am
+--- src/Makefile.am.orig
 src/Makefile.am
+@@ -28,7 +28,7 @@
+ MAINTAINERCLEANFILES = Makefile.in
+ 
+ AM_LDFLAGS= -L/usr/X11R6/lib
+-AM_CPPFLAGS   = -g -O3 -Wall -I/usr/X11R6/include \
++AM_CPPFLAGS   = -O3 -Wall -I/usr/X11R6/include \
+ $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I. \
+ -DPREFIX=\""$(prefix)"\" @GIBLIB_CFLAGS@
+ LIBOBJS = @LIBOBJS@
Index: graphics/scrot/patches/patch-src_Makefile_in
===
RCS file: graphics/scrot/patches/patch-src_Makefile_in
diff -N graphics/scrot/patches/patch-src_Makefile_in
--- graphics/scrot/patches/patch-src_Makefile_in8 Jul 2011 11:25:47 
-   1.2
+++ 

[update] graphics/scrot 0.8 to 1.4

2021-01-21 Thread Stefan Hagen
Hello,

I noticed that the screenshot utility graphics/scrot is pretty old and
missing some options people on IRC were asking for. So I looked at it.

The upstream site vanished. There is an active github repository run by
volunteers and that's where scrot seems to be maintained now.

Scrots new home:
https://github.com/resurrecting-open-source-projects/scrot


# Port changes:
- changed upstream to github
- bump version to 1.4
- removed revision
- switched configure style from gnu to autoreconf
- removed wantlib: Xext freetype z
- added  wantlib: Xcomposite Xfixes
- new build_dep: devel/autoconf-archive
- two patches removed (included upstream)
- fixed memset(sizeof(ptr)) in patches/patch-src_options_c

The old scrot has put the README, AUTHORS, TODO and Changelog files in
the doc directory. The upstream install target is not doing so anymore.
This is fine for me. Besides the changelog, there's nothing of value in
those files.

Q: The AUTOMAKE_VERSION and AUTOCONF_VERSION are guesswork. I know
that the oldest autoconf version that works is 2.63. What version is
advisable to set in ports when upstream does not specify one?
(The porter handbook sais this should be obvious when looking at the
configure[.ac?] file. Not obvious to me... any pointers?)


# Tests performed:
- portcheck: ok
- port-lib-depends-check: ok
- Builds on amd64

There is no test suite, so I did some screenshots and tested the -s and
-o flag as well as the more complex examples in the manpage. My tests
all worked. One more person on IRC did some tests as well and found it
working.


# Changelog: (only code related changes here)
Version 1.4
  * Fix SIGSEGV, if running without DISPLAY environment variable.
  * Removed libXcursor references.
  * Using create-man.sh 2.0 from txt2man package from Debian.
  * Call XCloseDisplay on exit. This is the right thing in every X
server program, to release acquired resources. * Fixed autoselect.
  * Fixed capturing partially hidden windows on the edge of the desktop.
  * Fixed required number.
  * Fixed SIGSEGV, option --note.
  * Minor fix: variable is assigned that is never used.
  * New Feature: capture stack/overlapping windows. Depends of libXcomposite
(X11). New option: --stack or -k.
  * Stack windows: client list spec EWMH.

Version 1.3
  * Added delay option to autoselect.
  * Fixed bug #39, mouse pointer not captured with -a -p options.
  * Added -D option to specify the display to use.

Version 1.2
  * Changed the cursor to indicate the selection mode.
  * Fixed GCC >=8.0 warning: -Wstringop-truncation.
  * Evaluate return of strftime.
  * Fixes ambiguous else warning by providing proper braces for if in
src/getopt.c.
  * Fixed missing warnings.

Version 1.1
  * Added (-n, --note) to draw a text.
  * Added (-l, --line) to define the line to use to select an area to capture.
  * Added a specifier ($a) to embed hostname in output file.
  * Added a check for autoconf-archive presence in configure.ac.
  * Adjusted Makefile.am to remove src/scrot_config.h when distclean.

Version 1.0
  * Added EXIT_FAILURE when are no arguments required by some options. Fix
Debian bug #685173.
  * Added option: --overwrite or -o. Now, by default do not overwrite the file.
Fix Debian bug #807139.
  * Added support to grab mouse pointer (-p option). Fix Ubuntu bug #1698375.
  * Added support to freeze the screen when selection is activated (-f option).
  * Do not use gib_eprintf in calls to X11 functions. Fix Ubuntu bug #1523212.
  * Fix: scrot can't save files without extension. Fix Ubuntu bug #148659.
  * Fix: scrot don't complain about invalid numeric argument. Fix Ubuntu 
bug #371784.
  * Fixed some compiling warnings.

OK?

Best Regards,
Stefan

Index: graphics/scrot/Makefile
===
RCS file: /cvs/ports/graphics/scrot/Makefile,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 Makefile
--- graphics/scrot/Makefile 12 Jul 2019 20:47:10 -  1.17
+++ graphics/scrot/Makefile 21 Jan 2021 21:49:00 -
@@ -2,25 +2,28 @@
 
 COMMENT=   commandline screen capture util
 
-DISTNAME=  scrot-0.8
-REVISION = 4
-CATEGORIES=graphics
+GH_ACCOUNT =   resurrecting-open-source-projects
+GH_PROJECT =   scrot
+GH_TAGNAME =   1.4
 
-HOMEPAGE=  http://www.linuxbrit.co.uk/scrot/
+CATEGORIES =   graphics
+
+HOMEPAGE=  
https://github.com/resurrecting-open-source-projects/scrot
 
 # BSD
 PERMIT_PACKAGE=Yes
 
-WANTLIB=   X11 Xext c freetype m z \
-   giblib>=1 Imlib2>=1
-
-MASTER_SITES=  http://www.linuxbrit.co.uk/downloads/
+WANTLIB =  c m Imlib2 giblib X11 Xcomposite Xfixes
 
-LIB_DEPENDS=devel/giblib \
+LIB_DEPENDS =  devel/giblib \
graphics/imlib2
 
-CONFIGURE_STYLE=   gnu
+AUTOMAKE_VERSION = 1.16
+AUTOCONF_VERSION =