Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/hydrus/
Date: Fri, 11 Jun 2021 21:29:18
Message-Id: 1623401382.f1f4fa13c95f537afd0f497eae1aa5e61893d34c.sam@gentoo
1 commit: f1f4fa13c95f537afd0f497eae1aa5e61893d34c
2 Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch>
3 AuthorDate: Fri Jun 11 08:49:16 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 11 08:49:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1f4fa13
7
8 media-gfx/hydrus: Add 9999
9
10 Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch>
11 Closes: https://github.com/gentoo/gentoo/pull/21182
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 media-gfx/hydrus/hydrus-9999.ebuild | 144 ++++++++++++++++++++++++++++++++++++
15 1 file changed, 144 insertions(+)
16
17 diff --git a/media-gfx/hydrus/hydrus-9999.ebuild b/media-gfx/hydrus/hydrus-9999.ebuild
18 new file mode 100644
19 index 00000000000..d51d23e32a5
20 --- /dev/null
21 +++ b/media-gfx/hydrus/hydrus-9999.ebuild
22 @@ -0,0 +1,144 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PYTHON_COMPAT=( python3_{7..9} )
29 +PYTHON_REQ_USE="sqlite"
30 +
31 +inherit python-single-r1 desktop optfeature
32 +
33 +DESCRIPTION="A booru-like media organizer for the desktop"
34 +HOMEPAGE="https://hydrusnetwork.github.io/hydrus/ https://github.com/hydrusnetwork/hydrus"
35 +
36 +if [ "${PV}" == "9999" ]; then
37 + inherit git-r3
38 +
39 + EGIT_REPO_URI="https://github.com/hydrusnetwork/hydrus.git"
40 +else
41 + SRC_URI="https://github.com/hydrusnetwork/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
42 +
43 + KEYWORDS="~amd64"
44 +fi
45 +
46 +# hydrus itself is WTFPL
47 +# icons included are CC-BY-2.5
48 +LICENSE="WTFPL-2 CC-BY-2.5"
49 +SLOT="0"
50 +IUSE="+mpv +ffmpeg +lz4 socks +cloudscraper charts test"
51 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
52 +
53 +RESTRICT="!test? ( test )"
54 +
55 +RDEPEND="
56 + ${PYTHON_DEPS}
57 + $(python_gen_cond_dep '
58 + dev-python/chardet[${PYTHON_MULTI_USEDEP}]
59 + dev-python/html5lib[${PYTHON_MULTI_USEDEP}]
60 + dev-python/lxml[${PYTHON_MULTI_USEDEP}]
61 + dev-python/numpy[${PYTHON_MULTI_USEDEP}]
62 + dev-python/pillow[${PYTHON_MULTI_USEDEP}]
63 + dev-python/psutil[${PYTHON_MULTI_USEDEP}]
64 + dev-python/pyopenssl[${PYTHON_MULTI_USEDEP}]
65 + dev-python/pyside2[widgets,gui,charts?,${PYTHON_MULTI_USEDEP}]
66 + dev-python/pyyaml[${PYTHON_MULTI_USEDEP}]
67 + dev-python/requests[${PYTHON_MULTI_USEDEP}]
68 + dev-python/send2trash[${PYTHON_MULTI_USEDEP}]
69 + dev-python/service_identity[${PYTHON_MULTI_USEDEP}]
70 + dev-python/six[${PYTHON_MULTI_USEDEP}]
71 + dev-python/twisted[${PYTHON_MULTI_USEDEP}]
72 + media-libs/opencv[python,png,jpeg,${PYTHON_MULTI_USEDEP}]
73 +
74 + >=dev-python/QtPy-1.9.0-r4[pyside2,${PYTHON_MULTI_USEDEP}]
75 + dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
76 +
77 + cloudscraper? ( dev-python/cloudscraper[${PYTHON_MULTI_USEDEP}] )
78 + ffmpeg? ( media-video/ffmpeg )
79 + lz4? ( dev-python/lz4[${PYTHON_MULTI_USEDEP}] )
80 + mpv? (
81 + media-video/mpv[libmpv,${PYTHON_MULTI_USEDEP}]
82 + dev-python/python-mpv[${PYTHON_MULTI_USEDEP}]
83 + )
84 + socks? (
85 + || ( dev-python/requests[socks5,${PYTHON_MULTI_USEDEP}]
86 + dev-python/PySocks[${PYTHON_MULTI_USEDEP}] )
87 + )
88 + ')
89 +"
90 +BDEPEND="
91 + ${RDEPEND}
92 + $(python_gen_cond_dep '
93 + test? (
94 + dev-python/httmock[${PYTHON_MULTI_USEDEP}]
95 + dev-python/mock[${PYTHON_MULTI_USEDEP}]
96 + dev-python/nose[${PYTHON_MULTI_USEDEP}]
97 + dev-python/unittest2[${PYTHON_MULTI_USEDEP}]
98 + )
99 + ')
100 +"
101 +
102 +PATCHES=(
103 + "${FILESDIR}/upnpc.patch"
104 + "${FILESDIR}/userpath-in-local-share.patch"
105 + "${FILESDIR}/test-exitcode.patch"
106 +)
107 +
108 +src_prepare() {
109 + default
110 +
111 + # Contains pre-built binaries for other systems and a broken swf renderer for linux
112 + rm -r bin/ || die
113 + # Build files used for CI, not actually needed
114 + rm -r static/build_files || die
115 + # Duplicate license file, not needed
116 + rm license.txt || die
117 + # Python requirements files, not needed
118 + rm requirements_*.txt || die
119 +}
120 +
121 +src_compile() {
122 + python_optimize "${S}"
123 +}
124 +
125 +src_test() {
126 + # The tests use unittest, but are run with a custom runner script.
127 + # QT_QPA_PLATFORM is required to make them run without X
128 + local -x QT_QPA_PLATFORM=offscreen
129 + "${EPYTHON}" "${S}/test.py" || die "Tests failed"
130 +}
131 +
132 +src_install() {
133 + local doc="${EPREFIX}/usr/share/doc/${PF}"
134 + elog "Hydrus includes an excellent manual, that can either be viewed at"
135 + elog "${doc}/html/help/index.html"
136 + elog "or accessed through the hydrus help menu."
137 +
138 + mv "help my client will not boot.txt" "help_my_client_will_not_boot.txt" || die
139 +
140 + local DOCS=(COPYING README.md Readme.txt help_my_client_will_not_boot.txt db/)
141 + local HTML_DOCS=("${S}"/help/)
142 + einstalldocs
143 +
144 + # Files only needed for testing
145 + rm test.py hydrus/hydrus_test.py || die
146 + rm -r hydrus/test/ static/testing/ || die
147 +
148 + # These files are copied into doc
149 + rm -r "${DOCS[@]}" "${HTML_DOCS[@]}" || die
150 + # The program expects to find documentation here, so add a symlink to doc
151 + ln -s "${doc}/html/help" help || die
152 +
153 + insinto /opt/hydrus
154 + doins -r "${S}"/.
155 +
156 + exeinto /usr/bin
157 + python_newexe - hydrus-server < <(sed "s/python/${EPYTHON}/" "${FILESDIR}/hydrus-server")
158 + python_newexe - hydrus-client < <(sed "s/python/${EPYTHON}/" "${FILESDIR}/hydrus-client")
159 +
160 + make_desktop_entry "hydrus-client" "Hydrus Client" "/opt/hydrus/static/hydrus_non-transparent.png" \
161 + "AudioVideo;FileTools;Graphics;Network;"
162 +}
163 +
164 +pkg_postinst() {
165 + optfeature "support for automatic port forwarding" "net-libs/miniupnpc"
166 +}