Friday, April 13, 2018

Re: UPDATE: graphics/farbfeld 3 -> 4

On Thu, Apr 12, 2018 at 10:23:56AM +0200, Klemens Nanni wrote:
> On Thu, Apr 12, 2018 at 01:52:48AM +0100, Kaashif Hymabaccus wrote:
> > This is an update to graphics/farbfeld. The main change to the port is
> > that USE_GMAKE isn't needed any more.
> >
> > Works fine for me on amd64 (converted some images to ff and back,
> > still seems to work).
> Can you provide a simple do-install and drop patch-Makefile instead?
> This was recently done for x11/{dmenu,st} as well. This would be
> reasonably simpler and keep suckless ports somewhat consistent across
> the tree.

Thanks for the suggestion, the updated diff is below.

--
Kaashif Hymabaccus
GPG: 3E810B04

diff --git Makefile Makefile
index 8d499d1ad33..7a0cc01f58c 100644
--- Makefile
+++ Makefile
@@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.1.1.1 2017/10/23 21:39:20 bcallah Exp $

COMMENT = lossless, uncompressed graphics format
-DISTNAME = farbfeld-3
+DISTNAME = farbfeld-4
CATEGORIES = graphics converters

HOMEPAGE = https://tools.suckless.org/farbfeld
@@ -19,9 +19,16 @@ LIB_DEPENDS = graphics/png \

RUN_DEPENDS = graphics/ImageMagick

-USE_GMAKE = Yes
MAKE_ENV = CC="${CC}"

NO_TEST = Yes

+do-install:
+ ${INSTALL_PROGRAM} \
+ ${WRKBUILD}/{ff2jpg,ff2pam,ff2png,ff2ppm,jpg2ff,png2ff} \
+ ${PREFIX}/bin/
+ ${INSTALL_SCRIPT} ${WRKSRC}/2ff ${PREFIX}/bin/
+ ${INSTALL_MAN} ${WRKSRC}/*.1 ${PREFIX}/man/man1/
+ ${INSTALL_MAN} ${WRKSRC}/*.5 ${PREFIX}/man/man5/
+
.include <bsd.port.mk>
diff --git distinfo distinfo
index c632a202e9e..a5f2d6668be 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (farbfeld-3.tar.gz) = W5U7hqctP+rt9iaYUyyIiOX24vY2MZOkzIzuDjjDeK0=
-SIZE (farbfeld-3.tar.gz) = 10169
+SHA256 (farbfeld-4.tar.gz) = x99ZIe3RIcpdWxz2+wHkMK/5sxJCJi5PaQ069yzL5yo=
+SIZE (farbfeld-4.tar.gz) = 10340
diff --git patches/patch-Makefile patches/patch-Makefile
deleted file mode 100644
index c42275f1f20..00000000000
--- patches/patch-Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.1.1.1 2017/10/23 21:39:20 bcallah Exp $
-
-Index: Makefile
---- Makefile.orig
-+++ Makefile
-@@ -38,15 +38,12 @@ dist:
- rm -rf "farbfeld-$(VERSION)"
-
- install: all
-- mkdir -p "$(DESTDIR)$(PREFIX)/bin"
-- cp -f $(SCR) $(BIN) "$(DESTDIR)$(PREFIX)/bin"
-- for f in $(BIN) $(SCR); do chmod 755 "$(DESTDIR)$(PREFIX)/bin/$$f"; done
-- mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
-- cp -f $(MAN1) "$(DESTDIR)$(MANPREFIX)/man1"
-- for m in $(MAN1); do chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/$$m"; done
-- mkdir -p "$(DESTDIR)$(MANPREFIX)/man5"
-- cp -f $(MAN5) "$(DESTDIR)$(MANPREFIX)/man5"
-- for m in $(MAN5); do chmod 644 "$(DESTDIR)$(MANPREFIX)/man5/$$m"; done
-+ ${BSD_INSTALL_PROGRAM_DIR} "$(PREFIX)/bin"
-+ ${BSD_INSTALL_PROGRAM} $(SCR) $(BIN) "$(PREFIX)/bin"
-+ ${BSD_INSTALL_MAN_DIR} "$(MANPREFIX)/man1"
-+ ${BSD_INSTALL_MAN} $(MAN1) "$(MANPREFIX)/man1"
-+ ${BSD_INSTALL_MAN_DIR} "$(MANPREFIX)/man5"
-+ ${BSD_INSTALL_MAN} $(MAN5) "$(MANPREFIX)/man5"
-
- uninstall:
- for f in $(BIN) $(SCR); do rm -f "$(DESTDIR)$(PREFIX)/bin/$$f"; done
diff --git patches/patch-config_mk patches/patch-config_mk
index b27e187cb51..f660d82096f 100644
--- patches/patch-config_mk
+++ patches/patch-config_mk
@@ -3,13 +3,14 @@ $OpenBSD: patch-config_mk,v 1.1.1.1 2017/10/23 21:39:20 bcallah Exp $
Index: config.mk
--- config.mk.orig
+++ config.mk
-@@ -4,15 +4,15 @@ VERSION = 3
+@@ -4,15 +4,15 @@ VERSION = 4
# Customize below to fit your system

# paths
-PREFIX = /usr/local
+-MANPREFIX = $(PREFIX)/share/man
+PREFIX ?= /usr/local
- MANPREFIX = ${PREFIX}/man
++MANPREFIX = $(PREFIX)/man

# flags
CPPFLAGS = -D_DEFAULT_SOURCE
@@ -17,8 +18,8 @@ Index: config.mk
-LDFLAGS = -s
+CFLAGS += -std=c99 -pedantic -Wall -Wextra -I${LOCALBASE}/include
+LDFLAGS += -s -L${LOCALBASE}/lib
- PNG-LDFLAGS = -lpng
- JPG-LDFLAGS = -ljpeg
+ PNG-LDLIBS = -lpng
+ JPG-LDLIBS = -ljpeg

# compiler and linker
-CC = cc

No comments:

Post a Comment