summaryrefslogtreecommitdiff
path: root/app-editors/xemacs
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-editors/xemacs
reinit the tree, so we can have metadata
Diffstat (limited to 'app-editors/xemacs')
-rw-r--r--app-editors/xemacs/Manifest28
-rw-r--r--app-editors/xemacs/files/README.Gentoo45
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.19-db.patch84
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.19-texi.patch33
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.21-vcdiff.patch19
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.22-deprecated-ldap.patch18
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.22-large-images.patch122
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch66
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.22-texinfo-5.patch437
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.24-gcc5.patch32
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.24-glibc-macro.patch28
-rw-r--r--app-editors/xemacs/files/xemacs-21.4.24-ncurses-tinfo.patch12
-rw-r--r--app-editors/xemacs/files/xemacs-21.5.29-optimization-bug.patch14
-rw-r--r--app-editors/xemacs/files/xemacs-21.5.33-no-mule-build.patch33
-rw-r--r--app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch35
-rw-r--r--app-editors/xemacs/files/xemacs-21.5.34-glibc-macro.patch32
-rw-r--r--app-editors/xemacs/files/xemacs-21.5.34-ncurses-tinfo.patch13
-rw-r--r--app-editors/xemacs/files/xemacs.desktop33
-rw-r--r--app-editors/xemacs/metadata.xml17
-rw-r--r--app-editors/xemacs/xemacs-21.4.22-r4.ebuild257
-rw-r--r--app-editors/xemacs/xemacs-21.4.24-r1.ebuild245
-rw-r--r--app-editors/xemacs/xemacs-21.4.24.ebuild247
-rw-r--r--app-editors/xemacs/xemacs-21.5.34-r4.ebuild252
23 files changed, 2102 insertions, 0 deletions
diff --git a/app-editors/xemacs/Manifest b/app-editors/xemacs/Manifest
new file mode 100644
index 000000000000..744228229aa9
--- /dev/null
+++ b/app-editors/xemacs/Manifest
@@ -0,0 +1,28 @@
+AUX README.Gentoo 1426 SHA256 9fa4fa31fc4deb0742dd220c8a1cf41af2bb4f4651e4f995589389afcc9f5f92 SHA512 0576235fb09ea9ad5fbe5b1bbaa41dd37913603ab40773f2c476b72e147eac9b8de62f600717d06d5366184deadb55e0002e79b9987ba215bad5ebee41fdfbb1 WHIRLPOOL a0687729c64ac2323d3b2d3fb8db9a68368553a3188725ade8d2a1d2b5c09ae32e3f8079037edc9c1f1e933894b9d287dd0c24fa8feb5dde953df9490a5403de
+AUX xemacs-21.4.19-db.patch 3157 SHA256 c0c0cf18ccd01ee0e34e913c4f275977f4f61aa7343fef9fdff1f3ba84096022 SHA512 b4987784295c5d2335440dccca4e157d5ccece510d97fc131e33f701fc2dc48bd01080df577c6e588d926703f7b461a347d0d3e3f99931e10cdb8b11592b35be WHIRLPOOL 0ff39c8a7ba863194636a71e55831d145c79c2f45463c21705763618bcf4e2092ee2cef3ae485de8d8eb335dbe66d2d560674cf3028d29b23de1f1c358a0c122
+AUX xemacs-21.4.19-texi.patch 1107 SHA256 9f7af4de522d03c9e78076c4801db775ce919d30b27f4f84c8b055d17f476ae5 SHA512 8b032464dfdeed928c1d4fc566657762fa791e64a3b255a2725edf0d244b76c928c9dcc643584debbaa5b8c1d3c53f635950905ab30900f6d758ed5951d3c219 WHIRLPOOL 6aff14b5206492c5f519bd199927a438ecfc754527196e96f2106eaa2b5e416e09ee3e1313b93a53435249c5a44a626d37c1ab299a66927a9532ee5f04b394ba
+AUX xemacs-21.4.21-vcdiff.patch 476 SHA256 adf0bb95ef289187027203f28fb0055be817c6b54211912bc33c16a9ff9cfb2c SHA512 89d8c8ba5af0467057506b9e2b974fa5d09432e7375dcd0517007ad4d28fee8019895667bc4291fe500b1a039fbeef0b82d2318995ca41ed7045327dff860f85 WHIRLPOOL 0c0343e962bad880f328b292c73240dade407b60dea93c400101f9c3db76d92a0b4cd3a891647df390ba6cace35e1d1050961f576364f5478833d5ec411df4d5
+AUX xemacs-21.4.22-deprecated-ldap.patch 516 SHA256 41100c6c9fc45d90aa4618e9e9897f229854fbea60ba34fb0e6b82e8e8a37a7b SHA512 4761f5759741f733518668fededec21ab2e9ec1cb883a363ca23669e1c82d9d44c03126a758da02c21cad8a810c3f83f0516f2bad4103fbea2cf73b00516b388 WHIRLPOOL ae9da77b267b96e8fc3c87e3498f1bee86fd0a2629be4083da84a3ddf50651c18d32c9e6af552cb3fa569f944b58e559a23c38554e27af4e6cd3b2ae94ad3dfa
+AUX xemacs-21.4.22-large-images.patch 4695 SHA256 bde9b13e2e57f25564d732213fa5cb5f2bef17ce8580f8d18e81975febade3f8 SHA512 b1e03d7824d0fed82eff4fc6e5d6cd7e9f1b94e6eeec5d429b8a66027a9fc95943318c4c010bbb0f57d59b31a90bab94360a41bb0858735da59ffcfb75d59319 WHIRLPOOL 391d95c4fb41fb2a9fe40fb90973a7475fe69079e8199345a0a3029d08d08b6f593452e3ecc44805bd505f8790344be834ddc9fc12d85d587d76716854b7316b
+AUX xemacs-21.4.22-libpng15.patch 2593 SHA256 d2e1b5a1410cd6394f055092db591caba3c615f6bb26d4c8f1ff6507b0d70a69 SHA512 f026634a164e4d34eb10a4fa60da3a86743f9cd8bda8e760a7ad206fa4056a4e4c2236c9e8a4ac92d70883b5838086e48e5d5647979a3692c15da0a765aa2e1e WHIRLPOOL ec21ac2290415f0c6c475e4628be241a0f73301453cbd5e8d82a655882165e9b92b37084216d4f7eabf82676859e6b7c306aff0fccbbe739a5f5d4846b818f13
+AUX xemacs-21.4.22-texinfo-5.patch 12752 SHA256 282a8291a1e9c7436ffbfb86c6b458d5b80ab4154131bf783e4c97aa1685ca12 SHA512 0817a882ca75d99537865a23a4565e9f8b21af75b1cb90f951ee672b0ad6485542d10b28c5c7532267b07e1fae973879e40f174a1dac40ef7dc305f34a575637 WHIRLPOOL e6528655da5439f66e7f43d67cd19ea539af9d7ed87e136e59a54f40e02cf9d458ffb3b05bcc157dff3adfdbe3c6c98b4e3fd6f0ad5d28baa8a4c9b0d242f22a
+AUX xemacs-21.4.24-gcc5.patch 1132 SHA256 5a2ec81e20914af91ade0c80a4683783a46d4dd2ee993eaea2b138287ca15458 SHA512 1b3e56804594b82209ddb6318c2bff13b8e63f189d98e5ff313022eb66267eb45683841599dadd8a4d97e5e221dd85195121246fba5c91eade905e1d7b593749 WHIRLPOOL 05b61799c344e581fd23621ebc10743b9b5652c820c74432d219b4614b7e4fb84de9c344f023ba524dd94539c2559ce237245b23ee80ef585af37a7d06ab1f2e
+AUX xemacs-21.4.24-glibc-macro.patch 1081 SHA256 09af1a7c5cc6f70dfd21d4f3beaaab88a3c396498ddaf12bc7624f56970eb77e SHA512 6802260f60cd8ad14f9f7f4dc156e1914cbefd7efae38837426f54f141bec6241c210c28120badfdf46d0cd2866014cf31b05ee228c407cdb0f387ea5cf56e3b WHIRLPOOL 4a538dc63e4083acbdb655c3d45e922c45a052570ec1f19b43640c1385b64ecf07f32116db264e97aec26506e02da26eb4b5c37dcc74e0cf335fad263297613b
+AUX xemacs-21.4.24-ncurses-tinfo.patch 538 SHA256 be591ab5ef7d2ec3c68310d9c8915a57dd8be90b1afbed2496c833a79e5fc4a2 SHA512 61af7d1090f160802a6a5ff2ba28ff2d9d2a39ac615c692748a76f60c4f93b6d09a66fbf797467257efe1a269aa90033f5384423521b1e403defb6cbd8709bb3 WHIRLPOOL bad539f5a147e61f61d3316381ce9de279902a66c776d905b0e1763662dc8c7c6439691e96e5257dc28cf15136990df18e5edfd90feedfec88a48cce622338dc
+AUX xemacs-21.5.29-optimization-bug.patch 371 SHA256 14c5d9ddab865a9e4a1c6d4f64ed44e4b16e0eccb9fdcef94cedfaa30948863c SHA512 a955379e9abe736bdc17eeb9e924b9bf292bf4c9b2f59ca6221a09de8dafa020350ff5466732779bbb01f05152e8a823e333b9c967a6ec2fb5c1f2c9d7f694da WHIRLPOOL 9405db9d2dc618310f30e6a257a95667dfb94782db0f7ec3f5a7c702a210e9293bbe04cec5b8a1c59ec94a35b4960b1a03fbf3ce0892e29c3657fa93bbf97150
+AUX xemacs-21.5.33-no-mule-build.patch 1393 SHA256 805014085e7faeacd98d7bb2a3a57e49cf6a6f991db26dfa28230373044f2809 SHA512 2afac7a199455ad0ace5a63f6a1e2b73d8f2a8da3eb93b59975b2d654ae85acd24d206ba0d9cfe08e35fb1fdea757fc6cd3588f4b97b75991eb946885eab85b4 WHIRLPOOL 6d1e2d2df7059d0b8477eadccfeb8873a8dde3a129bc06ffdca4e86950c1df924070212198dcb309f00287f0a4525e230b6df1827c209bb058ae3f6d6feffa11
+AUX xemacs-21.5.34-gcc5.patch 1194 SHA256 e72a849fdcf4f4bc2ec4b5ef66e066a4498fd9b6ea17b71d52395c35097b9bcb SHA512 276f3e10334c3809f625e69ea0d56585fd429e9aced65331bd1ca0ced467bcf526cee43925b4c4dc381723883348877782e1c234db00e60c3d74a78021a2330b WHIRLPOOL 12c8179bbbcf9ef51eada3955444d4013fc85febb3cc51eb48ac69c81250412f0a497e9fdfd72f34a2ec358bd5ee16a687e42614531f389473f1ef39e185fb4b
+AUX xemacs-21.5.34-glibc-macro.patch 1369 SHA256 20c320e475d35b89f966b555ecba0dcd3cbbb8abe7e49939e8d4f309c4fe09c6 SHA512 6397267d99649f62a20a0a1f2bc380360ed7689691adde515421286b3bcad55dbb0cea246427e03f904fd829624060ad7ae66a67c63f16f3b3c1f88803022176 WHIRLPOOL bca96f308eba1e9c3b4be169d2cb83f2ecb98a2c89a88f4780399983a9c931f9241a7ac1f09d425f24bc327b7395e87f8a577a61ec13af210c5c20a3685de85c
+AUX xemacs-21.5.34-ncurses-tinfo.patch 699 SHA256 ded43ce90666103396d63e7a3180f9f65cfff81352db16bee5d304982c6ec3ef SHA512 814b01388e7eb5963307dd5cd136725dd6d0d206b1a4e8ffc2ca8dabdd0070a58122fb4faa943efead1fe70f6309819177870630e05e5c02b51dc5e2aa0bd765 WHIRLPOOL 57f3dac98434869bf694992e32e00802237cdd89452fa2e3cd55b004767d19f0b43bab563321e2dfa94eb292c664d5a8f41f8ebcb32b5fd9e7e1d0324d3ef0ff
+AUX xemacs.desktop 1061 SHA256 0f73f0492c8f647892ff94c76d7fe99bb8271ca79573093061870a60f35eaf5e SHA512 6542fc7777af888ae711d386918e712e1d106635f70e65af77d1e809156baba9831fc4c8bd2cb7e7c6f9ab0ab18ddfb92709ac2909aa613471101454599bdb69 WHIRLPOOL 1124a7f80ce877110e8ddd27f36c656952d81408230ad05de0458a80d00aa51cc0e0704d5b98829c99d1e92206e9fa619274c9a50bb890325e1186583b514782
+DIST NeXT_XEmacs.tar.gz 39571 SHA256 35a0d988fd4ee801572639a99798571aa9fad140ddbed1455565ae9d5e0086c7 SHA512 611ddbbf5be3d2274e7f76be7f8200c6c7f3cba917efcc24e73685aa5f61c94237e6e48ce66f2d59ee4b74862e686f3ea7a29cf006717d5d0674db24d243d566 WHIRLPOOL d47aafa6fe7a11de94196dffb752c683722b8ead23979a7f4344c61964ebcd052a4f0ad6b9ab42a5d41f5551c0a543f46af59656fc8a79340257626272c1faae
+DIST xemacs-21.4.22.tar.gz 8357931 SHA256 87fb7633106625935105e821eb8fe65e521a3de44d45fe864109779c3a8e4bd1 SHA512 7ddd91f8d1a1b9f6d984a5bfddd98705dd6f7e3d6b4f81c1e03d971c93e33bff09b641bc2ad0a0d9d2e44170063550ad0399f3e28237dd34b8ad6200d8b197e8 WHIRLPOOL f1d313aa2dee7f4238190b90c10dc951a31302563a8a098e69ed740e85f428ac360b363e44f1e618f2d97782b5532846df290e9f79f11abdc7648a1e380cb44e
+DIST xemacs-21.4.24.tar.gz 8543879 SHA256 9016a51496d4978cf3dba75000a8e38bfc8cb4ca3a3f3e71371aa19259f26cd5 SHA512 b7a88d5a4a9f74f74c2067ed60f7ea87ac8ccad5d9c2c1033ecf07f540250191f8fa5f9e6d23d9fedd0f2ab1eb5ea6c29a7665a310ec512d85e2e4f337447213 WHIRLPOOL 469d52341833037e22cebeb6b554435c81b3f5749f64d86ddf31c3990dfc08a57f49fab7e868ab8c2009d1cae665f4fd731813f25c942d5aafd287ad7736a049
+DIST xemacs-21.5.34.tar.gz 15816932 SHA256 33cc54a6a9a45224a64b6c57c8138b5a5f0f1be368951a6d9ec8c0aec5993ee5 SHA512 b61d88fe530a77b88c2ed0cecd6597ed3c265450bc61f7c6823920f774b2d566ef6fc18a6c33928d846d08d465617d4ccd3c4656606ec8634127a683abbc929a WHIRLPOOL 733aabc45309ff4172ab77492dd85e71f156722f2e06d9a185c0a4260b9fbea607ff8a41dc43fc009cb8cdf3f05d4523778610a501f27a4917ab43cea03c6209
+EBUILD xemacs-21.4.22-r4.ebuild 7280 SHA256 786de73c7f730be19301d9bd5bd0a356fb00751e8081241b2ebdd9f138dfc60b SHA512 138ff46f7bee2db19ae21f75e74ae78675c34092831c488db9c967d972986d1b4e5f9e07bcff2151b1a6108f23e596fcd31d4d8d524a249dac1a6a4849bd913a WHIRLPOOL f75ac7afe821c18a30865b504fc2ed33db4c585f46b01f92a5f3c32abc670a8ef27bf2424c9f7aa984725ba87394c0fe2ec713bf2b30914583ea0ac963543016
+EBUILD xemacs-21.4.24-r1.ebuild 6962 SHA256 05ed21fbc4abc06add6583abcb562b5279f494aa7cee965b5ff37edebcce0251 SHA512 9600bcacf389cbdf18670d1fba9418092c82ba96d3c7d2d89b54b6164d8645440c5d199801e53d7d566c848ff7c478cba7450166e87137615eb6e10e3d421a9f WHIRLPOOL e4096041e8eb0a22582a6ecc894abf24556a364b89021c819d8916acb94760d26cb51b8c91cd3a34b6d02486a59bf64e5871235bc7d4ffe4ccd303af48a50616
+EBUILD xemacs-21.4.24.ebuild 7012 SHA256 f76c8d5370a685b3969a6d4d48fec00e9e0217fbe6a01e9c6636a7c647278251 SHA512 fa52a8d8dce88546644801254a9c98b533725dd4cf7b412504b06de079fe07e89f9e08711a3250f67702dae1b4c5c242f003c45a456e7a4c48d59892b36d3b7f WHIRLPOOL 8eacb0df27ff4df47da13c5eb611dccda005b983b1ae04c06dfcf8c01ef1577b0063f1f1baea6b152b4fedbe7587cfbddf2cca3a67d0bf04307d29722113ae81
+EBUILD xemacs-21.5.34-r4.ebuild 7157 SHA256 7997065025ae528acbdcd1a00c4124fd7cb31ee4f93bf8bed88069f46b0f58fb SHA512 7d684732229228dd73635f9a8608822ea9402faa98120d7c2aab55df66a9e3b1c568ec0fe8d3cc9f2203676129081ef07fe784b3e6328bb617eddfc3c7f12bf0 WHIRLPOOL 8c67f28c41270013ee99706993a1650580e1df86431528cd5b8225a49fee6b00bdfa923ca31fb61803893ff8c6d0a644a9d40595304d2bf885a882b050479b9c
+MISC ChangeLog 4632 SHA256 305da3c9b0a1d61f320521b4c36c955ab10edabc6c8346307d372cf1494ea275 SHA512 36c9225f158fd991a83f3690b50428cdd7286273f0a3434a0b7c6c6d6a58f4110c04c130d054aaa6170383e8a837c8052c2930806dba4587f559465eacd15644 WHIRLPOOL c8e33a9a827b3b2c12816f289c5169a238237ab452718c5656db2080410e1fe5d3f67fa57dbad3811145a1535ef0aa8905d6addf5669534ac8e36a7ce34c2517
+MISC ChangeLog-2015 33697 SHA256 71e74f83c2f6bb00e7a8f620d879764a0a02f93377034954681d325c529947fa SHA512 bbeae790ec4eb870d3e3019417cce754566a849ab6d90f79ffffdbb41b928659fb5e7ef91687d5d17d00f74992f3523fd3197b9d774c10563d0940a9f33ea31a WHIRLPOOL 60fe82bfd7ac47095b131480d8bce9d1fdfecb2b29124afa83994467f40cb59a0357b5bc17ac1d813321cb30b35a908c0c137d6b6e11d18b85ed9e1191792965
+MISC metadata.xml 666 SHA256 373ac229fb00f2e4792259b81c7d292a55bf8f240b22f5589e3902a2e04db026 SHA512 e106c48dd98ac741c2fe9780e86f77a339957ecb490b0f33b88e65b61724f8f96531c8cc6075bd724e97ea4efb9b7e4cae5d7a33fe51e5693fd04734d83c135a WHIRLPOOL 0b65393223129842df7435c9a74e0238a68e2884dc1d96b6fecdde7442f5c9690b16b5510c793e0c1c13412fb320ce7bb80b8bcf205373010e84698b7ee8f897
diff --git a/app-editors/xemacs/files/README.Gentoo b/app-editors/xemacs/files/README.Gentoo
new file mode 100644
index 000000000000..abb71cc90988
--- /dev/null
+++ b/app-editors/xemacs/files/README.Gentoo
@@ -0,0 +1,45 @@
+README.Gentoo
+-------------
+
+This is a quick tutorial on how to configure the XEmacs package user
+interface (package-ui). After you configure package-ui, you will be
+able to download and install XEmacs packages and dependencies while in
+XEmacs. For the complete documentation, see
+/usr/share/doc/xemacs-21.4.*/README.packages.gz
+
+Once XEmacs is emerged onto a Gentoo Linux system, you will only have
+the following elisp modules installed: xemacs-base, efs and
+(optionally if you had mule in USE) mule-base. This guide will show
+how to use package-ui to download and install your own preference in
+elisp modules to ~/.xemacs/xemacs-packages.
+
+First, start XEmacs and load the package-ui elisp module.
+
+ M-x load-library RET package-ui RET
+
+The first thing to set is the download site (package-ui installs via
+network).
+
+ M-x customize-variable RET package-get-remote RET
+
+Insert a new value, then:
+
+ Choice: Remote
+ Host: ibiblio.org
+ Directory: /pub/packages/editors/xemacs/packages/
+
+Make sure you set and save the change. Note, other host/directories
+are possible. The the documentation for package-ui for more
+information. Hint: ibiblio.org is *fast*.
+
+Then set the location package-ui should install to:
+
+ M-x customize-variable RET pui-package-install-dest-dir RET
+
+ Directory: ~/.xemacs/xemacs-packages
+
+Make sure you set and save the change.
+
+At this point you can install your modules:
+
+ M-x pui-list-packages
diff --git a/app-editors/xemacs/files/xemacs-21.4.19-db.patch b/app-editors/xemacs/files/xemacs-21.4.19-db.patch
new file mode 100644
index 000000000000..cf87d60e628a
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.19-db.patch
@@ -0,0 +1,84 @@
+This patch fixes several database-related problems.
+
+dbm_open has been moved into gdbm_compat, so we check for that and include it.
+
+ndbm.h is located in /usr/include/gdbm on Gentoo, so we only check
+there, given that we don't support normal dbm installations, and we
+patch database.c as well. Not portable beyond Gentoo, but will work
+for us.
+
+The checks for Berkeley DB only took into account up to version
+3. Added checks to deal with several versions 4 as well.
+
+--- xemacs-21.4.19/configure.in 2005-12-24 01:48:14.000000000 +0100
++++ xemacs-21.4.19-db/configure.in 2006-06-11 22:43:52.000000000 +0200
+@@ -4502,7 +4502,7 @@
+
+ dnl Check for ndbm.h, required for either kind of DBM support.
+ if test "$with_database_gdbm $with_database_dbm" != "no no"; then
+- AC_CHECK_HEADER(ndbm.h, [:], [
++ AC_CHECK_HEADER(gdbm/ndbm.h, [:], [
+ test "$with_database_gdbm" = "yes" -o \
+ "$with_database_dbm" = "yes" && \
+ XE_DIE("Required DBM support cannot be provided.")
+@@ -4513,10 +4513,13 @@
+ if test "$with_database_gdbm" != "no"; then
+ AC_CHECK_LIB(gdbm, dbm_open, [
+ with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm], [
++ AC_CHECK_LIB(gdbm_compat, dbm_open, [
++ with_database_gdbm=yes with_database_dbm=no libdbm="-lgdbm_compat -lgdbm"], [
+ if test "$with_database_gdbm" = "yes"; then
+ XE_DIE("Required GNU DBM support cannot be provided.")
+ fi
+- with_database_gdbm=no])
++ with_database_gdbm=no], -lgdbm)
++ ])
+ fi
+
+ dnl Check for DBM support in libc and libdbm.
+@@ -4614,11 +4617,30 @@
+ #if DB_VERSION_MAJOR > 2
+ yes
+ #endif
+-], [AC_MSG_RESULT(3); dbfunc=db_create],[
+- AC_MSG_RESULT(2); dbfunc=db_open])],[
+- AC_MSG_RESULT(1); dbfunc=dbopen])
++], [AC_EGREP_CPP(yes,
++[#include <$db_h_file>
++#if DB_VERSION_MAJOR > 3
++yes
++#endif
++], [AC_MSG_RESULT(4); dbfunc=db_create; dbver=4],[
++ AC_MSG_RESULT(3); dbfunc=db_create; dbver=3])],[
++ AC_MSG_RESULT(2); dbfunc=db_open; dbver=2])],[
++ AC_MSG_RESULT(1); dbfunc=dbopen; dbver=1])
+ AC_CHECK_FUNC($dbfunc, with_database_berkdb=yes need_libdb=no, [
+- AC_CHECK_LIB(db, $dbfunc, with_database_berkdb=yes need_libdb=yes)])
++ AC_CHECK_LIB(db, db_create_4002, with_database_berkdb=yes need_libdb=yes)])
++ fi
++
++ dnl Berk db 4.1 decorates public functions with version information
++ if test "$have_database_berkdb" != "yes" -a "$dbver" = "4"; then
++ rm -f $tempcname
++ echo "#include <$db_h_file>" > $tempcname
++ echo "configure___ dbfunc=db_create" >> $tempcname
++ define(TAB, [ ])dnl
++ eval `$CPP -Isrc $tempcname \
++ | sed -n -e "s/[[ TAB]]*=[[ TAB\"]]*/='/" -e "s/[[ TAB\"]]*\$/'/" -e "s/^configure___//p"`
++ rm -f $tempcname
++ AC_MSG_WARN("db_create is really $dbfunc")
++ AC_CHECK_LIB(db, $dbfunc, have_database_berkdb=yes need_libdb=yes)
+ fi
+
+ if test "$with_database_berkdb" = "yes"; then
+--- xemacs-21.4.19/src/database.c 2005-12-24 01:52:35.000000000 +0100
++++ xemacs-21.4.19-db/src/database.c 2006-06-13 21:00:01.000000000 +0200
+@@ -82,7 +82,7 @@
+ #endif /* HAVE_BERKELEY_DB */
+
+ #ifdef HAVE_DBM
+-#include <ndbm.h>
++#include <gdbm/ndbm.h>
+ Lisp_Object Qdbm;
+ #endif /* HAVE_DBM */
+
diff --git a/app-editors/xemacs/files/xemacs-21.4.19-texi.patch b/app-editors/xemacs/files/xemacs-21.4.19-texi.patch
new file mode 100644
index 000000000000..f53eb3dafd31
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.19-texi.patch
@@ -0,0 +1,33 @@
+Index: emodules.texi
+===================================================================
+RCS file: /pack/xemacscvs/XEmacs/xemacs/man/emodules.texi,v
+retrieving revision 1.2.2.2
+diff -u -B -r1.2.2.2 emodules.texi
+--- man/emodules.texi 2002/08/20 11:35:22 1.2.2.2
++++ man/emodules.texi 2006/12/09 14:21:22
+@@ -3,6 +3,9 @@
+ @c %**start of header
+ @setfilename ../info/emodules.info
+ @settitle Extending Emacs using C Modules
++@direntry
++* Emodules: (emodules). XEmacs dynamically loadable module support.
++@end direntry
+ @c %**end of header
+
+ @c
+Index: external-widget.texi
+===================================================================
+RCS file: /pack/xemacscvs/XEmacs/xemacs/man/external-widget.texi,v
+retrieving revision 1.3.2.1
+diff -u -B -r1.3.2.1 external-widget.texi
+--- man/external-widget.texi 2002/04/30 16:06:06 1.3.2.1
++++ man/external-widget.texi 2006/12/09 14:21:22
+@@ -4,7 +4,7 @@
+ @ifinfo
+ @dircategory XEmacs Editor
+ @direntry
+-* External Widget: (external-widget) External Client Widget.
++* External Widget: (external-widget). External Client Widget.
+ @end direntry
+ @end ifinfo
+
diff --git a/app-editors/xemacs/files/xemacs-21.4.21-vcdiff.patch b/app-editors/xemacs/files/xemacs-21.4.21-vcdiff.patch
new file mode 100644
index 000000000000..105eb549eb6d
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.21-vcdiff.patch
@@ -0,0 +1,19 @@
+--- lib-src/vcdiff.~1~ 1996-12-18 23:42:33.000000000 +0100
++++ lib-src/vcdiff 2008-04-09 08:20:36.000000000 +0200
+@@ -79,14 +79,14 @@
+ case $f in
+ s.* | */s.*)
+ if
+- rev1=/tmp/geta$$
++ rev1=`mktemp /tmp/geta.XXXXXXXX`
+ get -s -p -k $sid1 "$f" > $rev1 &&
+ case $sid2 in
+ '')
+ workfile=`expr " /$f" : '.*/s.\(.*\)'`
+ ;;
+ *)
+- rev2=/tmp/getb$$
++ rev2=`mktemp /tmp/getb.XXXXXXXX`
+ get -s -p -k $sid2 "$f" > $rev2
+ workfile=$rev2
+ esac
diff --git a/app-editors/xemacs/files/xemacs-21.4.22-deprecated-ldap.patch b/app-editors/xemacs/files/xemacs-21.4.22-deprecated-ldap.patch
new file mode 100644
index 000000000000..aceae530bcb0
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.22-deprecated-ldap.patch
@@ -0,0 +1,18 @@
+Patch to include depracated LDAP symbols, specifically
+ldap_open. Without the proper prototype the call will almost surely
+lead to crashes on 64-bit arches otherwise. Thanks to hwoareng for the
+initial bug report.
+
+Not reported upstream since bug tracker is down.
+
+--- src/eldap.h.~1~ 2001-04-12 20:23:36.000000000 +0200
++++ src/eldap.h 2010-09-28 19:53:34.148472315 +0200
+@@ -21,6 +21,8 @@
+ #ifndef INCLUDED_eldap_h_
+ #define INCLUDED_eldap_h_
+
++#define LDAP_DEPRECATED 1
++
+ #include <lber.h>
+ #include <ldap.h>
+
diff --git a/app-editors/xemacs/files/xemacs-21.4.22-large-images.patch b/app-editors/xemacs/files/xemacs-21.4.22-large-images.patch
new file mode 100644
index 000000000000..a03af3ccfa38
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.22-large-images.patch
@@ -0,0 +1,122 @@
+PATCH 21.4
+
+Here is the 21.4 version of the previous patch. The lisp.h hunk is a
+little ugly. Recommendations on how to deal with the absence of
+UINT_64_T in 21.4 are welcome.
+
+Index: src/glyphs-eimage.c
+===================================================================
+RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-eimage.c,v
+retrieving revision 1.9.2.5
+diff -d -u -r1.9.2.5 glyphs-eimage.c
+--- src/glyphs-eimage.c 2007/08/20 19:52:28 1.9.2.5
++++ src/glyphs-eimage.c 2009/07/01 22:36:04
+@@ -407,6 +407,7 @@
+ */
+
+ {
++ UINT_64_BIT pixels_sq;
+ int jpeg_gray = 0; /* if we're dealing with a grayscale */
+ /* Step 4: set parameters for decompression. */
+
+@@ -429,7 +430,10 @@
+ jpeg_start_decompress (&cinfo);
+
+ /* Step 6: Read in the data and put into EImage format (8bit RGB triples)*/
+-
++ pixels_sq =
++ (UINT_64_BIT) cinfo.output_width * (UINT_64_BIT) cinfo.output_height;
++ if (pixels_sq > ((size_t) -1) / 3)
++ signal_image_error ("JPEG image too large to instantiate", instantiator);
+ unwind.eimage = (unsigned char*) xmalloc (cinfo.output_width * cinfo.output_height * 3);
+ if (!unwind.eimage)
+ signal_image_error("Unable to allocate enough memory for image", instantiator);
+@@ -671,6 +675,7 @@
+ {
+ ColorMapObject *cmo = unwind.giffile->SColorMap;
+ int i, j, row, pass, interlace, slice;
++ UINT_64_BIT pixels_sq;
+ unsigned char *eip;
+ /* interlaced gifs have rows in this order:
+ 0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ... */
+@@ -679,6 +684,9 @@
+
+ height = unwind.giffile->SHeight;
+ width = unwind.giffile->SWidth;
++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
++ if (pixels_sq > ((size_t) -1) / (3 * unwind.giffile->ImageCount))
++ signal_image_error ("GIF image too large to instantiate", instantiator);
+ unwind.eimage = (unsigned char*)
+ xmalloc (width * height * 3 * unwind.giffile->ImageCount);
+ if (!unwind.eimage)
+@@ -937,11 +945,15 @@
+ {
+ int y;
+ unsigned char **row_pointers;
++ UINT_64_BIT pixels_sq;
+ height = info_ptr->height;
+ width = info_ptr->width;
++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
++ if (pixels_sq > ((size_t) -1) / 3)
++ signal_image_error ("PNG image too large to instantiate", instantiator);
+
+ /* Wow, allocate all the memory. Truly, exciting. */
+- unwind.eimage = xnew_array_and_zero (unsigned char, width * height * 3);
++ unwind.eimage = xnew_array_and_zero (unsigned char, pixels_sq * 3);
+ /* libpng expects that the image buffer passed in contains a
+ picture to draw on top of if the png has any transparencies.
+ This could be a good place to pass that in... */
+@@ -994,7 +1006,7 @@
+ png_set_expand (png_ptr);
+ /* send grayscale images to RGB too */
+ if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ png_set_gray_to_rgb (png_ptr);
+ /* we can't handle alpha values */
+ if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+@@ -1268,6 +1280,7 @@
+
+ uint32 *raster;
+ unsigned char *ep;
++ UINT_64_BIT pixels_sq;
+
+ assert (!NILP (data));
+
+@@ -1290,12 +1303,15 @@
+
+ TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height);
+- unwind.eimage = (unsigned char *) xmalloc (width * height * 3);
++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
++ if (pixels_sq >= 1 << 29)
++ signal_image_error ("TIFF image too large to instantiate", instantiator);
++ unwind.eimage = (unsigned char *) xmalloc (pixels_sq * 3);
+
+ /* #### This is little more than proof-of-concept/function testing.
+ It needs to be reimplemented via scanline reads for both memory
+ compactness. */
+- raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32));
++ raster = (uint32*) _TIFFmalloc ((tsize_t) (pixels_sq * sizeof (uint32)));
+ if (raster != NULL)
+ {
+ int i,j;
+Index: src/lisp.h
+===================================================================
+RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
+retrieving revision 1.45.2.10
+diff -d -u -r1.45.2.10 lisp.h
+--- src/lisp.h 2005/02/01 03:55:02 1.45.2.10
++++ src/lisp.h 2009/07/01 22:36:05
+@@ -265,6 +265,11 @@
+ /*#define REGISTER register*/
+ /*#endif*/
+
++#if SIZEOF_LONG == 8
++#define UINT_64_BIT unsigned long
++#elif SIZEOF_LONG_LONG == 8
++#define UINT_64_BIT unsigned long long
++#endif
+
+ /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
+ In particular, it must be large enough to contain a pointer.
diff --git a/app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch b/app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch
new file mode 100644
index 000000000000..0143e375d749
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.22-libpng15.patch
@@ -0,0 +1,66 @@
+diff -ur xemacs-21.4.22.orig/src/glyphs-eimage.c xemacs-21.4.22/src/glyphs-eimage.c
+--- xemacs-21.4.22.orig/src/glyphs-eimage.c 2011-09-26 19:44:57.889720996 +0300
++++ xemacs-21.4.22/src/glyphs-eimage.c 2011-09-26 19:48:07.026226254 +0300
+@@ -946,8 +946,8 @@
+ int y;
+ unsigned char **row_pointers;
+ UINT_64_BIT pixels_sq;
+- height = info_ptr->height;
+- width = info_ptr->width;
++ height = png_get_image_height(png_ptr, info_ptr);
++ width = png_get_image_width(png_ptr, info_ptr);
+ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
+ if (pixels_sq > ((size_t) -1) / 3)
+ signal_image_error ("PNG image too large to instantiate", instantiator);
+@@ -1002,22 +1002,22 @@
+ /* Now that we're using EImage, ask for 8bit RGB triples for any type
+ of image*/
+ /* convert palette images to full RGB */
+- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE)
+ png_set_expand (png_ptr);
+ /* send grayscale images to RGB too */
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
++ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
+ png_set_gray_to_rgb (png_ptr);
+ /* we can't handle alpha values */
+- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
++ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
+ png_set_strip_alpha (png_ptr);
+ /* tell libpng to strip 16 bit depth files down to 8 bits */
+- if (info_ptr->bit_depth == 16)
++ if (png_get_bit_depth(png_ptr, info_ptr) == 16)
+ png_set_strip_16 (png_ptr);
+ /* if the image is < 8 bits, pad it out */
+- if (info_ptr->bit_depth < 8)
++ if (png_get_bit_depth(png_ptr, info_ptr) < 8)
+ {
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY)
+ png_set_expand (png_ptr);
+ else
+ png_set_packing (png_ptr);
+@@ -1036,16 +1036,18 @@
+ */
+ {
+ int i;
++ png_textp text;
++ int num_text;
+
+- for (i = 0 ; i < info_ptr->num_text ; i++)
++ for (i = 0 ; i < num_text ; i++)
+ {
+ /* How paranoid do I have to be about no trailing NULLs, and
+ using (int)info_ptr->text[i].text_length, and strncpy and a temp
+ string somewhere? */
+
+ warn_when_safe (Qpng, Qinfo, "%s - %s",
+- info_ptr->text[i].key,
+- info_ptr->text[i].text);
++ text[i].key,
++ text[i].text);
+ }
+ }
+ #endif
diff --git a/app-editors/xemacs/files/xemacs-21.4.22-texinfo-5.patch b/app-editors/xemacs/files/xemacs-21.4.22-texinfo-5.patch
new file mode 100644
index 000000000000..05dda3974a65
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.22-texinfo-5.patch
@@ -0,0 +1,437 @@
+--- xemacs-21.4.22-orig/man/custom.texi
++++ xemacs-21.4.22/man/custom.texi
+@@ -60,7 +60,7 @@
+
+ @node Declaring Groups, Declaring Variables, Top, Top
+ @comment node-name, next, previous, up
+-@section Declaring Groups
++@chapter Declaring Groups
+
+ Use @code{defgroup} to declare new customization groups.
+
+@@ -92,7 +92,7 @@
+
+ @node Declaring Variables, Declaring Faces, Declaring Groups, Top
+ @comment node-name, next, previous, up
+-@section Declaring Variables
++@chapter Declaring Variables
+
+ Use @code{defcustom} to declare user editable variables.
+
+@@ -176,7 +176,7 @@
+
+ @node Declaring Faces, Usage for Package Authors, Declaring Variables, Top
+ @comment node-name, next, previous, up
+-@section Declaring Faces
++@chapter Declaring Faces
+
+ Faces are declared with @code{defface}.
+
+@@ -228,7 +228,7 @@
+
+ @node Usage for Package Authors, Utilities, Declaring Faces, Top
+ @comment node-name, next, previous, up
+-@section Usage for Package Authors
++@chapter Usage for Package Authors
+
+ The recommended usage for the author of a typical emacs lisp package is
+ to create one group identifying the package, and make all user options
+@@ -244,7 +244,7 @@
+
+ @node Utilities, The Init File, Usage for Package Authors, Top
+ @comment node-name, next, previous, up
+-@section Utilities
++@chapter Utilities
+
+ These utilities can come in handy when adding customization support.
+
+@@ -276,7 +276,7 @@
+
+ @node The Init File, Wishlist, Utilities, Top
+ @comment node-name, next, previous, up
+-@section The Init File
++@chapter The Init File
+
+ Customizations are saved to the file specified by @code{custom-file}, as
+ calls to @code{custom-set-variables} and @code{custom-set-faces}.
+@@ -299,7 +299,7 @@
+
+ @node Wishlist, , The Init File, Top
+ @comment node-name, next, previous, up
+-@section Wishlist
++@chapter Wishlist
+
+ @itemize @bullet
+ @item
+--- xemacs-21.4.22-orig/man/info.texi
++++ xemacs-21.4.22/man/info.texi
+@@ -543,6 +543,10 @@
+ @c If a menu appears at the end of this node, remove it.
+ @c It is an accident of the menu updating command.
+
++@menu
++* Help-Cross::
++@end menu
++
+ @node Help-Cross, , , Help-Adv
+ @subsection The node reached by the cross reference in Info
+
+--- xemacs-21.4.22-orig/man/lispref/edebug-inc.texi
++++ xemacs-21.4.22/man/lispref/edebug-inc.texi
+@@ -1103,7 +1103,7 @@
+ Here is a table of the possibilities for @var{specification} and how each
+ directs processing of arguments.
+
+-@table @bullet
++@table @asis
+
+ @item @code{t}
+ All arguments are instrumented for evaluation.
+--- xemacs-21.4.22-orig/man/lispref/packaging.texi
++++ xemacs-21.4.22/man/lispref/packaging.texi
+@@ -600,7 +600,7 @@
+ Does most of the work. Builds the elcs, infos at a minimum.
+ @end table
+
+-@subsection The targets that most people would be interested in would be:
++@section The targets that most people would be interested in would be:
+
+ @itemize @bullet
+ @item @code{all}
+--- xemacs-21.4.22-orig/man/term.texi
++++ xemacs-21.4.22/man/term.texi
+@@ -4,7 +4,7 @@
+
+ @titlepage
+ @sp 6
+-@center @titlefont(Notes about Emacs TERM Mode)
++@center @titlefont{Notes about Emacs TERM Mode}
+ @end titlepage
+
+ @ifinfo
+--- xemacs-21.4.22-orig/man/widget.texi
++++ xemacs-21.4.22/man/widget.texi
+@@ -38,7 +38,7 @@
+
+ @node Introduction, User Interface, Top, Top
+ @comment node-name, next, previous, up
+-@section Introduction
++@chapter Introduction
+
+ Most graphical user interface toolkits, such as Motif and XView, provide
+ a number of standard user interface controls (sometimes known as
+@@ -129,7 +129,7 @@
+
+ @node User Interface, Programming Example, Introduction, Top
+ @comment node-name, next, previous, up
+-@section User Interface
++@chapter User Interface
+
+ A form consists of read only text for documentation and some fields,
+ where each of the fields contains two parts, a tag and a value. The
+@@ -175,7 +175,7 @@
+ a form, namely editing the editable text fields and activating the
+ buttons.
+
+-@subsection Editable Text Fields
++@section Editable Text Fields
+
+ In the example, the value for the @samp{Name} is most likely displayed
+ in an editable text field, and so are values for each of the members of
+@@ -194,7 +194,7 @@
+ Face used for other editing fields.
+ @end deffn
+
+-@subsection Buttons
++@section Buttons
+
+ Some portions of the buffer have an associated @dfn{action}, which can
+ be @dfn{invoked} by a standard key or mouse command. These portions
+@@ -259,7 +259,7 @@
+ Face used for buttons when the mouse pointer is above it.
+ @end defopt
+
+-@subsection Navigation
++@section Navigation
+
+ You can use all the normal Emacs commands to move around in a form
+ buffer, plus you will have these additional commands:
+@@ -277,7 +277,7 @@
+
+ @node Programming Example, Setting Up the Buffer, User Interface, Top
+ @comment node-name, next, previous, up
+-@section Programming Example
++@chapter Programming Example
+
+ Here is the code to implement the user interface example (see @ref{User
+ Interface}).
+@@ -369,7 +369,7 @@
+
+ @node Setting Up the Buffer, Basic Types, Programming Example, Top
+ @comment node-name, next, previous, up
+-@section Setting Up the Buffer
++@chapter Setting Up the Buffer
+
+ Widgets are created with @code{widget-create}, which returns a
+ @dfn{widget} object. This object can be queried and manipulated by
+@@ -422,7 +422,7 @@
+
+ @node Basic Types, Sexp Types, Setting Up the Buffer, Top
+ @comment node-name, next, previous, up
+-@section Basic Types
++@chapter Basic Types
+
+ The syntax of a type specification is given below:
+
+@@ -635,7 +635,7 @@
+
+ @node link, url-link, Basic Types, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{link} Widget
++@section The @code{link} Widget
+
+ Syntax:
+
+@@ -659,7 +659,7 @@
+
+ @node url-link, info-link, link, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{url-link} Widget
++@section The @code{url-link} Widget
+
+ Syntax:
+
+@@ -672,7 +672,7 @@
+
+ @node info-link, push-button, url-link, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{info-link} Widget
++@section The @code{info-link} Widget
+
+ Syntax:
+
+@@ -685,7 +685,7 @@
+
+ @node push-button, editable-field, info-link, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{push-button} Widget
++@section The @code{push-button} Widget
+
+ Syntax:
+
+@@ -709,7 +709,7 @@
+
+ @node editable-field, text, push-button, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{editable-field} Widget
++@section The @code{editable-field} Widget
+
+ Syntax:
+
+@@ -753,7 +753,7 @@
+
+ @node text, menu-choice, editable-field, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{text} Widget
++@section The @code{text} Widget
+
+ This is just like @code{editable-field}, but intended for multiline text
+ fields. The default @code{:keymap} is @code{widget-text-keymap}, which
+@@ -761,7 +761,7 @@
+
+ @node menu-choice, radio-button-choice, text, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{menu-choice} Widget
++@section The @code{menu-choice} Widget
+
+ Syntax:
+
+@@ -796,7 +796,7 @@
+
+ @node radio-button-choice, item, menu-choice, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{radio-button-choice} Widget
++@section The @code{radio-button-choice} Widget
+
+ Syntax:
+
+@@ -856,7 +856,7 @@
+
+ @node item, choice-item, radio-button-choice, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{item} Widget
++@section The @code{item} Widget
+
+ Syntax:
+
+@@ -870,7 +870,7 @@
+
+ @node choice-item, toggle, item, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{choice-item} Widget
++@section The @code{choice-item} Widget
+
+ Syntax:
+
+@@ -886,7 +886,7 @@
+
+ @node toggle, checkbox, choice-item, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{toggle} Widget
++@section The @code{toggle} Widget
+
+ Syntax:
+
+@@ -914,7 +914,7 @@
+
+ @node checkbox, checklist, toggle, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{checkbox} Widget
++@section The @code{checkbox} Widget
+
+ The widget has two possible states, `selected' and `unselected', which
+ corresponds to a @code{t} or @code{nil} value.
+@@ -927,7 +927,7 @@
+
+ @node checklist, editable-list, checkbox, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{checklist} Widget
++@section The @code{checklist} Widget
+
+ Syntax:
+
+@@ -978,7 +978,7 @@
+
+ @node editable-list, group, checklist, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{editable-list} Widget
++@section The @code{editable-list} Widget
+
+ Syntax:
+
+@@ -1030,7 +1030,7 @@
+
+ @node group, , editable-list, Basic Types
+ @comment node-name, next, previous, up
+-@subsection The @code{group} Widget
++@section The @code{group} Widget
+
+ This widget simply groups other widgets together.
+
+@@ -1044,7 +1044,7 @@
+
+ @node Sexp Types, Widget Properties, Basic Types, Top
+ @comment
+-@section Sexp Types
++@chapter Sexp Types
+
+ A number of widgets for editing s-expressions (lisp types) are also
+ available. These basically fall in the following categories.
+@@ -1058,7 +1058,7 @@
+
+ @node constants, generic, Sexp Types, Sexp Types
+ @comment node-name, next, previous, up
+-@subsection The Constant Widgets.
++@section The Constant Widgets.
+
+ The @code{const} widget can contain any lisp expression, but the user is
+ prohibited from editing it, which is mainly useful as a component of one
+@@ -1094,7 +1094,7 @@
+
+ @node generic, atoms, constants, Sexp Types
+ @comment node-name, next, previous, up
+-@subsection Generic Sexp Widget.
++@section Generic Sexp Widget.
+
+ The @code{sexp} widget can contain any lisp expression, and allows the
+ user to edit it inline in the buffer.
+@@ -1115,7 +1115,7 @@
+
+ @node atoms, composite, generic, Sexp Types
+ @comment node-name, next, previous, up
+-@subsection Atomic Sexp Widgets.
++@section Atomic Sexp Widgets.
+
+ The atoms are s-expressions that does not consist of other
+ s-expressions. A string is an atom, while a list is a composite type.
+@@ -1192,7 +1192,7 @@
+
+ @node composite, , atoms, Sexp Types
+ @comment node-name, next, previous, up
+-@subsection Composite Sexp Widgets.
++@section Composite Sexp Widgets.
+
+ The syntax for the composite are
+
+@@ -1265,7 +1265,7 @@
+
+ @node Widget Properties, Defining New Widgets, Sexp Types, Top
+ @comment node-name, next, previous, up
+-@section Properties
++@chapter Properties
+
+ You can examine or set the value of a widget by using the widget object
+ that was returned by @code{widget-create}.
+@@ -1353,7 +1353,7 @@
+
+ @node Defining New Widgets, Widget Browser, Widget Properties, Top
+ @comment node-name, next, previous, up
+-@section Defining New Widgets
++@chapter Defining New Widgets
+
+ You can define specialized widgets with @code{define-widget}. It allows
+ you to create a shorthand for more complex widgets. This includes
+@@ -1565,7 +1565,7 @@
+
+ @node Widget Browser, Widget Minor Mode, Defining New Widgets, Top
+ @comment node-name, next, previous, up
+-@section Widget Browser
++@chapter Widget Browser
+
+ There is a separate package to browse widgets. This is intended to help
+ programmers who want to examine the content of a widget. The browser
+@@ -1589,7 +1589,7 @@
+
+ @node Widget Minor Mode, Utilities, Widget Browser, Top
+ @comment node-name, next, previous, up
+-@section Widget Minor Mode
++@chapter Widget Minor Mode
+
+ There is a minor mode for manipulating widgets in major modes that
+ doesn't provide any support for widgets themselves. This is mostly
+@@ -1606,7 +1606,7 @@
+
+ @node Utilities, Widget Wishlist, Widget Minor Mode, Top
+ @comment node-name, next, previous, up
+-@section Utilities.
++@chapter Utilities.
+
+ @defun widget-prompt-value widget prompt [ value unbound ]
+ Prompt for a value matching @var{widget}, using @var{prompt}.@*
+@@ -1621,7 +1621,7 @@
+
+ @node Widget Wishlist, Widget Internals, Utilities, Top
+ @comment node-name, next, previous, up
+-@section Wishlist
++@chapter Wishlist
+
+ @itemize @bullet
+ @item
+@@ -1693,7 +1693,7 @@
+ @end itemize
+
+ @node Widget Internals, , Widget Wishlist, Top
+-@section Internals
++@chapter Internals
+
+ This (very brief!) section provides a few notes on the internal
+ structure and implementation of Emacs widgets. Avoid relying on this
+@@ -1701,7 +1701,7 @@
+ To the extent that it actually describes APIs, the information will be
+ moved to appropriate sections of the manual in due course.
+
+-@subsection The @dfn{Widget} and @dfn{Type} Structures
++@section The @dfn{Widget} and @dfn{Type} Structures
+
+ Widgets and types are currently both implemented as lists.
+
diff --git a/app-editors/xemacs/files/xemacs-21.4.24-gcc5.patch b/app-editors/xemacs/files/xemacs-21.4.24-gcc5.patch
new file mode 100644
index 000000000000..494fc51c3b88
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.24-gcc5.patch
@@ -0,0 +1,32 @@
+diff -r e2da872593c0 configure.in
+--- a/configure.in Tue Mar 24 22:15:53 2015 -0400
++++ b/configure.in Sun Mar 13 13:48:24 2016 +0100
+@@ -1939,6 +1939,8 @@
+ CFLAGS="-g -O3 -Wall -Wno-switch -Winline -Wmissing-prototypes"
+ dnl Yuck, bad compares have been worth at least 3 crashes!
+ CFLAGS="$CFLAGS -Wsign-compare"
++ dnl Use old gnu inline semantics until we fix the source
++ CFLAGS="$CFLAGS -fgnu89-inline"
+ dnl XEmacs is known not to be strict-aliasing-safe.
+ case "`gcc -v --help 2>&1`" in
+ *-fstrict-aliasing* ) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
+diff -r e2da872593c0 src/lisp.h
+--- a/src/lisp.h Tue Mar 24 22:15:53 2015 -0400
++++ b/src/lisp.h Sun Mar 13 13:48:24 2016 +0100
+@@ -193,6 +193,8 @@
+ # endif /* GNUC */
+ #endif
+
++#ifndef _GCC_MAX_ALIGN_T
++#define _GCC_MAX_ALIGN_T
+ /* No type has a greater alignment requirement than max_align_t.
+ (except perhaps for types we don't use, like long double) */
+ typedef union
+@@ -202,6 +204,7 @@
+ struct { void (*f)(void); } f;
+ struct { double d; } d;
+ } max_align_t;
++#endif
+
+ #ifndef ALIGNOF
+ # if defined (__GNUC__) && (__GNUC__ >= 2)
diff --git a/app-editors/xemacs/files/xemacs-21.4.24-glibc-macro.patch b/app-editors/xemacs/files/xemacs-21.4.24-glibc-macro.patch
new file mode 100644
index 000000000000..62d26ccc053c
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.24-glibc-macro.patch
@@ -0,0 +1,28 @@
+Don't define deprecated glibc symbol
+
+Avoid defining the deprecated symbols _BSD_SOURCE and _SVID_SOURCE
+that xmkmf thinks are needed to compile X programs.
+
+diff -r 09d56098ea2c -r 32a8151f8af7 configure.in
+--- a/configure.in Sat Feb 11 01:24:06 2017 +0100
++++ b/configure.in Sat Feb 11 01:59:40 2017 +0100
+@@ -2868,10 +2868,15 @@
+ * ) val=1 ;;
+ esac
+ dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
+- if grep "^#define $sym " confdefs.h >/dev/null; then :; else
+- if test "$val" = "1"
+- then AC_DEFINE_UNQUOTED($sym)
+- else AC_DEFINE_UNQUOTED($sym,$val)
++dnl Also, glibc doesn't like two of the traditional POSIX macros that xmkmf
++dnl likes us to define; ignore them if appropriate.
++ if grep "^#define $sym " confdefs.h >/dev/null || \
++ test "$have_glibc" = "yes" -a "$sym" = "_BSD_SOURCE" || \
++ test "$have_glibc" = "yes" -a "$sym" = "_SVID_SOURCE";
++ then :; else
++ if test "$val" = "1"
++ then AC_DEFINE_UNQUOTED($sym)
++ else AC_DEFINE_UNQUOTED($sym,$val)
+ fi
+ fi ;;
+ esac
diff --git a/app-editors/xemacs/files/xemacs-21.4.24-ncurses-tinfo.patch b/app-editors/xemacs/files/xemacs-21.4.24-ncurses-tinfo.patch
new file mode 100644
index 000000000000..19b8984db2d0
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.4.24-ncurses-tinfo.patch
@@ -0,0 +1,12 @@
+diff -r e2da872593c0 configure.in
+--- a/configure.in Tue Mar 24 22:15:53 2015 -0400
++++ b/configure.in Mon Apr 17 10:13:05 2017 +0200
+@@ -4449,7 +4449,7 @@
+ AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h)
+ AC_CHECK_HEADER(ncurses/term.h, term_h_file=ncurses/term.h)
+ XE_ADD_OBJS(terminfo.o)
+- XE_PREPEND(-lncurses, LIBS)
++ XE_PREPEND($(pkg-config ncurses --libs), LIBS)
+
+ if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
+ dnl Try again, and check for the bogus ncurses/ include bug.
diff --git a/app-editors/xemacs/files/xemacs-21.5.29-optimization-bug.patch b/app-editors/xemacs/files/xemacs-21.5.29-optimization-bug.patch
new file mode 100644
index 000000000000..32a1a02c2abe
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.29-optimization-bug.patch
@@ -0,0 +1,14 @@
+Work around a GCC optimization bug as described in
+http://tracker.xemacs.org/XEmacs/its/issue354
+
+--- src/dumper.c.~1~ 2008-01-26 09:54:11.000000000 +0100
++++ src/dumper.c 2008-05-03 10:17:03.000000000 +0200
+@@ -2584,7 +2584,7 @@
+ #endif /* !WIN32_NATIVE */
+
+
+-static int
++int
+ pdump_file_try (Wexttext *exe_path)
+ {
+ Wexttext *w = exe_path + wext_strlen (exe_path);
diff --git a/app-editors/xemacs/files/xemacs-21.5.33-no-mule-build.patch b/app-editors/xemacs/files/xemacs-21.5.33-no-mule-build.patch
new file mode 100644
index 000000000000..17e572044fac
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.33-no-mule-build.patch
@@ -0,0 +1,33 @@
+diff -r a2912073be85 lisp/paragraphs.el
+--- a/lisp/paragraphs.el Wed Jun 19 09:30:30 2013 -0600
++++ b/lisp/paragraphs.el Sat Jun 22 13:27:48 2013 +0200
+@@ -180,7 +180,10 @@
+ :type '(choice regexp (const :tag "Use default value" nil)))
+ (put 'sentence-end 'safe-local-variable 'string-or-null-p)
+
+-(defcustom sentence-end-base "[.?!][]\"'”)}]*"
++(defcustom sentence-end-base
++ (concat "[.?!][]\"'"
++ (if (featurep 'mule) (string (unicode-to-char #x201D)) "")
++ ")}]*")
+ "Regexp matching the basic end of a sentence, not including following space."
+ :group 'paragraphs
+ :type 'string
+@@ -201,14 +204,14 @@
+ in between. See Info node `(elisp)Standard Regexps'."
+ (or sentence-end
+ ;; We accept non-break space along with space.
+- (concat (if sentence-end-without-period "\\w[ \u00a0][ \u00a0]\\|")
++ (concat (if sentence-end-without-period "\\w[ \240][ \240]\\|")
+ "\\("
+ sentence-end-base
+ (if sentence-end-double-space
+- "\\($\\|[ \u00a0]$\\|\t\\|[ \u00a0][ \u00a0]\\)" "\\($\\|[\t \u00a0]\\)")
++ "\\($\\|[ \240]$\\|\t\\|[ \240][ \240]\\)" "\\($\\|[\t \240]\\)")
+ "\\|[" sentence-end-without-space "]+"
+ "\\)"
+- "[ \u00a0\t\n]*")))
++ "[ \240\t\n]*")))
+
+ (defcustom page-delimiter "^\014"
+ "*Regexp describing line-beginnings that separate pages."
diff --git a/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch b/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch
new file mode 100644
index 000000000000..025a390f3335
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch
@@ -0,0 +1,35 @@
+diff --git a/src/lisp.h b/src/lisp.h
+--- a/src/lisp.h
++++ b/src/lisp.h
+@@ -1154,6 +1154,8 @@
+
+ /* ------------------------ alignment definitions ------------------- */
+
++#if (!defined (__STDC_VERSION__) || __STDC_VERSION__ < 201112L) && \
++ (!defined (__cplusplus) || __cplusplus < 201103L)
+ /* No type has a greater alignment requirement than max_align_t.
+ (except perhaps for types we don't use, like long double) */
+ typedef union
+@@ -1163,6 +1165,7 @@
+ struct { void (*f)(void); } f;
+ struct { double d; } d;
+ } max_align_t;
++#endif
+
+ /* ALIGNOF returns the required alignment of a type -- i.e. a value such
+ that data of this type must begin at a memory address which is a
+@@ -1170,7 +1173,11 @@
+ as the type itself. */
+
+ #ifndef ALIGNOF
+-# if defined (__GNUC__) && (__GNUC__ >= 2)
++# if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
++# define ALIGNOF(type) _Alignof(type)
++# elif defined (__cplusplus) && __cplusplus >= 201103L
++# define ALIGNOF(type) alignof(type)
++# elif defined (__GNUC__) && (__GNUC__ >= 2)
+ /* gcc has an extension that gives us exactly what we want. */
+ # define ALIGNOF(type) __alignof__ (type)
+ # elif ! defined (__cplusplus)
+
+
diff --git a/app-editors/xemacs/files/xemacs-21.5.34-glibc-macro.patch b/app-editors/xemacs/files/xemacs-21.5.34-glibc-macro.patch
new file mode 100644
index 000000000000..b611b15fd8b1
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.34-glibc-macro.patch
@@ -0,0 +1,32 @@
+diff -r f412e9f093d4 configure
+--- a/configure Wed Jan 25 00:47:06 2017 +0000
++++ b/configure Sun Jan 29 19:32:47 2017 +0100
+@@ -13507,7 +13507,10 @@
+ -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;;
+ * ) val=1 ;;
+ esac
+- if grep "^#define $sym " confdefs.h >/dev/null; then :; else
++ if grep "^#define $sym " confdefs.h >/dev/null || \
++ test "$have_glibc" = "yes" -a "$sym" = "_BSD_SOURCE" || \
++ test "$have_glibc" = "yes" -a "$sym" = "_SVID_SOURCE";
++ then :; else
+ if test "$val" = "1"
+ then cat >>confdefs.h <<_ACEOF
+ #define $sym 1
+diff -r f412e9f093d4 configure.ac
+--- a/configure.ac Wed Jan 25 00:47:06 2017 +0000
++++ b/configure.ac Sun Jan 29 19:32:47 2017 +0100
+@@ -3136,7 +3136,12 @@
+ * ) val=1 ;;
+ esac
+ dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
+- if grep "^#define $sym " confdefs.h >/dev/null; then :; else
++dnl Also, glibc doesn't like two of the traditional POSIX macros that xmkmf
++dnl likes us to define; ignore them if appropriate.
++ if grep "^#define $sym " confdefs.h >/dev/null || \
++ test "$have_glibc" = "yes" -a "$sym" = "_BSD_SOURCE" || \
++ test "$have_glibc" = "yes" -a "$sym" = "_SVID_SOURCE";
++ then :; else
+ if test "$val" = "1"
+ then AC_DEFINE_UNQUOTED($sym)
+ else AC_DEFINE_UNQUOTED($sym,$val)
diff --git a/app-editors/xemacs/files/xemacs-21.5.34-ncurses-tinfo.patch b/app-editors/xemacs/files/xemacs-21.5.34-ncurses-tinfo.patch
new file mode 100644
index 000000000000..a08eda3c8a83
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.34-ncurses-tinfo.patch
@@ -0,0 +1,13 @@
+diff -r 6355de501637 configure
+--- a/configure Thu Jan 23 15:03:16 2014 +0000
++++ b/configure Fri Jan 31 23:55:12 2014 +0100
+@@ -19699,7 +19699,8 @@
+ extra_objs="$extra_objs terminfo.o" && if test "$verbose" = "yes"; then
+ echo " xemacs will be linked with \"terminfo.o\""
+ fi
+- LIBS="-lncurses $LIBS" && if test "$verbose" = "yes"; then echo " Prepending \"-lncurses\" to \$LIBS"; fi
++ ncurses_libs=$(pkg-config ncurses --libs)
++ LIBS="$ncurses_libs $LIBS" && if test "$verbose" = "yes"; then echo " Prepending \"$ncurses_libs\" to \$LIBS"; fi
+
+ if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then
+ save_c_switch_site="$c_switch_site"
diff --git a/app-editors/xemacs/files/xemacs.desktop b/app-editors/xemacs/files/xemacs.desktop
new file mode 100644
index 000000000000..93f14a731f2b
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs.desktop
@@ -0,0 +1,33 @@
+[Desktop Entry]
+Name=XEmacs Text Editor
+Name[bg]=редактор XEmacs
+Name[ca]=Editor XEmacs
+Name[cs]=Editor XEmacs
+Name[da]=XEmacs tekstredigerer
+Name[de]=XEmacs Texteditor
+Name[eo]=La redaktilo XEmakso
+Name[es]=Emacs para X
+Name[et]=Emacs X'i kasutajaliidesega
+Name[fi]=XEmacs editori
+Name[fr]=Éditeur XEmacs
+Name[hu]=XEmacs szövegszerkesztő
+Name[is]=XEmacs-ritill
+Name[it]=Emacs per X
+Name[ja]=XEmacs テキスト・エディター
+Name[mk]=Софистицираниот XEmacs уредувач
+Name[no]=XEmacs-tekstredigerer
+Name[pt]=Editor XEmacs
+Name[ro]=Editorul XEmacs
+Name[ru]=Редактор XEmacs
+Name[sk]=Editor XEmacs
+Name[sl]=Urejevalnik XEmacs
+Name[uk]=Редактор XEmacs
+GenericName=Text Editor
+Comment=Edit text
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+Exec=xemacs %f
+Icon=xemacs
+Type=Application
+Terminal=false
+Categories=Utility;TextEditor;
+StartupWMClass=Emacs
diff --git a/app-editors/xemacs/metadata.xml b/app-editors/xemacs/metadata.xml
new file mode 100644
index 000000000000..eb55cb7dabc8
--- /dev/null
+++ b/app-editors/xemacs/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>xemacs@gentoo.org</email>
+ <description>Primary Maintainer</description>
+ </maintainer>
+ <use>
+ <flag name="athena">Chooses the MIT Athena widget set</flag>
+ <flag name="dnd">Enables support for the <pkg>x11-libs/dnd</pkg>
+ drag-n-drop library</flag>
+ <flag name="eolconv">Support detection and translation of newline
+ conventions</flag>
+ <flag name="pop">Support POP for mail retrieval</flag>
+ <flag name="xim">Enable X11 XiM input method</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-editors/xemacs/xemacs-21.4.22-r4.ebuild b/app-editors/xemacs/xemacs-21.4.22-r4.ebuild
new file mode 100644
index 000000000000..5c1ab8b28274
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.4.22-r4.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI="5"
+
+WANT_AUTOCONF="2.1"
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.4/${P}.tar.gz
+ http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
+IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+ berkdb? ( sys-libs/db:= )
+ gdbm? ( >=sys-libs/gdbm-1.8.3 )
+ >=sys-libs/zlib-1.1.4
+ >=dev-libs/openssl-0.9.6:0
+ >=media-libs/audiofile-0.2.3
+ gpm? ( >=sys-libs/gpm-1.19.6 )
+ postgres? ( dev-db/postgresql:= )
+ ldap? ( net-nds/openldap )
+ nas? ( media-libs/nas )
+ X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+ dnd? ( x11-libs/dnd )
+ motif? ( >=x11-libs/motif-2.3:0 )
+ athena? ( x11-libs/libXaw )
+ Xaw3d? ( x11-libs/libXaw3d )
+ neXt? ( x11-libs/neXtaw )
+ xface? ( media-libs/compface )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0 )
+ jpeg? ( virtual/jpeg:0 )
+ canna? ( app-i18n/canna )
+ !amd64? ( freewnn? ( app-i18n/freewnn ) )
+ >=sys-libs/ncurses-5.2:=
+ >=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}"
+
+PDEPEND="app-xemacs/xemacs-base
+ mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/xemacs-21.4.19-texi.patch
+
+ # see bug 58350, 102540 and 143580
+ epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
+
+ # Security bug #216880
+ epatch "${FILESDIR}"/xemacs-21.4.21-vcdiff.patch
+
+ # Security bug #275397
+ epatch "${FILESDIR}"/${P}-large-images.patch
+
+ # Make sure to include deprecated LDAP symbols to avoid runtime
+ # crashes.
+ epatch "${FILESDIR}"/${P}-deprecated-ldap.patch
+
+ # Fix compilation with libpng 1.5, bug 384461
+ epatch "${FILESDIR}"/${P}-libpng15.patch
+
+ # Add texinfo-5.1 compatibility
+ epatch "${FILESDIR}"/${P}-texinfo-5.patch
+
+ # Some binaries and man pages are installed under suffixed names
+ # to avoid collions with their GNU Emacs counterparts (see below).
+ # Fix internal filename references.
+ sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+ sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+ sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+
+ # Run autoconf. XEmacs tries to be smart by providing a stub
+ # configure.ac file for autoconf 2.59 but this throws our
+ # autotools eclass so it must be removed first.
+ rm "${S}"/configure.ac || die
+ eautoconf
+
+ use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+}
+
+src_configure() {
+ local myconf=""
+
+ if use X; then
+
+ myconf="${myconf} --with-widgets=athena"
+ myconf="${myconf} --with-dialogs=athena"
+ myconf="${myconf} --with-menubars=lucid"
+ myconf="${myconf} --with-scrollbars=lucid"
+ if use motif ; then
+ myconf="--with-widgets=motif"
+ myconf="${myconf} --with-dialogs=motif"
+ myconf="${myconf} --with-scrollbars=motif"
+ myconf="${myconf} --with-menubars=lucid"
+ fi
+ if use athena ; then
+ myconf="--with-scrollbars=athena"
+ fi
+
+ if use Xaw3d; then
+ myconf="${myconf} --with-athena=3d"
+ elif use neXt; then
+ myconf="${myconf} --with-athena=next"
+ else
+ myconf="${myconf} --with-athena=xaw"
+ fi
+
+ use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+ myconf="${myconf} $(use_with tiff ) $(use_with png )"
+ myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
+ else
+ myconf="${myconf}
+ --without-x
+ --without-xpm
+ --without-dragndrop
+ --with-gif=no"
+ fi
+
+ if use mule ; then
+ myconf="${myconf} --with-mule"
+
+ if use xim ; then
+ if use motif ; then
+ myconf="${myconf} --with-xim=motif"
+ else
+ myconf="${myconf} --with-xim=xlib"
+ fi
+ else
+ myconf="${myconf} --with-xim=no"
+ fi
+
+ myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
+ fi
+
+ # This determines the type of sounds we are playing
+ local soundconf="native"
+
+ # This determines how these sounds should be played
+ use nas && soundconf="${soundconf},nas"
+
+ myconf="${myconf} --with-sound=${soundconf}"
+
+ if use gdbm || use berkdb ; then
+ use gdbm && mydb="gdbm"
+
+ use berkdb && mydb="${mydb},berkdb"
+
+ myconf="${myconf} --with-database=${mydb}"
+ else
+ myconf="${myconf} --without-database"
+ fi
+
+ # fixes #21264, this should be fixed in 21.4.21 and has been fixed
+ # in 21.5 for sure. Now that 21.4.21 is out there is no real
+ # evidence that this indeed got fixed, so keep these exceptions
+ # for now.
+ use alpha && myconf="${myconf} --with-system-malloc"
+ use ppc64 && myconf="${myconf} --with-system-malloc"
+ use ia64 && myconf="${myconf} --with-system-malloc"
+
+ # Enabling modules will cause segfaults outside the XEmacs build directory
+ use ia64 && myconf="${myconf} --without-modules"
+
+ # fixes #552044, deprecation warnings fools header detection in configure
+ myconf="${myconf} --cppflags=-Wno-cpp"
+
+ einfo "${myconf}"
+
+ # Don't use econf because it uses options which this configure
+ # script does not understand (like --host).
+ ./configure ${myconf} ${EXTRA_ECONF} \
+ $(use_with gif ) \
+ $(use_with gpm ) \
+ $(use_with postgres postgresql ) \
+ $(use_with ldap ) \
+ $(use_with eolconv file-coding ) \
+ $(use_with pop ) \
+ --compiler=$(tc-getCC) \
+ --prefix=/usr \
+ --with-ncurses \
+ --with-msw=no \
+ --mail-locking=flock \
+ --with-site-lisp=yes \
+ --with-site-modules=yes \
+ || die "The configure script failed to run properly"
+}
+
+src_install() {
+ emake prefix="${D}"/usr \
+ mandir="${D}"/usr/share/man/man1 \
+ infodir="${D}"/usr/share/info \
+ install gzip-el || die "emake install failed"
+
+ # Rename some applications installed in bin so that it is clear
+ # which application installed them and so that conflicting
+ # packages (emacs) can't clobber the actual applications.
+ # Addresses bug #62991.
+ for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+ done
+
+ # rename man pages
+ for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+ done
+
+ # install base packages directories
+ dodir /usr/lib/xemacs/xemacs-packages/
+ dodir /usr/lib/xemacs/site-packages/
+ dodir /usr/lib/xemacs/site-modules/
+ dodir /usr/lib/xemacs/site-lisp/
+
+ if use mule;
+ then
+ dodir /usr/lib/xemacs/mule-packages
+ fi
+
+ # remove extraneous info files
+ cd "${D}"/usr/share/info
+ rm -f dir info.info texinfo* termcap* standards*
+
+ cd "${S}"
+ dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+ domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
+
+pkg_postrm() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
diff --git a/app-editors/xemacs/xemacs-21.4.24-r1.ebuild b/app-editors/xemacs/xemacs-21.4.24-r1.ebuild
new file mode 100644
index 000000000000..4b120d8e087d
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.4.24-r1.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI="5"
+
+WANT_AUTOCONF="2.1"
+inherit autotools eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.4/${P}.tar.gz
+ http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+ berkdb? ( sys-libs/db:= )
+ gdbm? ( >=sys-libs/gdbm-1.8.3 )
+ >=sys-libs/zlib-1.1.4
+ >=dev-libs/openssl-0.9.6:0
+ >=media-libs/audiofile-0.2.3
+ gpm? ( >=sys-libs/gpm-1.19.6 )
+ postgres? ( dev-db/postgresql:= )
+ ldap? ( net-nds/openldap )
+ nas? ( media-libs/nas )
+ X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+ dnd? ( x11-libs/dnd )
+ motif? ( >=x11-libs/motif-2.3:0 )
+ athena? ( x11-libs/libXaw )
+ Xaw3d? ( x11-libs/libXaw3d )
+ neXt? ( x11-libs/neXtaw )
+ xface? ( media-libs/compface )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0 )
+ jpeg? ( virtual/jpeg:0 )
+ canna? ( app-i18n/canna )
+ !amd64? ( freewnn? ( app-i18n/freewnn ) )
+ >=sys-libs/ncurses-5.2:=
+ >=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-5"
+
+PDEPEND="app-xemacs/xemacs-base
+ mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+ # see bug 58350, 102540 and 143580
+ epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
+ # see bug 576512
+ epatch "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
+ epatch "${FILESDIR}"/xemacs-21.4.24-glibc-macro.patch
+ # see bug 615544
+ epatch "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
+
+ # Some binaries and man pages are installed under suffixed names
+ # to avoid collions with their GNU Emacs counterparts (see below).
+ # Fix internal filename references.
+ sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+ sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+ sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+
+ # Run autoconf. XEmacs tries to be smart by providing a stub
+ # configure.ac file for autoconf 2.59 but this throws our
+ # autotools eclass so it must be removed first.
+ rm "${S}"/configure.ac || die
+ eautoconf
+
+ use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+}
+
+src_configure() {
+ local myconf=""
+
+ if use X; then
+
+ myconf="${myconf} --with-widgets=athena"
+ myconf="${myconf} --with-dialogs=athena"
+ myconf="${myconf} --with-menubars=lucid"
+ myconf="${myconf} --with-scrollbars=lucid"
+ if use motif ; then
+ myconf="--with-widgets=motif"
+ myconf="${myconf} --with-dialogs=motif"
+ myconf="${myconf} --with-scrollbars=motif"
+ myconf="${myconf} --with-menubars=lucid"
+ fi
+ if use athena ; then
+ myconf="--with-scrollbars=athena"
+ fi
+
+ if use Xaw3d; then
+ myconf="${myconf} --with-athena=3d"
+ elif use neXt; then
+ myconf="${myconf} --with-athena=next"
+ else
+ myconf="${myconf} --with-athena=xaw"
+ fi
+
+ use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+ myconf="${myconf} $(use_with tiff ) $(use_with png )"
+ myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
+ else
+ myconf="${myconf}
+ --without-x
+ --without-xpm
+ --without-dragndrop
+ --with-gif=no"
+ fi
+
+ if use mule ; then
+ myconf="${myconf} --with-mule"
+
+ if use xim ; then
+ if use motif ; then
+ myconf="${myconf} --with-xim=motif"
+ else
+ myconf="${myconf} --with-xim=xlib"
+ fi
+ else
+ myconf="${myconf} --with-xim=no"
+ fi
+
+ myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
+ fi
+
+ # This determines the type of sounds we are playing
+ local soundconf="native"
+
+ # This determines how these sounds should be played
+ use nas && soundconf="${soundconf},nas"
+
+ myconf="${myconf} --with-sound=${soundconf}"
+
+ if use gdbm || use berkdb ; then
+ use gdbm && mydb="gdbm"
+
+ use berkdb && mydb="${mydb},berkdb"
+
+ myconf="${myconf} --with-database=${mydb}"
+ else
+ myconf="${myconf} --without-database"
+ fi
+
+ # fixes #21264, this should be fixed in 21.4.21 and has been fixed
+ # in 21.5 for sure. Now that 21.4.21 is out there is no real
+ # evidence that this indeed got fixed, so keep these exceptions
+ # for now.
+ use alpha && myconf="${myconf} --with-system-malloc"
+ use ppc64 && myconf="${myconf} --with-system-malloc"
+ use ia64 && myconf="${myconf} --with-system-malloc"
+
+ # Enabling modules will cause segfaults outside the XEmacs build directory
+ use ia64 && myconf="${myconf} --without-modules"
+
+ einfo "${myconf}"
+
+ # see bug 576512
+ append-cflags -fgnu89-inline
+
+ # Don't use econf because it uses options which this configure
+ # script does not understand (like --host).
+ ./configure ${myconf} ${EXTRA_ECONF} \
+ $(use_with gif ) \
+ $(use_with gpm ) \
+ $(use_with postgres postgresql ) \
+ $(use_with ldap ) \
+ $(use_with eolconv file-coding ) \
+ $(use_with pop ) \
+ --compiler=$(tc-getCC) \
+ --prefix=/usr \
+ --with-ncurses \
+ --with-msw=no \
+ --mail-locking=flock \
+ --with-site-lisp=yes \
+ --with-site-modules=yes \
+ || die "The configure script failed to run properly"
+}
+
+src_install() {
+ emake prefix="${D}"/usr \
+ mandir="${D}"/usr/share/man/man1 \
+ infodir="${D}"/usr/share/info \
+ install gzip-el || die "emake install failed"
+
+ # Rename some applications installed in bin so that it is clear
+ # which application installed them and so that conflicting
+ # packages (emacs) can't clobber the actual applications.
+ # Addresses bug #62991.
+ for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+ done
+
+ # rename man pages
+ for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+ done
+
+ # install base packages directories
+ dodir /usr/lib/xemacs/xemacs-packages/
+ dodir /usr/lib/xemacs/site-packages/
+ dodir /usr/lib/xemacs/site-modules/
+ dodir /usr/lib/xemacs/site-lisp/
+
+ if use mule;
+ then
+ dodir /usr/lib/xemacs/mule-packages
+ fi
+
+ # remove extraneous info files
+ cd "${D}"/usr/share/info
+ rm -f dir info.info texinfo* termcap* standards*
+
+ cd "${S}"
+ dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+ domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
+
+pkg_postrm() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
diff --git a/app-editors/xemacs/xemacs-21.4.24.ebuild b/app-editors/xemacs/xemacs-21.4.24.ebuild
new file mode 100644
index 000000000000..daf6425d4dac
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.4.24.ebuild
@@ -0,0 +1,247 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI="5"
+
+WANT_AUTOCONF="2.1"
+inherit autotools eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.4/${P}.tar.gz
+ http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
+IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+ berkdb? ( sys-libs/db:= )
+ gdbm? ( >=sys-libs/gdbm-1.8.3 )
+ >=sys-libs/zlib-1.1.4
+ >=dev-libs/openssl-0.9.6:0
+ >=media-libs/audiofile-0.2.3
+ gpm? ( >=sys-libs/gpm-1.19.6 )
+ postgres? ( dev-db/postgresql:= )
+ ldap? ( net-nds/openldap )
+ nas? ( media-libs/nas )
+ X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+ dnd? ( x11-libs/dnd )
+ motif? ( >=x11-libs/motif-2.3:0 )
+ athena? ( x11-libs/libXaw )
+ Xaw3d? ( x11-libs/libXaw3d )
+ neXt? ( x11-libs/neXtaw )
+ xface? ( media-libs/compface )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0 )
+ jpeg? ( virtual/jpeg:0 )
+ canna? ( app-i18n/canna )
+ !amd64? ( freewnn? ( app-i18n/freewnn ) )
+ >=sys-libs/ncurses-5.2:=
+ >=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-5"
+
+PDEPEND="app-xemacs/xemacs-base
+ mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+ # see bug 58350, 102540 and 143580
+ epatch "${FILESDIR}"/xemacs-21.4.19-db.patch
+ # see bug 576512
+ epatch "${FILESDIR}"/xemacs-21.4.24-gcc5.patch
+ # see bug 615544
+ epatch "${FILESDIR}"/xemacs-21.4.24-ncurses-tinfo.patch
+
+ # Some binaries and man pages are installed under suffixed names
+ # to avoid collions with their GNU Emacs counterparts (see below).
+ # Fix internal filename references.
+ sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+ sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+ sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+
+ # Run autoconf. XEmacs tries to be smart by providing a stub
+ # configure.ac file for autoconf 2.59 but this throws our
+ # autotools eclass so it must be removed first.
+ rm "${S}"/configure.ac || die
+ eautoconf
+
+ use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+}
+
+src_configure() {
+ local myconf=""
+
+ if use X; then
+
+ myconf="${myconf} --with-widgets=athena"
+ myconf="${myconf} --with-dialogs=athena"
+ myconf="${myconf} --with-menubars=lucid"
+ myconf="${myconf} --with-scrollbars=lucid"
+ if use motif ; then
+ myconf="--with-widgets=motif"
+ myconf="${myconf} --with-dialogs=motif"
+ myconf="${myconf} --with-scrollbars=motif"
+ myconf="${myconf} --with-menubars=lucid"
+ fi
+ if use athena ; then
+ myconf="--with-scrollbars=athena"
+ fi
+
+ if use Xaw3d; then
+ myconf="${myconf} --with-athena=3d"
+ elif use neXt; then
+ myconf="${myconf} --with-athena=next"
+ else
+ myconf="${myconf} --with-athena=xaw"
+ fi
+
+ use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+ myconf="${myconf} $(use_with tiff ) $(use_with png )"
+ myconf="${myconf} $(use_with jpeg ) $(use_with xface )"
+ else
+ myconf="${myconf}
+ --without-x
+ --without-xpm
+ --without-dragndrop
+ --with-gif=no"
+ fi
+
+ if use mule ; then
+ myconf="${myconf} --with-mule"
+
+ if use xim ; then
+ if use motif ; then
+ myconf="${myconf} --with-xim=motif"
+ else
+ myconf="${myconf} --with-xim=xlib"
+ fi
+ else
+ myconf="${myconf} --with-xim=no"
+ fi
+
+ myconf="${myconf} $(use_with canna ) $(use_with freewnn wnn )"
+ fi
+
+ # This determines the type of sounds we are playing
+ local soundconf="native"
+
+ # This determines how these sounds should be played
+ use nas && soundconf="${soundconf},nas"
+
+ myconf="${myconf} --with-sound=${soundconf}"
+
+ if use gdbm || use berkdb ; then
+ use gdbm && mydb="gdbm"
+
+ use berkdb && mydb="${mydb},berkdb"
+
+ myconf="${myconf} --with-database=${mydb}"
+ else
+ myconf="${myconf} --without-database"
+ fi
+
+ # fixes #21264, this should be fixed in 21.4.21 and has been fixed
+ # in 21.5 for sure. Now that 21.4.21 is out there is no real
+ # evidence that this indeed got fixed, so keep these exceptions
+ # for now.
+ use alpha && myconf="${myconf} --with-system-malloc"
+ use ppc64 && myconf="${myconf} --with-system-malloc"
+ use ia64 && myconf="${myconf} --with-system-malloc"
+
+ # Enabling modules will cause segfaults outside the XEmacs build directory
+ use ia64 && myconf="${myconf} --without-modules"
+
+ # fixes #552044, deprecation warnings fools header detection in configure
+ myconf="${myconf} --cppflags=-Wno-cpp"
+
+ einfo "${myconf}"
+
+ # see bug 576512
+ append-cflags -std=gnu89
+
+ # Don't use econf because it uses options which this configure
+ # script does not understand (like --host).
+ ./configure ${myconf} ${EXTRA_ECONF} \
+ $(use_with gif ) \
+ $(use_with gpm ) \
+ $(use_with postgres postgresql ) \
+ $(use_with ldap ) \
+ $(use_with eolconv file-coding ) \
+ $(use_with pop ) \
+ --compiler=$(tc-getCC) \
+ --prefix=/usr \
+ --with-ncurses \
+ --with-msw=no \
+ --mail-locking=flock \
+ --with-site-lisp=yes \
+ --with-site-modules=yes \
+ || die "The configure script failed to run properly"
+}
+
+src_install() {
+ emake prefix="${D}"/usr \
+ mandir="${D}"/usr/share/man/man1 \
+ infodir="${D}"/usr/share/info \
+ install gzip-el || die "emake install failed"
+
+ # Rename some applications installed in bin so that it is clear
+ # which application installed them and so that conflicting
+ # packages (emacs) can't clobber the actual applications.
+ # Addresses bug #62991.
+ for i in b2m ctags etags rcs-checkin gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+ done
+
+ # rename man pages
+ for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+ done
+
+ # install base packages directories
+ dodir /usr/lib/xemacs/xemacs-packages/
+ dodir /usr/lib/xemacs/site-packages/
+ dodir /usr/lib/xemacs/site-modules/
+ dodir /usr/lib/xemacs/site-lisp/
+
+ if use mule;
+ then
+ dodir /usr/lib/xemacs/mule-packages
+ fi
+
+ # remove extraneous info files
+ cd "${D}"/usr/share/info
+ rm -f dir info.info texinfo* termcap* standards*
+
+ cd "${S}"
+ dodoc BUGS CHANGES-* ChangeLog GETTING* INSTALL PROBLEMS README*
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+ domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
+
+pkg_postrm() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}
diff --git a/app-editors/xemacs/xemacs-21.5.34-r4.ebuild b/app-editors/xemacs/xemacs-21.5.34-r4.ebuild
new file mode 100644
index 000000000000..dec26af2cdbd
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.5.34-r4.ebuild
@@ -0,0 +1,252 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI=5
+
+WANT_AUTOCONF="2.5"
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.5/${P}.tar.gz
+ http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
+IUSE="alsa debug eolconv gif gpm pop postgres ldap libressl xface nas dnd X jpeg tiff png mule motif freewnn canna xft xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+ berkdb? ( >=sys-libs/db-4:= !!<sys-libs/db-4 )
+ gdbm? ( >=sys-libs/gdbm-1.8.3[berkdb(+)] )
+ >=sys-libs/zlib-1.1.4
+ !libressl? ( >=dev-libs/openssl-0.9.6:0 )
+ libressl? ( dev-libs/libressl )
+ >=media-libs/audiofile-0.2.3
+ gpm? ( >=sys-libs/gpm-1.19.6 )
+ postgres? ( dev-db/postgresql:= )
+ ldap? ( net-nds/openldap )
+ alsa? ( media-libs/alsa-lib )
+ nas? ( media-libs/nas )
+ X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+ dnd? ( x11-libs/dnd )
+ motif? ( >=x11-libs/motif-2.3:0[xft=] )
+ athena? ( x11-libs/libXaw )
+ Xaw3d? ( x11-libs/libXaw3d )
+ xft? ( media-libs/freetype:2 x11-libs/libXft x11-libs/libXrender >=media-libs/fontconfig-2.5.0 )
+ neXt? ( x11-libs/neXtaw )
+ xface? ( media-libs/compface )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0 )
+ jpeg? ( virtual/jpeg:0 )
+ canna? ( app-i18n/canna )
+ freewnn? ( app-i18n/freewnn )
+ >=sys-libs/ncurses-5.2:=
+ >=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PDEPEND="app-xemacs/xemacs-base
+ mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+ default_src_unpack
+
+ use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+ use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+ find "${S}"/lisp -name '*.elc' -exec rm {} \; || die
+ epatch "${FILESDIR}/${P}-ncurses-tinfo.patch"
+ epatch "${FILESDIR}/${P}-gcc5.patch"
+ epatch "${FILESDIR}/${P}-glibc-macro.patch"
+
+ # Some binaries and man pages are installed under suffixed names
+ # to avoid collions with their GNU Emacs counterparts (see below).
+ # Fix internal filename references.
+ sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+ sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+ sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+}
+
+src_configure() {
+ local myconf=""
+
+ if use X; then
+
+ myconf="${myconf} --with-widgets=athena"
+ myconf="${myconf} --with-dialogs=athena"
+ myconf="${myconf} --with-menubars=lucid"
+ myconf="${myconf} --with-scrollbars=lucid"
+ if use motif ; then
+ myconf="--with-widgets=motif"
+ myconf="${myconf} --with-dialogs=motif"
+ myconf="${myconf} --with-scrollbars=motif"
+ myconf="${myconf} --with-menubars=lucid"
+ fi
+ if use athena or use Xaw3d ; then
+ myconf="--with-scrollbars=athena"
+ fi
+
+ if use Xaw3d; then
+ myconf="${myconf} --with-athena=3d"
+ elif use neXt; then
+ myconf="${myconf} --with-athena=next"
+ else
+ myconf="${myconf} --with-athena=xaw"
+ fi
+
+ use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+ myconf="${myconf} $(use_with tiff )"
+ myconf="${myconf} $(use_with png )"
+ myconf="${myconf} $(use_with jpeg )"
+ myconf="${myconf} $(use_with xface )"
+
+ use xft && myconf="${myconf} --with-xft=emacs,tabs,menubars,gauges" ||
+ myconf="${myconf} --with-xft=no"
+
+ else
+ myconf="${myconf}
+ --without-x
+ --without-xpm
+ --without-dragndrop
+ --with-xft=no
+ --with-gif=no"
+ fi
+
+ if use mule ; then
+ myconf="${myconf} --with-mule"
+
+ if use xim ; then
+ if use motif ; then
+ myconf="${myconf} --with-xim=motif"
+ else
+ myconf="${myconf} --with-xim=xlib"
+ fi
+ else
+ myconf="${myconf} --with-xim=no"
+ fi
+
+ myconf="${myconf} $(use_with canna )"
+ myconf="${myconf} $(use_with freewnn wnn )"
+ fi
+
+ # This determines the type of sounds we are playing
+ local soundconf="native"
+
+ # This determines how these sounds should be played
+ use nas && soundconf="${soundconf},nas"
+ use alsa && soundconf="${soundconf},alsa"
+
+ myconf="${myconf} --with-sound=${soundconf}"
+
+ if use gdbm || use berkdb ; then
+ use gdbm && mydb="gdbm"
+ use berkdb && mydb="${mydb},berkdb"
+
+ myconf="${myconf} --with-database=${mydb}"
+ else
+ myconf="${myconf} --without-database"
+ fi
+
+ use debug && myconf="${myconf} --with-debug" ||
+ myconf="${myconf} --with-optimization"
+
+ econf ${myconf} \
+ $(use_with gif ) \
+ $(use_with gpm ) \
+ $(use_with postgres postgresql ) \
+ $(use_with ldap ) \
+ $(use_with eolconv file-coding ) \
+ $(use_with pop ) \
+ --prefix=/usr \
+ --with-ncurses \
+ --with-msw=no \
+ --with-mail-locking=flock \
+ --with-site-lisp=yes \
+ --with-site-modules=yes \
+ --with-newgc \
+ --with-system-malloc \
+ --enable-option-checking=no \
+ --with-last-packages=/usr/lib/xemacs \
+ || die "configuration failed"
+}
+
+src_compile() {
+ emake EMACSLOADPATH="${S}"/lisp
+}
+
+src_install() {
+ emake prefix="${D}"/usr \
+ mandir="${D}"/usr/share/man/man1 \
+ infodir="${D}"/usr/share/info \
+ libdir="${D}"/usr/$(get_libdir) \
+ datadir="${D}"/usr/share \
+ install || die
+
+ # Rename some applications installed in bin so that it is clear
+ # which application installed them and so that conflicting
+ # packages (emacs) can't clobber the actual applications.
+ # Addresses bug #62991.
+ for i in b2m ctags etags gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+ done
+
+ # rename man pages
+ for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+ mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+ done
+
+ # install base packages directories
+ dodir /usr/lib/xemacs/xemacs-packages/
+ dodir /usr/lib/xemacs/site-packages/
+ dodir /usr/lib/xemacs/site-modules/
+ dodir /usr/lib/xemacs/site-lisp/
+
+ if use mule;
+ then
+ dodir /usr/lib/xemacs/mule-packages
+ fi
+
+ # remove extraneous info files
+ cd "${D}"/usr/share/info
+ rm -f dir info.info texinfo* termcap* standards*
+
+ cd "${S}"
+ dodoc CHANGES-* ChangeLog INSTALL Installation PROBLEMS README*
+
+ newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+ domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+
+ einfo "If you are upgrading from XEmacs 21.4 you should note the following"
+ einfo "incompatibilities:"
+ einfo "- Mule-UCS is no longer supported due to proper UTF-8 support in XEmacs 21.5"
+ einfo "- The X resource class has changed from Emacs to XEmacs,"
+ einfo " settings in your .Xdefaults file should be updated accordingly."
+
+ if use xft;
+ then
+ einfo "You have enabled Xft font support. Xft requires font names to be provided"
+ einfo "in a different way, so you may need to adjust your .Xdefaults accordingly."
+ fi
+}
+
+pkg_postrm() {
+ eselect emacs update ifunset
+ eselect gnuclient update ifunset
+}