void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.49k stars 2.11k forks source link

Package request: forgejo #41815

Open tranzystorekk opened 1 year ago

tranzystorekk commented 1 year ago

Package name

forgejo

Package homepage

https://forgejo.org/

Description

Forgejo is a community-driven soft fork of Gitea.

I have previously attempted to package it (#41410), but since there's no consensus on whether this is different enough from Gitea itself, I wanted to post my template here so that anyone interested can use it: https://github.com/tranzystorekk/void-packages/blob/forgejo/srcpkgs/forgejo/template

Does the requested package meet the package requirements?

System, Compiled

Is the requested package released?

Yes

BlitDev commented 1 year ago

When will it be merged, who knows?

tranzystorekk commented 1 year ago

@BlitDev not likely in the foreseeable future:

since there's no consensus on whether this is different enough from Gitea itself,

This part hasn't changed, and it is reasonable that maintaining two almost identical projects at the same time is an effort no maintainer will accept lightly.

tranzystorekk commented 9 months ago

https://forgejo.org/2023-11-release-v1211-0/#what-is-unique-to-forgejo

Recent contribution licensing frictions between Gitea and Forgejo will result in divergent changes in Forgejo starting from v1.21. This might start warranting another package.

Vinfall commented 1 month ago

Forgejo announced to be a hard fork back in February in Forgejo forks its own path forward and following semver it is a crazy v7.0.5. It should be acceptable now I guess?

Vinfall commented 1 month ago

Cannot make runit service running, maybe I messed up. Here is the updated patch in case anyone wanna do it.

Patch

```diff Subject: [PATCH] New package: forgejo-7.0.5 --- srcpkgs/forgejo/INSTALL | 5 +++++ srcpkgs/forgejo/files/forgejo/run | 13 ++++++++++++ srcpkgs/forgejo/template | 34 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 srcpkgs/forgejo/INSTALL create mode 100755 srcpkgs/forgejo/files/forgejo/run create mode 100644 srcpkgs/forgejo/template diff --git a/srcpkgs/forgejo/INSTALL b/srcpkgs/forgejo/INSTALL new file mode 100644 index 00000000..fadddd89 --- /dev/null +++ b/srcpkgs/forgejo/INSTALL @@ -0,0 +1,5 @@ +case "${ACTION}" in +post) + chown _forgejo:_forgejo etc/forgejo/app.ini + ;; +esac diff --git a/srcpkgs/forgejo/files/forgejo/run b/srcpkgs/forgejo/files/forgejo/run new file mode 100755 index 00000000..84c7167d --- /dev/null +++ b/srcpkgs/forgejo/files/forgejo/run @@ -0,0 +1,13 @@ +#!/bin/sh +exec 2>&1 + +# USER and HOME are needed because gitea doesn't actually check the user it +# runs as, but instead just grabs the variables from the variables. +export USER=_forgejo +export HOME=/var/lib/forgejo + +# forgejo needs to run from its home for SSH to work properly +export FORGEJO_WORK_DIR="${HOME}" + +cd "${HOME}" +exec chpst -u _forgejo:_forgejo forgejo web --config /etc/forgejo/app.ini 2>&1 diff --git a/srcpkgs/forgejo/template b/srcpkgs/forgejo/template new file mode 100644 index 00000000..851e49d7 --- /dev/null +++ b/srcpkgs/forgejo/template @@ -0,0 +1,34 @@ +# Template file for 'forgejo' +pkgname=forgejo +version=7.0.5 +revision=1 +_forgejo_tag="7-0-5" +build_style=go +go_import_path=code.gitea.io/gitea +go_ldflags=" -X main.Version=${version}" +# Follow forgejo default release build and enable pam support additionally +go_build_tags="bindata timetzdata sqlite sqlite_unlock_notify pam" +hostmakedepends="go-bindata" +makedepends="sqlite-devel pam-devel" +depends="git git-lfs bash" +short_desc="Self-hosted lightweight software forge" +maintainer="" +license="MIT" +homepage="https://forgejo.org" +changelog="https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${_forgejo_tag}" +distfiles="https://codeberg.org/forgejo/forgejo/releases/download/v${version}/forgejo-src-${version}.tar.gz" +checksum=647efd8b70e312e1d8aa349a535bae1c9cce5c095a7a2ebe0d0b0ec84ff1e198 + +system_accounts="_forgejo" +_forgejo_homedir="/var/lib/forgejo" +_forgejo_shell="/bin/bash" # Proper shell needed for ssh support +make_dirs="/var/lib/forgejo 0750 _forgejo _forgejo + /var/log/forgejo 0755 _forgejo root" +conf_files="/etc/forgejo/app.ini" + + +post_install() { + vlicense LICENSE + vsv forgejo + vinstall custom/conf/app.example.ini 0640 /etc/forgejo app.ini +} -- 2.45.2 ```

I think tests should also be added following Compiling from source and go_import_path is definitely wrong. Anyway I'd just use prebuild binary instead.