Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] gitea: update to 1.12.1, fix cross build
@ 2020-07-10  6:31 fosslinux
  2020-07-10  6:50 ` [PR REVIEW] " ericonr
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10  6:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]

There is a new pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

gitea: update to 1.12.1, fix cross build
This template now uses gitea's upstream Makefile. This is because the
Makefile is the only official way to build. build_style=go is still used
because it provides things like GOARCH for cross building.

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We regenerate them ourselves because
1. weird crap on musl
2. no reason not to really and it's generally better

The configuration file has been moved from /etc/gitea.conf to
/etc/gitea/app.ini. This is the appropriate location and previously it
was not being read by gitea. Also, the configuration file changes have
been moved to a .patch because the changes were getting very dense and
difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

Internally, in the makefile, the go tags are created by the variable
TAGS. We set this. In addition, internally, they use LDFLAGS for the go
command. :( This has been patched.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 16289 bytes --]

From cfbb85ed139abdca7bfdfc4c88d7c98d2758b66b Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.1, fix cross build

This template now uses gitea's upstream Makefile. This is because the
Makefile is the only official way to build. build_style=go is still used
because it provides things like GOARCH for cross building.

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We regenerate them ourselves because
1. weird crap on musl
2. no reason not to really and it's generally better

The configuration file has been moved from /etc/gitea.conf to
/etc/gitea/app.ini. This is the appropriate location and previously it
was not being read by gitea. Also, the configuration file changes have
been moved to a .patch because the changes were getting very dense and
difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

Internally, in the makefile, the go tags are created by the variable
TAGS. We set this. In addition, internally, they use LDFLAGS for the go
command. :( This has been patched.
---
 srcpkgs/gitea/patches/10583.patch   |  23 -----
 srcpkgs/gitea/patches/12030.patch   |  72 +++++++++++++++
 srcpkgs/gitea/patches/config.patch  | 136 ++++++++++++++++++++++++++++
 srcpkgs/gitea/patches/ldflags.patch |  11 +++
 srcpkgs/gitea/template              |  52 +++++------
 5 files changed, 241 insertions(+), 53 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/12030.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch
 create mode 100644 srcpkgs/gitea/patches/ldflags.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/12030.patch b/srcpkgs/gitea/patches/12030.patch
new file mode 100644
index 00000000000..61fcff96c69
--- /dev/null
+++ b/srcpkgs/gitea/patches/12030.patch
@@ -0,0 +1,72 @@
+From 659f1307a2ffa9f6f7a86bbde1a0f9b3f545fad8 Mon Sep 17 00:00:00 2001
+From: silverwind <me@silverwind.io>
+Date: Tue, 23 Jun 2020 17:36:25 +0200
+Subject: [PATCH] Disable go module when downloading global binaries
+
+Prevent `go get` from touching `go.mod` and `go.sum` when executing
+global binaries during the build process. Once
+https://github.com/golang/go/issues/30515 is fixed, we should is
+whatever solution is provided there.
+
+Fixes: https://github.com/go-gitea/gitea/pull/12010
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git Makefile Makefile
+index 2b9abc46e0f..37af184945a 100644
+--- Makefile
++++ Makefile
+@@ -253,7 +253,7 @@ swagger-validate:
+ .PHONY: errcheck
+ errcheck:
+ 	@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/kisielk/errcheck; \
++		GO111MODULE=off $(GO) get -u github.com/kisielk/errcheck; \
+ 	fi
+ 	errcheck $(GO_PACKAGES)
+ 
+@@ -264,14 +264,14 @@ revive:
+ .PHONY: misspell-check
+ misspell-check:
+ 	@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/client9/misspell/cmd/misspell; \
++		GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
+ 	fi
+ 	misspell -error -i unknwon,destory $(GO_SOURCES_OWN)
+ 
+ .PHONY: misspell
+ misspell:
+ 	@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/client9/misspell/cmd/misspell; \
++		GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
+ 	fi
+ 	misspell -w -i unknwon $(GO_SOURCES_OWN)
+ 
+@@ -529,7 +529,7 @@ $(DIST_DIRS):
+ .PHONY: release-windows
+ release-windows: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
+@@ -539,7 +539,7 @@ endif
+ .PHONY: release-linux
+ release-linux: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
+@@ -549,7 +549,7 @@ endif
+ .PHONY: release-darwin
+ release-darwin: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/patches/ldflags.patch b/srcpkgs/gitea/patches/ldflags.patch
new file mode 100644
index 00000000000..b02b15cd065
--- /dev/null
+++ b/srcpkgs/gitea/patches/ldflags.patch
@@ -0,0 +1,11 @@
+--- Makefile	2020-07-10 12:25:58.893000000 +1000
++++ Makefile	2020-07-10 12:26:04.329000000 +1000
+@@ -84,7 +84,7 @@
+ 	endif
+ endif
+ 
+-LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
++LDFLAGS := $(GOLDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
+ 
+ GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list -mod=vendor ./... | grep -v /vendor/)))
+ 
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..3a9739144cf 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,7 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.1
 revision=1
+create_wrksrc=yes
+# The go build_style is very useful here as it provides a number of important
+# environment variables. As a result, we use build_style=go, just override
+# do_build.
 build_style=go
 go_import_path=code.gitea.io/gitea
 # This could be done with build options, but these are built in with the
@@ -20,53 +24,41 @@ go_import_path=code.gitea.io/gitea
 #   * tidb: This is an alternate database engine for users who would
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
-go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
-hostmakedepends="go-bindata git"
+_build_tags="bindata sqlite pam tidb"
+hostmakedepends="go-bindata git nodejs"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=8b72216460195d486e2d4c181d31f0447f4b93b4e00a750d2eebad5b9cae2259
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
 _gitea_shell="/bin/bash" # Proper shell needed for ssh support
 make_dirs="/var/lib/gitea 0755 _gitea _gitea
  /var/log/gitea 0755 _gitea root"
-conf_files="/etc/gitea.conf"
+conf_files="/etc/gitea/app.ini"
+
+post_extract() {
+	rm -rf node_modules/
+}
 
 pre_build() {
-	make generate
+	go mod vendor
+	make clean-all
 }
 
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+do_build() {
+	TAGS="${_build_tags}" make build
 }
 
-post_install() {
+do_install() {
+	vbin gitea
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
-	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
+	vinstall custom/conf/app.ini.sample 0640 /etc/gitea app.ini
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR REVIEW] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
@ 2020-07-10  6:50 ` ericonr
  2020-07-10  6:51 ` ericonr
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ericonr @ 2020-07-10  6:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#discussion_r452654119

Comment:
Isn't it easier to unset LDFLAGS when running `make`?

I guess the build failed when you didn't have this patch?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR REVIEW] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
  2020-07-10  6:50 ` [PR REVIEW] " ericonr
