summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Dummer <martin.dummer@gmx.net>2019-11-09 11:32:24 +0100
committerJoonas Niilola <juippis@gentoo.org>2019-11-20 16:39:31 +0200
commitb3b4a2770d6709bb5eb12887db2f68c53da17559 (patch)
tree3821b4e9b41197faa928f323607b5ea8e6c15910
parentdev-lisp/sbcl: cleaning old (diff)
downloadgentoo-b3b4a2770d6709bb5eb12887db2f68c53da17559.tar.gz
gentoo-b3b4a2770d6709bb5eb12887db2f68c53da17559.tar.bz2
gentoo-b3b4a2770d6709bb5eb12887db2f68c53da17559.zip
media-plugins/vdr-devstatus: fix for >vdr-2.3
add misc patches to make the plugin work together with >media-video/vdr-2.3 Package-Manager: Portage-2.3.78, Repoman-2.3.17 Signed-off-by: Martin Dummer <martin.dummer@gmx.net> Closes: https://github.com/gentoo/gentoo/pull/13592 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
-rw-r--r--media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-channelswitch.patch20
-rw-r--r--media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-dvb-adapter-frontend.patch22
-rw-r--r--media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-memoryleak.patch74
-rw-r--r--media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-recordingfound.patch17
-rw-r--r--media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-vdr2.3.patch99
-rw-r--r--media-plugins/vdr-devstatus/metadata.xml18
-rw-r--r--media-plugins/vdr-devstatus/vdr-devstatus-0.4.1-r1.ebuild36
7 files changed, 281 insertions, 5 deletions
diff --git a/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-channelswitch.patch b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-channelswitch.patch
new file mode 100644
index 000000000000..fbba371b05ee
--- /dev/null
+++ b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-channelswitch.patch
@@ -0,0 +1,20 @@
+--- a/devstatus.c
++++ b/devstatus.c
+@@ -122,7 +122,7 @@
+ #else
+ virtual void Recording(const cDevice *Device, const char *Name);
+ #endif
+- virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
++ virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView);
+ };
+
+ cList<cRecObj> CurrentRecordings;
+@@ -660,7 +660,7 @@
+ }
+ }
+
+-void cDevStatusMonitor::ChannelSwitch(const cDevice *Device, int ChannelNumber) {
++void cDevStatusMonitor::ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView) {
+ if (!ChannelNumber) return;
+ update=1;
+ }
diff --git a/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-dvb-adapter-frontend.patch b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-dvb-adapter-frontend.patch
new file mode 100644
index 000000000000..05572a29b710
--- /dev/null
+++ b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-dvb-adapter-frontend.patch
@@ -0,0 +1,22 @@
+--- a/devstatus.c
++++ b/devstatus.c
+@@ -161,6 +161,10 @@
+ private:
+ public:
+ void deviceinfoAsString(cDevice *d) {
++ cDvbDevice *dvb = dynamic_cast<cDvbDevice *>(d);
++ if (dvb == NULL)
++ return;
++
+ struct dvb_frontend_info m_FrontendInfo;
+ int m_Frontend;
+ // fe_status_t status;
+@@ -170,7 +174,7 @@
+ char* output = NULL;
+
+ #define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d"
+- cString dev = cString::sprintf(FRONTEND_DEVICE, d->CardIndex(), 0);
++ cString dev = cString::sprintf(FRONTEND_DEVICE, dvb->Adapter(), dvb->Frontend());
+ m_Frontend = open(dev, O_RDONLY | O_NONBLOCK);
+ if (m_Frontend < 0) {
+ return;
diff --git a/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-memoryleak.patch b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-memoryleak.patch
new file mode 100644
index 000000000000..86977aa9584e
--- /dev/null
+++ b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-memoryleak.patch
@@ -0,0 +1,74 @@
+--- a/devstatus.c
++++ b/devstatus.c
+@@ -561,8 +561,8 @@
+ cString cPluginDevstatus::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) {
+ // Process SVDRP commands this plugin implements
+ if(strcasecmp(Command, "DEVSTAT") == 0) {
+- char* output = NULL;
+- asprintf(&output, "%s:\n", tr("List of DVB devices"));
++ cString output;
++ output = cString::sprintf("%s:\n", tr("List of DVB devices"));
+ for (int i = 0; i < cDevice::NumDevices(); i++) {
+ cDevice *d = cDevice::GetDevice(i);
+ char* devName = NULL;
+@@ -570,7 +570,7 @@
+ if (d->HasDecoder() || d->IsPrimaryDevice())
+ asprintf(&devInfo, " (%s%s%s)", d->HasDecoder() ? tr("device with decoder") : "", (d->HasDecoder() && d->IsPrimaryDevice()) ? ", " : "", d->IsPrimaryDevice() ? tr("primary device") : "");
+ asprintf(&devName, "--- %s %d%s ---", tr("Device"), i+1, devInfo ? devInfo : "");
+- asprintf(&output, "%s %s:\n", output , devName); // add device output and there info's
++ output = cString::sprintf("%s %s:\n", *output , devName); // add device output and there info's
+ free(devName);
+ if (devInfo)
+ free(devInfo);
+@@ -582,30 +582,29 @@
+ Name = strdup(r->name);
+ char* itemText = NULL;
+ asprintf(&itemText, "%s %s", DAYDATETIME(r->timer->StartTime()), Name);
+- asprintf(&output, "%s %s\n", output , itemText);
++ output = cString::sprintf("%s %s\n", *output , itemText);
+ free(itemText);
+ }
+ Count++;
+ }
+ }
+ if (Count == 0)
+- asprintf(&output, "%s %s\n", output, tr("currently no recordings"));
++ output = cString::sprintf("%s %s\n", *output, tr("currently no recordings"));
+ if (i < cDevice::NumDevices())
+- asprintf(&output, "%s\n", output);
++ output = cString::sprintf("%s\n", *output);
+ }
+ // we use the default reply code here
+- // return cString::sprintf("%s", output);
+ return output;
+ }
+
+ if(strcasecmp(Command, "RECNUMBER") == 0) {
+- char* output = NULL;
+- asprintf(&output, "%s:\n", tr("Number of concurrent recordings"));
++ cString output;
++ output = cString::sprintf("%s:\n", tr("Number of concurrent recordings"));
+ for (int i = 0; i < cDevice::NumDevices(); i++) {
+ cDevice *d = cDevice::GetDevice(i);
+ char* devName = NULL;
+ asprintf(&devName, "%s %d", tr("Device"), i+1);
+- asprintf(&output, "%s %s:", output , devName); // add device output and there info's
++ output = cString::sprintf("%s %s:", *output , devName); // add device output and there info's
+ free(devName);
+ int Count = 0;
+ for (cRecObj *r = CurrentRecordings.First(); r; r = CurrentRecordings.Next(r)){ // add recordings to the output
+@@ -613,12 +612,11 @@
+ Count++;
+ }
+ }
+- asprintf(&output, "%s %i\n", output, Count);
++ output = cString::sprintf("%s %i\n", *output, Count);
+ if (i < cDevice::NumDevices())
+- asprintf(&output, "%s\n", output);
++ output = cString::sprintf("%s\n", *output);
+ }
+ // we use the default reply code here
+- // return cString::sprintf("%s", output);
+ return output;
+ }
+
diff --git a/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-recordingfound.patch b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-recordingfound.patch
new file mode 100644
index 000000000000..984210481dc6
--- /dev/null
+++ b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-recordingfound.patch
@@ -0,0 +1,17 @@
+Index: b/devstatus.c
+===================================================================
+--- a/devstatus.c
++++ b/devstatus.c
+@@ -351,7 +351,11 @@
+ recordingFound = recording;
+ if (!recordingFound)
+ return osContinue;
+- cReplayControl::SetRecording(recordingFound->FileName(), recordingFound->Title());
++ #if VDRVERSNUM < 10728
++ cReplayControl::SetRecording(recordingFound->FileName(), recordingFound->Title());
++ #else
++ cReplayControl::SetRecording(recordingFound->FileName());
++ #endif
+ return osReplay;
+ }
+
diff --git a/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-vdr2.3.patch b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-vdr2.3.patch
new file mode 100644
index 000000000000..88c0a095c950
--- /dev/null
+++ b/media-plugins/vdr-devstatus/files/vdr-devstatus-0.4.1-vdr2.3.patch
@@ -0,0 +1,99 @@
+--- a/devstatus.c
++++ b/devstatus.c
+@@ -55,8 +55,14 @@
+ int channelNo;
+ cChannel *channel = NULL;
+
++#if VDRVERSNUM < 20300
+ for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
+ if( (channel = Channels.GetByNumber(channelNo)) ) {
++#else
++ LOCK_CHANNELS_READ;
++ for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
++ if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
++#endif
+ if (d->IsTunedToTransponder(channel)) {
+ return channel;
+ }
+@@ -78,8 +84,14 @@
+ cChannel *resChannel = NULL;
+ int oldQRG = getTunedFrequency(device);
+
++#if VDRVERSNUM < 20300
+ for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
+ if( (channel = Channels.GetByNumber(channelNo)) ) {
++#else
++ LOCK_CHANNELS_READ;
++ for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
++ if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
++#endif
+ if( device->ProvidesSource( channel->Source() ) ) { // same source (DVB-T, -S, ...)
+ if( !ISTRANSPONDER(channel->Frequency(),oldQRG) ) { //not the same transponder
+ if( channel->Frequency()*direction > oldQRG*direction ) {
+@@ -152,7 +164,11 @@
+ int GetChannelNr() { return ChannelNr; }
+ bool IsChannel() { return ChannelNr != 0; }
+ bool HasDevice() { return DeviceNr >= 0; }
++#if VDRVERSNUM < 20300
+ cChannel* GetChannel() { return Channels.GetByNumber(ChannelNr); }
++#else
++ cChannel* GetChannel() { LOCK_CHANNELS_READ; return (cChannel*) Channels->GetByNumber(ChannelNr); }
++#endif
+ cDevice* GetDevice() { return cDevice::GetDevice(DeviceNr); };
+ };
+
+@@ -279,8 +295,15 @@
+ int channelNo;
+ cChannel *channel = NULL;
+
++#if VDRVERSNUM < 20300
+ for (channelNo = 1; channelNo <= Channels.MaxNumber(); channelNo++) {
+ if( (channel = Channels.GetByNumber(channelNo)) ) {
++#else
++ LOCK_CHANNELS_READ;
++ for (channelNo = 1; channelNo <= Channels->MaxNumber(); channelNo++) {
++ if( (channel = (cChannel*) Channels->GetByNumber(channelNo)) ) {
++
++#endif
+ if (d->IsTunedToTransponder(channel)) {
+ bool currentLive = channelNo == d->CurrentChannel()
+ && (i == cDevice::ActualDevice()->CardIndex());
+@@ -350,7 +373,12 @@
+ eOSState Play(char* file) {
+ // Play the selected recording
+ cRecording* recordingFound = NULL;
++#if VDRVERSNUM < 20300
+ for(cRecording* recording = Recordings.First(); recording; recording = Recordings.Next(recording))
++#else
++ LOCK_RECORDINGS_READ;
++ for(cRecording* recording = (cRecording*) Recordings->First(); recording; recording = (cRecording*) Recordings->Next(recording))
++#endif
+ if (strstr(recording->Title(), file))
+ recordingFound = recording;
+ if (!recordingFound)
+@@ -405,7 +433,12 @@
+ ri = (cMenuRecItem*)Get(Current());
+ if (ri->Selectable()) {
+ if (ri->IsChannel()) {
++#if VDRVERSNUM < 20300
+ Channels.SwitchTo(ri->GetChannelNr());
++#else
++ LOCK_CHANNELS_READ;
++ Channels->SwitchTo(ri->GetChannelNr());
++#endif
+ Write(); //repaint; maybe 'Live' has changed
+ return osContinue;
+ } else
+@@ -635,7 +668,12 @@
+ #endif
+ if (Name) {
+ // insert new timers currently recording in TimersRecording
++#if VDRVERSNUM < 20300
+ for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti))
++#else
++ LOCK_TIMERS_READ;
++ for (cTimer *ti = (cTimer*) Timers->First(); ti; ti = (cTimer*) Timers->Next(ti))
++#endif
+ if (ti->Recording()) {
+ // check if this is a new entry
+ bool bFound = false;
diff --git a/media-plugins/vdr-devstatus/metadata.xml b/media-plugins/vdr-devstatus/metadata.xml
index d83af69d923f..b97ab2647da7 100644
--- a/media-plugins/vdr-devstatus/metadata.xml
+++ b/media-plugins/vdr-devstatus/metadata.xml
@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="project">
- <email>vdr@gentoo.org</email>
- <name>Gentoo VDR Project</name>
- </maintainer>
+ <pkgmetadata>
+ <maintainer type="person">
+ <email>martin.dummer@gmx.net</email>
+ <name>Martin Dummer</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>vdr@gentoo.org</email>
+ <name>Gentoo VDR Project</name>
+ </maintainer>
</pkgmetadata>
diff --git a/media-plugins/vdr-devstatus/vdr-devstatus-0.4.1-r1.ebuild b/media-plugins/vdr-devstatus/vdr-devstatus-0.4.1-r1.ebuild
new file mode 100644
index 000000000000..a51ba83b6f6a
--- /dev/null
+++ b/media-plugins/vdr-devstatus/vdr-devstatus-0.4.1-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit vdr-plugin-2
+
+DESCRIPTION="VDR plugin: display the usage status of the available DVB devices"
+HOMEPAGE="http://www.u32.de/vdr.html"
+SRC_URI="http://www.u32.de/download/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="media-video/vdr"
+RDEPEND="${DEPEND}"
+
+QA_FLAGS_IGNORED="
+ usr/lib/vdr/plugins/libvdr-.*
+ usr/lib64/vdr/plugins/libvdr-.*"
+PATCHES=(
+ "${FILESDIR}/${P}-recordingfound.patch"
+ "${FILESDIR}/${P}-channelswitch.patch"
+ "${FILESDIR}/${P}-dvb-adapter-frontend.patch"
+ "${FILESDIR}/${P}-memoryleak.patch"
+ "${FILESDIR}/${P}-vdr2.3.patch"
+)
+
+src_prepare() {
+ # remove untranslated .po files
+ rm "${S}"/po/{ca_ES,cs_CZ,da_DK,el_GR,et_EE,hr_HR,hu_HU,nl_NL,nn_NO,pl_PL,pt_PT,ro_RO,sl_SI,sv_SE,tr_TR}.po \
+ || die "failed to remove untranslated .po files"
+
+ vdr-plugin-2_src_prepare
+}