pkgsrc-Changes archive

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

CVS commit: pkgsrc/net/syncthing



Module Name:    pkgsrc
Committed By:   tnn
Date:           Wed Aug 29 13:27:40 UTC 2018

Modified Files:
        pkgsrc/net/syncthing: Makefile distinfo
Added Files:
        pkgsrc/net/syncthing/patches: patch-build.go

Log Message:
syncthing: use go-package.mk instead of custom Makefile rules


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 pkgsrc/net/syncthing/Makefile
cvs rdiff -u -r1.60 -r1.61 pkgsrc/net/syncthing/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/syncthing/patches/patch-build.go

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/syncthing/Makefile
diff -u pkgsrc/net/syncthing/Makefile:1.74 pkgsrc/net/syncthing/Makefile:1.75
--- pkgsrc/net/syncthing/Makefile:1.74  Sat Jul 28 09:03:25 2018
+++ pkgsrc/net/syncthing/Makefile       Wed Aug 29 13:27:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.74 2018/07/28 09:03:25 wiz Exp $
+# $NetBSD: Makefile,v 1.75 2018/08/29 13:27:40 tnn Exp $
 
 # Upstream regularly breaks protocol compatibility.  While users of
 # pkgsrc syncthing on multiple systems can update synchronously, an
@@ -16,6 +16,7 @@
 DISTNAME=      syncthing-0.14.49
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=syncthing/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
 
 # Minor version updates may be committed without asking.  Major
 # updates not following the above policy will be reverted.
@@ -24,43 +25,16 @@ HOMEPAGE=   https://syncthing.net/
 MAINTAINER=    gdt%NetBSD.org@localhost
 LICENSE=       mpl-2.0
 
-# System pax fails on NetBSD 6.  Just use gtar until this is understood.
-EXTRACT_USING=         gtar
-
-GITHUB_TAG=    v${PKGVERSION_NOREV}
-
-.include "../../lang/go/version.mk"
-
-BUILD_DEPENDS+=                go-${GO_VERSION}*:../../lang/go
+# System pax fails on NetBSD 6.  Just use bsdtar until this is understood.
+EXTRACT_USING=         bsdtar
 
 # The 'zillode' dependency calls the compiler on certain archs.
 USE_LANGUAGES=         c
 NO_CONFIGURE=          yes
-
+GO_SRCPATH=            github.com/syncthing/syncthing
+GO_DIST_BASE=          ${PKGNAME_NOREV}
 INSTALLATION_DIRS=     bin
 
-# Go has very strong notions of how building is supposed to work, and
-# paths.  Until 0.14, syncthing had symlink workarounds to have
-# sources be found via a gopath directory.  Then, building failed
-# because the sources are not a subdirectory of a component of GOPATH..
-# See the following discussion for some hints.
-# http://stackoverflow.com/questions/18149601/go-install-always-fails-no-install-directory-outside-gopath#18164310
-
-# Upstream's build instructions say to place tarball contents under a
-# particular named subdirectory of gopath:
-# https://docs.syncthing.net/dev/building.html
-# We attempt to follow their instructions as closely as possible.
-
-# We set up a gopath directory, and a directory where we will place
-# the tarball contents.  We use the non-standard variable name
-# WRKPLACE so that we can let WRKSRC refer to where pkgsrc naturally
-# unpacked the tarball.
-GOPATH=                        ${WRKDIR}/gopath
-WRKPLACEP=             ${GOPATH}/src/github.com/syncthing
-WRKPLACE=              ${WRKPLACEP}/syncthing
-
-MAKE_ENV+=             GOPATH=${GOPATH} GOCACHE=${WRKDIR}/.cache
-
 CHECK_RELRO_SKIP+=     bin/syncthing
 
 SUBST_CLASSES+=                version
@@ -71,21 +45,11 @@ SUBST_SED.version=  -e 's|runError("git",
 SUBST_SED.version+=    -e 's|runError("git", "show", "-s", "--format=%ct")|runError("false")|'
 SUBST_SED.version+=    -e 's|"go"|"${GO}"|'
 
