commit:     c99dd5f065d84822c4429f9d2f3547ddaf600499
Author:     Chris Mayo <aklhfex <AT> gmail <DOT> com>
AuthorDate: Sat Sep 28 16:31:40 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 14:18:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c99dd5f0

sci-geosciences/gpsbabel: Make GUI optional

Closes: https://bugs.gentoo.org/940440
Signed-off-by: Chris Mayo <aklhfex <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38806
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-geosciences/gpsbabel/Manifest                  |   1 +
 .../files/gpsbabel-1.9.0-qmake-xmldoc.patch        |  11 +++
 .../gpsbabel/files/gpsbabel-1.9.0-xmllint.patch    |  10 ++
 sci-geosciences/gpsbabel/gpsbabel-1.9.0-r1.ebuild  | 106 +++++++++++++++++++++
 4 files changed, 128 insertions(+)

diff --git a/sci-geosciences/gpsbabel/Manifest 
b/sci-geosciences/gpsbabel/Manifest
index fd35d4f0d4e5..c8a792d54d33 100644
--- a/sci-geosciences/gpsbabel/Manifest
+++ b/sci-geosciences/gpsbabel/Manifest
@@ -1 +1,2 @@
+DIST gpsbabel.org-style3.css 2171 BLAKE2B 
7fafef65e37d7c7cd183be06caafdbf303ac334484d7c09b4e668e8845f156f850b6f4cc6ac1aa081627367e999fa30d3505400e2aabd03fa117f6389318254f
 SHA512 
33b843e0431de6d71a83c58da35ede28435e5a4746f59e52350c6e4451659e1b443d3c0dd52df1c68001e9937787820fb96afc363ec1ae7d23430bfed31dbc83
 DIST gpsbabel_1_9_0.tar.gz 14514572 BLAKE2B 
cdea8c74c1a75c4707b071b8a08fe83ce7fd3c6a6fd107c00d8fed958c9674c9f81de548a5cab7f9613a5d9f41834219f93bf7cabbc356047ef07f6667347bfe
 SHA512 
e8591aef8015470471ff7ff6a75ab4a71a584f8de2ac00f3957d06ee76145bf1f53c26a12b8d963f1b96ce09270f54fbd5e96c80eccbeb8466ff94a75b72972d

diff --git a/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-qmake-xmldoc.patch 
b/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-qmake-xmldoc.patch
new file mode 100644
index 000000000000..2bf36f39a84c
--- /dev/null
+++ b/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-qmake-xmldoc.patch
@@ -0,0 +1,11 @@
+--- a/tools/make_gpsbabel_html.sh
++++ b/tools/make_gpsbabel_html.sh
+@@ -10,6 +10,7 @@ xsltproc \
+   --stringparam html.cleanup "1" \
+   --stringparam make.clean.html "1" \
+   --stringparam html.valid.html "1" \
+-  --stringparam html.stylesheet "https://www.gpsbabel.org/style3.css"; \
++  --stringparam html.stylesheet "gpsbabel.org-style3.css" \
++  --nonet \
+   http://docbook.sourceforge.net/release/xsl-ns/current/xhtml/docbook.xsl \
+   xmldoc/readme.xml

diff --git a/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-xmllint.patch 
b/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-xmllint.patch
new file mode 100644
index 000000000000..46a5365568d3
--- /dev/null
+++ b/sci-geosciences/gpsbabel/files/gpsbabel-1.9.0-xmllint.patch
@@ -0,0 +1,10 @@
+--- a/tools/make_gpsbabel_doc.sh
++++ b/tools/make_gpsbabel_doc.sh
+@@ -2,7 +2,6 @@
+ set -ex
+ 
+ perl xmldoc/makedoc
+-xmllint --noout --relaxng http://docbook.org/xml/5.0/rng/docbook.rng 
xmldoc/readme.xml
+ # the following doesn't seem to work.
+ #xmllint --noout --schematron http://docbook.org/xml/5.0/sch/docbook.sch 
xmldoc/readme.xml
+ # jing and many depedencies removed from fedora

