commit:     4671498eed17568162abd06a521a6da9793ff2e9
Author:     Antti Järvinen <antti.jarvinen <AT> katiska <DOT> org>
AuthorDate: Mon Nov 22 13:57:00 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Nov 22 14:03:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4671498e

net-p2p/classified-ads: install example files into correct path

Closes: https://bugs.gentoo.org/809464
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Antti Järvinen <antti.jarvinen <AT> katiska.org>
Closes: https://github.com/gentoo/gentoo/pull/22629
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../classified-ads/classified-ads-0.13-r2.ebuild   | 87 ++++++++++++++++++++++
 .../classified-ads-0.13-examples-install-dir.patch | 52 +++++++++++++
 2 files changed, 139 insertions(+)

diff --git a/net-p2p/classified-ads/classified-ads-0.13-r2.ebuild 
b/net-p2p/classified-ads/classified-ads-0.13-r2.ebuild
new file mode 100644
index 000000000000..2034c6a3dac5
--- /dev/null
+++ b/net-p2p/classified-ads/classified-ads-0.13-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit qmake-utils virtualx xdg
+
+DESCRIPTION="Program for displaying classified advertisement items"
+HOMEPAGE="http://katiska.org/classified-ads/";
+SRC_URI="https://github.com/operatornormal/classified-ads/archive/${PV}.tar.gz
+       -> classified-ads-${PV}.tar.gz
+       
https://github.com/operatornormal/classified-ads/blob/graphics/preprocessed.tar.gz?raw=true
+       -> classified-ads-graphics-${PV}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="app-arch/bzip2
+       dev-lang/tcl:=
+       dev-lang/tk:=
+       dev-libs/openssl:0=
+       dev-qt/qtcore:5
+       dev-qt/qtgui:5
+       dev-qt/qtmultimedia:5[widgets]
+       dev-qt/qtnetwork:5[ssl]
+       dev-qt/qtprintsupport:5
+       dev-qt/qtsql:5[sqlite]
+       dev-qt/qtwidgets:5
+       media-libs/opus
+       net-libs/libnatpmp
+       net-libs/miniupnpc
+       sys-apps/file
+       sys-libs/zlib
+       virtual/libintl"
+
+DEPEND="${RDEPEND}
+       doc? ( app-doc/doxygen[dot] )
+       test? ( dev-libs/libgcrypt:0
+               dev-qt/qttest:5
+               sys-devel/gdb:0 )"
+
+BDEPEND="sys-devel/gettext"
+
+PATCHES=(
+       "${FILESDIR}/${P}-examples-install-dir.patch"
+)
+
+src_prepare() {
+       # preprocessed graphics are unpacked into wrong directory
+       # so lets move them into correct location:
+       mv ../ui/* ui/ || die
+       default
+}
+
+src_configure() {
+       eqmake5 examplefiles.path=/usr/share/doc/${PF}/examples
+       if use test; then
+               cd testca || die
+               eqmake5
+       fi
+}
+
+src_compile() {
+       emake
+       if use doc; then
+               pushd doc > /dev/null || die
+               doxygen || die
+               popd > /dev/null || die
+       fi
+       if use test; then
+               emake -C testca
+       fi
+}
+
+src_test() {
+       # testca will return 0 if all unit tests pass
+       virtx ./testca/testca
+}
+
+src_install() {
+       docompress -x /usr/share/doc/
+       emake install INSTALL_ROOT="${D}" DESTDIR="${D}"
+       use doc && dodoc -r doc/doxygen.generated/html/.
+}

diff --git 
a/net-p2p/classified-ads/files/classified-ads-0.13-examples-install-dir.patch 
b/net-p2p/classified-ads/files/classified-ads-0.13-examples-install-dir.patch
new file mode 100644
index 000000000000..e6b0b4bab362
--- /dev/null
+++ 
b/net-p2p/classified-ads/files/classified-ads-0.13-examples-install-dir.patch
@@ -0,0 +1,52 @@
+From: Antti Järvinen <[email protected]>
+Bug: https://bugs.gentoo.org/809464
+
+Installs example TCL programs into correct path. Upon startup binary
+will check example files from path, this why this touches not only
+makefile but also the c++ code. Changes are possible to incorporate
+into next upstream release so this patch will become obsolete.
+
+diff -u -r classified-ads-0.13.orig/classified-ads.pro 
classified-ads-0.13/classified-ads.pro
+--- classified-ads-0.13.orig/classified-ads.pro        2018-07-03 
17:16:11.000000000 +0300
++++ classified-ads-0.13/classified-ads.pro     2021-10-17 19:13:22.049743665 
+0300
+@@ -186,7 +186,9 @@
+ manpages.path = /usr/share/man/man1
+ manpages.files = classified-ads.1
+ # note this example file path appears also in file tclmodel.cpp
+-examplefiles.path = /usr/share/doc/classified-ads/examples
++isEmpty(examplefiles.path){
++  examplefiles.path = /usr/share/doc/classified-ads/examples
++} 
+ examplefiles.files = doc/sysinfo.tcl doc/luikero.tcl doc/calendar.tcl
+ INSTALLS += target \
+         desktopfiles \
+diff -u -r classified-ads-0.13.orig/datamodel/tclmodel.cpp 
classified-ads-0.13/datamodel/tclmodel.cpp
+--- classified-ads-0.13.orig/datamodel/tclmodel.cpp    2018-07-03 
17:16:11.000000000 +0300
++++ classified-ads-0.13/datamodel/tclmodel.cpp 2021-10-17 19:28:39.084875578 
+0300
+@@ -292,7 +292,13 @@
+ #else
+         // in unix this path appears in classified-ads.pro and 
+         // is used by "make install" phase.
+-        QDir examplesDir ("/usr/share/doc/classified-ads/examples") ; 
++        QDir examplesDir ("/usr/share/doc/classified-ads/examples") ;
++        if ( !examplesDir.exists() ) {
++        // some linux distributions want version number inside path:
++        examplesDir.setPath("/usr/share/doc/classified-ads-"+
++                            QString(CLASSIFIED_ADS_VERSION)+
++                            "/examples") ;      
++        }
+ #endif
+         if ( !examplesDir.exists() ) {
+             return ; // no examples, obviously
+diff -u -r classified-ads-0.13.orig/mcontroller.h 
classified-ads-0.13/mcontroller.h
+--- classified-ads-0.13.orig/mcontroller.h     2018-07-03 17:16:11.000000000 
+0300
++++ classified-ads-0.13/mcontroller.h  2021-10-18 20:38:39.495032595 +0300
+@@ -25,7 +25,7 @@
+ #include "datamodel/netrequestexecutor.h"
+ #include "datamodel/cadbrecord.h" // for CaDbRecord::SearchTerms
+ 
+-#define CLASSIFIED_ADS_VERSION "0.13"
++#define CLASSIFIED_ADS_VERSION "0.13-r2"
+ 
+ class Node ;
+ class Model ;

Reply via email to