-SUBST_CLASSES+=                go                              
-SUBST_STAGE.go=                pre-build                                      
-SUBST_MESSAGE.go=      Fixing go executable reference             
-SUBST_FILES.go=                lib/auto/doc.go cmd/strelaypoolsrv/auto/doc.go        
-SUBST_SED.go+=         -e 's|go run|"${GO}" run|'                      
-
-# Create WRKPLACE's parent, but not WRKPLACE.  Move the contents of
-# the distribution tarball to the directory name desired by upstream's
-# build instructions.  Make a symlink so that the rest of the pkgsrc
-# machinery that expects ${WRKSRC} to contain the tarball contents
-# works.
-post-extract:
-       ${MKDIR} ${GOPATH}/src/github.com/syncthing/
-       ${MV} ${WRKSRC} ${WRKPLACE}
-       ${LN} -s ${WRKPLACE} ${WRKSRC}
+SUBST_CLASSES+=                go
+SUBST_STAGE.go=                pre-build
+SUBST_MESSAGE.go=      Fixing go executable reference
+SUBST_FILES.go=                lib/auto/doc.go cmd/strelaypoolsrv/auto/doc.go
+SUBST_SED.go+=         -e 's|go run|"${GO}" run|'
 
 do-build:
        cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO} run build.go build syncthing
@@ -94,4 +58,5 @@ do-build:
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/syncthing ${DESTDIR}/${PREFIX}/bin
 
+.include "../../lang/go/go-package.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/net/syncthing/distinfo
diff -u pkgsrc/net/syncthing/distinfo:1.60 pkgsrc/net/syncthing/distinfo:1.61
--- pkgsrc/net/syncthing/distinfo:1.60  Wed Jul 25 21:30:45 2018
+++ pkgsrc/net/syncthing/distinfo       Wed Aug 29 13:27:40 2018
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.60 2018/07/25 21:30:45 abs Exp $
+$NetBSD: distinfo,v 1.61 2018/08/29 13:27:40 tnn Exp $
 
 SHA1 (syncthing-0.14.49.tar.gz) = d64904882847e54d138c93b832c090b2807618f9
 RMD160 (syncthing-0.14.49.tar.gz) = bd5d0dfb80a2577f2f506eedf3ec6727112b27da
 SHA512 (syncthing-0.14.49.tar.gz) = 7a9974e0d45582c5f184165456ea8fcaca0f7ba07a01b9f8eb2de1e1f0410ca36dc978ddde9c725a2b9d08bae8286fc2ce67595a0e510cbfe22fde9cdd9fc694
 Size (syncthing-0.14.49.tar.gz) = 10952008 bytes
+SHA1 (patch-build.go) = 9fc31a4bcb251e299b671903f540839f45a9bf32

Added files:

Index: pkgsrc/net/syncthing/patches/patch-build.go
diff -u /dev/null pkgsrc/net/syncthing/patches/patch-build.go:1.1
--- /dev/null   Wed Aug 29 13:27:40 2018
+++ pkgsrc/net/syncthing/patches/patch-build.go Wed Aug 29 13:27:40 2018
@@ -0,0 +1,19 @@
+$NetBSD: patch-build.go,v 1.1 2018/08/29 13:27:40 tnn Exp $
+
+Without this I get:
+
+open /usr/pkg/go/pkg/netbsd_amd64/runtime/cgo.a: permission denied
+
+when building as non-root.
+
+--- build.go.orig      2018-07-10 15:40:06.000000000 +0000
++++ build.go
+@@ -440,7 +440,7 @@ func build(target target, tags []string)
+ 
+       rmr(target.BinaryName())
+ 
+-      args := []string{"build", "-i", "-v"}
++      args := []string{"build", "-v"}
+       args = appendParameters(args, tags, target)
+ 
+       os.Setenv("GOOS", goos)



Home | Main Index | Thread Index | Old Index