summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@gentoo.org>2009-07-14 09:42:48 +0000
committerNirbheek Chauhan <nirbheek@gentoo.org>2009-07-14 09:42:48 +0000
commitccb43e3c0b8d20ef18608dde1c9b9a22ab411681 (patch)
tree3c9ed6f00cc031c685bf3253ec435b8855a13b44 /www-plugins/mozilla-weave/files
parentRemove _one_ eutils from inherit, because it's there _two_ times. (diff)
downloadgentoo-2-ccb43e3c0b8d20ef18608dde1c9b9a22ab411681.tar.gz
gentoo-2-ccb43e3c0b8d20ef18608dde1c9b9a22ab411681.tar.bz2
gentoo-2-ccb43e3c0b8d20ef18608dde1c9b9a22ab411681.zip
Bump to 0.5_pre1 -- keyword-less because it's a pre-release
(Portage version: 2.2_rc33/cvs/Linux i686)
Diffstat (limited to 'www-plugins/mozilla-weave/files')
-rw-r--r--www-plugins/mozilla-weave/files/mozilla-weave-use-pkgconfig.patch179
1 files changed, 179 insertions, 0 deletions
diff --git a/www-plugins/mozilla-weave/files/mozilla-weave-use-pkgconfig.patch b/www-plugins/mozilla-weave/files/mozilla-weave-use-pkgconfig.patch
new file mode 100644
index 000000000000..27928b52a05d
--- /dev/null
+++ b/www-plugins/mozilla-weave/files/mozilla-weave-use-pkgconfig.patch
@@ -0,0 +1,179 @@
+Fix hard-coded paths in Makefiles. Use pkg-config if available instead
+
+bmo: 504022
+
+Nirbheek Chauhan <nirbheek@gentoo.org>
+---
+--- a/Makefile
++++ b/Makefile
+@@ -39,12 +39,23 @@
+ stage_dir=../dist/stage
+
+ sdkdir ?= ${MOZSDKDIR}
++
++# If blank, try to use pkg-config
++# To add a path to pkg-config search path, use PKG_CONFIG_PATH
++# (see man pkg-config)
++ifeq ($(sdkdir),)
++ sdkdir = $(shell pkg-config --variable sdkdir libxul-unstable)
++endif
++
+ ifeq ($(sdkdir),)
+ $(warning No 'sdkdir' variable given)
+ $(warning It should point to the location of the Gecko SDK)
+ $(warning For example: "make sdkdir=/foo/bar/baz")
+ $(warning Or set the MOZSDKDIR environment variable to point to it)
++ $(warning Or fix your xulrunner pkg-config files)
+ $(error)
++else
++ $(info Using Mozilla SDKDIR as: ${sdkdir})
+ endif
+
+ all: build
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -37,6 +37,15 @@
+ #
+ # ***** END LICENSE BLOCK *****
+
++# Define some custom pkg-config functions
++pkg-config-var = $(shell pkg-config --variable $(1) $(2))
++pkg-config-I = $(shell pkg-config --cflags-only-I $(1) $(2))
++pkg-config-l = $(patsubst -l%,%,$(shell pkg-config --libs-only-l $(1)))
++pkg-config-L = $(patsubst -L%,%,$(shell pkg-config --libs-only-L $(1)))
++
++# Actually use pkg-config?
++pkgconfig = "no"
++
+ # OS detection
+
+ sys := $(shell uname -s)
+@@ -133,7 +142,7 @@
+ cpp_objects = $(cpp_sources:.cpp=.o)
+ endif
+
+-# source and path configurations
++# Source and path configurations
+ idl = IWeaveCrypto.idl
+ cpp_sources = WeaveCrypto.cpp WeaveCryptoModule.cpp
+
+@@ -141,7 +150,15 @@
+ destdir = ..
+ platformdir = $(destdir)/platform/$(platform)
+
+-xpidl = $(sdkdir)/bin/xpidl
++sdkdir ?= ${MOZSDKDIR}
++
++# If blank, try to use pkg-config
++# To add a path to pkg-config search path, use PKG_CONFIG_PATH
++# (see man pkg-config)
++ifeq ($(sdkdir),)
++ pkgconfig="yes"
++ sdkdir = $(call pkg-config-var,sdkdir,libxul-unstable)
++endif
+
+ # FIXME: we don't actually require this for e.g. clean
+ ifeq ($(sdkdir),)
+@@ -149,32 +161,73 @@
+ $(warning It should point to the location of the Gecko SDK)
+ $(warning For example: "make sdkdir=/foo/bar/baz")
+ $(warning Or set the MOZSDKDIR environment variable to point to it)
++ $(warning Or fix your xulrunner pkg-config files)
+ $(error )
++else
++ $(info Using Mozilla SDKDIR as: ${sdkdir})
+ endif
+
++xpidl = $(sdkdir)/bin/xpidl
+ idl_headers = $(idl:.idl=.h)
+ idl_typelib = $(idl:.idl=.xpt)
+ cpp_objects = $(cpp_sources:.cpp=.o)
+ so_target = $(target:=.$(so))
+
+-headers = -I$(sdkdir)/include \
+- -I$(sdkdir)/include/system_wrappers \
+- -I$(sdkdir)/include/nss \
+- -I$(sdkdir)/include/xpcom \
+- -I$(sdkdir)/include/string \
+- -I$(sdkdir)/include/pipnss \
+- -I$(sdkdir)/include/nspr \
+- -I$(sdkdir)/sdk/include
++ifeq ($(pkgconfig),"yes")
++ # Include dirs
++ nss_includes = $(call pkg-config-I,mozilla-nss)
++ nspr_includes = $(call pkg-config-I,mozilla-nspr)
++ libxul_includes = $(call pkg-config-I,libxul-unstable)
++
++ # Library dirs
++ nss_libdirs = $(call pkg-config-L,mozilla-nss)
++ nspr_libdirs = $(call pkg-config-L,mozilla-nspr)
++ libxul_libdirs = $(call pkg-config-L,libxul-unstable)
++
++ # Libs
++ nss_libs = $(call pkg-config-l,mozilla-nss)
++ nspr_libs = $(call pkg-config-l,mozilla-nspr)
++ libxul_libs = $(call pkg-config-l,libxul-unstable)
++
++ idl_dir = $(call pkg-config-var,idldir,libxul-unstable)/unstable
++
++# Fallback to Hard-coded
++else
++ # Include dirs
++ nss_includes = -I$(sdkdir)/include/nss
++ nspr_includes = -I$(sdkdir)/include/nspr
++ libxul_includes = -I$(sdkdir)/include \
++ -I$(sdkdir)/include/system_wrappers \
++ -I$(sdkdir)/include/xpcom \
++ -I$(sdkdir)/include/string \
++ -I$(sdkdir)/include/pipnss \
++ -I$(sdkdir)/sdk/include
++
++ # Library dirs
++ libxul_libdirs = $(sdkdir)/lib $(sdkdir)/bin
++ nss_libdirs = $(libxul_libdirs)
++ nspr_libdirs = $(libxul_libdirs)
++
++ # Libs
++ nss_libs = ssl3 smime3 nss3 nssutil3
++ nspr_libs = nspr4 plds4 plc4
++ libxul_libs = xpcomglue_s xpcom
++
++ idl_dir = $(sdkdir)/idl
++endif
++
++headers = $(nss_includes) \
++ $(nspr_includes) \
++ $(libxul_includes)
+
+ # libraries
+-libdirs := $(sdkdir)/lib $(sdkdir)/bin
+-libs := xpcomglue_s xpcom nspr4 \
+- crmf smime3 ssl3 nss3 nssutil3 \
+- plds4 plc4
+-
+-ifeq ($(os), linux)
+- libs := xpcom_core $(libs)
+-endif
++libdirs = $(nss_libdirs) \
++ $(nspr_libdirs) \
++ $(libxul_libdirs)
++
++libs = $(nss_libs) \
++ $(nspr_libs) \
++ $(libxul_libs)
+
+ # compiler and Linker Flags
+
+@@ -277,10 +340,10 @@
+
+ # rules to build the c headers and .xpt from idl
+ $(idl_headers): $(idl)
+- $(xpidl) -m header -I$(sdkdir)/idl $(@:.h=.idl)
++ $(xpidl) -m header -I$(idl_dir) $(@:.h=.idl)
+
+ $(idl_typelib): $(idl)
+- $(xpidl) -m typelib -I$(sdkdir)/idl $(@:.xpt=.idl)
++ $(xpidl) -m typelib -I$(idl_dir) $(@:.xpt=.idl)
+
+ # build and link rules
+ ifeq ($(os), Darwin)