Gentoo Archives: gentoo-commits

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