pwlib1 stable port information

Package: pwlib1
Version: 1.10.10
Revision: 10
Maintainer: The Gnome Core Team
GCC: 4.0
BuildDepends: <<
audiofile,
cyrus-sasl2-dev (>= 2.1.22-1006),
doxygen,
esound (>= 0.2.38-1),
expat1,
fink (>= 0.27.2),
libdv4,
openldap24-dev (>= 2.4.15-1),
openssl098-dev,
sdl (>= 1.2.13-1),
sed
<<
# libdv4 for 1 configure test..
# none of the plugins seem to get built yet
# sed : because of the patchscript
# bison ? (is used)
BuildDependsOnly: true
Depends: %N-shlibs (= %v-%r)
# Depends: just in order not to have to duplicate the docfiles...
Conflicts: pwlib, ptlib2.6.0
Replaces: pwlib, ptlib2.6.0
Source: mirror:gnome:sources/pwlib/1.10/pwlib-%v.tar.bz2
Source-MD5: 2c3bf7e8236a96659728ad139ce30b33
PatchFile: %n.patch
PatchFile-MD5: 79bb88877165e2552af6a3e2a6016c38
PatchScript: <<
#!/bin/sh -ev
%{default_script}

find . \( -name CVS -o -name '.cvsignore' -o -name '*.bak' \) -exec rm -fR \{\} \+ || true
sed -ri.bak -e '/P_MACOSX/,+45{/socklen_t/d ; s,setpgrp,setpgid, }' include/ptlib/unix/ptlib/pmachdep.h
# the def of SEM_FAILED changed between 10.4 and 10.5. We coerce it anyway to sem_t *
sed -ri.bak -e 's,\(int\)sem != SEM_FAILED,sem != (sem_t *)SEM_FAILED,' src/ptlib/unix/tlibthrd.cxx
# perl -pi.bak -e 's,^LDAP_SOURCE,CFLAGS += -DLDAP_DEPRECATED\n$&,' src/ptlib/unix/Makefile
perl -pi.bak -e 's,sys/soundcard\.h,liboss/soundcard.h,' {,plugins/}configure*
sed -ri.bak -e '/NETBSD/,+5{ /#endif/a\
\
#ifdef P_MACOSX\
#include \
#endif
}' plugins/sound_{esd,oss}/sound_*.h src/ptlib/unix/ossaix.cxx
sed -ri -e 's,^\#include ,#include ,' configure
sed -ri.bak -e 's,libesd.a,libesd.dylib,' -e 's, \-I\$\(ESDDIR\)/include,,' make/unix.mak
sed -ri.bak -e 's,-shared,-bundle,' make/plugins.mak
## relying on Apple's version of the MIN macro too system-dependent, rely instead on PMIN in ptlib/object.h :
sed -ri.bak -e 's, MIN\(, PMIN\(,' src/ptlib/unix/maccoreaudio{.cxx,/circular_buffer.inl}
## for the build of dependent pkgs (SYSLIBDIR is only defined for a couple of OS's, and not necessarily where pwlib is installed):
sed -ri.bak -e 's,SYSLIBDIR,shell ptlib-config --libdir,' make/common.mak
## for vers. 1.11.1 :
# sed -i.bak -e 's, || defined(__APPLE__),,' src/ptclib/pssl.cxx

