diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-editors/atom | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-editors/atom')
-rw-r--r-- | app-editors/atom/Manifest | 32 | ||||
-rw-r--r-- | app-editors/atom/atom-1.23.3.ebuild | 535 | ||||
-rw-r--r-- | app-editors/atom/atom-1.24.0_beta3.ebuild | 535 | ||||
-rw-r--r-- | app-editors/atom/files/apm-python.patch | 16 | ||||
-rw-r--r-- | app-editors/atom/files/atom-apm-path-r2.patch | 16 | ||||
-rw-r--r-- | app-editors/atom/files/atom-fix-app-restart-r1.patch | 12 | ||||
-rw-r--r-- | app-editors/atom/files/atom-license-path-r1.patch | 11 | ||||
-rw-r--r-- | app-editors/atom/files/atom-marker-layer-r1.patch | 11 | ||||
-rw-r--r-- | app-editors/atom/files/atom-python.patch | 10 | ||||
-rw-r--r-- | app-editors/atom/files/atom-unbundle-electron-r1.patch | 45 | ||||
-rw-r--r-- | app-editors/atom/files/gyp-unbundle.py | 141 | ||||
-rw-r--r-- | app-editors/atom/files/transpile-coffee-script.js | 23 | ||||
-rw-r--r-- | app-editors/atom/metadata.xml | 18 |
13 files changed, 1405 insertions, 0 deletions
diff --git a/app-editors/atom/Manifest b/app-editors/atom/Manifest new file mode 100644 index 000000000000..fc7deb0e208b --- /dev/null +++ b/app-editors/atom/Manifest @@ -0,0 +1,32 @@ +AUX apm-python.patch 388 BLAKE2B 1f3187b4219bb849ce87fd83dd19c335f9c163c63a8660b552235dda2a16b3247c56cc82c17eae7bd7b45516a8dbf345332fb0d22d57589cf7edcd4c448da27c SHA512 5d280b2a37c8f1b03156627c1622d0a5c76edda7523353b7b60e6ba563f090e6472eae318689bd964cc98503a963aa591d3ed37929f1df36f81ab893ad437f21 +AUX atom-apm-path-r2.patch 537 BLAKE2B 68f5a53be36f34a4953450f6ff466bb00256c028adf290b3bd8c63b966c06dbdc9fcb6a12c95172aabc9010f0b1a4c6522390a4ad6012a0f60e11a38a61373cd SHA512 1172c72c94d25538d63e04202f273b87f794431847d9b1138d4eb43d4578d47ca1ecf2636170a8648eef2afaf01a35114752ebecad2b9cd8c7d4ae04dcbc741d +AUX atom-fix-app-restart-r1.patch 402 BLAKE2B 95c61f01f11751fd00cfee81c39daa10e06268f0cb4bf37787be89ce8965d765bc7f7f5fa36b226412c2183151481456661b09faa866e9a929856061f41e7b5f SHA512 6218175e2513f7afdbd6ed4875037929e375fdfd84683f84430e387bb8302aaf472845d74d46f75a79409b867a79b29f06ecfaea4a95ff48d229d080dc74f68f +AUX atom-license-path-r1.patch 719 BLAKE2B 72fbead68a55b5c013f353320581aa431a188e6676b17967a4024de6302e651e0d28ba1efab7689d5dc62014e32d0e968821a6660a530cc5a5d500f2fb2f85e0 SHA512 2909f47f37d065afe5ef4fd86b8b1c01a1a4d4f9f03e7c762cfdb0f97b53ebec2eaa803b34273bf3401c5a0e1faf03ef10c3caf6f96000d1786883cd08d7b964 +AUX atom-marker-layer-r1.patch 418 BLAKE2B 4001c4e8bd64cf6389bb2f5550e5b243fb0fabb0627e76e70ba8c863a3d9be6b2412cfc6dffbb3911e450484d636dfc705f721ef16654aa7c435d5cb2ad0fc1e SHA512 c8bd34e4747626642a57596ef36c4ddbaee36273a213aa4439d0c64557084c7c5bdb25735ffc3c118533ce43dbf2ad638258c29b52a58a28e417163279ada925 +AUX atom-python.patch 168 BLAKE2B d836061d772d187b039b9c88f8755cfac5d236a2c694c34fbd0d5a1a79fd9792c33f52d3ba54d085d6a7f375f309c2d5b5f57be78ea426b1e13fe2d8aad8e71c SHA512 813e79528fd2e814d8e4c5d54cf4d59d2eb7f82683669b787604c713a165b8ea952fe31012c8cf0a208d3ecdb8fa7fdd70c9abd1090aeae549f9aaeb713be5ee +AUX atom-unbundle-electron-r1.patch 1531 BLAKE2B 51f0072ad40e5d9268d9dbfc107201b8518a41a6272fe026fc612d121e109c7bcd5c6781b2340ebec4bff1e8030eead44018b825421bc1b094a95d072ebb2dfa SHA512 40f3f39720cd801f28d1d9e8e202d51848e7f5667f85c543caca623ad33b088b49cf6d5383dcd940448d4247991aaf1a33e868364830f000619856e39b4ec443 +AUX gyp-unbundle.py 3933 BLAKE2B 638bf2ad17c5e052c4b1972ac91a1d0d6b0d9d361cb0d04c3e732c892af54a30b099069ac4bfb0f8882ac3d049c25a53d698cc95aeb23a486d92284a1ac21376 SHA512 5de7aab9b2fcf135fac5429a2655acfb53ed40871ca51281be237393b0318b06339d20af196275bc48acac456eac61e884821da7abeefb9991bf2502d2835cfe +AUX transpile-coffee-script.js 589 BLAKE2B 0fa75fef95437d8c2f3eb5619734b577f843bd11ca4cfe96174408315c6defb57352ea29a22b69d0d6f1e2d01f3515e65cde2793914c42c60a28e936046b0304 SHA512 383772d0a8df6ab3f4950dcda87eb21222d71463007e15cf54c768aedcdd06d4791bf92660c042542aaf2c6fe283ff33f8e6c60488907bd309c450712bb94496 +DIST asar-0.13.0.tar.gz 1622264 BLAKE2B 018bccc3d2b54040fe7c6e6c1ecfbe0ab4d52554feab78fae41a09d35b7e934720cba45f77239eda46d746390c4f072b3e0eecdf7f0953882d6f27cb940de018 SHA512 619b59e9576a185905b455b780630188ce32aed72b424c69967a7bf15236d1edf2f5d92f7dde972599679c88fe0a80f05295a3d82b2ae0944be08d332a659aee +DIST atom-1.23.3.tar.gz 9553983 BLAKE2B ed5f77a51fbbf7a5ba828f5c488b139067636865fef30c88926baf5855b89a7283a35de383cfc65a06391479ec70c067e8ddacd5132b46859b4d4c6ee5cf35e8 SHA512 879a6a209659b612efcef6d3cac9c218da033295b3cc915259e2d4ab51567627a2369b2b8630f6e8a4706aa7b4e0cfb7cc3a55b635f559c8a913cc19e702d524 +DIST atom-1.24.0-beta3.tar.gz 9550090 BLAKE2B e74923afb56573530a3297d7ce27197af478b2697f49e3d1d9d239e12281a43ab614f8bb9356451372723af7a2bb6cfe2dc21c2e672a321eeeeca6455dcedd9b SHA512 31dc4e9be108fdd5e770a21e94f1284f3e5aa3a8293bce542fbf5a449930bb4f9a3f2405653e27809ccb3d2395b9bf3e0e630b4b1d6c2f7995859b2af391c554 +DIST atom-bin-1.23.3.rpm 129956012 BLAKE2B eedb8a55955dbd30d85073e536435a6faa214e9f197acda4f3c7a46408ed5fdcff16141b28c519b1d1fc680d0a17f77d0f22ccb561eaea9665c7836ef282ab8d SHA512 f17b0edc33c537ced60360ff5daba44257ac2a85fdb8cf10e886133429093cbd99cd5835ea1ec451a2c1c485971dd5176585357b980d7dbab17f12ee0adacbe8 +DIST atom-bin-1.24.0-beta3.rpm 129894085 BLAKE2B 9c58bd91ed3d4c9eaf97de0b2ba168c1f4118890f40f8aa9c4f50a9fe24d614c1d52ce8d91f0efdfc8b7bb01891096d8e39a2e2f67faefdd6db33e0114288892 SHA512 a942732dfc975c44c3db11c8e43b88e6dbe247245947964704ee2ada79a8732da5a6f6cedd960556349844ca92333c3504541b300975bd4daad639abb3ce309b +DIST atomdep-atom--nsfw-1.0.18.tar.gz 20870 BLAKE2B 2e90e2cc337b2d40805db44c48a6f9da2b4e749bd5d036bdeec78790286a0d0c7e4536a8d461480b91c45552ce1f6db06e6f70f975e52b2ec90146714c4a0fb9 SHA512 61c78a57d6b75fada687843bf0dca2f1a4d16a8546769789047a202fc831535ee206112962fc4680c7d37b4da3d611f6b5a153e1b6ab919e51759906288b09ff +DIST atomdep-cached-run-in-this-context-0.4.1.tar.gz 2388 BLAKE2B 9cf59f69c3433a9982c1dedf58c03eef5e1ccf1275f92ed192a2de601f38caceea5926e9b3a8571e2124b83e49c99a14f262db39a44732e1ff6550d6cd46d500 SHA512 942db40139b0beda616a25628772e515ce92ceca3e9a5288b10920e68c35149c52677a975e6e30f278ec64f06ae341fa1fa00702b339b2fb8f7af1cf9685efe5 +DIST atomdep-ctags-3.0.0.tar.gz 12864 BLAKE2B 561a64734f67cd7943f2d6f972e4d1ec55913934357e7a0d3077c2910f938071b090f55880788ebeab5d7fcaa3009c8984a9045dc83089c46d276152653eb156 SHA512 af1d3764cc3a6bb781a9a2357eeb8503886fc14481c3dbe4a899d3c672fea9325524aed3a4c1c87965bc4cce2fbae20b56b32690849afc1fcb751cd5462adbcc +DIST atomdep-fs-admin-0.1.6.tar.gz 5539 BLAKE2B 9ee1857152cca343673a270c1044ad33a3ddbfb5b8389f2e0449e99348d0bdd4aaaa7e4c07bfb8871ae840f1a69cd90074a769f80fa3cc7f914050bc6f45b29c SHA512 2474523d5441ad882000633a929bcdbc5771b859a80f16a69c15504ff240a59b558e2edb1ca6e12ce91ad58da935243f3950a16e664529c59da70b9912903ae7 +DIST atomdep-git-utils-5.1.0.tar.gz 4141959 BLAKE2B 7504a4ba57b093da659ed0ba7319863636d7f9f1e9a6a4bbd4b6c6fcf9922c9ca32398b44550e4a94d519471ca5cf249976426583f998186398c147c6cce5636 SHA512 1f9c38646b25a526c0399d538e58864c552d65802402df82f8303a936374121db40f61195ea3254e56e31dd9d25b847b325264911f62d6beddfc24931a9367bf +DIST atomdep-keyboard-layout-2.0.13.tar.gz 17881 BLAKE2B e86a399be545a43768a53d5d9279dae1bc4d87fd99af87a10861f2e3367d6786e3631f8dc77671b08b06e30290f2c97833402e3732a010ae31c7c1c02d9d6afd SHA512 5b155cddb0484edb47a334b21183eccabe6b376290b97b4469732541f4231337b526b90bc37d321ff6dc367d481b1e3c6feb5d39dc9ba67abef8914b53615a66 +DIST atomdep-keytar-4.1.0.tar.gz 8564 BLAKE2B 69b745c6afd22dd4ffd5694205294f4cc7985b9ae5df51e5c7671cee296a2d28732ccd453417eeb60cc66fdfd39247ee90205808fdbfbea8b5585029c22d4d76 SHA512 2f72aa89232da558ad96e838bae23e2b95cb9def52015105584f120902214221f4200fc24dba27e6fe69ad52ca2b429e9f9e28d8ef15f4771e29a829c09ba6f9 +DIST atomdep-nsfw-1.0.16.tar.gz 43214 BLAKE2B 261539bebfe494aad0b372f1837a87c7c2a410bb591df523ea25bd5acd008f7eb0e8460a218fd4ee70d98bc26dd166472e9ea0aea265971cf2e904da913dda88 SHA512 0060d7fb5016454aaaf7df438d973b9a389a6e5f7a166c5d402cf8ef8bcda724501c3bfbd44e37e9e6c38d5f1decaeb48c571aad9145dec38ba0c94073b9702a +DIST atomdep-nslog-3.0.0.tar.gz 2270 BLAKE2B 3258b7e7d7f94a89b0e5a21bfedfbe71bbfe3d776871aaeb3443ce6a7759860abfef2b8af823dab009183b5378c1ed06c7b2729df9acc09d3c5ea6a5f47ff160 SHA512 6a0ce8970ae12fdefd0935916e5501bb89e366fb66b05fffade884f3adf4add4b135eb4f0f208684e28424fdb9858ee8193eb1f3db1f7eac3cb49bdb5d1a4bb1 +DIST atomdep-oniguruma-6.2.1.tar.gz 586350 BLAKE2B 65574ef004c98cced7a9f5917845015ccd84b2383a85d889365da5c73313114454458b441bf6588eaee2a17150d674b7754ccc0bbb2d68ae3d98f7d5ca63530e SHA512 faa46dc4c1b8d7e75ab54512de9a823c5b958a7ccb43333375b33e16de47a464ea2a9ba9996596a8359d423a3e8c9d63cc92a5162b3f9d44b4485304073b41f1 +DIST atomdep-pathwatcher-8.0.1.tar.gz 18357 BLAKE2B 8e2b86da307757c352d0cab5eff64cc31e6745bf10a982f6ef11a0fd92eeeadf5b438aaaaa00e679100600691e59ff7aa7badf33e62c33a2497b5573cf7b4711 SHA512 34df8fecf456753f1977517018e5ff78b143f2d36e1417435bfcac2f9b9f8bd045a8080e7d0ad5d2930c63fa110c539911447863c46e757a4bb8f8c4f5bda999 +DIST atomdep-scrollbar-style-3.2.0.tar.gz 3498 BLAKE2B 2d1a88f2764b5a51da92e41f5dd5424a4ffbc13ec9b2e826236097ff7ebb0babd22b4e4cd00873e786aa52d901eedce49bd102ad6398eda614734bdd78b8b4e3 SHA512 9f5fcc2bcb13cb81e95a52aa6db0c99ffd67c9cd48a9faf0223587359f4082c3e867cb384497dc6be3e8230b4cd035e910a7048d431e81a28dfded0bc572da18 +DIST atomdep-spellchecker-3.4.4.tar.gz 481892 BLAKE2B 3bae26ffffbaffdbac6f082c6f33ea4f5127583663e1df3ed8d98cebed2ce11ea0d9965615e369383695df6ad55aa996e8968e6616415d359ffae640a679f47b SHA512 974b3ce9866ce7e3f30137856ea0f4b1348c105edb833a94620c6b53cfa7052c37575f6dcd160a322fa10c61babfc32c916786d9d44ad10efdb2ab3578620ac1 +DIST atomdep-superstring-2.2.16.tar.gz 795922 BLAKE2B 58f66a51f20f11bd6d4335c945c5af2418ab5e210af989f9480e319a55cf273d63c97db2c5a32e8196dc06c14bbb552ea1e34d2e8910807f8e2d04925c953b41 SHA512 1ea105483032a5f6fb3b752dce33cef7498a9d597cdef35efb00ef26dba95c84dda863452eaa954d38c9c22510397aedfeed2ed44874560fdca4151d87d49e5c +DIST nodejs-nan-2.6.2.tar.gz 161949 BLAKE2B f74e8d56e67ae03e60e0be7752ed9527bd8499c01f7df8899f3eb6735b1286633753e8bf595781b6d3d1446df20483fc0377bd745be10c6bae0ad66426751b79 SHA512 d1b5ed12e90accfa117cb73b9432897631ed2dd6045f93fa8b53237a13cec0ec467b14c035e9e4d4a5c6588949c1c80b0eef48a46d5c9c0a1f81ef400da031c3 +EBUILD atom-1.23.3.ebuild 14818 BLAKE2B 1e1d81e555efdc6e0ac073ece2b4c2d0128b3aee89c09656e9a58e00979b883d6d22facc55e51f34e38609412f6661780e54035fc312c797c69ed737190dfee0 SHA512 23a70450f5223b3e2f4b8a63240efdf5a6f1337aeee386c5848224f3963211621fde3fa071208d99c1d06def823c6001e496a6ac21e5cc399a80d2a29e91ad3f +EBUILD atom-1.24.0_beta3.ebuild 14821 BLAKE2B 7d50260f0e4fa4ddf0486d694fb23c87ed049bffd4fdc424c30be7fc7fcb014298d2db907b999329d54af7f1b0481931981c11c318e9a79d6bb9b0b218273a83 SHA512 afa15e00d2446ab6f9104840641588977c0a9b1094c0df66fd00ec39514aed614c09f3c072a5d373fe8ed8e1d3efa01c48665e5e0f4d4ad8e3c257e0d2a1fc2a +MISC metadata.xml 531 BLAKE2B 75dc8465fe585ee047f3e702b40d1e951759c67b28e63cbba370813e34c5213748529022dd3ecc8477bedcee3657f87ce162bde4984a3d4afbe2b2a200cc1060 SHA512 ba84d0e101f6d53dbd6abb0e441d426bfd04f890331bd5357c18d7a34eea903897a06d725f45d50d95a645018f5ba6b519be07b7dd1ba6cbcfb30bbf1602ff12 diff --git a/app-editors/atom/atom-1.23.3.ebuild b/app-editors/atom/atom-1.23.3.ebuild new file mode 100644 index 000000000000..14043a200d4f --- /dev/null +++ b/app-editors/atom/atom-1.23.3.ebuild @@ -0,0 +1,535 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# NOTE: this ebuild has been generated by atom-ebuild-gen.py from the +# atom overlay. If you would like to make changes, please consider +# modifying the ebuild template and submitting a PR to +# https://github.com/elprans/atom-overlay. + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit python-single-r1 multiprocessing rpm virtualx xdg-utils + +DESCRIPTION="A hackable text editor for the 21st Century" +HOMEPAGE="https://atom.io" +MY_PV="${PV//_/-}" + +ELECTRON_V=1.6.15 +ELECTRON_SLOT=1.6 + +ASAR_V=0.13.0 +# All binary packages depend on this +NAN_V=2.6.2 + +ATOM__NSFW_V=1.0.18 +CACHED_RUN_IN_THIS_CONTEXT_V=0.4.1 +CTAGS_V=3.0.0 +FS_ADMIN_V=0.1.6 +GIT_UTILS_V=5.1.0 +KEYBOARD_LAYOUT_V=2.0.13 +KEYTAR_V=4.1.0 +NSFW_V=1.0.16 +NSLOG_V=3.0.0 +ONIGURUMA_V=6.2.1 +PATHWATCHER_V=8.0.1 +SCROLLBAR_STYLE_V=3.2.0 +SPELLCHECKER_V=3.4.4 +SUPERSTRING_V=2.2.16 + +# The x86_64 arch below is irrelevant, as we will rebuild all binary packages. +SRC_URI=" + https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/atom.x86_64.rpm -> atom-bin-${MY_PV}.rpm + https://github.com/${PN}/${PN}/archive/v${MY_PV}.tar.gz -> atom-${MY_PV}.tar.gz + https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz + https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz + https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.18.tgz -> atomdep-atom--nsfw-1.0.18.tar.gz + https://registry.npmjs.org/cached-run-in-this-context/-/cached-run-in-this-context-0.4.1.tgz -> atomdep-cached-run-in-this-context-0.4.1.tar.gz + https://registry.npmjs.org/ctags/-/ctags-3.0.0.tgz -> atomdep-ctags-3.0.0.tar.gz + https://registry.npmjs.org/fs-admin/-/fs-admin-0.1.6.tgz -> atomdep-fs-admin-0.1.6.tar.gz + https://registry.npmjs.org/git-utils/-/git-utils-5.1.0.tgz -> atomdep-git-utils-5.1.0.tar.gz + https://registry.npmjs.org/keyboard-layout/-/keyboard-layout-2.0.13.tgz -> atomdep-keyboard-layout-2.0.13.tar.gz + https://registry.npmjs.org/keytar/-/keytar-4.1.0.tgz -> atomdep-keytar-4.1.0.tar.gz + https://registry.npmjs.org/nsfw/-/nsfw-1.0.16.tgz -> atomdep-nsfw-1.0.16.tar.gz + https://registry.npmjs.org/nslog/-/nslog-3.0.0.tgz -> atomdep-nslog-3.0.0.tar.gz + https://registry.npmjs.org/oniguruma/-/oniguruma-6.2.1.tgz -> atomdep-oniguruma-6.2.1.tar.gz + https://registry.npmjs.org/pathwatcher/-/pathwatcher-8.0.1.tgz -> atomdep-pathwatcher-8.0.1.tar.gz + https://registry.npmjs.org/scrollbar-style/-/scrollbar-style-3.2.0.tgz -> atomdep-scrollbar-style-3.2.0.tar.gz + https://registry.npmjs.org/spellchecker/-/spellchecker-3.4.4.tgz -> atomdep-spellchecker-3.4.4.tar.gz + https://registry.npmjs.org/superstring/-/superstring-2.2.16.tgz -> atomdep-superstring-2.2.16.tar.gz +" + +BINMODS=( + atom--nsfw + cached-run-in-this-context + ctags + fs-admin + git-utils + keyboard-layout + keytar + nsfw + nslog + oniguruma + pathwatcher + scrollbar-style + spellchecker + superstring +) + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND=" + ${PYTHON_DEPS} + >=app-text/hunspell-1.3.3:= + >=dev-libs/libgit2-0.23:=[ssh] + >=dev-libs/libpcre2-10.22:=[jit,pcre16] + >=gnome-base/libgnome-keyring-3.12:= + >=dev-libs/oniguruma-6.6.0:= + >=dev-util/ctags-5.8 + >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} + x11-libs/libxkbfile" +RDEPEND=" + ${DEPEND} + !sys-apps/apmd +" + +S="${WORKDIR}/${PN}-${MY_PV}" +BIN_S="${WORKDIR}/${PN}-bin-${MY_PV}" +BUILD_DIR="${S}/out" + +pkg_setup() { + python-single-r1_pkg_setup +} + +src_unpack() { + local a + + for a in ${A} ; do + case ${a} in + *.rpm) srcrpm_unpack "${a}" ;; + *) _unpack "${a}" ;; + esac + done + + mkdir "${BIN_S}" || die + mv "${WORKDIR}/usr" "${BIN_S}" || die +} + +src_prepare() { + local install_dir="$(get_install_dir)" + local suffix="$(get_install_suffix)" + local nan_s="${WORKDIR}/nodejs-nan-${NAN_V}" + local patch + local binmod + local _s + + mkdir "${BUILD_DIR}" || die + cp -a "${BIN_S}/$(get_atom_rpmdir)/resources/app" \ + "${BUILD_DIR}/app" || die + + # Add source files omitted from the upstream binary distribution, + # and which we want to include in ours. + cp -a -t "${BUILD_DIR}/app" "${S}/spec" || die + + # Unpack app.asar + if [ -e "${BIN_S}/$(get_atom_rpmdir)/resources/app.asar" ]; then + easar extract "${BIN_S}/$(get_atom_rpmdir)/resources/app.asar" \ + "${BUILD_DIR}/app" + fi + + cd "${BUILD_DIR}/app" || die + + eapply "${FILESDIR}/atom-python.patch" + eapply "${FILESDIR}/apm-python.patch" + eapply "${FILESDIR}/atom-unbundle-electron-r1.patch" + eapply "${FILESDIR}/atom-apm-path-r2.patch" + eapply "${FILESDIR}/atom-license-path-r1.patch" + eapply "${FILESDIR}/atom-fix-app-restart-r1.patch" + eapply "${FILESDIR}/atom-marker-layer-r1.patch" + + sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|$(get_electron_nodedir)|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_PATH}}|$(get_electron_dir)/electron|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_RESOURCE_PATH}}|${EROOT%/}${install_dir}/app.asar|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_PREFIX}}|${EROOT%/}|g" \ + ./atom.sh \ + || die + + sed -i -e "s|^#!/bin/bash|#!${EROOT%/}/bin/bash|g" \ + ./atom.sh \ + || die + + local env="export NPM_CONFIG_NODEDIR=$(get_electron_nodedir)\n\ + export ELECTRON_NO_ASAR=1" + sed -i -e \ + "s|\"\$binDir/\$nodeBin\"|${env}\nexec $(get_electron_dir)/node|g" \ + apm/bin/apm || die + + sed -i -e \ + "s|^\([[:space:]]*\)node[[:space:]]\+|\1\"$(get_electron_dir)/node\" |g" \ + apm/node_modules/npm/bin/node-gyp-bin/node-gyp || die + + sed -i -e \ + "s|atomCommand = 'atom';|atomCommand = '${EROOT%/}/usr/bin/atom${suffix}'|g" \ + apm/lib/test.js || die + + rm apm/bin/node || die + + sed -i -e "s|/$(get_atom_rpmdir)/atom|${EROOT%/}/usr/bin/atom${suffix}|g" \ + "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" || die + + for binmod in ${BINMODS[@]}; do + _s="${WORKDIR}/$(package_dir ${binmod})" + cd "${_s}" || die + if _have_patches_for "${binmod}"; then + for patch in "${FILESDIR}"/${binmod}-*.patch; do + eapply "${patch}" + done + fi + done + + cd "${BUILD_DIR}/app" || die + + # Unbundle bundled libs from modules + + _s="${WORKDIR}/$(package_dir git-utils)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "git;libgit2;git2" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir oniguruma)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "onig_scanner;oniguruma;onig" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir spellchecker)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "spellchecker;hunspell;hunspell" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir superstring)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle \ + "superstring_core;./vendor/pcre/pcre.gyp:pcre;pcre2-16; \ + -DPCRE2_CODE_UNIT_WIDTH=16" \ + "${_s}/binding.gyp" || die + + for binmod in ${BINMODS[@]}; do + _s="${WORKDIR}/$(package_dir ${binmod})" + mkdir -p "${_s}/node_modules" || die + ln -s "${nan_s}" "${_s}/node_modules/nan" || die + done + + sed -i -e "s|{{ATOM_PREFIX}}|${EROOT%/}|g" \ + "${BUILD_DIR}/app/src/config-schema.js" || die + + sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \ + "${BUILD_DIR}/app/src/config-schema.js" || die + + eapply_user +} + +src_configure() { + local binmod + + for binmod in ${BINMODS[@]}; do + einfo "Configuring ${binmod}..." + cd "${WORKDIR}/$(package_dir ${binmod})" || die + enodegyp_atom configure + done +} + +src_compile() { + local binmod + local x + local ctags_d="node_modules/symbols-view/vendor" + local jobs=$(makeopts_jobs) + local gypopts + + # Transpile any yet untranspiled files. + ecoffeescript "${BUILD_DIR}/app/spec/*.coffee" + + gypopts="--verbose" + + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then + gypopts+=" --jobs ${jobs}" + fi + + mkdir -p "${BUILD_DIR}/modules/" || die + + for binmod in ${BINMODS[@]}; do + einfo "Building ${binmod}..." + cd "${WORKDIR}/$(package_dir ${binmod})" || die + enodegyp_atom ${gypopts} build + x=${binmod##node-} + mkdir -p "${BUILD_DIR}/modules/${x}" || die + cp build/Release/*.node "${BUILD_DIR}/modules/${x}" || die + done + + # Put compiled binary modules in place + _fix_binmods "${BUILD_DIR}/app" "apm" + _fix_binmods "${BUILD_DIR}/app" "node_modules" + + # Remove non-Linux vendored ctags binaries + rm "${BUILD_DIR}/app/${ctags_d}/ctags-darwin" \ + "${BUILD_DIR}/app/${ctags_d}/ctags-win32.exe" || die + + # Re-pack app.asar + # Keep unpack rules in sync with build/tasks/generate-asar-task.coffee + cd "${BUILD_DIR}" || die + x="--unpack={*.node,ctags-config,ctags-linux,**/spec/fixtures/**,**/node_modules/spellchecker/**,**/resources/atom.png}" + xd="--unpack-dir=apm" + easar pack "${x}" "${xd}" "app" "app.asar" + + rm -r "${BUILD_DIR}/app.asar.unpacked/apm" || die + + # Replace vendored ctags with a symlink to system ctags + rm "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die + ln -s "${EROOT%/}/usr/bin/ctags" \ + "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die +} + +src_test() { + local electron="$(get_electron_dir)/electron" + local app="${BUILD_DIR}/app.asar" + + virtx "${electron}" --app="${app}" --test "${app}/spec" +} + +src_install() { + local install_dir="$(get_install_dir)" + local suffix="$(get_install_suffix)" + + insinto "${install_dir}" + + doins "${BUILD_DIR}/app.asar" + doins -r "${BUILD_DIR}/app.asar.unpacked" + + insinto "${install_dir}/app" + doins -r "${BUILD_DIR}/app/apm" + + insinto "/usr/share/applications/" + newins "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" \ + "atom${suffix}.desktop" + + insinto "/usr/share/icons/" + doins -r "${BIN_S}/usr/share/icons/hicolor" + + exeinto "${install_dir}" + newexe "${BUILD_DIR}/app/atom.sh" atom + insinto "/usr/share/licenses/${PN}${suffix}" + doins "${BIN_S}/$(get_atom_rpmdir)/resources/LICENSE.md" + dosym "${install_dir}/atom" "/usr/bin/atom${suffix}" + dosym "${install_dir}/app/apm/bin/apm" "/usr/bin/apm${suffix}" + + _fix_executables "${install_dir}/app/apm/bin" + _fix_executables "${install_dir}/app/apm/node_modules/.bin" + _fix_executables "${install_dir}/app/apm/node_modules/npm/bin" + _fix_executables "${install_dir}/app/apm/node_modules/npm/bin/node-gyp-bin" + _fix_executables "${install_dir}/app/apm/node_modules/node-gyp/bin" +} + +pkg_postinst() { + xdg_desktop_database_update +} + +pkg_postrm() { + xdg_desktop_database_update +} + +# Helpers +# ------- + +# Return the installation suffix appropriate for the slot. +get_install_suffix() { + local c=(${SLOT//\// }) + local slot=${c[0]} + local suffix + + if [[ "${slot}" == "0" ]]; then + suffix="" + else + suffix="-${slot}" + fi + + echo -n "${suffix}" +} + +# Return the upstream app name appropriate for $PV. +get_atom_appname() { + if [[ "${PV}" == *beta* ]]; then + echo -n "atom-beta" + else + echo -n "atom" + fi +} + +# Return the app installation path inside the upstream archive. +get_atom_rpmdir() { + echo -n "usr/share/$(get_atom_appname)" +} + +# Return the installation target directory. +get_install_dir() { + echo -n "/usr/$(get_libdir)/atom$(get_install_suffix)" +} + +# Return the Electron installation directory. +get_electron_dir() { + echo -n "${EROOT%/}/usr/$(get_libdir)/electron-${ELECTRON_SLOT}" +} + +# Return the directory containing appropriate Node headers +# for the required version of Electron. +get_electron_nodedir() { + echo -n "${EROOT%/}/usr/include/electron-${ELECTRON_SLOT}/node/" +} + +# Run JavaScript using Electron's version of Node. +enode_electron() { + "$(get_electron_dir)"/node $@ +} + +# Run node-gyp using Electron's version of Node. +enodegyp_atom() { + local apmpath="$(get_atom_rpmdir)/resources/app/apm" + local nodegyp="${BIN_S}/${apmpath}/node_modules/node-gyp/bin/node-gyp.js" + + PATH="$(get_electron_dir):${PATH}" \ + enode_electron "${nodegyp}" \ + --nodedir="$(get_electron_nodedir)" $@ || die +} + +# Coffee Script wrapper. +ecoffeescript() { + local cscript="${FILESDIR}/transpile-coffee-script.js" + + # Disable shell glob expansion, as we want the coffee script + # transpiler to do that instead. + set -f + echo "ecoffeescript" $@ + ATOM_HOME="${T}/.atom" ATOM_SRC_ROOT="${BUILD_DIR}/app" \ + NODE_PATH="${BUILD_DIR}/app/node_modules" \ + enode_electron "${cscript}" $@ || die + set +f +} + +# asar wrapper. +easar() { + local asar="${WORKDIR}/$(package_dir asar)/node_modules/asar/bin/asar" + echo "asar" $@ + enode_electron "${asar}" $@ || die +} + +# Return a $WORKDIR directory for a given package name. +package_dir() { + local binmod="${1//-/_}" + local binmod_v="${binmod^^}_V" + echo -n ${1}-${!binmod_v} +} + +# Check if there are patches for a given package. +_have_patches_for() { + local _patches="${1}-*.patch" _find + _find=$(find "${FILESDIR}" -maxdepth 1 -name "${_patches}" -print -quit) + test -n "$_find" +} + +# Tarballs on registry.npmjs.org are wildly inconsistent, +# and violate the convention of having ${P} as the top directory name. +# This helper detects and fixes that. +_unpack() { + local a="${1}" + local b="${a%.tar.gz}" + local p="${b#atomdep-}" + local dir="$(tar -tzf "${DISTDIR}/${a}" | head -1 | cut -f1 -d'/')" + + unpack "${a}" + + if [[ "${dir}" != "${p}" ]]; then + # Set the correct name for the unpacked directory. + mv "${WORKDIR}/${dir}" "${WORKDIR}/${p}" || die + fi +} + +# Check if the binary node module is actually a valid dependency. +# Sometimes the upstream removes a dependency from package.json but +# forgets to remove the module from node_modules. +_is_valid_binmod() { + local mod + + for mod in "${BINMODS[@]}"; do + if [[ "${mod}" == "${1}" ]]; then + return 0 + fi + done + + return 1 +} + +# Replace binary node modules with the newly compiled versions thereof. +_fix_binmods() { + local _dir="${2}" + local _prefix="${1}" + local path + local relpath + local modpath + local mod + local f + local d + local cruft + + (find "${_prefix}/${_dir}" -name '*.node' -print || die) \ + | while IFS= read -r path; do + f=$(basename "${path}") + d=$(dirname "${path}") + relpath=${path#${_prefix}} + relpath=${relpath##/} + relpath=${relpath#W${_dir}} + modpath=$(dirname ${relpath}) + modpath=${modpath%build/Release} + mod=$(basename ${modpath}) + + _is_valid_binmod "${mod}" || continue + + # must copy here as symlinks will cause the module loading to fail + cp -f "${BUILD_DIR}/modules/${mod}/${f}" "${path}" || die + cruft=$(find "${d}" -name '*.a' -print) + if [[ -n "${cruft}" ]]; then + rm ${cruft} || die + fi + done +} + +# Fix script permissions and shebangs to point to the correct version +# of Node. +_fix_executables() { + local _dir="${1}" + local _node_sb="#!$(get_electron_dir)"/node + + (find -L "${ED}/${_dir}" -maxdepth 1 -mindepth 1 -type f -print || die) \ + | while IFS= read -r f; do + IFS= read -r shebang < "${f}" + + if [[ ${shebang} == '#!'* ]]; then + fperms +x "${f#${ED}}" + if [[ "${shebang}" == "#!/usr/bin/env node" || "${shebang}" == "#!/usr/bin/node" ]]; then + einfo "Fixing node shebang in ${f#${ED}}" + sed --follow-symlinks -i \ + -e "1s:${shebang}$:${_node_sb}:" "${f}" || die + fi + fi + done || die +} diff --git a/app-editors/atom/atom-1.24.0_beta3.ebuild b/app-editors/atom/atom-1.24.0_beta3.ebuild new file mode 100644 index 000000000000..be1bdba86e3e --- /dev/null +++ b/app-editors/atom/atom-1.24.0_beta3.ebuild @@ -0,0 +1,535 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# NOTE: this ebuild has been generated by atom-ebuild-gen.py from the +# atom overlay. If you would like to make changes, please consider +# modifying the ebuild template and submitting a PR to +# https://github.com/elprans/atom-overlay. + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +inherit python-single-r1 multiprocessing rpm virtualx xdg-utils + +DESCRIPTION="A hackable text editor for the 21st Century" +HOMEPAGE="https://atom.io" +MY_PV="${PV//_/-}" + +ELECTRON_V=1.6.15 +ELECTRON_SLOT=1.6 + +ASAR_V=0.13.0 +# All binary packages depend on this +NAN_V=2.6.2 + +ATOM__NSFW_V=1.0.18 +CACHED_RUN_IN_THIS_CONTEXT_V=0.4.1 +CTAGS_V=3.0.0 +FS_ADMIN_V=0.1.6 +GIT_UTILS_V=5.1.0 +KEYBOARD_LAYOUT_V=2.0.13 +KEYTAR_V=4.1.0 +NSFW_V=1.0.16 +NSLOG_V=3.0.0 +ONIGURUMA_V=6.2.1 +PATHWATCHER_V=8.0.1 +SCROLLBAR_STYLE_V=3.2.0 +SPELLCHECKER_V=3.4.4 +SUPERSTRING_V=2.2.16 + +# The x86_64 arch below is irrelevant, as we will rebuild all binary packages. +SRC_URI=" + https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/atom.x86_64.rpm -> atom-bin-${MY_PV}.rpm + https://github.com/${PN}/${PN}/archive/v${MY_PV}.tar.gz -> atom-${MY_PV}.tar.gz + https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz + https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz + https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.18.tgz -> atomdep-atom--nsfw-1.0.18.tar.gz + https://registry.npmjs.org/cached-run-in-this-context/-/cached-run-in-this-context-0.4.1.tgz -> atomdep-cached-run-in-this-context-0.4.1.tar.gz + https://registry.npmjs.org/ctags/-/ctags-3.0.0.tgz -> atomdep-ctags-3.0.0.tar.gz + https://registry.npmjs.org/fs-admin/-/fs-admin-0.1.6.tgz -> atomdep-fs-admin-0.1.6.tar.gz + https://registry.npmjs.org/git-utils/-/git-utils-5.1.0.tgz -> atomdep-git-utils-5.1.0.tar.gz + https://registry.npmjs.org/keyboard-layout/-/keyboard-layout-2.0.13.tgz -> atomdep-keyboard-layout-2.0.13.tar.gz + https://registry.npmjs.org/keytar/-/keytar-4.1.0.tgz -> atomdep-keytar-4.1.0.tar.gz + https://registry.npmjs.org/nsfw/-/nsfw-1.0.16.tgz -> atomdep-nsfw-1.0.16.tar.gz + https://registry.npmjs.org/nslog/-/nslog-3.0.0.tgz -> atomdep-nslog-3.0.0.tar.gz + https://registry.npmjs.org/oniguruma/-/oniguruma-6.2.1.tgz -> atomdep-oniguruma-6.2.1.tar.gz + https://registry.npmjs.org/pathwatcher/-/pathwatcher-8.0.1.tgz -> atomdep-pathwatcher-8.0.1.tar.gz + https://registry.npmjs.org/scrollbar-style/-/scrollbar-style-3.2.0.tgz -> atomdep-scrollbar-style-3.2.0.tar.gz + https://registry.npmjs.org/spellchecker/-/spellchecker-3.4.4.tgz -> atomdep-spellchecker-3.4.4.tar.gz + https://registry.npmjs.org/superstring/-/superstring-2.2.16.tgz -> atomdep-superstring-2.2.16.tar.gz +" + +BINMODS=( + atom--nsfw + cached-run-in-this-context + ctags + fs-admin + git-utils + keyboard-layout + keytar + nsfw + nslog + oniguruma + pathwatcher + scrollbar-style + spellchecker + superstring +) + +LICENSE="MIT" +SLOT="beta" +KEYWORDS="~amd64" +IUSE="" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND=" + ${PYTHON_DEPS} + >=app-text/hunspell-1.3.3:= + >=dev-libs/libgit2-0.23:=[ssh] + >=dev-libs/libpcre2-10.22:=[jit,pcre16] + >=gnome-base/libgnome-keyring-3.12:= + >=dev-libs/oniguruma-6.6.0:= + >=dev-util/ctags-5.8 + >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} + x11-libs/libxkbfile" +RDEPEND=" + ${DEPEND} + !sys-apps/apmd +" + +S="${WORKDIR}/${PN}-${MY_PV}" +BIN_S="${WORKDIR}/${PN}-bin-${MY_PV}" +BUILD_DIR="${S}/out" + +pkg_setup() { + python-single-r1_pkg_setup +} + +src_unpack() { + local a + + for a in ${A} ; do + case ${a} in + *.rpm) srcrpm_unpack "${a}" ;; + *) _unpack "${a}" ;; + esac + done + + mkdir "${BIN_S}" || die + mv "${WORKDIR}/usr" "${BIN_S}" || die +} + +src_prepare() { + local install_dir="$(get_install_dir)" + local suffix="$(get_install_suffix)" + local nan_s="${WORKDIR}/nodejs-nan-${NAN_V}" + local patch + local binmod + local _s + + mkdir "${BUILD_DIR}" || die + cp -a "${BIN_S}/$(get_atom_rpmdir)/resources/app" \ + "${BUILD_DIR}/app" || die + + # Add source files omitted from the upstream binary distribution, + # and which we want to include in ours. + cp -a -t "${BUILD_DIR}/app" "${S}/spec" || die + + # Unpack app.asar + if [ -e "${BIN_S}/$(get_atom_rpmdir)/resources/app.asar" ]; then + easar extract "${BIN_S}/$(get_atom_rpmdir)/resources/app.asar" \ + "${BUILD_DIR}/app" + fi + + cd "${BUILD_DIR}/app" || die + + eapply "${FILESDIR}/atom-python.patch" + eapply "${FILESDIR}/apm-python.patch" + eapply "${FILESDIR}/atom-unbundle-electron-r1.patch" + eapply "${FILESDIR}/atom-apm-path-r2.patch" + eapply "${FILESDIR}/atom-license-path-r1.patch" + eapply "${FILESDIR}/atom-fix-app-restart-r1.patch" + eapply "${FILESDIR}/atom-marker-layer-r1.patch" + + sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|$(get_electron_nodedir)|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_PATH}}|$(get_electron_dir)/electron|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_RESOURCE_PATH}}|${EROOT%/}${install_dir}/app.asar|g" \ + ./atom.sh \ + || die + + sed -i -e "s|{{ATOM_PREFIX}}|${EROOT%/}|g" \ + ./atom.sh \ + || die + + sed -i -e "s|^#!/bin/bash|#!${EROOT%/}/bin/bash|g" \ + ./atom.sh \ + || die + + local env="export NPM_CONFIG_NODEDIR=$(get_electron_nodedir)\n\ + export ELECTRON_NO_ASAR=1" + sed -i -e \ + "s|\"\$binDir/\$nodeBin\"|${env}\nexec $(get_electron_dir)/node|g" \ + apm/bin/apm || die + + sed -i -e \ + "s|^\([[:space:]]*\)node[[:space:]]\+|\1\"$(get_electron_dir)/node\" |g" \ + apm/node_modules/npm/bin/node-gyp-bin/node-gyp || die + + sed -i -e \ + "s|atomCommand = 'atom';|atomCommand = '${EROOT%/}/usr/bin/atom${suffix}'|g" \ + apm/lib/test.js || die + + rm apm/bin/node || die + + sed -i -e "s|/$(get_atom_rpmdir)/atom|${EROOT%/}/usr/bin/atom${suffix}|g" \ + "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" || die + + for binmod in ${BINMODS[@]}; do + _s="${WORKDIR}/$(package_dir ${binmod})" + cd "${_s}" || die + if _have_patches_for "${binmod}"; then + for patch in "${FILESDIR}"/${binmod}-*.patch; do + eapply "${patch}" + done + fi + done + + cd "${BUILD_DIR}/app" || die + + # Unbundle bundled libs from modules + + _s="${WORKDIR}/$(package_dir git-utils)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "git;libgit2;git2" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir oniguruma)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "onig_scanner;oniguruma;onig" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir spellchecker)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle "spellchecker;hunspell;hunspell" \ + "${_s}/binding.gyp" || die + + _s="${WORKDIR}/$(package_dir superstring)" + ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ + --inplace --unbundle \ + "superstring_core;./vendor/pcre/pcre.gyp:pcre;pcre2-16; \ + -DPCRE2_CODE_UNIT_WIDTH=16" \ + "${_s}/binding.gyp" || die + + for binmod in ${BINMODS[@]}; do + _s="${WORKDIR}/$(package_dir ${binmod})" + mkdir -p "${_s}/node_modules" || die + ln -s "${nan_s}" "${_s}/node_modules/nan" || die + done + + sed -i -e "s|{{ATOM_PREFIX}}|${EROOT%/}|g" \ + "${BUILD_DIR}/app/src/config-schema.js" || die + + sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \ + "${BUILD_DIR}/app/src/config-schema.js" || die + + eapply_user +} + +src_configure() { + local binmod + + for binmod in ${BINMODS[@]}; do + einfo "Configuring ${binmod}..." + cd "${WORKDIR}/$(package_dir ${binmod})" || die + enodegyp_atom configure + done +} + +src_compile() { + local binmod + local x + local ctags_d="node_modules/symbols-view/vendor" + local jobs=$(makeopts_jobs) + local gypopts + + # Transpile any yet untranspiled files. + ecoffeescript "${BUILD_DIR}/app/spec/*.coffee" + + gypopts="--verbose" + + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then + gypopts+=" --jobs ${jobs}" + fi + + mkdir -p "${BUILD_DIR}/modules/" || die + + for binmod in ${BINMODS[@]}; do + einfo "Building ${binmod}..." + cd "${WORKDIR}/$(package_dir ${binmod})" || die + enodegyp_atom ${gypopts} build + x=${binmod##node-} + mkdir -p "${BUILD_DIR}/modules/${x}" || die + cp build/Release/*.node "${BUILD_DIR}/modules/${x}" || die + done + + # Put compiled binary modules in place + _fix_binmods "${BUILD_DIR}/app" "apm" + _fix_binmods "${BUILD_DIR}/app" "node_modules" + + # Remove non-Linux vendored ctags binaries + rm "${BUILD_DIR}/app/${ctags_d}/ctags-darwin" \ + "${BUILD_DIR}/app/${ctags_d}/ctags-win32.exe" || die + + # Re-pack app.asar + # Keep unpack rules in sync with build/tasks/generate-asar-task.coffee + cd "${BUILD_DIR}" || die + x="--unpack={*.node,ctags-config,ctags-linux,**/spec/fixtures/**,**/node_modules/spellchecker/**,**/resources/atom.png}" + xd="--unpack-dir=apm" + easar pack "${x}" "${xd}" "app" "app.asar" + + rm -r "${BUILD_DIR}/app.asar.unpacked/apm" || die + + # Replace vendored ctags with a symlink to system ctags + rm "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die + ln -s "${EROOT%/}/usr/bin/ctags" \ + "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die +} + +src_test() { + local electron="$(get_electron_dir)/electron" + local app="${BUILD_DIR}/app.asar" + + virtx "${electron}" --app="${app}" --test "${app}/spec" +} + +src_install() { + local install_dir="$(get_install_dir)" + local suffix="$(get_install_suffix)" + + insinto "${install_dir}" + + doins "${BUILD_DIR}/app.asar" + doins -r "${BUILD_DIR}/app.asar.unpacked" + + insinto "${install_dir}/app" + doins -r "${BUILD_DIR}/app/apm" + + insinto "/usr/share/applications/" + newins "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" \ + "atom${suffix}.desktop" + + insinto "/usr/share/icons/" + doins -r "${BIN_S}/usr/share/icons/hicolor" + + exeinto "${install_dir}" + newexe "${BUILD_DIR}/app/atom.sh" atom + insinto "/usr/share/licenses/${PN}${suffix}" + doins "${BIN_S}/$(get_atom_rpmdir)/resources/LICENSE.md" + dosym "${install_dir}/atom" "/usr/bin/atom${suffix}" + dosym "${install_dir}/app/apm/bin/apm" "/usr/bin/apm${suffix}" + + _fix_executables "${install_dir}/app/apm/bin" + _fix_executables "${install_dir}/app/apm/node_modules/.bin" + _fix_executables "${install_dir}/app/apm/node_modules/npm/bin" + _fix_executables "${install_dir}/app/apm/node_modules/npm/bin/node-gyp-bin" + _fix_executables "${install_dir}/app/apm/node_modules/node-gyp/bin" +} + +pkg_postinst() { + xdg_desktop_database_update +} + +pkg_postrm() { + xdg_desktop_database_update +} + +# Helpers +# ------- + +# Return the installation suffix appropriate for the slot. +get_install_suffix() { + local c=(${SLOT//\// }) + local slot=${c[0]} + local suffix + + if [[ "${slot}" == "0" ]]; then + suffix="" + else + suffix="-${slot}" + fi + + echo -n "${suffix}" +} + +# Return the upstream app name appropriate for $PV. +get_atom_appname() { + if [[ "${PV}" == *beta* ]]; then + echo -n "atom-beta" + else + echo -n "atom" + fi +} + +# Return the app installation path inside the upstream archive. +get_atom_rpmdir() { + echo -n "usr/share/$(get_atom_appname)" +} + +# Return the installation target directory. +get_install_dir() { + echo -n "/usr/$(get_libdir)/atom$(get_install_suffix)" +} + +# Return the Electron installation directory. +get_electron_dir() { + echo -n "${EROOT%/}/usr/$(get_libdir)/electron-${ELECTRON_SLOT}" +} + +# Return the directory containing appropriate Node headers +# for the required version of Electron. +get_electron_nodedir() { + echo -n "${EROOT%/}/usr/include/electron-${ELECTRON_SLOT}/node/" +} + +# Run JavaScript using Electron's version of Node. +enode_electron() { + "$(get_electron_dir)"/node $@ +} + +# Run node-gyp using Electron's version of Node. +enodegyp_atom() { + local apmpath="$(get_atom_rpmdir)/resources/app/apm" + local nodegyp="${BIN_S}/${apmpath}/node_modules/node-gyp/bin/node-gyp.js" + + PATH="$(get_electron_dir):${PATH}" \ + enode_electron "${nodegyp}" \ + --nodedir="$(get_electron_nodedir)" $@ || die +} + +# Coffee Script wrapper. +ecoffeescript() { + local cscript="${FILESDIR}/transpile-coffee-script.js" + + # Disable shell glob expansion, as we want the coffee script + # transpiler to do that instead. + set -f + echo "ecoffeescript" $@ + ATOM_HOME="${T}/.atom" ATOM_SRC_ROOT="${BUILD_DIR}/app" \ + NODE_PATH="${BUILD_DIR}/app/node_modules" \ + enode_electron "${cscript}" $@ || die + set +f +} + +# asar wrapper. +easar() { + local asar="${WORKDIR}/$(package_dir asar)/node_modules/asar/bin/asar" + echo "asar" $@ + enode_electron "${asar}" $@ || die +} + +# Return a $WORKDIR directory for a given package name. +package_dir() { + local binmod="${1//-/_}" + local binmod_v="${binmod^^}_V" + echo -n ${1}-${!binmod_v} +} + +# Check if there are patches for a given package. +_have_patches_for() { + local _patches="${1}-*.patch" _find + _find=$(find "${FILESDIR}" -maxdepth 1 -name "${_patches}" -print -quit) + test -n "$_find" +} + +# Tarballs on registry.npmjs.org are wildly inconsistent, +# and violate the convention of having ${P} as the top directory name. +# This helper detects and fixes that. +_unpack() { + local a="${1}" + local b="${a%.tar.gz}" + local p="${b#atomdep-}" + local dir="$(tar -tzf "${DISTDIR}/${a}" | head -1 | cut -f1 -d'/')" + + unpack "${a}" + + if [[ "${dir}" != "${p}" ]]; then + # Set the correct name for the unpacked directory. + mv "${WORKDIR}/${dir}" "${WORKDIR}/${p}" || die + fi +} + +# Check if the binary node module is actually a valid dependency. +# Sometimes the upstream removes a dependency from package.json but +# forgets to remove the module from node_modules. +_is_valid_binmod() { + local mod + + for mod in "${BINMODS[@]}"; do + if [[ "${mod}" == "${1}" ]]; then + return 0 + fi + done + + return 1 +} + +# Replace binary node modules with the newly compiled versions thereof. +_fix_binmods() { + local _dir="${2}" + local _prefix="${1}" + local path + local relpath + local modpath + local mod + local f + local d + local cruft + + (find "${_prefix}/${_dir}" -name '*.node' -print || die) \ + | while IFS= read -r path; do + f=$(basename "${path}") + d=$(dirname "${path}") + relpath=${path#${_prefix}} + relpath=${relpath##/} + relpath=${relpath#W${_dir}} + modpath=$(dirname ${relpath}) + modpath=${modpath%build/Release} + mod=$(basename ${modpath}) + + _is_valid_binmod "${mod}" || continue + + # must copy here as symlinks will cause the module loading to fail + cp -f "${BUILD_DIR}/modules/${mod}/${f}" "${path}" || die + cruft=$(find "${d}" -name '*.a' -print) + if [[ -n "${cruft}" ]]; then + rm ${cruft} || die + fi + done +} + +# Fix script permissions and shebangs to point to the correct version +# of Node. +_fix_executables() { + local _dir="${1}" + local _node_sb="#!$(get_electron_dir)"/node + + (find -L "${ED}/${_dir}" -maxdepth 1 -mindepth 1 -type f -print || die) \ + | while IFS= read -r f; do + IFS= read -r shebang < "${f}" + + if [[ ${shebang} == '#!'* ]]; then + fperms +x "${f#${ED}}" + if [[ "${shebang}" == "#!/usr/bin/env node" || "${shebang}" == "#!/usr/bin/node" ]]; then + einfo "Fixing node shebang in ${f#${ED}}" + sed --follow-symlinks -i \ + -e "1s:${shebang}$:${_node_sb}:" "${f}" || die + fi + fi + done || die +} diff --git a/app-editors/atom/files/apm-python.patch b/app-editors/atom/files/apm-python.patch new file mode 100644 index 000000000000..0467beaf10ee --- /dev/null +++ b/app-editors/atom/files/apm-python.patch @@ -0,0 +1,16 @@ +diff --git a/apm/bin/python-interceptor.sh b/apm/bin/python-interceptor.sh +index 7ce1965..12cc72f 100755 +--- a/apm/bin/python-interceptor.sh ++++ b/apm/bin/python-interceptor.sh +@@ -34,9 +34,9 @@ case $1 in + ARGS+=("--format=safemake.py") + fi + +- exec python "${ARGS[@]}" ++ exec python2 "${ARGS[@]}" + ;; + *) +- exec python "$@" ++ exec python2 "$@" + ;; + esac diff --git a/app-editors/atom/files/atom-apm-path-r2.patch b/app-editors/atom/files/atom-apm-path-r2.patch new file mode 100644 index 000000000000..12234b6bab13 --- /dev/null +++ b/app-editors/atom/files/atom-apm-path-r2.patch @@ -0,0 +1,16 @@ +diff --git a/src/config-schema.js b/src/config-schema.js +index 39f0585..24ee2de 100644 +--- a/src/config-schema.js ++++ b/src/config-schema.js +@@ -5,6 +5,11 @@ const configSchema = { + core: { + type: 'object', + properties: { ++ apmPath: { ++ type: 'string', ++ "default": '{{ATOM_PREFIX}}/usr/bin/apm{{ATOM_SUFFIX}}', ++ description: 'Path to apm executable.' ++ }, + ignoredNames: { + type: 'array', + default: ['.git', '.hg', '.svn', '.DS_Store', '._*', 'Thumbs.db', 'desktop.ini'], diff --git a/app-editors/atom/files/atom-fix-app-restart-r1.patch b/app-editors/atom/files/atom-fix-app-restart-r1.patch new file mode 100644 index 000000000000..f984d7841be9 --- /dev/null +++ b/app-editors/atom/files/atom-fix-app-restart-r1.patch @@ -0,0 +1,12 @@ +diff --git a/atom-application.js.orig b/atom-application.js +index 92d985f..9a120e6 100644 +--- a/src/main-process/atom-application.js ++++ b/src/main-process/atom-application.js +@@ -1178,6 +1178,7 @@ + AtomApplication.prototype.restart = function() { + var args; + args = []; ++ args.push("--app=" + this.resourcePath); + if (this.safeMode) { + args.push("--safe"); + } diff --git a/app-editors/atom/files/atom-license-path-r1.patch b/app-editors/atom/files/atom-license-path-r1.patch new file mode 100644 index 000000000000..c8d6ab9784f0 --- /dev/null +++ b/app-editors/atom/files/atom-license-path-r1.patch @@ -0,0 +1,11 @@ +--- a/src/main-process/atom-application.js ++++ b/src/main-process/atom-application.js +@@ -406,7 +406,7 @@ + this.openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap'); + this.openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets'); + this.openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet'); +- this.openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md')); ++ this.openPathOnEvent('application:open-license', '/usr/share/licenses/atom/LICENSE.md'); + this.disposable.add(ipcHelpers.on(app, 'before-quit', (function(_this) { + return function(event) { + if (!_this.quitting) { diff --git a/app-editors/atom/files/atom-marker-layer-r1.patch b/app-editors/atom/files/atom-marker-layer-r1.patch new file mode 100644 index 000000000000..1dcdecbd4eba --- /dev/null +++ b/app-editors/atom/files/atom-marker-layer-r1.patch @@ -0,0 +1,11 @@ +--- a/node_modules/text-buffer/lib/marker-layer.js +--- b/node_modules/text-buffer/lib/marker-layer.js +@@ -192,7 +192,7 @@ + return function(markerId) { + var marker; + marker = _this.markersById[markerId]; +- if (!marker.matchesParams(params)) { ++ if (marker == null || !marker.matchesParams(params)) { + return; + } + return result.push(marker); diff --git a/app-editors/atom/files/atom-python.patch b/app-editors/atom/files/atom-python.patch new file mode 100644 index 000000000000..57a475ecce02 --- /dev/null +++ b/app-editors/atom/files/atom-python.patch @@ -0,0 +1,10 @@ +--- a/atom.sh ++++ b/atom.sh +@@ -92,6 +92,7 @@ + fi + + ATOM_HOME="${ATOM_HOME:-$HOME/.atom}" ++ export PYTHON=python2 + mkdir -p "$ATOM_HOME" + + : ${TMPDIR:=/tmp} diff --git a/app-editors/atom/files/atom-unbundle-electron-r1.patch b/app-editors/atom/files/atom-unbundle-electron-r1.patch new file mode 100644 index 000000000000..85c0c64ab794 --- /dev/null +++ b/app-editors/atom/files/atom-unbundle-electron-r1.patch @@ -0,0 +1,45 @@ +From ea6d1be3558d7610ccc82b3a44dd30657a686639 Mon Sep 17 00:00:00 2001 +From: Elvis Pranskevichus <elvis@magic.io> +Date: Thu, 27 Jul 2017 13:18:54 -0400 +Subject: [PATCH] Unbundle electron + +--- + atom.sh | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/atom.sh b/atom.sh +index 6b0e94430..ea8e0dc2e 100755 +--- a/atom.sh ++++ b/atom.sh +@@ -102,11 +102,10 @@ elif [ $OS == 'Linux' ]; then + SCRIPT=$(readlink -f "$0") + USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) + +- if [ -n "$BETA_VERSION" ]; then +- ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom" +- else +- ATOM_PATH="$USR_DIRECTORY/share/atom/atom" +- fi ++ export NPM_CONFIG_NODEDIR="{{NPM_CONFIG_NODEDIR}}" ++ export ATOM_RESOURCE_PATH="{{ATOM_RESOURCE_PATH}}" ++ export LOCAL_GIT_DIRECTORY="{{ATOM_PREFIX}}/usr" ++ ATOM_PATH="{{ATOM_PATH}}" + + ATOM_HOME="${ATOM_HOME:-$HOME/.atom}" + mkdir -p "$ATOM_HOME" +@@ -116,11 +115,11 @@ elif [ $OS == 'Linux' ]; then + [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom" + + if [ $EXPECT_OUTPUT ]; then +- "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" ++ "$ATOM_PATH" --app="$ATOM_RESOURCE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" + exit $? + else + ( +- nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 ++ nohup "$ATOM_PATH" --app="$ATOM_RESOURCE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 + if [ $? -ne 0 ]; then + cat "$ATOM_HOME/nohup.out" + exit $? +-- +2.13.3 diff --git a/app-editors/atom/files/gyp-unbundle.py b/app-editors/atom/files/gyp-unbundle.py new file mode 100644 index 000000000000..370221380b64 --- /dev/null +++ b/app-editors/atom/files/gyp-unbundle.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python2 + +from __future__ import print_function + + +import argparse +import pprint +import sys + + +def die(msg): + print(msg, file=sys.stderr) + sys.exit(1) + + +def do_unbundle(gypdata, targets): + gyptargets = {t['target_name']: t for t in gypdata['targets']} + dropped_deps = set() + + def _unbundle_in_block(gypblock): + gypdeps = gypblock.get('dependencies') or {} + + for dep, (libs, defines) in unbundlings.items(): + if dep not in gypdeps: + continue + + gypdeps.remove(dep) + + try: + ls = gyptarget['link_settings'] + except KeyError: + ls = gyptarget['link_settings'] = {} + + try: + gyplibs = ls['libraries'] + except KeyError: + gyplibs = ls['libraries'] = [] + + gyplibs.extend('-l{}'.format(lib) for lib in libs) + + if defines: + try: + dd = gyptarget['defines'] + except KeyError: + dd = gyptarget['defines'] = [] + + dd.extend(defines) + + dropped_deps.add(dep) + + gypconds = gypblock.get('conditions') or [] + for cond in gypconds: + condblocks = cond[1:] + for condblock in condblocks: + _unbundle_in_block(condblock) + + for target, unbundlings in targets.items(): + if target not in gyptargets: + die('There is no {} target in gyp file'.format(target)) + + gyptarget = gyptargets[target] + + _unbundle_in_block(gyptarget) + + for gyptarget in gypdata['targets']: + if gyptarget['target_name'] in dropped_deps: + if gyptarget.get('dependencies'): + dropped_deps.update(gyptarget.get('dependencies')) + + new_targets = [] + for gyptarget in gypdata['targets']: + if gyptarget['target_name'] not in dropped_deps: + new_targets.append(gyptarget) + + gypdata['targets'] = new_targets + + gypconds = gypdata.get('conditions') + if gypconds: + for cond in gypconds: + condblocks = cond[1:] + for condblock in condblocks: + new_targets = [] + blocktargets = condblock.get('targets') + if blocktargets: + for blocktarget in blocktargets: + if blocktarget['target_name'] not in dropped_deps: + new_targets.append(blocktarget) + condblock['targets'] = new_targets + + +def main(): + parser = argparse.ArgumentParser(description='Unbundle libs in gyp files') + parser.add_argument('gypfile', type=str, help='input gyp file') + parser.add_argument( + '--unbundle', type=str, action='append', + help='unbundle rule in the format ' + '<target>;<dep>;<lib>[;lib][;-DMACRO]') + parser.add_argument( + '-i', '--inplace', action='store_true', + help='modify gyp file in-place') + + args = parser.parse_args() + + targets = {} + + for unbundle in args.unbundle: + rule = list(filter(None, (i.strip() for i in unbundle.split(';')))) + if len(rule) < 3: + die('Invalid unbundle rule: {!r}'.format(unbundle)) + target, dep = rule[:2] + + defines = [] + libs = [] + + for item in rule[2:]: + if item.startswith('-D'): + defines.append(item[2:]) + else: + libs.append(item) + + try: + target_unbundlings = targets[target] + except KeyError: + target_unbundlings = targets[target] = {} + + target_unbundlings[dep] = libs, defines + + with open(args.gypfile, 'rt') as f: + gypdata = eval(f.read()) + + do_unbundle(gypdata, targets) + + if args.inplace: + with open(args.gypfile, 'wt') as f: + pprint.pprint(gypdata, stream=f) + else: + pprint.pprint(gypdata) + + +if __name__ == '__main__': + main() diff --git a/app-editors/atom/files/transpile-coffee-script.js b/app-editors/atom/files/transpile-coffee-script.js new file mode 100644 index 000000000000..c32e09cad92d --- /dev/null +++ b/app-editors/atom/files/transpile-coffee-script.js @@ -0,0 +1,23 @@ +'use strict' + +const CompileCache = require(process.env.ATOM_SRC_ROOT + '/src/compile-cache') +const fs = require('fs') +const glob = require('glob') +const path = require('path') + +module.exports = function () { + let paths = new Set() + + for (let pattern of process.argv.slice(2)) { + for (let path of glob.sync(pattern, {nodir: true})) { + paths.add(path) + } + } + + for (let path of paths) { + let jsPath = coffeePath.replace(/coffee$/g, 'js') + fs.writeFileSync( + jsPath, CompileCache.addPathToCache(coffeePath, process.env.ATOM_HOME)) + fs.unlinkSync(coffeePath) + } +} diff --git a/app-editors/atom/metadata.xml b/app-editors/atom/metadata.xml new file mode 100644 index 000000000000..8278b52b9728 --- /dev/null +++ b/app-editors/atom/metadata.xml @@ -0,0 +1,18 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>elvis@magic.io</email> + <name>Elvis Pranskevichus</name> + </maintainer> + <maintainer type="person"> + <email>cynede@gentoo.org</email> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">atom/node-spellchecker</remote-id> + </upstream> +</pkgmetadata> |