@ 2020-07-10  6:51 ` ericonr
  2020-07-10  8:52 ` [PR PATCH] [Updated] WIP " fosslinux
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ericonr @ 2020-07-10  6:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#discussion_r452654816

Comment:
LDFLAGS are being used for cgo afaiu, which can indeed use them.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Updated] WIP gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
  2020-07-10  6:50 ` [PR REVIEW] " ericonr
  2020-07-10  6:51 ` ericonr
@ 2020-07-10  8:52 ` fosslinux
  2020-07-10  8:53 ` [PR REVIEW] " fosslinux
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10  8:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

WIP gitea: update to 1.12.1, fix cross build
This template now uses gitea's upstream Makefile. This is because the
Makefile is the only official way to build. build_style=go is still used
because it provides things like GOARCH for cross building.

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We regenerate them ourselves because
1. weird crap on musl
2. no reason not to really and it's generally better

The configuration file has been moved from /etc/gitea.conf to
/etc/gitea/app.ini. This is the appropriate location and previously it
was not being read by gitea. Also, the configuration file changes have
been moved to a .patch because the changes were getting very dense and
difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

Internally, in the makefile, the go tags are created by the variable
TAGS. We set this. In addition, internally, they use LDFLAGS for the go
command. :( This has been patched.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 14291 bytes --]

From b6314401e39b26b00d5f3c0d60aa5270aeb3d79c Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.1, fix cross build

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.
---
 srcpkgs/gitea/patches/10583.patch  |  23 -----
 srcpkgs/gitea/patches/12030.patch  |  72 +++++++++++++++
 srcpkgs/gitea/patches/config.patch | 136 +++++++++++++++++++++++++++++
 srcpkgs/gitea/template             |  35 ++------
 4 files changed, 216 insertions(+), 50 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/12030.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/12030.patch b/srcpkgs/gitea/patches/12030.patch
