aboutsummaryrefslogtreecommitdiff
path: root/www/helixplugin
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2007-03-19 21:33:38 +0000
committerMikhail Teterin <mi@FreeBSD.org>2007-03-19 21:33:38 +0000
commitef62575d24cb1b5c35dfc1b0acf1c3aff3349213 (patch)
tree7e99283642a4744d730c40791100936dfd2ef2c1 /www/helixplugin
parentfd0ad26af3b779de2bca70a19d6b9ce528d1e091 (diff)
downloadports-ef62575d24cb1b5c35dfc1b0acf1c3aff3349213.tar.gz
ports-ef62575d24cb1b5c35dfc1b0acf1c3aff3349213.zip
Notes
Diffstat (limited to 'www/helixplugin')
-rw-r--r--www/helixplugin/Makefile31
-rw-r--r--www/helixplugin/distinfo3
-rw-r--r--www/helixplugin/files/BSDmakefile34
-rw-r--r--www/helixplugin/files/patch-headers66
-rw-r--r--www/helixplugin/files/patch-obsoletetimer178
-rw-r--r--www/helixplugin/files/patch-unicode39
-rw-r--r--www/helixplugin/pkg-descr17
-rw-r--r--www/helixplugin/pkg-message10
8 files changed, 378 insertions, 0 deletions
diff --git a/www/helixplugin/Makefile b/www/helixplugin/Makefile
new file mode 100644
index 000000000000..d7b7814252fd
--- /dev/null
+++ b/www/helixplugin/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: helixplugin
+# Date created: October 22, 2006
+# Whom: Mikhail T <mi@aldan.algebra.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= hxplugin
+PORTVERSION= 20070318
+CATEGORIES= www multimedia
+MASTER_SITES= http://virtual-estates.net/~mi/port-stuff/
+
+MAINTAINER= mi@aldan.algebra.com
+COMMENT= Browser plugin for Real or Helix Players
+
+USE_BZIP2 = yes
+USE_DOS2UNIX = yes
+MAKEFILE = ${FILESDIR}/BSDmakefile
+#USE_GECKO = firefox mozilla seamonkey xulrunner firefox-devel
+USE_GECKO = ${_GECKO_ALL}
+MAKE_ENV += TOP="${WRKSRC}" GECKO=${GECKO}
+
+PDIR ?= lib/browser_plugins
+PLIST_FILES= ${PDIR}/helix.so ${PDIR}/nphelix.xpt
+
+do-install:
+ ${INSTALL_DATA} ${PLIST_FILES:S|${PDIR}|${WRKSRC}|} ${PREFIX}/${PDIR}/
+
+.include <bsd.port.pre.mk>
+.include "${PORTSDIR}/www/mozilla/bsd.gecko.mk"
+.include <bsd.port.post.mk>
diff --git a/www/helixplugin/distinfo b/www/helixplugin/distinfo
new file mode 100644
index 000000000000..5eb1aba4c5c7
--- /dev/null
+++ b/www/helixplugin/distinfo
@@ -0,0 +1,3 @@
+MD5 (hxplugin-20070318.tar.bz2) = 52747a603be3b064e8673a2ee54de50b
+SHA256 (hxplugin-20070318.tar.bz2) = 1d6f8f913aee645be6f7bcdff5c8cdec414d77ba1ad773013499ef5b84b2cc70
+SIZE (hxplugin-20070318.tar.bz2) = 56721
diff --git a/www/helixplugin/files/BSDmakefile b/www/helixplugin/files/BSDmakefile
new file mode 100644
index 000000000000..3c3a1a3ce139
--- /dev/null
+++ b/www/helixplugin/files/BSDmakefile
@@ -0,0 +1,34 @@
+SHLIB_NAME = helix.so
+
+CXXFLAGS += -D_UNIX -DMOZ_X11 -I${LOCALBASE}/include/nspr
+CXXFLAGS += -I${LOCALBASE}/include/${GECKO}/uconv
+CXXFLAGS += -I${LOCALBASE}/include/${GECKO}/xpcom
+CXXFLAGS += -I${LOCALBASE}/include/${GECKO}/npapi
+CXXFLAGS += -I${LOCALBASE}/include/${GECKO}/string
+CXXFLAGS += -I${LOCALBASE}/include/${GECKO}
+CXXFLAGS += -I${X11BASE}/include
+CXXFLAGS += -I${TOP}/player/app/plugin/include
+CXXFLAGS += -I${TOP}/player/app/gtk/pub
+
+SRCS = hxbackend.cpp \
+ np_entry.cpp \
+ npn_gate.cpp \
+ npp_gate.cpp \
+ nsHXPlayer.cpp \
+ plugin.cpp \
+ tokenizer.cpp
+
+XPIDL ?= ${LOCALBASE}/lib/${GECKO}/xpidl
+XPTLINK ?= ${XPIDL:H}/xpt_link
+SHARE_IDL != echo ${LOCALBASE}/share/idl/${GECKO:S/-devel/-2/}*
+
+.PATH: ${TOP}/player/app/plugin ${TOP}/player/app/plugin/common
+
+nphelix.xpt: nsIHXPlayer.idl
+ ${XPIDL} -m header -I${SHARE_IDL} ${.ALLSRC}
+ ${XPIDL} -m typelib -I${SHARE_IDL} ${.ALLSRC}
+ ${XPTLINK} $@ nsIHXPlayer.xpt
+
+all: nphelix.xpt
+
+.include <bsd.lib.mk>
diff --git a/www/helixplugin/files/patch-headers b/www/helixplugin/files/patch-headers
new file mode 100644
index 000000000000..0d51b27d74ae
--- /dev/null
+++ b/www/helixplugin/files/patch-headers
@@ -0,0 +1,66 @@
+Use browser-installed headers instead of the bundled (obsolete)
+copies...
+
+Fix other bugs/deficiencies...
+
+ -mi
+
+--- player/app/plugin/nsHXPlayer.cpp Mon Nov 22 19:24:25 2004
++++ player/app/plugin/nsHXPlayer.cpp Tue Oct 24 13:13:00 2006
+@@ -56,5 +56,4 @@
+ #include "hxbackend.h"
+ #include "tokenizer.h"
+-#include "asprintf.h"
+
+ #include <stdlib.h>
+--- player/app/plugin/hxbackend.cpp Sun Oct 22 13:33:21 2006
++++ player/app/plugin/hxbackend.cpp Sun Oct 22 13:50:24 2006
+@@ -66,13 +66,10 @@
+ #include <signal.h>
+
+-#include "npplat.h"
+-#include "hxbackend.h"
+-#include "asprintf.h"
+-
+ #include "tokenizer.h"
++#include "hxbackend.h"
+
+-#include "nsIServiceManager.h"
+-#include "nsIComponentManager.h"
+-#include "nsIDOMWindow.h"
++#include <nsIServiceManager.h>
++#include <nsIComponentManager.h>
++#include <nsIDOMWindow.h>
+
+ #define EXIT_CODE_UNKNOWN 0
+@@ -358,5 +357,5 @@ nsresult CHXPlayerBackend::ReceiveMessag
+ {
+ /* Trim back the buffer to the size we actually used (plus NULL) */
+- pBuf = (char*)realloc(pBuf, nPos + 1);
++ *ppBuf = (char*)realloc(pBuf, nPos + 1);
+ }
+ else
+@@ -509,5 +500,5 @@
+ fcntl(cbsockets[1], F_SETFD, 0);
+
+- m_nChildPid = fork();
++ m_nChildPid = vfork();
+ if(m_nChildPid < 0)
+ {
+--- player/app/plugin/nsHXPlayer.h Sun Oct 22 13:59:54 2006
++++ player/app/plugin/nsHXPlayer.h Sun Oct 22 14:11:15 2006
+@@ -51,10 +51,10 @@
+ #define __NS_HXPLAYER_H__
+
+-#include "nsISupports.h"
+-#include "nsIClassInfo.h"
++#include <nsISupports.h>
++#include <nsIClassInfo.h>
+ #include "nsIHXPlayer.h"
+-#include "nsISupportsImpl.h"
++#include <nsISupportsImpl.h>
+ #include "embddef.h"
+-#include "npapi.h"
++#include <npapi.h>
+ #include "pluginbase.h"
+
diff --git a/www/helixplugin/files/patch-obsoletetimer b/www/helixplugin/files/patch-obsoletetimer
new file mode 100644
index 000000000000..8cc046371f77
--- /dev/null
+++ b/www/helixplugin/files/patch-obsoletetimer
@@ -0,0 +1,178 @@
+Don't look for the ancient nsIScriptableTimer.h header and its
+long-obsolete content...
+
+ -mi
+
+--- player/app/plugin/hxbackend.h Mon Nov 22 19:24:25 2004
++++ player/app/plugin/hxbackend.h Sun Jul 2 01:13:09 2006
+@@ -62,9 +62,4 @@
+ #include "nsIObserver.h"
+
+-/* Mozilla 1.0-1.2 had nsIScriptableTimer.h and a different nsITimer.h. We
+- use the nsIScriptableTimer version to avoid conflicts with the newer
+- nsITimer. */
+-#include "nsIScriptableTimer.h"
+-
+ /* Mozilla 1.3+ have the modern nsITimer */
+ #include "nsITimer.h"
+@@ -106,5 +101,5 @@
+ nsresult ReadGenericResponse(PRBool *retval);
+
+- PRBool AreCallbacksSupported(void) { return m_pTimer || m_pObsoleteTimer; }
++ PRBool AreCallbacksSupported(void) { return m_pTimer != NULL; }
+
+ private:
+@@ -129,5 +124,4 @@
+
+ nsITimer *m_pTimer;
+- nsIScriptableTimer *m_pObsoleteTimer; // Only found in old mozilla's
+ nsIScriptableUnicodeConverter *m_pUConv;
+ nsIPromptService *m_pPromptService;
+--- player/app/plugin/nsHXPlayer.cpp Mon Nov 22 19:24:25 2004
++++ player/app/plugin/nsHXPlayer.cpp Sun Jul 2 01:47:25 2006
+@@ -560,8 +560,8 @@
+ XFlush(ws_info->display);
+
+- nLen = asprintf(&pMsg, "%s %d %d %d %d %d %d %d %d %d %d %d\n",
++ nLen = asprintf(&pMsg, "%s %td %d %d %d %d %d %d %d %d %d %d\n",
+ szCommand,
+ m_iPlayerID,
+- (int)aWindow->window,
++ (intptr_t)aWindow->window,
+ aWindow->x,
+ aWindow->y,
+@@ -602,5 +602,4 @@
+ PRBool retval;
+ unsigned int nStreamLength;
+- int nStreamId = 0;
+
+ nStreamLength = ( stream->end > 0 ) ? stream->end : 0;
+@@ -617,16 +616,7 @@
+ *stype = NP_NORMAL;
+
+- if(m_bIsFirstNewStream)
+- {
+- nStreamId = 0;
+- }
+- else
+- {
+- nStreamId = (int)stream;
+- }
+-
+- nLen = asprintf(&pMsg, "NewStream %d %d %s %s %d\n",
++ nLen = asprintf(&pMsg, "NewStream %d %td %s %s %d\n",
+ m_iPlayerID,
+- nStreamId,
++ (intptr_t)(m_bIsFirstNewStream ? 0 : stream),
+ stream->url,
+ type,
+@@ -671,5 +661,5 @@
+ (void)offset;
+
+- nLen = asprintf(&pMsg, "StreamData %d %d %d\n", m_iPlayerID, (int)streamID, nDataLen);
++ nLen = asprintf(&pMsg, "StreamData %d %td %d\n", m_iPlayerID, (intptr_t)streamID, nDataLen);
+ result = m_pBackend->SendMessage(pMsg, nLen);
+ free(pMsg);
+@@ -704,5 +694,5 @@
+ const void *streamID = (void*)stream;
+
+- nLen = asprintf(&pMsg, "StreamDone %d %d\n", m_iPlayerID, (int)streamID);
++ nLen = asprintf(&pMsg, "StreamDone %d %td\n", m_iPlayerID, (intptr_t)streamID);
+ result = m_pBackend->SendMessage(pMsg, nLen);
+ free(pMsg);
+--- player/app/plugin/hxbackend.cpp Mon Nov 22 19:24:25 2004
++++ player/app/plugin/hxbackend.cpp Sun Jul 2 02:37:29 2006
+@@ -153,5 +153,4 @@
+ m_nCallbackBufPos(0),
+ m_pTimer(NULL),
+- m_pObsoleteTimer(NULL),
+ m_pUConv(NULL),
+ m_pPromptService(NULL),
+@@ -424,13 +423,5 @@
+ (void**)&m_pTimer);
+
+- if(!m_pTimer)
+- {
+- /* Try to get an old-style mozilla 1.0-1.2 timer */
+- pComponentManager->CreateInstanceByContractID(NS_TIMER_CONTRACTID,
+- NULL,
+- NS_GET_IID(nsIScriptableTimer),
+- (void**)&m_pObsoleteTimer);
+- }
+-
++
+ NS_RELEASE(pComponentManager);
+ }
+@@ -545,5 +536,5 @@
+ sprintf(cbSd, "%d", cbsockets[1]);
+
+- if (m_pTimer || m_pObsoleteTimer)
++ if (m_pTimer)
+ {
+ /* We have a timer callback, include --callbacks flag */
+@@ -716,13 +699,4 @@
+ free(szJavaScriptAlert);
+ }
+-
+- if(pUnicodeTitle)
+- {
+- m_pMemory->Free(pUnicodeTitle);
+- }
+- if(pUnicodeMessage)
+- {
+- m_pMemory->Free(pUnicodeMessage);
+- }
+ }
+
+@@ -894,5 +868,5 @@
+ m_pTimer->Init(pTimerFob,
+ 500,
+- nsIScriptableTimer::TYPE_REPEATING_SLACK);
++ nsITimer::TYPE_REPEATING_SLACK);
+ m_pTimer->Cancel();
+
+@@ -901,20 +875,4 @@
+ }
+
+- if(m_pObsoleteTimer)
+- {
+- m_pObsoleteTimer->Cancel();
+-
+- /* Re-initing causes the timer to unref this and switch its ref
+- to pTimerFob instead */
+- m_pObsoleteTimer->Init(pTimerFob,
+- 500,
+- nsIScriptableTimer::PRIORITY_NORMAL,
+- nsIScriptableTimer::TYPE_REPEATING_SLACK);
+- m_pObsoleteTimer->Cancel();
+-
+- NS_RELEASE(m_pObsoleteTimer);
+- m_pObsoleteTimer = NULL;
+- }
+-
+ NS_RELEASE(pTimerFob);
+
+@@ -1187,12 +1145,4 @@
+ nsITimer::TYPE_REPEATING_SLACK);
+ }
+- else if(m_pObsoleteTimer)
+- {
+- m_bCallbackTimerRunning = PR_TRUE;
+- m_pObsoleteTimer->Init(this,
+- 500,
+- nsIScriptableTimer::PRIORITY_NORMAL,
+- nsIScriptableTimer::TYPE_REPEATING_SLACK);
+- }
+ }
+
+@@ -1205,10 +1155,3 @@
+ m_pTimer->Cancel();
+ }
+- if(m_pObsoleteTimer)
+- {
+- m_bCallbackTimerRunning = PR_FALSE;
+- m_pObsoleteTimer->Cancel();
+- }
+ }
+-
+-
diff --git a/www/helixplugin/files/patch-unicode b/www/helixplugin/files/patch-unicode
new file mode 100644
index 000000000000..270fdf9e1b78
--- /dev/null
+++ b/www/helixplugin/files/patch-unicode
@@ -0,0 +1,39 @@
+--- player/app/plugin/hxbackend.cpp Mon Mar 19 14:45:03 2007
++++ player/app/plugin/hxbackend.cpp Mon Mar 19 16:49:02 2007
+@@ -72,4 +72,5 @@
+ #include <nsIComponentManager.h>
+ #include <nsIDOMWindow.h>
++#include <nsStringAPI.h>
+
+ #define EXIT_CODE_UNKNOWN 0
+@@ -710,17 +702,13 @@
+ if(instance)
+ {
+- PRUnichar *pUnicodeTitle = NULL;
+- PRUnichar *pUnicodeMessage = NULL;
+-
+ NPN_GetValue(instance, NPNVDOMWindow, &pDomWindow);
+
+- if(m_pPromptService && m_pUConv && m_pMemory && pDomWindow)
+- {
+- m_pUConv->ConvertToUnicode("Helix DNA Plugin Error", &pUnicodeTitle);
+- m_pUConv->ConvertToUnicode(szError, &pUnicodeMessage);
+- }
+-
+- if(pUnicodeTitle && pUnicodeMessage && m_pPromptService && m_pMemory && pDomWindow)
++ if(m_pPromptService && m_pMemory && pDomWindow)
+ {
++ nsString UnicodeMessage, UnicodeTitle;
++
++ NS_CStringToUTF16(nsCString(szError), NS_CSTRING_ENCODING_ASCII, UnicodeMessage);
++ NS_CStringToUTF16(nsCString("Helix DNA Plugin Error"), NS_CSTRING_ENCODING_ASCII, UnicodeTitle);
++
+ /* Cancel the callback timer while the alert dialog is up to
+ prevent a race (eg, the timer callback can call Shutdown(),
+@@ -730,5 +718,5 @@
+ StopCallbackTimer();
+
+- m_pPromptService->Alert(pDomWindow, pUnicodeTitle, pUnicodeMessage);
++ m_pPromptService->Alert(pDomWindow, UnicodeTitle.get(), UnicodeMessage.get());
+
+ if(bRestartCallbackTimer)
diff --git a/www/helixplugin/pkg-descr b/www/helixplugin/pkg-descr
new file mode 100644
index 000000000000..beb46e09e173
--- /dev/null
+++ b/www/helixplugin/pkg-descr
@@ -0,0 +1,17 @@
+Real (and Helix) browser plugins do little else, but start the separate
+"realplay" executable and talk to it.
+
+This port builds and installs this simple plugin part. The port allows
+to use native FreeBSD browsers with the realplay executable built for
+Linux (installed by multimedia/linux-realplayer).
+
+Although the multimedia/helixplayer port installs a modern version of
+the player, it lacks certain codecs, which Real/Helix are not allowed to
+(or would not) open-source.
+
+This port's "source" is extracted verbatim from the Helix-player's,
+which is much larger.
+
+Although tested primarily against firefox, it should build any other
+Mozilla-family browser's headers. Care is taken to NOT include browser
+headers typically bundled by Helix/Real...
diff --git a/www/helixplugin/pkg-message b/www/helixplugin/pkg-message
new file mode 100644
index 000000000000..f404bc7c4ac1
--- /dev/null
+++ b/www/helixplugin/pkg-message
@@ -0,0 +1,10 @@
+
+The port will try to use either "realplay" (see
+multimedia/linux-reaplayer) or "hxplay" (see multimedia/helixplayer)
+executables.
+
+If you'd like to make the plugin execute anything other than "realplay"
+or "hxplay" (based on your PATH), sym-link desired executable to
+"realplayer" (or to hxplay), or run the browser with the environment
+variable HELIX_PLUGIN_PLAYER_OVERRIDE pointing to the executable you
+wish.