From 250381c5c81f68ee3efe74fcf2043fbe2b1d4972 Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 16 Mar 2005 15:32:12 +0000 Subject: Added some patches for building on NetBSD-1.6.2 with gcc-2.95.3. Approved by wiz. --- ham/linpsk/Makefile | 5 ++++- ham/linpsk/distinfo | 10 ++++++++- ham/linpsk/files/pkgsrc_fixes.h | 25 ++++++++++++++++++++++ ham/linpsk/patches/patch-ab | 15 +++++++++++++ ham/linpsk/patches/patch-ac | 24 +++++++++++++++++++++ ham/linpsk/patches/patch-ad | 29 +++++++++++++++++++++++++ ham/linpsk/patches/patch-ae | 23 ++++++++++++++++++++ ham/linpsk/patches/patch-af | 24 +++++++++++++++++++++ ham/linpsk/patches/patch-ag | 47 +++++++++++++++++++++++++++++++++++++++++ ham/linpsk/patches/patch-ah | 17 +++++++++++++++ ham/linpsk/patches/patch-ai | 24 +++++++++++++++++++++ 11 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 ham/linpsk/files/pkgsrc_fixes.h create mode 100644 ham/linpsk/patches/patch-ab create mode 100644 ham/linpsk/patches/patch-ac create mode 100644 ham/linpsk/patches/patch-ad create mode 100644 ham/linpsk/patches/patch-ae create mode 100644 ham/linpsk/patches/patch-af create mode 100644 ham/linpsk/patches/patch-ag create mode 100644 ham/linpsk/patches/patch-ah create mode 100644 ham/linpsk/patches/patch-ai (limited to 'ham') diff --git a/ham/linpsk/Makefile b/ham/linpsk/Makefile index 909aa249152..ffa91b3c719 100644 --- a/ham/linpsk/Makefile +++ b/ham/linpsk/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2005/01/31 13:47:04 wulf Exp $ +# $NetBSD: Makefile,v 1.3 2005/03/16 15:32:12 rillig Exp $ # DISTNAME= linpsk-0.8.0.4 @@ -23,6 +23,9 @@ LDFLAGS+= ${LIBOSSAUDIO} -lqt-mt CONFIGURE_ARGS+="--with-fftw-dir=${LOCALBASE}" +post-configure: + ${_PKG_DEBUG}${_PKG_SILENT}${LN} -s ${FILESDIR}/pkgsrc_fixes.h ${BUILDLINK_DIR}/include/ + .include "../../mk/ossaudio.buildlink3.mk" .include "../../x11/qt3-libs/buildlink3.mk" .include "../../math/fftw/buildlink3.mk" diff --git a/ham/linpsk/distinfo b/ham/linpsk/distinfo index 4de2e39d3da..e6a96e4850d 100644 --- a/ham/linpsk/distinfo +++ b/ham/linpsk/distinfo @@ -1,6 +1,14 @@ -$NetBSD: distinfo,v 1.2 2005/02/22 21:06:06 agc Exp $ +$NetBSD: distinfo,v 1.3 2005/03/16 15:32:12 rillig Exp $ SHA1 (linpsk-0.8.0.4.tar.gz) = cd4c76608a0c11f9990345d7a6859db58d7bba27 RMD160 (linpsk-0.8.0.4.tar.gz) = 0113b0b7708a651193b677e96a9544b6e2ec1ba3 Size (linpsk-0.8.0.4.tar.gz) = 426817 bytes SHA1 (patch-aa) = b3fda2c3242e7f88a6f43ee40f66f35ab7938f85 +SHA1 (patch-ab) = f2be2babf20024e80879d4122735314fe7ffd813 +SHA1 (patch-ac) = 521b6e002a6e15af69f3e754acd0164b9ae50467 +SHA1 (patch-ad) = 331aaf33ccc7cfd5723a84a99c4bfdac31ac7e64 +SHA1 (patch-ae) = 36fd197d1d4320d58462786a16ccb89348bbce6f +SHA1 (patch-af) = 0a01f2131f87fd4865b00c06e3a38b3827a037b0 +SHA1 (patch-ag) = 2577212da1fffa673d7dce9b8c939f1ae2dee12a +SHA1 (patch-ah) = 2d626269647214f558557c47b6e806f3ebdb8804 +SHA1 (patch-ai) = 3e5ef3fa0a9cda973f5549a2f675b2edc4bbce7d diff --git a/ham/linpsk/files/pkgsrc_fixes.h b/ham/linpsk/files/pkgsrc_fixes.h new file mode 100644 index 00000000000..d587ec35c52 --- /dev/null +++ b/ham/linpsk/files/pkgsrc_fixes.h @@ -0,0 +1,25 @@ +#ifndef LINPSK_PKGSRC_FIXES_H +#define LINPSK_PKGSRC_FIXES_H + +#ifdef __NetBSD__ +# include +#endif +#if !(defined(__NetBSD__) && __NetBSD_Version__ < 200000000) +# define HAVE_STRUCT_SCHED_PARAM +#endif + +#if !(defined(__GNUC__) && (__GNUC__ < 3)) +# define HAVE_STD_VECTOR_AT +#endif + +#ifdef __cplusplus +template typename T::reference at_replacement(T &c, const typename T::size_type &i) { +# ifdef HAVE_STD_VECTOR_AT + return c::at(i); +# else + return c[i]; +# endif +} +#endif + +#endif diff --git a/ham/linpsk/patches/patch-ab b/ham/linpsk/patches/patch-ab new file mode 100644 index 00000000000..e9e5b158a0c --- /dev/null +++ b/ham/linpsk/patches/patch-ab @@ -0,0 +1,15 @@ +$NetBSD: patch-ab,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/cpskdemodulator.cpp.orig Sun Jul 4 17:50:45 2004 ++++ src/cpskdemodulator.cpp Wed Mar 16 03:02:48 2005 +@@ -559,7 +559,7 @@ if ( UseAfc ) + { + Phase_Vector=m_BitSignal*conj(Prev_Sample); + Prev_Sample = m_BitSignal; +- Phase[j++]=Phase_Vector; ++ Phase[j++]=complex(Phase_Vector); + double angle = atan2(Phase_Vector.imag(),Phase_Vector.real()); + DecodeSymbol( angle); + if ( (unsigned int) m_DevAve > Threshold) diff --git a/ham/linpsk/patches/patch-ac b/ham/linpsk/patches/patch-ac new file mode 100644 index 00000000000..3e26a4c190f --- /dev/null +++ b/ham/linpsk/patches/patch-ac @@ -0,0 +1,24 @@ +$NetBSD: patch-ac,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/crxdisplay.cpp.orig Sun Jul 4 17:50:45 2004 ++++ src/crxdisplay.cpp Wed Mar 16 03:28:45 2005 +@@ -27,7 +27,7 @@ + #include + #include + +- ++#include + + #include "crecording.h" + #include "crxchannel.h" +@@ -69,7 +69,7 @@ void MyTabBar::paintLabel ( QPainter *p, + { + int position=t->identifier(); + if ( position >= 0 && position < Farbe->size() ) +- Cg.setColor(QColorGroup::Foreground, Farbe->at(position)); ++ Cg.setColor(QColorGroup::Foreground, at_replacement(*Farbe, position)); + } + style().drawControl( QStyle::CE_TabBarLabel, p, this, br, + Cg, diff --git a/ham/linpsk/patches/patch-ad b/ham/linpsk/patches/patch-ad new file mode 100644 index 00000000000..b8e3277a9ac --- /dev/null +++ b/ham/linpsk/patches/patch-ad @@ -0,0 +1,29 @@ +$NetBSD: patch-ad,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/interfaces/editmacro.ui.h.orig Sun Jul 4 17:50:45 2004 ++++ src/interfaces/editmacro.ui.h Wed Mar 16 02:37:57 2005 +@@ -7,9 +7,10 @@ + ** place of a destructor. + *****************************************************************************/ + +- + #include "macros.h" + #include ++#include ++ + using namespace std; + void EditMacro::init( Macros *k) + { +@@ -44,8 +45,8 @@ void EditMacro::accept() + { + int AktPosition, NewPosition; + AktPosition=SelectMacro->currentItem()-1; +-AllMacros->MacroText.at(AktPosition)=Definition->text(); +-AllMacros->Accelerator.at(AktPosition)=Accelerator->text(); ++at_replacement(AllMacros->MacroText, AktPosition)=Definition->text(); ++at_replacement(AllMacros->Accelerator, AktPosition)=Accelerator->text(); + /** Position Change to be done later + NewPosition=Position->value(); + if (AktPosition != NewPosition ) diff --git a/ham/linpsk/patches/patch-ae b/ham/linpsk/patches/patch-ae new file mode 100644 index 00000000000..9adfa9fa0b6 --- /dev/null +++ b/ham/linpsk/patches/patch-ae @@ -0,0 +1,23 @@ +$NetBSD: patch-ae,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/interfaces/renamemacro.ui.h.orig Sun Jul 4 17:50:45 2004 ++++ src/interfaces/renamemacro.ui.h Wed Mar 16 02:28:54 2005 +@@ -12,6 +12,7 @@ + + #include + ++#include + + //using namespace std; + +@@ -41,7 +42,7 @@ if (NewName->text().length() ==0 ) + return; + } + else +- AllMacros->MacroNames.at(MacroNumber)=NewName->text(); ++ at_replacement(AllMacros->MacroNames, MacroNumber)=NewName->text(); + QDialog::accept(); + + } diff --git a/ham/linpsk/patches/patch-af b/ham/linpsk/patches/patch-af new file mode 100644 index 00000000000..9976f57e772 --- /dev/null +++ b/ham/linpsk/patches/patch-af @@ -0,0 +1,24 @@ +$NetBSD: patch-af,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/linpsk.cpp.orig Fri Jul 23 16:41:47 2004 ++++ src/linpsk.cpp Wed Mar 16 03:01:04 2005 +@@ -44,6 +44,8 @@ + + #include + ++#include ++ + #include "controlpanel.h" + #include "crxdisplay.h" + #include "ctxdisplay.h" +@@ -421,7 +423,7 @@ if ( Channel->exec() != 0) + (Mode) Channel->RxMode->currentItem(), + Channel->TitleText->text()); + +- settings.ActChannel->setWindowColor(WindowColors.at(settings.RxChannels)); ++ settings.ActChannel->setWindowColor(at_replacement(WindowColors,settings.RxChannels)); + settings.RxChannels++; + RxDisplay->RxFreq->setAFCWide(settings.ActChannel->getAFCWide()); + diff --git a/ham/linpsk/patches/patch-ag b/ham/linpsk/patches/patch-ag new file mode 100644 index 00000000000..2db2645dbc2 --- /dev/null +++ b/ham/linpsk/patches/patch-ag @@ -0,0 +1,47 @@ +$NetBSD: patch-ag,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +NetBSD-1.6.2 does not have struct sched_param. + +--- src/portaudio/pa_unix.c.orig Sun Jul 11 18:03:57 2004 ++++ src/portaudio/pa_unix.c Wed Mar 16 02:58:17 2005 +@@ -87,6 +87,8 @@ O- what if input and output of a device + */ + + ++#include ++ + #include "pa_unix.h" + + typedef void *(*pthread_function_t)(void *); +@@ -411,6 +413,7 @@ static int PaHost_CanaryProc( PaHostSoun + + static PaError PaHost_WatchDogProc( PaHostSoundControl *pahsc ) + { ++#ifdef HAVE_STRUCT_SCHED_PARAM + struct sched_param schp = { 0 }; + int maxPri; + +@@ -495,6 +498,7 @@ cleanup: + #ifdef GNUSTEP + GSUnregisterCurrentThread(); /* SB20010904 */ + #endif ++#endif + return 0; + } + +@@ -574,6 +578,7 @@ static PaError PaHost_BoostPriority( int + { + PaHostSoundControl *pahsc; + PaError result = paNoError; ++#ifdef HAVE_STRUCT_SCHED_PARAM + struct sched_param schp = { 0 }; + + pahsc = (PaHostSoundControl *) past->past_DeviceData; +@@ -597,6 +602,7 @@ static PaError PaHost_BoostPriority( int + /* We are running at high priority so we should have a watchdog in case audio goes wild. */ + result = PaHost_StartWatchDog( pahsc ); + } ++#endif + + return result; + } diff --git a/ham/linpsk/patches/patch-ah b/ham/linpsk/patches/patch-ah new file mode 100644 index 00000000000..5a23b4cbe01 --- /dev/null +++ b/ham/linpsk/patches/patch-ah @@ -0,0 +1,17 @@ +$NetBSD: patch-ah,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +g++-2.95.3 does not know the min() and max() macros/functions. + +--- src/rtty2demodulator.cpp.orig Sun Jul 4 17:50:45 2004 ++++ src/rtty2demodulator.cpp Wed Mar 16 03:34:16 2005 +@@ -149,8 +149,8 @@ while ( actSample < NxSamples ) + { + j=(ThresholdPointer+i)%SampleBufferLength; + float x=ThresholdBuffer[j]; +- xmax=max(xmax,x); +- xmin=min(xmin,x); ++ xmax= xmax > x ? xmax : x; ++ xmin= xmin < x ? xmin : x; + } + DiscriminatorThreshold=(xmax+xmin)/2.; + diff --git a/ham/linpsk/patches/patch-ai b/ham/linpsk/patches/patch-ai new file mode 100644 index 00000000000..85815cf7a4c --- /dev/null +++ b/ham/linpsk/patches/patch-ai @@ -0,0 +1,24 @@ +$NetBSD: patch-ai,v 1.1 2005/03/16 15:32:12 rillig Exp $ + +Needed for g++-2.95.3. + +--- src/spectrumdisplay.cpp.orig Sun Jul 25 18:00:51 2004 ++++ src/spectrumdisplay.cpp Wed Mar 16 03:25:07 2005 +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + #include "spectrumdisplay.h" + #include "crxchannel.h" + #include "parameter.h" +@@ -181,7 +183,7 @@ paintLineal(&p,xmax,ymax); + { + int ID = pRx->getID(); + if ( ID >= 0 && ID < Farbe->size() ) +- p.setPen(Farbe->at(ID)); ++ p.setPen(at_replacement(*Farbe, ID)); + } + // Calculate Centerfrequency Coordinates + z=(( (int) pRx->getRxFrequency()-minfreq)*xmax)/(maxfreq-minfreq); -- cgit v1.2.3