Re: lang/go-bootstrap: Makefile improvements

2018-05-05 Thread Klemens Nanni
On Fri, May 04, 2018 at 04:14:20AM +1000, Joel Sing wrote:
> On Saturday 07 April 2018 01:04:59 Klemens Nanni wrote:
> > Same thing as with lang/go: Simplify do-install, combine finds,
> > fix space/tab mixtures.
> > 
> > Feedback? OK?
Updated diff after feedback from jsing@.

OK?

> > +GOBIN =pkg/tool/${GOCFG}
> 
> GOTOOLS
Done.

> >  do-test:
> > @cd ${WRKSRC} && \
> > ulimit -n 256 -d 2097152 && \
> > -   PATH=${WRKDIST}/bin:${PATH} GOROOT=${WRKDIST} ./run.bash
> > +   PATH=${WRKDIST}/bin:${PATH} \
> > +   GOROOT=${WRKDIST} \
> > +   ./run.bash
> 
> Same comment re readability - either revert, or indent such that it is 
> obvious 
> what the env is for.
Indented as done in the lang/go diff as well.

> > -.  for dir in doc include lib misc src pkg
> > -   @cd ${WRKDIST} && \
> > -   find ${dir} -type d \
> > -   -exec ${INSTALL_DATA_DIR} \
> > -   ${GOROOT}/{} \;
> > -   @cd ${WRKDIST} && \
> > -   find ${dir} ! -name \*.orig -type f \
> > -   -exec ${INSTALL_DATA} -p {} \
> > -   ${GOROOT}/{} \;
> > -.  endfor
> > +   @find ${WRKDIST} -maxdepth 1 -type f ! -name .git\* ! -name .hg\* \
> > +   -exec ${INSTALL_DATA} -p {} ${GOROOT} \;
> > +
> > +.for dir in doc include lib misc src pkg
> > +   cd ${WRKDIST} && \
> > +   find ${dir} -type d \
> > +   -exec ${INSTALL_DATA_DIR} ${GOROOT}/{} \; \
> > +   -o -type f ! -name \*.orig \
> > +   -exec ${INSTALL_DATA} -p {} ${GOROOT}/{} \;
> > +.endfor
> 
> Indentation appears messed up here - it should be for.
Done.

Index: Makefile
===
RCS file: /cvs/ports/lang/go-bootstrap/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile5 Apr 2018 17:47:30 -   1.9
+++ Makefile5 May 2018 13:45:34 -
@@ -6,19 +6,19 @@ COMMENT = Go programming language
 
 VERSION =  1.4
 RELEASE =  20171003
-DISTNAME = go${VERSION}-bootstrap-${RELEASE}
-PKGNAME =  go-bootstrap-${VERSION}.${RELEASE}
+DISTNAME = go${VERSION}-bootstrap-${RELEASE}
+PKGNAME =  go-bootstrap-${VERSION}.${RELEASE}
 CATEGORIES =   lang
 REVISION = 0
 
 HOMEPAGE = https://golang.org/
 
-MAINTAINER =   Joel Sing 
+MAINTAINER =   Joel Sing 
 
 # software: BSD, documentation: CC-BY-3.0
 PERMIT_PACKAGE_CDROM = bootstrap only
 PERMIT_PACKAGE_FTP =   bootstrap only
-PERMIT_DISTFILES_FTP =  bootstrap only
+PERMIT_DISTFILES_FTP = bootstrap only
 
 WANTLIB =  c m pthread
 
@@ -35,9 +35,9 @@ WRKSRC =  ${WRKDIST}/src
 
 INSTALL_STRIP =
 
-GOOS = openbsd
+GOOS = openbsd
 GOARCH =   unknown
-GOROOT =   ${PREFIX}/go/bootstrap
+GOROOT =   ${PREFIX}/go/bootstrap
 
 .if ${MACHINE_ARCH} == "amd64"
 GOARCH =   amd64
