Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlitestudio/
Date: Tue, 07 Jun 2022 23:02:25
Message-Id: 1654642931.819fa97ef1e668378b5e81afcab27e26d07cbd34.sam@gentoo
1 commit: 819fa97ef1e668378b5e81afcab27e26d07cbd34
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 7 23:01:23 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 7 23:02:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=819fa97e
7
8 dev-db/sqlitestudio: add 3.3.3
9
10 Closes: https://bugs.gentoo.org/850499
11 Closes: https://bugs.gentoo.org/773406
12 Closes: https://bugs.gentoo.org/838325
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 dev-db/sqlitestudio/Manifest | 1 +
16 dev-db/sqlitestudio/sqlitestudio-3.3.3.ebuild | 153 ++++++++++++++++++++++++++
17 2 files changed, 154 insertions(+)
18
19 diff --git a/dev-db/sqlitestudio/Manifest b/dev-db/sqlitestudio/Manifest
20 index 3f2d35cbdf64..7c5ddd701a4e 100644
21 --- a/dev-db/sqlitestudio/Manifest
22 +++ b/dev-db/sqlitestudio/Manifest
23 @@ -1 +1,2 @@
24 DIST sqlitestudio-3.2.1.tar.gz 9405867 BLAKE2B 53cd8465a6140cf17c602094cceef2fdf74f513f33257b22e1a3d7adcb9c78d8eb2cdaff047920836a9d98429ba0025924ce608f2eab97319feabf063de4c9ee SHA512 9c07f0dc50bf35ad04d0cb06cfc1a306d3f0aa9446e7d737c8187c63cb7dd2c44fb4b960693f2c30a15ece3aac0878701874a9ce3cebfe0c6bf48df10814a574
25 +DIST sqlitestudio-3.3.3.tar.gz 8863232 BLAKE2B 1dfa74ab405ec057090f87726c3562470de4c1fd7b97c0fbc3e3fb4b3c8413825ec1884ac8bc9cb86e0d3d64b42af323a46ae4aa324de98c1dc8e967a4eb0d35 SHA512 1b92b06dbca3b5ee051d2582345c0e9a0a3cbd2cbbde0c6b9b18f75ca30140c777746fc9d35a3c314c13d99300dbe8d9bbd313b2ae4cb069b8e81446b27e982f
26
27 diff --git a/dev-db/sqlitestudio/sqlitestudio-3.3.3.ebuild b/dev-db/sqlitestudio/sqlitestudio-3.3.3.ebuild
28 new file mode 100644
29 index 000000000000..401c8f8bec3e
30 --- /dev/null
31 +++ b/dev-db/sqlitestudio/sqlitestudio-3.3.3.ebuild
32 @@ -0,0 +1,153 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +PLOCALES="de es fr it pl pt_BR ro_RO ru sk zh_CN"
39 +inherit desktop plocale toolchain-funcs qmake-utils xdg
40 +
41 +DESCRIPTION="Powerful cross-platform SQLite database manager"
42 +HOMEPAGE="https://sqlitestudio.pl"
43 +SRC_URI="https://github.com/pawelsalawa/sqlitestudio/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
44 +
45 +LICENSE="GPL-3"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86"
48 +IUSE="cli cups tcl test"
49 +
50 +REQUIRED_USE="test? ( cli )"
51 +RESTRICT="!test? ( test )"
52 +
53 +RDEPEND="
54 + dev-db/sqlite:3
55 + dev-qt/qtcore:5
56 + dev-qt/qtgui:5
57 + dev-qt/qtnetwork:5
58 + dev-qt/qtscript:5
59 + dev-qt/qtsvg:5
60 + dev-qt/qtwidgets:5
61 + dev-qt/qtxml:5
62 + cli? (
63 + sys-libs/readline:=
64 + sys-libs/ncurses:=
65 + )
66 + cups? ( dev-qt/qtprintsupport:5 )
67 + tcl? ( dev-lang/tcl:0= )
68 +"
69 +DEPEND="${RDEPEND}
70 + dev-qt/designer:5
71 + dev-qt/qtconcurrent:5
72 + test? ( dev-qt/qttest:5 )
73 +"
74 +BDEPEND="
75 + dev-qt/linguist-tools:5
76 + virtual/pkgconfig
77 +"
78 +
79 +core_build_dir="${S}/output/build"
80 +plugins_build_dir="${core_build_dir}/Plugins"
81 +
82 +src_prepare() {
83 + default
84 +
85 + sed -i -e 's/linux|portable/portable/' SQLiteStudio3/sqlitestudio/sqlitestudio.pro || die
86 +
87 + # bug #838325
88 + sed -i -e "s:-lcurses:$($(tc-getPKG_CONFIG) --libs ncurses):" SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro || die
89 +
90 + disable_modules() {
91 + [[ $# -lt 2 ]] && die "not enough arguments"
92 +
93 + local pro="$1"; shift
94 + local modules="${@}"
95 +
96 + sed -r -i \
97 + -e 's/('${modules// /|}')[[:space:]]*(\\?)/\2/' \
98 + ${pro} || die
99 + }
100 +
101 + use cli || disable_modules SQLiteStudio3/SQLiteStudio3.pro cli
102 +
103 + local mod_lst=( DbSqlite2 )
104 + use cups || mod_lst+=( Printing )
105 + use tcl || mod_lst+=( ScriptingTcl )
106 + disable_modules Plugins/Plugins.pro ${mod_lst[@]}
107 +
108 + local mylrelease="$(qt5_get_bindir)"/lrelease
109 + local ts_dir_lst=$(find * -type f -name "*.qm" -printf '%h\n' | sort -u)
110 + local ts_pro_lst=$(find * -type f -name "*.pro" -exec grep -l 'TRANSLATIONS' {} \;)
111 + local ts_qrc_lst=$(find * -type f -name "*.qrc" -exec grep -l '\.qm' {} \;)
112 +
113 + # delete all "*.qm"
114 + for ts_dir in ${ts_dir_lst[@]}; do
115 + rm "${ts_dir}"/*.qm || die
116 + done
117 +
118 + lrelease_locale() {
119 + for ts_dir in ${ts_dir_lst[@]}; do
120 + local ts=$(find "${ts_dir}" -type f -name "*${1}.ts" || continue)
121 + "${mylrelease}" "${ts}" || die "preparing ${1} locale failed"
122 + done
123 + }
124 +
125 + rm_locale() {
126 + for ts_pro in ${ts_pro_lst[@]}; do
127 + sed -i -r -e 's/[^[:space:]]*'${1}'\.ts//' \
128 + ${ts_pro} || die
129 + done
130 +
131 + for ts_qrc in ${ts_qrc_lst[@]}; do
132 + sed -i -e '/'${1}'\.qm/d' \
133 + ${ts_qrc} || die
134 + done
135 + }
136 +
137 + local ts_dir_main="SQLiteStudio3/sqlitestudio/translations"
138 + plocale_find_changes ${ts_dir_main} "sqlitestudio_" '.ts'
139 + plocale_for_each_locale lrelease_locale
140 + plocale_for_each_disabled_locale rm_locale
141 +
142 + # prevent "multilib-strict check failed" with USE test
143 + sed -i -e 's/\(target.*usr\/\)lib/\1'$(get_libdir)'/' \
144 + SQLiteStudio3/Tests/TestUtils/TestUtils.pro || die
145 +}
146 +
147 +src_configure() {
148 + # NOTE: QMAKE_CFLAGS_ISYSTEM option prevents
149 + # build error with tcl use enabled (stdlib.h is missing)
150 + local myqmakeargs=(
151 + "BINDIR=${EPREFIX}/usr/bin"
152 + "LIBDIR=${EPREFIX}/usr/$(get_libdir)"
153 + "QMAKE_CFLAGS_ISYSTEM=\"\""
154 + $(usex test 'DEFINES+=tests' '')
155 + )
156 +
157 + ## Core
158 + mkdir -p "${core_build_dir}" && cd "${core_build_dir}" || die
159 + eqmake5 "${myqmakeargs[@]}" "${S}/SQLiteStudio3"
160 +
161 + ## Plugins
162 + mkdir -p "${plugins_build_dir}" && cd "${plugins_build_dir}" || die
163 + eqmake5 "${myqmakeargs[@]}" "${S}/Plugins"
164 +}
165 +
166 +src_compile() {
167 + emake -C "${core_build_dir}"
168 + emake -C "${plugins_build_dir}"
169 +}
170 +
171 +src_install() {
172 + emake -C "${core_build_dir}" INSTALL_ROOT="${D}" install
173 + emake -C "${plugins_build_dir}" INSTALL_ROOT="${D}" install
174 +
175 + doicon -s scalable "SQLiteStudio3/guiSQLiteStudio/img/${PN}.svg"
176 +
177 + local make_desktop_entry_args=(
178 + "${PN} -- %F"
179 + 'SQLiteStudio3'
180 + "${PN}"
181 + 'Development;Database;Utility'
182 + )
183 + make_desktop_entry "${make_desktop_entry_args[@]}" \
184 + "$( printf '%s\n' "MimeType=application/x-sqlite3;" )"
185 +}