Re: plan9port: enable fontsrv(4)

2015-06-11 Thread Gleydson Soares
> > This should make use of ${X11BASE} instead of hardcoding /usr/X11R6.
> > Though in principle, /usr/local should be ${LOCALBASE} as well ...
> > 
> 
> In addition to pascal's comment, can you change also the lines with
> "gcc" hardcoded to ${CC}?

yes, makes sense,
diff attached with pascal's points and plus your tweak.

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
--- Makefile9 Mar 2014 20:26:48 -   1.5
+++ Makefile11 Jun 2015 16:04:40 -
@@ -6,6 +6,7 @@ BROKEN-powerpc =threading issues
 COMMENT =  Plan 9 from user space
 
 DISTNAME = plan9port-20140306
+REVISION = 0
 
 CATEGORIES =   plan9
 
@@ -37,6 +38,8 @@ PLAN9 =   ${PREFIX}/plan9
 
 NO_TEST =  Yes
 
+SUBST_VARS+=   CC
+
 post-extract:
cd ${WRKSRC}/dict && tar xjf ${FULLDISTDIR}/pgw.tar.bz2
cd ${WRKSRC}/dict && tar xjf ${FULLDISTDIR}/roget.tar.bz2
@@ -48,7 +51,8 @@ post-patch:
OpenBSD-x86_64-asm.S
find ${WRKSRC} -name .cvsignore -exec rm -f {} \;
cd ${WRKSRC} && rm -rf .hg .hgignore .hgtags
-
+pre-configure:
+   ${SUBST_CMD} ${WRKSRC}/INSTALL
 do-build:
cd ${WRKSRC} && env CC9="${CC}" CCFLAGS="${CFLAGS}" ./INSTALL -b
 
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 -   1.2
+++ patches/patch-INSTALL   11 Jun 2015 16:04:40 -
@@ -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
-+++ INSTALLSun 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
 INSTALLWed Jun 10 20:03:02 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
++  ${CC} -o a.out -c -Iinclude -I/usr/include -I${LOCALBASE}/include 
-I/usr/include/freetype2 -I${LOCALBASE}/include/freetype2 \
++  -I${X11BASE}/include -I${X11BASE}/include/freetype2 
src/cmd/fontsrv/x11.c >/dev/null 2>&1
+   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 -   1.3
+++ pkg/PLIST   11 Jun 2015 16:04:42 -
@@ -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


Re: plan9port: enable fontsrv(4)

2015-06-11 Thread Juan Francisco Cantero Hurtado
On Thu, Jun 11, 2015 at 08:32:40AM +0200, Pascal Stumpf wrote:
> 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
> > --- Makefile9 Mar 2014 20:26:48 -   1.5
> > +++ Makefile11 Jun 2015 05:12:54 -
> > @@ -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 -   1.2
> > +++ patches/patch-INSTALL   11 Jun 2015 05:12:55 -
> > @@ -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
> > -+++ INSTALLSun 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
> >  INSTALLWed 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 ...
> 

In addition to pascal's comment, can you change also the lines with
"gcc" hardcoded to ${CC}?

> > +   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 -   1.3
> > +++ pkg/PLIST   11 Jun 2015 05:12:58 -
> > @@ -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

Re: plan9port: enable fontsrv(4)

2015-06-11 Thread Gleydson Soares
> This should make use of ${X11BASE} instead of hardcoding /usr/X11R6.
> Though in principle, /usr/local should be ${LOCALBASE} as well ...

Yup. forgot it.
attached diff without those hardcoded paths.

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
--- Makefile9 Mar 2014 20:26:48 -   1.5
+++ Makefile11 Jun 2015 14:59:26 -
@@ -6,6 +6,7 @@ BROKEN-powerpc =threading issues
 COMMENT =  Plan 9 from user space
 
 DISTNAME = plan9port-20140306
+REVISION = 0
 
 CATEGORIES =   plan9
 
@@ -48,7 +49,8 @@ post-patch:
OpenBSD-x86_64-asm.S
find ${WRKSRC} -name .cvsignore -exec rm -f {} \;
cd ${WRKSRC} && rm -rf .hg .hgignore .hgtags
-
+pre-configure:
+   ${SUBST_CMD} ${WRKSRC}/INSTALL
 do-build:
cd ${WRKSRC} && env CC9="${CC}" CCFLAGS="${CFLAGS}" ./INSTALL -b
 
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 -   1.2
+++ patches/patch-INSTALL   11 Jun 2015 14:59:26 -
@@ -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
-+++ INSTALLSun 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
 INSTALLWed Jun 10 18:56:52 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${LOCALBASE}/include 
-I/usr/include/freetype2 -I${LOCALBASE}/include/freetype2 \
++  -I${X11BASE}/include -I${X11BASE}/include/freetype2 
src/cmd/fontsrv/x11.c >/dev/null 2>&1
+   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 -   1.3
+++ pkg/PLIST   11 Jun 2015 14:59:31 -
@@ -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


Re: plan9port: enable fontsrv(4)

2015-06-11 Thread Pascal Stumpf
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 -   1.5
> +++ Makefile  11 Jun 2015 05:12:54 -
> @@ -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 -   1.2
> +++ patches/patch-INSTALL 11 Jun 2015 05:12:55 -
> @@ -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 -   1.3
> +++ pkg/PLIST 11 Jun 2015 05:12:58 -
> @@ -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
>