Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/gitea/
Date: Thu, 16 Jul 2020 14:39:17
Message-Id: 1594910321.80f55aa072437aeeea95b359fa9982115471be99.juippis@gentoo
1 commit: 80f55aa072437aeeea95b359fa9982115471be99
2 Author: Pierre-Olivier Mercier <nemunaire <AT> nemunai <DOT> re>
3 AuthorDate: Wed Jun 10 15:06:14 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 16 14:38:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80f55aa0
7
8 www-apps/gitea: sync -9999 ebuild
9
10 Suggested-by: William Hubbs <williamh <AT> gentoo.org>
11 Closes: https://bugs.gentoo.org/725000
12 Package-Manager: Portage-2.3.99, Repoman-2.3.22
13 Signed-off-by: Pierre-Olivier Mercier <nemunaire <AT> nemunai.re>
14 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
15
16 www-apps/gitea/gitea-9999.ebuild | 105 ++++++++++++++++-----------------------
17 1 file changed, 42 insertions(+), 63 deletions(-)
18
19 diff --git a/www-apps/gitea/gitea-9999.ebuild b/www-apps/gitea/gitea-9999.ebuild
20 index 0d1559ca4a3..672af6461ca 100644
21 --- a/www-apps/gitea/gitea-9999.ebuild
22 +++ b/www-apps/gitea/gitea-9999.ebuild
23 @@ -2,70 +2,42 @@
24 # Distributed under the terms of the GNU General Public License v2
25
26 EAPI=7
27 -
28 -if [[ ${PV} != 9999* ]] ; then
29 - SCM="golang-vcs-snapshot"
30 -else
31 - SCM="git-r3"
32 -fi
33 -
34 -inherit fcaps golang-base tmpfiles systemd ${SCM}
35 -unset SCM
36 -
37 -EGO_PN="code.gitea.io/gitea"
38 +inherit fcaps go-module tmpfiles systemd
39 +MY_PV="${PV/_rc/-rc}"
40
41 DESCRIPTION="A painless self-hosted Git service"
42 HOMEPAGE="https://gitea.io"
43
44 if [[ ${PV} != 9999* ]] ; then
45 - SRC_URI="https://github.com/go-gitea/gitea/releases/download/v${PV}/gitea-src-${PV}.tar.gz"
46 + SRC_URI="https://github.com/go-gitea/gitea/releases/download/v${MY_PV}/gitea-src-${MY_PV}.tar.gz -> ${P}.tar.gz"
47 KEYWORDS="~amd64 ~arm ~arm64"
48 + S="${WORKDIR}"
49 else
50 EGIT_REPO_URI="https://github.com/go-gitea/gitea"
51 - EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
52 - has test ${FEATURES} && EGIT_MIN_CLONE_TYPE="mirror"
53 + inherit git-r3
54 + S="${WORKDIR}/${P}"
55 fi
56
57 LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
58 SLOT="0"
59 IUSE="+acct pam sqlite"
60
61 -BDEPEND="dev-lang/go
62 - >=net-libs/nodejs-10[npm]"
63 -DEPEND="pam? ( sys-libs/pam )"
64 -RDEPEND="${DEPEND}
65 +BDEPEND=">=net-libs/nodejs-10[npm]"
66 +COMMON_DEPEND="
67 acct? (
68 acct-group/git
69 - acct-user/git[gitea]
70 - )
71 + acct-user/git[gitea] )
72 + pam? ( sys-libs/pam )"
73 +DEPEND="${COMMON_DEPEND}"
74 +RDEPEND="${COMMON_DEPEND}
75 dev-vcs/git"
76
77 -DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
78 -FILECAPS=( cap_net_bind_service+ep usr/bin/gitea )
79 -S="${WORKDIR}/${P}/src/${EGO_PN}"
80 -
81 -PATCHES=( "${FILESDIR}/gitea-logflags.patch" )
82 -
83 -gitea_make() {
84 - local gitea_tags=(
85 - bindata
86 - $(usev pam)
87 - $(usex sqlite 'sqlite sqlite_unlock_notify' '')
88 - )
89 - local gitea_settings=(
90 - "-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/gitea/app.ini"
91 - "-X code.gitea.io/gitea/modules/setting.CustomPath=${EPREFIX}/var/lib/gitea/custom"
92 - "-X code.gitea.io/gitea/modules/setting.AppWorkPath=${EPREFIX}/var/lib/gitea"
93 - )
94 - local makeenv=(
95 - TAGS="${gitea_tags[@]}"
96 - LDFLAGS="-extldflags \"${LDFLAGS}\" ${gitea_settings[@]}"
97 - GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)"
98 - )
99 - [[ ${PV} != 9999* ]] && makeenv+=("DRONE_TAG=${PV}")
100 -
101 - env "${makeenv[@]}" emake -j1 "$@"
102 -}
103 +DOCS=(
104 + custom/conf/app.ini.sample CONTRIBUTING.md README.md
105 +)
106 +FILECAPS=(
107 + cap_net_bind_service+ep usr/bin/gitea
108 +)
109
110 src_prepare() {
111 default
112 @@ -89,27 +61,34 @@ src_prepare() {
113 sed -i -e "s#^DB_TYPE = .*#DB_TYPE = sqlite3#" custom/conf/app.ini.sample || die
114 fi
115
116 - # Remove already build assets (like frontend part)
117 - gitea_make clean-all
118 -}
119 + einfo "Remove tests which are known to fail with network-sandbox enabled."
120 + rm ./modules/migrations/github_test.go || die
121
122 -src_compile() {
123 - gitea_make build
124 + einfo "Remove tests which depend on gitea git-repo."
125 + rm ./modules/git/blob_test.go || die
126 + rm ./modules/git/repo_test.go || die
127 }
128
129 -src_test() {
130 - if has network-sandbox ${FEATURES}; then
131 - einfo "Remove tests which are known to fail with network-sandbox enabled."
132 - rm ./modules/migrations/github_test.go || die
133 - fi
134 -
135 - if [[ ${PV} != 9999* ]] ; then
136 - einfo "Remove tests which depend on gitea git-repo."
137 - rm ./modules/git/blob_test.go || die
138 - rm ./modules/git/repo_test.go || die
139 - fi
140 +src_compile() {
141 + local gitea_tags=(
142 + bindata
143 + $(usev pam)
144 + $(usex sqlite 'sqlite sqlite_unlock_notify' '')
145 + )
146 + local gitea_settings=(
147 + "-X code.gitea.io/gitea/modules/setting.CustomConf=${EPREFIX}/etc/gitea/app.ini"
148 + "-X code.gitea.io/gitea/modules/setting.CustomPath=${EPREFIX}/var/lib/gitea/custom"
149 + "-X code.gitea.io/gitea/modules/setting.AppWorkPath=${EPREFIX}/var/lib/gitea"
150 + )
151 + local makeenv=(
152 + TAGS="${gitea_tags[@]}"
153 + LDFLAGS="-extldflags \"${LDFLAGS}\" ${gitea_settings[@]}"
154 + )
155 + [[ ${PV} != 9999* ]] && makeenv+=("DRONE_TAG=${MY_PV}")
156
157 - default
158 + # -j1 as Makefile doesn't handle dependancy correctly, and is not
159 + # useful as golang compiler don't use this info.
160 + env "${makeenv[@]}" emake -j1 build
161 }
162
163 src_install() {