new file mode 100644
index 00000000000..61fcff96c69
--- /dev/null
+++ b/srcpkgs/gitea/patches/12030.patch
@@ -0,0 +1,72 @@
+From 659f1307a2ffa9f6f7a86bbde1a0f9b3f545fad8 Mon Sep 17 00:00:00 2001
+From: silverwind <me@silverwind.io>
+Date: Tue, 23 Jun 2020 17:36:25 +0200
+Subject: [PATCH] Disable go module when downloading global binaries
+
+Prevent `go get` from touching `go.mod` and `go.sum` when executing
+global binaries during the build process. Once
+https://github.com/golang/go/issues/30515 is fixed, we should is
+whatever solution is provided there.
+
+Fixes: https://github.com/go-gitea/gitea/pull/12010
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git Makefile Makefile
+index 2b9abc46e0f..37af184945a 100644
+--- Makefile
++++ Makefile
+@@ -253,7 +253,7 @@ swagger-validate:
+ .PHONY: errcheck
+ errcheck:
+ 	@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/kisielk/errcheck; \
++		GO111MODULE=off $(GO) get -u github.com/kisielk/errcheck; \
+ 	fi
+ 	errcheck $(GO_PACKAGES)
+ 
+@@ -264,14 +264,14 @@ revive:
+ .PHONY: misspell-check
+ misspell-check:
+ 	@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/client9/misspell/cmd/misspell; \
++		GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
+ 	fi
+ 	misspell -error -i unknwon,destory $(GO_SOURCES_OWN)
+ 
+ .PHONY: misspell
+ misspell:
+ 	@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u github.com/client9/misspell/cmd/misspell; \
++		GO111MODULE=off $(GO) get -u github.com/client9/misspell/cmd/misspell; \
+ 	fi
+ 	misspell -w -i unknwon $(GO_SOURCES_OWN)
+ 
+@@ -529,7 +529,7 @@ $(DIST_DIRS):
+ .PHONY: release-windows
+ release-windows: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
+@@ -539,7 +539,7 @@ endif
+ .PHONY: release-linux
+ release-linux: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
+@@ -549,7 +549,7 @@ endif
+ .PHONY: release-darwin
+ release-darwin: | $(DIST_DIRS)
+ 	@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
+-		$(GO) get -u src.techknowlogick.com/xgo; \
++		GO111MODULE=off $(GO) get -u src.techknowlogick.com/xgo; \
+ 	fi
+ 	CGO_CFLAGS="$(CGO_CFLAGS)" GO111MODULE=off xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
+ ifeq ($(CI),drone)
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..81ea47ef3c7 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,9 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.1
 revision=1
+create_wrksrc=yes
 build_style=go
 go_import_path=code.gitea.io/gitea
+go_ldflags=" -X main.Version=${version}"
 # This could be done with build options, but these are built in with the
 # following justification.
 #   * bindata: running with things not all in the binary is not a
@@ -21,18 +23,16 @@ go_import_path=code.gitea.io/gitea
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
 go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
 hostmakedepends="go-bindata git"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=8b72216460195d486e2d4c181d31f0447f4b93b4e00a750d2eebad5b9cae2259
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
@@ -42,31 +42,12 @@ make_dirs="/var/lib/gitea 0755 _gitea _gitea
 conf_files="/etc/gitea.conf"
 
 pre_build() {
-	make generate
-}
-
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+	go mod vendor
+	CGO_CFLAGS= CGO_LDFLAGS= make generate
 }
 
 post_install() {
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
 	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR REVIEW] WIP gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (2 preceding siblings ...)
  2020-07-10  8:52 ` [PR PATCH] [Updated] WIP " fosslinux
@ 2020-07-10  8:53 ` fosslinux
  2020-07-10  8:56 ` [PR PATCH] [Updated] " fosslinux
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10  8:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#discussion_r452713405

Comment:
Patch removed.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Updated] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (3 preceding siblings ...)
  2020-07-10  8:53 ` [PR REVIEW] " fosslinux
@ 2020-07-10  8:56 ` fosslinux
  2020-07-10  9:44 ` fosslinux
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10  8:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

gitea: update to 1.12.1, fix cross build
The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 10815 bytes --]

