On Wed, 10 Jun 2015 17:13:38 -0300, Gleydson Soares wrote:
> Hi Pascal,
> 
> here is a diff[1] to enable fontsrv(4) support in ports/plan9/plan9port. diff 
> inline below.
> 
> fontsrv(4) provides an interface to use X11 fonts in plan9port. It is useful, 
> can be used to load anti-aliasing/TrueType fonts on acme.
> 
> eg:
> fontsrv &
> acme -f /mnt/font/"DejaVu Sans Mono"/8a/font
> 
> for list all available fonts:
> $ fontsrv & 
> $ 9p ls font
>  or
> $ fontsrv -p .
> 
> Well, by default it is enabled, but requires X11 headers and on openbsd the 
> plan9port/INSTALL script wasn't catching, therefore it was disabled.
> so I did a patch to adjust it, append /usr/X11R6/include and 
> /usr/X11R6/include/freetype2 to X11 headers check in ${WRKSRC}/INSTALL file 
> script.
> 
> I already sent patch[2] upstream...
> 
> [1] http://shutupandhack.org/~gsoares/openbsd/plan9port-20140306p0.diff
> [2] https://plan9port-review.googlesource.com/#/c/1290/
> 
> CC ports@ so others can also test and give us feedback.
> 
> comments, OK?
> 
> cheers,
> gsoares.
> 
> ? plan9port-20140306p0.diff
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/plan9/plan9port/Makefile,v
> retrieving revision 1.5
> diff -u -p -u -p -r1.5 Makefile
> --- Makefile  9 Mar 2014 20:26:48 -0000       1.5
> +++ Makefile  11 Jun 2015 05:12:54 -0000
> @@ -6,6 +6,7 @@ BROKEN-powerpc =      threading issues
>  COMMENT =            Plan 9 from user space
>  
>  DISTNAME =           plan9port-20140306
> +REVISION =           0
>  
>  CATEGORIES =         plan9
>  
> Index: patches/patch-INSTALL
> ===================================================================
> RCS file: /cvs/ports/plan9/plan9port/patches/patch-INSTALL,v
> retrieving revision 1.2
> diff -u -p -u -p -r1.2 patch-INSTALL
> --- patches/patch-INSTALL     9 Mar 2014 20:26:48 -0000       1.2
> +++ patches/patch-INSTALL     11 Jun 2015 05:12:55 -0000
> @@ -1,7 +1,24 @@
>  $OpenBSD: patch-INSTALL,v 1.2 2014/03/09 20:26:48 pascal Exp $
> ---- INSTALL.orig     Thu Mar  6 11:00:08 2014
> -+++ INSTALL  Sun Mar  9 20:58:02 2014
> -@@ -150,7 +150,7 @@ cd src
> +
> +INSTALL: append /usr/X11R6/include and /usr/X11R6/include/freetype2 to
> +X11 headers detection, so that enable fontsrv build on OpenBSD.
> +
> +patch sent upstream:
> +https://plan9port-review.googlesource.com/#/c/1290/
> +
> +--- INSTALL.orig     Thu Mar  6 07:00:08 2014
> ++++ INSTALL  Wed Jun 10 16:52:29 2015
> +@@ -128,7 +128,8 @@ fi
> + if [ `uname` != Darwin ]; then
> +     # Determine whether fontsrv X11 files are available.
> +     rm -f a.out
> +-    gcc -o a.out -c -Iinclude -I/usr/include -I/usr/local/include 
> -I/usr/include/freetype2 -I/usr/local/include/freetype2 src/cmd/fontsrv/x11.c 
> >/dev/null 2>&1
> ++    gcc -o a.out -c -Iinclude -I/usr/include -I/usr/local/include 
> -I/usr/include/freetype2 -I/usr/local/include/freetype2 \
> ++        -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 
> src/cmd/fontsrv/x11.c >/dev/null 2>&1

This should make use of ${X11BASE} instead of hardcoding /usr/X11R6.
Though in principle, /usr/local should be ${LOCALBASE} as well ...

> +     if [ -f a.out ]; then
> +             echo "  fontsrv dependencies found."
> +             echo "FONTSRV=fontsrv" >>$PLAN9/config
> +@@ -150,7 +151,7 @@ cd src
>   if $dobuild; then
>       if [ ! -x ../bin/mk ]; then
>               echo "* Building mk..."
> @@ -10,7 +27,7 @@ $OpenBSD: patch-INSTALL,v 1.2 2014/03/09
>       fi
>       if [ ! -x ../bin/mk ]; then
>               echo "* Error: mk failed to build."
> -@@ -158,7 +158,6 @@ if $dobuild; then
> +@@ -158,7 +159,6 @@ if $dobuild; then
>       fi
>       
>       echo "* Building everything (be patient)..."
> @@ -18,7 +35,7 @@ $OpenBSD: patch-INSTALL,v 1.2 2014/03/09
>       mk libs-nuke
>       mk all || exit 1
>       if [ ! -x $PLAN9/src/cmd/o.cleanname -o ! -x $PLAN9/src/cmd/acme/o.acme 
> ]; then
> -@@ -213,5 +212,5 @@ if $doinstall; then
> +@@ -213,5 +213,5 @@ if $doinstall; then
>       echo "  PLAN9=$PLAN9 export PLAN9"
>       echo '  PATH=$PATH:$PLAN9/bin export PATH'
>   fi
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/plan9/plan9port/pkg/PLIST,v
> retrieving revision 1.3
> diff -u -p -u -p -r1.3 PLIST
> --- pkg/PLIST 9 Mar 2014 20:26:48 -0000       1.3
> +++ pkg/PLIST 11 Jun 2015 05:12:58 -0000
> @@ -122,6 +122,7 @@ plan9/bin/doctype
>  @bin plan9/bin/factotum
>  @bin plan9/bin/file
>  @bin plan9/bin/fmt
> +@bin plan9/bin/fontsrv
>  @bin plan9/bin/fortune
>  plan9/bin/fossil/
>  plan9/bin/fossil/conf
> 

Reply via email to