devel/plan9port: Update to latest commit

- Cleanup and simplify the port
- Remove all no-op REINPLACE_CMD
- Add a plist
- Update pkg-descr and WWW
- Take maintainership
- Install dictionary and thesaurus files for dict(1)
- Install data files for scat(1)
- Copy pkg-message from the OpenBSD port
This commit is contained in:
Tobias Kortkamp 2018-03-09 13:39:33 +00:00
parent 37a5c0b07a
commit 1c80169f97
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=463959
6 changed files with 7897 additions and 328 deletions

View file

@ -2,225 +2,84 @@
# $FreeBSD$ # $FreeBSD$
PORTNAME= plan9port PORTNAME= plan9port
PORTVERSION= 20170723 PORTVERSION= 20180205
CATEGORIES= devel plan9 CATEGORIES= devel plan9
DIST_SUBDIR= plan9port
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= ports@FreeBSD.org MAINTAINER= tobik@FreeBSD.org
COMMENT= Port of many Plan 9 programs to Unix-like operating systems COMMENT= Plan 9 from User Space
LICENSE= LUCENT LICENSE= LUCENT
LICENSE_NAME= Lucent Public License Version 1.02 LICENSE_NAME= Lucent Public License Version 1.02
LICENSE_FILE= ${WRKSRC}/LICENSE LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
GH_ACCOUNT= 9fans
GH_TAGNAME= 4a8c0c7
USE_GITHUB= yes
DIST_SUBDIR= ${PORTNAME}
LIB_DEPENDS= libfreetype.so:print/freetype2 \ LIB_DEPENDS= libfreetype.so:print/freetype2 \
libfontconfig.so:x11-fonts/fontconfig libfontconfig.so:x11-fonts/fontconfig
BROKEN_sparc64= does not install: cleanname not found USES= localbase:ldflags perl5 shebangfix
USE_GITHUB= yes
OPTIONS_DEFINE= SRC GH_ACCOUNT= 9fans
OPTIONS_DEFAULT= GH_TAGNAME= 4798a8a5560552480efde5fe8b1f7963a25a96d3
OPTIONS_SUB= yes
SRC_DESC= Install sources
USES= perl5 shebangfix tar:tgz
USE_XORG= x11 xt xi xaw xext
USE_PERL5= build USE_PERL5= build
USE_XORG= x11 xt xext
SHEBANG_GLOB= *
SHEBANG_LANG= rc SHEBANG_LANG= rc
rc_OLD_CMD= /bin/rc /usr/local/plan9/bin/rc rc_OLD_CMD= /bin/rc /usr/local/plan9/bin/rc
rc_CMD= ${PLAN9}/bin/rc rc_CMD= ${PREFIX}/plan9/bin/rc
# /usr/bin/perl
SHEBANG_FILES= unix/man/fixurls
# /bin/rc
SHEBANG_FILES+= acid/transcript \
acid/window \
mac/9term.app/Contents/MacOS/9term \
mac/Plumb.app/Contents/MacOS/plumb \
src/cmd/9660/mk9660.rc \
src/cmd/acme/mail/mkbox \
src/cmd/dict/egfix \
src/cmd/dict/egfix2 \
src/cmd/dict/gefix \
src/cmd/dict/getneeds \
src/cmd/lp/lpsend.rc \
src/cmd/map/map.rc \
src/cmd/map/mapdemo.rc \
src/cmd/postscript/hardcopy/hardcopy.rc \
src/cmd/postscript/psencoding/psencoding.rc \
src/cmd/spell/spell.rc \
src/cmd/upas/filterkit/pipefrom.sample \
src/cmd/upas/filterkit/pipeto.sample-hold \
src/cmd/upas/filterkit/pipeto.sample \
tmac/sendcover \
troff/font/devutf/mkMAP
# /usr/local/plan9/bin/rc
SHEBANG_FILES+= bin/codereview \
bin/quote1 \
bin/quote2 \
bin/ssam \
bin/upas/isspam \
bin/upas/msgcat \
bin/upas/spam \
bin/upas/spambox \
bin/upas/unspam \
bin/upas/unspambox \
lp/bin/lpsend.rc \
lp/bin/UNLOCK \
lp/daemon/generic \
lp/daemon/gsdev \
lp/daemon/psdev \
lp/kill/generic \
lp/process/dvipost \
lp/process/g3post \
lp/process/generic \
lp/process/gifpost \
lp/process/hpost \
lp/process/jpgpost \
lp/process/noproc \
lp/process/p9bitpost \
lp/process/pdfgs \
lp/process/pdfpost \
lp/process/post \
lp/process/ppost \
lp/process/psextract \
lp/process/tr2post \
lp/sched/FIFO \
lp/spooler/generic \
lp/spooler/lpdspool \
lp/spooler/nospool \
lp/stat/generic \
lp/stat/lpd \
mail/lib/validateattachment \
man/secindex \
src/cmd/fossil/conf.rc \
src/cmd/lp/lp.rc \
src/cmd/netfiles/netfileget \
src/cmd/netfiles/netfileput \
src/cmd/netfiles/netfilestat \
src/cmd/postscript/printfont/printfont.rc \
src/cmd/upas/misc/mail.rc \
src/cmd/upas/misc/qmail \
src/cmd/upas/misc/remotemail \
src/cmd/venti/srv/conf.rc
WRKSRC= ${WRKDIR}/plan9
PLIST= ${WRKDIR}/.PLIST
SUB_FILES= pkg-message SUB_FILES= pkg-message
REINPLACE_ARGS= -i "" # necessary since installs via recursive copy SUB_LIST= OPSYS=${OPSYS}
PLAN9= ${PREFIX}/plan9 OPTIONS_DEFINE= DATA
OPTIONS_DEFAULT= DATA
OPTIONS_SUB= yes
EMPTY_DIRS= plan9/mail/queue \ DATA_DESC= Install dictionary, thesaurus, and other data files
plan9/log \
plan9/bin/lpbin
post-extract: DATA_MASTER_SITES= https://9fans.github.io/plan9port/dist/
${MV} ${WRKDIR}/plan9port-${GH_TAGNAME} ${WRKDIR}/plan9 DATA_DISTFILES= pgw.tar.bz2 roget.tar.bz2 scat.tgz
post-extract-DATA-on:
@cd ${WRKSRC}/dict && ${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/pgw.tar.bz2
@cd ${WRKSRC}/dict && ${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/roget.tar.bz2
@cd ${WRKSRC}/sky && ${TAR} -xf ${DISTDIR}/${DIST_SUBDIR}/scat.tgz
post-patch: post-patch:
@${FIND} ${WRKSRC}/man -type f -regex ".*\.[0-9?]$\" \
| ${XARGS} ${REINPLACE_CMD} -e 's|\\\*9|${PLAN9}|'
@${REINPLACE_CMD} -e 's|X11=/usr/X11R6|X11=${LOCALBASE}|' \
${WRKSRC}/bin/9l ${WRKSRC}/src/cmd/devdraw/mkwsysrules.sh
@${REINPLACE_CMD} -e 's|\[5-9\]\.||' ${WRKSRC}/bin/9l @${REINPLACE_CMD} -e 's|\[5-9\]\.||' ${WRKSRC}/bin/9l
@${REINPLACE_CMD} -e 's|/lib/font/bit|${PLAN9}/font|' \ @${REINPLACE_CMD} -e 's|/lib/font/bit|${PREFIX}/plan9/font|' \
${WRKSRC}/src/cmd/acme/acme.c ${WRKSRC}/src/cmd/acme/acme.c
@${SED} -e 's|util\.h|lib&|' ${WRKSRC}/src/cmd/9term/OpenBSD.c \ @${REINPLACE_CMD} -e 's|#!/bin/rc|#!${PREFIX}/plan9/bin/rc|' \
> ${WRKSRC}/src/cmd/9term/${OPSYS}.c
@${REINPLACE_CMD} -e 's|, swizz(void)|&, swizz8(void)|' \
${WRKSRC}/src/cmd/xd.c
@${REINPLACE_CMD} -e '/^cd $$PLAN9/d' ${WRKSRC}/lib/moveplan9.sh
@${REINPLACE_CMD} -e 's|^#!/bin/bash$$|#!/bin/sh|' ${WRKSRC}/bin/macedit
@${REINPLACE_CMD} -e 's|#!/bin/rc|#!${PLAN9}/bin/rc|' \
${WRKSRC}/src/cmd/upas/ml/mlmgr.c \ ${WRKSRC}/src/cmd/upas/ml/mlmgr.c \
${WRKSRC}/src/cmd/tcs/font/mkfile ${WRKSRC}/src/cmd/tcs/font/mkfile
@${REINPLACE_CMD} -e '/<sys\/termios.h>/d' \
${WRKSRC}/src/lib9/readcons.c \
${WRKSRC}/src/cmd/9term/bsdpty.c
@${REINPLACE_CMD} -e 's|<sys/termios.h>|<termios.h>|' \
${WRKSRC}/src/cmd/draw/mc.c
@${REINPLACE_CMD} -e 's|ulong|u64int|' ${WRKSRC}/src/libmach/FreeBSD.c @${REINPLACE_CMD} -e 's|ulong|u64int|' ${WRKSRC}/src/libmach/FreeBSD.c
@${REINPLACE_CMD} -e \ # Fix 9term: no ptys
'/[Rr]enaming hard-coded.*paths\./!s|/usr/local/|${PREFIX}/|' \ @${SED} -e 's|util\.h|lib&|' ${WRKSRC}/src/cmd/9term/OpenBSD.c \
${WRKSRC}/INSTALL > ${WRKSRC}/src/cmd/9term/${OPSYS}.c
@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|g' \
${WRKSRC}/bin/codereview \ do-configure:
${WRKSRC}/bin/macedit \ @${ECHO_CMD} 'CFLAGS="${CFLAGS}"' > ${WRKSRC}/LOCAL.config
${WRKSRC}/lib/moveplan9.sh \ @${ECHO_CMD} 'LDFLAGS="${LDFLAGS}"' >> ${WRKSRC}/LOCAL.config
${WRKSRC}/man/lookman.index \
${WRKSRC}/plumb/basic \
${WRKSRC}/src/cmd/9pfuse/errstr.c \
${WRKSRC}/src/cmd/devdraw/mkwsysrules.sh \
${WRKSRC}/src/cmd/fossil/mkfile \
${WRKSRC}/src/cmd/lp/lp.rc \
${WRKSRC}/src/cmd/postscript/printfont/printfont.rc \
${WRKSRC}/src/cmd/sam/sam.c \
${WRKSRC}/src/cmd/upas/nfs/imap.c \
${WRKSRC}/src/cmd/venti/srv/mkfile \
${WRKSRC}/src/lib9/_p9translate.c \
${WRKSRC}/src/lib9/get9root.c \
${WRKSRC}/src/libregexp/mkfile
do-build: do-build:
@cd ${WRKSRC} && { \ @cd ${WRKSRC} && ${SETENV} CC9=${CC} ./INSTALL -b
export PLAN9_TARGET="${PLAN9}" CC9="${CC}"; \
if [ ! -t 1 ]; then \
export winid=1; \
fi; \
./INSTALL; \
}
post-build:
@${FIND} ${WRKSRC} -name .cvsignore -o -name .gitignore -delete
@${RM} ${WRKSRC}/configure ${WRKSRC}/config ${WRKSRC}/install.log \
${WRKSRC}/install.sum
@( cd ${WRKDIR} ; \
${FIND} plan9 -type f; \
${ECHO_CMD} "@dir(,,1777) plan9/news"; \
for D in ${EMPTY_DIRS}; do \
${ECHO_CMD} "@dir $${D}"; \
done; \
) | sed -e 's|^plan9/bin/auxstats|@(,kmem,2755) &|' \
-e 's|^plan9/mac|%%SRC%%&|' \
-e 's|^plan9/unix|%%SRC%%&|' \
-e 's|^plan9/bin/macedit|%%SRC%%&|' \
-e 's|^plan9/bin/osxvers|%%SRC%%&|' \
-e '/^plan9\/dist\//{/spaceglenda100\.png/!s/^/%%SRC%%/;}' \
-e '/^plan9\/src\//{/src\/mk/!s/^/%%SRC%%/;}' > ${PLIST}
do-install: do-install:
${CP} -a ${WRKSRC} ${STAGEDIR}${PREFIX} .for l in .cvsignore .hg .hgignore .hgtags .gitignore .gitkeep *.bak *.orig *.beforesubst .travis.yml
@${FIND} ${WRKSRC} -name "${l}" -delete
do-install-SRC-off: .endfor
@${RM} -r ${STAGEDIR}${PLAN9}/mac ${STAGEDIR}${PLAN9}/unix \ @cd ${WRKSRC} && ${SED} -i '' 's#/usr/local#${PREFIX}#' \
${STAGEDIR}${PLAN9}/bin/osxvers ${STAGEDIR}${PLAN9}/bin/macedit `${CAT} lib/moveplan9.files`
@${FIND} ${STAGEDIR}${PLAN9}/dist ! -name spaceglenda100.png -delete @${MKDIR} ${STAGEDIR}${PREFIX}/plan9
@${FIND} ${STAGEDIR}${PLAN9}/src ! -path '${STAGEDIR}${PLAN9}/src/mk*' \ @cd ${WRKSRC} && ${PAX} -rw . ${STAGEDIR}${PREFIX}/plan9
-delete @${RLN} ${STAGEDIR}${PREFIX}/plan9/bin/9 ${STAGEDIR}${PREFIX}/bin/9
post-install: post-install:
@${FIND} ${STAGEDIR}${PLAN9}/bin -type f | \ @cd ${STAGEDIR}${PREFIX}/plan9 && \
while read file; do \ for f in bin/* bin/disk/* bin/fossil/* bin/fs/* bin/venti/* src/cmd/devdraw/o.devdraw; do \
case "$$(file -- "$$file")" in \ ${STRIP_CMD} $$f > /dev/null 2>&1 || ${TRUE}; \
*ELF*) \
${STRIP_CMD} -- "$$file"; \
;; \
esac \
done done
post-install-SRC-on:
@${STRIP_CMD} -- ${STAGEDIR}${PLAN9}/src/cmd/devdraw/o.devdraw
install-user:
@${MKDIR} ${HOME}/lib
${INSTALL_DATA} ${PLAN9}/plumb/initial.plumbing ${HOME}/lib/plumbing
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -1,3 +1,9 @@
TIMESTAMP = 1501722772 TIMESTAMP = 1520599448
SHA256 (plan9port/9fans-plan9port-20170723-4a8c0c7_GH0.tar.gz) = 0b48f908f4212a7b5c266d369f5ee38640f72cceecdedea324e8fd2ec4207089 SHA256 (plan9port/pgw.tar.bz2) = de3af82012b3380612b56fa0c1a2ed8daf619a0215189fc59eab9919ec47ea15
SIZE (plan9port/9fans-plan9port-20170723-4a8c0c7_GH0.tar.gz) = 23469932 SIZE (plan9port/pgw.tar.bz2) = 9406367
SHA256 (plan9port/roget.tar.bz2) = b24f051354dabe58f1d825e29db386091c84aec98125dbe499adeca51a32a836
SIZE (plan9port/roget.tar.bz2) = 482956
SHA256 (plan9port/scat.tgz) = a995f52544a712f2bdb87f531638d4c846224fa9212d034e3bd8e809cb99be1e
SIZE (plan9port/scat.tgz) = 5145346
SHA256 (plan9port/9fans-plan9port-20180205-4798a8a5560552480efde5fe8b1f7963a25a96d3_GH0.tar.gz) = 4bbc118d699924760079c57f81d71d743d6ccf58827bce17bc2844a71faf3564
SIZE (plan9port/9fans-plan9port-20180205-4798a8a5560552480efde5fe8b1f7963a25a96d3_GH0.tar.gz) = 23434357

View file

@ -1,91 +0,0 @@
--- src/cmd/auxstats/FreeBSD.c.orig 2017-07-23 11:11:56 UTC
+++ src/cmd/auxstats/FreeBSD.c
@@ -8,20 +8,15 @@
#include <sys/time.h>
#include <sys/dkstat.h>
#include <net/if.h>
-#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-#if __FreeBSD_version < 600000
-#include <machine/apm_bios.h>
-#endif
#include <sys/ioctl.h>
#include <limits.h>
#include <libc.h>
#include <bio.h>
+#include <ifaddrs.h>
#include "dat.h"
-/* XXX: #if __FreeBSD_version */
-
void xapm(int);
void xloadavg(int);
void xcpu(int);
@@ -45,7 +40,6 @@ void (*statfn[])(int) =
static kvm_t *kvm;
static struct nlist nl[] = {
- { "_ifnet" },
{ "_cp_time" },
{ "" }
};
@@ -86,45 +80,28 @@ kread(ulong addr, char *buf, int size)
void
xnet(int first)
{
+ struct ifaddrs *ifap, *ifa;
ulong out, in, outb, inb, err;
- static ulong ifnetaddr;
- ulong addr;
- struct ifnet ifnet;
- struct ifnethead ifnethead;
- char name[16];
if(first)
return;
- if(ifnetaddr == 0){
- ifnetaddr = nl[0].n_value;
- if(ifnetaddr == 0)
- return;
- }
-
- if(kread(ifnetaddr, (char*)&ifnethead, sizeof ifnethead) < 0)
+ if (getifaddrs(&ifap) != 0)
return;
out = in = outb = inb = err = 0;
- addr = (ulong)TAILQ_FIRST(&ifnethead);
- while(addr){
-#if __FreeBSD_version < 500000
- if(kread(addr, (char*)&ifnet, sizeof ifnet) < 0
- || kread((ulong)ifnet.if_name, name, 16) < 0)
- return;
-#else
- if(kread(addr, (char*)&ifnet, sizeof ifnet) < 0
- || kread((ulong)ifnet.if_dname, name, 16) < 0)
- return;
-#endif
- name[15] = 0;
- addr = (ulong)TAILQ_NEXT(&ifnet, if_link);
- out += ifnet.if_opackets;
- in += ifnet.if_ipackets;
- outb += ifnet.if_obytes;
- inb += ifnet.if_ibytes;
- err += ifnet.if_oerrors+ifnet.if_ierrors;
+
+#define IFA_STAT(s) (((struct if_data *)ifa->ifa_data)->ifi_ ## s)
+ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (ifa->ifa_addr->sa_family != AF_LINK)
+ continue;
+ out += IFA_STAT(opackets);
+ in += IFA_STAT(ipackets);
+ outb += IFA_STAT(obytes);
+ inb += IFA_STAT(ibytes);
+ err += IFA_STAT(oerrors) + IFA_STAT(ierrors);
}
+ freeifaddrs(ifap);
Bprint(&bout, "etherin %lud 1000\n", in);
Bprint(&bout, "etherout %lud 1000\n", out);
Bprint(&bout, "etherinb %lud 1000000\n", inb);

View file

@ -1,30 +1,8 @@
You should benefit from adding these to your profile environment (example The plan9port tools consist of many small binaries intimately tied
for sh/bash, adjust for tcsh as appropriate): together, some of them conflicting with %%OPSYS%% base utilities. To
avoid runtime conflicts, you may wish to append
%%PREFIX%%/plan9/bin to your PATH.
PLAN9=%%PREFIX%%/plan9; export PLAN9 Alternatively, plan9port tools can be run with %%PREFIX%%/bin/9
PATH=$PATH:$PLAN9/bin; export PATH
You can also install a default plumbing file if you want: 9 man 1 intro
$ mkdir -p ${HOME}/lib
$ %%PREFIX%%/plan9/plumb/initial.plumbing ${HOME}/lib/plumbing
When installing from the port (as your normal user), you can simply type
(while in the port directory) to do the same:
make install-user
BEWARE: This port can cause some problems if you try to install certain
software (including, but not limited to our Ports Collection):
- Ports that require `archivers/zip' to build (e.g. `www/mozilla'). If
`$PLAN9/bin/zip' would be found as `zip' command (via $PATH) and used,
it could easily fail since it does not share options with "standard"
`zip' (at least not all of them)
- `x11/kdebase3' build can result in crash in `fish.cpp' file if you try
to build it with $PLAN9. We suggest you to unset PLAN9 before building
any ports that fail with similar symptoms (or unset it for all ports
just to be on the safe side)
- venti/fmt* commands work only with normal files

View file

@ -1,22 +1,9 @@
This is a port of the bulk of the Plan 9 software build environment to Unix. Plan 9 is a distributed computing environment built at Bell Labs
It tries to reproduce the Plan 9 build environment as faithfully as possible, starting in the late 1980s. Plan 9 became a convenient platform for
providing u.h and libc.h, and blithely redefining tokens such as open, dup, experimenting with new ideas, applications, and services.
and accept in order to provide implementations that better mimic the Plan 9
semantics. The result is a somewhat more complicated and less Unix-friendly
environment, but Plan 9 programs can typically be compiled with little or no
changes.
The port includes the following: Plan 9 from User Space (aka plan9port) is a port of many Plan 9
programs from their native Plan 9 environment to Unix-like operating
systems.
- Sources for Linux, FreeBSD, and SunOS WWW: https://9fans.github.io/plan9port/
- lib9 (nee libc), libString, libbin, libbio, libcomplete, libdraw,
liblibflate, frame, libfs, libhtml, libhttpd, libip, libmux, libplumb,
liblibregexp, libsec, thread, and libventi
- 9term, acme, hoc, plumber, rio (nee 9wm), sam, and samterm, along with
many small utilities and manual pages
- Plan 9 bitmap fonts
WWW: http://swtch.com/plan9port/

7830
devel/plan9port/pkg-plist Normal file

File diff suppressed because it is too large Load diff