summaryrefslogtreecommitdiff
path: root/dev-java/swt
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/swt')
-rw-r--r--dev-java/swt/Manifest32
-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.5-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-3.8.2-libwebkit-compat.patch23
-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.xml16
-rw-r--r--dev-java/swt/swt-3.5.2.ebuild165
-rw-r--r--dev-java/swt/swt-3.7.2-r1.ebuild176
-rw-r--r--dev-java/swt/swt-3.8.2-r1.ebuild174
-rw-r--r--dev-java/swt/swt-4.2-r2.ebuild176
19 files changed, 2099 insertions, 0 deletions
diff --git a/dev-java/swt/Manifest b/dev-java/swt/Manifest
new file mode 100644
index 000000000000..392d44bda527
--- /dev/null
+++ b/dev-java/swt/Manifest
@@ -0,0 +1,32 @@
+AUX as-needed-and-flag-fixes-3.6.patch 7755 SHA256 4a33ab3b2f617d137977562b096c64a37600e48ceaee5e1f94f4c912efdcaaa3 SHA512 9c2061b82d0a9a10fc99500ea27192cbf74001ab48254f528f00c15ca28e56de697c3861975691d0f8e4d6079a77236a8389ba07612c98031297e3289f4bf083 WHIRLPOOL 05cc1a58c1647dba3f3b6985ffd503f8b2af74fd6e07d6ee76afcb7d16b8279dcd9a89097c4c70f1f1569065a62ca1255c551b371c74d0f095f60eac98cf8a7c
+AUX as-needed-and-flag-fixes.patch 7229 SHA256 016a810cc9649235fcab73467a056240b712d5557663b7756d4de64c939256ee SHA512 1c4d217965bd8ee9a293095dcf8abca399277a103e523610340a6f3cc25291cc53c2e89b9fed396298e5f9e7b78221df5c4bc881d65713058f029810799f8010 WHIRLPOOL c2abc3a0dfb593f8f3ab2d2f2427cc6c817367ec0c73108dff238e1110bde39c6d98b5e0adeede7d89c9296f227970db17e23893318b60f2becfb352837a69ef
+AUX build.xml 458 SHA256 bbac0fb3bf9454b81e6d27dae4ebb9538cf62f2be17adcf169538749230dc8e7 SHA512 49f3a4cc04d4d9cf0609aa97e01fa409a8f2dbb953ab3a52bc9984799d0bf4092d2a63fe665d8ba6ca0428089984b6ef47bc78900c613373ca1a7b588f6c5525 WHIRLPOOL e70d35ed0834e72c83818e346e4c40af55059de096fb6ef4c4f4927f13886e88925b9caa538306aa1ec9ece966f28782282139a60f2dbefc4aec53a0401db9a9
+AUX swt-3.5-manifest 752 SHA256 8ad9d69aa58e533cc03b9ccf3d8e0356505c357aaeb14968bf146f94d8b79be9 SHA512 7021ce5766ff50b999ad3474de00a2f19490e5eaef1f811b95d3cf01a43467de3e8e4913b668d019d59513ca54a159b50fd0bda427c4efcb3fddc522fa2925a6 WHIRLPOOL 09ba77a4ef824120624b9d6122a9eb6a39004e643b7e95f5a7f0f3e934a985f1cef86c838f5663ae4f3149f1953ceee0231e0d86ae7c3b9ab47a62ddee9a16ec
+AUX swt-3.7-manifest 750 SHA256 4c911bfa6f4def901570ca715da547c1d13766915f3244e5d6282bee8be6564f SHA512 e4f6aa5ce58cdc697c234a2a4be43de0510d3c082a2737627a35df74d378a50edc0f7d3e62221f402eed602fcdc50fa7eff969b12602189fd400e1f1580f0d8f WHIRLPOOL b84f61067d00c864f1029718b560a33fd04d76e6cae8f5aa5e5aa0da31af752494277d759d909dc4a78f5412e963c21c95125ae01ac405fd72c7a8223032f558
+AUX swt-3.7.2-gio_launch-URI-x86.patch 4287 SHA256 6108e54fe7179fbace74f29b11270516befc172ec51197da46f32241085ddd08 SHA512 c82364b7e7bc255ed592a254201346a4159789ddbf486f22c026fdefce3f0d26bc91b42535228050eee4ec9b4e7a840008b60b2c7cb98896d6b8f1d875b5bef7 WHIRLPOOL 97bf19eca86604904408e82708a602af3d653840b7f1cdca8b9959197a3454f93272f80a5c7af7f9caa42e220663741f596c5beb3cb07c363b0f2389214c264e
+AUX swt-3.7.2-gio_launch-URI.patch 4287 SHA256 9d6ab97a06c190d1229168fb85dc10577c19b9d88ce6ae216eb8d1b803ae0752 SHA512 4954c7464bb2ab7b9c23fd771d3dd49dd826d4a919d3ee85914ca8360708f26d396aaaa6564cc826fcff6ea892d916097e118c4ed0a1ed60cb8217e5c3ebf94d WHIRLPOOL 0b9e8fc03d9e7ceb69b5ba8212b943bcf99501f57827aabba53cf3b5f241b0df111bc452f91485924616b4731d8d8dae436b2690ce5d0bbee56b6b8ab8d8ecda
+AUX swt-3.8-as-needed-and-flag-fixes.patch 8852 SHA256 211bc5ba5a4592bf3d0b32966ab4d9b428b7396be36c31ca31f80d807d702547 SHA512 523dfb0c0fa2bb2c8c0647ef214465c7ebbc93a7a179b204efc46065a925170dc2659238bbb0abefc73b145322b9668340d36ff8a95fc5083890223b48d6e644 WHIRLPOOL 493b0559eb7e668b3c0a9852fd5e3b8263752f2af1c50f1522622c646bb89d3c4e286d90c231fa95b648419fa8541cfaac70e0d3b379a2b463242a9df56772d7
+AUX swt-3.8-manifest 750 SHA256 5beeddd8f5e381811e9ac50167dc8c0408773d40591f9ef44294a00595a2dcbb SHA512 ce465f77e2fc3340ccaf3ecce67697666972331f849ef196eeebfed3dd1342691a5641ec20b91bc5b480ea0acc9edf194ec9f4bc597c2778d0bd0382923d1bc5 WHIRLPOOL 17739c43c98179f6115d27eae3a41a0b5f44ef28db10eb560c19e215ee95e68addbc301e857584db39eeb4c8259f59d10b893d346803ae68e805a97db1215b2d
+AUX swt-3.8.2-gthread.patch 1225 SHA256 e7c477aba9475ce582b493b541296f8e4d28a68c8dbef8a6ad1815deb27aba89 SHA512 035ea3dda893481f67ac0447e0c7382a9761eb3ee77b65ca77038bd17117b68a2d93058c8414d9b2656ceeecde3e6ebc06c0f27e044f217fe8f44945104dcbd4 WHIRLPOOL d7e474e2ddc65db5f00ce9846a57a7a5a73760237308cd921ba6c601d6648163e75e74fd397f984dc21de1a95b8848d49ffc840f2996fbcf49a002d25ff21c5f
+AUX swt-3.8.2-libwebkit-compat.patch 1104 SHA256 fc1aef129a9859d487366f333fb2ddb41deb478e738e57c003c13bcb31d8f9a2 SHA512 f063be5652b44b776f774a8e3d7f31be3018858322cbbe8b7c2e47a18bc705c4ff751ed239699c2014a5f51785a723a2d8f4fdc9804f4fe1961c861cecbe4117 WHIRLPOOL b9065c59cf11da3724204655c6288557ff9052cea77b06c40c7c3ced0b6bbc842b29138b5816b6a5e5f4eae1ada6c896c6fb5d983a7c28c14cea2899d9e07fbb
+AUX swt-4.2-as-needed-and-flag-fixes.patch 7840 SHA256 3aed5349c3c0cf1a2e63fdd4b40d053804ecbba7a5b798de73be36f64b42fb65 SHA512 00cc50a0432bb17272a40c3606c9a5729171708af5581c861a5bfae3d1b694289de92164961bfceb841813fb9161befdc2114616556296e81401f133f07c1db1 WHIRLPOOL e9f21b6745422aa1ac74f25530f4ae829165b77c1843319a21aed59e8a7da27fdf803eaaad4acc49e5373ff7f2e7209f35bbe8cdc4ffe0e62ff576f03eb912c2
+AUX swt-4.2-manifest 739 SHA256 3c67656a0798cd6f464ce6db022fab04fa23ff3b07e7079d8c3364d950f8acc4 SHA512 f17bdc21083c70896d82d12d6918bb121db838b895d1db95dbbf9bbc0368b1b26e6b6acf5a90b709ff961f3640911111932391fa45ae898d1de8a387d17594b1 WHIRLPOOL 31f9e54ceb9640c0e3d1ac0c67bd290295a424997d8633be5d172b0467e9aac4b0b94420862864e29531ae3ef67610007729fba1b944bf22551cd8450d4326ff
+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.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
+EBUILD swt-3.5.2.ebuild 4602 SHA256 dfcf996100b1b779abd1a2dea24c00fb410763e3ce1b8b47317bd99149476412 SHA512 cdff54906b1a7cfb98ca02cde97354cbaee4b34fe76724a9d9ee7720b6565e1dc1ba930ae060eed631f9db5891f20a96da567d1324436c381b3daecc7d80ddce WHIRLPOOL be0237194098225a556bcbb0622033e5b436010901569059b407dbf2fd8ab6dbb0a4c3ad06569ccd4bc27868bf8c6ee3e7d41a01901d5855d3ed5dba830f2d65
+EBUILD swt-3.7.2-r1.ebuild 4764 SHA256 cab399644f38ea83cbffd5b8f4c7e1e3b48c73ae79e3b0afae9e6692d8a331b1 SHA512 2c11e4795f4aecd246e1128c81169fe6b3eb8283632fd4a371b7ee71a716da0469a86c8b5be9bd35ffd87eecfe87acaba95464d0ed31f2c79085a7c5562b2880 WHIRLPOOL c31bd1dbd7c7db16c6a07623d8b904565469a871f4365ce87d6ccb8be14f18c003d5fcb217f92e492054d46c150aa0a0446c8f736be5b956f2897ed9dee90c70
+EBUILD swt-3.8.2-r1.ebuild 4645 SHA256 15be392a771e8476e24228001ebf39c347df3c181908b7706ca507a1f7a4b0ea SHA512 b94a9b93af8431689e30d2e85388692a96e94b6dd624c9f2b5cf273e2edb5d24fc3994c625b098e7b1ce2be56d04a4c413b0cc374706d784daedf8d9ad76f062 WHIRLPOOL e6cd1f71bf47ec3b0325082a4be1b92f5c2b62636d071a8b6a3865f4922836e26af0eaa379264ef473416c0f2621f8d7174b7426f8d2242ff308df7076a5379e
+EBUILD swt-4.2-r2.ebuild 4839 SHA256 e75bf989a04c8eb8ed2ee4baf0b179f03e16a5f13c1e4dfaa449e7294a04cc41 SHA512 0cc9aee2f5182070e882a150dabef7e0119519348d18e786ec259c1c211d9f5a3fce05dce5f8e73e2ddca7d6889514dc28366b18f536e7fdc189bad6c1d7855f WHIRLPOOL 0d413ad28f0c576a915fc9d47b850b3b5807b9f5dcf7c2c9235d2880a89e4d5a0d8b2e0a21162dd489e4f24dfff88bcc82276206592d560fde42fffe063b40c5
+MISC ChangeLog 4918 SHA256 4fc299bc9b69da9518d2c91250667227beccaf8a9a4d8bdce1a7587b057b67c8 SHA512 5bcb7d993980fc7fbeafac06179055f611645dde2fc4d8cbce18647551f2785e3c5dc60e0269b550bb50a9648447a0ddf0e848f917c57139d5f1fec79d7c01e7 WHIRLPOOL fdc38d6fb5aa860cfba642a048f1c3e72ce12033c2c299fb3f3bed05f19cb6487b5f9e26ea48ef308bfed8ffef9b9d09b78239b45bcdeb56665716d18c146888
+MISC ChangeLog-2015 26480 SHA256 98c352fb8b2e245d8a1fbb7a17b54bf6cb3fc3f1172d413bc1c4e5e174f8e43b SHA512 3384443c195961622544ec8dffcd54c102328ec0df3872db2bed60d36f2026d0066e6c3cbbcf76c24a0380b19a0b58999cec96172991929bef873a142a2bb4ec WHIRLPOOL c7a3a96084dbb3913a317b997a7e18918fbede853db080b4ed4d036150c71344dbec3000d9befca2f2a934091aeb66933accb655127204cea5525b774a91e08b
+MISC metadata.xml 656 SHA256 6ce4e1f076c5bae081badb5d39c5b3be7d1f97aa85245b148d7ada92a57edce8 SHA512 1aa0b6b24df23fa95730ab3167ed5ad264305ee0dd73296c3816de3be9fdc965b70d84c930c21ec2baf8b4535a4fcafcd554b242dab2bf6b7fdaf75ecb3c1615 WHIRLPOOL 2ff07c0e2c8386b394d66baf3a6350c1039d2bd0120eb40801e77a89617502040db260fffed477a61e6874083c6ddc15f0855d6e81300dd4c0c88881ca4df68a
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.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.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-3.8.2-libwebkit-compat.patch b/dev-java/swt/files/swt-3.8.2-libwebkit-compat.patch
new file mode 100644
index 000000000000..ba537f54024e
--- /dev/null
+++ b/dev-java/swt/files/swt-3.8.2-libwebkit-compat.patch
@@ -0,0 +1,23 @@
+crash: fatal error in soup_session_feature_detach with WebKitGTK+ >= 1.11.91
+http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b22a7d19afbe2a3811a0f8aa54c1e85d92c62a2c
+https://bugs.eclipse.org/404776
+https://bugs.gentoo.org/500570
+
+--- a/src/org/eclipse/swt/browser/WebKit.java
++++ b/src/org/eclipse/swt/browser/WebKit.java
+@@ -597,9 +597,13 @@ public void create (Composite parent, int style) {
+ */
+ long /*int*/ session = WebKitGTK.webkit_get_default_session ();
+ long /*int*/ originalAuth = WebKitGTK.soup_session_get_feature (session, WebKitGTK.webkit_soup_auth_dialog_get_type ());
+- WebKitGTK.soup_session_feature_detach (originalAuth, session);
++ if (originalAuth != 0) {
++ WebKitGTK.soup_session_feature_detach (originalAuth, session);
++ }
+ OS.g_signal_connect (session, WebKitGTK.authenticate, Proc5.getAddress (), webView);
+- WebKitGTK.soup_session_feature_attach (originalAuth, session);
++ if (originalAuth != 0) {
++ WebKitGTK.soup_session_feature_attach (originalAuth, session);
++ }
+
+ /*
+ * Check for proxy values set as documented java properties and update the
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..3100286ec075
--- /dev/null
+++ b/dev-java/swt/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>java@gentoo.org</email>
+ <name>Java</name>
+ </maintainer>
+ <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..8f9fb56f021b
--- /dev/null
+++ b/dev-java/swt/swt-3.5.2.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=2
+
+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/drops/R-${MY_PV}-201002111343"
+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-ppc.zip )
+ ppc64? ( ${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip )
+ x86? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )
+ x86-fbsd? ( ${MY_DMF}/${MY_P}-gtk-linux-x86.zip )"
+
+SLOT="3.5"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 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.7.2-r1.ebuild b/dev-java/swt/swt-3.7.2-r1.ebuild
new file mode 100644
index 000000000000..de15a30fd3e7
--- /dev/null
+++ b/dev-java/swt/swt-3.7.2-r1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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/drops/R-${MY_PV}-201202080800"
+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 )"
+
+SLOT="3.7"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 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.8.2-r1.ebuild b/dev-java/swt/swt-3.8.2-r1.ebuild
new file mode 100644
index 000000000000..e0d8a03d7f0a
--- /dev/null
+++ b/dev-java/swt/swt-3.8.2-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+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/drops/R-${MY_PV}-201301310800"
+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 )"
+
+SLOT="3.8"
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+KEYWORDS="amd64 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
+ epatch "${FILESDIR}"/${P}-libwebkit-compat.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-r2.ebuild b/dev-java/swt/swt-4.2-r2.ebuild
new file mode 100644
index 000000000000..10d4a3a0aa38
--- /dev/null
+++ b/dev-java/swt/swt-4.2-r2.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 ~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
+}