pkgsrc-WIP-changes archive

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

Makefile cleanup. Request for feedback.



Module Name:	pkgsrc-wip
Committed By:	bkrawczyk <bbartlomiej%gmail.com@localhost>
Pushed By:	bkrawczyk
Date:		Sun Jan 24 13:16:13 2021 +0100
Changeset:	ead3ca10adb128a192f15c09d67f49c108fa16ff

Modified Files:
	adguardhome/Makefile
	adguardhome/distinfo

Log Message:
Makefile cleanup. Request for feedback.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ead3ca10adb128a192f15c09d67f49c108fa16ff

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

diffstat:
 adguardhome/Makefile | 42 +++++++++++++++++++++++++++---------------
 adguardhome/distinfo |  4 ++++
 2 files changed, 31 insertions(+), 15 deletions(-)

diffs:
diff --git a/adguardhome/Makefile b/adguardhome/Makefile
index c6d7cabcc9..31ec27f1e6 100644
--- a/adguardhome/Makefile
+++ b/adguardhome/Makefile
@@ -1,47 +1,59 @@
 # $NetBSD$
 
-
 .include "go-modules.mk"
 
 GITHUB_PROJECT=	AdGuardHome
 GITHUB_TAG=	v0.104.3
 DISTNAME=	v0.104.3
-PKGNAME=	adguardhome-${DISTNAME:S,^v,,}
+PKGNAME=	${GITHUB_PROJECT}-${DISTNAME:S,^v,,}
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_GITHUB:=AdguardTeam/}
 EXTRACT_SUFX=	.zip
 DIST_SUBDIR=	${GITHUB_PROJECT}
 
+FRONTEND=           ${PKGNAME_NOREV}-frontend.tar.gz
+SITES.AdGuardHome-0.104.3-frontend.tar.gz=	https://cloud.krawczyk.it/     
+DISTFILES=          ${DEFAULT_DISTFILES} ${FRONTEND}
+
 MAINTAINER=	bbartlomiej%gmail.com@localhost
 HOMEPAGE=	https://github.com/AdguardTeam/AdGuardHome/
 COMMENT=	Free and open source, network-wide ads & trackers blocking DNS server
 LICENSE=	gnu-gpl-v3
 
-WRKSRC=		${WRKDIR}/adguardhome-0.104.3
-USE_LANGUAGES=	# none
-
-#BUILD_DEPENDS+= npm>=6.14:../../lang/npm
-#BUILD_DEPENDS+=	nodejs>=10.16:../../lang/nodejs
-
+WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
 PKG_SYSCONFSUBDIR=	adguardhome
 
-.include "../../lang/go/go-vars.mk"
+USE_TOOLS+=	tar
+#USE_LANGUAGES=	# none
+
+# This software requires some frontend assets which are generated by npm and
+# nodejs packages. To build those asses please uncomment below variables and
+# run generate-frontend target. Next the resulting archive has to be uploaded
+# to distfile location on pkgsrc distfile server. This has to be done once per
+# package version by pkgsrc maintainer and only when those assets change. The
+# reason is if npm commands are run during the build doznes of npm packages
+# would get downloaded bypassing pkgsrc fetch model.
+#BUILD_DEPENDS+=	npm>=6.14:../../lang/npm
+#BUILD_DEPENDS+=	nodejs>=10.16:../../lang/nodejs
 
-PREPEND_PATH+=	${WRKDIR}/.gopath/bin
-MAKE_ENV+=      GO111MODULE=on GOPATH=${WRKDIR}/.gopath GOPROXY=file://${WRKDIR}/.goproxy
-MAKE_ENV+=      GOCACHE=${WRKDIR}/.cache/go-build
 
 do-build:
 	${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO} generate ./...
 	${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO} build -ldflags="-s -w -X main.version=${DISTNAME:S,^v,,} -X main.channel=release -X main.goarm=${GOARM}"
 
-.PHONY: generate-client
-generate-client:
+.PHONY: generate-frontend
+generate-frontend:
 	# You need to have npm >=6.14:../../lang/npm and
 	# nodejs>=10.16:../../lang/nodejs to build this part. Next it has to be
 	# uploaded to distfile location on pkgsrc distfile server.
-	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --prefix client run build-prod
 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --prefix client ci
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --prefix client run build-prod
+	cd ${WRKDIR} && ${TAR} -zcf ${WRKDIR}/${PKGNAME_NOREV}-frontend.tar.gz ${PKGNAME_NOREV}/build
+	@${ECHO} "Now upload ${WRKDIR}/${PKGNAME_NOREV}-frontend.tar.gz to LOCAL_PORTS"
+
+.include "../../mk/bsd.prefs.mk"
+
+PREPEND_PATH+= ${WRKDIR}/.gopath/bin
 
 .include "../../lang/go/go-module.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/adguardhome/distinfo b/adguardhome/distinfo
index 41993a7671..51c94c40c0 100644
--- a/adguardhome/distinfo
+++ b/adguardhome/distinfo
@@ -1,5 +1,9 @@
 $NetBSD$
 
+SHA1 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = c4c93793a84f5469a168f5908a79e4de618896c9
+RMD160 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 37a7a35fbd0d7ce89ae06b248d5b5d1d3b1c9f03
+SHA512 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 088e97fd2c1f06a79891061661046f7613253c997f4ec590077b73225e4535fa60a788c4f6b55ad6aa29a670fc459d4d1cd79ea3e08eb8b9e627fb9d9a4f8e4c
+Size (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 2298109 bytes
 SHA1 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 8293f3ba79a69f4176a8f80fba7311b4f03e179e
 RMD160 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 072627a02c6b01bbb485da13d664567e3064d7ab
 SHA512 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 5132f3438533427c0ab0fbb7a12112a7830ea9122662ed46019ff89c71d9cf80c02edc32dd5c892da572031b5a2cce100f2602fa6a19bea6be7c02781f701273


Home | Main Index | Thread Index | Old Index