diff options
author | ahze <ahze@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-11-24 13:20:33 +0800 |
---|---|---|
committer | ahze <ahze@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-11-24 13:20:33 +0800 |
commit | 18397919e9e0485e56315dd727ee8386534d02db (patch) | |
tree | 8180115ba3e323a9dc3541c11c935e902a82d0bc | |
parent | 0ea9b5e9c10bff89fddb18ac62201c73a0d388b0 (diff) | |
download | marcuscom-ports-18397919e9e0485e56315dd727ee8386534d02db.tar.gz marcuscom-ports-18397919e9e0485e56315dd727ee8386534d02db.tar.zst marcuscom-ports-18397919e9e0485e56315dd727ee8386534d02db.zip |
Add firefox3-devel at version 3.1b1
Repo-copied from: www/firefox-devel
Repo-copied by: marcus
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@11771 df743ca5-7f9a-e211-a948-0013205c9059
25 files changed, 1896 insertions, 0 deletions
diff --git a/www/firefox3-devel/Makefile b/www/firefox3-devel/Makefile new file mode 100644 index 000000000..e55e72767 --- /dev/null +++ b/www/firefox3-devel/Makefile @@ -0,0 +1,116 @@ +# New ports collection makefile for: phoenix +# Date created: 2002/10/21 +# Whom: Alan Eldridge <alane@FreeBSD.org> +# +# $FreeBSD$ +# $MCom$ +# + +PORTNAME= firefox +DISTVERSION= 3.1b1 +PORTEPOCH= 1 +CATEGORIES= www ipv6 +MASTER_SITES= ${MASTER_SITE_MOZILLA} +MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${DISTVERSION}/source +DISTNAME= ${PORTNAME}-${DISTVERSION}-source + +MAINTAINER= gnome@FreeBSD.org +COMMENT= Web browser based on the browser portion of Mozilla + +BUILD_DEPENDS= nspr>=4.7:${PORTSDIR}/devel/nspr + +USE_AUTOTOOLS= autoconf:213 +LATEST_LINK= firefox3-devel +USE_GECKO= gecko +MOZ_PKGCONFIG_FILES= # empty +USE_MOZILLA= -png -nss -dbm -jpeg +MOZILLA_NAME= Firefox${MOZILLA_SUFX} +MOZILLA_SUFX= 3 +MOZILLA= ${PORTNAME}${MOZILLA_SUFX} +MOZ_TOOLKIT= cairo-gtk2 +GECKO_PLIST_PRE_DIRS= lib/${MOZILLA}/bin lib/${MOZILLA}/idl \ + lib/${MOZILLA}/include lib/${MOZILLA}/lib \ + lib/${MOZILLA}/sdk/idl lib/${MOZILLA}/sdk/include + +WANT_GNOME= yes +ALL_TARGET= default +CONFIGURE_ENV= LOCALBASE=${LOCALBASE} +EXTRA_CFLAGS= -O2 +HAS_CONFIGURE= yes +USE_BZIP2= yes +USE_GMAKE= yes +NO_MOZPKGINSTALL=yes + +FIREFOX_ICON= ${MOZILLA}.png +FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png +MOZ_OPTIONS= --program-transform-name='s/firefox/${MOZILLA}/' \ + --with-default-mozilla-five-home=${PREFIX}/lib/${MOZILLA} \ + --enable-svg --enable-svg-renderer=cairo \ + --enable-application=browser \ + --enable-official-branding \ + --enable-canvas --enable-libxul + +SYSTEM_PREFS= ${FAKEDIR}/lib/${MOZILLA}/defaults/pref/firefox.js + +OPTIONS= DBUS "Enable D-BUS support" on \ + NEWTAB "Open external links in a new tab" on \ + SMB "Enable smb:// URI support using gnomevfs" off + +.include <bsd.port.pre.mk> + +WRKSRC:= ${WRKSRC}-central + +GECKO_PTHREAD_LIBS!=${CC} -dumpspecs | ${GREP} -m 1 '%{\!pg: %{pthread:' | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE} + +.if ${HAVE_GNOME:Mlibgnomeui}!="" +USE_GNOME+= libgnomeui +MOZ_OPTIONS+= --enable-gnomeui +.else +MOZ_OPTIONS+= --disable-gnomeui +.endif + +.if defined(WITHOUT_DBUS) +MOZ_OPTIONS+= --disable-dbus +.else +LIB_DEPENDS+= dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib +.endif + +post-extract:: + @(cd ${WRKSRC} && ${AUTOCONF}) + @${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \ + -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|' \ + <${FILESDIR}/firefox.desktop.in >${WRKDIR}/${MOZILLA}.desktop + +post-patch: + ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS:C/-pthread/${GECKO_PTHREAD_LIBS}/}|' \ + ${WRKSRC}/storage/build/Makefile.in \ + ${WRKSRC}/db/sqlite3/src/Makefile.in + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + ${WRKSRC}/security/manager/ssl/src/Makefile.in +.if ${ARCH} == "sparc64" + @(cd ${WRKSRC}/xpcom/reflect/xptcall/src/md/unix && \ + ${LN} -s xptcstubs_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_freebsd.s && \ + ${LN} -s xptcstubs_sparc64_openbsd.cpp xptcstubs_sparc64_freebsd.cpp && \ + ${LN} -s xptcinvoke_sparc64_openbsd.cpp xptcinvoke_sparc64_freebsd.cpp) && \ + ${LN} -s xptcinvoke_asm_sparc64_openbsd.s xptcinvoke_asm_sparc64_freebsd.s) +.endif + +port-pre-install: +# ${SED} -e 's|1.9a7|0|' ${WRKSRC}/dist/bin/application.ini ${FAKEDIR}/lib + ${ECHO_CMD} 'share/applications/${MOZILLA}.desktop' >> ${PLISTF} + ${ECHO_CMD} "@dirrmtry share/applications" >> ${PLISTD} + ${ECHO_CMD} 'share/pixmaps/${FIREFOX_ICON}' >> ${PLISTF} +.if !defined(WITHOUT_NEWTAB) + ${ECHO_CMD} >> ${SYSTEM_PREFS} + ${ECHO_CMD} "// Open external links in new tab" >> ${SYSTEM_PREFS} + ${ECHO_CMD} "pref(\"browser.link.open_external\", 3);" \ + >> ${SYSTEM_PREFS} +.endif # !defined(WITHOUT_NEWTAB) + +post-install: + ${MKDIR} ${PREFIX}/share/applications ${PREFIX}/share/pixmaps + ${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${PREFIX}/share/applications/ + ${MKDIR} ${PREFIX}/lib/${MOZILLA}/chrome/icons/default + ${LN} -sf ${FIREFOX_ICON_SRC} ${PREFIX}/share/pixmaps/${FIREFOX_ICON} + +.include <bsd.port.post.mk> diff --git a/www/firefox3-devel/distinfo b/www/firefox3-devel/distinfo new file mode 100644 index 000000000..2c82ca0a7 --- /dev/null +++ b/www/firefox3-devel/distinfo @@ -0,0 +1,3 @@ +MD5 (firefox-3.1b1-source.tar.bz2) = d101c02c8ad670eeb2095e449c79c085 +SHA256 (firefox-3.1b1-source.tar.bz2) = 5382518ad10313c4c22fbfd2bf5cbf1a6e88160e7e29ab5dcd07362147d04c8d +SIZE (firefox-3.1b1-source.tar.bz2) = 40007549 diff --git a/www/firefox3-devel/files/firefox.desktop.in b/www/firefox3-devel/files/firefox.desktop.in new file mode 100644 index 000000000..d72090e1a --- /dev/null +++ b/www/firefox3-devel/files/firefox.desktop.in @@ -0,0 +1,191 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=@MOZILLA_NAME@ Web Browser +Name[am]= +Name[ar]= +Name[az]=@MOZILLA_NAME@ Veb Səyyahı +Name[be]= +Name[bg]=Интернет браузър @MOZILLA_NAME@ +Name[bn]= +Name[bs]=@MOZILLA_NAME@ web preglednik +Name[ca]=Navegador web @MOZILLA_NAME@ +Name[cs]=Prohlížeč WWW @MOZILLA_NAME@ +Name[cy]=Y Porwr Gwe @MOZILLA_NAME@ +Name[da]=@MOZILLA_NAME@ - internetsurfning +Name[de]=@MOZILLA_NAME@ Webbrowser +Name[el]=Περιηγητής Διαδικτύου @MOZILLA_NAME@ +Name[en_CA]=@MOZILLA_NAME@ Web Browser +Name[en_GB]=@MOZILLA_NAME@ Web Browser +Name[es]=Navegador Web @MOZILLA_NAME@ +Name[et]=@MOZILLA_NAME@ veebibrauser +Name[eu]=@MOZILLA_NAME@ web arakatzailea +Name[fi]=@MOZILLA_NAME@, WWW-selain +Name[fr]=Navigateur Web @MOZILLA_NAME@ +Name[ga]=Brabhsálaí Lín @MOZILLA_NAME@ +Name[gu]=એપીફની વૅબ બ્રાઉઝર +Name[he]=דפדפן @MOZILLA_NAME@ +Name[hi]= +Name[hr]=@MOZILLA_NAME@ Web preglednik +Name[hu]=@MOZILLA_NAME@ webböngésző +Name[id]=Web Browser @MOZILLA_NAME@ +Name[it]=Browser web @MOZILLA_NAME@ +Name[ja]=@MOZILLA_NAME@ ウェブ・ブラウザ +Name[ko]=@MOZILLA_NAME@ 웹 브라우저 +Name[li]=@MOZILLA_NAME@ Web Browser +Name[lt]=@MOZILLA_NAME@ web naršyklė +Name[mk]=@MOZILLA_NAME@ веб прелистувач +Name[ml]=എപ്പിഫാനി വെബ്ബ് ബ്രൌസര് +Name[mn]=@MOZILLA_NAME@ веб хөтөч +Name[ms]=Pelungsur Web @MOZILLA_NAME@ +Name[nb]=@MOZILLA_NAME@ nettleser +Name[nl]=@MOZILLA_NAME@ Webbrowser +Name[nn]=@MOZILLA_NAME@ nettlesar +Name[no]=@MOZILLA_NAME@ nettleser +Name[pa]=ਏਪੀਫਾਨੀ ਵੈੱਬ ਬਰਾਊਜ਼ਰ +Name[pl]=Przeglądarka WWW @MOZILLA_NAME@ +Name[pt]=Navegador Web @MOZILLA_NAME@ +Name[pt_BR]=Navegador Web @MOZILLA_NAME@ +Name[ro]=Navigatorul @MOZILLA_NAME@ +Name[ru]=Веб-браузер @MOZILLA_NAME@ +Name[sk]= +Name[sl]=Spletni brskalnik @MOZILLA_NAME@ +Name[sq]=@MOZILLA_NAME@ - Shfletuesi Web +Name[sr]= +Name[sr@Latn]=Veb čitač Spoznaja +Name[sv]=Webbläsaren @MOZILLA_NAME@ +Name[ta]=எபிபனி வலை உலாவி +Name[tk]=@MOZILLA_NAME@ Web Ahtarçisi +Name[tr]=@MOZILLA_NAME@ Web Tarayıcı +Name[uk]=Переглядач web @MOZILLA_NAME@ +Name[vi]=Trình Duyệt Web @MOZILLA_NAME@ +Name[wa]=Betchteu waibe epiphany +Name[zh_CN]=@MOZILLA_NAME@ Web 浏览器 +Name[zh_TW]=@MOZILLA_NAME@ 網頁瀏覽器 +GenericName=Web Browser +GenericName[ar]=متصفّح الانترنت +GenericName[az]=Veb Səyyahı +GenericName[be]=Вандроўнік па павуціньню +GenericName[bg]=Браузър +GenericName[bn]=ওয়েব ব্রাউজার +GenericName[bs]=Web preglednik +GenericName[ca]=Navegador web +GenericName[cs]=Prohlížeč WWW +GenericName[cy]=Porwr Gwe +GenericName[da]=Internetsurfning +GenericName[de]=Webbrowser +GenericName[el]=Περιηγητής Ιστοσελίδων +GenericName[en_CA]=Web Browser +GenericName[en_GB]=Web Browser +GenericName[es]=Navegador web +GenericName[et]=Veebilehitseja +GenericName[eu]=Web arakatzailea +GenericName[fi]=WWW-selain +GenericName[fr]=Navigateur Web @MOZILLA_NAME@ +GenericName[ga]=Brabhsálaí Lín +GenericName[gu]=વેબ બ્રાઉઝર +GenericName[he]=דפדפן אינטרנט +GenericName[hi]=वेब ब्राउज़र +GenericName[hr]=Web preglednik +GenericName[hu]=Webböngésző +GenericName[id]=Browser Web +GenericName[it]=Browser web +GenericName[ja]=GNOME ウェブ・ブラウザ +GenericName[ko]=웹 브라우저 +GenericName[li]=Wèb Browser +GenericName[lt]=Web naršyklė +GenericName[mk]=Веб прелистувач +GenericName[mn]=Веб хөтөч +GenericName[ms]=Pelungsur Web +GenericName[nb]=Nettleser +GenericName[nl]=Web-browser +GenericName[nn]=Nettlesar +GenericName[no]=Nettleser +GenericName[pa]=ਵੈਬ ਬਰਾਊਜ਼ +GenericName[pl]=Przeglądarka WWW +GenericName[pt]=Navegador Web +GenericName[pt_BR]=Navegador Web +GenericName[ro]=Navigator Internet +GenericName[ru]=Веб-браузер +GenericName[sk]=WWW prehliadač +GenericName[sl]=Spletni brskalnik +GenericName[sq]=Shfletuesi Web +GenericName[sr]=Веб читач +GenericName[sr@Latn]=Veb čitač +GenericName[sv]=Webbläsare +GenericName[ta]=வலை உலாவி +GenericName[th]=เว็บบราวเซอร์ +GenericName[tk]=Web Ahtarçysy +GenericName[tr]=Web Tarayıcı +GenericName[uk]=Переглядач web-сторінок +GenericName[vi]=Trình duyệt Web +GenericName[wa]=Betchteu waibe +GenericName[zh_CN]=Web 浏览器 +GenericName[zh_TW]=網頁瀏覽器 +Comment=Browse the web +Comment[ar]=تصفح الانترنت +Comment[az]=Vebi gəzin +Comment[be]=Вандраваць па павуціньню +Comment[bg]=Сърфиране в интернет +Comment[bn]=ওয়েব ব্রাউজ করুন +Comment[bs]=Pregledaj na internetu +Comment[ca]=Navegueu per la web +Comment[cs]=Prohlížet WWW +Comment[cy]=Pori'r we +Comment[da]=Surf på internettet +Comment[de]=Im Web surfen +Comment[el]=Περιήγηση στον παγκόσμιο ιστό +Comment[en_CA]=Browse the web +Comment[en_GB]=Browse the web +Comment[es]=Navegar por la web +Comment[et]=Sirvi veebi +Comment[eu]=Arakatu web-a +Comment[fi]=Selaa WWW:tä +Comment[fr]=Naviguer sur Internet +Comment[ga]=Brabhsáil an Líon +Comment[gu]=વેબમાં શોધો +Comment[he]=גלוש ברשת +Comment[hi]=वेब ब्राउज़ करें +Comment[hr]=Pregledaj Web +Comment[hu]=A világháló böngészése +Comment[id]=Jelajah web +Comment[it]=Esplora il web +Comment[ja]=ウェブを閲覧します +Comment[ko]=웹을 돌아 다닙니다 +Comment[li]=Blajere op internet +Comment[lt]=Naršyti internete +Comment[mk]=Прелистувајте на веб +Comment[ml]=വലക്കെട്ട് തിരയുക +Comment[mn]=Веб броузе хийх +Comment[ms]=Layari web +Comment[nb]=Surf på nettet +Comment[nl]=Websurfen +Comment[nn]=Surf på nettet +Comment[no]=Surf på nettet +Comment[pa]=ਵੈਬ ਬਰਾਊਜ਼ +Comment[pl]=Przeglądanie stron WWW +Comment[pt]=Navegar na web +Comment[pt_BR]=Navegar na web +Comment[ro]=Navigare Internet +Comment[ru]=Веб-браузер +Comment[sk]=Prehliadať internet +Comment[sl]=Brskaj po spletu +Comment[sq]=Eksploro web-in +Comment[sr]=Прегледај веб +Comment[sr@Latn]=Pregledaj veb +Comment[sv]=Surfa på nätet +Comment[ta]=வலையில் உலாவு +Comment[th]=ใช้งานเว็บบราวเซอร์ @MOZILLA_NAME@ +Comment[tk]=Webi Ahtar +Comment[tr]=Web'e Gözat +Comment[uk]=Програма перегляду web-сторінок +Comment[vi]=Duyệt web +Comment[wa]=Naivyî avå les waibes +Comment[zh_CN]=浏览 Web +Comment[zh_TW]=瀏覽網頁 +Exec=@MOZILLA@ %u +Icon=@FIREFOX_ICON@ +StartupNotify=false +Terminal=false +Type=Application +Categories=Application;Network; +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml; diff --git a/www/firefox3-devel/files/patch-config-mkdepend-imakemdep.h b/www/firefox3-devel/files/patch-config-mkdepend-imakemdep.h new file mode 100644 index 000000000..b688e6644 --- /dev/null +++ b/www/firefox3-devel/files/patch-config-mkdepend-imakemdep.h @@ -0,0 +1,10 @@ +--- config/mkdepend/imakemdep.h Fri Sep 4 21:22:25 1998 ++++ config/mkdepend/imakemdep.h Thu Oct 16 22:43:25 2003 +@@ -278,4 +278,7 @@ + "-D__i386__", + # endif ++# if defined(__amd64__) || defined(__x86_64__) ++ "-D__amd64__ -D__x86_64__", ++# endif + # ifdef __GNUC__ + "-traditional", diff --git a/www/firefox3-devel/files/patch-config-rules.mk b/www/firefox3-devel/files/patch-config-rules.mk new file mode 100644 index 000000000..8ab35f5a8 --- /dev/null +++ b/www/firefox3-devel/files/patch-config-rules.mk @@ -0,0 +1,13 @@ +--- config/rules.mk.orig Thu Sep 14 14:07:03 2006 ++++ config/rules.mk Wed Oct 18 11:00:09 2006 +@@ -442,9 +442,7 @@ + endif + + ifeq ($(OS_ARCH),FreeBSD) +-ifdef IS_COMPONENT +-EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic +-endif ++EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic -lc + endif + + ifeq ($(OS_ARCH),NetBSD) diff --git a/www/firefox3-devel/files/patch-config_autoconf.mk.in b/www/firefox3-devel/files/patch-config_autoconf.mk.in new file mode 100644 index 000000000..b39d9bacf --- /dev/null +++ b/www/firefox3-devel/files/patch-config_autoconf.mk.in @@ -0,0 +1,21 @@ +--- config/autoconf.mk.in.orig 2007-08-28 12:02:43.000000000 -0400 ++++ config/autoconf.mk.in 2007-09-26 14:21:51.000000000 -0400 +@@ -58,14 +58,14 @@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + bindir = @bindir@ +-includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) ++includedir = @includedir@/%%MOZILLA%% + libdir = @libdir@ + datadir = @datadir@ + mandir = @mandir@ +-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) ++idldir = $(datadir)/idl/%%MOZILLA%% + +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/%%MOZILLA%% ++sdkdir = $(libdir)/%%MOZILLA%% + + DIST = $(DEPTH)/dist + LIBXUL_SDK = @LIBXUL_SDK@ diff --git a/www/firefox3-devel/files/patch-config_mkdepend_Makefile.in b/www/firefox3-devel/files/patch-config_mkdepend_Makefile.in new file mode 100644 index 000000000..bace012a2 --- /dev/null +++ b/www/firefox3-devel/files/patch-config_mkdepend_Makefile.in @@ -0,0 +1,10 @@ +--- config/mkdepend/Makefile.in.orig Sun Dec 12 07:36:57 2004 ++++ config/mkdepend/Makefile.in Sun Dec 12 07:37:55 2004 +@@ -57,6 +57,7 @@ + include $(topsrcdir)/config/rules.mk + + HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" ++HOST_CFLAGS += $(XCFLAGS) + + ifdef GNU_CC + _GCCDIR = $(shell $(CC) -print-file-name=include) diff --git a/www/firefox3-devel/files/patch-content_xslt_public_txDouble.h b/www/firefox3-devel/files/patch-content_xslt_public_txDouble.h new file mode 100644 index 000000000..534bccba4 --- /dev/null +++ b/www/firefox3-devel/files/patch-content_xslt_public_txDouble.h @@ -0,0 +1,20 @@ +--- content/xslt/public/txDouble.h.orig Fri Oct 13 00:00:29 2006 ++++ content/xslt/public/txDouble.h Fri Oct 13 00:00:53 2006 +@@ -41,7 +41,7 @@ + #define __txdouble_h__ + + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D. +-#ifdef __FreeBSD__ ++/* #ifdef __FreeBSD__ + #include <ieeefp.h> + #ifdef __alpha__ + fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP; +@@ -50,7 +50,7 @@ + #endif + fp_except_t oldmask = fpsetmask(~allmask); + #endif +- ++*/ + /** + * Macros to workaround math-bugs bugs in various platforms + */ diff --git a/www/firefox3-devel/files/patch-db_sqlite3_src_Makefile.in b/www/firefox3-devel/files/patch-db_sqlite3_src_Makefile.in new file mode 100644 index 000000000..71b84da6d --- /dev/null +++ b/www/firefox3-devel/files/patch-db_sqlite3_src_Makefile.in @@ -0,0 +1,11 @@ +--- db/sqlite3/src/Makefile.in.orig 2008-06-19 11:03:17.000000000 -0500 ++++ db/sqlite3/src/Makefile.in 2008-06-19 11:04:15.000000000 -0500 +@@ -45,6 +45,8 @@ + + include $(DEPTH)/config/autoconf.mk + ++OS_CFLAGS = -I../../../dist/include/sqlite3 ++OS_LIBS = %%PTHREAD_LIBS%% + MODULE = sqlite3 + LIBRARY_NAME = sqlite3 + FORCE_SHARED_LIB = 1 diff --git a/www/firefox3-devel/files/patch-js_src_jsnum.cpp b/www/firefox3-devel/files/patch-js_src_jsnum.cpp new file mode 100644 index 000000000..588d44cd9 --- /dev/null +++ b/www/firefox3-devel/files/patch-js_src_jsnum.cpp @@ -0,0 +1,28 @@ +--- js/src/jsnum.cpp.orig Sun Nov 5 18:37:07 2006 ++++ js/src/jsnum.cpp Sun Nov 5 18:42:31 2006 +@@ -45,6 +45,9 @@ + #if defined(XP_WIN) || defined(XP_OS2) + #include <float.h> + #endif ++#if defined(__FreeBSD__) ++#include <sys/param.h> ++#endif + #include <locale.h> + #include <limits.h> + #include <math.h> +@@ -532,7 +535,15 @@ static jsdouble NaN; + + #else + ++#if defined(__FreeBSD__) && __FreeBSD_version >= 601000 ++#include <fenv.h> ++#define FIX_FPU() (fedisableexcept(FE_ALL_EXCEPT)) ++ ++#else ++ + #define FIX_FPU() ((void)0) ++ ++#endif /* defined(__FreeBSD__) && __FreeBSD_version >= 503000 */ + + #endif + diff --git a/www/firefox3-devel/files/patch-layout_generic_Makefile.in b/www/firefox3-devel/files/patch-layout_generic_Makefile.in new file mode 100644 index 000000000..038b5df63 --- /dev/null +++ b/www/firefox3-devel/files/patch-layout_generic_Makefile.in @@ -0,0 +1,14 @@ +--- layout/generic/Makefile.in.orig 2008-06-19 12:29:06.000000000 -0500 ++++ layout/generic/Makefile.in 2008-06-19 12:30:04.000000000 -0500 +@@ -188,9 +188,10 @@ + -I$(srcdir)/../../content/base/src \ + -I$(srcdir)/../../content/html/content/src \ + -I$(srcdir)/../../dom/src/base \ +- $(MOZ_CAIRO_CFLAGS) \ + $(NULL) + ++CXXFLAGS += $(MOZ_CAIRO_CFLAGS) ++ + ifdef MOZ_ENABLE_GTK2 + CXXFLAGS += $(MOZ_GTK2_CFLAGS) + endif diff --git a/www/firefox3-devel/files/patch-media_liboggplay_audio_Makefile.in b/www/firefox3-devel/files/patch-media_liboggplay_audio_Makefile.in new file mode 100644 index 000000000..6a735b800 --- /dev/null +++ b/www/firefox3-devel/files/patch-media_liboggplay_audio_Makefile.in @@ -0,0 +1,16 @@ +--- media/liboggplay_audio/Makefile.in.orig 2008-11-24 23:14:37.000000000 +0000 ++++ media/liboggplay_audio/Makefile.in 2008-11-24 23:19:00.000000000 +0000 +@@ -49,6 +49,13 @@ + sydney_audio.h \ + $(NULL) + ++ifeq ($(OS_ARCH),FreeBSD) ++CSRCS = \ ++ sydney_audio_oss.c \ ++ $(NULL) ++endif ++ ++ + ifeq ($(OS_ARCH),Linux) + CSRCS = \ + sydney_audio_alsa.c \ diff --git a/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio.h b/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio.h new file mode 100644 index 000000000..65eeb0702 --- /dev/null +++ b/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio.h @@ -0,0 +1,11 @@ +--- media/liboggplay_audio/sydney_audio.h.orig 2008-11-24 21:38:34.000000000 +0000 ++++ media/liboggplay_audio/sydney_audio.h 2008-11-24 21:39:10.000000000 +0000 +@@ -32,7 +32,7 @@ + # endif + #elif defined(WIN32) + # define SA_LITTLE_ENDIAN 1 +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__FreeBSD__) + # if defined(__BIG_ENDIAN__) + # define SA_BIG_ENDIAN 1 + # else diff --git a/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio_oss.c b/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio_oss.c new file mode 100644 index 000000000..a45919ba0 --- /dev/null +++ b/www/firefox3-devel/files/patch-media_liboggplay_audio_sydney_audio_oss.c @@ -0,0 +1,1222 @@ +--- media/liboggplay_audio/sydney_audio_oss.c.orig 2008-10-07 09:58:44.000000000 +0000 ++++ media/liboggplay_audio/sydney_audio_oss.c 2008-08-08 20:02:04.000000000 +0000 +@@ -16,7 +16,9 @@ + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * +- * Contributor(s): Marcin Lubonski ++ * Contributor(s): Michael Martin ++ * Chris Double (chris.double@double.co.nz) ++ * Jeremy D. Lea (reg@openpave.org) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or +@@ -33,608 +35,685 @@ + * ***** END LICENSE BLOCK ***** * + */ + +-#include "sydney_audio.h" + #include <stdio.h> + #include <stdlib.h> + #include <sys/soundcard.h> +- + #include <sys/ioctl.h> + #include <unistd.h> + #include <fcntl.h> + #include <string.h> +- +-#define SA_READ_PERIOD 0 +-#define SA_WRITE_PERIOD 2560 // 40 ms of 16-bit, stereo, 16kHz +-#define SA_READ_BUFFER 0 +-#define SA_WRITE_BUFFER 7680 // 3 periods per buffer ++#include <pthread.h> ++#include <assert.h> ++#include "sydney_audio.h" + + // for versions newer than 3.6.1 + #define OSS_VERSION(x, y, z) (x << 16 | y << 8 | z) + // support only versions newer than 3.6.1 + #define SUPP_OSS_VERSION OSS_VERSION(3,6,1) + +-#if (SOUND_VERSION >= SUPP_OSS_VERSION) ++#if (SOUND_VERSION < SUPP_OSS_VERSION) ++#error Unsupported OSS Version ++#else ++ ++typedef struct sa_buf sa_buf; ++struct sa_buf { ++ unsigned int size; ++ unsigned int start; ++ unsigned int end; ++ sa_buf * next; ++ unsigned char data[0]; ++}; + +-struct SAAudioHandle_ { +- char *device_name; +- int channels; +- int read_period; +- int write_period; +- int read_buffer; +- int write_buffer; +- sa_pcm_mode_t rw_mode; +- sa_pcm_format_t format; +- int rate; +- int interleaved; +- +- int capture_handle; +- int playback_handle; +- int readN, writeN; +- char *stored; +- int stored_amount; +- int stored_limit; +- //int read_fd, write_fd; ++struct sa_stream { ++ char* output_unit; ++ int output_fd; ++ pthread_t thread_id; ++ pthread_mutex_t mutex; ++ char playing; ++ int64_t bytes_played; ++ ++ /* audio format info */ ++ unsigned int rate; ++ unsigned int channels; ++ int format; ++ ++ /* buffer list */ ++ sa_buf * bl_head; ++ sa_buf * bl_tail; ++ int n_bufs; + }; + +-/* Implemented API functions */ +-/** Normal way to open PCM device */ +-int sa_device_create_pcm(SAAudioHandle **_dev, const char *client_name, sa_pcm_mode_t rw_mode, sa_pcm_format_t format, int rate, int channels); +-/** Initialise the device */ +-int sa_device_open(SAAudioHandle *dev); +-/** Close/destroy everything */ +-int sa_device_close(SAAudioHandle *dev); +- +-/* Soft parameter setup - can only be called before calling open*/ +-/** Set write buffer lower mark */ +-int sa_device_set_write_lower_watermark(SAAudioHandle *dev, int size); +-/** Set read buffer lower mark */ +-int sa_device_set_read_lower_watermark(SAAudioHandle *dev, int size); +-/** Set write buffer upper watermark */ +-int sa_device_set_write_upper_watermark(SAAudioHandle *dev, int size); +-/** Set read buffer upper watermark */ +-int sa_device_set_read_upper_watermark(SAAudioHandle *dev, int size); +- +-/** volume in hundreths of dB's*/ +-int sa_device_change_input_volume(SAAudioHandle *dev, const int *vol); +-/** volume in hundreths of dB's*/ +-int sa_device_change_output_volume(SAAudioHandle *dev, const int *vol); +- +-/** Read audio playback position */ +-int sa_device_get_position(SAAudioHandle *dev, sa_pcm_index_t ref, int64_t *pos); +- +-/* Blocking I/O calls */ +-/** Interleaved playback function */ +-int sa_device_write(SAAudioHandle *dev, size_t nbytes, const void *data); +- +- +-/* Implementation-specific functions */ +-static int oss_audio_format(sa_pcm_format_t sa_format, int* oss_format); +-//static void sa_print_handle_settings(SAAudioHandle* dev); + +-/*! +- * \brief fills in the SAAudioHandle struct +- * \param SAAudioHandle - encapsulation of a handle to audio device +- * \param client_name - +- * \param rw_mode - requested device access type as in :: sa_pcm_mode_t +- * \param format - audio format as specified in ::sa_pcm_format_t +- * \return - Sydney API error as in ::sa_pcm_error_t ++/* ++ * Use a default buffer size with enough room for one second of audio, ++ * assuming stereo data at 44.1kHz with 32 bits per channel, and impose ++ * a generous limit on the number of buffers. + */ +-int sa_device_create_pcm(SAAudioHandle **_dev, const char *client_name, sa_pcm_mode_t rw_mode, sa_pcm_format_t format, int rate, int channels) { +- SAAudioHandle* dev = NULL; +- +- dev = malloc(sizeof(SAAudioHandle)); +- +- if (!dev) { +- return SA_DEVICE_OOM; +- } +- dev->channels = channels; +- dev->format = format; +- dev->rw_mode = rw_mode; +- dev->rate = rate; +- dev->readN = 0; +- dev->readN = 0; +- dev->capture_handle = -1; +- dev->playback_handle = -1; +- dev->interleaved = 1; +- dev->read_period = SA_READ_PERIOD; +- dev->write_period = SA_WRITE_PERIOD; +- dev->read_buffer = SA_READ_BUFFER; +- dev->write_buffer = SA_WRITE_BUFFER; +- dev->device_name = "/dev/dsp"; +- dev->stored = NULL; +- dev->stored_amount = 0; +- dev->stored_limit = 0; +- +- *_dev = dev; +- //sa_print_handle_settings(dev); +- return SA_DEVICE_SUCCESS; +-} ++#define BUF_SIZE (2 * 44100 * 4) ++#define BUF_LIMIT 5 ++ ++#if BUF_LIMIT < 2 ++#error BUF_LIMIT must be at least 2! ++#endif ++ ++static void audio_callback(void* s); ++static sa_buf *new_buffer(void); ++ ++/** Private functions - implementation specific */ + + /*! +- * \brief creates and opens selected audio device +- * \param dev - encapsulated audio device handle +- * \return - Sydney API error as in ::sa_pcm_error_t ++ * \brief private function mapping Sudney Audio format to OSS formats ++ * \param format - Sydney Audio API specific format ++ * \param - filled by the function with a value for corresponding OSS format ++ * \return - Sydney API error value as in ::sa_pcm_format_t ++ * */ ++static int oss_audio_format(sa_pcm_format_t sa_format, int *fmt) { ++ *fmt = -1; ++ switch (sa_format) { ++ case SA_PCM_FORMAT_U8: ++ *fmt = AFMT_U8; ++ break; ++ case SA_PCM_FORMAT_ULAW: ++ *fmt = AFMT_MU_LAW; ++ break; ++ case SA_PCM_FORMAT_ALAW: ++ *fmt = AFMT_A_LAW; ++ break; ++ /* 16-bit little endian (LE) format */ ++ case SA_PCM_FORMAT_S16_LE: ++ *fmt = AFMT_S16_LE; ++ break; ++ /* 16-bit big endian (BE) format */ ++ case SA_PCM_FORMAT_S16_BE: ++ *fmt = AFMT_S16_BE; ++ break; ++#if SOUND_VERSION >= OSS_VERSION(4,0,0) ++ /* 24-bit formats (LSB aligned in 32 bit word) */ ++ case SA_PCM_FORMAT_S24_LE: ++ *fmt = AFMT_S24_LE; ++ break; ++ /* 24-bit formats (LSB aligned in 32 bit word) */ ++ case SA_PCM_FORMAT_S24_BE: ++ *fmt = AFMT_S24_BE; ++ break; ++ /* 32-bit format little endian */ ++ case SA_PCM_FORMAT_S32_LE: ++ *fmt = AFMT_S32_LE; ++ break; ++ /* 32-bit format big endian */ ++ case SA_PCM_FORMAT_S32_BE: ++ *fmt = AFMT_S32_BE; ++ break; ++#endif ++ default: ++ return SA_ERROR_NOT_SUPPORTED; ++ break; ++ } ++ return SA_SUCCESS; ++} ++ ++/* ++ * ----------------------------------------------------------------------------- ++ * Startup and shutdown functions ++ * ----------------------------------------------------------------------------- + */ +-int sa_device_open(SAAudioHandle *dev) { +- int err; +- int fmt; +- int audio_fd = -1; +- +- if (dev->rw_mode == SA_PCM_WRONLY) { +- // open the default OSS device +- dev->device_name = "/dev/dsp"; // replace with a function which returns audio ouput device best matching the settings +- audio_fd = open(dev->device_name, O_WRONLY, 0); +- if (audio_fd == -1) { +- fprintf(stderr, "Cannot open device: %s\n", dev->device_name); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- +- // set the playback rate +- if ((err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &(dev->rate))) < 0) { +- fprintf(stderr, +- "Error setting the audio playback rate [%d]\n", +- dev->rate); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- // set the channel numbers +- if ((err = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, +- &(dev->channels)))< 0) { +- fprintf(stderr, "Error setting audio channels\n"); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- if ((err = oss_audio_format(dev->format, &fmt)) < 0) { +- fprintf(stderr, "Format unknown\n"); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- printf("Setting format with value %d\n", fmt); +- if ((err = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &fmt)) < 0 ) { +- fprintf(stderr, "Error setting audio format\n"); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- +- dev->playback_handle = audio_fd; +- +- } +- if (dev->rw_mode == SA_PCM_RDONLY) { +- return SA_DEVICE_NOT_SUPPORTED; +- } +- if (dev->rw_mode == SA_PCM_RW) { +- return SA_DEVICE_NOT_SUPPORTED; +- } +- fprintf(stderr, "Audio device opened successfully\n"); +- return SA_DEVICE_SUCCESS; +-} +- +-#define WRITE(data,amt) \ +- if ((err = write(dev->playback_handle, data, amt)) < 0) { \ +- fprintf(stderr, "Error writing data to audio device\n"); \ +- return SA_DEVICE_OOM; \ ++ ++int ++sa_stream_create_pcm( ++ sa_stream_t ** _s, ++ const char * client_name, ++ sa_mode_t mode, ++ sa_pcm_format_t format, ++ unsigned int rate, ++ unsigned int channels ++) { ++ sa_stream_t * s = 0; ++ int fmt = 0; ++ ++ /* ++ * Make sure we return a NULL stream pointer on failure. ++ */ ++ if (_s == NULL) { ++ return SA_ERROR_INVALID; ++ } ++ *_s = NULL; ++ ++ if (mode != SA_MODE_WRONLY) { ++ return SA_ERROR_NOT_SUPPORTED; ++ } ++ if (oss_audio_format(format, &fmt) != SA_SUCCESS) { ++ return SA_ERROR_NOT_SUPPORTED; + } + +-/*! +- * \brief Interleaved write operation +- * \param dev - device handle +- * \param nbytes - size of the audio buffer to be written to device +- * \param data - pointer to the buffer with audio samples +- * \return +- * */ +-int sa_device_write(SAAudioHandle *dev, size_t nbytes, const void *_data) { +- int err; +- audio_buf_info info; +- int bytes; +- char * data = (char *)_data; + /* +- ioctl(dev->playback_handle, SNDCTL_DSP_GETOSPACE, &info); +- printf("fragment size: %d, nfrags: %d, free: %d wtw: %d\n", info.fragsize, +- info.fragstotal, info.bytes, nbytes); +- */ ++ * Allocate the instance and required resources. ++ */ ++ if ((s = malloc(sizeof(sa_stream_t))) == NULL) { ++ return SA_ERROR_OOM; ++ } ++ if ((s->bl_head = new_buffer()) == NULL) { ++ free(s); ++ return SA_ERROR_OOM; ++ } ++ if (pthread_mutex_init(&s->mutex, NULL) != 0) { ++ free(s->bl_head); ++ free(s); ++ return SA_ERROR_SYSTEM; ++ } + ++ s->output_unit = "/dev/dsp"; ++ s->output_fd = -1; ++ s->thread_id = 0; ++ s->playing = 0; ++ s->bytes_played = 0; ++ s->rate = rate; ++ s->channels = channels; ++ s->format = fmt; ++ s->bl_tail = s->bl_head; ++ s->n_bufs = 1; ++ ++ *_s = s; ++ return SA_SUCCESS; ++} + + +- if ((dev->playback_handle) > 0) { +- ioctl(dev->playback_handle, SNDCTL_DSP_GETOSPACE, &info); +- bytes = info.bytes; +- if (dev->stored_amount > bytes) { +- WRITE(dev->stored, bytes); +- memmove(dev->stored, dev->stored + bytes, dev->stored_amount - bytes); +- dev->stored_amount -= bytes; +- } else if (dev->stored_amount > 0) { +- WRITE(dev->stored, dev->stored_amount); +- bytes -= dev->stored_amount; +- dev->stored_amount = 0; +- if (nbytes < bytes) { +- WRITE(data, nbytes); +- return SA_DEVICE_SUCCESS; +- } +- WRITE(data, bytes); +- data += bytes; +- nbytes -= bytes; +- } else { +- if (nbytes < bytes) { +- WRITE(data, nbytes); +- return SA_DEVICE_SUCCESS; +- } +- WRITE(data, bytes); +- data += bytes; +- nbytes -= bytes; +- } ++int ++sa_stream_open(sa_stream_t *s) { ++ if (s == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ if (s->output_unit == NULL || s->output_fd != -1) { ++ return SA_ERROR_INVALID; ++ } + +- if (nbytes > 0) { +- if (dev->stored_amount + nbytes > dev->stored_limit) { +- dev->stored = realloc(dev->stored, dev->stored_amount + nbytes); +- } +- +- memcpy(dev->stored + dev->stored_amount, data, nbytes); +- dev->stored_amount += nbytes; +- } +- } +- return SA_DEVICE_SUCCESS; ++ // open the default OSS device ++ if ((s->output_fd = open(s->output_unit, O_WRONLY, 0)) == -1) { ++ return SA_ERROR_NO_DEVICE; ++ } ++ ++ // set the playback rate ++ if (ioctl(s->output_fd, SNDCTL_DSP_SPEED, &(s->rate)) < 0) { ++ close(s->output_fd); ++ s->output_fd = -1; ++ return SA_ERROR_NOT_SUPPORTED; ++ } ++ ++ // set the channel numbers ++ if (ioctl(s->output_fd, SNDCTL_DSP_CHANNELS, &(s->channels)) < 0) { ++ close(s->output_fd); ++ s->output_fd = -1; ++ return SA_ERROR_NOT_SUPPORTED; ++ } ++ ++ if (ioctl(s->output_fd, SNDCTL_DSP_SETFMT, &(s->format)) < 0 ) { ++ close(s->output_fd); ++ s->output_fd = -1; ++ return SA_ERROR_NOT_SUPPORTED; ++ } ++ ++ return SA_SUCCESS; + } + +-#define CLOSE_HANDLE(x) if (x != -1) close(x); + +-/*! +- * \brief Closes and destroys allocated resources +- * \param dev - Sydney Audio device handle +- * \return Sydney API error as in ::sa_pcm_error_t +- **/ +-int sa_device_close(SAAudioHandle *dev) { +- int err; ++int ++sa_stream_destroy(sa_stream_t *s) { ++ int result = SA_SUCCESS; + +- if (dev != NULL) { ++ if (s == NULL) { ++ return SA_SUCCESS; ++ } + +- if (dev->stored_amount > 0) { +- WRITE(dev->stored, dev->stored_amount); +- } ++ pthread_mutex_lock(&s->mutex); + +- if (dev->stored != NULL) { +- free(dev->stored); ++ /* ++ * This causes the thread sending data to ALSA to stop ++ */ ++ s->thread_id = 0; ++ ++ /* ++ * Shut down the audio output device. ++ */ ++ if (s->output_fd != -1) { ++ if (s->playing && close(s->output_fd) < 0) { ++ result = SA_ERROR_SYSTEM; + } ++ } + +- dev->stored = NULL; +- dev->stored_amount = 0; +- dev->stored_limit = 0; +- +- CLOSE_HANDLE(dev->playback_handle); +- CLOSE_HANDLE(dev->capture_handle); +- +- printf("Closing audio device\n"); +- free(dev); +- } +- return SA_DEVICE_SUCCESS; +-} +- +-/** +- * \brief +- * \param dev +- * \param size +- * \return Sydney API error as in ::sa_pcm_error_t +- */ +-int sa_device_set_write_lower_watermark(SAAudioHandle *dev, int size) { +- dev->write_period = size; +- return SA_DEVICE_SUCCESS; +-} +-/** +- * \brief +- * \param dev +- * \param size +- * \return Sydney API error as in ::sa_pcm_error_t +- */ +-int sa_device_set_read_lower_watermark(SAAudioHandle *dev, int size) { +- dev->read_period = size; +- return SA_DEVICE_SUCCESS; +-} +-/** +- * \brief +- * \param dev +- * \param size +- * \return Sydney API error as in ::sa_pcm_error_t +- */ +-int sa_device_set_write_upper_watermark(SAAudioHandle *dev, int size) { +- dev->write_buffer = size; +- return SA_DEVICE_SUCCESS; ++ pthread_mutex_unlock(&s->mutex); ++ ++ /* ++ * Release resources. ++ */ ++ if (pthread_mutex_destroy(&s->mutex) != 0) { ++ result = SA_ERROR_SYSTEM; ++ } ++ while (s->bl_head != NULL) { ++ sa_buf * next = s->bl_head->next; ++ free(s->bl_head); ++ s->bl_head = next; ++ } ++ free(s); ++ ++ return result; + } + +-/** +- * \brief +- * \param dev +- * \param size +- * \return Sydney API error as in ::sa_pcm_error_t ++ ++ ++/* ++ * ----------------------------------------------------------------------------- ++ * Data read and write functions ++ * ----------------------------------------------------------------------------- + */ +-int sa_device_set_read_upper_watermark(SAAudioHandle *dev, int size) { +- dev->read_buffer = size; +- return SA_DEVICE_SUCCESS; +-} + ++int ++sa_stream_write(sa_stream_t *s, const void *data, size_t nbytes) { ++ int result = SA_SUCCESS; + +-int sa_device_set_xrun_mode(SAAudioHandle *dev, sa_xrun_mode_t mode) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ if (s == NULL || s->output_unit == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ if (nbytes == 0) { ++ return SA_SUCCESS; ++ } + ++ pthread_mutex_lock(&s->mutex); + +-int sa_device_set_ni(SAAudioHandle *dev) { +- dev->interleaved = 1; +- return SA_DEVICE_SUCCESS; +-} ++ /* ++ * Append the new data to the end of our buffer list. ++ */ ++ while (1) { ++ unsigned int avail = s->bl_tail->size - s->bl_tail->end; ++ ++ if (nbytes <= avail) { ++ ++ /* ++ * The new data will fit into the current tail buffer, so ++ * just copy it in and we're done. ++ */ ++ memcpy(s->bl_tail->data + s->bl_tail->end, data, nbytes); ++ s->bl_tail->end += nbytes; ++ break; + +-int sa_device_start_thread(SAAudioHandle *dev, sa_device_callback *callback) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ } else { + +-int sa_device_set_channel_map(SAAudioHandle *dev, const sa_channel_def_t *map) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ /* ++ * Copy what we can into the tail and allocate a new buffer ++ * for the rest. ++ */ ++ memcpy(s->bl_tail->data + s->bl_tail->end, data, avail); ++ s->bl_tail->end += avail; ++ data = ((unsigned char *)data) + avail; ++ nbytes -= avail; ++ ++ /* ++ * If we still have data left to copy but we've hit the limit of ++ * allowable buffer allocations, we need to spin for a bit to allow ++ * the audio callback function to slurp some more data up. ++ */ ++ if (nbytes > 0 && s->n_bufs == BUF_LIMIT) { ++#ifdef TIMING_TRACE ++ printf("#"); /* too much audio data */ ++#endif ++ if (!s->playing) { ++ /* ++ * We haven't even started playing yet! That means the ++ * BUF_SIZE/BUF_LIMIT values are too low... Not much we can ++ * do here; spinning won't help because the audio callback ++ * hasn't been enabled yet. Oh well, error time. ++ */ ++ printf("Too much audio data received before audio device enabled!\n"); ++ result = SA_ERROR_SYSTEM; ++ break; ++ } ++ while (s->n_bufs == BUF_LIMIT) { ++ struct timespec ts = {0, 1000000}; ++ pthread_mutex_unlock(&s->mutex); ++ nanosleep(&ts, NULL); ++ pthread_mutex_lock(&s->mutex); ++ } ++ } ++ ++ /* ++ * Allocate a new tail buffer, and go 'round again to fill it up. ++ */ ++ if ((s->bl_tail->next = new_buffer()) == NULL) { ++ result = SA_ERROR_OOM; ++ break; ++ } ++ s->n_bufs++; ++ s->bl_tail = s->bl_tail->next; + ++ } /* if (nbytes <= avail), else */ + +-int sa_device_change_device(SAAudioHandle *dev, const char *device_name) { +- return SA_DEVICE_NOT_SUPPORTED; ++ } /* while (1) */ ++ ++ pthread_mutex_unlock(&s->mutex); ++ ++ /* ++ * Once we have our first block of audio data, enable the audio callback ++ * function. This doesn't need to be protected by the mutex, because ++ * s->playing is not used in the audio callback thread, and it's probably ++ * better not to be inside the lock when we enable the audio callback. ++ */ ++ if (!s->playing) { ++ s->playing = 1; ++ if (pthread_create(&s->thread_id, NULL, (void *)audio_callback, s) != 0) { ++ result = SA_ERROR_SYSTEM; ++ } ++ } ++ ++ return result; + } + +-/*! +- * \brief volume in hundreths of dB's +- * \param dev - device handle +- * \param vol - volume level +- * \return Sydney API error as in ::sa_pcm_error_t +- * */ +-int sa_device_change_input_volume(SAAudioHandle *dev, const int *vol) { +-#if SOUND_VERSION >= OSS_VERSION(4,0,0) +- int err; +- if ((err = ioctl(dev->capture_handle, SNDCTL_DSP_SETRECVOL, vol) < 0) { +- fpritnf(stderr, "Error setting new recording volume level\n"); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- return SA_DEVICE_SUCCESS; +-#else +- return SA_DEVICE_NOT_SUPPORTED; ++ ++static void audio_callback(void* data) ++{ ++ sa_stream_t* s = (sa_stream_t*)data; ++ audio_buf_info info; ++ char* buffer = 0; ++ unsigned int avail; ++ int frames; ++ ++#ifdef TIMING_TRACE ++ printf("."); /* audio read 'tick' */ + #endif +-} + +-/*! +- * \brief volume in hundreths of dB's +- * \param dev - device handle +- * \param vol - volume level +- * \retrun Sydney API error as in ::sa_pcm_error_t +- * */ +-int sa_device_change_output_volume(SAAudioHandle *dev, const int *vol) { +-#if SOUND_VERSION >= OSS_VERSION(4,0,0) +- int err; +- if ((err = ioctl(dev->playback_handle, SNDCTL_DSP_SETPLAYVOL, vol) < 0){ ++ ioctl(s->output_fd, SNDCTL_DSP_GETOSPACE, &info); ++ buffer = malloc(info.bytes); + +- fprintf(stderr, "Error setting new playback volume\n"); +- //assert(0); +- return SA_DEVICE_OOM; +- } +- return SA_DEVICE_SUCCESS; +-#else +- return SA_DEVICE_NOT_SUPPORTED; ++ while(1) { ++ char* dst = buffer; ++ unsigned int bytes_to_copy = info.bytes; ++ int bytes = info.bytes; ++ ++ pthread_mutex_lock(&s->mutex); ++ if (!s->thread_id) ++ break; ++ ++ /* ++ * Consume data from the start of the buffer list. ++ */ ++ while (1) { ++ assert(s->bl_head->start <= s->bl_head->end); ++ avail = s->bl_head->end - s->bl_head->start; ++ ++ if (avail >= bytes_to_copy) { ++ /* ++ * We have all we need in the head buffer, so just grab it and go. ++ */ ++ memcpy(dst, s->bl_head->data + s->bl_head->start, bytes_to_copy); ++ s->bl_head->start += bytes_to_copy; ++ s->bytes_played += bytes_to_copy; ++ break; ++ ++ } else { ++ ++ sa_buf* next = 0; ++ /* ++ * Copy what we can from the head and move on to the next buffer. ++ */ ++ memcpy(dst, s->bl_head->data + s->bl_head->start, avail); ++ s->bl_head->start += avail; ++ dst += avail; ++ bytes_to_copy -= avail; ++ s->bytes_played += avail; ++ ++ /* ++ * We want to free the now-empty buffer, but not if it's also the ++ * current tail. If it is the tail, we don't have enough data to fill ++ * the destination buffer, so we write less and give up. ++ */ ++ next = s->bl_head->next; ++ if (next == NULL) { ++#ifdef TIMING_TRACE ++ printf("!"); /* not enough audio data */ + #endif +-} ++ bytes = bytes-bytes_to_copy; ++ break; ++ } ++ free(s->bl_head); ++ s->bl_head = next; ++ s->n_bufs--; + +-int sa_device_change_sampling_rate(SAAudioHandle *dev, int rate) { +- dev->rate = rate; +- return SA_DEVICE_SUCCESS; +-} ++ } /* if (avail >= bytes_to_copy), else */ + +-int sa_device_change_client_name(SAAudioHandle *dev, const char *client_name) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ } /* while (1) */ + +-int sa_device_change_stream_name(SAAudioHandle *dev, const char *stream_name) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ pthread_mutex_unlock(&s->mutex); + +-int sa_device_change_user_data(SAAudioHandle *dev, void *val) { +- return SA_DEVICE_NOT_SUPPORTED; ++ if(bytes > 0) { ++ frames = write(s->output_fd, buffer, bytes); ++ if (frames < 0) { ++ printf("error writing to sound device\n"); ++ } ++ if (frames >= 0 && frames != bytes) { ++ printf("short write (expected %d, wrote %d)\n", (int)bytes, (int)frames); ++ } ++ } ++ } ++ free(buffer); + } + + +-/*! +- * \brief +- * \param dev +- * \param rate +- * \param direction +- * \return Sydney API error as in ::sa_pcm_error_t +- * */ +-int sa_device_adjust_rate(SAAudioHandle *dev, int rate, int direction) { +- return SA_DEVICE_NOT_SUPPORTED; +-} +-/*! +- * \brief +- * \param dev +- * \param nb_channels +- * \return Sydney API error as in ::sa_pcm_error_t +- * */ +-int sa_device_adjust_channels(SAAudioHandle *dev, int nb_channels) { return SA_DEVICE_NOT_SUPPORTED; +-} +-/** Adjust bit sample format */ +-int sa_device_adjust_format(SAAudioHandle *dev, sa_pcm_format_t format, int direction) { +- return SA_DEVICE_NOT_SUPPORTED; +-} + +-/** Get current state of the audio device */ +-int sa_device_get_state(SAAudioHandle *dev, sa_state_t *running) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++/* ++ * ----------------------------------------------------------------------------- ++ * General query and support functions ++ * ----------------------------------------------------------------------------- ++ */ + +-/** Get current sampling rate */ +-int sa_device_get_sampling_rate(SAAudioHandle *dev, int *rate) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++int ++sa_stream_get_write_size(sa_stream_t *s, size_t *size) { ++ sa_buf * b; ++ size_t used = 0; + +-/** Get number of channels */ +-int sa_device_get_nb_channels(SAAudioHandle *dev, int *nb_channels) { +- return SA_DEVICE_NOT_SUPPORTED; +-} ++ if (s == NULL || s->output_unit == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ ++ pthread_mutex_lock(&s->mutex); ++ ++ /* ++ * Sum up the used portions of our buffers and subtract that from ++ * the pre-defined max allowed allocation. ++ */ ++ for (b = s->bl_head; b != NULL; b = b->next) { ++ used += b->end - b->start; ++ } ++ *size = BUF_SIZE * BUF_LIMIT - used; + +-/** Get format being used */ +-int sa_device_get_format(SAAudioHandle *dev, sa_pcm_format_t *format) { +- return SA_DEVICE_NOT_SUPPORTED; ++ pthread_mutex_unlock(&s->mutex); ++ return SA_SUCCESS; + } + +-/** Get opaque pointer associated to the device */ +-int sa_device_get_user_data(SAAudioHandle *dev, void **val) { +- return SA_DEVICE_NOT_SUPPORTED; ++ ++int ++sa_stream_get_position(sa_stream_t *s, sa_position_t position, int64_t *pos) { ++ int err; ++ count_info ptr; ++ ++ if (s == NULL || s->output_unit == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ if (position != SA_POSITION_WRITE_SOFTWARE) { ++ return SA_ERROR_NOT_SUPPORTED; ++ } ++ if ((err = ioctl(s->output_fd, ++ SNDCTL_DSP_GETOPTR, ++ &ptr)) <0) { ++ fprintf(stderr, "Error reading playback position\n"); ++ return SA_ERROR_OOM; ++ } ++ ++ pthread_mutex_lock(&s->mutex); ++ *pos = (int64_t)ptr.bytes; ++ pthread_mutex_unlock(&s->mutex); ++ return SA_SUCCESS; + } + +-/** Obtain the error code */ +-int sa_device_get_event_error(SAAudioHandle *dev, sa_pcm_error_t *error) { +- return SA_DEVICE_NOT_SUPPORTED; ++ ++int ++sa_stream_pause(sa_stream_t *s) { ++ ++ if (s == NULL || s->output_unit == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ ++ pthread_mutex_lock(&s->mutex); ++#if 0 /* TODO */ ++ AudioOutputUnitStop(s->output_unit); ++#endif ++ pthread_mutex_unlock(&s->mutex); ++ return SA_SUCCESS; + } + +-/** Obtain the notification code */ +-int sa_device_get_event_notify(SAAudioHandle *dev, sa_pcm_notification_t *notify) { +- return SA_DEVICE_NOT_SUPPORTED; ++ ++int ++sa_stream_resume(sa_stream_t *s) { ++ ++ if (s == NULL || s->output_unit == NULL) { ++ return SA_ERROR_NO_INIT; ++ } ++ ++ pthread_mutex_lock(&s->mutex); ++ ++ /* ++ * The audio device resets its mSampleTime counter after pausing, ++ * so we need to clear our tracking value to keep that in sync. ++ */ ++ s->bytes_played = 0; ++#if 0 /* TODO */ ++ AudioOutputUnitStart(s->output_unit); ++#endif ++ pthread_mutex_unlock(&s->mutex); ++ return SA_SUCCESS; + } + +-/*! +- * \brief returns the current position of the audio playback capture +- * \param dev - device handle +- * \param ref - type of position to be returned by this function see ::sa_pcm_index_t +- * \param pos - position (in bytes or ms depending on 'ref' value) +- * \return Sydney API error as in ::sa_pcm_error_t +- * */ +-int sa_device_get_position(SAAudioHandle *dev, sa_pcm_index_t ref, int64_t *pos) +-{ +- int err; +- int64_t _pos; +- int delay; +- count_info ptr; +- switch (ref) { +- case SA_PCM_WRITE_DELAY: +- //int delay; +- if ((err = ioctl(dev->playback_handle, +- SNDCTL_DSP_GETODELAY, +- &delay)) <0) { +- fprintf(stderr, "Error reading playback buffering delay\n"); +- return SA_DEVICE_OOM; +- }; +- _pos = (int64_t)delay; +- break; +- case SA_PCM_WRITE_SOFTWARE_POS: +- //count_info ptr; +- if ((err = ioctl(dev->playback_handle, +- SNDCTL_DSP_GETOPTR, +- &ptr)) <0) { +- //fprintf(stderr, "Error reading audio playback position\n"); +- return SA_DEVICE_OOM; +- }; +- _pos = (int64_t)ptr.bytes; +- break; +- case SA_PCM_READ_SOFTWARE_POS: +- //count_info ptr; +- if ((err = ioctl(dev->playback_handle, +- SNDCTL_DSP_GETIPTR, +- &ptr)) <0) { +- fprintf(stderr, "Error reading audio capture position\n"); +- return SA_DEVICE_OOM; +- }; +- _pos = (int64_t)ptr.bytes; +- break; +- +- case SA_PCM_READ_DELAY: +- case SA_PCM_READ_HARDWARE_POS: +- case SA_PCM_WRITE_HARDWARE_POS: +- case SA_PCM_DUPLEX_DELAY: +- default: +- return SA_DEVICE_NOT_SUPPORTED; +- break; +- } +- (*pos) = _pos; +- return SA_DEVICE_SUCCESS; ++ ++static sa_buf * ++new_buffer(void) { ++ sa_buf * b = malloc(sizeof(sa_buf) + BUF_SIZE); ++ if (b != NULL) { ++ b->size = BUF_SIZE; ++ b->start = 0; ++ b->end = 0; ++ b->next = NULL; ++ } ++ return b; + } + +-/** Private functions - implementation specific */ + +-/*! +- * \brief private function mapping Sudney Audio format to OSS formats +- * \param format - Sydney Audio API specific format +- * \param - filled by the function with a value for corresponding OSS format +- * \return - Sydney API error value as in ::sa_pcm_format_t +- * */ +-static int oss_audio_format(sa_pcm_format_t sa_format, int* oss_format) { +-#if SOUND_VERSION >= OSS_VERSION(4,0,0) +- int fmt = AFMT_UNDEF; ++ ++/* ++ * ----------------------------------------------------------------------------- ++ * Extension functions ++ * ----------------------------------------------------------------------------- ++ */ ++ ++int ++sa_stream_set_volume_abs(sa_stream_t *s, float vol) { ++ if (s == NULL || s->output_fd == -1) { ++ return SA_ERROR_NO_INIT; ++ } ++#if SOUND_VERSION >= OSS_VERSION(4,0,0) ++ int mvol = ((int)(100*vol)) | ((int)(100*vol) << 8); ++ if (ioctl(s->output_fd, SNDCTL_DSP_SETPLAYVOL, &mvol) < 0){ ++ return SA_ERROR_SYSTEM; ++ } ++ return SA_SUCCESS; + #else +- int fmt = -1; +-#endif +- switch (sa_format) { +- case SA_PCM_UINT8: +- fmt = AFMT_U8; +- break; +- case SA_PCM_ULAW: +- fmt = AFMT_MU_LAW; +- break; +- case SA_PCM_ALAW: +- fmt = AFMT_A_LAW; +- break; +- /* 16-bit little endian (LE) format */ +- case SA_PCM_S16_LE: +- fmt = AFMT_S16_LE; +- break; +- /* 16-bit big endian (BE) format */ +- case SA_PCM_S16_BE: +- fmt = AFMT_S16_BE; +- break; ++ return SA_ERROR_NOT_SUPPORTED; ++#endif ++} ++ ++ ++int ++sa_stream_get_volume_abs(sa_stream_t *s, float *vol) { ++ ++ if (vol == NULL) { ++ return SA_ERROR_INVALID; ++ } ++ *vol = 0.0f; ++ if (s == NULL || s->output_fd == -1) { ++ return SA_ERROR_NO_INIT; ++ } + #if SOUND_VERSION >= OSS_VERSION(4,0,0) +- /* 24-bit formats (LSB aligned in 32 bit word) */ +- case SA_PCM_S24_LE: +- fmt = AFMT_S24_LE; +- break; +- /* 24-bit formats (LSB aligned in 32 bit word) */ +- case SA_PCM_S24_BE: +- fmt = AFMT_S24_BE; +- break; +- /* 32-bit format little endian */ +- case SA_PCM_S32_LE: +- fmt = AFMT_S32_LE; +- break; +- /* 32-bit format big endian */ +- case SA_PCM_S32_BE: +- fmt = AFMT_S32_BE; +- break; +- case SA_PCM_FLOAT32_NE: +- fmt = AFMT_FLOAT; +- break; ++ int mvol; ++ if (ioctl(s->output_fd, SNDCTL_DSP_SETPLAYVOL, &mvol) < 0){ ++ return SA_ERROR_SYSTEM; ++ } ++ *vol = ((mvol & 0xFF) + (mvol >> 8)) / 200.0f; ++ return SA_SUCCESS; ++#else ++ return SA_ERROR_NOT_SUPPORTED; + #endif +- default: +- return SA_DEVICE_NOT_SUPPORTED; +- break; +- +- } +- (*oss_format) = fmt; +- return SA_DEVICE_SUCCESS; + } + ++ ++ + /* +-static void sa_print_handle_settings(SAAudioHandle* dev) { +- printf(">>>>>>>>>>>> SA Device Handle <<<<<<<<<<<\n"); +- printf("[SA Audio] - Device name %s\n", dev->device_name); +- printf("[SA_Audio] - Number of audio channels %d\n", dev->channels); +- printf("[SA_Audio] - Read period size %d bytes\n", dev->read_period); +- printf("[SA_Audio] - Write period size %d bytes\n", dev->write_period); +- printf("[SA_Audio] - Write buffer size %d bytes\n", dev->write_buffer); +- printf("[SA_Audio] - Read buffer size %d bytes\n", dev->read_buffer); +- printf("[SA_Audio] - Read/write mode value %d\n", dev->rw_mode); +- printf("[SA_Audio] - Audio sample bit format value %d\n", dev->format); +- printf("[SA_Audio] - Audio playback rate %d\n", dev->rate); +- if (dev->interleaved) { +- printf("[SA_Audio] - Processing interleaved audio\n"); +- } else { +- printf("[SA_Audio] - Processing non-interleaved audio\n"); +- } +- if ((dev->capture_handle) > 0) { +- printf("[SA Audio] - Device opened for capture\n"); +- } +- if ((dev->playback_handle) > 0) { +- printf("[SA_Audio] - Device opened for playback\n"); +- } +-} +-*/ ++ * ----------------------------------------------------------------------------- ++ * Unsupported functions ++ * ----------------------------------------------------------------------------- ++ */ ++#define UNSUPPORTED(func) func { return SA_ERROR_NOT_SUPPORTED; } ++ ++UNSUPPORTED(int sa_stream_create_opaque(sa_stream_t **s, const char *client_name, sa_mode_t mode, const char *codec)) ++UNSUPPORTED(int sa_stream_set_write_lower_watermark(sa_stream_t *s, size_t size)) ++UNSUPPORTED(int sa_stream_set_read_lower_watermark(sa_stream_t *s, size_t size)) ++UNSUPPORTED(int sa_stream_set_write_upper_watermark(sa_stream_t *s, size_t size)) ++UNSUPPORTED(int sa_stream_set_read_upper_watermark(sa_stream_t *s, size_t size)) ++UNSUPPORTED(int sa_stream_set_channel_map(sa_stream_t *s, const sa_channel_t map[], unsigned int n)) ++UNSUPPORTED(int sa_stream_set_xrun_mode(sa_stream_t *s, sa_xrun_mode_t mode)) ++UNSUPPORTED(int sa_stream_set_non_interleaved(sa_stream_t *s, int enable)) ++UNSUPPORTED(int sa_stream_set_dynamic_rate(sa_stream_t *s, int enable)) ++UNSUPPORTED(int sa_stream_set_driver(sa_stream_t *s, const char *driver)) ++UNSUPPORTED(int sa_stream_start_thread(sa_stream_t *s, sa_event_callback_t callback)) ++UNSUPPORTED(int sa_stream_stop_thread(sa_stream_t *s)) ++UNSUPPORTED(int sa_stream_change_device(sa_stream_t *s, const char *device_name)) ++UNSUPPORTED(int sa_stream_change_read_volume(sa_stream_t *s, const int32_t vol[], unsigned int n)) ++UNSUPPORTED(int sa_stream_change_write_volume(sa_stream_t *s, const int32_t vol[], unsigned int n)) ++UNSUPPORTED(int sa_stream_change_rate(sa_stream_t *s, unsigned int rate)) ++UNSUPPORTED(int sa_stream_change_meta_data(sa_stream_t *s, const char *name, const void *data, size_t size)) ++UNSUPPORTED(int sa_stream_change_user_data(sa_stream_t *s, const void *value)) ++UNSUPPORTED(int sa_stream_set_adjust_rate(sa_stream_t *s, sa_adjust_t direction)) ++UNSUPPORTED(int sa_stream_set_adjust_nchannels(sa_stream_t *s, sa_adjust_t direction)) ++UNSUPPORTED(int sa_stream_set_adjust_pcm_format(sa_stream_t *s, sa_adjust_t direction)) ++UNSUPPORTED(int sa_stream_set_adjust_watermarks(sa_stream_t *s, sa_adjust_t direction)) ++UNSUPPORTED(int sa_stream_get_mode(sa_stream_t *s, sa_mode_t *access_mode)) ++UNSUPPORTED(int sa_stream_get_codec(sa_stream_t *s, char *codec, size_t *size)) ++UNSUPPORTED(int sa_stream_get_pcm_format(sa_stream_t *s, sa_pcm_format_t *format)) ++UNSUPPORTED(int sa_stream_get_rate(sa_stream_t *s, unsigned int *rate)) ++UNSUPPORTED(int sa_stream_get_nchannels(sa_stream_t *s, int *nchannels)) ++UNSUPPORTED(int sa_stream_get_user_data(sa_stream_t *s, void **value)) ++UNSUPPORTED(int sa_stream_get_write_lower_watermark(sa_stream_t *s, size_t *size)) ++UNSUPPORTED(int sa_stream_get_read_lower_watermark(sa_stream_t *s, size_t *size)) ++UNSUPPORTED(int sa_stream_get_write_upper_watermark(sa_stream_t *s, size_t *size)) ++UNSUPPORTED(int sa_stream_get_read_upper_watermark(sa_stream_t *s, size_t *size)) ++UNSUPPORTED(int sa_stream_get_channel_map(sa_stream_t *s, sa_channel_t map[], unsigned int *n)) ++UNSUPPORTED(int sa_stream_get_xrun_mode(sa_stream_t *s, sa_xrun_mode_t *mode)) ++UNSUPPORTED(int sa_stream_get_non_interleaved(sa_stream_t *s, int *enabled)) ++UNSUPPORTED(int sa_stream_get_dynamic_rate(sa_stream_t *s, int *enabled)) ++UNSUPPORTED(int sa_stream_get_driver(sa_stream_t *s, char *driver_name, size_t *size)) ++UNSUPPORTED(int sa_stream_get_device(sa_stream_t *s, char *device_name, size_t *size)) ++UNSUPPORTED(int sa_stream_get_read_volume(sa_stream_t *s, int32_t vol[], unsigned int *n)) ++UNSUPPORTED(int sa_stream_get_write_volume(sa_stream_t *s, int32_t vol[], unsigned int *n)) ++UNSUPPORTED(int sa_stream_get_meta_data(sa_stream_t *s, const char *name, void*data, size_t *size)) ++UNSUPPORTED(int sa_stream_get_adjust_rate(sa_stream_t *s, sa_adjust_t *direction)) ++UNSUPPORTED(int sa_stream_get_adjust_nchannels(sa_stream_t *s, sa_adjust_t *direction)) ++UNSUPPORTED(int sa_stream_get_adjust_pcm_format(sa_stream_t *s, sa_adjust_t *direction)) ++UNSUPPORTED(int sa_stream_get_adjust_watermarks(sa_stream_t *s, sa_adjust_t *direction)) ++UNSUPPORTED(int sa_stream_get_state(sa_stream_t *s, sa_state_t *state)) ++UNSUPPORTED(int sa_stream_get_event_error(sa_stream_t *s, sa_error_t *error)) ++UNSUPPORTED(int sa_stream_get_event_notify(sa_stream_t *s, sa_notify_t *notify)) ++UNSUPPORTED(int sa_stream_read(sa_stream_t *s, void *data, size_t nbytes)) ++UNSUPPORTED(int sa_stream_read_ni(sa_stream_t *s, unsigned int channel, void *data, size_t nbytes)) ++UNSUPPORTED(int sa_stream_write_ni(sa_stream_t *s, unsigned int channel, const void *data, size_t nbytes)) ++UNSUPPORTED(int sa_stream_pwrite(sa_stream_t *s, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence)) ++UNSUPPORTED(int sa_stream_pwrite_ni(sa_stream_t *s, unsigned int channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence)) ++UNSUPPORTED(int sa_stream_get_read_size(sa_stream_t *s, size_t *size)) ++UNSUPPORTED(int sa_stream_drain(sa_stream_t *s)) + +-#endif // (SOUND_VERSION > SUPP_OSS_VERSION) ++const char *sa_strerror(int code) { return NULL; } ++ ++#endif diff --git a/www/firefox3-devel/files/patch-media_liboggplay_src_liboggplay_std_semaphore.h b/www/firefox3-devel/files/patch-media_liboggplay_src_liboggplay_std_semaphore.h new file mode 100644 index 000000000..0ba003a7c --- /dev/null +++ b/www/firefox3-devel/files/patch-media_liboggplay_src_liboggplay_std_semaphore.h @@ -0,0 +1,11 @@ +--- media/liboggplay/src/liboggplay/std_semaphore.h.orig 2008-11-24 20:59:17.000000000 +0000 ++++ media/liboggplay/src/liboggplay/std_semaphore.h 2008-11-24 20:59:29.000000000 +0000 +@@ -34,7 +34,7 @@ + + #ifndef _STD_SEMAPHORE_H + #define _STD_SEMAPHORE_H +-#if defined(linux) ++#if defined(linux) || defined(__FreeBSD__) + #include <semaphore.h> + #define SEM_CREATE(p,s) sem_init(&(p), 1, s) + #define SEM_SIGNAL(p) sem_post(&(p)) diff --git a/www/firefox3-devel/files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h b/www/firefox3-devel/files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h new file mode 100644 index 000000000..614456a9d --- /dev/null +++ b/www/firefox3-devel/files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h @@ -0,0 +1,11 @@ +--- media/liboggz/include/oggz/oggz_off_t_generated.h.orig 2008-11-24 21:01:48.000000000 +0000 ++++ media/liboggz/include/oggz/oggz_off_t_generated.h 2008-11-24 21:16:57.000000000 +0000 +@@ -59,7 +59,7 @@ + + #include <sys/types.h> + +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined (__FreeBSD__) + typedef off_t oggz_off_t; + #else + typedef loff_t oggz_off_t; diff --git a/www/firefox3-devel/files/patch-security-coreconf-FreeBSD.mk b/www/firefox3-devel/files/patch-security-coreconf-FreeBSD.mk new file mode 100644 index 000000000..c4ed8e5ba --- /dev/null +++ b/www/firefox3-devel/files/patch-security-coreconf-FreeBSD.mk @@ -0,0 +1,30 @@ +--- security/coreconf/FreeBSD.mk.orig 2008-07-06 00:10:00.000000000 -0500 ++++ security/coreconf/FreeBSD.mk 2008-07-06 00:12:34.000000000 -0500 +@@ -45,8 +45,12 @@ + ifeq ($(OS_TEST),alpha) + CPU_ARCH = alpha + else ++ifeq ($(OS_TEST),amd64) ++CPU_ARCH = amd64 ++else + CPU_ARCH = x86 + endif ++endif + + OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK + +@@ -73,7 +77,7 @@ + DLL_SUFFIX = so.1.0 + endif + +-MKSHLIB = $(CC) $(DSO_LDOPTS) ++MKSHLIB = $(CC) -Wl,-Bsymbolic -lc $(DSO_LDOPTS) -o $@ + ifdef MAPFILE + MKSHLIB += -Wl,--version-script,$(MAPFILE) + endif +@@ -82,4 +86,4 @@ + + G++INCLUDES = -I/usr/include/g++ + +-INCLUDES += -I/usr/X11R6/include ++#INCLUDES += -I/usr/X11R6/include diff --git a/www/firefox3-devel/files/patch-security_manager_ssl_src_nsNSSComponent.cpp b/www/firefox3-devel/files/patch-security_manager_ssl_src_nsNSSComponent.cpp new file mode 100644 index 000000000..f30d12229 --- /dev/null +++ b/www/firefox3-devel/files/patch-security_manager_ssl_src_nsNSSComponent.cpp @@ -0,0 +1,10 @@ +--- security/manager/ssl/src/nsNSSComponent.cpp.orig Mon May 29 23:10:54 2006 ++++ security/manager/ssl/src/nsNSSComponent.cpp Mon May 29 23:12:22 2006 +@@ -110,6 +110,7 @@ + #include "nss.h" + #include "pk11func.h" + #include "ssl.h" ++#define NSS_ENABLE_ECC 1 + #include "sslproto.h" + #include "secmod.h" + #include "sechash.h" diff --git a/www/firefox3-devel/files/patch-storage_build_Makefile.in b/www/firefox3-devel/files/patch-storage_build_Makefile.in new file mode 100644 index 000000000..18202a5a6 --- /dev/null +++ b/www/firefox3-devel/files/patch-storage_build_Makefile.in @@ -0,0 +1,10 @@ +--- storage/build/Makefile.in.orig Tue Feb 21 11:18:56 2006 ++++ storage/build/Makefile.in Sun Nov 5 16:16:06 2006 +@@ -77,6 +77,7 @@ + $(EXTRA_DSO_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(MOZ_JS_LIBS) \ ++ %%PTHREAD_LIBS%% \ + $(NULL) + + include $(topsrcdir)/config/rules.mk diff --git a/www/firefox3-devel/files/patch-toolkit_mozapps_installer_packager.mk b/www/firefox3-devel/files/patch-toolkit_mozapps_installer_packager.mk new file mode 100644 index 000000000..635c3c79c --- /dev/null +++ b/www/firefox3-devel/files/patch-toolkit_mozapps_installer_packager.mk @@ -0,0 +1,11 @@ +--- toolkit/mozapps/installer/packager.mk.orig 2007-09-26 13:45:01.000000000 -0400 ++++ toolkit/mozapps/installer/packager.mk 2007-09-26 13:47:29.000000000 -0400 +@@ -409,7 +409,7 @@ + (cd $(DIST)/sdk/include && tar $(TAR_CREATE_FLAGS) - .) | \ + (cd $(DESTDIR)$(includedir)/stable && tar -xf -) + # The dist/include has module subdirectories that we need to flatten +- find $(DIST)/include -xtype f -exec $(SYSINSTALL) $(IFLAGS1) {} $(DESTDIR)$(includedir)/unstable \; ++ find $(DIST)/include -type f -o -type l -exec $(SYSINSTALL) $(IFLAGS1) {} $(DESTDIR)$(includedir)/unstable \; + # IDL directory is stable (dist/sdk/idl) and unstable (dist/idl) + $(NSINSTALL) -D $(DESTDIR)$(idldir)/stable + $(NSINSTALL) -D $(DESTDIR)$(idldir)/unstable diff --git a/www/firefox3-devel/files/patch-toolkit_xre_Makefile.in b/www/firefox3-devel/files/patch-toolkit_xre_Makefile.in new file mode 100644 index 000000000..4a9c8533a --- /dev/null +++ b/www/firefox3-devel/files/patch-toolkit_xre_Makefile.in @@ -0,0 +1,8 @@ +--- toolkit/xre/Makefile.in.orig 2007-09-10 10:31:53.000000000 -0400 ++++ toolkit/xre/Makefile.in 2007-09-10 10:35:00.000000000 -0400 +@@ -263,5 +263,3 @@ + libs:: platform.ini + $(INSTALL) $^ $(DIST)/bin + +-install:: +- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir) diff --git a/www/firefox3-devel/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc b/www/firefox3-devel/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc new file mode 100644 index 000000000..9a41bbfc4 --- /dev/null +++ b/www/firefox3-devel/files/patch-xpcom-reflect-xptcall-public-xptcstubsdecl.inc @@ -0,0 +1,11 @@ +--- xpcom/reflect/xptcall/public/xptcstubsdecl.inc.orig Tue Mar 16 03:07:25 2004 ++++ xpcom/reflect/xptcall/public/xptcstubsdecl.inc Tue Jun 15 12:52:36 2004 +@@ -8,7 +8,7 @@ + * 1 is AddRef + * 2 is Release + */ +-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__)) ++#if !defined(__ia64) + NS_IMETHOD Stub3(); + NS_IMETHOD Stub4(); + NS_IMETHOD Stub5(); diff --git a/www/firefox3-devel/files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in b/www/firefox3-devel/files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in new file mode 100644 index 000000000..b1aa7ce6c --- /dev/null +++ b/www/firefox3-devel/files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in @@ -0,0 +1,63 @@ +--- xpcom/reflect/xptcall/src/md/unix/Makefile.in ++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in +@@ -70,6 +70,9 @@ + ifeq (Darwin,$(OS_ARCH)) + DEFINES += -DKEEP_STACK_16_BYTE_ALIGNED + endif ++ifeq (x86_64,$(OS_TEST)) ++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp ++endif + endif + endif + # +@@ -87,7 +90,7 @@ + endif + endif + # IA64 Linux +-ifneq (,$(filter Linux,$(OS_ARCH))) ++ifneq (,$(filter Linux FreeBSD,$(OS_ARCH))) + ifneq (,$(findstring ia64,$(OS_TEST))) + CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp + ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s +@@ -150,9 +153,15 @@ + ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s + endif + # ++# FreeBSD/Alpha ++# ++ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha) ++CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp ++endif ++# + # Linux/Alpha + # +-ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) ++ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) + CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp + endif + # +@@ -311,7 +320,7 @@ + # + # Linux/PPC + # +-ifeq ($(OS_ARCH)$(OS_TEST),Linuxpowerpc) ++ifneq (,$(filter Linuxpowerpc FreeBSDpowerpc,$(OS_ARCH)$(OS_TEST))) + CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp + ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s + AS := $(CC) -c -x assembler-with-cpp +@@ -389,6 +398,15 @@ + ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s + endif + # ++# FreeBSD/SPARC64 ++# ++ifeq ($(OS_ARCH),FreeBSD) ++ifneq (,$(findstring sparc,$(OS_TEST))) ++CPPSRCS := xptcinvoke_sparc64_freebsd.cpp xptcstubs_sparc64_freebsd.cpp ++ASFILES := xptcinvoke_asm_sparc64_freebsd.s xptcstubs_asm_sparcv9_solaris.s ++endif ++endif ++# + # OpenBSD/SPARC + # + ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc) diff --git a/www/firefox3-devel/pkg-descr b/www/firefox3-devel/pkg-descr new file mode 100644 index 000000000..4bdeb9118 --- /dev/null +++ b/www/firefox3-devel/pkg-descr @@ -0,0 +1,13 @@ +Mozilla Firefox is a free and open source web browser descended from the +Mozilla Application Suite.It is small, fast and easy to use, and offers many +advanced features: + + o Popup Blocking + o Tabbed Browsing + o Live Bookmarks (ie. RSS) + o Extensions + o Themes + o FastFind + o Improved Security + +WWW: http://www.mozilla.com/firefox diff --git a/www/firefox3-devel/pkg-message b/www/firefox3-devel/pkg-message new file mode 100644 index 000000000..5c9d24b32 --- /dev/null +++ b/www/firefox3-devel/pkg-message @@ -0,0 +1,32 @@ +====================================================================== + +SMB issues: +Network group, machine, and share browsing does not work correctly. + +SFTP: +Only sftp access using public key authentication works. To easily +setup public key authentication to "remote_host": + +ssh-keygen -t dsa +cat ~/.ssh/id_dsa.pub | ssh remote_host "cat >> .ssh/authorized_keys" + +The SSH sever on remote_host must allow pub key authentication. + +====================================================================== + +Any bug reports should be addressed to the maintainers at: + gnome@FreeBSD.org +You may also Cc: freebsd-ports@FreeBSD.org. Please do not send +bug reports to any other addresses. + +Please include the following information with any bug report: +* Output from 'uname -a'. +* Date/time stamp from www/firefox-devel/Makefile. +* Where/when did the problem occur: configuring, building, or + running firefox +* How can you reproduce the problem? + +Thank you for your help in testing and reporting bugs, and we hope you +enjoy using Firefox. +The Maintainers (gnome@) +====================================================================== |