]> git.pld-linux.org Git - packages/mozilla-addon-gnome-keyring.git/blob - xulrunner-27.patch
- upstream fixes for firefox 27+
[packages/mozilla-addon-gnome-keyring.git] / xulrunner-27.patch
1 From b637542e490b98b94ddc2dce6919970703f46932 Mon Sep 17 00:00:00 2001
2 From: Ximin Luo <infinity0@pwned.gg>
3 Date: Sun, 23 Mar 2014 03:07:41 +0000
4 Subject: [PATCH] add some more conditional compilation stuff to make things
5  work for firefox 27+
6
7 ---
8  GnomeKeyring.cpp |  8 ++++++++
9  Makefile         |  4 +++-
10  config.sh        | 30 +++++++++++++++++++++---------
11  xpcom_abi.cpp    |  4 ++++
12  4 files changed, 36 insertions(+), 10 deletions(-)
13
14 diff --git a/GnomeKeyring.cpp b/GnomeKeyring.cpp
15 index ac089ed..92711c8 100644
16 --- a/GnomeKeyring.cpp
17 +++ b/GnomeKeyring.cpp
18 @@ -37,6 +37,10 @@
19   *
20   * ***** END LICENSE BLOCK ***** */
21  
22 +#if HAVE_MOZ_BUG_956507
23 +#include "mozilla/Char16.h"
24 +#endif
25 +
26  #include "GnomeKeyring.h"
27  #include "nsMemory.h"
28  #include "nsILoginInfo.h"
29 @@ -614,8 +618,12 @@ NS_IMETHODIMP GnomeKeyring::Init()
30    return ret;
31  }
32  
33 +#if HAVE_NSILMS_INITWITHFILE_2
34  NS_IMETHODIMP GnomeKeyring::InitWithFile(nsIFile *aInputFile,
35                                           nsIFile *aOutputFile)
36 +#else
37 +NS_IMETHODIMP GnomeKeyring::InitWithFile(nsIFile *aInputFile)
38 +#endif
39  {
40    // TODO
41    return Init();
42 diff --git a/Makefile b/Makefile
43 index cecfce7..5c52024 100644
44 --- a/Makefile
45 +++ b/Makefile
46 @@ -62,6 +62,8 @@ else
47  endif
48  
49  SHELL_EXPORT := $(foreach v,CXX XUL_CFLAGS XUL_LDFLAGS XPCOM_ABI_FLAGS GNOME_CFLAGS GNOME_LDFLAGS CXXFLAGS LDFLAGS,$(v)="$($(v))")
50 +CXX_MACRO_EXPORT := $(foreach v,HAVE_NSILMS_GETISLOGGEDIN HAVE_NSILMS_INITWITHFILE_2 HAVE_MOZ_BUG_956507 HAVE_MOZGLUE,-D$(v)="$($(v))")
51 +
52  config.vars: config.sh GnomeKeyring.h xpcom_abi.cpp Makefile
53         $(SHELL_EXPORT) sh $^ > $@
54  
55 @@ -97,7 +99,7 @@ xpi/chrome/skin/hicolor/seahorse.svg: seahorse.svg
56         cp -a $< $@
57  
58  $(TARGET): GnomeKeyring.cpp GnomeKeyring.h
59 -       $(CXX) $< -o $@ -shared -DHAVE_NSILMS_GETISLOGGEDIN=$(HAVE_NSILMS_GETISLOGGEDIN) \
60 +       $(CXX) $< -o $@ -shared $(CXX_MACRO_EXPORT) \
61             $(XUL_CFLAGS) $(XUL_LDFLAGS) $(GNOME_CFLAGS) $(GNOME_LDFLAGS) $(CXXFLAGS) $(LDFLAGS)
62         chmod +x $@
63  
64 diff --git a/config.sh b/config.sh
65 index bf50a68..4b32da2 100755
66 --- a/config.sh
67 +++ b/config.sh
68 @@ -13,8 +13,20 @@ XUL_VERSION=$(echo '#include "mozilla-config.h"'|
69  XUL_VER_MIN=$(echo $XUL_VERSION | sed -r -e 's/([^.]+\.[^.]+).*/\1/g')
70  XUL_VER_MAX=$(echo $XUL_VERSION | sed -rn -e 's/([^.]+).*/\1.*/gp')
71  
72 -HAVE_NSILMS_GETISLOGGEDIN=$({ echo '#include "'"$SRC_GNOME_KEYRING_H"'"'; echo 'NS_IMETHODIMP GnomeKeyring::GetIsLoggedIn(bool *aIsLoggedIn) { return NS_OK; }'; } |
73 -         $CXX $XUL_CFLAGS $GNOME_CFLAGS $CXXFLAGS -x c++ -w -c -o /dev/null - && echo 1 || echo 0)
74 +HAVE_NSILMS_GETISLOGGEDIN=$({ cat <<EOF; } | $CXX $XUL_CFLAGS $GNOME_CFLAGS $CXXFLAGS -x c++ -w -c -o /dev/null - 2>/dev/null && echo 1 || echo 0)
75 +#include "$SRC_GNOME_KEYRING_H"
76 +NS_IMETHODIMP GnomeKeyring::GetIsLoggedIn(bool *aIsLoggedIn) { return NS_OK; }
77 +EOF
78 +
79 +HAVE_NSILMS_INITWITHFILE_2=$({ cat <<EOF; } | $CXX $XUL_CFLAGS $GNOME_CFLAGS $CXXFLAGS -x c++ -w -c -o /dev/null - 2>/dev/null && echo 1 || echo 0)
80 +#include "$SRC_GNOME_KEYRING_H"
81 +NS_IMETHODIMP GnomeKeyring::InitWithFile(nsIFile *aInputFile, nsIFile *aOutputFile) { return NS_OK; }
82 +EOF
83 +
84 +HAVE_MOZ_BUG_956507=$({ cat <<EOF; } | $CXX $XUL_CFLAGS $GNOME_CFLAGS $CXXFLAGS -x c++ -w -c -o /dev/null - 2>/dev/null && echo 0 || echo 1)
85 +#include <nspr/prtypes.h>
86 +#include "mozilla/Char16.h"
87 +EOF
88  
89  HAVE_MOZGLUE=$($CXX $XUL_CFLAGS $XUL_LDFLAGS $XPCOM_ABI_FLAGS $CXXFLAGS $LDFLAGS -lmozglue -shared -o /dev/null && echo 1 || echo 0)
90  
91 @@ -22,13 +34,13 @@ if [ $HAVE_MOZGLUE = 1 ]; then
92         XPCOM_ABI_FLAGS="$XPCOM_ABI_FLAGS -Wl,-whole-archive -lmozglue -Wl,-no-whole-archive"
93  fi
94  DST_XPCOM_ABI="$(dirname $0)/xpcom_abi"
95 -$CXX $SRC_XPCOM_ABI_CPP -o "$DST_XPCOM_ABI" $XUL_CFLAGS $XUL_LDFLAGS $XPCOM_ABI_FLAGS $CXXFLAGS $LDFLAGS
96 +$CXX $SRC_XPCOM_ABI_CPP -DHAVE_MOZ_BUG_956507="$HAVE_MOZ_BUG_956507" -o "$DST_XPCOM_ABI" \
97 +  $XUL_CFLAGS $XUL_LDFLAGS $XPCOM_ABI_FLAGS $CXXFLAGS $LDFLAGS
98  PLATFORM="$("$DST_XPCOM_ABI")"
99  
100 -echo export XUL_VERSION="$XUL_VERSION"
101 -echo export XUL_VER_MIN="$XUL_VER_MIN"
102 -echo export XUL_VER_MAX="$XUL_VER_MAX"
103 -echo export HAVE_NSILMS_GETISLOGGEDIN="$HAVE_NSILMS_GETISLOGGEDIN"
104 -echo export HAVE_MOZGLUE="$HAVE_MOZGLUE"
105 -echo export PLATFORM="$PLATFORM"
106 +for var in XUL_VERSION XUL_VER_MIN XUL_VER_MAX PLATFORM \
107 +  HAVE_NSILMS_GETISLOGGEDIN HAVE_NSILMS_INITWITHFILE_2 HAVE_MOZ_BUG_956507 HAVE_MOZGLUE; do
108 +       eval val=\$$var
109 +       echo export $var=$val
110 +done;
111  echo export HAVE_CONFIG_VARS=1
112 diff --git a/xpcom_abi.cpp b/xpcom_abi.cpp
113 index c6d0202..bf8d91b 100644
114 --- a/xpcom_abi.cpp
115 +++ b/xpcom_abi.cpp
116 @@ -1,6 +1,10 @@
117  #include <stdio.h>
118  #include <stdint.h>
119  
120 +#if HAVE_MOZ_BUG_956507
121 +#include "mozilla/Char16.h"
122 +#endif
123 +
124  #include "nsIXULRuntime.h"
125  #include "nsServiceManagerUtils.h"
126  #include "nsStringAPI.h"
127 -- 
128 1.8.5.5
129
This page took 0.084447 seconds and 3 git commands to generate.