@@ -50,11 +50,13 @@ EXEPREFIX = 8
 PKG_ARGS +=-Damd64=0
 PKG_ARGS +=-Di386=1
 .else
-PKG_ARGS +=-Damd64=0 -Di386=0
+PKG_ARGS +=-Damd64=0
+PKG_ARGS +=-Di386=0
 .endif
 
 GOCFG =/${GOOS}_${GOARCH}
 GOEXE =${GOCFG}/${EXEPREFIX}
+GOTOOLS =  pkg/tool/${GOCFG}
 
 do-configure:
 .  if ${GOARCH} == "unknown"
@@ -62,7 +64,6 @@ do-configure:
@exit 1
 .  endif
 
-
 do-build:
@cd ${WRKSRC} && \
CC="${CC}" \
@@ -75,7 +76,9 @@ do-build:
 do-test:
@cd ${WRKSRC} && \
ulimit -n 256 -d 2097152 && \
-   PATH=${WRKDIST}/bin:${PATH} GOROOT=${WRKDIST} ./run.bash
+   PATH=${WRKDIST}/bin:${PATH} \
+   GOROOT=${WRKDIST} \
+   ./run.bash
 
 do-install:
${INSTALL_PROGRAM_DIR} ${GOROOT}
@@ -83,25 +86,19 @@ do-install:
${INSTALL_PROGRAM_DIR} ${GOROOT}/bin
${INSTALL_PROGRAM} -p ${WRKDIST}/bin/go{,fmt} ${GOROOT}/bin
 
-   @cd ${WRKDIST} && \
-   find . ! -name .git\* ! -name .hg\* -type f -maxdepth 1 \
-   -exec ${INSTALL_DATA} -p {} \
-   ${GOROOT} \;
+   @find ${WRKDIST} -maxdepth 1 -type f ! -name .git\* ! -name .hg\* \
+   -exec ${INSTALL_DATA} -p {} ${GOROOT} \;
 
 .  for dir in doc include lib misc src pkg
-   @cd ${WRKDIST} && \
+   cd ${WRKDIST} && \
find ${dir} -type d \
-   -exec ${INSTALL_DATA_DIR} \
-   ${GOROOT}/{} \;
-   @cd ${WRKDIST} && \
-   find ${dir} ! -name \*.orig -type f \
-   -exec 

Re: lang/go-bootstrap: Makefile improvements

2018-04-18 Thread Klemens Nanni
On Sat, Apr 07, 2018 at 01:04:59AM +0200, Klemens Nanni wrote:
> Same thing as with lang/go: Simplify do-install, combine finds,
> fix space/tab mixtures.
> 
> Feedback? OK?
Bump.

Index: Makefile
===
RCS file: /cvs/ports/lang/go-bootstrap/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile5 Apr 2018 17:47:30 -   1.9
+++ Makefile18 Apr 2018 18:57:39 -
@@ -6,19 +6,19 @@ COMMENT = Go programming language
 
 VERSION =  1.4
 RELEASE =  20171003
-DISTNAME = go${VERSION}-bootstrap-${RELEASE}
-PKGNAME =  go-bootstrap-${VERSION}.${RELEASE}
+DISTNAME = go${VERSION}-bootstrap-${RELEASE}
+PKGNAME =  go-bootstrap-${VERSION}.${RELEASE}
 CATEGORIES =   lang
 REVISION = 0
 
 HOMEPAGE = https://golang.org/
 
-MAINTAINER =   Joel Sing 
+MAINTAINER =   Joel Sing 
 
 # software: BSD, documentation: CC-BY-3.0
 PERMIT_PACKAGE_CDROM = bootstrap only
 PERMIT_PACKAGE_FTP =   bootstrap only
-PERMIT_DISTFILES_FTP =  bootstrap only
+PERMIT_DISTFILES_FTP = bootstrap only
 
 WANTLIB =  c m pthread
 
@@ -35,26 +35,25 @@ WRKSRC =${WRKDIST}/src
 
 INSTALL_STRIP =
 
-GOOS = openbsd
+GOOS = openbsd
 GOARCH =   unknown
-GOROOT =   ${PREFIX}/go/bootstrap
+GOROOT =   ${PREFIX}/go/bootstrap
 
 .if ${MACHINE_ARCH} == "amd64"
 GOARCH =   amd64
 EXEPREFIX =6
-PKG_ARGS +=-Damd64=1
-PKG_ARGS +=-Di386=0
+PKG_ARGS +=-Damd64=1 -Di386=0
 .elif ${MACHINE_ARCH} == "i386"
 GOARCH =   386
 EXEPREFIX =8
-PKG_ARGS +=-Damd64=0
-PKG_ARGS +=-Di386=1
+PKG_ARGS +=-Damd64=0 -Di386=1
 .else
 PKG_ARGS +=-Damd64=0 -Di386=0
 .endif
 
 GOCFG =/${GOOS}_${GOARCH}
 GOEXE =${GOCFG}/${EXEPREFIX}
+GOBIN =pkg/tool/${GOCFG}
 
 do-configure:
 .  if ${GOARCH} == "unknown"
@@ -62,7 +61,6 @@ do-configure:
@exit 1
 .  endif
 
-
 do-build:
@cd ${WRKSRC} && \
CC="${CC}" \
@@ -75,7 +73,9 @@ do-build:
 do-test:
@cd ${WRKSRC} && \
ulimit -n 256 -d 2097152 && \
-   PATH=${WRKDIST}/bin:${PATH} GOROOT=${WRKDIST} ./run.bash
+   PATH=${WRKDIST}/bin:${PATH} \
+   GOROOT=${WRKDIST} \
+   ./run.bash
 
 do-install:
${INSTALL_PROGRAM_DIR} ${GOROOT}
@@ -83,25 +83,19 @@ do-install:
${INSTALL_PROGRAM_DIR} ${GOROOT}/bin
${INSTALL_PROGRAM} -p ${WRKDIST}/bin/go{,fmt} ${GOROOT}/bin
 
-   @cd ${WRKDIST} && \
-   find . ! -name .git\* ! -name .hg\* -type f -maxdepth 1 \
-   -exec ${INSTALL_DATA} -p {} \
-   ${GOROOT} \;
-
-.  for dir in doc include lib misc src pkg
-   @cd ${WRKDIST} && \
-   find ${dir} -type d \
-   -exec ${INSTALL_DATA_DIR} \
-   ${GOROOT}/{} \;
-   @cd ${WRKDIST} && \
-   find ${dir} ! -name \*.orig -type f \
-   -exec ${INSTALL_DATA} -p {} \
-   ${GOROOT}/{} \;
-.  endfor
+   @find ${WRKDIST} -maxdepth 1 -type f ! -name .git\* ! -name .hg\* \
+   -exec ${INSTALL_DATA} -p {} ${GOROOT} \;
+
+.for dir in doc include lib misc src pkg
+   cd ${WRKDIST} && \
+   find ${dir} -type d \
+   -exec ${INSTALL_DATA_DIR} ${GOROOT}/{} \; \
+   -o -type f ! -name \*.orig \
+   -exec ${INSTALL_DATA} -p {} ${GOROOT}/{} \;
+.endfor
 
# These get installed via `find' however we need them to be executable
-   ${INSTALL_PROGRAM_DIR} ${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
-   ${INSTALL_PROGRAM} -p ${WRKDIST}/pkg/tool/${GOOS}_${GOARCH}/* \
-   ${GOROOT}/pkg/tool/${GOOS}_${GOARCH}
+   ${INSTALL_PROGRAM_DIR} ${GOROOT}/${GOBIN}
+   ${INSTALL_PROGRAM} -p ${WRKDIST}/${GOBIN}/* ${GOROOT}/${GOBIN}
 
 .include 
===
Stats: --- 30 lines 943 chars
Stats: +++ 24 lines 825 chars
Stats: -6 lines
Stats: -118 chars