Klemens Nanni writes:
> On Mon, Nov 06, 2017 at 02:21:41AM +0100, Klemens Nanni wrote:
> > Hey ports@,
> > 
> > here's a simple diff updating sxiv to the newest release; Yes, upstream
> > jumped from 2.3.1 to 24 not 2.4. These are mostly mechanical changes,
> > I've also updated the description as upstream did.
> > (snip)
> > -MAKE_FLAGS =       CC=${CC} MANPREFIX=${PREFIX}/man \
> > -           CFLAGS="${CFLAGS} -I${X11BASE}/include -I${PREFIX}/include" \
> > -           LDFLAGS="-L${PREFIX}/lib -L${X11BASE}/lib -lX11 -lImlib2 -lexif
>  -lgif"
> > +MAKE_FLAGS =       CC=${CC} \
> > +           PREFIX=${PREFIX} \

No need to set PREFIX.
Also, I set V=1 so we can actually see the compiler commands.

> > +           CFLAGS="${CFLAGS} -I${X11BASE}/include -I${X11BASE}/include/fre
> etype2 -I${LOCALBASE}/include -I${LOCALBASE}/include/inotify" \
> > +           LDFLAGS="${LDFLAGS} -L${X11BASE}/lib -L${LOCALBASE}/lib -L${LOC
> ALBASE}/lib/inotify -lX11 -lXft -lImlib2 -lexif -linotify -lgif -Wl,-rpath ${
> LOCALBASE}/lib/inotify"

Couple things. Existing LDFLAGS don't need to be passed to LDFLAGS,
because unlike CFLAGS it's not a standard variable likely to be in
mk.conf. Also, sxiv uses LDLIBS for the -l chain so we don't have to
repeat it.

> >  post-install:
> > -   cd ${WRKSRC}/icon && make install
> > +   make -C ${WRKSRC}/icon install

No need for a cosmetic change like this...


Here's a (very) slightly modified version of your diff per above. I
don't understand the inotify stuff, but it matches what existing ports
do, so...

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/sxiv/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- Makefile    6 May 2017 13:45:49 -0000       1.10
+++ Makefile    21 Nov 2017 08:39:17 -0000
@@ -1,11 +1,10 @@
 # $OpenBSD: Makefile,v 1.10 2017/05/06 13:45:49 fcambus Exp $
 
-COMMENT =      simple (or small or suckless) X Image Viewer
+COMMENT =      simple X Image Viewer
 
 GH_PROJECT =   sxiv
 GH_ACCOUNT =   muennich
-GH_TAGNAME =   v1.3.2
-REVISION =     0
+GH_TAGNAME =   v24
 
 CATEGORIES =   graphics x11
 
@@ -14,17 +13,20 @@ MAINTAINER =        Matthew Via <via@matthewvia
 # GPLv2+
 PERMIT_PACKAGE_CDROM =         Yes
 
-WANTLIB +=     Imlib2 exif gif X11 c
+WANTLIB +=     Imlib2 X11 Xft c exif gif lib/inotify/inotify
 
 RUN_DEPENDS =  devel/desktop-file-utils \
                x11/gtk+3,-guic
 
-LIB_DEPENDS =  graphics/imlib2 \
+LIB_DEPENDS =  devel/libinotify \
+               graphics/imlib2 \
                graphics/libexif
 
-MAKE_FLAGS =   CC=${CC} MANPREFIX=${PREFIX}/man \
-               CFLAGS="${CFLAGS} -I${X11BASE}/include -I${PREFIX}/include" \
-               LDFLAGS="-L${PREFIX}/lib -L${X11BASE}/lib -lX11 -lImlib2 -lexif 
-lgif"
+MAKE_FLAGS =   CC="${CC}" \
+               V=1 \
+               MANPREFIX=${PREFIX}/man \
+               CFLAGS="${CFLAGS} -I${X11BASE}/include 
-I${X11BASE}/include/freetype2 -I${LOCALBASE}/include 
-I${LOCALBASE}/include/inotify" \
+               LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib 
-L${LOCALBASE}/lib/inotify -linotify -Wl,-rpath ${LOCALBASE}/lib/inotify"
 
 NO_TEST =      Yes
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/sxiv/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo    24 Dec 2015 21:54:09 -0000      1.5
+++ distinfo    21 Nov 2017 08:39:17 -0000
@@ -1,2 +1,2 @@
-SHA256 (sxiv-1.3.2.tar.gz) = n1No3o8PV+eOvgLLUxoxEHqZPydpzsUbzI1w9cZotlM=
-SIZE (sxiv-1.3.2.tar.gz) = 46560
+SHA256 (sxiv-24.tar.gz) = UR3EXRKWKvnDHDBozmvKS4MqYmOUaye+/qSaSM8BkRA=
+SIZE (sxiv-24.tar.gz) = 47148
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/graphics/sxiv/patches/patch-Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile
--- patches/patch-Makefile      24 Dec 2015 21:54:09 -0000      1.4
+++ patches/patch-Makefile      21 Nov 2017 08:39:17 -0000
@@ -1,53 +1,31 @@
 $OpenBSD: patch-Makefile,v 1.4 2015/12/24 21:54:09 mmcc Exp $