From 59be5c2e6e1534e6f1d9c1c01c8aa827213ef54c Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.1, fix cross build

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.
---
 srcpkgs/gitea/patches/10583.patch  |  23 -----
 srcpkgs/gitea/patches/config.patch | 136 +++++++++++++++++++++++++++++
 srcpkgs/gitea/template             |  35 ++------
 3 files changed, 144 insertions(+), 50 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..81ea47ef3c7 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,9 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.1
 revision=1
+create_wrksrc=yes
 build_style=go
 go_import_path=code.gitea.io/gitea
+go_ldflags=" -X main.Version=${version}"
 # This could be done with build options, but these are built in with the
 # following justification.
 #   * bindata: running with things not all in the binary is not a
@@ -21,18 +23,16 @@ go_import_path=code.gitea.io/gitea
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
 go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
 hostmakedepends="go-bindata git"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=8b72216460195d486e2d4c181d31f0447f4b93b4e00a750d2eebad5b9cae2259
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
@@ -42,31 +42,12 @@ make_dirs="/var/lib/gitea 0755 _gitea _gitea
 conf_files="/etc/gitea.conf"
 
 pre_build() {
-	make generate
-}
-
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+	go mod vendor
+	CGO_CFLAGS= CGO_LDFLAGS= make generate
 }
 
 post_install() {
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
 	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (4 preceding siblings ...)
  2020-07-10  8:56 ` [PR PATCH] [Updated] " fosslinux
@ 2020-07-10  9:44 ` fosslinux
  2020-07-10 20:55 ` [PR REVIEW] " the-maldridge
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10  9:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#issuecomment-656587793

Comment:
Ok, sorry about that very bad first implementation where I wasted my and everyone else's time trying to get a stupid idea to work. :( I will think more carefully in future about why something is a certain way....

This is the same thing just simpler and with consideration and thinking and without stupidity.

Builds on all archs and runs on x86_64 x86_64-musl and aarch64 (tested)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR REVIEW] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (5 preceding siblings ...)
  2020-07-10  9:44 ` fosslinux
@ 2020-07-10 20:55 ` the-maldridge
  2020-07-10 22:40 ` [PR PATCH] [Updated] " fosslinux
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: the-maldridge @ 2020-07-10 20:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New review comment by the-maldridge on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#discussion_r453072590

Comment:
if you're using the provided tarballs, this step should no longer be needed.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Updated] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (6 preceding siblings ...)
  2020-07-10 20:55 ` [PR REVIEW] " the-maldridge
@ 2020-07-10 22:40 ` fosslinux
  2020-07-10 22:42 ` fosslinux
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10 22:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

gitea: update to 1.12.1, fix cross build
The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 10816 bytes --]

From 3430164f9b597609731edfe51602ac4237870470 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.1, fix cross build

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.
---
 srcpkgs/gitea/patches/10583.patch  |  23 -----
 srcpkgs/gitea/patches/config.patch | 136 +++++++++++++++++++++++++++++
 srcpkgs/gitea/template             |  35 ++------
 3 files changed, 144 insertions(+), 50 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..e4eca909ecc 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,9 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.1
 revision=1
+create_wrksrc=yes
 build_style=go
 go_import_path=code.gitea.io/gitea
+go_ldflags=" -X main.Version=${version}"
 # This could be done with build options, but these are built in with the
 # following justification.
 #   * bindata: running with things not all in the binary is not a
@@ -21,18 +23,16 @@ go_import_path=code.gitea.io/gitea
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
 go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
 hostmakedepends="go-bindata git"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=8b72216460195d486e2d4c181d31f0447f4b93b4e00a750d2eebad5b9cae2259
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
@@ -42,31 +42,12 @@ make_dirs="/var/lib/gitea 0755 _gitea _gitea
 conf_files="/etc/gitea.conf"
 
 pre_build() {
-	make generate
-}
-
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+	go mod vendor
+#	CGO_CFLAGS= CGO_LDFLAGS= make generate
 }
 
 post_install() {
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
 	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Updated] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (7 preceding siblings ...)
  2020-07-10 22:40 ` [PR PATCH] [Updated] " fosslinux
@ 2020-07-10 22:42 ` fosslinux
  2020-07-10 22:42 ` [PR REVIEW] " fosslinux
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10 22:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

gitea: update to 1.12.1, fix cross build
The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 10774 bytes --]

