aboutsummaryrefslogtreecommitdiff
path: root/www-apps/wger/wger-2.3_pre20240614.ebuild
blob: bab397d905ef1e36b1ce7a6a151ddb8d4d7c016a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{11..12} )
DISTUTILS_USE_PEP517=hatchling

inherit distutils-r1

COMMIT="e68afe7fc3394432dd19949ea28c433ae7278159"
DESCRIPTION="FLOSS workout, fitness and weight manager/tracker"
HOMEPAGE="https://github.com/wger-project/wger"
SRC_URI="https://github.com/wger-project/wger/archive/${COMMIT}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT}"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# For Yarn/NPM
RESTRICT="network-sandbox"

RDEPEND="
	${PYTHON_DEPS}
	acct-user/wger
	acct-group/wger

	>=dev-python/django-4.2.13[${PYTHON_USEDEP}]
	>=dev-python/bleach-6.1.0[${PYTHON_USEDEP}]
	>=dev-python/celery-5.4.0[${PYTHON_USEDEP}]
	>=dev-python/crispy-bootstrap5-2024.2[${PYTHON_USEDEP}]
	>=dev-python/django-activity-stream-2.0.0[${PYTHON_USEDEP}]
	>=dev-python/django-axes-6.4.0[${PYTHON_USEDEP}]
	>=dev-python/django4-bootstrap-breadcrumbs-0.1.0[${PYTHON_USEDEP}]
	>=dev-python/django-crispy-forms-2.1[${PYTHON_USEDEP}]
	>=dev-python/django-email-verification-0.3.3[${PYTHON_USEDEP}]
	>=dev-python/django-environ-0.11.2[${PYTHON_USEDEP}]
	>=dev-python/django-formtools-2.5[${PYTHON_USEDEP}]
	>=dev-python/django-prometheus-2.3.1[${PYTHON_USEDEP}]
	>=dev-python/django-recaptcha-4.0.0[${PYTHON_USEDEP}]
	>=dev-python/django-simple-history-3.7[${PYTHON_USEDEP}]
	>=dev-python/django-storages-1.14[${PYTHON_USEDEP}]
	>=dev-python/django-compressor-4.4[${PYTHON_USEDEP}]
	>=dev-python/drf-spectacular-0.27.2[${PYTHON_USEDEP}]
	>=dev-python/drf-spectacular-sidecar-2024.6.1[${PYTHON_USEDEP}]
	>=dev-python/easy-thumbnails-2.8.5[${PYTHON_USEDEP}]
	>=dev-python/flower-2.0.1[${PYTHON_USEDEP}]
	>=dev-python/fontawesomefree-6.5.1[${PYTHON_USEDEP}]
	>=dev-python/icalendar-5.0.12[${PYTHON_USEDEP}]
	>=dev-python/invoke-2.2.0[${PYTHON_USEDEP}]
	>=dev-python/openfoodfacts-0.3.0[${PYTHON_USEDEP}]
	>=dev-python/pillow-10.3.0[${PYTHON_USEDEP}]
	>=dev-python/reportlab-4.2.0[${PYTHON_USEDEP}]
	>=dev-python/requests-2.32.3[${PYTHON_USEDEP}]
	>=dev-python/tqdm-4.66.4[${PYTHON_USEDEP}]
	>=dev-python/tzdata-2024.1[${PYTHON_USEDEP}]
	>=dev-python/django-cors-headers-4.3.1[${PYTHON_USEDEP}]
	>=dev-python/django-filter-24.2[${PYTHON_USEDEP}]
	>=dev-python/djangorestframework-3.15.1[${PYTHON_USEDEP}]
	>=dev-python/djangorestframework-simplejwt-5.3.1[${PYTHON_USEDEP}]
	>=dev-python/django-sortedm2m-3.1[${PYTHON_USEDEP}]
	>=dev-python/pymongo-4.7.1[${PYTHON_USEDEP}]
	>=dev-python/django-extensions-3.2[${PYTHON_USEDEP}]
	>=dev-python/django-debug-toolbar-4.3.0[${PYTHON_USEDEP}]
	>=dev-python/psycopg-2.9.9[${PYTHON_USEDEP}]
	>=dev-python/django-redis-5.4.0[${PYTHON_USEDEP}]
"
DEPEND="${RDEPEND}"
BDEPEND="
	net-libs/nodejs[npm]
	>=sys-apps/yarn-1.22.21
	dev-lang/sassc
"

PATCHES=(
	# Remove yarn commands from tasks.py
	# Since they are done in python_install
	"${FILESDIR}"/yarn.patch
)

eyarn() {
	yarn \
		--non-interactive \
		--modules-folder "${BUILD_DIR}/install$(python_get_sitedir)/wger/core/static/yarn/" \
		"${@}" || die
}

python_compile() {
	distutils-r1_python_compile

	local WGER_PATH
	WGER_PATH="${BUILD_DIR}/install$(python_get_sitedir)/${PN}/"

	cp "${S}"/package.json "${WGER_PATH}" || die
	eyarn --cwd "${WGER_PATH}" install

	sassc "${WGER_PATH}"core/static/scss/main.scss "${WGER_PATH}"core/static/yarn/bootstrap-compiled.css || die
}

src_install() {
	distutils-r1_src_install

	python_moduleinto wger
	python_foreach_impl python_domodule "${S}"/wger/settings_global.py

	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
}

pkg_postinst() {
	einfo
	elog "To configure wger, you need to generate a settings file and running the bootstrap using these command:"
	elog "wger create-settings --settings-path=/etc/wger/settings.py --database-type={sqlite3,postgresql}"
	elog "wger bootstrap --settings-path=/etc/wger/settings.py [--database-path=<sqlite3 database path>]"
	elog "wger load-online-fixtures --settings-path=/etc/wger/settings.py"
	elog "Make sure to review the other settings in settings.py"
	elog "Refer to https://wger.readthedocs.io/en/latest/settings.html"
	einfo
}