From a6645e36d2baa45dc4cda17f3639a30d5f1ab400 Mon Sep 17 00:00:00 2001 From: Enno Tensing Date: Tue, 11 Feb 2025 19:45:42 +0100 Subject: [PATCH] app-editors/texworks: Copy texworks ebuild from ::gentoo --- app-editors/texworks/Manifest | 4 + .../texworks-0.6.5-cmake_lua_version.patch | 11 +++ .../texworks-0.6.8-optional-qtscript.patch | 25 ++++++ app-editors/texworks/texworks-0.6.8.ebuild | 85 +++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 app-editors/texworks/Manifest create mode 100644 app-editors/texworks/files/texworks-0.6.5-cmake_lua_version.patch create mode 100644 app-editors/texworks/files/texworks-0.6.8-optional-qtscript.patch create mode 100644 app-editors/texworks/texworks-0.6.8.ebuild diff --git a/app-editors/texworks/Manifest b/app-editors/texworks/Manifest new file mode 100644 index 0000000..d4a718e --- /dev/null +++ b/app-editors/texworks/Manifest @@ -0,0 +1,4 @@ +AUX texworks-0.6.5-cmake_lua_version.patch 219 BLAKE2B c09494099363fa26e4110c23b0e1c06caf44cb0040578bfa33457741fdc8fe4698a2f4000a6dc6da4cd19dca6039c251cd1b875a27dc41abfea03b5cb79c341a SHA512 66ccbbcf313596c674833b36f222c8aa8bde541dfd58a706814aef3eaeec50247bec954a4f7137dfda31df9cd7b15163200592acb8433ed252d961ebf2b9ea32 +AUX texworks-0.6.8-optional-qtscript.patch 1038 BLAKE2B 43f130632a1ea3d815e28b427eacfcfac5967233238d7b2ef271b9288f3c4f9d8492679edfd3a50a585303d02d26ced97ed36c56610223af7bf273ab3212d548 SHA512 badc300f48886c596155f10638c9929ab4093ee63d1efdba760674cef8fbe0c5a91164adca843e7f2957dc05a89d37bad440d527034cf4ea709238aa1a68cef1 +DIST texworks-0.6.8.tar.gz 12486607 BLAKE2B a7de78adc0746c57b721a400a704d3912574933604e01124a99f5a60ba377ba66ce8d57f5f0a87e336de715d981146db6b8ae61a78c744b385c698fcdad2f7fe SHA512 23164f9ab2f611a705b533f4c435891f1279d1e0e0de2d7f947864f8919a6513cb696881dc1dcf93345471599f113d264ced57cbd2dceae343b9dde46ee80482 +EBUILD texworks-0.6.8.ebuild 1807 BLAKE2B c9677b88df568d3b93cb0c5f50df865a7cbdc66fe0ecfe29460bd935aac645a860ca4c59f63fee930a8df850aea63b923162d422c4337245907a335e4fe17978 SHA512 aef2c00456b7f6d129f3794eff7c739c88c3b1af2823b80792092d5c2004a041419b40743126504d90ba187bbcf951f61dae3250a8e30bb53cc393533547a4c7 diff --git a/app-editors/texworks/files/texworks-0.6.5-cmake_lua_version.patch b/app-editors/texworks/files/texworks-0.6.5-cmake_lua_version.patch new file mode 100644 index 0000000..630443d --- /dev/null +++ b/app-editors/texworks/files/texworks-0.6.5-cmake_lua_version.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -297,7 +297,7 @@ + # ------------------------------- + + IF ( WITH_LUA ) +- FIND_PACKAGE(Lua) ++ FIND_PACKAGE(Lua ${LUA_VERSION} EXACT REQUIRED) + ENDIF() + + IF ( WITH_PYTHON ) diff --git a/app-editors/texworks/files/texworks-0.6.8-optional-qtscript.patch b/app-editors/texworks/files/texworks-0.6.8-optional-qtscript.patch new file mode 100644 index 0000000..460c4f4 --- /dev/null +++ b/app-editors/texworks/files/texworks-0.6.8-optional-qtscript.patch @@ -0,0 +1,25 @@ +It doesn't work like that. + +--- a/CMakeLists.txt 2023-02-18 11:42:11.000000000 +0100 ++++ b/CMakeLists.txt 2023-10-21 20:00:29.144638825 +0200 +@@ -281,9 +281,11 @@ + set(QT_VERSION_PATCH "${Qt6_VERSION_PATCH}") + else () + # Check for Qt5 +- find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Concurrent Xml LinguistTools Qml OPTIONAL_COMPONENTS Script ScriptTools) ++ find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui UiTools Concurrent Xml LinguistTools Qml) + set(QT_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui Qt5::UiTools Qt5::Concurrent Qt5::Xml Qt5::Qml) + ++ find_package(Qt5Script) ++ find_package(Qt5ScriptTools) + if (Qt5Script_FOUND AND Qt5ScriptTools_FOUND) + list(APPEND QT_LIBRARIES Qt5::ScriptTools Qt5::Script) + set(WITH_QTSCRIPT ON) +@@ -311,7 +313,6 @@ + set(QT_VERSION_MAJOR "${Qt5_VERSION_MAJOR}") + set(QT_VERSION_MINOR "${Qt5_VERSION_MINOR}") + set(QT_VERSION_PATCH "${Qt5_VERSION_PATCH}") +- set(WITH_QTSCRIPT ON) + endif () + + # Expose the major version number of Qt to the preprocessor. This is necessary diff --git a/app-editors/texworks/texworks-0.6.8.ebuild b/app-editors/texworks/texworks-0.6.8.ebuild new file mode 100644 index 0000000..0e8f8e9 --- /dev/null +++ b/app-editors/texworks/texworks-0.6.8.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..3} ) +PYTHON_COMPAT=( python3_{9..12} ) +CMAKE_REMOVE_MODULES_LIST=( FindLua ) +inherit lua-single python-single-r1 cmake xdg + +DESCRIPTION="Simple interface for working with TeX documents" +HOMEPAGE="https://tug.org/texworks/" +SRC_URI="https://github.com/TeXworks/texworks/archive/release-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/${PN}-release-${PV} + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~riscv x86" +IUSE="lua python test" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + lua? ( ${LUA_REQUIRED_USE} ) + python? ( ${PYTHON_REQUIRED_USE} ) +" + +RDEPEND=" + app-text/hunspell:= + app-text/poppler[qt5] + dev-qt/designer:5 + dev-qt/qtcore:5 + dev-qt/qtconcurrent:5 + dev-qt/qtdeclarative:5 + dev-qt/qtdbus:5 + dev-qt/qtdeclarative:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + sys-libs/zlib + lua? ( ${LUA_DEPS} ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND} + test? ( dev-qt/qttest:5 ) +" +BDEPEND=" + dev-qt/linguist-tools:5 + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.6.5-cmake_lua_version.patch + "${FILESDIR}"/${P}-optional-qtscript.patch +) + +pkg_setup() { + use lua && lua-single_pkg_setup + + python-single-r1_pkg_setup +} + +src_configure() { + local mycmakeargs=( + -Wno-dev + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Script=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Qt5ScriptTools=ON + -DPREFER_BUNDLED_SYNCTEX=ON + -DWITH_LUA=$(usex lua) + -DWITH_PYTHON=$(usex python) + -DWITH_TESTS=$(usex test) + -DTeXworks_PLUGIN_DIR="/usr/$(get_libdir)/texworks" + -DTeXworks_DOCS_DIR="/share/doc/${PF}" + -DQTPDF_VIEWER=ON + -DBUILD_SHARED_PLUGINS=ON + ) + + use lua && mycmakeargs+=( -DLUA_VERSION="$(lua_get_version)" ) + + cmake_src_configure +} + +src_test() { + local -x QT_QPA_PLATFORM=offscreen + cmake_src_test +} +