pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/go go: Improve PRINT_PLIST_AWK patterns and avoid...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5991259461af
branches:  trunk
changeset: 324689:5991259461af
user:      leot <leot%pkgsrc.org@localhost>
date:      Fri Oct 26 13:49:23 2018 +0000

description:
go: Improve PRINT_PLIST_AWK patterns and avoid possible double definition

- Move GO_PLATFORM definition in lang/go/version.mk in order that also lang/go*
  packages can (re)use it
- Change PRINT_PLIST_AWK pattern that replace all ${GO_PLATFORM} and apply it
  only when ${GO_PLATFORM} is a directory (between two "/").  There are only
  3 exceptions to that in lang/go14.
  Move it to version.mk so lang/go* PLIST can be mostly automatically
  generated.

These changes should help to avoid (most) manual editing of
lang/go*/PLIST.

Discussed with and thanks to <bsiegert>!

diffstat:

 lang/go/go-package.mk |  6 +-----
 lang/go/version.mk    |  7 +++++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r 95d45263004e -r 5991259461af lang/go/go-package.mk
--- a/lang/go/go-package.mk     Fri Oct 26 12:52:43 2018 +0000
+++ b/lang/go/go-package.mk     Fri Oct 26 13:49:23 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: go-package.mk,v 1.19 2018/10/14 18:15:34 bsiegert Exp $
+# $NetBSD: go-package.mk,v 1.20 2018/10/26 13:49:23 leot Exp $
 #
 # This file implements common logic for compiling Go programs in pkgsrc.
 #
@@ -62,12 +62,8 @@
 
 BUILD_DEPENDS+=                ${GO_PACKAGE_DEP}
 
-GO_PLATFORM=           ${LOWER_OPSYS}_${GOARCH}
 GOTOOLDIR=             go${GOVERSSUFFIX}/pkg/tool/${GO_PLATFORM}
 
-PRINT_PLIST_AWK+=      /${GO_PLATFORM}/ { gsub(/${GO_PLATFORM}/, \
-                       "$${GO_PLATFORM}"); \
-                       print; next; }
 PRINT_PLIST_AWK+=      /^@pkgdir bin$$/ { next; }
 PRINT_PLIST_AWK+=      /^@pkgdir gopkg$$/ { next; }
 
diff -r 95d45263004e -r 5991259461af lang/go/version.mk
--- a/lang/go/version.mk        Fri Oct 26 12:52:43 2018 +0000
+++ b/lang/go/version.mk        Fri Oct 26 13:49:23 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: version.mk,v 1.46 2018/10/02 18:19:56 bsiegert Exp $
+# $NetBSD: version.mk,v 1.47 2018/10/26 13:49:23 leot Exp $
 
 SSP_SUPPORTED= no
 
@@ -44,5 +44,8 @@
 .elif ${MACHINE_ARCH} == "earmv7hf"
 GOOPT=         GOARM=7
 .endif
-PLIST_SUBST+=  GO_PLATFORM=${LOWER_OPSYS:Q}_${GOARCH:Q} GOARCH=${GOARCH:Q}
+GO_PLATFORM=   ${LOWER_OPSYS}_${GOARCH}
+PLIST_SUBST+=  GO_PLATFORM=${GO_PLATFORM:Q} GOARCH=${GOARCH:Q}
 PLIST_SUBST+=  GOCHAR=${GOCHAR:Q}
+
+PRINT_PLIST_AWK+=      { sub("/${GO_PLATFORM}/", "/$${GO_PLATFORM}/") }



Home | Main Index | Thread Index | Old Index