diff options
author | jperkin <jperkin@pkgsrc.org> | 2020-05-21 13:35:12 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2020-05-21 13:35:12 +0000 |
commit | 4abe31de364ecc79dcbc3eb98419d22482ded543 (patch) | |
tree | 6ea3467c6c88e329d1a9f95fb00071eb395247c7 /www | |
parent | a1fedfd2d007ee80f87f7e48aac6be61f6807e18 (diff) | |
download | pkgsrc-4abe31de364ecc79dcbc3eb98419d22482ded543.tar.gz |
gitea: Various fixes.
Add a target to generate the frontend artefacts that are required at
runtime, but do not build them by default as they require nodejs/npm which
will download node modules during the build. Instead use a pre-built copy
stored in LOCAL_PORTS. The web interface should now look correct.
Use the supplied Makefile to simplify some of the targets.
Remove unnecessary MAKE_DIRS (shadows an OWN_DIRS_PERMS), and fix
permissions on some of the installed files.
Based on joyent/pkgsrc#263 from GitHub user teutat3s.
Diffstat (limited to 'www')
-rw-r--r-- | www/gitea/Makefile | 55 | ||||
-rw-r--r-- | www/gitea/PLIST | 8 | ||||
-rw-r--r-- | www/gitea/distinfo | 7 | ||||
-rw-r--r-- | www/gitea/patches/patch-Makefile | 15 |
4 files changed, 65 insertions, 20 deletions
diff --git a/www/gitea/Makefile b/www/gitea/Makefile index f130db1059e..c691f72d10d 100644 --- a/www/gitea/Makefile +++ b/www/gitea/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.33 2020/05/17 14:50:40 nia Exp $ +# $NetBSD: Makefile,v 1.34 2020/05/21 13:35:12 jperkin Exp $ DISTNAME= gitea-1.11.5 MASTER_SITES= ${MASTER_SITE_GITHUB:=go-gitea/} @@ -13,19 +13,30 @@ LICENSE= mit GO_DIST_BASE= ${DISTNAME} GO_SRCPATH= code.gitea.io/gitea -.include "../../lang/go/go-vars.mk" -.include "options.mk" +FRONTEND= ${DISTNAME}-frontend.tar.gz +SITES.${FRONTEND}= ${MASTER_SITE_LOCAL} +DISTFILES:= ${DEFAULT_DISTFILES} ${FRONTEND} + +BUILD_TARGET= backend -.if !empty(GO_TAGS) -GO_BUILD_PATTERN+= -tags "${GO_TAGS}" -.endif +# +# When updating this package it is necessary to build the front-end artefacts +# and upload them to LOCAL_PORTS. Doing this at build time is untenable as npm +# will download a significant number of modules. +# +# Install nodejs>=10 and npm, uncomment the additional BUILD_TARGET, run the +# generate-artefacts target, then upload the distfile to LOCAL_PORTS. +# +#BUILD_TARGET+= frontend +# -GO_BUILD_PATTERN+= ${GO_SRCPATH} +.include "../../lang/go/go-vars.mk" +.include "options.mk" BUILD_DEFS+= VARBASE GITEA_USER GITEA_GROUP EXTRACT_USING= bsdtar -USE_TOOLS+= pax +USE_TOOLS+= ggrep gmake pax tar DEPENDS+= git-base-[0-9]*:../../devel/git-base EGDIR= ${PREFIX}/share/examples/gitea @@ -50,21 +61,12 @@ PKG_USERS= ${GITEA_USER}:${GITEA_GROUP} PKG_SHELL.${GITEA_USER}= ${SH} PKG_HOME.${GITEA_USER}= ${VARBASE}/db/gitea -SUBST_CLASSES+= fix-version -SUBST_STAGE.fix-version= pre-configure -SUBST_MESSAGE.fix-version= Fix the outdated version number. -SUBST_FILES.fix-version= main.go -SUBST_SED.fix-version= -e 's,^\( Version = \)"1\.9\.0-dev",\1"${PKGVERSION}",' -SUBST_NOOP_OK.fix-version= no - SUBST_CLASSES+= fix-var SUBST_STAGE.fix-var= pre-configure SUBST_MESSAGE.fix-var= Replace some vars SUBST_FILES.fix-var= ${WRKDIR}/app.ini.sample SUBST_VARS.fix-var= VARBASE GITEA_USER -MAKE_DIRS+= ${PKG_SYSCONFDIR}/conf - CONF_FILES_PERMS+= ${EGDIR}/app.ini.sample ${PKG_SYSCONFDIR}/conf/app.ini \ ${GITEA_USER} ${GITEA_GROUP} 0600 @@ -75,17 +77,34 @@ FILES_SUBST+= GITEA_SHARE_DIR=${PREFIX}/share/gitea RCD_SCRIPTS+= gitea +MAKE_ENV+= TAGS="${GO_TAGS}" + pre-patch: ${CP} ${FILESDIR}/app.ini.sample ${WRKDIR}/ + ${CP} ${WRKDIR}/${DISTNAME}/.eslint* ${WRKSRC}/ + ${CP} ${WRKDIR}/${DISTNAME}/.stylelintrc ${WRKSRC}/ + ${ECHO} ${PKGVERSION_NOREV} > ${WRKSRC}/VERSION + +do-build: + cd ${WRKSRC} && ${BUILD_MAKE_CMD} ${BUILD_TARGET} do-install: - ${INSTALL_PROGRAM} ${WRKDIR}/bin/gitea ${DESTDIR}${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKSRC}/gitea ${DESTDIR}${PREFIX}/sbin cd ${WRKSRC}/options && ${PAX} -rw -pp . ${DESTDIR}${PREFIX}/share/gitea/options/ cd ${WRKSRC}/templates && ${PAX} -rw -pp . ${DESTDIR}${PREFIX}/share/gitea/templates/ cd ${WRKSRC}/public && ${PAX} -rw -pp . ${DESTDIR}${PREFIX}/share/gitea/public/ + cd ${WRKDIR}/public && ${PAX} -rw -pp . ${DESTDIR}${PREFIX}/share/gitea/public/ + ${CHMOD} -R g-w ${DESTDIR}${PREFIX}/share/gitea + ${CHMOD} -x ${DESTDIR}${PREFIX}/share/gitea/public/vendor/plugins/tribute/tribute.css + ${CHMOD} -x ${DESTDIR}${PREFIX}/share/gitea/public/vendor/plugins/tribute/tribute.min.js post-install: ${INSTALL_DATA} ${WRKDIR}/app.ini.sample ${DESTDIR}${EGDIR} +.PHONY: generate-frontend +generate-frontend: build + cd ${WRKSRC} && ${TAR} -zcf ${WRKDIR}/${PKGNAME_NOREV}-frontend.tar.gz public/css public/js + @${ECHO} "Now upload ${WRKDIR}/${PKGNAME_NOREV}-frontend.tar.gz to LOCAL_PORTS" + .include "../../lang/go/go-package.mk" .include "../../mk/bsd.pkg.mk" diff --git a/www/gitea/PLIST b/www/gitea/PLIST index da5562df9c4..ca4487a8f64 100644 --- a/www/gitea/PLIST +++ b/www/gitea/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.6 2020/03/09 11:06:16 nia Exp $ +@comment $NetBSD: PLIST,v 1.7 2020/05/21 13:36:12 jperkin Exp $ sbin/gitea share/examples/gitea/app.ini.sample share/gitea/options/gitignore/Actionscript @@ -660,6 +660,8 @@ share/gitea/options/locale/locale_zh-CN.ini share/gitea/options/locale/locale_zh-HK.ini share/gitea/options/locale/locale_zh-TW.ini share/gitea/options/readme/Default +share/gitea/public/css/index.css +share/gitea/public/css/theme-arc-green.css share/gitea/public/img/404.png share/gitea/public/img/500.png share/gitea/public/img/auth/bitbucket.png @@ -690,6 +692,10 @@ share/gitea/public/img/openid-16x16.png share/gitea/public/img/repo_default.png share/gitea/public/img/slack.png share/gitea/public/img/telegram.png +share/gitea/public/js/gitgraph.js +share/gitea/public/js/gitgraph.js.map +share/gitea/public/js/index.js +share/gitea/public/js/index.js.map share/gitea/public/vendor/VERSIONS share/gitea/public/vendor/assets/font-awesome/LICENSE share/gitea/public/vendor/assets/font-awesome/css/LICENSE diff --git a/www/gitea/distinfo b/www/gitea/distinfo index 2dbd538d799..a6f6fdbeb29 100644 --- a/www/gitea/distinfo +++ b/www/gitea/distinfo @@ -1,6 +1,11 @@ -$NetBSD: distinfo,v 1.20 2020/05/17 14:50:40 nia Exp $ +$NetBSD: distinfo,v 1.21 2020/05/21 13:36:12 jperkin Exp $ +SHA1 (gitea-1.11.5-frontend.tar.gz) = 262d7161cbfa663624094e44307ec4f32d182698 +RMD160 (gitea-1.11.5-frontend.tar.gz) = 7b1790a486d86d0043f98dcfd9a8d75696b6bfc7 +SHA512 (gitea-1.11.5-frontend.tar.gz) = 2350c0d8a71b2b5157b5158be90b4ef70dcf7779dd551082340a7bc44d999a79f57f779a412ffcd9d83b67210b31e0bd1c9c530acbf3ef89aa3fb4ed34b16255 +Size (gitea-1.11.5-frontend.tar.gz) = 304761 bytes SHA1 (gitea-1.11.5.tar.gz) = bc8ca807775578f0ffdc73e8d8c68b28211878c4 RMD160 (gitea-1.11.5.tar.gz) = 942aabda1f4efe5a9cc5778a2283558c2d97e39b SHA512 (gitea-1.11.5.tar.gz) = ba80ba77f6f761a03d062d5ceaacf0d2f9a7c5ad3c414f3d34ff31ee37ac00c4af562ecba0f14c6dca3ad2012e6cbfd8aea105dd87cfb06aedc80cf22a9ff12b Size (gitea-1.11.5.tar.gz) = 28249501 bytes +SHA1 (patch-Makefile) = e24daca412c8213a5cc8f312bb258b24d20e6407 diff --git a/www/gitea/patches/patch-Makefile b/www/gitea/patches/patch-Makefile new file mode 100644 index 00000000000..6e0c6c1e905 --- /dev/null +++ b/www/gitea/patches/patch-Makefile @@ -0,0 +1,15 @@ +$NetBSD: patch-Makefile,v 1.1 2020/05/21 13:36:12 jperkin Exp $ + +Exclude LDFLAGS, this is not C. + +--- Makefile.orig 2020-05-09 19:26:27.000000000 +0000 ++++ Makefile +@@ -49,7 +49,7 @@ else + endif + endif + +-LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" ++LDFLAGS := -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" + + PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/))) + |