File 01-make-build-process-work-on-linux.patch of Package flickr-uploadr
=== modified file 'MacUploadr.app/Contents/Resources/application.ini'
--- MacUploadr.app/Contents/Resources/application.ini 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/application.ini 2008-08-26 16:48:15 +0000
@@ -18,8 +18,8 @@
[Gecko]
MinVersion=1.8
-MaxVersion=1.9
+MaxVersion=2.0
[Crash Reporter]
-Enabled=False
+Enabled=True
ServerURL=http://www.flickr.com/services/uploadr/crash/
=== modified file 'MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js'
--- MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js 2008-08-26 16:48:15 +0000
@@ -52,7 +52,7 @@
var path = Cc['@mozilla.org/file/directory_service;1'].getService(
Ci.nsIProperties).get('ProfD', Ci.nsIFile).path;
if (path.match(/^\//)) {
- path += '/../../../../../Pictures';
+ path = '~/';
} else {
path += '\\..\\..\\..\\..\\..\\My Documents\\My Pictures';
}
@@ -553,4 +553,4 @@
this.hidden = settings.hidden;
this.sets = [];
this.progress_bar = null;
-};
\ No newline at end of file
+};
=== modified file 'MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js'
--- MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js 2008-08-26 16:48:15 +0000
@@ -300,11 +300,12 @@
// Open a browser window to the given URL
var launch_browser = function(url) {
- var io = Cc['@mozilla.org/network/io-service;1'].getService(Ci.nsIIOService);
- var uri = io.newURI(url, null, null);
- var eps = Cc['@mozilla.org/uriloader/external-protocol-service;1'].getService(
- Ci.nsIExternalProtocolService);
- var launcher = eps.getProtocolHandlerInfo('http');
- launcher.preferredAction = Ci.nsIHandlerInfo.useSystemDefault;
- launcher.launchWithURI(uri, null);
-};
\ No newline at end of file
+ // first construct an nsIURI object using the ioservice
+ var io = Components.classes['@mozilla.org/network/io-service;1']
+ .getService(Components.interfaces.nsIIOService);
+ var uriToOpen = io.newURI(url, null, null);
+ var extps = Components.classes['@mozilla.org/uriloader/external-protocol-service;1']
+ .getService(Components.interfaces.nsIExternalProtocolService);
+ // now, open it!
+ extps.loadURI(uriToOpen, null);
+};
=== modified file 'MacUploadr.app/Contents/Resources/components/Makefile'
--- MacUploadr.app/Contents/Resources/components/Makefile 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/components/Makefile 2008-08-26 16:54:34 +0000
@@ -10,6 +10,7 @@
# Headers and libraries
GECKO_SDK := ../gecko-sdk
+GECKO_BIN := ../gecko-bin
GM_INCLUDE := /usr/local/include/GraphicsMagick
GM_LIB := /usr/local/lib
EXIV_INCLUDE := /usr/local/include/exiv2
@@ -17,18 +18,30 @@
X11_LIB := /usr/X11R6/lib
PORTS_LIB := /opt/local/lib
XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current
+XPGLUE := -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER)
PLATFORM := $(filter mac ppc linux universal, $(MAKECMDGOALS))
COMPONENT := $(filter gm key clh, $(MAKECMDGOALS))
+DLL := -dynamiclib
+
ifeq (mac, $(PLATFORM))
DEFINE := -DXP_UNIX -DXP_MACOSX
+LIB_SUFFIX := dylib.$(PLATFORM)
endif
ifeq (ppc, $(PLATFORM))
DEFINE := -DXP_UNIX -DXP_MACOSX
+SHARED_LIB_SUFFIX := dylib.$(PLATFORM)
endif
ifeq (linux, $(PLATFORM))
DEFINE := -DXP_UNIX
+SHARED_LIB_SUFFIX := so
+GM_INCLUDE := $(shell pkg-config GraphicsMagick++ --cflags | sed s/-I//)
+EXIV_INCLUDE := /usr/include/exiv2
+NSPR_INCLUDE := /usr/include/nspr4
+DLL := -shared
+CFLAGS := -fshort-wchar -fPIC
+XPGLUE := -L$(GECKO_SDK).$(PLATFORM)/lib -L$(GECKO_SDK).$(PLATFORM)/bin -Wl,-rpath-link,$(GECKO_SDK).$(PLATFORM)/bin
endif
all:
@@ -68,29 +81,31 @@
gm:
ifneq (universal, $(PLATFORM))
@echo "Building the GraphicsMagick XPCOM component..."
-ifeq (mac, $(PLATFORM))
+ifneq (, $(findstring $(PLATFORM), 'mac linux'))
@echo "Building XPT file..."
- $(GECKO_SDK).$(PLATFORM)/bin/xpidl \
+ $(GECKO_BIN).$(PLATFORM)/xpidl \
-m header \
-I$(GECKO_SDK).$(PLATFORM)/idl \
flIGM.idl
- $(GECKO_SDK).$(PLATFORM)/bin/xpidl \
+ $(GECKO_BIN).$(PLATFORM)/xpidl \
-m typelib \
-I$(GECKO_SDK).$(PLATFORM)/idl \
flIGM.idl
endif
- g++ -w -c -O2 \
+ g++ $(CFLAGS) -w -c -O2 \
-o flGM.o \
-I$(GECKO_SDK).$(PLATFORM)/include \
-I$(GM_INCLUDE) \
-I$(EXIV_INCLUDE) \
+ -I$(NSPR_INCLUDE) \
$(DEFINE) \
flGM.cpp
- g++ -w -c -O2 \
+ g++ $(CFLAGS) -w -c -O2 \
-o flGMModule.o \
-I$(GECKO_SDK).$(PLATFORM)/include \
-I$(GM_INCLUDE) \
-I$(EXIV_INCLUDE) \
+ -I$(NSPR_INCLUDE) \
$(DEFINE) \
flGMModule.cpp
# g++ -dynamiclib -O2 \
@@ -109,13 +124,13 @@
# -lxml2 \
3 -lXext \
# -ljpeg -lpng -ltiff
- g++ -dynamiclib -O2 \
- -o gm.dylib.$(PLATFORM) \
+ g++ $(CFLAGS) $(DLL) -O2 \
+ -o gm.$(SHARED_LIB_SUFFIX) \
flGM.o flGMModule.o \
-L$(GECKO_SDK).$(PLATFORM)/lib \
-L$(GM_LIB) \
-L$(PORTS_LIB) \
- -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \
+ $(XPGLUE) \
-lxpcomglue_s -lxpcom -lnspr4 \
-lGraphicsMagick -lGraphicsMagick++ \
-lexiv2 \
@@ -131,32 +146,34 @@
key:
ifneq (universal, $(PLATFORM))
@echo "Building the API key XPCOM component..."
-ifeq (mac, $(PLATFORM))
+ifneq (, $(findstring $(PLATFORM), 'mac linux'))
@echo "Building XPT file..."
- $(GECKO_SDK).$(PLATFORM)/bin/xpidl \
+ $(GECKO_BIN).$(PLATFORM)/xpidl \
-m header \
-I$(GECKO_SDK).$(PLATFORM)/idl \
flIKey.idl
- $(GECKO_SDK).$(PLATFORM)/bin/xpidl \
+ $(GECKO_BIN).$(PLATFORM)/xpidl \
-m typelib \
-I$(GECKO_SDK).$(PLATFORM)/idl \
flIKey.idl
endif
- g++ -w -c -O2 \
+ g++ $(CFLAGS) -w -c -O2 \
-o flKey.o \
-I$(GECKO_SDK).$(PLATFORM)/include \
+ -I$(NSPR_INCLUDE) \
$(DEFINE) \
flKey.cpp
- g++ -w -c -O2 \
+ g++ $(CFLAGS) -w -c -O2 \
-o flKeyModule.o \
-I$(GECKO_SDK).$(PLATFORM)/include \
+ -I$(NSPR_INCLUDE) \
$(DEFINE) \
flKeyModule.cpp
- g++ -dynamiclib -O2 \
- -o key.dylib.$(PLATFORM) \
+ g++ $(CFLAGS) $(DLL) -O2 \
+ -o key.$(SHARED_LIB_SUFFIX) \
flKey.o flKeyModule.o \
-L$(GECKO_SDK).$(PLATFORM)/lib \
- -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \
+ $(XPGLUE) \
-lxpcomglue_s -lxpcom -lnspr4
else
@echo "Not building the API key XPCOM component"
@@ -166,16 +183,17 @@
clh:
@echo "Building XPT file..."
- $(GECKO_SDK).$(PLATFORM)/bin/xpidl \
+ $(GECKO_BIN).$(PLATFORM)/xpidl \
-m typelib \
-I$(GECKO_SDK).$(PLATFORM)/idl \
flICLH.idl
-
test:
- g++ -w -c -O2 -o gm_test.o -I$(GM_INCLUDE) -I$(EXIV_INCLUDE) gm_test.cpp
- g++ -O2 -o gm_test gm_test.o \
+ g++ $(CFLAGS) -w -c -O2 -o gm_test.o \
+ -I$(GECKO_SDK).$(PLATFORM)/include \
+ -I$(GM_INCLUDE) -I$(EXIV_INCLUDE) -I$(NSPR_INCLUDE) gm_test.cpp
+ g++ $(CFLAGS) -O2 -o gm_test gm_test.o \
-L$(GM_LIB) \
-L$(X11_LIB) \
-L$(PORTS_LIB) \
=== modified file 'MacUploadr.app/Contents/Resources/components/flGM.cpp'
--- MacUploadr.app/Contents/Resources/components/flGM.cpp 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/components/flGM.cpp 2008-08-26 16:48:15 +0000
@@ -8,6 +8,8 @@
* GPL for more details (http://www.gnu.org/licenses/gpl.html)
*/
+#include "xpcom-config.h"
+
#include "flGM.h"
// GraphicsMagick
@@ -805,4 +807,4 @@
}
return NS_OK;
-}
\ No newline at end of file
+}
=== modified file 'MacUploadr.app/Contents/Resources/components/flGMModule.cpp'
--- MacUploadr.app/Contents/Resources/components/flGMModule.cpp 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/components/flGMModule.cpp 2008-08-26 16:48:15 +0000
@@ -7,7 +7,7 @@
* distributed WITHOUT ANY WARRANTY, whether express or implied. See the GNU
* GPL for more details (http://www.gnu.org/licenses/gpl.html)
*/
-
+#include "xpcom-config.h"
#include "nsIGenericFactory.h"
#include "flGM.h"
@@ -22,4 +22,4 @@
}
};
-NS_IMPL_NSGETMODULE("flGMModule", components)
\ No newline at end of file
+NS_IMPL_NSGETMODULE("flGMModule", components)
=== modified file 'MacUploadr.app/Contents/Resources/components/flKey.cpp'
--- MacUploadr.app/Contents/Resources/components/flKey.cpp 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/components/flKey.cpp 2008-08-26 16:48:15 +0000
@@ -8,6 +8,7 @@
* GPL for more details (http://www.gnu.org/licenses/gpl.html)
*/
+#include "xpcom-config.h"
#include "flKey.h"
#include "md5.h"
@@ -36,6 +37,9 @@
#ifdef XP_WIN
char * k = "win-key-here";
#endif
+#ifdef XP_UNIX
+ char * k = "linux-key-here";
+#endif
unsigned int i;
unsigned int ii = 32; // API key length
for (i = 0; i < ii; ++i) {
@@ -96,6 +100,24 @@
bytes[14] = '-';
bytes[15] = '-';
#endif
+#ifdef XP_UNIX
+ bytes[0] = '-';
+ bytes[1] = '-';
+ bytes[2] = '-';
+ bytes[3] = '-';
+ bytes[4] = '-';
+ bytes[5] = '-';
+ bytes[6] = '-';
+ bytes[7] = '-';
+ bytes[8] = '-';
+ bytes[9] = '-';
+ bytes[10] = '-';
+ bytes[11] = '-';
+ bytes[12] = '-';
+ bytes[13] = '-';
+ bytes[14] = '-';
+ bytes[15] = '-';
+#endif
// Returning API secret, legacy
/*
@@ -146,4 +168,4 @@
delete [] bytes;
return NS_OK;
-}
\ No newline at end of file
+}
=== modified file 'MacUploadr.app/Contents/Resources/components/flKeyModule.cpp'
--- MacUploadr.app/Contents/Resources/components/flKeyModule.cpp 2008-06-10 20:16:50 +0000
+++ MacUploadr.app/Contents/Resources/components/flKeyModule.cpp 2008-08-26 16:48:15 +0000
@@ -7,7 +7,7 @@
* distributed WITHOUT ANY WARRANTY, whether express or implied. See the GNU
* GPL for more details (http://www.gnu.org/licenses/gpl.html)
*/
-
+#include "xpcom-config.h"
#include "nsIGenericFactory.h"
#include "flKey.h"
@@ -22,4 +22,4 @@
}
};
-NS_IMPL_NSGETMODULE("flKeyModule", components)
\ No newline at end of file
+NS_IMPL_NSGETMODULE("flKeyModule", components)