---- Makefile.orig      Sun Dec 20 07:21:25 2015
-+++ Makefile   Wed Dec 23 20:01:02 2015
-@@ -11,11 +11,11 @@ LIBS      := -lX11 -lImlib2
- 
- # optional dependencies:
- # giflib: gif animations
--      CPPFLAGS += -DHAVE_GIFLIB
--      LIBS     += -lgif
-+CPPFLAGS += -DHAVE_GIFLIB
-+LIBS     += -lgif
- # libexif: jpeg auto-orientation, exif thumbnails
--      CPPFLAGS += -DHAVE_LIBEXIF
--      LIBS     += -lexif
-+CPPFLAGS += -DHAVE_LIBEXIF
-+LIBS     += -lexif
- 
- 
- .PHONY: clean install uninstall
-@@ -30,7 +30,7 @@ $(OBJ): Makefile
- 
- -include $(DEP)
- 
--%.o: %.c
-+.c.o:
-       $(CC) $(CFLAGS) $(CPPFLAGS) -DVERSION=\"$(VERSION)\" -MMD -MP -c -o $@ 
$<
- 
- config.h:
-@@ -43,15 +43,15 @@ clean:
-       rm -f $(OBJ) $(DEP) sxiv
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -60,19 +60,13 @@ clean:
+       rm -f *.o sxiv
  
  install: all
+-      @echo "INSTALL bin/sxiv"
 -      mkdir -p $(DESTDIR)$(PREFIX)/bin
 -      cp sxiv $(DESTDIR)$(PREFIX)/bin/
 -      chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv
+-      @echo "INSTALL sxiv.1"
 -      mkdir -p $(DESTDIR)$(MANPREFIX)/man1
--      sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 > 
$(DESTDIR)$(MANPREFIX)/man1/sxiv.1
+-      sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 \
+-              >$(DESTDIR)$(MANPREFIX)/man1/sxiv.1
 -      chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
+-      @echo "INSTALL share/sxiv/"
 -      mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec
 -      cp exec/* $(DESTDIR)$(PREFIX)/share/sxiv/exec/
 -      chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/*
 +      ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin
 +      ${BSD_INSTALL_PROGRAM} sxiv ${DESTDIR}${PREFIX}/bin
++      sed -i "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1
 +      ${BSD_INSTALL_MAN_DIR} ${DESTDIR}${MANPREFIX}/man1
-+      sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 > sxiv.1.tmp
-+      mv sxiv.1.tmp sxiv.1
 +      ${BSD_INSTALL_MAN} sxiv.1 ${DESTDIR}${MANPREFIX}/man1
 +      ${BSD_INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/sxiv
-+      ${BSD_INSTALL_DATA} exec/image-info 
${DESTDIR}${PREFIX}/share/examples/sxiv
-+      ${BSD_INSTALL_DATA} exec/key-handler 
${DESTDIR}${PREFIX}/share/examples/sxiv
++      ${BSD_INSTALL_DATA} exec/* ${DESTDIR}${PREFIX}/share/examples/sxiv
  
  uninstall:
-       rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
+       @echo "REMOVE bin/sxiv"
Index: patches/patch-sxiv_1
===================================================================
RCS file: /cvs/ports/graphics/sxiv/patches/patch-sxiv_1,v
retrieving revision 1.1
diff -u -p -r1.1 patch-sxiv_1
--- patches/patch-sxiv_1        25 Dec 2015 02:03:00 -0000      1.1
+++ patches/patch-sxiv_1        21 Nov 2017 08:39:17 -0000
@@ -1,8 +1,9 @@
 $OpenBSD: patch-sxiv_1,v 1.1 2015/12/25 02:03:00 mmcc Exp $
---- sxiv.1.orig        Sun Dec 20 07:21:25 2015
-+++ sxiv.1     Wed Dec 23 20:11:36 2015
-@@ -354,7 +354,7 @@ image gets loaded. The path of this script is
- and the first argument to this script is the path of the loaded image.
+Index: sxiv.1
+--- sxiv.1.orig
++++ sxiv.1
+@@ -381,7 +381,7 @@ and the arguments given to it are: 1) path to image fi
+ 3) image height.
  .P
  There is also an example script installed together with sxiv as
 -.IR PREFIX/share/sxiv/exec/image-info .
@@ -10,7 +11,7 @@ $OpenBSD: patch-sxiv_1,v 1.1 2015/12/25 
  .SH EXTERNAL KEY HANDLER
  Additional external keyboard commands can be defined using a handler program
  located in
-@@ -372,7 +372,7 @@ where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier sta
+@@ -399,7 +399,7 @@ where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier sta
  keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
  
  There is also an example script installed together with sxiv as
Index: pkg/DESCR
===================================================================
RCS file: /cvs/ports/graphics/sxiv/pkg/DESCR,v
retrieving revision 1.2
diff -u -p -r1.2 DESCR
--- pkg/DESCR   24 Dec 2015 21:54:09 -0000      1.2
+++ pkg/DESCR   21 Nov 2017 08:39:17 -0000
@@ -1,7 +1,5 @@
-sxiv is an alternative to feh and qiv. Its only dependencies besides
-xlib are imlib2, libexif and giflib. The primary goal for writing sxiv
-is to create an image viewer, which only has the most basic features
-required for fast image viewing (the ones I want). It has vi key
-bindings and works nicely with tiling window managers. Its code base
-should be kept small and clean to make it easy for you to dig into it
-and customize it for your needs.
+The primary goal of sxiv is to create an image viewer which only has the most
+basic features required for fast image viewing (the ones I want). It has vi key
+bindings and works nicely with tiling window managers.  Its code base should be
+kept small and clean to make it easy for you to dig into it and customize it 
for
+your needs.

Reply via email to