Wed Jul 14 18:38:58 2021 UTC ()
go-bin: Hide the signing removal behind DARWIN_CHROOTED.

Unfortunately stripping the signatures breaks running the binaries outside a
chroot according to schmonz, so we're left with no choice but to make this
user-configurable.  It took a lot of effort for me not to name this variable
something far ruder.

This will still mean the go-bin package is ultimately useless when shipped as
part of a package set, but really we only need it for bootstrapping a real
version which should work fine.


(jperkin)
diff -r1.7 -r1.8 pkgsrc/lang/go-bin/Makefile

cvs diff -r1.7 -r1.8 pkgsrc/lang/go-bin/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/go-bin/Makefile 2021/07/14 14:31:21 1.7
+++ pkgsrc/lang/go-bin/Makefile 2021/07/14 18:38:58 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.7 2021/07/14 14:31:21 jperkin Exp $ 1# $NetBSD: Makefile,v 1.8 2021/07/14 18:38:58 jperkin Exp $
2 2
3PKGNAME= go-bin-1.14.2 3PKGNAME= go-bin-1.14.2
4PKGREVISION= 4 4PKGREVISION= 4
5CATEGORIES= lang 5CATEGORIES= lang
6MASTER_SITES= https://dl.google.com/go/ 6MASTER_SITES= https://dl.google.com/go/
7 7
8MAINTAINER= tnn@NetBSD.org 8MAINTAINER= tnn@NetBSD.org
9HOMEPAGE= https://golang.org/ 9HOMEPAGE= https://golang.org/
10COMMENT= Bootstrap toolchain for lang/go* 10COMMENT= Bootstrap toolchain for lang/go*
11LICENSE= modified-bsd 11LICENSE= modified-bsd
12 12
13NO_BUILD= yes 13NO_BUILD= yes
14PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC 14PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC
@@ -75,25 +75,30 @@ EXTRACT_ONLY+= ${DIST.linux-arm64} @@ -75,25 +75,30 @@ EXTRACT_ONLY+= ${DIST.linux-arm64}
75 75
76ONLY_FOR_PLATFORM+= NetBSD-*-aarch64 76ONLY_FOR_PLATFORM+= NetBSD-*-aarch64
77DIST.netbsd-arm64= go1.14.2.netbsd-arm64.tar.gz 77DIST.netbsd-arm64= go1.14.2.netbsd-arm64.tar.gz
78SITES.${DIST.netbsd-arm64}= https://cdn.NetBSD.org/pub/pkgsrc/misc/tnn/golang-aarch64/ 78SITES.${DIST.netbsd-arm64}= https://cdn.NetBSD.org/pub/pkgsrc/misc/tnn/golang-aarch64/
79.if !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64) || make(distinfo) 79.if !empty(MACHINE_PLATFORM:MNetBSD-*-aarch64) || make(distinfo)
80DISTFILES+= ${DIST.netbsd-arm64} 80DISTFILES+= ${DIST.netbsd-arm64}
81EXTRACT_ONLY+= ${DIST.netbsd-arm64} 81EXTRACT_ONLY+= ${DIST.netbsd-arm64}
82.endif 82.endif
83 83
84INSTALLATION_DIRS+= go-bin 84INSTALLATION_DIRS+= go-bin
85 85
86do-install: 86do-install:
87 cd ${WRKSRC} && ${PAX} -rw . ${DESTDIR}${PREFIX}/go-bin 87 cd ${WRKSRC} && ${PAX} -rw . ${DESTDIR}${PREFIX}/go-bin
88.if !empty(MACHINE_PLATFORM:MDarwin-*-aarch64) 88#
 89# Removing the signatures is required to operate inside a chroot, but breaks
 90# running them outside. We're left with no choice but to make it configurable
 91# by the user.
 92#
 93.if !empty(MACHINE_PLATFORM:MDarwin-*-aarch64) && defined(DARWIN_CHROOTED)
89 for f in ${DESTDIR}${PREFIX}/go-bin/bin/* \ 94 for f in ${DESTDIR}${PREFIX}/go-bin/bin/* \
90 ${DESTDIR}${PREFIX}/go-bin/pkg/tool/darwin_arm64/*; do \ 95 ${DESTDIR}${PREFIX}/go-bin/pkg/tool/darwin_arm64/*; do \
91 /usr/bin/codesign --remove-signature $$f; \ 96 /usr/bin/codesign --remove-signature $$f; \
92 done 97 done
93.endif 98.endif
94 99
95post-install: 100post-install:
96 cd ${DESTDIR}${PREFIX} && find go-bin -type f -print \ 101 cd ${DESTDIR}${PREFIX} && find go-bin -type f -print \
97 > ${WRKDIR}/PLIST_DYNAMIC 102 > ${WRKDIR}/PLIST_DYNAMIC
98 103
99.include "../../mk/bsd.pkg.mk" 104.include "../../mk/bsd.pkg.mk"