Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net-p2p/classified-ads: Install example files into correct path #22629

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
86 changes: 86 additions & 0 deletions net-p2p/classified-ads/classified-ads-0.13-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# 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}
sys-devel/gettext
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is not in BDEPEND?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least gettext is not in @System set so to be safe it might be good idea to keep it. Or is there easy way to check what packages are included in BDEPEND?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BDEPEND has nothing to do with @System; think cross-compiling: if you're using arm machine to build the software for ppc64, do you need gettext for which arch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this took me some time to figure out. GNU gettext is build-time dependency (msgfmt program et al.) but the run-time functions required at runtime (setlocale+dgettext etc.) are found from /lib/libc.so.6 -> no extra run-time dep besides libc is needed. So I'll move gettext to BDEPEND.

Last time I was writing ebuild I had EAPI~6 or something and no BDEPEND. While studying documentation I came across a claim that contents of BDEPEND have something to do with system set and that left me confuzed. Bad internet.

I'll push corrected ebuild shortly..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc? ( app-doc/doxygen[dot] )
test? ( dev-libs/libgcrypt:0
dev-qt/qttest:5
sys-devel/gdb:0 )"

PATCHES=(
"${FILESDIR}/${PV}-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/.
}
52 changes: 52 additions & 0 deletions net-p2p/classified-ads/files/0.13-examples-install-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From: Antti Järvinen <antti.jarvinen@katiska.org>
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--- 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 ;