diff --git a/sci-geosciences/gpsbabel/gpsbabel-1.9.0-r1.ebuild 
b/sci-geosciences/gpsbabel/gpsbabel-1.9.0-r1.ebuild
new file mode 100644
index 000000000000..5a4ed28f31f5
--- /dev/null
+++ b/sci-geosciences/gpsbabel/gpsbabel-1.9.0-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_IN_SOURCE_BUILD=1
+inherit cmake desktop xdg
+
+MY_PV="${PV//./_}"
+MY_P="${PN}_${MY_PV}"
+
+DESCRIPTION="GPS waypoints, tracks and routes converter"
+HOMEPAGE="https://www.gpsbabel.org/ https://github.com/gpsbabel/gpsbabel";
+
+if [[ ${PV} == 9999 ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/gpsbabel/gpsbabel.git";
+else
+       SRC_URI="
+               
https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_${MY_PV}.tar.gz
+               doc? ( https://www.gpsbabel.org/style3.css -> 
gpsbabel.org-style3.css )"
+       KEYWORDS="~amd64 ~arm64"
+       S="${WORKDIR}/gpsbabel-gpsbabel_${MY_PV}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="doc gui"
+
+BDEPEND="
+       virtual/pkgconfig
+       doc? (
+               app-text/docbook-xml-dtd:4.1.2
+               dev-lang/perl
+               dev-libs/libxslt
+       )
+       gui? ( dev-qt/qttools:6[linguist] )
+"
+
+RDEPEND="
+       dev-libs/expat
+       sci-libs/shapelib:=
+       sys-libs/zlib:=[minizip]
+       virtual/libusb:1
+       dev-qt/qtbase:6
+       dev-qt/qt5compat:6
+       gui? (
+               dev-qt/qtbase:6[gui,network,widgets,xml]
+               dev-qt/qtserialport:6
+               dev-qt/qtwebchannel:6
+               dev-qt/qtwebengine:6[widgets]
+       )
+"
+
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS NEWS README.{contrib,igc,md} gui/README.gui )
+
+PATCHES=(
+       "${FILESDIR}/${PN}-1.8.0-no-automagic-qt5-qt6.patch"
+       "${FILESDIR}"/${P}-qmake-xmldoc.patch
+       "${FILESDIR}"/${P}-xmllint.patch
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       # ensure bundled libs are not used
+       rm -r shapelib zlib || die
+
+       use doc && cp "${DISTDIR}/gpsbabel.org-style3.css" "${S}"
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DGPSBABEL_WITH_LIBUSB=pkgconfig
+               -DGPSBABEL_WITH_SHAPELIB=pkgconfig
+               -DGPSBABEL_WITH_ZLIB=pkgconfig
+               -DGPSBABEL_MAPPREVIEW=$(usex gui)
+               -DGPSBABEL_EMBED_MAP=$(usex gui)
+               -DGPSBABEL_EMBED_TRANSLATIONS=$(usex gui)
+               -DUSE_QT6=ON
+       )
+
+       cmake_src_configure
+}
+
+cmake_src_compile() {
+       cmake_build gpsbabel
+       use gui && cmake_build gpsbabelfe
+       use doc && cmake_build gpsbabel.html
+}
+
+src_install() {
+       use doc && HTML_DOCS=( "${S}/${PN}.html" "${S}/${PN}.org-style3.css" )
+       einstalldocs
+
+       dobin gpsbabel
+       if use gui; then
+               dobin gui/GPSBabelFE/gpsbabelfe
+               insinto /usr/share/${PN}/translations/
+               doins gui/gpsbabel*_*.qm
+               newicon gui/images/appicon.png ${PN}.png
+               domenu gui/gpsbabel.desktop
+       fi
+}

Reply via email to