perl -pi -e 's/-Wno-long-double//g' configure
<<
NoSetLDFLAGS: true
SetLIBRARY_PATH: %p/lib
NoSetCPPFLAGS: true
SetCFLAGS: -O3
ConfigureParams: <<
--exec-prefix=%p --libdir=%p/lib --enable-alsa --enable-avc --enable-bsdvideo --enable-dc --disable-oss \
--enable-plugins --enable-v4l --enable-v4l2 --enable-asn --enable-audio --enable-configfile --enable-dtmf \
--enable-expat --enable-ftp --enable-http --enable-httpsvc --enable-ipv6 --enable-jabber --enable-openldap \
--enable-openssl --enable-pipechan --enable-pop3smtp --enable-qos --enable-remconn --enable-resolver \
--enable-sasl --enable-sdl --enable-serial --enable-snmp --enable-soap --enable-socks --enable-stun \
--enable-telnet --enable-tts --enable-video --enable-vxml --enable-wavfile --enable-xmlrpc
<<
## Rmvd --enable-shm-video :
# make[2]: *** No rule to make target `/sw/.bld/pwlib1-1.10.1-1/pwlib-1.10.1/lib/obj_Darwin_x86_r/shmvideo.o', needed by `/sw/.bld/pwlib1-1.10.1-1/pwlib-1.10.1/lib/libpt_Darwin_x86_r_s.a'. Stop.
## liboss1 is broken -> Replaced --enable-oss by --disable-oss :
# c++ -fno-common -dynamic -Wno-long-double -D_REENTRANT -Wall -D__MACOSX__ -m486 -I/sw/include -DUSE_ESD=1 -I/sw/.bld/pwlib1-1.10.1-1/pwlib-1.10.1/include \
# -I. -bundle sound_oss.cxx -o ../pwlib/device/sound/oss_pwplugin.dylib
# /sw/include/liboss/soundcard.h: In function 'int ioctl(int, long unsigned int, ...)':
# /sw/include/liboss/soundcard.h:341: error: 'int ioctl(int, long unsigned int, ...)' was declared 'extern' and later 'static'
# /usr/include/sys/ioctl.h:91: error: previous declaration of 'int ioctl(int, long unsigned int, ...)'
# etc..
## Rmvd --enable-sunaudio :
# checking for Sun audio sound support... yes (God knows what's this test... Should look at it, by curiosity)
# but still :
## c++ -fno-common -dynamic -Wno-long-double -D_REENTRANT -Wall -D__MACOSX__ -m486 -I/sw/include -DUSE_ESD=1 -I/sw/.bld/pwlib1-1.10.1-1/pwlib-1.10.1/include \
## -I. -L../../lib -lpt_Darwin_x86_r -bundle sound_sunaudio.cxx -o ../pwlib/device/sound/sunaudio_pwplugin.dylib
## sound_sunaudio.cxx:48:21: error: stropts.h: No such file or directory
## sound_sunaudio.cxx:50:23: error: sys/mixer.h: No such file or directory
## In file included from sound_sunaudio.cxx:55:
## sound_sunaudio.h:8:23: error: sys/audio.h: No such file or directory
# I see :
# /sw/include/gstreamer-0.10/gst/interfaces/mixer.h
# /sw/include/gstreamer-0.8/gst/mixer/mixer.h
# and :
# /sw/include/cdio/audio.h
# /sw/include/gstreamer-0.10/gst/audio/audio.h
# /sw/include/gstreamer-0.8/gst/audio/audio.h
# (and /sw/.bld/pwlib1-1.10.1-1/pwlib-1.10.1/samples/audio/audio.h)
# but no stropts.h
# so even trying to add eg gstreamer-0.10 say to the CPATH would still probably not cure the problem...
CompileScript: <<
#!/bin/sh -ev
# the next line also adds -fno-exceptions to the CXXFLAGS for opal2 and openh323-1, through make/ptbuildopts.mak
# (CXXFLAGS is not obeyed by those pkgs) (and -fno-rtti should not be used: "typeid" used in %p/include/ptlib/pfactory.h)
export CPATH=%p/include; export ESDDIR=%p; export STDCXXFLAGS="-fno-exceptions"
if [ %m != powerpc ] ; then abbr=x86 ; else abbr=ppc ; fi
./configure %c
mv=`sed -r -e 's,\.[^.]*$,,' <<<"%v"`
Mv=`sed -r -e 's,\.[^.]*$,,' <<<"$mv"`
make PWLIBDIR=%b \
LDSOOPTS="-dynamiclib -single_module -Wl,-x -dead_strip -compatibility_version $mv -current_version %v -install_name %p/lib/libpt_Darwin_${abbr}_r.${Mv}.dylib" \
optshared docs
<<
InstallScript: <<
# make install DESTDIR=%d # is broken..
mkdir -p -m755 %i/share/pwlib/make
mkdir -p -m755 %i/lib
mkdir -p -m755 %i/bin
cp -pPR include %i
find %i/include \( -name '*.h.*' -o -name '*.bak' \) -exec rm \{\} \+ || true
cp -pPR make/{*.mak,ptlib-config} %i/share/pwlib/make
ln -s ../share/pwlib/make/ptlib-config %i/bin
cp -pPR lib/lib* %i/lib
cd %i/lib; ln -s libpt_Darwin_*_r.dylib libpt.dylib; ranlib libpt_Darwin_*.a; cd -
mkdir -p -m755 %i/share/doc/%n
cp -pPR samples html plugins version.h %i/share/doc/%n
chmod a-x %i/include/ptclib/* %i/lib/* %i/share/doc/%n/samples/ldaptest/*
ln -s ../%N-shlibs/{mpl-1.0.htm,ReadMe.txt,History.txt} %i/share/doc/%n
<<
SplitOff: <<
Package: %N-shlibs
Depends: <<
cyrus-sasl2-shlibs (>= 2.1.22-1006),
esound-shlibs (>= 0.2.38-1),
expat1-shlibs,
openldap24-shlibs (>= 2.4.15-1),
openssl098-shlibs,
sdl-shlibs (>= 1.2.13-1)
<<
Conflicts: pwlib-shlibs
Replaces: pwlib-shlibs
Provides: pwlib-shlibs
Description: Shared libraries for pwlib
Files: lib/libpt_Darwin_*.*.*dylib
Shlibs: <<
( %m = powerpc ) %p/lib/libpt_Darwin_ppc_r.1.dylib 1.10.0 %n (>= 1.10.1-1)
( %m != powerpc ) %p/lib/libpt_Darwin_x86_r.1.dylib 1.10.0 %n (>= 1.10.1-1)
<<
DocFiles: mpl-1.0.htm ReadMe.txt History.txt
<<
Description: Portable Windows library for OpenH323
DescPort: <<
Try to keep at latest version compatible _ according to http://www.ekiga.org/ _
with current version of ekiga, or else go first back for pwlib to the format
infofile_name = %N-%v.info, so older versions can stay in fink (versioning of those
pkgs seems completely erratic)

nieder for x86_64 builds:
maccoreaudio.cxx error: "cast from 'AudioBuffer*' to 'UInt32' loses precision" error
http://sourceforge.net/mailarchive/message.php?msg_id=24954122

{svcproc,tlibthrd,osutils}.cxx error: "cast from '...' to '...' loses precision"
similarly fixed by changing to 'long'
<<
DescPackaging: <<
Original version by Shawn Hsiao ; version 1.5.2-10 by James Gibbs
Installs now in policy-conformant dirs.
<<
License: OSI-Approved
Homepage: http://openh323.sourceforge.net/

pwlib1 stable port .patch

diff -Nurd -x'*~' pwlib-1.10.10.orig/src/ptlib/unix/maccoreaudio.cxx pwlib-1.10.10/src/ptlib/unix/maccoreaudio.cxx
--- pwlib-1.10.10.orig/src/ptlib/unix/maccoreaudio.cxx 2005-08-04 16:10:24.000000000 -0400
+++ pwlib-1.10.10/src/ptlib/unix/maccoreaudio.cxx 2012-01-26 16:52:24.000000000 -0500
@@ -23,6 +23,7 @@
#include
#include // used for Volume Listener

+#include


PCREATE_SOUND_PLUGIN(CoreAudio, PSoundChannelCoreAudio);
@@ -1337,7 +1338,7 @@

//calculate size of ABL given the last field, assum non-interleaved
UInt32 mChannelsPerFrame = hwASBD.mChannelsPerFrame;
- UInt32 propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
+ UInt32 propsize = sizeof(AudioBuffer) * mChannelsPerFrame + sizeof(AudioBufferList);

//malloc buffer lists
mInputBufferList = (AudioBufferList *)malloc(propsize);
@@ -1372,7 +1373,7 @@

//calculate number of buffers from channels
mChannelsPerFrame = pwlibASBD.mChannelsPerFrame;
- propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
+ propsize = sizeof(AudioBuffer) * mChannelsPerFrame + sizeof(AudioBufferList);

//malloc buffer lists
mOutputBufferList = (AudioBufferList *)malloc(propsize);
--- a/src/ptlib/unix/svcproc.cxx 2012-03-16 10:44:21.000000000 -0400
+++ b/src/ptlib/unix/svcproc.cxx 2007-10-19 02:22:32.000000000 -0400
@@ -388,7 +388,7 @@
#elif defined(BE_THREADS)
thread_id tid = ::find_thread(NULL);
#else
- unsigned tid = (unsigned) pthread_self();
+ unsigned tid = (unsigned long) pthread_self();
#endif
*out << "ThreadID=0x"
<< setfill('0') << ::hex
@@ -938,7 +938,7 @@
#elif defined(BE_THREADS)
thread_id tid = ::find_thread(NULL);
#else
- unsigned tid = (unsigned) pthread_self();
+ unsigned tid = (unsigned long) pthread_self();
#endif
PThread * thread_ptr = activeThreads.GetAt(tid);

--- a/src/ptlib/unix/tlibthrd.cxx 2012-03-16 10:44:21.000000000 -0400
+++ b/src/ptlib/unix/tlibthrd.cxx 2007-10-19 02:22:32.000000000 -0400
@@ -754,7 +754,7 @@
{
PWaitAndSignal m(threadMutex);

- if (!activeThreads.Contains((unsigned)id))
+ if (!activeThreads.Contains((unsigned long)id))
return FALSE;

return pthread_kill(id, sig) == 0;
@@ -792,7 +792,7 @@
#endif

((PProcess *)this)->activeThreads.DisallowDeleteObjects();
- ((PProcess *)this)->activeThreads.SetAt((unsigned)PX_threadId, this);
+ ((PProcess *)this)->activeThreads.SetAt((unsigned long)PX_threadId, this);

PX_firstTimeStart = FALSE;

@@ -906,7 +906,7 @@
PAssertPTHREAD(pthread_create, (&PX_threadId, &threadAttr, PX_ThreadStart, this));

// put the thread into the thread list
- process.activeThreads.SetAt((unsigned)PX_threadId, this);
+ process.activeThreads.SetAt((unsigned long)PX_threadId, this);
if (process.activeThreads.GetSize() > highWaterMark)
newHighWaterMark = highWaterMark = process.activeThreads.GetSize();

@@ -1229,7 +1229,7 @@
{
PProcess & process = PProcess::Current();
process.threadMutex.Wait();
- PThread * thread = process.activeThreads.GetAt((unsigned)pthread_self());
+ PThread * thread = process.activeThreads.GetAt((unsigned long)pthread_self());
process.threadMutex.Signal();
return thread;
}
@@ -1362,7 +1362,7 @@
}

// remove this thread from the active thread list
- process.activeThreads.SetAt((unsigned)id, NULL);
+ process.activeThreads.SetAt((unsigned long)id, NULL);

// delete the thread if required, note this is done this way to avoid
// a race condition, the thread ID cannot be zeroed before the if!
@@ -1562,7 +1562,7 @@

PAssertPTHREAD(pthread_mutex_unlock, (&semCreationMutex));

- PAssert(((int)sem != SEM_FAILED), "Couldn't create named semaphore");
+ PAssert((sem != (sem_t *)SEM_FAILED), "Couldn't create named semaphore");
return sem;
}
#endif
--- a/src/ptlib/common/osutils.cxx 2005-12-04 17:43:30.000000000 -0500
+++ b/src/ptlib/common/osutils.cxx 2012-03-16 11:11:48.000000000 -0400
@@ -2145,9 +2145,9 @@
void PThread::SetThreadName(const PString & name)
{
if (name.IsEmpty())
- threadName = psprintf("%s:%08x", GetClass(), (INT)this);
+ threadName = psprintf("%s:%08x", GetClass(), (long INT)this);
else
- threadName = psprintf(name, (INT)this);
+ threadName = psprintf(name, (long INT)this);

#if defined(_DEBUG) && defined(_MSC_VER)
if (threadId) { // make thread name known to debugger
@@ -2356,21 +2356,21 @@
PReadWriteMutex::Nest * PReadWriteMutex::GetNest() const
{
PWaitAndSignal mutex(nestingMutex);
- return nestedThreads.GetAt(POrdinalKey((PINDEX)PThread::GetCurrentThreadId()));
+ return nestedThreads.GetAt(POrdinalKey((long PINDEX)PThread::GetCurrentThreadId()));
}


void PReadWriteMutex::EndNest()
{
nestingMutex.Wait();
- nestedThreads.RemoveAt(POrdinalKey((PINDEX)PThread::GetCurrentThreadId()));
+ nestedThreads.RemoveAt(POrdinalKey((long PINDEX)PThread::GetCurrentThreadId()));
nestingMutex.Signal();
}


PReadWriteMutex::Nest & PReadWriteMutex::StartNest()
{
- POrdinalKey threadId = (PINDEX)PThread::GetCurrentThreadId();
+ POrdinalKey threadId = (long PINDEX)PThread::GetCurrentThreadId();

nestingMutex.Wait();

pwlib1 _unstable_ port .patch