Skip to content

Commit

Permalink
graphics/netpbm: Switch to 11.03.05 (advanced train) from sourceforge
Browse files Browse the repository at this point in the history
The sourceforge repo does not create actual releases, instead
they to commit to stable and advanced branches. So build
one using svn/tar and distribute via MASTER_SITES=LOCAL/... (Crib
do-fetch logic from graphics/yukon and devel/libopenbsd.)

Remove MANPAGES option (no longer included).

Remove PERL option (we're now unconditionally dependant on perl).

Remove STATIC option (does not build because graphics/jasper no
longer installs a static library).

Reported by:	diizzy
PR:		262212
  • Loading branch information
Craig Leres authored and Craig Leres committed Sep 10, 2023
1 parent cb8b45f commit 170ff4f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 523 deletions.
142 changes: 49 additions & 93 deletions graphics/netpbm/Makefile
@@ -1,8 +1,7 @@
PORTNAME= netpbm
DISTVERSION= 10.91.01
PORTREVISION= 3
DISTVERSION= 11.03.05
CATEGORIES= graphics
MASTER_SITES= LOCAL/tobik
MASTER_SITES= LOCAL/leres/netpbm

MAINTAINER= leres@FreeBSD.org
COMMENT= Toolkit for conversion of images between different formats
Expand All @@ -14,22 +13,21 @@ LICENSE_NAME_IJG= Independent JPEG Group License
LICENSE_FILE_IJG= ${WRKSRC}/doc/copyright_summary
LICENSE_PERMS_IJG= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

TEST_DEPENDS= bash:shells/bash
LIB_DEPENDS= libjasper.so:graphics/jasper \
libjbig.so:graphics/jbigkit \
libpng.so:graphics/png \
libtiff.so:graphics/tiff

# The port follows the advanced release series. Upstream does not
# create tarballs for them, so we have to roll our own. See
# http://netpbm.sourceforge.net/getting_netpbm.php. To checkout the
# sources yourself see the netpbm-version-check and netpbm-fetch
# targets below.
USES= cpe ghostscript:test gmake perl5 shebangfix tar:xz
USES= cpe gmake jpeg perl5 shebangfix tar:xz
USE_LDCONFIG= yes
USE_PERL5= build test
CPE_VENDOR= netpbm_project

SHEBANG_FILES= buildtools/makeman converter/pbm/pbmtox10bm editor/pnmflip \
editor/pnmquant editor/ppmfade editor/ppmquant editor/ppmshadow \
generator/ppmrainbow test/*.test test/Available-Testprog \
test/Execute-Tests
SVN_REV= r4636

SHEBANG_FILES= buildtools/makeman converter/pbm/pbmtox10bm \
editor/pnmflip editor/pnmquant editor/ppmfade \
editor/ppmquant editor/ppmshadow generator/ppmrainbow \
test/*.test test/Available-Testprog test/Execute-Tests

MAKEFILE= GNUmakefile
MAKE_ARGS= BINMODE=${BINMODE} \
Expand All @@ -40,108 +38,66 @@ MAKE_ARGS= BINMODE=${BINMODE} \
MANMODE=${MANMODE} \
pkgdir=${STAGEDIR}${PREFIX} \
SHAREMODE=${SHAREMODE}
INSTALL_TARGET= install.bin install.lib install.data install.hdr \
install.staticlib
TEST_ARGS= pkgdir="${STAGEDIR}${PREFIX}" \
resultdir="${WRKDIR}/tests" \
RGBDEF="${STAGEDIR}${PREFIX}/share/netpbm/rgb.txt"
TEST_TARGET= check
# Disable fragile tests. tiff-flate-lzw-roundtrip's checksums are
# different on FreeBSD so the test fails. The resulting and
# intermediary images look fine in spite of this.
_DISABLE_TESTS= all-in-place palm-roundtrip pamdice pamexec pamhue \
pammixmulti-identity pamtopdbimg pamvalidate pj-roundtrip \
ps-alt-roundtrip tiff-flate-lzw-roundtrip

OPTIONS_DEFINE= MANPAGES PERL STATIC SVGTOPAM X11
OPTIONS_DEFAULT= MANPAGES PERL
INSTALL_TARGET= install.bin install.lib install.data install.hdr

OPTIONS_DEFINE= SVGTOPAM X11
OPTIONS_SUB= yes

SVGTOPAM_DESC= Build svgtopam
X11_DESC= Build pamx

PERL_USE= PERL5=run
STATIC_BUILD_DEPENDS= jasper>0:graphics/jasper \
jbigkit>0:graphics/jbigkit \
png>0:graphics/png \
tiff>0:graphics/tiff
STATIC_LIB_DEPENDS_OFF= libjasper.so:graphics/jasper \
libjbig.so:graphics/jbigkit \
libpng.so:graphics/png \
libtiff.so:graphics/tiff
STATIC_USES= jpeg:build
STATIC_USES_OFF= jpeg
SVGTOPAM_USES= gnome
SVGTOPAM_USE= GNOME=libxml2
SVGTOPAM_VARS_OFF= _DISABLE_TESTS+=svgtopam
X11_USES= xorg
X11_USE= XORG=x11,xau,xcb,xdmcp
SVGTOPAM_USES= gnome
SVGTOPAM_USE= gnome=libxml2
X11_USES= xorg
X11_USE= xorg=x11,xau,xcb,xdmcp

post-patch:
@${REINPLACE_CMD} -e 's|misc|share/netpbm|g' ${WRKSRC}/common.mk
@${REINPLACE_CMD} -e 's|pkg-config|false|g' ${WRKSRC}/GNUmakefile
@${REINPLACE_CMD} ${_DISABLE_TESTS:@.test.@-e '/${.test.}/d'@} \
${WRKSRC}/test/Test-Order
${REINPLACE_CMD} -e 's|misc|share/netpbm|g' ${WRKSRC}/common.mk
${REINPLACE_CMD} -e 's|pkg-config|false|g' ${WRKSRC}/GNUmakefile
.ifdef WITH_PIE
.for dn in buildtools test
@${REINPLACE_CMD} -e '/^all:/s/^/CFLAGS_FOR_BUILD+=${PIE_CFLAGS}\n/' \
${REINPLACE_CMD} -e '/^all:/s/^/CFLAGS_FOR_BUILD+=${PIE_CFLAGS}\n/' \
${WRKSRC}/${dn}/Makefile
.endfor
.endif

post-patch-STATIC-on:
@${REINPLACE_CMD} -e 's|$$(LD)|$$(LD) -static|g' \
-e 's@$$(NETPBMLIBFNAME)@libnetpbm.a@' \
${WRKSRC}/common.mk
#
# To roll snapshot: make BOOTSTRAP= makesum
#
#.if defined(BOOTSTRAP) && !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
.if defined(BOOTSTRAP)
FETCH_DEPENDS+= svn:devel/subversion
WRKDIR= ${WRKDIRPREFIX}${.CURDIR}/work/.bootstrap

do-fetch:
${RM} -rf ${WRKDIR}
${MKDIR} ${WRKDIR}
svn export -r${SVN_REV} \
svn://svn.code.sf.net/p/${PORTNAME}/code/advanced ${WRKSRC}
${TAR} -jcf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} -C${WRKDIR} \
${DISTNAME}
${RM} -rf ${WRKDIR}
.endif

# Disable building svgtopam by default. It is the only program that
# requires libxml2 and it is not useful in this day and age according
# to the author. See the top of converter/other/svgtopam.c for more
# details.
post-patch-SVGTOPAM-off:
@${REINPLACE_CMD} '/svgtopam/d' ${WRKSRC}/converter/other/Makefile
${REINPLACE_CMD} '/svgtopam/d' ${WRKSRC}/converter/other/Makefile

post-patch-X11-off:
@${REINPLACE_CMD} '/pamx/d' ${WRKSRC}/other/Makefile
${REINPLACE_CMD} '/pamx/d' ${WRKSRC}/other/Makefile

do-configure:
@${CAT} ${WRKSRC}/config.mk.in ${FILESDIR}/config.mk > ${WRKSRC}/config.mk
${CAT} ${WRKSRC}/config.mk.in ${FILESDIR}/config.mk > \
${WRKSRC}/config.mk

post-install:
@cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libnetpbm.so.11 libnetpbm.so
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libnetpbm.so
@${RM} ${STAGEDIR}${PREFIX}/bin/manweb
cd ${STAGEDIR}${PREFIX}/lib && ${LN} -sf libnetpbm.so.11 libnetpbm.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libnetpbm.so
${RM} ${STAGEDIR}${PREFIX}/bin/manweb
${INSTALL_DATA} ${WRKSRC}/lib/util/pm_c_util.h ${WRKSRC}/pm_config.h \
${STAGEDIR}${PREFIX}/include/netpbm
${MV} ${STAGEDIR}${PREFIX}/staticlink/libnetpbm.a ${STAGEDIR}${PREFIX}/lib
${RMDIR} ${STAGEDIR}${PREFIX}/sharedlink ${STAGEDIR}${PREFIX}/staticlink

post-install-MANPAGES-on:
${INSTALL_MAN} ${WRKSRC}/man/*.1 ${STAGEDIR}${PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/man/*.3 ${STAGEDIR}${PREFIX}/man/man3
${INSTALL_MAN} ${WRKSRC}/man/*.5 ${STAGEDIR}${PREFIX}/man/man5

.if defined(DEVELOPER)
# A lot of this is stolen from the netpbm OpenBSD port
NETPBM_REPO= https://svn.code.sf.net/p/netpbm/code
NETPBM_SERIES= advanced

netpbm-version-check:
@REV=`svnlite info ${NETPBM_REPO}/${NETPBM_SERIES}/version.mk | ${SED} -n 's/Last Changed Rev: //p'`; \
VERSION=`(svnlite ${CAT} -r$$REV ${NETPBM_REPO}/${NETPBM_SERIES}/version.mk; \
echo 'all:'; \
echo ' @printf "%02d.%02d.%02d" \'; \
echo ' $${NETPBM_MAJOR_RELEASE} \' ; \
echo ' $${NETPBM_MINOR_RELEASE} \' ; \
echo ' $${NETPBM_POINT_RELEASE} \' ; \
) | make -f -`; \
case `pkg version -t ${PORTVERSION} $$VERSION` in \
'>') echo "Port version is greater than latest release $$VERSION"; exit 1 ;; \
'<') echo "Run 'make NETPBM_REV=$$REV netpbm-fetch' to download netpbm $$VERSION" ;; \
esac

netpbm-fetch:
@svnlite export --force -r${NETPBM_REV} ${NETPBM_REPO}/${NETPBM_SERIES} netpbm-r${NETPBM_REV}
.endif
${STAGEDIR}${PREFIX}/include/netpbm
${RMDIR} ${STAGEDIR}${PREFIX}/sharedlink

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions graphics/netpbm/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1595613552
SHA256 (netpbm-10.91.01.tar.xz) = dba419ffa3ac6af7d88c866abdeca64985c498a696906906e2dd719e10c7e12d
SIZE (netpbm-10.91.01.tar.xz) = 2432820
TIMESTAMP = 1694293236
SHA256 (netpbm-11.03.05.tar.xz) = 42ee0d65fb98f594756f2241f778d598bda1ae95cf94e1e5b7e0a0379f772157
SIZE (netpbm-11.03.05.tar.xz) = 2412537
14 changes: 0 additions & 14 deletions graphics/netpbm/files/patch-converter_other_pstopnm.c

This file was deleted.

0 comments on commit 170ff4f

Please sign in to comment.