summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-java/swt
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-java/swt')
-rw-r--r--dev-java/swt/Manifest18
-rw-r--r--dev-java/swt/files/as-needed-and-flag-fixes-3.6.patch243
-rw-r--r--dev-java/swt/files/as-needed-and-flag-fixes.patch238
-rw-r--r--dev-java/swt/files/build.xml17
-rw-r--r--dev-java/swt/files/swt-3.3-callback-pointer-dereferencing.patch23
-rw-r--r--dev-java/swt/files/swt-3.4-manifest16
-rw-r--r--dev-java/swt/files/swt-3.4-xulrunner-1.9.1-amd64.patch325
-rw-r--r--dev-java/swt/files/swt-3.4-xulrunner-1.9.1.patch325
-rw-r--r--dev-java/swt/files/swt-3.5-manifest17
-rw-r--r--dev-java/swt/files/swt-3.6-manifest17
-rw-r--r--dev-java/swt/files/swt-3.7-manifest17
-rw-r--r--dev-java/swt/files/swt-3.7.2-gio_launch-URI-x86.patch121
-rw-r--r--dev-java/swt/files/swt-3.7.2-gio_launch-URI.patch121
-rw-r--r--dev-java/swt/files/swt-3.8-as-needed-and-flag-fixes.patch243
-rw-r--r--dev-java/swt/files/swt-3.8-manifest17
-rw-r--r--dev-java/swt/files/swt-3.8.2-gthread.patch44
-rw-r--r--dev-java/swt/files/swt-4.2-as-needed-and-flag-fixes.patch243
-rw-r--r--dev-java/swt/files/swt-4.2-manifest16
-rw-r--r--dev-java/swt/metadata.xml13
-rw-r--r--dev-java/swt/swt-3.5.2.ebuild175
-rw-r--r--dev-java/swt/swt-3.6.1.ebuild175
-rw-r--r--dev-java/swt/swt-3.7.1.ebuild181
-rw-r--r--dev-java/swt/swt-3.7.2-r1.ebuild186
-rw-r--r--dev-java/swt/swt-3.7.2.ebuild181
-rw-r--r--dev-java/swt/swt-3.8.2.ebuild183
-rw-r--r--dev-java/swt/swt-4.2-r1.ebuild174
-rw-r--r--dev-java/swt/swt-4.2-r2.ebuild177
-rw-r--r--dev-java/swt/swt-4.2.ebuild171
28 files changed, 3677 insertions, 0 deletions
diff --git a/dev-java/swt/Manifest b/dev-java/swt/Manifest
new file mode 100644
index 000000000000..dff8fea97819
--- /dev/null
+++ b/dev-java/swt/Manifest
@@ -0,0 +1,18 @@
+DIST swt-3.5.2-gtk-linux-ppc.zip 4947929 SHA256 f2619f6e107eee3c55c6694df4c89e77976d2d5517b6f3c17c358602536abf28 SHA512 2d3d194d2bb4c7f0e6d5bc801d41cb6de970de78c544a7edd2f18c4ed9291f7639dbedab4594c5221e76dd559c884c6fda7f32d11d0465a2d017fe0398a33dae WHIRLPOOL 282057de0d2e23c887db96d20ff8e39a1ea1e87adde415357903323095d4439e966218390932bebd2234dfed2117a0afa93372e9088e695770cb521ff7180501
+DIST swt-3.5.2-gtk-linux-x86.zip 4881316 SHA256 00477e6fc3c913916cd980a1ec29629c5250afc52dc0fcee74b035af0360eef7 SHA512 f53226458e5404cc03475c3bb903de81efa328625b713fe97b3b418a769b0476695e437e0693b5e10fa9a356de90302d6a2d267fe5e13f172803c684db9e9c82 WHIRLPOOL 4ca8f495c6d499ed8f1f6789333a6b357978029a6138a9986b6ef309a3e60303b6399b3c288e3732b13b75eb1db45e3679a559c806113a80572b0a05a226cadd
+DIST swt-3.5.2-gtk-linux-x86_64.zip 5068674 SHA256 91f9e2d4f6ca3926252d33895aafe82ba1b72bcdb77ec71dafa20d154f5d5bc7 SHA512 f226d531002dc472852f09ce9814c8dcf7b0c4209353a5639d8b814308807df6477c4a8aa0fd49743578282e6662ca8d5c316371720dca50953ad7ec44b7c6d3 WHIRLPOOL 335ab0845f3c27d3396286f26b45583cf4b71469c3567dd2a978fa3b82af7828d02925529ec686825d283207b3e3858237664f43ab4ecb56835a84ffb066033b
+DIST swt-3.6.1-gtk-linux-ppc.zip 5396609 SHA256 71caf4106401c8227696f8fc2c6d84a9c88877a38ed046b830455c65b85412ec SHA512 cee062224f8e5508d9f8d0a099535337c73a18338bb804a37dd79c11e7601ebd9455469300ad17fa2bd260b7ddddc673ac8d7e385250fcf55bf9f70af76b6c7b WHIRLPOOL 9a567eb65eee0e8f29da4eb53f0795469b92bfecddfc753f7e42915586b5b7fc2a33b1e2a5d43b41afd33d8f10e27716331195ede79315307c885fc24a58be39
+DIST swt-3.6.1-gtk-linux-x86.zip 5234373 SHA256 d0df381d82b1483bc2ffc576a55250be12db108f6a77058f87dd87ac7874f9ef SHA512 89159a74b27f3afb31c1ce0360012b0d3f72649bac9f068ceb02a3447033a6d06ce5a434f6fa996a2455569b45d263f960e96a7de3860db8ed688b3554cb8a5f WHIRLPOOL 462a7e1bb706a3335ca623ee1a6f8edc429155fd50a678a4865322af07c5daf0dc6cc970b5369914134fba788031dfbdf9a690f719105d5d529f6921d5548aec
+DIST swt-3.6.1-gtk-linux-x86_64.zip 5529321 SHA256 e4e72278e710ecda4594a143e76cb7dc30ab7bcd5e6334b4c0d08ca75d900b94 SHA512 175d1827108168596ef5c68f1c9c5eef567f5b27aca8fe45374cc5fb2b59ee003a627edfcc24f34222abc078ec28d230535279bd79b04128cccb1e349d2bf0bb WHIRLPOOL 2d2eb7466a268553a6744e7e1f88402cfffd09fb5b0f00522253bd295e23eeb42ab4ab3d302267fb083c0391158124d3b6eca29c6a06c53d37b71560d91d0f24
+DIST swt-3.7.1-gtk-linux-ppc64.zip 5687650 SHA256 11b0ea72554f0f75941b44ae76aaf70b326e1c0cda7328fbb5a83b682a5e653c SHA512 fe73fa10c41cde27393818eab7a3d4c1402fcfad5639d75c9642e2a020e872e7a5d65dd65c1a526b3e70f74ac6cb4bbb7df93ac48cd6923c483754dc74e52125 WHIRLPOOL d599d45cf43b4892faa0d435dc0e22d717234b918b74a29e7d542ebab486dacb3287fd105ba0380ea8b4b53806153ac62cb86d5bd5de4bf236522bb9471d6c49
+DIST swt-3.7.1-gtk-linux-x86.zip 5374283 SHA256 94279a6ab1aab248641daf728bca34f4eb2f4b812aaebc1973c775320cb96942 SHA512 3b9095b04e2cd8d4f3721c7ac51303f93164b47cb2afa992e553b46909e99232d70cceba9088053740fd46ef158f190101f2d84d3e6d1eddeabb40128bde1bf5 WHIRLPOOL f0c5d3190d5a1b2fbf8718591362b1115bb17e583ded59464e5c7108f3e652631bac21e8c8c4d216d4451096d726871b9f64fead3db4234125bae4983f84a00f
+DIST swt-3.7.1-gtk-linux-x86_64.zip 5671004 SHA256 dd11d29a95391afed42ac3883c45a2bda7e4597c72c4b7b1291316e006139b75 SHA512 0d7a3b2bb5facb120682c4a5d7ca9232483aea1dab67172368e723849ed79dee89ecfec2d286c4827e111191b5f7025232c26e0219b6f9fda3705b3b667ae0e2 WHIRLPOOL c2b6ae1d89de955a1df14fa6b6df8e234ccae84e0b01f5a5c414cd8764eee6f826ac7298e1bfe35d92aa527d4caa96cc4a2b54c91350f88b12a28c132e88ab63
+DIST swt-3.7.2-gtk-linux-ppc64.zip 5688113 SHA256 90106c1878470dfb78b665062a6a8f94c19cbb469221a37be4b7b985bed54c5e SHA512 750aaa43560bbf6f82f7f8cd9338abc88578f4f0b9aadaec9bc8a5c3d1ad593619cdf01d202cbf06766090ee977989ea7904643669c61971973951d8428b57d0 WHIRLPOOL 44b3b19b425132a615026209d1b557ab099dec441a8c2fb7aadfd90d19cd56228385e8e4f0ce09d66ebdcb9870cc5a932c1e6c6b4e3c507ca5b687b3ec6e18f4
+DIST swt-3.7.2-gtk-linux-x86.zip 5374609 SHA256 4e31f4cf5c6eac378ecaf5e261e925e82c377902c61cfdefaa38b1c3ea445183 SHA512 9f58864d05eba2648e4b5d5c958172f5c0c7c730209525b3d6f607586daaefea4d5ba1013e80c0c11948f01c553044b0a98c81688b33c14114ba79c7ce620426 WHIRLPOOL ff47a49df58f711c9ea9dcbc08ae6e5e78fcf11e9419a97a28a660af10172ba5b8eeff4e181794816c1b6aca9a6b3ea52b4f2cc855c0e399265a761c96b87296
+DIST swt-3.7.2-gtk-linux-x86_64.zip 5671443 SHA256 a92498e1fcd001b91a5128a414263908c876c5b74bd10c3276e08a8edd470443 SHA512 d60ae1d3f3b0577f7e3018139f93069c89d021064fec2f3f4074f95cfae56abdc0c7d531cb904ad3911482543cddcc3f6646ff47192073f4bde97c79e13612b7 WHIRLPOOL 2698abf1f6f50d6712d37e7b10ee6b0442f1db43b0d78814c3ee04a3922816c9f62247c55610f539c11dfd10c4f4fcf1ab2986eec81d2555144730c95ee381dd
+DIST swt-3.8.2-gtk-linux-ppc64.zip 5933708 SHA256 af96edd43b751de4c9a1e45cc0d5d78d288a641481f8c6a2a75e4daa9c0523ab SHA512 cb9f2c7aed0b18bae6546272076c23c91d9e1a38404f0a70ddc6408047d961befe2839db177066312b82d8365bee6bcffb6e92aaa7a869ad37d9f49ab780e337 WHIRLPOOL 319ace912c06493102feb769944da5af753fab35b3e2ea0350194cec9374a2611850bf2127db397c9cb813457ca851a563d45cc847bd51c9ccf0db2505f48330
+DIST swt-3.8.2-gtk-linux-x86.zip 5558694 SHA256 d1339ae67b12cec7d82518a1e0c2ceba2637d9b5e1e429745b877b08d3450756 SHA512 afe1563e92fe9af0a58e7dbae731976991a6afacf6415ab88ebf557f99a5154169ad7103519524f71142c4160d55a9b0a9f7379b21486430318e4160e6f01c00 WHIRLPOOL d64dd28dc05b97e05a161ac50be414d011c37ea4790613d2ae9bb99cb1b4b69293741a393d5978a7c003cfa3a3c076f671e592d27e6c1fc17e944087a1e38a3f
+DIST swt-3.8.2-gtk-linux-x86_64.zip 5865160 SHA256 b4e7aeefbf1b44afe37c7850bbae3683a38b76669c007fe3e328c47aa31fa7ef SHA512 43a27cb6fc891d7da35f5fcfc6ccb689d2b2c58de70b628b1e7cf07131f0641598b627eeedafb6a8dca715a336a7fb4fb6a03bb29fea3e115a4af571b1574cf8 WHIRLPOOL 0b75a0857d9398e87bc502bdfc54beb9f4cc491170880138cfd566f590038aa98827743e013faa031ac3bdb8b3cd4c543979db15201570f8dae63094de7e52ba
+DIST swt-4.2-gtk-linux-ppc64.zip 5935799 SHA256 b853c9601ae0808634722976392319405bee53e6bc30864d0bfbf0507159d1db SHA512 bedd64099380980a6dbe47b86f4719666366680f7580150f97282c6f6b6acc95822493469e950e8fcbc9c584f6fca9f35a59937551ae8b6e799b188dc3751e9d WHIRLPOOL 8fe20ed46de94bb554205929fd142a2ac21aca543289a48cd6417f60f8a4d2d55062b7ebbda7f6712aabc6c7de8998c75c48eeffe73139c756e44e71c2ef84be
+DIST swt-4.2-gtk-linux-x86.zip 5561088 SHA256 e0e2977837c905b61219eb94544d89757ac3d01a88c3a81abff6d7446d48d9ac SHA512 e3d53bcd0521411c40f4c37719917f3570a17fb3ea5c617560986273fd155b99d9b0790ba27c57da26663d49ebec4c6a8387b41bd01b0ba934b21724ba98e133 WHIRLPOOL ad4fd1113f6e4b2605433ac7a53aa416c29824164b97b2b3a3ceb61e6bc812108c38841b75c5ec6f9a093ed2b8a7c58bf883d701403e8399a18ccb2a8c214165
+DIST swt-4.2-gtk-linux-x86_64.zip 5867140 SHA256 f549bb8309e1523dd4d3867aaf6f0582cdbe5a504ae8aba52900fe6fdb63f336 SHA512 56c5ec4ca2ddeed5256dd6ff350dc3911034ecbc414a06ba879f04ab53d6380ca9da9037097f76228ca8182f6076bcd9cc4cb9b01c10766c10048e6576fc5f50 WHIRLPOOL 5f60bfe556d6551fdabe4184dfc5a4a9df250b10010d59200902017a9f9cbed379a557e5179232d05a8542d531542c3eb6d0afc57c752717dca7a9d7f4177e62
diff --git a/dev-java/swt/files/as-needed-and-flag-fixes-3.6.patch b/dev-java/swt/files/as-needed-and-flag-fixes-3.6.patch
new file mode 100644
index 000000000000..16194fdc5f51
--- /dev/null
+++ b/dev-java/swt/files/as-needed-and-flag-fixes-3.6.patch
@@ -0,0 +1,243 @@
+--- make_linux.mak~ 2010-06-08 17:30:58.000000000 +0000
++++ make_linux.mak 2010-08-09 22:48:01.515433721 +0000
+@@ -66,7 +66,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS = $(CXXFLAGS) \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -107,7 +107,7 @@
+ WEBKIT_OBJECTS = swt.o webkit.o webkit_structs.o webkit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DLINUX -DGTK \
+@@ -131,13 +131,13 @@
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -156,7 +156,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -172,7 +172,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -180,7 +180,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -188,7 +188,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -205,7 +205,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -222,7 +222,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -242,7 +242,7 @@
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -262,7 +262,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -279,7 +279,7 @@
+ make_webkit: $(WEBKIT_LIB)
+
+ $(WEBKIT_LIB): $(WEBKIT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS) $(WEBKITLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS) $(WEBKITLIBS)
+
+ webkit.o: webkitgtk.c
+ $(CC) $(CFLAGS) $(WEBKITCFLAGS) -c webkitgtk.c -o webkit.o
+@@ -296,7 +296,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
+--- make_freebsd.mak~ 2010-06-08 17:30:58.000000000 +0000
++++ make_freebsd.mak 2010-08-09 22:50:26.173246263 +0000
+@@ -64,7 +64,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -91,7 +91,7 @@
+ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DFREEBSD -DGTK \
+@@ -115,13 +115,13 @@
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -140,7 +140,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -156,7 +156,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -164,7 +164,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -172,7 +172,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -189,7 +189,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -206,7 +206,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -226,7 +226,7 @@
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -252,7 +252,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -269,7 +269,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
diff --git a/dev-java/swt/files/as-needed-and-flag-fixes.patch b/dev-java/swt/files/as-needed-and-flag-fixes.patch
new file mode 100644
index 000000000000..4cacaf61d671
--- /dev/null
+++ b/dev-java/swt/files/as-needed-and-flag-fixes.patch
@@ -0,0 +1,238 @@
+--- make_linux.mak 2009-05-24 18:38:39.000000000 +0300
++++ make_linux.mak.fixed 2009-05-24 19:38:51.000000000 +0300
+@@ -64,7 +64,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS = $(CXXFLAGS) \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -92,15 +92,14 @@
+ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
+- -DSWT_VERSION=$(SWT_VERSION) \
++CFLAGS += -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DLINUX -DGTK \
+ -I$(JAVA_HOME)/include \
+ -I$(JAVA_HOME)/include/linux \
+ -fPIC \
+ ${SWT_PTR_CFLAGS}
+-LIBS = -shared -fPIC
++LIBS = -shared -fPIC $(LDFLAGS)
+
+ ifndef NO_STRIP
+ AWT_LIBS := $(AWT_LIBS) -s
+@@ -122,7 +121,7 @@
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LIBS) $(GTKLIBS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS)
++ $(CC) $(LIBS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -141,7 +140,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LIBS) $(CAIROLIBS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS)
++ $(CC) $(LIBS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -157,7 +156,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LIBS) $(CDE_LIBS) -o $(CDE_LIB) $(CDE_OBJECTS)
++ $(CC) $(LIBS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -165,7 +164,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LIBS) -o $(AWT_LIB) $(AWT_OBJECTS)
++ $(CC) $(LDFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -173,7 +172,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LIBS) $(ATKLIBS) -o $(ATK_LIB) $(ATK_OBJECTS)
++ $(CC) $(LIBS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -190,7 +189,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LIBS) $(GNOMELIBS) -o $(GNOME_LIB) $(GNOME_OBJECTS)
++ $(CC) $(LIBS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -207,7 +206,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -227,7 +226,7 @@
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -247,7 +246,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -264,7 +263,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LIBS) $(GLXLIBS) -o $(GLX_LIB) $(GLX_OBJECTS)
++ $(CC) $(LIBS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
+--- make_freebsd.mak 2009-05-24 20:09:55.000000000 +0300
++++ make_freebsd.mak.fixed 2009-05-24 20:15:03.000000000 +0300
+@@ -64,7 +64,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS = $(CXXFLAGS) \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -91,15 +91,14 @@
+ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
+- -DSWT_VERSION=$(SWT_VERSION) \
++CFLAGS += -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DFREEBSD -DGTK \
+ -I$(JAVA_HOME)/include \
+ -I$(JAVA_HOME)/include/freebsd \
+ -fPIC \
+ ${SWT_PTR_CFLAGS}
+-LIBS = -shared -fPIC
++LIBS = -shared -fPIC $(LDFLAGS)
+
+ ifndef NO_STRIP
+ AWT_LIBS := $(AWT_LIBS) -s
+@@ -121,7 +120,7 @@
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LIBS) $(GTKLIBS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS)
++ $(CC) $(LIBS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -140,7 +139,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LIBS) $(CAIROLIBS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS)
++ $(CC) $(LIBS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -156,7 +155,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LIBS) $(CDE_LIBS) -o $(CDE_LIB) $(CDE_OBJECTS)
++ $(CC) $(LIBS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -164,7 +163,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LIBS) -o $(AWT_LIB) $(AWT_OBJECTS)
++ $(CC) $(LDFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -172,7 +171,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LIBS) $(ATKLIBS) -o $(ATK_LIB) $(ATK_OBJECTS)
++ $(CC) $(LIBS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -189,7 +188,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LIBS) $(GNOMELIBS) -o $(GNOME_LIB) $(GNOME_OBJECTS)
++ $(CC) $(LIBS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -206,7 +205,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALIBS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -226,7 +225,7 @@
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -252,7 +251,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALIBS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -269,7 +268,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LIBS) $(GLXLIBS) -o $(GLX_LIB) $(GLX_OBJECTS)
++ $(CC) $(LIBS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
diff --git a/dev-java/swt/files/build.xml b/dev-java/swt/files/build.xml
new file mode 100644
index 000000000000..ea775871bf09
--- /dev/null
+++ b/dev-java/swt/files/build.xml
@@ -0,0 +1,17 @@
+<project name="SWT" default="jar" basedir=".">
+ <property name="src" location="."/>
+ <property name="build" location="build"/>
+
+ <target name="init">
+ <tstamp/>
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the SWT toolset">
+ <javac srcdir="${src}" destdir="${build}"/>
+ </target>
+
+ <target name="jar">
+ <jar destfile="swt.jar" basedir="${build}"/>
+ </target>
+</project>
diff --git a/dev-java/swt/files/swt-3.3-callback-pointer-dereferencing.patch b/dev-java/swt/files/swt-3.3-callback-pointer-dereferencing.patch
new file mode 100644
index 000000000000..92fbab779d1c
--- /dev/null
+++ b/dev-java/swt/files/swt-3.3-callback-pointer-dereferencing.patch
@@ -0,0 +1,23 @@
+# patch from gcj-overlay, not sure if by geki himself
+# removes QA warning about strict-aliasing
+--- callback.c.orig 2006-12-12 17:25:26.000000000 +0100
++++ callback.c 2006-12-12 18:11:34.000000000 +0100
+@@ -250,12 +250,16 @@
+
+ #ifdef JNI_VERSION_1_2
+ if (IS_JNI_1_2) {
+- (*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2);
++ /* http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/invocation.html */
++ /* jint GetEnv(JavaVM *vm, void **env, jint version); */
++ (*jvm)->GetEnv(jvm, (void *)&env, JNI_VERSION_1_2);
+ }
+ #endif
+
+ if (env == NULL) {
+- (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL);
++ /* http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/invocation.html */
++ /* jint AttachCurrentThread(JavaVM *vm, JNIEnv **p_env, void *thr_args); */
++ (*jvm)->AttachCurrentThread(jvm, (void *)&env, NULL);
+ if (IS_JNI_1_2) detach = 1;
+ }
+
diff --git a/dev-java/swt/files/swt-3.4-manifest b/dev-java/swt/files/swt-3.4-manifest
new file mode 100644
index 000000000000..c11c42ab7199
--- /dev/null
+++ b/dev-java/swt/files/swt-3.4-manifest
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 3.4.0
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.mozilla; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
diff --git a/dev-java/swt/files/swt-3.4-xulrunner-1.9.1-amd64.patch b/dev-java/swt/files/swt-3.4-xulrunner-1.9.1-amd64.patch
new file mode 100644
index 000000000000..db2536bab3ac
--- /dev/null
+++ b/dev-java/swt/files/swt-3.4-xulrunner-1.9.1-amd64.patch
@@ -0,0 +1,325 @@
+# Patch by Grant Gayed
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=268651#c18
+# https://bugs.eclipse.org/bugs/attachment.cgi?id=130751
+Index: Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+===================================================================
+RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java,v
+retrieving revision 1.105.2.3
+diff -u -r1.105.2.3 Mozilla.java
+--- src/org/eclipse/swt/browser/Mozilla.java 21 Aug 2008 16:02:30 -00001.105.2.3
++++ src/org/eclipse/swt/browser/Mozilla.java 2 Apr 2009 19:15:06 -0000
+@@ -47,6 +47,7 @@
+ Shell tip = null;
+ Listener listener;
+ Vector unhookedDOMWindows = new Vector ();
++ byte[] htmlBytes;
+
+ static nsIAppShell AppShell;
+ static AppFileLocProvider LocationProvider;
+@@ -1130,21 +1131,21 @@
+ * Once the client does a proper navigate with either setUrl() or setText() then resume as
+ * normal. The Mozilla bug for this is https://bugzilla.mozilla.org/show_bug.cgi?id=415789.
+ */
+- awaitingNavigate = true;
+- rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
+- if (rc != XPCOM.NS_OK) {
+- browser.dispose ();
+- error (rc);
+- }
+- if (result[0] == 0) {
+- browser.dispose ();
+- error (XPCOM.NS_ERROR_NO_INTERFACE);
+- }
+- nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+- char[] uri = new char[ABOUT_BLANK.length () + 1];
+- ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uri, 0);
+- rc = webNavigation.LoadURI (uri, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
+- webNavigation.Release ();
++// awaitingNavigate = true;
++// rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
++// if (rc != XPCOM.NS_OK) {
++// browser.dispose ();
++// error (rc);
++// }
++// if (result[0] == 0) {
++// browser.dispose ();
++// error (XPCOM.NS_ERROR_NO_INTERFACE);
++// }
++// nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
++// char[] uri = new char[ABOUT_BLANK.length () + 1];
++// ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uri, 0);
++// rc = webNavigation.LoadURI (uri, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
++// webNavigation.Release ();
+ }
+ }
+ result[0] = 0;
+@@ -1223,6 +1224,7 @@
+ }
+
+ public boolean back () {
++ htmlBytes = null;
+ if (awaitingNavigate) return false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1425,6 +1427,7 @@
+ }
+
+ public boolean forward () {
++ htmlBytes = null;
+ if (awaitingNavigate) return false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1635,6 +1638,7 @@
+ webBrowser.Release ();
+ webBrowser = null;
+ webBrowserObject = null;
++ htmlBytes = null;
+
+ if (tip != null && !tip.isDisposed ()) tip.dispose ();
+ tip = null;
+@@ -1696,6 +1700,7 @@
+ }
+
+ public void refresh () {
++ htmlBytes = null;
+ if (awaitingNavigate) return;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1817,11 +1822,45 @@
+ } else {
+ result[0] = 0;
+ rc = interfaceRequestor.GetInterface (nsIDocShell.NS_IDOCSHELL_IID, result);
+- if (rc != XPCOM.NS_OK) error (rc);
+- if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
+- nsIDocShell docShell = new nsIDocShell (result[0]);
+- rc = docShell.LoadStream (inputStream.getAddress (), uri.getAddress (), aContentType, aContentCharset, 0);
+- docShell.Release ();
++ if (rc == XPCOM.NS_OK) {
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIDocShell docShell = new nsIDocShell (result[0]);
++ rc = docShell.LoadStream (inputStream.getAddress (), uri.getAddress (), aContentType, aContentCharset, 0);
++ docShell.Release ();
++ } else {
++ result[0] = 0;
++ rc = webBrowser.QueryInterface (nsIWebBrowserStream.NS_IWEBBROWSERSTREAM_IID, result);
++ if (rc == XPCOM.NS_OK) {
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ /*
++ * Setting mozilla's content through nsIWebBrowserStream does not cause a page
++ * load to occur, so the events that usually accompany a page change are not
++ * fired. To make this behave as expected, navigate to about:blank first and
++ * then set the html content once the page has loaded.
++ */
++ new nsISupports (result[0]).Release ();
++ result[0] = 0;
++
++ /*
++ * If htmlBytes is not null then the about:blank page is already being loaded,
++ * so no Navigate is required. Just set the html that is to be shown.
++ */
++ boolean blankLoading = htmlBytes != null;
++ htmlBytes = data;
++ if (blankLoading) return true;
++
++ /* navigate to about:blank */
++ rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
++ result[0] = 0;
++ char[] uriChars = new char[ABOUT_BLANK.length () + 1];
++ ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uriChars, 0);
++ rc = webNavigation.LoadURI (uriChars, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
++ webNavigation.Release ();
++ }
++ }
+ }
+ }
+ if (rc != XPCOM.NS_OK) error (rc);
+@@ -1836,6 +1875,7 @@
+ }
+
+ public boolean setUrl (String url) {
++ htmlBytes = null;
+ awaitingNavigate = false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1852,6 +1892,7 @@
+ }
+
+ public void stop () {
++ htmlBytes = null;
+ if (awaitingNavigate) return;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -2174,6 +2215,108 @@
+ unhookedDOMWindows.remove (ptrObject);
+ new nsISupports (ptrObject.value).Release ();
+ }
++
++ /*
++ * If htmlBytes is not null then there is html from a previous setText() call
++ * waiting to be set into the about:blank page once it has completed loading.
++ */
++ if (htmlBytes != null) {
++ nsIRequest req = new nsIRequest (aRequest);
++ long /*int*/ name = XPCOM.nsEmbedCString_new ();
++ rc = req.GetName (name);
++ if (rc != XPCOM.NS_OK) error (rc);
++ int length = XPCOM.nsEmbedCString_Length (name);
++ long /*int*/ buffer = XPCOM.nsEmbedCString_get (name);
++ byte[] dest = new byte[length];
++ XPCOM.memmove (dest, buffer, length);
++ String url = new String (dest);
++ XPCOM.nsEmbedCString_delete (name);
++
++ if (url.startsWith (ABOUT_BLANK)) {
++ /*
++ * Setting mozilla's content with nsIWebBrowserStream invalidates the
++ * DOM listeners that were hooked on it (about:blank), so remove them and
++ * add new ones after the content has been set.
++ */
++ unhookDOMListeners ();
++
++ rc = XPCOM.NS_GetServiceManager (result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++
++ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
++ result[0] = 0;
++ rc = serviceManager.GetService (XPCOM.NS_IOSERVICE_CID, nsIIOService.NS_IIOSERVICE_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++ serviceManager.Release ();
++
++ nsIIOService ioService = new nsIIOService (result[0]);
++ result[0] = 0;
++ /*
++ * Note. Mozilla ignores LINK tags used to load CSS stylesheets
++ * when the URI protocol for the nsInputStreamChannel
++ * is about:blank. The fix is to specify the file protocol.
++ */
++ byte[] aString = MozillaDelegate.wcsToMbcs (null, URI_FROMMEMORY, false);
++ long /*int*/ aSpec = XPCOM.nsEmbedCString_new (aString, aString.length);
++ rc = ioService.NewURI (aSpec, null, 0, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++ XPCOM.nsEmbedCString_delete (aSpec);
++ ioService.Release ();
++
++ nsIURI uri = new nsIURI (result[0]);
++ result[0] = 0;
++
++ rc = webBrowser.QueryInterface (nsIWebBrowserStream.NS_IWEBBROWSERSTREAM_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++
++ nsIWebBrowserStream stream = new nsIWebBrowserStream (result[0]);
++ result[0] = 0;
++
++ byte[] contentTypeBuffer = MozillaDelegate.wcsToMbcs (null, "text/html", true); // $NON-NLS-1$
++ long /*int*/ aContentType = XPCOM.nsEmbedCString_new (contentTypeBuffer, contentTypeBuffer.length);
++
++ rc = stream.OpenStream (uri.getAddress (), aContentType);
++ if (rc != XPCOM.NS_OK) error (rc);
++ long /*int*/ ptr = C.malloc (htmlBytes.length);
++ XPCOM.memmove (ptr, htmlBytes, htmlBytes.length);
++ int pageSize = 8192;
++ int pageCount = htmlBytes.length / pageSize + 1;
++ long /*int*/ current = ptr;
++ for (int i = 0; i < pageCount; i++) {
++ length = i == pageCount - 1 ? htmlBytes.length % pageSize : pageSize;
++ if (length > 0) {
++ rc = stream.AppendToStream (current, length);
++ if (rc != XPCOM.NS_OK) error (rc);
++ }
++ current += pageSize;
++ }
++ rc = stream.CloseStream ();
++ if (rc != XPCOM.NS_OK) error (rc);
++ C.free (ptr);
++ XPCOM.nsEmbedCString_delete (aContentType);
++ stream.Release ();
++ uri.Release ();
++ htmlBytes = null;
++
++ rc = webBrowser.GetContentDOMWindow (result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ boolean isTop = result[0] == domWindow.getAddress ();
++ new nsISupports (result[0]).Release ();
++ result[0] = 0;
++ rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
++ result[0] = 0;
++ hookDOMListeners (target, isTop);
++ target.Release ();
++ }
++ }
+ domWindow.Release ();
+
+ /*
+Index: Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+===================================================================
+RCS file: Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+diff -N Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ src/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java 1 Jan 1970 00:00:00 -0000
+@@ -0,0 +1,55 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by Netscape are Copyright (C) 1998-1999
++ * Netscape Communications Corporation. All Rights Reserved.
++ *
++ * Contributor(s):
++ *
++ * IBM
++ * - Binding to permit interfacing between Mozilla and SWT
++ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
++ *
++ * ***** END LICENSE BLOCK ***** */
++package org.eclipse.swt.internal.mozilla;
++
++public class nsIWebBrowserStream extends nsISupports {
++
++ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3;
++
++ public static final String NS_IWEBBROWSERSTREAM_IID_STR =
++ "86d02f0e-219b-4cfc-9c88-bd98d2cce0b8";
++
++ public static final nsID NS_IWEBBROWSERSTREAM_IID =
++ new nsID(NS_IWEBBROWSERSTREAM_IID_STR);
++
++ public nsIWebBrowserStream(long /*int*/ address) {
++ super(address);
++ }
++
++ public int OpenStream(long /*int*/ aBaseURI, long /*int*/ aContentType) {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aBaseURI, aContentType);
++ }
++
++ public int AppendToStream(long /*int*/ aData, int aLen) {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aData, aLen);
++ }
++
++ public int CloseStream() {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress());
++ }
++}
diff --git a/dev-java/swt/files/swt-3.4-xulrunner-1.9.1.patch b/dev-java/swt/files/swt-3.4-xulrunner-1.9.1.patch
new file mode 100644
index 000000000000..8e829943e325
--- /dev/null
+++ b/dev-java/swt/files/swt-3.4-xulrunner-1.9.1.patch
@@ -0,0 +1,325 @@
+# Patch by Grant Gayed
+# https://bugs.eclipse.org/bugs/show_bug.cgi?id=268651#c18
+# https://bugs.eclipse.org/bugs/attachment.cgi?id=130751
+Index: Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java
+===================================================================
+RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java,v
+retrieving revision 1.105.2.3
+diff -u -r1.105.2.3 Mozilla.java
+--- src/org/eclipse/swt/browser/Mozilla.java 21 Aug 2008 16:02:30 -00001.105.2.3
++++ src/org/eclipse/swt/browser/Mozilla.java 2 Apr 2009 19:15:06 -0000
+@@ -47,6 +47,7 @@
+ Shell tip = null;
+ Listener listener;
+ Vector unhookedDOMWindows = new Vector ();
++ byte[] htmlBytes;
+
+ static nsIAppShell AppShell;
+ static AppFileLocProvider LocationProvider;
+@@ -1130,21 +1131,21 @@
+ * Once the client does a proper navigate with either setUrl() or setText() then resume as
+ * normal. The Mozilla bug for this is https://bugzilla.mozilla.org/show_bug.cgi?id=415789.
+ */
+- awaitingNavigate = true;
+- rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
+- if (rc != XPCOM.NS_OK) {
+- browser.dispose ();
+- error (rc);
+- }
+- if (result[0] == 0) {
+- browser.dispose ();
+- error (XPCOM.NS_ERROR_NO_INTERFACE);
+- }
+- nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
+- char[] uri = new char[ABOUT_BLANK.length () + 1];
+- ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uri, 0);
+- rc = webNavigation.LoadURI (uri, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
+- webNavigation.Release ();
++// awaitingNavigate = true;
++// rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
++// if (rc != XPCOM.NS_OK) {
++// browser.dispose ();
++// error (rc);
++// }
++// if (result[0] == 0) {
++// browser.dispose ();
++// error (XPCOM.NS_ERROR_NO_INTERFACE);
++// }
++// nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
++// char[] uri = new char[ABOUT_BLANK.length () + 1];
++// ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uri, 0);
++// rc = webNavigation.LoadURI (uri, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
++// webNavigation.Release ();
+ }
+ }
+ result[0] = 0;
+@@ -1223,6 +1224,7 @@
+ }
+
+ public boolean back () {
++ htmlBytes = null;
+ if (awaitingNavigate) return false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1425,6 +1427,7 @@
+ }
+
+ public boolean forward () {
++ htmlBytes = null;
+ if (awaitingNavigate) return false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1635,6 +1638,7 @@
+ webBrowser.Release ();
+ webBrowser = null;
+ webBrowserObject = null;
++ htmlBytes = null;
+
+ if (tip != null && !tip.isDisposed ()) tip.dispose ();
+ tip = null;
+@@ -1696,6 +1700,7 @@
+ }
+
+ public void refresh () {
++ htmlBytes = null;
+ if (awaitingNavigate) return;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1817,11 +1822,45 @@
+ } else {
+ result[0] = 0;
+ rc = interfaceRequestor.GetInterface (nsIDocShell.NS_IDOCSHELL_IID, result);
+- if (rc != XPCOM.NS_OK) error (rc);
+- if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
+- nsIDocShell docShell = new nsIDocShell (result[0]);
+- rc = docShell.LoadStream (inputStream.getAddress (), uri.getAddress (), aContentType, aContentCharset, 0);
+- docShell.Release ();
++ if (rc == XPCOM.NS_OK) {
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIDocShell docShell = new nsIDocShell (result[0]);
++ rc = docShell.LoadStream (inputStream.getAddress (), uri.getAddress (), aContentType, aContentCharset, 0);
++ docShell.Release ();
++ } else {
++ result[0] = 0;
++ rc = webBrowser.QueryInterface (nsIWebBrowserStream.NS_IWEBBROWSERSTREAM_IID, result);
++ if (rc == XPCOM.NS_OK) {
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ /*
++ * Setting mozilla's content through nsIWebBrowserStream does not cause a page
++ * load to occur, so the events that usually accompany a page change are not
++ * fired. To make this behave as expected, navigate to about:blank first and
++ * then set the html content once the page has loaded.
++ */
++ new nsISupports (result[0]).Release ();
++ result[0] = 0;
++
++ /*
++ * If htmlBytes is not null then the about:blank page is already being loaded,
++ * so no Navigate is required. Just set the html that is to be shown.
++ */
++ boolean blankLoading = htmlBytes != null;
++ htmlBytes = data;
++ if (blankLoading) return true;
++
++ /* navigate to about:blank */
++ rc = webBrowser.QueryInterface (nsIWebNavigation.NS_IWEBNAVIGATION_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIWebNavigation webNavigation = new nsIWebNavigation (result[0]);
++ result[0] = 0;
++ char[] uriChars = new char[ABOUT_BLANK.length () + 1];
++ ABOUT_BLANK.getChars (0, ABOUT_BLANK.length (), uriChars, 0);
++ rc = webNavigation.LoadURI (uriChars, nsIWebNavigation.LOAD_FLAGS_NONE, 0, 0, 0);
++ webNavigation.Release ();
++ }
++ }
+ }
+ }
+ if (rc != XPCOM.NS_OK) error (rc);
+@@ -1836,6 +1875,7 @@
+ }
+
+ public boolean setUrl (String url) {
++ htmlBytes = null;
+ awaitingNavigate = false;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -1852,6 +1892,7 @@
+ }
+
+ public void stop () {
++ htmlBytes = null;
+ if (awaitingNavigate) return;
+
+ long /*int*/[] result = new long /*int*/[1];
+@@ -2174,6 +2215,108 @@
+ unhookedDOMWindows.remove (ptrObject);
+ new nsISupports (ptrObject.value).Release ();
+ }
++
++ /*
++ * If htmlBytes is not null then there is html from a previous setText() call
++ * waiting to be set into the about:blank page once it has completed loading.
++ */
++ if (htmlBytes != null) {
++ nsIRequest req = new nsIRequest (aRequest);
++ int /*long*/ name = XPCOM.nsEmbedCString_new ();
++ rc = req.GetName (name);
++ if (rc != XPCOM.NS_OK) error (rc);
++ int length = XPCOM.nsEmbedCString_Length (name);
++ int /*long*/ buffer = XPCOM.nsEmbedCString_get (name);
++ byte[] dest = new byte[length];
++ XPCOM.memmove (dest, buffer, length);
++ String url = new String (dest);
++ XPCOM.nsEmbedCString_delete (name);
++
++ if (url.startsWith (ABOUT_BLANK)) {
++ /*
++ * Setting mozilla's content with nsIWebBrowserStream invalidates the
++ * DOM listeners that were hooked on it (about:blank), so remove them and
++ * add new ones after the content has been set.
++ */
++ unhookDOMListeners ();
++
++ rc = XPCOM.NS_GetServiceManager (result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++
++ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
++ result[0] = 0;
++ rc = serviceManager.GetService (XPCOM.NS_IOSERVICE_CID, nsIIOService.NS_IIOSERVICE_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++ serviceManager.Release ();
++
++ nsIIOService ioService = new nsIIOService (result[0]);
++ result[0] = 0;
++ /*
++ * Note. Mozilla ignores LINK tags used to load CSS stylesheets
++ * when the URI protocol for the nsInputStreamChannel
++ * is about:blank. The fix is to specify the file protocol.
++ */
++ byte[] aString = MozillaDelegate.wcsToMbcs (null, URI_FROMMEMORY, false);
++ int /*long*/ aSpec = XPCOM.nsEmbedCString_new (aString, aString.length);
++ rc = ioService.NewURI (aSpec, null, 0, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++ XPCOM.nsEmbedCString_delete (aSpec);
++ ioService.Release ();
++
++ nsIURI uri = new nsIURI (result[0]);
++ result[0] = 0;
++
++ rc = webBrowser.QueryInterface (nsIWebBrowserStream.NS_IWEBBROWSERSTREAM_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
++
++ nsIWebBrowserStream stream = new nsIWebBrowserStream (result[0]);
++ result[0] = 0;
++
++ byte[] contentTypeBuffer = MozillaDelegate.wcsToMbcs (null, "text/html", true); // $NON-NLS-1$
++ int /*long*/ aContentType = XPCOM.nsEmbedCString_new (contentTypeBuffer, contentTypeBuffer.length);
++
++ rc = stream.OpenStream (uri.getAddress (), aContentType);
++ if (rc != XPCOM.NS_OK) error (rc);
++ int /*long*/ ptr = C.malloc (htmlBytes.length);
++ XPCOM.memmove (ptr, htmlBytes, htmlBytes.length);
++ int pageSize = 8192;
++ int pageCount = htmlBytes.length / pageSize + 1;
++ int /*long*/ current = ptr;
++ for (int i = 0; i < pageCount; i++) {
++ length = i == pageCount - 1 ? htmlBytes.length % pageSize : pageSize;
++ if (length > 0) {
++ rc = stream.AppendToStream (current, length);
++ if (rc != XPCOM.NS_OK) error (rc);
++ }
++ current += pageSize;
++ }
++ rc = stream.CloseStream ();
++ if (rc != XPCOM.NS_OK) error (rc);
++ C.free (ptr);
++ XPCOM.nsEmbedCString_delete (aContentType);
++ stream.Release ();
++ uri.Release ();
++ htmlBytes = null;
++
++ rc = webBrowser.GetContentDOMWindow (result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ boolean isTop = result[0] == domWindow.getAddress ();
++ new nsISupports (result[0]).Release ();
++ result[0] = 0;
++ rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
++ if (rc != XPCOM.NS_OK) error (rc);
++ if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
++ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
++ result[0] = 0;
++ hookDOMListeners (target, isTop);
++ target.Release ();
++ }
++ }
+ domWindow.Release ();
+
+ /*
+Index: Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+===================================================================
+RCS file: Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+diff -N Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ src/org/eclipse/swt/internal/mozilla/nsIWebBrowserStream.java 1 Jan 1970 00:00:00 -0000
+@@ -0,0 +1,55 @@
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by Netscape are Copyright (C) 1998-1999
++ * Netscape Communications Corporation. All Rights Reserved.
++ *
++ * Contributor(s):
++ *
++ * IBM
++ * - Binding to permit interfacing between Mozilla and SWT
++ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
++ *
++ * ***** END LICENSE BLOCK ***** */
++package org.eclipse.swt.internal.mozilla;
++
++public class nsIWebBrowserStream extends nsISupports {
++
++ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3;
++
++ public static final String NS_IWEBBROWSERSTREAM_IID_STR =
++ "86d02f0e-219b-4cfc-9c88-bd98d2cce0b8";
++
++ public static final nsID NS_IWEBBROWSERSTREAM_IID =
++ new nsID(NS_IWEBBROWSERSTREAM_IID_STR);
++
++ public nsIWebBrowserStream(int /*long*/ address) {
++ super(address);
++ }
++
++ public int OpenStream(int /*long*/ aBaseURI, int /*long*/ aContentType) {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aBaseURI, aContentType);
++ }
++
++ public int AppendToStream(int /*long*/ aData, int aLen) {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aData, aLen);
++ }
++
++ public int CloseStream() {
++ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress());
++ }
++}
diff --git a/dev-java/swt/files/swt-3.5-manifest b/dev-java/swt/files/swt-3.5-manifest
new file mode 100644
index 000000000000..70be33fb8ef8
--- /dev/null
+++ b/dev-java/swt/files/swt-3.5-manifest
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 3.5
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.mozilla; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
+
diff --git a/dev-java/swt/files/swt-3.6-manifest b/dev-java/swt/files/swt-3.6-manifest
new file mode 100644
index 000000000000..cf217b0d0602
--- /dev/null
+++ b/dev-java/swt/files/swt-3.6-manifest
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 3.6
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.mozilla; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
+
diff --git a/dev-java/swt/files/swt-3.7-manifest b/dev-java/swt/files/swt-3.7-manifest
new file mode 100644
index 000000000000..bddcbb48b041
--- /dev/null
+++ b/dev-java/swt/files/swt-3.7-manifest
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 3.7
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
+ org.eclipse.swt.internal.webkit; x-internal:=true
+
diff --git a/dev-java/swt/files/swt-3.7.2-gio_launch-URI-x86.patch b/dev-java/swt/files/swt-3.7.2-gio_launch-URI-x86.patch
new file mode 100644
index 000000000000..cab0e0cdb573
--- /dev/null
+++ b/dev-java/swt/files/swt-3.7.2-gio_launch-URI-x86.patch
@@ -0,0 +1,121 @@
+Program.launch will first attempt to open files using libgio and then fallback
+to gnome-vfs. gio_launch uses g_file_new_for_path which fails when passed a
+URI. If swt was built with USE="-gnome" then the fallback fails as well,
+making it appear that a package has a dependency on swt[gnome] when it does
+not.
+
+Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
+ no swt-gnome-gtk-3740 in java.library.path
+ no swt-gnome-gtk in java.library.path
+ Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gnome-gtk-3740.so
+ Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gnome-gtk.so
+
+Use g_file_new_for_commandline_arg instead.
+
+https://bugs.gentoo.org/424151
+
+
+--- a/os.c
++++ b/os.c
+@@ -3059,6 +3059,30 @@ fail:
+ }
+ #endif
+
++#ifndef NO__1g_1file_1new_1for_1commandline_1arg
++JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1commandline_1arg)
++ (JNIEnv *env, jclass that, jbyteArray arg0)
++{
++ jbyte *lparg0=NULL;
++ jintLong rc = 0;
++ OS_NATIVE_ENTER(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
++ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
++/*
++ rc = (jintLong)g_file_new_for_commandline_arg(lparg0);
++*/
++ {
++ LOAD_FUNCTION(fp, g_file_new_for_commandline_arg)
++ if (fp) {
++ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jbyte *))fp)(lparg0);
++ }
++ }
++fail:
++ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
++ OS_NATIVE_EXIT(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
++ return rc;
++}
++#endif
++
+ #ifndef NO__1g_1file_1new_1for_1path
+ JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1path)
+ (JNIEnv *env, jclass that, jbyteArray arg0)
+--- a/os_custom.h
++++ b/os_custom.h
+@@ -280,6 +280,7 @@
+ #define g_file_icon_get_file_LIB LIB_GIO
+ #define g_file_info_get_content_type_LIB LIB_GIO
+ #define g_file_info_get_modification_time_LIB LIB_GIO
++#define g_file_new_for_commandline_arg_LIB LIB_GIO
+ #define g_file_new_for_path_LIB LIB_GIO
+ #define g_file_new_for_uri_LIB LIB_GIO
+ #define g_file_read_LIB LIB_GIO
+--- a/os_stats.c
++++ b/os_stats.c
+@@ -18,8 +18,8 @@
+
+ #ifdef NATIVE_STATS
+
+-int OS_nativeFunctionCount = 1396;
+-int OS_nativeFunctionCallCount[1396];
++int OS_nativeFunctionCount = 1397;
++int OS_nativeFunctionCallCount[1397];
+ char * OS_nativeFunctionNames[] = {
+ #ifndef JNI64
+ "Call__IIII",
+@@ -250,6 +250,7 @@ char * OS_nativeFunctionNames[] = {
+ "_1g_1file_1icon_1get_1file",
+ "_1g_1file_1info_1get_1content_1type",
+ "_1g_1file_1info_1get_1modification_1time",
++ "_1g_1file_1new_1for_1commandline_1arg",
+ "_1g_1file_1new_1for_1path",
+ "_1g_1file_1new_1for_1uri",
+ "_1g_1file_1query_1info",
+--- a/os_stats.h
++++ b/os_stats.h
+@@ -258,6 +258,7 @@ typedef enum {
+ _1g_1file_1icon_1get_1file_FUNC,
+ _1g_1file_1info_1get_1content_1type_FUNC,
+ _1g_1file_1info_1get_1modification_1time_FUNC,
++ _1g_1file_1new_1for_1commandline_1arg_FUNC,
+ _1g_1file_1new_1for_1path_FUNC,
+ _1g_1file_1new_1for_1uri_FUNC,
+ _1g_1file_1query_1info_FUNC,
+--- a/src/org/eclipse/swt/internal/gtk/OS.java
++++ b/src/org/eclipse/swt/internal/gtk/OS.java
+@@ -2113,6 +2113,16 @@ public static final int /*long*/ g_file_new_for_path(byte[] fileName) {
+ }
+ }
+ /** @method flags=dynamic */
++public static final native int /*long*/ _g_file_new_for_commandline_arg(byte[] fileName);
++public static final int /*long*/ g_file_new_for_commandline_arg(byte[] fileName) {
++ lock.lock();
++ try {
++ return _g_file_new_for_commandline_arg(fileName);
++ } finally {
++ lock.unlock();
++ }
++}
++/** @method flags=dynamic */
+ public static final native int /*long*/ _g_file_new_for_uri(byte[] fileName);
+ public static final int /*long*/ g_file_new_for_uri(byte[] fileName) {
+ lock.lock();
+--- a/src/org/eclipse/swt/program/Program.java
++++ b/src/org/eclipse/swt/program/Program.java
+@@ -954,7 +954,7 @@ static boolean gio_isExecutable(String fileName) {
+ static boolean gio_launch(String fileName) {
+ boolean result = false;
+ byte[] fileNameBuffer = Converter.wcsToMbcs (null, fileName, true);
+- int /*long*/ file = OS.g_file_new_for_path (fileNameBuffer);
++ int /*long*/ file = OS.g_file_new_for_commandline_arg (fileNameBuffer);
+ if (file != 0) {
+ int /*long*/ uri = OS.g_file_get_uri (file);
+ if (uri != 0) {
diff --git a/dev-java/swt/files/swt-3.7.2-gio_launch-URI.patch b/dev-java/swt/files/swt-3.7.2-gio_launch-URI.patch
new file mode 100644
index 000000000000..bbb28573072b
--- /dev/null
+++ b/dev-java/swt/files/swt-3.7.2-gio_launch-URI.patch
@@ -0,0 +1,121 @@
+Program.launch will first attempt to open files using libgio and then fallback
+to gnome-vfs. gio_launch uses g_file_new_for_path which fails when passed a
+URI. If swt was built with USE="-gnome" then the fallback fails as well,
+making it appear that a package has a dependency on swt[gnome] when it does
+not.
+
+Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
+ no swt-gnome-gtk-3740 in java.library.path
+ no swt-gnome-gtk in java.library.path
+ Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gnome-gtk-3740.so
+ Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gnome-gtk.so
+
+Use g_file_new_for_commandline_arg instead.
+
+https://bugs.gentoo.org/424151
+
+
+--- a/os.c
++++ b/os.c
+@@ -3059,6 +3059,30 @@ fail:
+ }
+ #endif
+
++#ifndef NO__1g_1file_1new_1for_1commandline_1arg
++JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1commandline_1arg)
++ (JNIEnv *env, jclass that, jbyteArray arg0)
++{
++ jbyte *lparg0=NULL;
++ jintLong rc = 0;
++ OS_NATIVE_ENTER(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
++ if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
++/*
++ rc = (jintLong)g_file_new_for_commandline_arg(lparg0);
++*/
++ {
++ LOAD_FUNCTION(fp, g_file_new_for_commandline_arg)
++ if (fp) {
++ rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jbyte *))fp)(lparg0);
++ }
++ }
++fail:
++ if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
++ OS_NATIVE_EXIT(env, that, _1g_1file_1new_1for_1commandline_1arg_FUNC);
++ return rc;
++}
++#endif
++
+ #ifndef NO__1g_1file_1new_1for_1path
+ JNIEXPORT jintLong JNICALL OS_NATIVE(_1g_1file_1new_1for_1path)
+ (JNIEnv *env, jclass that, jbyteArray arg0)
+--- a/os_custom.h
++++ b/os_custom.h
+@@ -280,6 +280,7 @@
+ #define g_file_icon_get_file_LIB LIB_GIO
+ #define g_file_info_get_content_type_LIB LIB_GIO
+ #define g_file_info_get_modification_time_LIB LIB_GIO
++#define g_file_new_for_commandline_arg_LIB LIB_GIO
+ #define g_file_new_for_path_LIB LIB_GIO
+ #define g_file_new_for_uri_LIB LIB_GIO
+ #define g_file_read_LIB LIB_GIO
+--- a/os_stats.c
++++ b/os_stats.c
+@@ -18,8 +18,8 @@
+
+ #ifdef NATIVE_STATS
+
+-int OS_nativeFunctionCount = 1396;
+-int OS_nativeFunctionCallCount[1396];
++int OS_nativeFunctionCount = 1397;
++int OS_nativeFunctionCallCount[1397];
+ char * OS_nativeFunctionNames[] = {
+ #ifndef JNI64
+ "Call__IIII",
+@@ -250,6 +250,7 @@ char * OS_nativeFunctionNames[] = {
+ "_1g_1file_1icon_1get_1file",
+ "_1g_1file_1info_1get_1content_1type",
+ "_1g_1file_1info_1get_1modification_1time",
++ "_1g_1file_1new_1for_1commandline_1arg",
+ "_1g_1file_1new_1for_1path",
+ "_1g_1file_1new_1for_1uri",
+ "_1g_1file_1query_1info",
+--- a/os_stats.h
++++ b/os_stats.h
+@@ -258,6 +258,7 @@ typedef enum {
+ _1g_1file_1icon_1get_1file_FUNC,
+ _1g_1file_1info_1get_1content_1type_FUNC,
+ _1g_1file_1info_1get_1modification_1time_FUNC,
++ _1g_1file_1new_1for_1commandline_1arg_FUNC,
+ _1g_1file_1new_1for_1path_FUNC,
+ _1g_1file_1new_1for_1uri_FUNC,
+ _1g_1file_1query_1info_FUNC,
+--- a/src/org/eclipse/swt/internal/gtk/OS.java
++++ b/src/org/eclipse/swt/internal/gtk/OS.java
+@@ -2113,6 +2113,16 @@ public static final long /*int*/ g_file_new_for_path(byte[] fileName) {
+ }
+ }
+ /** @method flags=dynamic */
++public static final native long /*int*/ _g_file_new_for_commandline_arg(byte[] fileName);
++public static final long /*int*/ g_file_new_for_commandline_arg(byte[] fileName) {
++ lock.lock();
++ try {
++ return _g_file_new_for_commandline_arg(fileName);
++ } finally {
++ lock.unlock();
++ }
++}
++/** @method flags=dynamic */
+ public static final native long /*int*/ _g_file_new_for_uri(byte[] fileName);
+ public static final long /*int*/ g_file_new_for_uri(byte[] fileName) {
+ lock.lock();
+--- a/src/org/eclipse/swt/program/Program.java
++++ b/src/org/eclipse/swt/program/Program.java
+@@ -954,7 +954,7 @@ static boolean gio_isExecutable(String fileName) {
+ static boolean gio_launch(String fileName) {
+ boolean result = false;
+ byte[] fileNameBuffer = Converter.wcsToMbcs (null, fileName, true);
+- long /*int*/ file = OS.g_file_new_for_path (fileNameBuffer);
++ long /*int*/ file = OS.g_file_new_for_commandline_arg (fileNameBuffer);
+ if (file != 0) {
+ long /*int*/ uri = OS.g_file_get_uri (file);
+ if (uri != 0) {
diff --git a/dev-java/swt/files/swt-3.8-as-needed-and-flag-fixes.patch b/dev-java/swt/files/swt-3.8-as-needed-and-flag-fixes.patch
new file mode 100644
index 000000000000..ce5c54e408e2
--- /dev/null
+++ b/dev-java/swt/files/swt-3.8-as-needed-and-flag-fixes.patch
@@ -0,0 +1,243 @@
+--- a/make_freebsd.mak
++++ b/make_freebsd.mak
+@@ -64,7 +64,7 @@ GLXLIBS = -L/usr/X11R6/lib -lGL -lGLU -lm
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -91,7 +91,7 @@ XULRUNNER_OBJECTS = swt.o xpcomxul.o xpcomxul_custom.o xpcomxul_structs.o xpcomx
+ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DFREEBSD -DGTK \
+@@ -115,13 +115,13 @@ all: make_swt make_atk make_gnome make_glx
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -140,7 +140,7 @@ os_stats.o: os_stats.c os_structs.h os.h os_stats.h swt.h
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -156,7 +156,7 @@ cairo_stats.o: cairo_stats.c cairo_structs.h cairo.h cairo_stats.h swt.h
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -164,7 +164,7 @@ $(CDE_LIB): $(CDE_OBJECTS)
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -172,7 +172,7 @@ $(AWT_LIB): $(AWT_OBJECTS)
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -189,7 +189,7 @@ atk_stats.o: atk_stats.c atk_structs.h atk_stats.h atk.h
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -206,7 +206,7 @@ gnome_stats.o: gnome_stats.c gnome_stats.h
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -226,7 +226,7 @@ xpcom_stats.o: xpcom_stats.cpp
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -252,7 +252,7 @@ xpcomxulglue_stats.o: xpcomglue_stats.cpp
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -269,7 +269,7 @@ xpcominit_stats.o: xpcominit_stats.cpp
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
+--- a/make_linux.mak
++++ b/make_linux.mak
+@@ -66,7 +66,7 @@ GLXLIBS = -lGL -lGLU -lm
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS = $(CXXFLAGS) \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -106,7 +106,7 @@ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ WEBKIT_OBJECTS = swt.o webkit.o webkit_structs.o webkit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DLINUX -DGTK \
+@@ -130,13 +130,13 @@ all: make_swt make_atk make_glx make_webkit
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -155,7 +155,7 @@ os_stats.o: os_stats.c os_structs.h os.h os_stats.h swt.h
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -171,7 +171,7 @@ cairo_stats.o: cairo_stats.c cairo_structs.h cairo.h cairo_stats.h swt.h
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -179,7 +179,7 @@ $(CDE_LIB): $(CDE_OBJECTS)
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -187,7 +187,7 @@ $(AWT_LIB): $(AWT_OBJECTS)
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -204,7 +204,7 @@ atk_stats.o: atk_stats.c atk_structs.h atk_stats.h atk.h
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -221,7 +221,7 @@ gnome_stats.o: gnome_stats.c gnome_stats.h
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -242,7 +242,7 @@ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+ echo -e "#include<stdlib.h>\nsize_t je_malloc_usable_size_in_advance(size_t n) {\nreturn n;\n}" | gcc --shared -xc - -o libswt-xulrunner-fix.so
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -262,7 +262,7 @@ xpcomxul_stats.o: xpcom_stats.cpp
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -279,7 +279,7 @@ xpcominit_stats.o: xpcominit_stats.cpp
+ make_webkit: $(WEBKIT_LIB)
+
+ $(WEBKIT_LIB): $(WEBKIT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS)
+
+ webkit.o: webkitgtk.c
+ $(CC) $(CFLAGS) $(WEBKITCFLAGS) -c webkitgtk.c -o webkit.o
+@@ -296,7 +296,7 @@ webkit_stats.o: webkitgtk_stats.c webkitgtk_stats.h
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
diff --git a/dev-java/swt/files/swt-3.8-manifest b/dev-java/swt/files/swt-3.8-manifest
new file mode 100644
index 000000000000..ee9e31c373d6
--- /dev/null
+++ b/dev-java/swt/files/swt-3.8-manifest
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version="[3.0.0,4.0.0)"
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 3.8
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
+ org.eclipse.swt.internal.webkit; x-internal:=true
+
diff --git a/dev-java/swt/files/swt-3.8.2-gthread.patch b/dev-java/swt/files/swt-3.8.2-gthread.patch
new file mode 100644
index 000000000000..6f99a59382ba
--- /dev/null
+++ b/dev-java/swt/files/swt-3.8.2-gthread.patch
@@ -0,0 +1,44 @@
+From c973b9b9be568ebbce618985bc5ee440babf8ab1 Mon Sep 17 00:00:00 2001
+From: Jakub Adam <jakub.adam@ktknet.cz>
+Date: Thu, 27 Jun 2013 10:16:49 +0200
+Subject: [PATCH 1/2] fix-glib-2.35-compatibility
+
+g_thread_init() and g_thread_supported() are deprecated and don't
+have to be used anymore.
+
+---
+ os.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/os.c
++++ b/os.c
+@@ -4444,9 +4444,9 @@ fail:
+ JNIEXPORT void JNICALL OS_NATIVE(_1g_1thread_1init)
+ (JNIEnv *env, jclass that, jintLong arg0)
+ {
+- OS_NATIVE_ENTER(env, that, _1g_1thread_1init_FUNC);
++ /*OS_NATIVE_ENTER(env, that, _1g_1thread_1init_FUNC);
+ g_thread_init((GThreadFunctions *)arg0);
+- OS_NATIVE_EXIT(env, that, _1g_1thread_1init_FUNC);
++ OS_NATIVE_EXIT(env, that, _1g_1thread_1init_FUNC);*/
+ }
+ #endif
+
+@@ -4454,11 +4454,12 @@ JNIEXPORT void JNICALL OS_NATIVE(_1g_1thread_1init)
+ JNIEXPORT jboolean JNICALL OS_NATIVE(_1g_1thread_1supported)
+ (JNIEnv *env, jclass that)
+ {
+- jboolean rc = 0;
++ /*jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, _1g_1thread_1supported_FUNC);
+ rc = (jboolean)g_thread_supported();
+ OS_NATIVE_EXIT(env, that, _1g_1thread_1supported_FUNC);
+- return rc;
++ return rc;*/
++ return 1;
+ }
+ #endif
+
+--
+1.7.10.4
+
diff --git a/dev-java/swt/files/swt-4.2-as-needed-and-flag-fixes.patch b/dev-java/swt/files/swt-4.2-as-needed-and-flag-fixes.patch
new file mode 100644
index 000000000000..98773c155697
--- /dev/null
+++ b/dev-java/swt/files/swt-4.2-as-needed-and-flag-fixes.patch
@@ -0,0 +1,243 @@
+--- make_linux.mak- 2012-07-02 00:49:48.729100052 +0000
++++ make_linux.mak 2012-07-02 00:53:16.753499389 +0000
+@@ -66,7 +66,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS = $(CXXFLAGS) \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -106,7 +106,7 @@
+ WEBKIT_OBJECTS = swt.o webkit.o webkit_structs.o webkit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DLINUX -DGTK \
+@@ -130,13 +130,13 @@
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -155,7 +155,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -171,7 +171,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -179,7 +179,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -187,7 +187,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -204,7 +204,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -221,7 +221,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) $(MOZILLAEXCLUDES) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -242,7 +242,7 @@
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+ echo -e "#include<stdlib.h>\nsize_t je_malloc_usable_size_in_advance(size_t n) {\nreturn n;\n}" | gcc --shared -xc - -o libswt-xulrunner-fix.so
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) $(XULRUNNEREXCLUDES) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -262,7 +262,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -279,7 +279,7 @@
+ make_webkit: $(WEBKIT_LIB)
+
+ $(WEBKIT_LIB): $(WEBKIT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS)
+
+ webkit.o: webkitgtk.c
+ $(CC) $(CFLAGS) $(WEBKITCFLAGS) -c webkitgtk.c -o webkit.o
+@@ -296,7 +296,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
+--- make_freebsd.mak- 2012-07-02 00:53:28.553351871 +0000
++++ make_freebsd.mak 2012-07-02 00:55:37.369741444 +0000
+@@ -64,7 +64,7 @@
+ # Uncomment for Native Stats tool
+ #NATIVE_STATS = -DNATIVE_STATS
+
+-MOZILLACFLAGS = -O \
++MOZILLACFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DMOZILLA_STRICT_API=1 \
+@@ -91,7 +91,7 @@
+ XPCOMINIT_OBJECTS = swt.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS = -O -Wall \
++CFLAGS += \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ -DFREEBSD -DGTK \
+@@ -115,13 +115,13 @@
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -140,7 +140,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -156,7 +156,7 @@
+ make_cde: $(CDE_LIB)
+
+ $(CDE_LIB): $(CDE_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CDE_LIB) $(CDE_OBJECTS) $(CDE_LIBS)
+
+ #
+ # AWT lib
+@@ -164,7 +164,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -172,7 +172,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -189,7 +189,7 @@
+ make_gnome: $(GNOME_LIB)
+
+ $(GNOME_LIB): $(GNOME_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GNOME_LIB) $(GNOME_OBJECTS) $(GNOMELIBS)
+
+ gnome.o: gnome.c
+ $(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome.c
+@@ -206,7 +206,7 @@
+ make_mozilla:$(MOZILLA_LIB)
+
+ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
+- $(CXX) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
++ $(CXX) $(LDFLAGS) -o $(MOZILLA_LIB) $(MOZILLA_OBJECTS) $(MOZILLALFLAGS) ${MOZILLA_LIBS}
+
+ xpcom.o: xpcom.cpp
+ $(CXX) $(MOZILLACFLAGS) ${MOZILLA_INCLUDES} -c xpcom.cpp
+@@ -226,7 +226,7 @@
+ make_xulrunner:$(XULRUNNER_LIB)
+
+ $(XULRUNNER_LIB): $(XULRUNNER_OBJECTS)
+- $(CXX) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XULRUNNER_LIB) $(XULRUNNER_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcomxul.o: xpcom.cpp
+ $(CXX) -o xpcomxul.o $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcom.cpp
+@@ -252,7 +252,7 @@
+ make_xpcominit:$(XPCOMINIT_LIB)
+
+ $(XPCOMINIT_LIB): $(XPCOMINIT_OBJECTS)
+- $(CXX) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
++ $(CXX) $(LDFLAGS) -o $(XPCOMINIT_LIB) $(XPCOMINIT_OBJECTS) $(MOZILLALFLAGS) ${XULRUNNER_LIBS}
+
+ xpcominit.o: xpcominit.cpp
+ $(CXX) $(MOZILLACFLAGS) ${XULRUNNER_INCLUDES} -c xpcominit.cpp
+@@ -269,7 +269,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
diff --git a/dev-java/swt/files/swt-4.2-manifest b/dev-java/swt/files/swt-4.2-manifest
new file mode 100644
index 000000000000..36736a0db72d
--- /dev/null
+++ b/dev-java/swt/files/swt-4.2-manifest
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Fragment-Host: org.eclipse.swt; bundle-version=4.2.0
+Bundle-SymbolicName: org.eclipse.swt.gtk.linux.SWT_ARCH; singleton:=true
+Bundle-Version: 4.2
+Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=SWT_ARCH))
+Export-Package: org.eclipse.swt.internal.accessibility.gtk; x-internal:=true,
+ org.eclipse.swt.internal.cairo; x-internal:=true,
+ org.eclipse.swt.internal.cde; x-internal:=true,
+ org.eclipse.swt.internal.gnome; x-internal:=true,
+ org.eclipse.swt.internal.gtk; x-internal:=true,
+ org.eclipse.swt.internal.opengl.glx; x-internal:=true
+ org.eclipse.swt.internal.webkit; x-internal:=true
diff --git a/dev-java/swt/metadata.xml b/dev-java/swt/metadata.xml
new file mode 100644
index 000000000000..2e5728b03433
--- /dev/null
+++ b/dev-java/swt/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <longdescription>
+ SWT is the software component that delivers native widget functionality for the
+ Eclipse platform in an operating system independent manner. It is analogous to
+ AWT/Swing in Java with a difference - SWT uses a rich set of native widgets.
+ </longdescription>
+ <use>
+ <flag name="webkit">Embedded browser support via net-libs/webkit-gtk:2, replacing former xulrunner-based browser.</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-java/swt/swt-3.5.2.ebuild b/dev-java/swt/swt-3.5.2.ebuild
new file mode 100644
index 000000000000..514c9cb42d26
--- /dev/null
+++ b/dev-java/swt/swt-3.5.2.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="download.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201002111343"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )"
+
+SLOT="3.5"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 ppc ppc64 x86"
+
+IUSE="cairo gnome opengl"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/libgnome-2*
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ x11-libs/libXtst"
+
+# Use a blocker to avoid file collisions when upgrading to the slotted version
+# We cannot use slotmove, java packages are expected to be in /usr/share/PN-SLOT
+# so this is the only way to prevent collisions
+# libXtst/xextproto is done like this due to the XTest.h move - bug #292244
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1 )
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/as-needed-and-flag-fixes.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt || die "Failed to build AWT support"
+
+ einfo "Building SWT library"
+ ${make} make_swt || die "Failed to build SWT support"
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk || die "Failed to build ATK support"
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome || die "Failed to build GNOME VFS support"
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo || die "Unable to build CAIRO support"
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx || die "Unable to build OpenGL component"
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/"
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-3.5-manifest" > "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}
diff --git a/dev-java/swt/swt-3.6.1.ebuild b/dev-java/swt/swt-3.6.1.ebuild
new file mode 100644
index 000000000000..a33ea996fc0e
--- /dev/null
+++ b/dev-java/swt/swt-3.6.1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="download.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201009090800"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )"
+
+SLOT="3.6"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 ppc ppc64 x86"
+
+IUSE="cairo gnome opengl"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/libgnome-2*
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ x11-libs/libXtst"
+
+# Use a blocker to avoid file collisions when upgrading to the slotted version
+# We cannot use slotmove, java packages are expected to be in /usr/share/PN-SLOT
+# so this is the only way to prevent collisions
+# libXtst/xextproto is done like this due to the XTest.h move - bug #292244
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1 )
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/as-needed-and-flag-fixes-3.6.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt || die "Failed to build AWT support"
+
+ einfo "Building SWT library"
+ ${make} make_swt || die "Failed to build SWT support"
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk || die "Failed to build ATK support"
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome || die "Failed to build GNOME VFS support"
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo || die "Unable to build CAIRO support"
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx || die "Unable to build OpenGL component"
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/"
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}
diff --git a/dev-java/swt/swt-3.7.1.ebuild b/dev-java/swt/swt-3.7.1.ebuild
new file mode 100644
index 000000000000..e22a743f051f
--- /dev/null
+++ b/dev-java/swt/swt-3.7.1.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="download.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201109091335"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip
+ )"
+
+SLOT="3.7"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+IUSE="cairo gnome opengl webkit"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/libgnome-2*
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )
+ x11-libs/libXtst"
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/as-needed-and-flag-fixes-3.6.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}
diff --git a/dev-java/swt/swt-3.7.2-r1.ebuild b/dev-java/swt/swt-3.7.2-r1.ebuild
new file mode 100644
index 000000000000..2420d40ef318
--- /dev/null
+++ b/dev-java/swt/swt-3.7.2-r1.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="download.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201202080800"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip
+ )"
+
+SLOT="3.7"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 ppc ppc64 x86"
+
+IUSE="cairo gnome opengl webkit"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/libgnome-2*
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )
+ x11-libs/libXtst"
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/as-needed-and-flag-fixes-3.6.patch
+
+ case ${ARCH} in
+ ppc|x86) epatch "${FILESDIR}"/${P}-gio_launch-URI-x86.patch ;;
+ *) epatch "${FILESDIR}"/${P}-gio_launch-URI.patch ;;
+ esac
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}
diff --git a/dev-java/swt/swt-3.7.2.ebuild b/dev-java/swt/swt-3.7.2.ebuild
new file mode 100644
index 000000000000..821781c78476
--- /dev/null
+++ b/dev-java/swt/swt-3.7.2.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="download.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201202080800"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip
+ )"
+
+SLOT="3.7"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 ~ppc ~ppc64 x86"
+
+IUSE="cairo gnome opengl webkit"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/libgnome-2*
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )
+ x11-libs/libXtst"
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/as-needed-and-flag-fixes-3.6.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}
diff --git a/dev-java/swt/swt-3.8.2.ebuild b/dev-java/swt/swt-3.8.2.ebuild
new file mode 100644
index 000000000000..b1c1e3b93704
--- /dev/null
+++ b/dev-java/swt/swt-3.8.2.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="archive.eclipse.org/eclipse/downloads/drops/R-${MY_PV}-201301310800"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="x86? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ x86-fbsd? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ amd64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip
+ )
+ ppc? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-x86.zip
+ )
+ ppc64? (
+ http://${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip
+ )"
+
+SLOT="3.8"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+IUSE="cairo gnome opengl webkit"
+COMMON=">=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ >=dev-libs/atk-1.10.2
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ gnome-base/gnome-vfs:2
+ gnome-base/libgnome
+ gnome-base/libgnomeui
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )
+ x11-libs/libXtst"
+
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto
+ virtual/pkgconfig
+ ${COMMON}"
+
+RDEPEND=">=virtual/jre-1.4
+ ${COMMON}"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+
+ mkdir -p "${S}/src"
+ mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ epatch "${FILESDIR}"/${PN}-3.8-as-needed-and-flag-fixes.patch
+ epatch "${FILESDIR}"/${P}-gthread.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt" || die
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html
+}
diff --git a/dev-java/swt/swt-4.2-r1.ebuild b/dev-java/swt/swt-4.2-r1.ebuild
new file mode 100644
index 000000000000..aa7dcc5689c3
--- /dev/null
+++ b/dev-java/swt/swt-4.2-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="http://archive.eclipse.org/eclipse/downloads/drops4/R-${MY_PV}-201206081400"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="
+ amd64? ( ${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip )
+ ppc? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ ppc64? ( ${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip )
+ x86? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ x86-fbsd? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )"
+
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+SLOT="4.2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="cairo gnome opengl webkit"
+
+COMMON_DEP="
+ >=dev-libs/atk-1.10.2
+ >=dev-libs/glib-2.32
+ >=x11-libs/gtk+-2.6.8:2
+ x11-libs/libXtst
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnome-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-1.4
+ app-arch/unzip
+ virtual/pkgconfig
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto"
+RDEPEND="${COMMON_DEP}
+ >=virtual/jre-1.4"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/${P}-as-needed-and-flag-fixes.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ # Bug #461784, g_thread_init is deprecated since glib-2.32.
+ append-cflags -DNO__1g_1thread_1init
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html
+}
diff --git a/dev-java/swt/swt-4.2-r2.ebuild b/dev-java/swt/swt-4.2-r2.ebuild
new file mode 100644
index 000000000000..55e353073408
--- /dev/null
+++ b/dev-java/swt/swt-4.2-r2.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="http://archive.eclipse.org/eclipse/downloads/drops4/R-${MY_PV}-201206081400"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="
+ amd64? ( ${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip )
+ ppc? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ ppc64? ( ${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip )
+ x86? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ x86-fbsd? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )"
+
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+SLOT="4.2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="cairo gnome opengl webkit"
+
+COMMON_DEP="
+ >=dev-libs/atk-1.10.2
+ >=dev-libs/glib-2.32
+ >=x11-libs/gtk+-2.6.8:2
+ x11-libs/libXtst
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnome-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-1.4
+ app-arch/unzip
+ virtual/pkgconfig
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto"
+RDEPEND="${COMMON_DEP}
+ >=virtual/jre-1.4"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/${P}-as-needed-and-flag-fixes.patch
+
+ # Define missing g_thread_supported() to be 0.
+ sed -i '1s/^/#define g_thread_supported() 0\n\n/' "${S}"/os_custom.h || die
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ # Bug #461784, g_thread_init is deprecated since glib-2.32.
+ append-cflags -DNO__1g_1thread_1init
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html
+}
diff --git a/dev-java/swt/swt-4.2.ebuild b/dev-java/swt/swt-4.2.ebuild
new file mode 100644
index 000000000000..6beffaddcc84
--- /dev/null
+++ b/dev-java/swt/swt-4.2.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils java-pkg-2 java-ant-2 toolchain-funcs java-osgi
+
+MY_PV="${PV/_rc/RC}"
+MY_DMF="http://archive.eclipse.org/eclipse/downloads/drops4/R-${MY_PV}-201206081400"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="GTK based SWT Library"
+HOMEPAGE="http://www.eclipse.org/"
+SRC_URI="
+ amd64? ( ${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip )
+ ppc? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ ppc64? ( ${MY_DMF}/${MY_P}-gtk-linux-ppc64.zip )
+ x86? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ x86-fbsd? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )"
+
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+SLOT="4.2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="cairo gnome opengl webkit"
+
+COMMON_DEP="
+ >=dev-libs/atk-1.10.2
+ >=dev-libs/glib-2.6
+ >=x11-libs/gtk+-2.6.8:2
+ x11-libs/libXtst
+ cairo? ( >=x11-libs/cairo-1.4.14 )
+ gnome? (
+ =gnome-base/gnome-vfs-2*
+ =gnome-base/libgnome-2*
+ =gnome-base/libgnomeui-2*
+ )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ webkit? ( >=net-libs/webkit-gtk-1.2:2 )"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-1.4
+ app-arch/unzip
+ virtual/pkgconfig
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/libXtst-1.1.0
+ x11-proto/inputproto"
+RDEPEND="${COMMON_DEP}
+ >=virtual/jre-1.4"
+
+S="${WORKDIR}"
+
+# JNI libraries don't need SONAME, bug #253756
+QA_SONAME="usr/$(get_libdir)/libswt-.*.so"
+
+src_unpack() {
+ local DISTFILE=${A}
+ unzip -jq "${DISTDIR}"/${DISTFILE} "*src.zip" || die "Unable to extract distfile"
+ unpack "./src.zip"
+
+ # Cleanup the redirtied directory structure
+ rm -rf about_files/ || die
+}
+
+java_prepare() {
+ # Replace the build.xml to allow compilation without Eclipse tasks
+ cp "${FILESDIR}/build.xml" "${S}/build.xml" || die "Unable to update build.xml"
+ mkdir "${S}/src" && mv "${S}/org" "${S}/src" || die "Unable to restructure SWT sources"
+
+ # Fix Makefiles to respect flags and work with --as-needed
+ epatch "${FILESDIR}"/${P}-as-needed-and-flag-fixes.patch
+}
+
+src_compile() {
+ # Drop jikes support as it seems to be unfriendly with SWT
+ java-pkg_filter-compiler jikes
+
+ local AWT_ARCH
+ local JAWTSO="libjawt.so"
+ if [[ $(tc-arch) == 'x86' ]] ; then
+ AWT_ARCH="i386"
+ elif [[ $(tc-arch) == 'ppc' ]] ; then
+ AWT_ARCH="ppc"
+ elif [[ $(tc-arch) == 'ppc64' ]] ; then
+ AWT_ARCH="ppc64"
+ else
+ AWT_ARCH="amd64"
+ fi
+ if [[ -f "${JAVA_HOME}/jre/lib/${AWT_ARCH}/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/lib/${AWT_ARCH}"
+ elif [[ -f "${JAVA_HOME}/jre/bin/${JAWTSO}" ]]; then
+ export AWT_LIB_PATH="${JAVA_HOME}/jre/bin"
+ elif [[ -f "${JAVA_HOME}/$(get_libdir)/${JAWTSO}" ]] ; then
+ export AWT_LIB_PATH="${JAVA_HOME}/$(get_libdir)"
+ else
+ eerror "${JAWTSO} not found in the JDK being used for compilation!"
+ die "cannot build AWT library"
+ fi
+
+ # Fix the pointer size for AMD64
+ [[ ${ARCH} == "amd64" || ${ARCH} == "ppc64" ]] && export SWT_PTR_CFLAGS=-DJNI64
+
+ local platform="linux"
+
+ use elibc_FreeBSD && platform="freebsd"
+
+ local make="emake -f make_${platform}.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)"
+
+ einfo "Building AWT library"
+ ${make} make_awt
+
+ einfo "Building SWT library"
+ ${make} make_swt
+
+ einfo "Building JAVA-AT-SPI bridge"
+ ${make} make_atk
+
+ if use gnome ; then
+ einfo "Building GNOME VFS support"
+ ${make} make_gnome
+ fi
+
+ if use cairo ; then
+ einfo "Building CAIRO support"
+ ${make} make_cairo
+ fi
+
+ if use opengl ; then
+ einfo "Building OpenGL component"
+ ${make} make_glx
+ fi
+
+ if use webkit ; then
+ einfo "Building the WebKitGTK+ component"
+
+ ${make} make_webkit
+ fi
+
+ einfo "Building JNI libraries"
+ eant compile
+
+ einfo "Copying missing files"
+ cp -i "${S}/version.txt" "${S}/build/version.txt"
+ cp -i "${S}/src/org/eclipse/swt/internal/SWTMessages.properties" \
+ "${S}/build/org/eclipse/swt/internal/" || die
+
+ einfo "Packing JNI libraries"
+ eant jar
+}
+
+src_install() {
+ swtArch=${ARCH}
+ use amd64 && swtArch=x86_64
+ use x86-fbsd && swtArch=x86
+
+ sed "s/SWT_ARCH/${swtArch}/" "${FILESDIR}/${PN}-${SLOT}-manifest" > "MANIFEST_TMP.MF" || die
+ use cairo || sed -i -e "/ org.eclipse.swt.internal.cairo; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use gnome || sed -i -e "/ org.eclipse.swt.internal.gnome; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use opengl || sed -i -e "/ org.eclipse.swt.internal.opengl.glx; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ use webkit || sed -i -e "/ org.eclipse.swt.internal.webkit; x-internal:=true,/d" "MANIFEST_TMP.MF"
+ java-osgi_newjar-fromfile "swt.jar" "MANIFEST_TMP.MF" "Standard Widget Toolkit for GTK 2.0"
+
+ java-pkg_sointo /usr/$(get_libdir)
+ java-pkg_doso *.so
+
+ dohtml about.html || die
+}