From be9b124c5992ca6d3d3f16f8b3fb4007aaf99eb3 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.1, fix cross build

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.
---
 srcpkgs/gitea/patches/10583.patch  |  23 -----
 srcpkgs/gitea/patches/config.patch | 136 +++++++++++++++++++++++++++++
 srcpkgs/gitea/template             |  34 ++------
 3 files changed, 143 insertions(+), 50 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..97c5425230b 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,9 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.1
 revision=1
+create_wrksrc=yes
 build_style=go
 go_import_path=code.gitea.io/gitea
+go_ldflags=" -X main.Version=${version}"
 # This could be done with build options, but these are built in with the
 # following justification.
 #   * bindata: running with things not all in the binary is not a
@@ -21,18 +23,16 @@ go_import_path=code.gitea.io/gitea
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
 go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
 hostmakedepends="go-bindata git"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=8b72216460195d486e2d4c181d31f0447f4b93b4e00a750d2eebad5b9cae2259
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
@@ -42,31 +42,11 @@ make_dirs="/var/lib/gitea 0755 _gitea _gitea
 conf_files="/etc/gitea.conf"
 
 pre_build() {
-	make generate
-}
-
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+	go mod vendor
 }
 
 post_install() {
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
 	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR REVIEW] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (8 preceding siblings ...)
  2020-07-10 22:42 ` fosslinux
@ 2020-07-10 22:42 ` fosslinux
  2020-07-12  5:33 ` [PR PATCH] [Updated] " fosslinux
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-10 22:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

New review comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#discussion_r453108619

Comment:
You are correct, checked.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Updated] gitea: update to 1.12.1, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (9 preceding siblings ...)
  2020-07-10 22:42 ` [PR REVIEW] " fosslinux
