mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:27:59 +01:00
Make binaries compilable on non-hemorrhage-edge releases. Add binaries subrepo.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
|
||||
interfaces components/dactylIUtils.xpt
|
||||
binary-component components/6.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 appversion>=6.0 appversion<6.*
|
||||
binary-component components/7.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 appversion>=7.0 appversion<7.*
|
||||
binary-component components/8.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 platformversion>=8.0 platformversion<8.*
|
||||
binary-component components/9.0-Linux_x86_64-gcc3/dactyl.so abi=Linux_x86_64-gcc3 platformversion>=9.0 platformversion<9.*
|
||||
|
||||
# vim:se tw=0 ft=cfg:
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
|
||||
PLATFORM = 9.0-Linux_x86_64-gcc3
|
||||
DEFINES = -DGECKO_MAJOR=9 -DGECKO_MINOR=0
|
||||
GECKO_MAJOR ?= 9
|
||||
GECKO_MINOR ?= 0
|
||||
ABI_OS ?= Linux
|
||||
ABI_ARCH ?= x86_64
|
||||
ABI_COMPILER ?= gcc3
|
||||
ABI ?= $(GECKO_MAJOR).$(GECKO_MINOR)-$(ABI_OS)_$(ABI_ARCH)-$(ABI_COMPILER)
|
||||
DEFINES = -DGECKO_MAJOR=$(GECKO_MAJOR) -DGECKO_MINOR=$(GECKO_MINOR)
|
||||
|
||||
SED ?= sed -r
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
ROOT = ..
|
||||
|
||||
XPTDIR = $(ROOT)/components/
|
||||
SODIR = $(ROOT)/components/$(PLATFORM)/
|
||||
OBJDIR = $(PLATFORM)/
|
||||
SODIR = $(ROOT)/components/$(ABI)/
|
||||
OBJDIR = $(ABI)/
|
||||
|
||||
MODULE = $(SODIR)dactyl
|
||||
|
||||
@@ -21,7 +21,7 @@ GECKO_CONFIG_INCLUDE = -include mozilla-config.h
|
||||
|
||||
GECKO_DEFINES = -DMOZILLA_STRICT_API
|
||||
|
||||
GECKO_INCLUDES = -I$(PLATFORM)/ \
|
||||
GECKO_INCLUDES = -I$(ABI)/ \
|
||||
-I$(GECKO_SDK_PATH) \
|
||||
-I$(GECKO_SDK_PATH)/idl \
|
||||
-I$(GECKO_SDK_PATH)/include
|
||||
@@ -40,13 +40,13 @@ sinclude $(ROOT)/config.local.mk
|
||||
|
||||
XPTS = $(XPIDLSRCS:%.idl=$(XPTDIR)%.xpt)
|
||||
OBJS = $(CPPSRCS:%.cpp=$(OBJDIR)%.o)
|
||||
HEADERS = $(XPIDLSRCS:%.idl=$(PLATFORM)/%.h)
|
||||
HEADERS = $(XPIDLSRCS:%.idl=$(ABI)/%.h)
|
||||
|
||||
all: build
|
||||
|
||||
$(OBJS): $(HEADERS)
|
||||
|
||||
$(PLATFORM)/%.h: %.idl
|
||||
$(ABI)/%.h: %.idl
|
||||
$(IDL_H) $@ $(GECKO_INCLUDES) $<
|
||||
|
||||
$(XPTDIR)%.xpt: %.idl
|
||||
@@ -71,9 +71,15 @@ dirs: $(XPTDIR) $(SODIR) $(OBJDIR)
|
||||
$(XPTDIR) $(SODIR) $(OBJDIR):
|
||||
mkdir -p $@
|
||||
|
||||
build: dirs $(XPTS) $(MODULE).so
|
||||
module: dirs $(MODULE).so
|
||||
|
||||
xpts: $(XPTS)
|
||||
|
||||
build: dirs module xpts
|
||||
|
||||
clean:
|
||||
rm $(MODULE).so
|
||||
|
||||
.PHONY: module xpts build clean all depend
|
||||
|
||||
sinclude .depend
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define JS_XDRScript JS_XDRScriptObject
|
||||
|
||||
#include "mozJSLoaderUtils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
@@ -55,7 +53,7 @@ using namespace mozilla::scache;
|
||||
|
||||
static nsresult
|
||||
ReadScriptFromStream(JSContext *cx, nsIObjectInputStream *stream,
|
||||
JSScript **script)
|
||||
JSScriptType **script)
|
||||
{
|
||||
*script = nsnull;
|
||||
|
||||
@@ -110,7 +108,7 @@ ReadScriptFromStream(JSContext *cx, nsIObjectInputStream *stream,
|
||||
}
|
||||
|
||||
static nsresult
|
||||
WriteScriptToStream(JSContext *cx, JSScript *script,
|
||||
WriteScriptToStream(JSContext *cx, JSScriptType *script,
|
||||
nsIObjectOutputStream *stream)
|
||||
{
|
||||
JSXDRState *xdr = JS_XDRNewMem(cx, JSXDR_ENCODE);
|
||||
@@ -152,7 +150,7 @@ WriteScriptToStream(JSContext *cx, JSScript *script,
|
||||
}
|
||||
|
||||
nsresult
|
||||
ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScript **script)
|
||||
ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScriptType **script)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
@@ -173,7 +171,7 @@ ReadCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScrip
|
||||
}
|
||||
|
||||
nsresult
|
||||
WriteCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScript *script)
|
||||
WriteCachedScript(nsIStartupCache* cache, nsACString &uri, JSContext *cx, JSScriptType *script)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
#ifndef mozJSLoaderUtils_h
|
||||
#define mozJSLoaderUtils_h
|
||||
|
||||
|
||||
#if defined(GECKO_MAJOR) && GECKO_MAJOR < 9
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is evil. Very evil.
|
||||
#define nsString_h___
|
||||
@@ -50,6 +54,22 @@
|
||||
#include "nsStringAPI.h"
|
||||
#include "jsapi.h"
|
||||
|
||||
#if defined(GECKO_MAJOR) && GECKO_MAJOR < 9
|
||||
#include "jsapi.h"
|
||||
# define JS_XDRScript JS_XDRScriptObject
|
||||
typedef JSObject JSScriptType;
|
||||
|
||||
# define NewObjectInputStreamFromBuffer NS_NewObjectInputStreamFromBuffer
|
||||
# define NewBufferFromStorageStream NS_NewBufferFromStorageStream
|
||||
# if GECKO_MAJOR > 6
|
||||
# define NewObjectOutputWrappedStorageStream NS_NewObjectOutputWrappedStorageStream
|
||||
# else
|
||||
# define NewObjectOutputWrappedStorageStream(a, b, c) NS_NewObjectOutputWrappedStorageStream((a), (b))
|
||||
# endif
|
||||
#else
|
||||
typedef JSScript JSScriptType;
|
||||
#endif
|
||||
|
||||
class nsIURI;
|
||||
|
||||
namespace mozilla {
|
||||
@@ -60,9 +80,9 @@ class StartupCache;
|
||||
|
||||
nsresult
|
||||
ReadCachedScript(nsIStartupCache* cache, nsACString &uri,
|
||||
JSContext *cx, JSScript **scriptObj);
|
||||
JSContext *cx, JSScriptType **scriptObj);
|
||||
|
||||
nsresult
|
||||
WriteCachedScript(nsIStartupCache* cache, nsACString &uri,
|
||||
JSContext *cx, JSScript *scriptObj);
|
||||
JSContext *cx, JSScriptType *scriptObj);
|
||||
#endif /* mozJSLoaderUtils_h */
|
||||
|
||||
@@ -271,7 +271,7 @@ static nsresult
|
||||
ReadScript(nsIURI *uri, JSContext *cx, JSObject *target_obj,
|
||||
jschar *charset, const char *uriStr,
|
||||
nsIIOService *serv, nsIPrincipal *principal,
|
||||
JSScript **scriptObjp)
|
||||
JSScriptType **scriptObjp)
|
||||
{
|
||||
nsCOMPtr<nsIChannel> chan;
|
||||
nsCOMPtr<nsIInputStream> instream;
|
||||
@@ -518,12 +518,17 @@ dactylUtils::LoadSubScript (const PRUnichar * aURL
|
||||
}
|
||||
|
||||
bool writeScript = false;
|
||||
JSScript *scriptObj = nsnull;
|
||||
JSScriptType *scriptObj = nsnull;
|
||||
JSVersion version = cx->findVersion();
|
||||
|
||||
nsCAutoString cachePath;
|
||||
cachePath.Append("jssubloader/");
|
||||
cachePath.Append(version);
|
||||
if (charset) {
|
||||
cachePath.Append("/");
|
||||
cachePath.Append(NS_ConvertUTF16toUTF8(
|
||||
nsDependentString(reinterpret_cast<PRUnichar*>(charset))));
|
||||
}
|
||||
|
||||
if (false)
|
||||
// This is evil. Very evil. Unfortunately, the PathifyURI symbol is
|
||||
|
||||
@@ -503,17 +503,18 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
|
||||
if (isinstance(context, ["Sandbox"]))
|
||||
return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber);
|
||||
else {
|
||||
|
||||
if (!context)
|
||||
context = userContext || ctxt;
|
||||
|
||||
if (services.has("dactyl") && services.dactyl.evalInContext)
|
||||
return services.dactyl.evalInContext(str, context, fileName, lineNumber);
|
||||
else
|
||||
|
||||
try {
|
||||
context[EVAL_ERROR] = null;
|
||||
context[EVAL_STRING] = str;
|
||||
context[EVAL_RESULT] = null;
|
||||
|
||||
this.loadScript("resource://dactyl-content/eval.js", context);
|
||||
if (context[EVAL_ERROR]) {
|
||||
try {
|
||||
@@ -530,7 +531,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
delete context[EVAL_RESULT];
|
||||
delete context[EVAL_STRING];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user