public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlitestudio/, dev-db/sqlitestudio/files/
@ 2019-03-29  5:11 Aaron Bauman
  0 siblings, 0 replies; 2+ messages in thread
From: Aaron Bauman @ 2019-03-29  5:11 UTC (permalink / raw
  To: gentoo-commits

commit:     4d26198ef2dd685c8b3c4e066e70a1645227d6d1
Author:     Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Mon Mar 25 16:39:32 2019 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 05:11:07 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d26198e

dev-db/sqlitestudio: add patch to fix build with LibreSSL

Closes: https://bugs.gentoo.org/681638
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11495
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 .../files/sqlitestudio-3.2.1-libressl.patch        | 32 ++++++++++++++++++++++
 ...o-3.2.1.ebuild => sqlitestudio-3.2.1-r1.ebuild} |  1 +
 2 files changed, 33 insertions(+)

diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch
new file mode 100644
index 00000000000..06552942e94
--- /dev/null
+++ b/dev-db/sqlitestudio/files/sqlitestudio-3.2.1-libressl.patch
@@ -0,0 +1,32 @@
+From 64542c8c5cb3ad9249fa353ff4472c405057d743 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <stefan.strogin@gmail.com>
+Date: Mon, 25 Mar 2019 18:07:13 +0200
+Subject: [PATCH] #3505 Fix compilation with LibreSSL >=2.7.0
+
+HMAC_CTX_{new,free} were provided by LibreSSL 2.7.0.
+Do not redefine them, otherwise it breaks compilation.
+
+Upstream-Status: Accepted
+[https://github.com/pawelsalawa/sqlitestudio/pull/3507]
+Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
+---
+ Plugins/DbSqliteCipher/sqlcipher.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Plugins/DbSqliteCipher/sqlcipher.c b/Plugins/DbSqliteCipher/sqlcipher.c
+index 4918cb6f..10c4e5a3 100644
+--- a/Plugins/DbSqliteCipher/sqlcipher.c
++++ b/Plugins/DbSqliteCipher/sqlcipher.c
+@@ -21638,7 +21638,8 @@ static unsigned int openssl_external_init = 0;
+ static unsigned int openssl_init_count = 0;
+ static sqlcipher_sqlite3_mutex* openssl_rand_mutex = NULL;
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
++    (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
+ static HMAC_CTX *HMAC_CTX_new(void)
+ {
+   HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
+-- 
+2.21.0
+

diff --git a/dev-db/sqlitestudio/sqlitestudio-3.2.1.ebuild b/dev-db/sqlitestudio/sqlitestudio-3.2.1-r1.ebuild
similarity index 98%
rename from dev-db/sqlitestudio/sqlitestudio-3.2.1.ebuild
rename to dev-db/sqlitestudio/sqlitestudio-3.2.1-r1.ebuild
index bd8f78a3763..f1b05ce7abe 100644
--- a/dev-db/sqlitestudio/sqlitestudio-3.2.1.ebuild
+++ b/dev-db/sqlitestudio/sqlitestudio-3.2.1-r1.ebuild
@@ -36,6 +36,7 @@ DEPEND="${RDEPEND}
 	dev-qt/qtconcurrent:5
 	test? ( dev-qt/qttest:5 )
 "
+PATCHES=( "${FILESDIR}"/${P}-libressl.patch )
 
 S="${WORKDIR}"
 core_build_dir="${S}/output/build"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlitestudio/, dev-db/sqlitestudio/files/
@ 2023-05-06  3:46 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-05-06  3:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d14468e49a5189ce2b486b07e752cde14d996e1b
Author:     Matthew White <mehw.is.me <AT> inventati <DOT> org>
AuthorDate: Fri May  5 19:10:19 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May  6 03:46:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d14468e4

dev-db/sqlitestudio: enable compiling plugins with Python 3.11 for 3.4.3-r1

Apply upstream patch to enable compiling the plugins with Python 3.11.

Closes: https://bugs.gentoo.org/905786
Package-Manager: portage-3.0.44-r1
Signed-off-by: Matteo Bianco <mehw.is.me <AT> inventati.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../sqlitestudio-3.4.3-fix-PyThreadState.patch     |  54 ++++++
 dev-db/sqlitestudio/sqlitestudio-3.4.3-r1.ebuild   | 187 +++++++++++++++++++++
 2 files changed, 241 insertions(+)

diff --git a/dev-db/sqlitestudio/files/sqlitestudio-3.4.3-fix-PyThreadState.patch b/dev-db/sqlitestudio/files/sqlitestudio-3.4.3-fix-PyThreadState.patch
new file mode 100644
index 000000000000..5f69298bb6d3
--- /dev/null
+++ b/dev-db/sqlitestudio/files/sqlitestudio-3.4.3-fix-PyThreadState.patch
@@ -0,0 +1,54 @@
+From 364981e072039de1322a72c936e3747c462e57d4 Mon Sep 17 00:00:00 2001
+From: Matthew White <mehw.is.me@inventati.org>
+Date: Fri, 5 May 2023 11:46:27 +0000
+Subject: [PATCH] Plugins: fix compiling with Python 3.11
+
+Python 3.11 removed PyThreadState()->frame, but since Python 3.9
+PyThreadState_GetFrame() can be used to get the frame.
+
+To get the frame's f_locals and f_globals use PyFrame_GetLocals()
+and PyFrame_GetGlobals() when compiling with Python 3.11.
+
+Merged here is also 'Fixed compilation for Python < 3.11':
+https://github.com/pawelsalawa/sqlitestudio/commit/30ad718415ffe78a5ac0ff9cf12cff2bd01e9810
+
+References:
+https://docs.python.org/3/c-api/frame.html
+---
+ Plugins/ScriptingPython/scriptingpython.cpp | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/Plugins/ScriptingPython/scriptingpython.cpp b/Plugins/ScriptingPython/scriptingpython.cpp
+index 1dedb5c106..663c55b7d7 100644
+--- a/Plugins/ScriptingPython/scriptingpython.cpp
++++ b/Plugins/ScriptingPython/scriptingpython.cpp
+@@ -582,15 +582,25 @@ SqlQueryPtr ScriptingPython::dbCommonEval(PyObject* sqlArg, const char* fnName)
+ QVariant ScriptingPython::getVariable(const QString& name)
+ {
+     PyThreadState* state = PyThreadState_Get();
+-    if (!state->frame)
++#if PY_VERSION_HEX < 0x03090000
++    PyFrameObject* frame = state->frame;
++#else
++    PyFrameObject* frame = PyThreadState_GetFrame(state);
++#endif
++    if (!frame)
+         return QVariant();
+ 
+     const char* varName = name.toUtf8().constData();
+     PyObject* obj = nullptr;
+ 
+-    PyFrame_FastToLocals(state->frame);
+-    PyObject* locals = state->frame->f_locals;
+-    PyObject* globals = state->frame->f_globals;
++    PyFrame_FastToLocals(frame);
++#if PY_VERSION_HEX < 0x030b0000
++    PyObject* locals = frame->f_locals;
++    PyObject* globals = frame->f_globals;
++#else
++    PyObject* locals = PyFrame_GetLocals(frame);
++    PyObject* globals = PyFrame_GetGlobals(frame);
++#endif
+     if (PyMapping_Check(locals))
+         obj = PyMapping_GetItemString(locals, varName);
+     else if (PyDict_Check(globals))

diff --git a/dev-db/sqlitestudio/sqlitestudio-3.4.3-r1.ebuild b/dev-db/sqlitestudio/sqlitestudio-3.4.3-r1.ebuild
new file mode 100644
index 000000000000..ff3c591f1c38
--- /dev/null
+++ b/dev-db/sqlitestudio/sqlitestudio-3.4.3-r1.ebuild
@@ -0,0 +1,187 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PLOCALES="af_ZA ar_SA ca_ES cs_CZ da_DK de_DE el_GR en_US es_ES fa_IR fi_FI fr_FR he_IL hu_HU it_IT ja_JP ko_KR nl_NL no_NO pl_PL pt_BR pt_PT ro_RO ru_RU sk_SK sr_SP sv_SE tr_TR uk_UA vi_VN zh_CN zh_TW"
+
+# ScriptingPython says exactly 3.9
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit desktop plocale python-single-r1 qmake-utils xdg
+
+DESCRIPTION="Powerful cross-platform SQLite database manager"
+HOMEPAGE="https://sqlitestudio.pl"
+SRC_URI="https://github.com/pawelsalawa/sqlitestudio/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cli cups python tcl test"
+
+REQUIRED_USE="
+	test? ( cli )
+	python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	dev-libs/openssl:=
+	dev-db/sqlite:3
+	dev-qt/qtcore:5
+	dev-qt/qtdeclarative:5
+	dev-qt/qtgui:5
+	dev-qt/qtnetwork:5
+	dev-qt/qtscript:5
+	dev-qt/qtsvg:5
+	dev-qt/qtwidgets:5
+	dev-qt/qtxml:5
+	cli? (
+		sys-libs/readline:=
+		sys-libs/ncurses:=
+	)
+	python? ( ${PYTHON_DEPS} )
+	cups? ( dev-qt/qtprintsupport:5 )
+	tcl? ( dev-lang/tcl:0= )
+"
+DEPEND="${RDEPEND}
+	dev-qt/designer:5
+	dev-qt/qtconcurrent:5
+	test? ( dev-qt/qttest:5 )
+"
+BDEPEND="
+	dev-qt/linguist-tools:5
+	virtual/pkgconfig
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-fix-python.patch
+	"${FILESDIR}"/${P}-fix-PyThreadState.patch
+)
+
+core_build_dir="${S}/output/build"
+plugins_build_dir="${core_build_dir}/Plugins"
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	disable_modules() {
+		[[ $# -lt 2 ]] && die "not enough arguments"
+
+		local pro="$1"; shift
+		local modules="${@}"
+
+		sed -r -i \
+			-e 's/('${modules// /|}')[[:space:]]*(\\?)/\2/' \
+			${pro} || die
+	}
+
+	use cli || disable_modules SQLiteStudio3/SQLiteStudio3.pro cli
+
+	local mod_lst=( DbSqlite2 )
+	use cups || mod_lst+=( Printing )
+	use tcl || mod_lst+=( ScriptingTcl )
+	use python || mod_lst+=( ScriptingPython )
+	disable_modules Plugins/Plugins.pro ${mod_lst[@]}
+
+	local mylrelease="$(qt5_get_bindir)"/lrelease
+	local ts_dir_lst=$(find * -type f -name "*.qm" -printf '%h\n' | sort -u)
+	local ts_pro_lst=$(find * -type f -name "*.pro" -exec grep -l 'TRANSLATIONS' {} \;)
+	local ts_qrc_lst=$(find * -type f -name "*.qrc" -exec grep -l '\.qm' {} \;)
+
+	# delete all "*.qm"
+	for ts_dir in ${ts_dir_lst[@]}; do
+		rm "${ts_dir}"/*.qm || die
+	done
+
+	lrelease_locale() {
+		for ts_dir in ${ts_dir_lst[@]}; do
+			local ts=$(find "${ts_dir}" -type f -name "*${1}.ts" || continue)
+			"${mylrelease}" "${ts}" || die "preparing ${1} locale failed"
+		done
+	}
+
+	rm_locale() {
+		for ts_pro in ${ts_pro_lst[@]}; do
+			sed -i -r -e 's/[^[:space:]]*'${1}'\.ts//' \
+				${ts_pro} || die
+		done
+
+		for ts_qrc in ${ts_qrc_lst[@]}; do
+			sed -i -e '/'${1}'\.qm/d' \
+				${ts_qrc} || die
+		done
+	}
+
+	local ts_dir_main="SQLiteStudio3/sqlitestudio/translations"
+	plocale_find_changes ${ts_dir_main} "sqlitestudio_" '.ts'
+	plocale_for_each_locale lrelease_locale
+	plocale_for_each_disabled_locale rm_locale
+
+	# prevent "multilib-strict check failed" with USE test by
+	# replacing target paths with dynamic lib dir
+	#
+	sed -i -e 's/\(target\.path = .*\/\)lib/\1'$(get_libdir)'/' \
+		SQLiteStudio3/Tests/TestUtils/TestUtils.pro || die
+}
+
+src_configure() {
+	# NOTE: QMAKE_CFLAGS_ISYSTEM option prevents
+	# build error with tcl use enabled (stdlib.h is missing)
+	# "QMAKE_CFLAGS_ISYSTEM=\"\""
+	# CONFIG+ borrowed from compile.sh of tarball
+	local myqmakeargs=(
+		"BINDIR=${EPREFIX}/usr/bin"
+		"LIBDIR=${EPREFIX}/usr/$(get_libdir)"
+		"CONFIG+=portable"
+		$(usex test 'DEFINES+=tests' '')
+	)
+
+	# Combination of kvirc ebuild and qtcompress
+	if use python; then
+		myqmakeargs+=(
+			INCLUDEPATH+=" $(python_get_includedir)"
+			LIBS+=" $(python_get_LIBS)"
+		)
+	fi
+
+	## Core
+	mkdir -p "${core_build_dir}" && cd "${core_build_dir}" || die
+	eqmake5 "${myqmakeargs[@]}" "${S}/SQLiteStudio3"
+
+	## Plugins
+	mkdir -p "${plugins_build_dir}" && cd "${plugins_build_dir}" || die
+	eqmake5 "${myqmakeargs[@]}" "${S}/Plugins"
+}
+
+src_compile() {
+	emake -C "${core_build_dir}"
+	emake -C "${plugins_build_dir}"
+}
+
+src_install() {
+	emake -C "${core_build_dir}" INSTALL_ROOT="${D}" install
+	emake -C "${plugins_build_dir}" INSTALL_ROOT="${D}" install
+
+	if use test; then
+		# remove test artifacts that must not be installed
+		rm -r "${ED}"/lib64 || die
+		rm -r "${ED}"/usr/share/qt5/tests || die
+	fi
+
+	doicon -s scalable "SQLiteStudio3/guiSQLiteStudio/img/${PN}.svg"
+
+	local make_desktop_entry_args=(
+		"${PN} -- %F"
+		'SQLiteStudio3'
+		"${PN}"
+		'Development;Database;Utility'
+	)
+	make_desktop_entry "${make_desktop_entry_args[@]}" \
+		"$( printf '%s\n' "MimeType=application/x-sqlite3;" )"
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-06  3:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-06  3:46 [gentoo-commits] repo/gentoo:master commit in: dev-db/sqlitestudio/, dev-db/sqlitestudio/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2019-03-29  5:11 Aaron Bauman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox