diff options
author | Ryan Hill <rhill@gentoo.org> | 2013-08-21 06:02:13 +0000 |
---|---|---|
committer | Ryan Hill <rhill@gentoo.org> | 2013-08-21 06:02:13 +0000 |
commit | 8e31a476f67aaf5f7665ce754d62cf61c68e12f6 (patch) | |
tree | f88ea9a9ff7698ad4ba8db6df09b29ebe6ba091e | |
parent | ~sparc wrt bz 449184 (diff) | |
download | historical-8e31a476f67aaf5f7665ce754d62cf61c68e12f6.tar.gz historical-8e31a476f67aaf5f7665ce754d62cf61c68e12f6.tar.bz2 historical-8e31a476f67aaf5f7665ce754d62cf61c68e12f6.zip |
Add patch for bug #424151 (gio_launch fails when opening by URI, causing
unnecessary dependencies on gnome libs).
Signed-off-by: Ryan Hill <dirtyepic@gentoo.org>
Package-Manager: portage-2.2.0/cvs/Linux x86_64
Manifest-Sign-Key: 0x957A8463
-rw-r--r-- | dev-java/swt/ChangeLog | 9 | ||||
-rw-r--r-- | dev-java/swt/Manifest | 20 | ||||
-rw-r--r-- | dev-java/swt/files/swt-3.7.2-gio_launch-URI.patch | 121 | ||||
-rw-r--r-- | dev-java/swt/swt-3.7.2-r1.ebuild | 182 |
4 files changed, 322 insertions, 10 deletions
diff --git a/dev-java/swt/ChangeLog b/dev-java/swt/ChangeLog index 8f10a8a917e7..045697a9d615 100644 --- a/dev-java/swt/ChangeLog +++ b/dev-java/swt/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-java/swt # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-java/swt/ChangeLog,v 1.146 2013/05/15 09:02:02 tomwij Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/swt/ChangeLog,v 1.147 2013/08/21 06:02:06 dirtyepic Exp $ + +*swt-3.7.2-r1 (21 Aug 2013) + + 21 Aug 2013; Ryan Hill <dirtyepic@gentoo.org> +swt-3.7.2-r1.ebuild, + +files/swt-3.7.2-gio_launch-URI.patch: + Add patch for bug #424151 (gio_launch fails when opening by URI, causing + unnecessary dependencies on gnome libs). *swt-4.2-r2 (15 May 2013) diff --git a/dev-java/swt/Manifest b/dev-java/swt/Manifest index 585eae9df948..ebe65ec5fc50 100644 --- a/dev-java/swt/Manifest +++ b/dev-java/swt/Manifest @@ -11,6 +11,7 @@ AUX swt-3.4-xulrunner-1.9.1.patch 12209 SHA256 08e4ed334b37347ad9ea267264b46fb67 AUX swt-3.5-manifest 752 SHA256 8ad9d69aa58e533cc03b9ccf3d8e0356505c357aaeb14968bf146f94d8b79be9 SHA512 7021ce5766ff50b999ad3474de00a2f19490e5eaef1f811b95d3cf01a43467de3e8e4913b668d019d59513ca54a159b50fd0bda427c4efcb3fddc522fa2925a6 WHIRLPOOL 09ba77a4ef824120624b9d6122a9eb6a39004e643b7e95f5a7f0f3e934a985f1cef86c838f5663ae4f3149f1953ceee0231e0d86ae7c3b9ab47a62ddee9a16ec AUX swt-3.6-manifest 752 SHA256 f5a8e3db5c47d3b82541a73b5b0f172342efc5754adcc00b9b62a5abe4b30096 SHA512 6b9fb3e2dc5d3da9f7988e46409a9086108dc8cf5facfe5ff09791ff8782a6babbb6a517f8282671d0800f207f7aef518dc480ca8d56740fade218851d2822fb WHIRLPOOL 72224faab73cda56beb9feb93140537868b25298b0903fcbcacbac3460eb7c955414504f7eb669f9b0a27ca1cbf3f2b76c9c6ab90ce3840b582e575220421be0 AUX swt-3.7-manifest 750 SHA256 4c911bfa6f4def901570ca715da547c1d13766915f3244e5d6282bee8be6564f SHA512 e4f6aa5ce58cdc697c234a2a4be43de0510d3c082a2737627a35df74d378a50edc0f7d3e62221f402eed602fcdc50fa7eff969b12602189fd400e1f1580f0d8f WHIRLPOOL b84f61067d00c864f1029718b560a33fd04d76e6cae8f5aa5e5aa0da31af752494277d759d909dc4a78f5412e963c21c95125ae01ac405fd72c7a8223032f558 +AUX swt-3.7.2-gio_launch-URI.patch 4287 SHA256 9d6ab97a06c190d1229168fb85dc10577c19b9d88ce6ae216eb8d1b803ae0752 SHA512 4954c7464bb2ab7b9c23fd771d3dd49dd826d4a919d3ee85914ca8360708f26d396aaaa6564cc826fcff6ea892d916097e118c4ed0a1ed60cb8217e5c3ebf94d WHIRLPOOL 0b9e8fc03d9e7ceb69b5ba8212b943bcf99501f57827aabba53cf3b5f241b0df111bc452f91485924616b4731d8d8dae436b2690ce5d0bbee56b6b8ab8d8ecda 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.4-gtk-linux-ppc.zip 4616331 SHA256 227d3bdceba48cd245269cf689731dc3072898c34ed874501532c06ad3c5e9e8 SHA512 3d456cb0f7b0374382b1dba16a963d8a1f39f483ef385d35c26f15255b9fba2e45d50de644f68561be880c0983fe464e6877a5761555081b5e14125724aeb4b0 WHIRLPOOL 2c3785ec75d16f337159691fdd9d9b745eed9d24cee5e8deedcd9b0c1c9d192f4c148b856493c4fe41795036ef011d0dd2a6fb8cf7586c6ed127dfbb88ee9bcf @@ -35,20 +36,21 @@ EBUILD swt-3.4-r4.ebuild 5067 SHA256 0c9a46de38fc77c2dd14c5ef86a993a33342e2f31e5 EBUILD swt-3.5.2.ebuild 4766 SHA256 f9b0cabc4f2cd251e83d3ee092cf55e6fe4efa251b10d4809f43ed94e293aa9c SHA512 d64148196c59f811791851924ecd1d576ebf3faf589af7a57a77ee2973d5cbe9b75bb40fbd08855e93b51676de223c2215782e02403756044bced85984a08d9d WHIRLPOOL c8a232d15a2246f20d74209ec4a4bb748ad9746ef32830367e48c1cff088993cd46e34f778b49bd3b45ff1fcd10dc7a359f2e5485b94c9b07026986085d42910 EBUILD swt-3.6.1.ebuild 4774 SHA256 2fa22bec72c95340565d8ae982a28ab646acf7d512ac42f724b2b034409808af SHA512 2f2a9433ee392a367324be0c56900fe89f3723e0095477fefb0e5a67fa806deeaafea72b1d7cfc9c850332ee5a7874d540d5b55b0556e3864d12729f201872d2 WHIRLPOOL ecb6e924a581d0652eac5d4dbee1ccebfa762182782d744d2f394782e46932704724cf27c7b67e0ff2c0057d353ebb3d139ee8393bf75c356a1a0fd37ee15aa5 EBUILD swt-3.7.1.ebuild 4782 SHA256 f31f5bf1b5648d2d9b84961bc8dc9c7344f31b1a4f9526c8d60848641ac5881e SHA512 4f4224d34b3d4e1f64c4bae3c10b5721e4bee7b9c4f7ed7d5d117d1aa872b22fa833447b08ee321d80aafc35b54c310e362c63604d760a76a55133f943a07812 WHIRLPOOL c30705aa922aed6e12b9c57ee70902ceb89b5b3e2127730eea0ffd2b84743fec49000b482117c06b969c6452d81570611ca0a0d1dedd18b223ce3fe067c7f226 +EBUILD swt-3.7.2-r1.ebuild 4836 SHA256 88855a710daf2e321e98fc70b01d872b17fe339308304bcf53edf4e0b1c34bd4 SHA512 3259e52fb905eec0c9ecf3ff9b73815b859209b41ece791bec33589bec2c46cf2606ee2f78013de117df663de4aa077bee4f21b5f3585129550ab735d4936e8d WHIRLPOOL fd7a48d5e0f7b8e493e1f6fe0ca917233ffeb6541e3b999f401456fa5f2bed6631611d7815e0bf60144364af4876b7ce26f7a1dae0f51d68f2e5c153ef23e57f EBUILD swt-3.7.2.ebuild 4780 SHA256 8116026fb485ab02e4b389507bc47b42288657c96fff3b70dac3126a3409b77c SHA512 62ccbd7e73e5b5e6de22381de73f02f1b43641423f1d5b8738031cba97b159c438d6c22744c117b707dc6e1f78cd03a881e6f693ac12a2e89ce68406dc2e8f4a WHIRLPOOL d87b37a92db73240703191d204db6f75118d5a69c8b044ae3b91df38d49b7a803f3bb2dc5ef81cef021a3580982c1860dc00cdb5204b94a0f240b61f989f3a12 EBUILD swt-4.2-r1.ebuild 4824 SHA256 1a0f97eca60d3a2791aca24573601fa7a23de0b56ae292a56e3f390ccf15c6fd SHA512 198ab0114ed9e7801c57cce950fcfe0a77fb1112dd2ea935964443395c861e597bf274022a70b1d951b68c2088ab95ac1fc64ebe935b14eb0fb0d4a18fad00cb WHIRLPOOL b995326f94a156f015298c7732df076906b31094f40dd841e7940d9c331792cc12018c31ca5cf0550b32f0279031c8db6d0dc411a681279cf5db8e057d0fc030 EBUILD swt-4.2-r2.ebuild 4950 SHA256 652162ae0f78851fc831cab7ee41cca21a2b3a6227a710c6d8076528307f63d4 SHA512 281824727d25b5677c8972dc57361723129297afb80b585de6b2393977d8b560c84f8340ee0c08c6a3b17d1f9170a72660b612902013599d5a337d8c882f275c WHIRLPOOL e138025e61eae4afc8262d7fe2b7653e49da415788ed990776e255528ac097b53b832566787579e8b4f7da07cae2d41097d2be8f8476870d70ef91fa58c1d6d2 EBUILD swt-4.2.ebuild 4710 SHA256 6885c522f436c3a9a305c4bb19fda4bc5ffc10a248b670f7ff7a9d1acdcdac38 SHA512 6a60a8216de7d3106abeb3e673b9bc458ec6d39e6ae57a46870e326d2000984dd2f059e112b499a252baefe3dc71711a0e3e2121e3a707003a6c5202081e1d34 WHIRLPOOL d5afcaebc5b297fc7c0dfd4c3c7d35e6d1842e870758907ff5be295aa5c8c8d8f9acf8fbadedbc9a592857131b801277c7e79ec3f3fc4e9487e145a7ee237687 -MISC ChangeLog 25136 SHA256 d58f1ea7fff072a0084000fd8dcc91e6f040f6ed448032a87a50f0f26f776ec6 SHA512 05d9013223b47fa24941de10bb50af12432a88f1e23586307f590c7b469554687015a0cf64141767714af12b3a62b120331f8956d0d48817270f284e88c4162b WHIRLPOOL 538db6399c4d14af0aab8f98d612a10a5f350b64ccd65ae1dd5dbce934fd1f4d5bb04d32092f626df728bcd18388db97f93844679348e09b118dba536e494d83 +MISC ChangeLog 25398 SHA256 a2bdf1bfaf7ff907b47b76ff495abb15ebe0785c4d57c1971d50a7e90774da0b SHA512 49abb331d6475c85e3da3fb74ae97925c647d67a218d1f6c728940337c42d862e274700cf0310fe40f35447d963667c43b1072a8e548fb22b049a22c4c477343 WHIRLPOOL b49b41b1e84a7429f0c033769d4e8fc9064ad80695d9033f38ed44781da5996c2a955082c2e180666717e0ac57f6f8255fb6a419941c39f610bc10602ed625b3 MISC metadata.xml 578 SHA256 1e4845acfd81dc03aba0b504ac5c3307bf8d8a3bf666ece773fc483e458eaea0 SHA512 2b9ed1965582b5cd8371b473a296d620005273c82b393f5f32c3c45ce65926330bb75e4a312256c21bdb3f69a9c2a4b99f18e9396a349ba17ba94ebe647e5b8a WHIRLPOOL a32177b01a02581a0b4762e31cdf8029a88fc7e57ec9809c9a8156326a843e604a861e8f5f7bb44d8adc9e1c0c09eebb58d8d6ffd613ae531f99d6f1113cf044 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) +Version: GnuPG v2.0.21 (GNU/Linux) -iQEcBAEBCAAGBQJRk06oAAoJEJWyH81tNOV9+eQH/Ra8I+6o7uzIs3s6esCcNcGG -EgG6nssfYEPWMRIC/ex+NvI3aIVfpLVz+7CYnUynInMCu6PYaZHqBmcwiJBwmAc2 -RbAvhP1yYzwBuR71IqQVihUWqi1u/M2k+6tgKRE0gm4tv7R56effHVwj/FoNpUoh -+7jWnZkJZD8HS5R9Lh8awt2A7j2z3tHlwLnjEvPSOGAtEpD/iRzx2Vj8My8vEPOG -WKmBBq+f8M4oR796FO+vRUX3kihzdM3KRv0QgmugvHupuZ3FQ4Z4rEXQq8MGoCFf -P/XWUQ+Lfd6HitnyAgX2lRDwoKcxY3GC35gPbLgvg5MLUrjiD++a0smsCJ5Xi/k= -=+CdW +iQEcBAEBCAAGBQJSFFpWAAoJEO04vUmVeoRjJDYIAJZZJAThoieENu0kqnJE7jUn +Tp2B/g3fRyfd5qoeeAt2zXQ0hi9RPE/DKgc/yEiWKaoqQD4C602nIVBZmRldPFvV +8vDo+NNOqiZyOWLn0ohTCrT+xtE/HT+H4RVxtYPqve7sXqDeUxRbuqXu9Djljtqw +JGl9U1OmXNYKSyFwOCX8jt6LZZ9Yp6XC515f7ZdPFImfp/oUQl/bWAk5DlppXkwx +RVROnw/zdpcXCNB5g/Kb/09aW+Ee1GOu4K4tnsopAXqUxzmxVbQJcfMBZD3Gsy7T +7/EdHpY0ZbuEJCzr6oFt3zcvJVUe5qvrRFDKEZ/XwLgyV/U6sVkrSpE6MrEkG5w= +=shKw -----END PGP SIGNATURE----- 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/swt-3.7.2-r1.ebuild b/dev-java/swt/swt-3.7.2-r1.ebuild new file mode 100644 index 000000000000..7d6af2de77c1 --- /dev/null +++ b/dev-java/swt/swt-3.7.2-r1.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-java/swt/swt-3.7.2-r1.ebuild,v 1.1 2013/08/21 06:02:06 dirtyepic Exp $ + +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 + epatch "${FILESDIR}"/${P}-gio_launch-URI.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 +} |