@ 2020-07-12  5:33 ` fosslinux
  2020-07-12  7:20 ` gitea: update to 1.12.2, " fosslinux
  2020-07-12  8:06 ` [PR PATCH] [Merged]: " the-maldridge
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-12  5:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages gitea-cross
https://github.com/void-linux/void-packages/pull/23505

gitea: update to 1.12.1, fix cross build
The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

@the-maldridge 

A patch file from https://github.com/void-linux/void-packages/pull/23505.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gitea-cross-23505.patch --]
[-- Type: text/x-diff, Size: 10487 bytes --]

From ed03c2ed68e9274c70637e34e76ceaf42dae3a4b Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Fri, 10 Jul 2020 15:07:32 +1000
Subject: [PATCH] gitea: update to 1.12.2, fix cross build

The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.
---
 srcpkgs/gitea/patches/10583.patch  |  23 -----
 srcpkgs/gitea/patches/config.patch | 136 +++++++++++++++++++++++++++++
 srcpkgs/gitea/template             |  34 ++------
 3 files changed, 143 insertions(+), 50 deletions(-)
 delete mode 100644 srcpkgs/gitea/patches/10583.patch
 create mode 100644 srcpkgs/gitea/patches/config.patch

diff --git a/srcpkgs/gitea/patches/10583.patch b/srcpkgs/gitea/patches/10583.patch
deleted file mode 100644
index 74c8ac3934b..00000000000
--- a/srcpkgs/gitea/patches/10583.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 1830d0ed5f4a67e3360ecbb55933b5540b6affce Mon Sep 17 00:00:00 2001
-From: zeripath <art27@cantab.net>
-Date: Tue, 3 Mar 2020 03:37:10 +0000
-Subject: [PATCH] Remove unnecessary parentheses in template
-
-Fix #10552
----
- templates/repo/wiki/view.tmpl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
-index f160deedbd5..26ed049e63e 100644
---- templates/repo/wiki/view.tmpl
-+++ templates/repo/wiki/view.tmpl
-@@ -45,7 +45,7 @@
- 					{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
- 						<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
- 					{{end}}
--					{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
-+					{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
- 						<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
- 							{{svg "octicon-clippy" 16}}
- 						</button>
diff --git a/srcpkgs/gitea/patches/config.patch b/srcpkgs/gitea/patches/config.patch
new file mode 100644
index 00000000000..e5833d9a31b
--- /dev/null
+++ b/srcpkgs/gitea/patches/config.patch
@@ -0,0 +1,136 @@
+--- custom/conf/app.ini.sample.orig	2020-06-22 08:49:03.000000000 +1000
++++ custom/conf/app.ini.sample	2020-07-10 10:53:31.047000000 +1000
+@@ -7,12 +7,12 @@
+ ; App name that shows in every page title
+ APP_NAME = Gitea: Git with a cup of tea
+ ; Change it if you run locally
+-RUN_USER = git
++RUN_USER = _gitea
+ ; Either "dev", "prod" or "test", default is "dev"
+-RUN_MODE = dev
++RUN_MODE = prod
+ 
+ [repository]
+-ROOT =
++ROOT = /var/lib/gitea/repositories
+ SCRIPT_TYPE = bash
+ ; Default ANSI charset
+ ANSI_CHARSET =
+@@ -62,16 +62,16 @@
+ PREVIEWABLE_FILE_MODES = markdown
+ 
+ [repository.local]
+-; Path for local repository copy. Defaults to `tmp/local-repo`
+-LOCAL_COPY_PATH = tmp/local-repo
+-; Path for local wiki copy. Defaults to `tmp/local-wiki`
+-LOCAL_WIKI_PATH = tmp/local-wiki
++; Path for local repository copy. Defaults to `/var/lib/gitea/tmp/local-repo`
++LOCAL_COPY_PATH = /var/lib/gitea/tmp/local-repo
++; Path for local wiki copy. Defaults to `/var/lib/gitea/tmp/local-wiki`
++LOCAL_WIKI_PATH = /var/lib/gitea/tmp/local-wiki
+ 
+ [repository.upload]
+ ; Whether repository file uploads are enabled. Defaults to `true`
+ ENABLED = true
+ ; Path for uploads. Defaults to `data/tmp/uploads` (tmp gets deleted on gitea restart)
+-TEMP_PATH = data/tmp/uploads
++TEMP_PATH = /var/lib/gitea/tmp/uploads
+ ; One or more allowed types, e.g. image/jpeg|image/png. Nothing means any file type
+ ALLOWED_TYPES =
+ ; Max size of each file in megabytes. Defaults to 3MB
+@@ -248,7 +248,7 @@
+ REDIRECT_OTHER_PORT = false
+ PORT_TO_REDIRECT = 80
+ ; Permission for unix socket
+-UNIX_SOCKET_PERMISSION = 666
++UNIX_SOCKET_PERMISSION = 660
+ ; Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service.
+ ; In most cases you do not need to change the default value.
+ ; Alter it only if your SSH server node is not the same as HTTP node.
+@@ -269,7 +269,7 @@
+ ; The port number the builtin SSH server should listen on
+ SSH_LISTEN_PORT = %(SSH_PORT)s
+ ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
+-SSH_ROOT_PATH =
++SSH_ROOT_PATH = /var/lib/gitea
+ ; Gitea will create a authorized_keys file by default when it is not using the internal ssh server
+ ; If you intend to use the AuthorizedKeysCommand functionality then you should turn this off.
+ SSH_CREATE_AUTHORIZED_KEYS_FILE = true
+@@ -308,7 +308,7 @@
+ KEY_FILE = https/key.pem
+ ; Root directory containing templates and static files.
+ ; default is the path where Gitea is executed
+-STATIC_ROOT_PATH =
++STATIC_ROOT_PATH = /var/lib/gitea
+ ; Default path for App data
+ APP_DATA_PATH = data
+ ; Application level GZIP support
+@@ -325,7 +325,7 @@
+ ; Enables git-lfs support. true or false, default is false.
+ LFS_START_SERVER = false
+ ; Where your lfs files reside, default is data/lfs.
+-LFS_CONTENT_PATH = data/lfs
++LFS_CONTENT_PATH = /var/lib/gitea/lfs
+ ; LFS authentication secret, change this yourself
+ LFS_JWT_SECRET =
+ ; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
+@@ -355,7 +355,7 @@
+ 
+ [database]
+ ; Database to use. Either "mysql", "postgres", "mssql" or "sqlite3".
+-DB_TYPE = mysql
++DB_TYPE = sqlite3
+ HOST = 127.0.0.1:3306
+ NAME = gitea
+ USER = root
+@@ -372,7 +372,7 @@
+ ; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
+ CHARSET = utf8
+ ; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
+-PATH = data/gitea.db
++PATH = /var/lib/gitea/data/gitea.db
+ ; For "sqlite3" only. Query timeout
+ SQLITE_TIMEOUT = 500
+ ; For iterate buffer, default is 50
+@@ -398,7 +398,7 @@
+ ; Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
+ ISSUE_INDEXER_NAME = gitea_issues
+ ; Issue indexer storage path, available when ISSUE_INDEXER_TYPE is bleve
+-ISSUE_INDEXER_PATH = indexers/issues.bleve
++ISSUE_INDEXER_PATH = /var/lib/gitea/indexers/issues.bleve
+ ; Issue indexer queue, currently support: channel, levelqueue or redis, default is levelqueue
+ ISSUE_INDEXER_QUEUE_TYPE = levelqueue
+ ; When ISSUE_INDEXER_QUEUE_TYPE is levelqueue, this will be the queue will be saved path,
+@@ -706,7 +706,7 @@
+ SESSION_LIFE_TIME = 86400
+ 
+ [picture]
+-AVATAR_UPLOAD_PATH = data/avatars
++AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
+ REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
+ ; How Gitea deals with missing repository avatars
+ ; none = no avatar will be displayed; random = random avatar will be displayed; image = default image will be used
+@@ -751,7 +751,7 @@
+ DEFAULT_UI_LOCATION =
+ 
+ [log]
+-ROOT_PATH =
++ROOT_PATH = /var/log/gitea
+ ; Either "console", "file", "conn", "smtp" or "database", default is "console"
+ ; Use comma to separate multiple modes, e.g. "console, file"
+ MODE = console
+@@ -968,14 +968,6 @@
+ sv-SE = sv
+ ko-KR = ko
+ 
+-[U2F]
+-; NOTE: THE DEFAULT VALUES HERE WILL NEED TO BE CHANGED
+-; Two Factor authentication with security keys
+-; https://developers.yubico.com/U2F/App_ID.html
+-;APP_ID = http://localhost:3000/
+-; Comma seperated list of trusted facets
+-;TRUSTED_FACETS = http://localhost:3000/
+-
+ ; Extension mapping to highlight class
+ ; e.g. .toml=ini
+ [highlight.mapping]
diff --git a/srcpkgs/gitea/template b/srcpkgs/gitea/template
index 8302757d4e6..7f7a4e687de 100644
--- a/srcpkgs/gitea/template
+++ b/srcpkgs/gitea/template
@@ -1,9 +1,11 @@
 # Template file for 'gitea'
 pkgname=gitea
-version=1.11.6
+version=1.12.2
 revision=1
+create_wrksrc=yes
 build_style=go
 go_import_path=code.gitea.io/gitea
+go_ldflags=" -X main.Version=${version}"
 # This could be done with build options, but these are built in with the
 # following justification.
 #   * bindata: running with things not all in the binary is not a
@@ -21,18 +23,16 @@ go_import_path=code.gitea.io/gitea
 #     rather not use SQLite3 for some reason.  It is also potentially
 #     more resiliant to corrupted writes.
 go_build_tags="bindata sqlite pam tidb"
-go_ldflags=" -X main.Version=${version}"
 hostmakedepends="go-bindata git"
 makedepends="sqlite-devel pam-devel"
 depends="git bash"
 short_desc="Git with a cup of Tea"
-maintainer="Michael Aldridge <maldridge@voidlinux.org>"
+maintainer="fosslinux <fosslinux@aussies.space>"
 license="MIT"
 homepage="https://gitea.io"
 changelog="https://github.com/go-gitea/gitea/blob/master/CHANGELOG.md"
-distfiles="https://github.com/go-gitea/gitea/archive/v${version}.tar.gz"
-checksum=ab6dcc47d3ba3441c8b343bfc2db9bae0a6ea3cae53519211adfd7e4e2716db9
-nocross="https://api.travis-ci.org/v3/job/616733825/log.txt"
+distfiles="https://github.com/go-gitea/gitea/releases/download/v${version}/gitea-src-${version}.tar.gz"
+checksum=695dae81327bdfaa4adaa9d3dc9d2bdcb78d54ac73abac3a630750465858ff8b
 
 system_accounts="_gitea"
 _gitea_homedir="/var/lib/gitea"
@@ -42,31 +42,11 @@ make_dirs="/var/lib/gitea 0755 _gitea _gitea
 conf_files="/etc/gitea.conf"
 
 pre_build() {
-	make generate
-}
-
-pre_install() {
-	sed -i \
-		'/RUN_USER/s:git:_gitea:
-		s:666:660:
-		/RUN_MODE/s:dev:prod:
-		/DB_TYPE/s:mysql:sqlite3:
-		s:ROOT =:& /var/lib/gitea/repositories:
-		s:tmp/local-repo:/var/lib/gitea/&:
-		s:tmp/local-wiki:/var/lib/gitea/&:
-		/TEMP_PATH/s:data/tmp/uploads:/var/lib/gitea/tmp/uploads:
-		/LFS_CONTENT/s:data/lfs:/var/lib/gitea/lfs:
-		s:data/gitea.db:/var/lib/gitea/&:
-		s:indexers/issues.bleve:/var/lib/gitea/&:
-		s:data/avatars:/var/lib/gitea/&:
-		s:SSH_ROOT_PATH =:& /var/lib/gitea:
-		s:STATIC_ROOT_PATH =:& /var/lib/gitea:
-		s:^ROOT_PATH =:& /var/log/gitea:' custom/conf/app.ini.sample
+	go mod vendor
 }
 
 post_install() {
 	vlicense LICENSE
 	vsv gitea
-	sed -e '/^\[U2F\]$/,/^$/d' -i custom/conf/app.ini.sample
 	vinstall custom/conf/app.ini.sample 0640 /etc gitea.conf
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: gitea: update to 1.12.2, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (10 preceding siblings ...)
  2020-07-12  5:33 ` [PR PATCH] [Updated] " fosslinux
@ 2020-07-12  7:20 ` fosslinux
  2020-07-12  8:06 ` [PR PATCH] [Merged]: " the-maldridge
  12 siblings, 0 replies; 14+ messages in thread
From: fosslinux @ 2020-07-12  7:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23505#issuecomment-657185460

Comment:
@the-maldridge Can you look at this again when you get a minute

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PR PATCH] [Merged]: gitea: update to 1.12.2, fix cross build
  2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
                   ` (11 preceding siblings ...)
  2020-07-12  7:20 ` gitea: update to 1.12.2, " fosslinux
@ 2020-07-12  8:06 ` the-maldridge
  12 siblings, 0 replies; 14+ messages in thread
From: the-maldridge @ 2020-07-12  8:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

There's a merged pull request on the void-packages repository

gitea: update to 1.12.2, fix cross build
https://github.com/void-linux/void-packages/pull/23505

Description:
The upstream tarball has been changed to gitea's hand-generated ones
because of the recent sha256sum debacle, as well as their existence
(they should be preferred). In addition, create_wrksrc=yes is now
required.

gitea also now uses nodejs to generate css and js files. However, in the
tarballs, they pre-generate them. We use this.

Configuration file changes have been moved to a .patch because the changes
were getting very dense and difficult to read in a sed.

There was a strange error with go modules which was meant to be fixed by
an upstream patch. 12030.patch is this patch. It doesn't work completely
but is fully fixed by running `go mod vendor` in pre_build (NB: the
patch is still needed). This may not be nessecary for the next release.

@the-maldridge 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-07-12  8:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10  6:31 [PR PATCH] gitea: update to 1.12.1, fix cross build fosslinux
2020-07-10  6:50 ` [PR REVIEW] " ericonr
2020-07-10  6:51 ` ericonr
2020-07-10  8:52 ` [PR PATCH] [Updated] WIP " fosslinux
2020-07-10  8:53 ` [PR REVIEW] " fosslinux
2020-07-10  8:56 ` [PR PATCH] [Updated] " fosslinux
2020-07-10  9:44 ` fosslinux
2020-07-10 20:55 ` [PR REVIEW] " the-maldridge
2020-07-10 22:40 ` [PR PATCH] [Updated] " fosslinux
2020-07-10 22:42 ` fosslinux
2020-07-10 22:42 ` [PR REVIEW] " fosslinux
2020-07-12  5:33 ` [PR PATCH] [Updated] " fosslinux
2020-07-12  7:20 ` gitea: update to 1.12.2, " fosslinux
2020-07-12  8:06 ` [PR PATCH] [Merged]: " the-maldridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).