summaryrefslogtreecommitdiff
path: root/dev-util/electron
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/electron')
-rw-r--r--dev-util/electron/Manifest84
-rw-r--r--dev-util/electron/electron-0.36.12-r5.ebuild740
-rw-r--r--dev-util/electron/electron-0.37.8-r2.ebuild750
-rw-r--r--dev-util/electron/electron-1.3.13-r1.ebuild763
-rw-r--r--dev-util/electron/electron-1.6.11-r1.ebuild885
-rw-r--r--dev-util/electron/files/chromium-56-gcc4.patch48
-rw-r--r--dev-util/electron/files/chromium-FORTIFY_SOURCE.patch27
-rw-r--r--dev-util/electron/files/chromium-cups-fix.patch12
-rw-r--r--dev-util/electron/files/chromium-disable-widevine.patch9
-rw-r--r--dev-util/electron/files/chromium-ffmpeg-license-r0.patch44
-rw-r--r--dev-util/electron/files/chromium-glibc-2.24.patch15
-rw-r--r--dev-util/electron/files/chromium-icu-58-r0.patch51
-rw-r--r--dev-util/electron/files/chromium-icu-58-r1.patch128
-rw-r--r--dev-util/electron/files/chromium-jinja-fix.patch24
-rw-r--r--dev-util/electron/files/chromium-last-commit-position-r0.patch26
-rw-r--r--dev-util/electron/files/chromium-linker-warnings-r0.patch18
-rw-r--r--dev-util/electron/files/chromium-lto-fixes-r1.patch36
-rw-r--r--dev-util/electron/files/chromium-lto-fixes-r3.patch108
-rw-r--r--dev-util/electron/files/chromium-lto-fixes.patch26
-rw-r--r--dev-util/electron/files/chromium-pdfium-r0.patch17
-rw-r--r--dev-util/electron/files/chromium-remove-gardiner-mod-font-r1.patch13
-rw-r--r--dev-util/electron/files/chromium-remove-gardiner-mod-font.patch13
-rw-r--r--dev-util/electron/files/chromium-shared-v8-r1.patch15
-rw-r--r--dev-util/electron/files/chromium-shared-v8-r2.patch79
-rw-r--r--dev-util/electron/files/chromium-shared-v8.patch15
-rw-r--r--dev-util/electron/files/chromium-snapshot-toolchain-r1.patch23
-rw-r--r--dev-util/electron/files/chromium-system-ffmpeg-r0.patch54
-rw-r--r--dev-util/electron/files/chromium-system-ffmpeg-r2.patch50
-rw-r--r--dev-util/electron/files/chromium-system-ffmpeg-r4.patch48
-rw-r--r--dev-util/electron/files/chromium-system-jinja-r11.patch79
-rw-r--r--dev-util/electron/files/chromium-system-jinja-r7.patch35
-rw-r--r--dev-util/electron/files/chromium-system-jinja-r9.patch71
-rw-r--r--dev-util/electron/files/chromium-system-zlib-r0.patch19
-rw-r--r--dev-util/electron/files/electron-0.36.12-vendor-brightray.patch144
-rw-r--r--dev-util/electron/files/electron-0.36.12-vendor-libchromiumcontent.patch75
-rw-r--r--dev-util/electron/files/electron-0.36.12-vendor-node.patch109
-rw-r--r--dev-util/electron/files/electron-0.36.12.patch257
-rw-r--r--dev-util/electron/files/electron-0.37.8-vendor-brightray.patch143
-rw-r--r--dev-util/electron/files/electron-0.37.8-vendor-libchromiumcontent.patch71
-rw-r--r--dev-util/electron/files/electron-0.37.8-vendor-node.patch105
-rw-r--r--dev-util/electron/files/electron-0.37.8.patch391
-rw-r--r--dev-util/electron/files/electron-1.3.13-vendor-node.patch95
-rw-r--r--dev-util/electron/files/electron-1.3.6-vendor-brightray.patch143
-rw-r--r--dev-util/electron/files/electron-1.3.6-vendor-libchromiumcontent.patch78
-rw-r--r--dev-util/electron/files/electron-1.3.6-vendor-node.patch92
-rw-r--r--dev-util/electron/files/electron-1.3.6.patch422
-rw-r--r--dev-util/electron/files/electron-1.6.11-vendor-brightray.patch163
-rw-r--r--dev-util/electron/files/electron-1.6.11-vendor-libchromiumcontent.patch86
-rw-r--r--dev-util/electron/files/electron-1.6.11-vendor-node.patch80
-rw-r--r--dev-util/electron/files/electron-1.6.11.patch512
-rw-r--r--dev-util/electron/files/electron-vendor-node-external-snapshots-r0.patch116
-rw-r--r--dev-util/electron/files/electron-vendor-node-external-snapshots-r2.patch117
-rw-r--r--dev-util/electron/files/toolchain/BUILD.gn19
-rw-r--r--dev-util/electron/metadata.xml26
54 files changed, 7569 insertions, 0 deletions
diff --git a/dev-util/electron/Manifest b/dev-util/electron/Manifest
new file mode 100644
index 000000000000..37cca30161f0
--- /dev/null
+++ b/dev-util/electron/Manifest
@@ -0,0 +1,84 @@
+AUX chromium-56-gcc4.patch 1933 SHA256 5c1eb9e244b7ee3981688ea6fb43836a9d74280f2185893a0048bd4e18d4c71e SHA512 85b59daa229da2619f7869e600bfc15962c4fdc15c30cf3d314852a8a1138fcc3765e65f0e450c6976b82559ffa43d0f3b5c006ecf36a7585e344e4c0994f999 WHIRLPOOL 82db0b05bdc5694518ba5164c8bb281ee8cd7efd325af191473e70d020854b2a7ffc4211fff95512da574cbe886d07ed8387c425ee95878508221d64891e4f59
+AUX chromium-FORTIFY_SOURCE.patch 1050 SHA256 ffc664a90b68600de2d80a4064df25ec6f34fb4443e96ef2f0741ccb49d90a4b SHA512 d404976ebeca7ffe4e07770055aa9ec8db8761fcbbbf1e463523232a135e11d201c6263d468124190372b3178fda4ea36bdf9be34c50183b7ca93f14ab9d83b0 WHIRLPOOL 57a6556d206918cb87a8dbf1c501b54227f6a7aa26e10ba8220ff713be71042b2fac0aa9c120f04311a53182abbdabaeeb982869f51e2335e85a08ec0a803bc5
+AUX chromium-cups-fix.patch 276 SHA256 3d45b35c0dd02b13ce738080db2bab7d32f3c6815c4323060f5e469d259548bb SHA512 20fef0212bd51a358149c8b6d17060707f290b502b2ea7f5561882444465d2e3c1c0baf8c91071ad80ec16622725b5dd4bda8df15c321541caeeeaa6453cb606 WHIRLPOOL 70351b44408948d80de800faa7647fd05cb0d19ce3a0b8084ffe5ea8a7ccb47116e3c311306376e68dba7e9ec8ff8ae742bd418704ef3d4cfa3a9c6a4440d045
+AUX chromium-disable-widevine.patch 266 SHA256 677418733c5ad59913e39eedd9e90b57afdea04566bae6c6f2e5c0d8de40f297 SHA512 51d53ef41fa52314c02fbd4dd3b521b7ab317f51a0ca487973b6a864a129659ecc43d50ff436e78ef582c2edab504c457d1b74313002c28ac0b7864c43c14275 WHIRLPOOL 1ba799eb3091e63f9dbae06df479b332128f4c8c0912491f35702229c16140942835eaab61ad6bab587f508d7ce0c79f840bfd063c6e0ddc7c3cbd7e3e836dd2
+AUX chromium-ffmpeg-license-r0.patch 1855 SHA256 6b844ebf2c2216911b131146f3a01fb84468ad4f9f4cee25d8d3861a67f77c34 SHA512 4b8c2beb79ee80efed32fa69ee3790fb058b0747c61b1f8ff0584d08d3db25e0216613808a16c4c8012e3c747f8936a8d548d7157fcd26ad0be1d45f7ae65b31 WHIRLPOOL 0a39a1b61a038904e501aa335fe29068de126556c706b218a5bffbac356998855aadda83e0d7e46bda40cea50374bd5c157d5bd2b85181a5025a269c3e5e58ea
+AUX chromium-glibc-2.24.patch 685 SHA256 6953651c002efe7fca8cda3143e963037ed38a0a4bc7ccb79304637c45340047 SHA512 73a1f271e227f3a906d1a9e8f5e84327e976e3d2ecd3c4543b4136bd78f89d4dfa31374b1a30dc1e6fa0b16bd4a174cc7e77d22ce4fdef85533611ed73a37905 WHIRLPOOL 7b81b3b28663bd6e4cb9b58b2845321803a886fbcf3e1509ab46fe90772145a10f092c846e8960250274b3af049e7a73ea708f70f69a21b7f2ccf5447527f4cf
+AUX chromium-icu-58-r0.patch 2772 SHA256 f91180e89af52ebda009050b280b081d19235f602ad155741e8d91ecd2ed1777 SHA512 c8d4072411a878f501f737d48d6117f36616d08b336676b958823d723a9a88bd762b82b0bb97f49f6ca245e53c57bf69ebfc14361ddcb8aff81d7ab5309a68de WHIRLPOOL f976880489121fa5cefb61eee6c8c2892d50e05ddf8e5fcfcd46e594f86f60fbeb1ad6f353ce0ba9ab366220826eac2e5f6bb0c33607c4b52586772d4f06c6c1
+AUX chromium-icu-58-r1.patch 5543 SHA256 b2a8f29c9579c9c9e18543344f50398f5d5d043af3517a0d2ebbaf520714b6c8 SHA512 bbf2d8015cb7dd1178ad8392d5bcbdc9e63a1db628098a35b1a362625b18c1752c7832b8bce43349abf423cde57ad51ecabfebefe062766a39d66540669b08b7 WHIRLPOOL 690c9428ee51af0286a3d17f6b01a3431c07321de5e59f07b08342b84ec5bbdf53faaa6b4e9d82545d47b30c5a425ce6a2fc8e9320f4c5343fb4242327d4a102
+AUX chromium-jinja-fix.patch 833 SHA256 966b65ecfb6f220afefb13f7605d3b1350418d2e1dd4592b2d388fe47a117363 SHA512 cbff41b68d090fac587cb3647e6d6e5b1aa514b842195b459ff79142a0da982a1f3462f2cc02f005064e52fde44d29eff92b072658219d4a6ae88bab57d26eee WHIRLPOOL 56c12ad59d003eda4edef1b14f5e0b6bde4dcf026f8459d929a09103d7216bdeae1b6f44f721a29f0fef9fe600192adce15a20cc6f3c141788e87a46430c2074
+AUX chromium-last-commit-position-r0.patch 732 SHA256 fc6b422004d65e316d093e75547f6b7670ada7f0e969ce0f6aeeabb281a17e2d SHA512 303fff289b1b7af6d42bccad65e45395017b0e3694c352a1121b0374a3c9b1ff81baec31306e7773b5160b83c9f88b3fb9717c0e6c183508abf0716757ef523f WHIRLPOOL 47caac1bf9f34a5673f22d175c0112fcd7492bcaab3d0c1908519bbecacbcdc4c3051c053dd8ed811ca965bd05b528b464fd6ef78b843fd83286274c468e2eea
+AUX chromium-linker-warnings-r0.patch 650 SHA256 f4fe415c84cb0e5fec54f5d8bfa97f6f1c936eac51bbfc50e11d2a48c3827ad3 SHA512 566fe00fa7c31d6552df1dfb55280c08c72c76e459ba30acf5b980349dc91204e521787230eec546bc8d3414be8f0b666d9925f6645e5f527a6e1ce2a8198f72 WHIRLPOOL 70680572b8c88e2c6efd55483a6e78e61a8de9262ad0896f218598bea4ff0a0d9d5b97cfad34cf8eb2420a9d07b84c516222f68e879a49d6f55d4190ed5a6d0a
+AUX chromium-lto-fixes-r1.patch 1188 SHA256 1d23227e5c15148afe593ea16546feaa5e6c38c756310a35a146f8b8730ce877 SHA512 684c2a95a46bc4c5cd5b3f6d1b7b7b8c91cb1bb3eda32e49d82697668b35aaa20b54d92b7b3fefae095ce1db91b4ca61eba008e2345941a109a7601456158147 WHIRLPOOL fde65a5628498e5179878e25db09c2ef7abe1101e7b7cacbaa3ca071da924c01552e4d9335e7b4d55e0213a21584c2bbb15acf0ca8960cfad05c1851c67d4983
+AUX chromium-lto-fixes-r3.patch 3426 SHA256 a1dc5b32c9607ad4b6a7ee8a1076b41018545d39e814db8b989893fe98283881 SHA512 4222712141637e620b43bc7c19d87a1eb48d19eaa4bd924156cf2e15bf4165faa03e1a664b06e8bd897f56fc7d4ccfce5014af1a17f45fc1544d2338e59895ef WHIRLPOOL 382bb873195857caf9f744fd75d6aca1a34ef0c7d5437e73934af2ff9c7c8b4d52c05add36d461c3fc86b84a597509f2b6853db696092d99cc4071c8d9d6a454
+AUX chromium-lto-fixes.patch 901 SHA256 214a63692d0c1471d768d1591e1a596b9cc7d52434dea613f26e25fdba6818e9 SHA512 07c324db940c72807d9ffb16ea41e67c0dc4bfdb676a8d98bbe5d5d0919bd4fa686bb1b4c16627c8516e82a7646383a76a99f96a471f923544cb86389fbb6c24 WHIRLPOOL 24dcbcb93af3e164a608e3deda8c0435efd0930a836b5212447c1915e30b8b5eb26ae391d164fd9547d382e834e40cee188a9c23dcd09083fd6bb08b1a0ad429
+AUX chromium-pdfium-r0.patch 774 SHA256 0f1586c7f9ad2b1838bf827491b8fec01ee0b3253daea2b0b01dbe0887c5082a SHA512 ec45fb601d079f3e3f2c4fc4ca5df0873ff985793cf6e2982db3842d4eb86c8846d6c90c6b9fc3b86da8939acfd74db5a285fa26383d11b7b7b59ef3e782f0ba WHIRLPOOL ee4cbd43e39a903e93569bcd8a0f1578ca6c01258ea7c195994ce8d555f9ec1bcb55c28f443a7ee717b7996ce75433d1f89c9ec8652d6a8c61dfd3d455f0ab6f
+AUX chromium-remove-gardiner-mod-font-r1.patch 467 SHA256 3c8b346bf2227bb3de8a3d40704e50d50126eb9282a7bfcbca99ad404d85df0b SHA512 7574734e4e5573811a3f9f4e26a2dbe2cb749df3f5d1f1308d5ec8e25820d8ccaa63df8bbbcd7ba01221c85a0480709fd99a2f224238ceada36ee9ff6d53f478 WHIRLPOOL d1d41afee9396aa2759a837fe007abe02fb99e887a5354ebde9d9aaccd6aaf5824a381cb67ff365a706ac38d28472dfcf344e67889d3a84af352d0056e4365af
+AUX chromium-remove-gardiner-mod-font.patch 482 SHA256 a9753773f6fb4fcc39e8341a37264f107e901651273b8d190d079ea3bfedbbb3 SHA512 49b5d3787acba86958766ad34a5ceb3d9c95a5d743a569de9fdd08c437f79ff45a37dada6e5d82aed51b75ba104be3be74a89e6e480f0964c537a02f8745c6e7 WHIRLPOOL 0804e4cf9ee85aa6fffe3d122785f7f5a5dd3ec0bb21aab2f9f2baa41204ca81ca139a5b86bb194e1991f6b79079270954b9ccd758c41843e0dcb5648498950e
+AUX chromium-shared-v8-r1.patch 523 SHA256 52cedfa37d1e6396c5f391cee86789f9f49ba5654d6b362050eeb0fc913d4d58 SHA512 3c0d397015424b93e0f3ce71418a71645a3c5d790ee8c2cad1ad5bf833da9e6fa95a3cee1195b212ba9eb5ec875ac007b93faeecabe55e825fb0078154d1fe6e WHIRLPOOL 3238b77889f87bbad2d1165ffa65cde109c995b85fb97767af8f88e5634afac0958c33db2318ab6d4ecf7b54fd66934494a230029b5fea2474ec0c0403a11f3a
+AUX chromium-shared-v8-r2.patch 2204 SHA256 e0565037d246464b8eaa7f78167991062e3bf36c2a3ddd4ecb8b20dda5769380 SHA512 2b69722196e66cfb35a036615d041e23748c84b5cf80e61784e30e88426f6a23a58f0a2a779b93eadf3c75e40ef5c8953acfd07a5ca0bc44d2ece29705eaf7c9 WHIRLPOOL 7487eca7b90224dd06400d5aef0dd4ceba944bae4f8a2cd03ee909f902401ab396bec77b56cade2adc9fa9ca70ef4fef4ffd2034ee48154aec8ee49b8a6aa0aa
+AUX chromium-shared-v8.patch 547 SHA256 51d9af17e17f5ab0ba69198ae271d9f43fb10e2aec8ffdc03147f98606794afa SHA512 eb1a4329856f29e8c1443da7fa7dd9e5bb384c60212619227b8c4cd5b6b45c541c3d364e358fca07c3443bfc92ff873cf66ba1c3711b586eba0efcc1bbfb4f92 WHIRLPOOL 2dade26e96a3545fd2fb99afcb860107f45079c63b459c27a50a85c36cba98da71d0834a5c48489e6a6d982ae52fc5226f1a97d0fcab5bc9d51d15e630aed370
+AUX chromium-snapshot-toolchain-r1.patch 990 SHA256 b71ffb3bd41e65161c8df5e5eef7cc9b35cd409223951a9fc09d8c31b3064878 SHA512 ea0a9ffc5aad07bb44dea617c1c3fae04b1c8b83a4671fdbb098986dbfcbe9af3785ebee444e0afefe6ccf05eb6f1cb5f688d22e4bd8a925fa50e32c93738196 WHIRLPOOL 527e6398f1757176563068a1483fb012ec0b0c6049beaf16a3bbef037988ff0f3e32868511966614d5a2d08000cc8e5205b26951b8f972b2f3274a62b69c59df
+AUX chromium-system-ffmpeg-r0.patch 2449 SHA256 32f65bb6d1a70eea8c0536e7d9aebf8f09cb161d2dd0cda8ace52ae0e417761d SHA512 35097cba0ba5afdf20bb3899d588396a1c8ab287a5928104efb0506559bcf84e1029fd19788326b7affd71daad2e897bf2af32b4a388a03a3e222f19cab23011 WHIRLPOOL b1f4ae204fc79d133e079adbb82bdc960c3a5ddabbf01da4fad101eed8e00e82dafe094cfeb3c8ce2462dc36fe6a63234b6545a7e13686e78e21a7d4c8c50c32
+AUX chromium-system-ffmpeg-r2.patch 2350 SHA256 de19a06e10f6fb8a405c019b04dffa1616cd770bee6aa96adc9028fd7e3e2de1 SHA512 bd662718e65d72854018d7d9e20be0196057de69be87e2ef18e1a8c98b2ddaccbdb074377820b31e6797d9370aa68724fabf26d826a402595390730857cc3956 WHIRLPOOL 9b017452f3b406e9e2329b348ddc0d1b240d3681c7375b31ae393aece32c080304aea4511e4a718086c809599a8c2329e3c917e391bfabb822c13e15248cbb93
+AUX chromium-system-ffmpeg-r4.patch 2307 SHA256 e3c474dbf3822a0be50695683bd8a2c9dfc82d41c1524a20b4581883c0c88986 SHA512 e99601fdd199cc95cbc6bb6b03283380f65cc835fbe62555ab97ceafca1e00d7c257a6b6f2f6da999c497f3128098e631989ad7cf7840b160b0dda982fb843cd WHIRLPOOL 8f13080e71e56d22ba0dca6b793f1aab8b841ab17a4688f0278bfa15b68551a5898860b0a37722c36a2cebe68e148a6d81964b88bb0f673e87a9e7bb69821ea9
+AUX chromium-system-jinja-r11.patch 3709 SHA256 dfce2012b4a390219da1a057d827b7265b499d0915a6a69617b47193d585da1c SHA512 008a3fa78dc09493f98bc1d5f615fbf261c055a824f1edd920b775b4d87992120a1c27111c8d5e4a1b335b16c83066c01d22e4ac5b91b2d39f811aa9b0605c00 WHIRLPOOL 817e64c67d104c3485737c00120a6c7385102bbddbd57d1b653ad55bf094057c44327108a3c4d1cd783226b0204efb76264069fe0e7470e06fb5e64aa285835b
+AUX chromium-system-jinja-r7.patch 1611 SHA256 ff06a869615dd10ed3b26946b6a3113b3866c4d72183037be30996857e56ce32 SHA512 689cee917bd8a81edb4e640d551eca8bbbca9fa7c8d0afbca513cd911880773e7bfa0e3d558ca770afb418c6e0b42c28edb08b4792de900df1fb0b58afba22ee WHIRLPOOL 340253d54a041a1cb607ba5048ac83bf5f4ac1d691ecc69f09d0fbcdf4207db8b665f7f467b2632ead988736c4779f33fd749d91b0d5f2ecf16caff09725d444
+AUX chromium-system-jinja-r9.patch 3243 SHA256 a7598aaea19f8957ccbd01ac7f7b8616b0343ad248e999c99702a72e0fca8519 SHA512 c750ff04a4adaa1f18d0b56b4e1937f47ad8bc1a53bd251e5c7c46293f49ea5543807a9e70c8ed8d18df2ab8aa52dce2f5a5ce3148e385e6472af59b2168e8e1 WHIRLPOOL b151ba7b2a8217a1b5403f6c50f80679ab4472944432521c49e1cd170c074e0d742cebfb9e4e6add2a6d64a739a6a6cf419f2206909eb173751e25103b130030
+AUX chromium-system-zlib-r0.patch 411 SHA256 3f160db5eea72257d957541d69960fd1ea2657175ef16545725d2124990d9cc7 SHA512 ea7b9da8bf504583e0753ed2d69e95e6d2579bb9640b52b9d575966f495bd4dc15ec94fb35ad9877a736dceed946a38dccac028a4130326fda3f7ad7dfb3b07c WHIRLPOOL 7a19d22d5ec39348b00dd64276aee1f00b915dc6a6f20c61ae545974fc128c6453229f8b231abe5e2980b6bd8b9f3e03fef4d2516afe813a115e57ceefebd78d
+AUX electron-0.36.12-vendor-brightray.patch 4561 SHA256 d3d5b6b148f97ac614e9c3948761c053f45f9d8ae41a40a5a78b339307b5a21d SHA512 d96922be1a82c66f26fd433671f709277f21ea20a45425ec4f20bfb011ae6da9feb7fb9f45bb0369c9c83df07050edf31f9b9c22e804f8f77c249d6aaeeea2d1 WHIRLPOOL 090aea164146597d59f5696203159dd3e5dd197f08f0c1694f5641fbfab00bbb9a9a88d3610dc2ad8e5600a3f24a0edd77d95c184df873c77b89cea192f85008
+AUX electron-0.36.12-vendor-libchromiumcontent.patch 2939 SHA256 7b7ea865d3ac70299f01a783545cdbc3149c44634f4f931d79c00cfb2c0d0f35 SHA512 2ee97d7fe5c5abbbf76983f3fc36213844adf48d48ddc9f7962b1b66d14809aaf8a5c5a9911411d369a5772093c2d655e827160cfd1a72c2f620e4f5775819f3 WHIRLPOOL a3bfe6daba3a85bddf4065bdeea99b084ffdace8014b840be9c69db9eadd203220fe4b7bd231651d03d96b98acae9052f8b5a021774fd274891972690658bf96
+AUX electron-0.36.12-vendor-node.patch 2818 SHA256 f9aac81a3927d79cea8028c3908be9ca1f371c19bba4007df30b74f4498ba494 SHA512 068115d33de795200ac59797da3b1f4a1f509f4018e0e6442ffcc2fc423a7db969672636db8c2fad95a5d2fca330d58f563de48cc91dda1553a0bb6c4618f648 WHIRLPOOL a5d267afdafeea8d9e8433ce3800ce083fdc648b4470b5d5eba89bf4f98466b1382c2add164d9c5ea79fdd7614f979d87513c5bac17ac24773fd45b75713cf53
+AUX electron-0.36.12.patch 8307 SHA256 9463c9d42c076bba47fb4fe98dba23a09583dbbd6e0d289e4d5436dc816a8349 SHA512 844d7ed9de911f7c8627869299f3c97a8df01b0c210ca85de0bc6f7df004f3ee27b5784b6b0cb89f34d8a74b5e2321c5349f283f08f49371294ad3fffc8f894c WHIRLPOOL 564f94206829f9cc2f4cbc8d93d0ffe57a4e952b8e40a7c00c7a139bf33fa6caa9be98edfb5be9b1ca7e0e85f530216019b661dc8b1108cdf3aa5cde0aa4a10f
+AUX electron-0.37.8-vendor-brightray.patch 4518 SHA256 42426996ae9923fe32d09f0c9790f6550466c1a3ae64cac10a0f5f161c213388 SHA512 551708a0cc880143ec40e5d029e20edf868336e99e2c46326dbb053209bccea3bf64516ce4a7adf39cc8f9d54b455d62f998685379f361964e8645d71b43368d WHIRLPOOL 3829b049a2bebaab99ead9975701355b554f2fa3f06c3cda3a3d7852b7b8944afe4a1405d21195e1fdefc7c39c340f67991f572b97d7bc11268bfb501f2dc1ef
+AUX electron-0.37.8-vendor-libchromiumcontent.patch 2661 SHA256 0f8f3c3878d6955dcbec55c3569336ab61a503ec22801a7098a091e27203ebe8 SHA512 b0b7df79e510ad42e8cc0599c358e3e1ae3bd99ee5d91bd683a47ef6d23b7cd41d9ef4ef90970a9a80d03d77e46561df363cb0916926219de293813b04f0a4f8 WHIRLPOOL 510e6a0134d5d6cb649a51c191cdd9c5355b8ff273fe88f66f078cad39cd3407dc1c4ff717ce6fc9052203ed20e5a23ed5247b79cbd64de74588fa46471d51e3
+AUX electron-0.37.8-vendor-node.patch 2828 SHA256 a10c9f724c6cd3d77c8ac24c9fd5cf629fa20190a659b8f5f9a0f1664563c333 SHA512 df0b01481a1920d9f7afa87a6a84bdeb7dfda0041d2d47e8bcf33e1e06711f9be14f7453d75cff45692ac186969e4668356b167fffc46acb8e737fa5e837b5f4 WHIRLPOOL 41e7f9e6dbefea379ec2b223ca44103c8c2a0d21dd41985c03ee1f686238d09fa801b4b58ab85262475ef4a0c69e43ec1cc50b777bd82dde1734f4b8f63c785d
+AUX electron-0.37.8.patch 12649 SHA256 c9d6aaca05d32454de77d4effab037328b76ce48acf50cef3ae86ce9971fe670 SHA512 57b51dd5d8a76e0f880563fb8c9fb89c26f21be227fdc9b446f26b7a066ffcd19564ad56e74a65c63386b71feb70a5578865f131be76c33921e7f13619b56ef3 WHIRLPOOL 9f35cbef21d168d824e57db374538295ea4bdef89ac6ca99e9ec4ecebbfdc4806d20b4ebef0f5190112574d2117e03858a671570aecb712adf87566865421648
+AUX electron-1.3.13-vendor-node.patch 2733 SHA256 95c86c29890445427c87f0f9a5a96b97ca70949428206cb79729fdee9b43d925 SHA512 0cce18ac0716d62c1e66fa9e24def3196c2a83f83acb0b43fff931673a359e1f84cbb017bbd12f3a4c280293e7fb2e55dc712214fb490384e802f5696b9dd46d WHIRLPOOL 759186e148b024bf9a9c00715a48df9ce8de8fbb2f755203e6b253c696bacd80b749c48c450a52f34cb6e942890ec53f97da187c6bf85ecca29193eaadcbe87b
+AUX electron-1.3.6-vendor-brightray.patch 4520 SHA256 0577c85597b9f7f1a99062b7ed1a7d018f62fc8fc888dee63f29a0c39e47cf42 SHA512 d61bc76c3c2d6258923c08f269d931ef7100548488cf74850525affce62583d968f5bab520f559505a8ac1bf485933b4b38ee91205205e365108146ff66f8e1b WHIRLPOOL 147d64b1059dc15165385aaebe8e6dd0c323eb75d2afaa52054026aa4f829243522716fbfa69f08168cfdd60880a52b0feb938859ecb1da35f40ea94c0ac8a7e
+AUX electron-1.3.6-vendor-libchromiumcontent.patch 3129 SHA256 9ff870d6fc59620b80bf9b1c4414bafb405ad79fff2f9b5fc9d70952715fe24c SHA512 4bb3a80391b485b210b1b2f2005c7f9ed7dfa67c19931286bb93b69eabe0b3d54cfed55afe044d35a6af17e7f50cc4dce3910b9c11f6165c4008f6e976fe2658 WHIRLPOOL bb370d35156f5ce4a9673820d14e304786ef15321b44453f4a41ad2cdc7fcbed0b24770efd484d0a5e63ad898f3af53364d5bd8ccddb0af8c3ad08e3d7079939
+AUX electron-1.3.6-vendor-node.patch 2507 SHA256 7dd1d1859fee46aad499389836c41ea89f0430d3fbf5500011d94e6b5fa17e2a SHA512 8d1c3a1ac02824a5a221b7b7fb239c2c966be993212929e6aa707f2183627b8e22c46136bdc58931a22d752218f2cb64d04c9a5d9c2cd2c3edff2d9d612bf4b3 WHIRLPOOL 194ab45fd004b0ee444f734471df3e836edd200d3cac17abd64247025ae48fd80f24db6a77857c7fe337f2571cf3836ebb0d9b0c048f9e886690404b71ce8bda
+AUX electron-1.3.6.patch 13898 SHA256 8022fda203bc9b0de4db1c4c1814416db1e71a893d03a7c6a0ae4a3faf8182f0 SHA512 600126f0ca1a0f0553cd07278d129c52137b792f84b33ec814734e73011aacd9dd42ad2bf489c4c2a01117f9af019c514ed423294c6619c0f11e76aa8fa19a06 WHIRLPOOL 990957e95ad7ccf5d33f3e4da714a695a39086a4ba1a6ad442a0c9117c9f05889d50458ab5fa932c13e2fe32dac229eff979dc859daf1d9d52e150558484af51
+AUX electron-1.6.11-vendor-brightray.patch 4984 SHA256 4f61f160a1496addf28f6a0df0334ef8fdf16a6113b64cfd9a27654c141be677 SHA512 324394042b613740608d42226d369d358f7c8b0e21d823ecfc5cf5840d5af65236b21a2ec43b76bff1efeea9e90358c119b971b22cd9e0d0efa1da7afb031abf WHIRLPOOL e0b0469ee1b61d711526aa12850440a430aadcc2ea42f0a9285fa1820ab55792d5658bfe30e8e4aeee1178aa552e8592bc7f07ff3a290422fbf9d2b22c7fcc35
+AUX electron-1.6.11-vendor-libchromiumcontent.patch 2503 SHA256 d62688a5b6ed9d343257cad0e18dd3f97bafcdb081c2bf75298715f271ced71d SHA512 24926af9061915fb322411b471fb6fd415f4e2748d4808daa81d3aa793f76b0d7bb87711c6f1d14a87bf8ac422c4f1fcde32f00ce307d218f53c2b8f72d7d38f WHIRLPOOL 723dded398303dba0bd1fe47fa752fcaaf519489ab195fbfc23b166677540b40ac1e8fa8d82c3890a01e10cd752fa1d4120fefd4ccbcd0683cb3cf34d973960c
+AUX electron-1.6.11-vendor-node.patch 2191 SHA256 55da53cead124c2fbda92cfd9baea74ce4528d831be42ca4267082e7b916f64e SHA512 5731b8901501dd811301b701c916abf064ccc9eb1cfe4aabdcb7dfdae3ceee633ea050e8b25446040d368df50f673a318fc41fe4d8f7e9cfeeac26e90bb7e19c WHIRLPOOL e486b940db7b94bb450c5eb0ed3d4603369682930978c086a243030093c3c132209239d62f8853519cedb71d8e1e532ba4692bc2228299476cf7a3541556c271
+AUX electron-1.6.11.patch 15920 SHA256 fdeb2ef7055b7412c06f9c0eae7cce3e07c0b6f7540ad191a80f65fbc01fad53 SHA512 b84f503f86f66f50639f200bc825dbbbcfb6cb87d310bc22ac8efff47004af7e198a19fc64f6b2b7f7fe3205d3073ad4743c43ff09226d5c2e6647fe195ae9f4 WHIRLPOOL 7c86b0c385b0e23c428159d333d8096f2e4af2fd6a2f817654748468a9d463b1a83b8f7b1c4c82b5984fafc2cf7ca1558c426e78ce675a30dd9cdf04e7dc5b05
+AUX electron-vendor-node-external-snapshots-r0.patch 3003 SHA256 dc06637df16a0f0670381b4e160299b44bb1cfafeea501afb20efc4e9871a062 SHA512 ad51509b75ed5a3bb31be19ca4e3f7b44007fe9cde5de7521d381406b13ee651f4716566c0483ae2eee05836e3fa51a107fbda3f1ca400c64f4aecfe165becfe WHIRLPOOL e2ff5554c7b8e56fe0c899a3fa720d4fc013e1363d782cbe155a17504d49b253931f6048912e3cd0dc366d59f036c5629685361abda2aa0c05089496aed9dea8
+AUX electron-vendor-node-external-snapshots-r2.patch 3119 SHA256 a4883a05dff8a2e47493b3feb99dd9e47f0f1d46b0b57424333414ab5297e4f3 SHA512 25d563dac3819c41edc5609acea572b8f71abbbda77d6b79fe379118fe37b5948aa29b39546c9aca70ddb47cf6ef2eb57cc15970e8afcd989d94868f18c6f731 WHIRLPOOL 9ac7f027fd7e604aacdc60dd52b166a427264e804b5fa23c4970a19bcb57a674168ba6ee0b85e87e5efcccd26594a868073c9baf255432a4c5ccdc9c8fe1ddf7
+AUX toolchain/BUILD.gn 400 SHA256 d51e70d29f69110726c1ae93a4cfc8685a2feea24ce19516c219c179ae9c62b8 SHA512 cc36ab3406dcaedfd9472e94c53d3f25c4f5e25e2d1275e2bc99b8e18ffdf6de1583f7e0ceadfb8a8d10ab3e5d7018b84ec506e3b31a0a55cfb9453fb19ad3d0 WHIRLPOOL c5fbf488502ad5fb080dbb2eeb6c490b6575d30e97a5b19343ff36f2c5819067af0b920e30edbb84ed097ff1215eb06a2c1a57cb8f63c20f859a31533db400e0
+DIST asar-0.12.1.tar.gz 1016626 SHA256 731714f0036318fe0878b517391a01977954bb088d4dbc7dd98682ff1e03c0e7 SHA512 fc64be9b11215426d405f7acd7adf6c0eead3135b0012baf6d168a13c77675058a4e2c60682928ac014e4bef4538d452ad745d1e87dd315387997a19e04718a7 WHIRLPOOL d73b8bb459724bb3b011de312171519c1f1954a94ce1bb0a20eb9877c168baa82a15786d3ab420d5b3d32ce8a11333e85f844b43c21cbd56c3b019e73774388e
+DIST brightray-8dbaeed37b9c4fb8ae985670b142f659bb265fb4.tar.gz 76965 SHA256 fb5e57cc723500c8a7b5fba8cf0a38d4ca79b3f967dd9f9427e6fca8cde81552 SHA512 eb0ad05107ebfb4151fb0f26f7dbea58c353cde0407c13ea00c7b98487fb29582d5f3e334900749dc43c8aeca828d8885c4d77dff6739de97ec19b33017a6e93 WHIRLPOOL d2aa3bd6361643304158dff859aa071400bc1b74f0fce934d5dc5eb25bf76d599a27efabde6c13bd20dadb15ffec7bb3ea8577bdb1e38e2382f81600d543fd35
+DIST brightray-9bc1d21b69ac99bed546d42035dc1205ea6b04af.tar.gz 74416 SHA256 9cb944145085384423efdbdbe4dd523b71eaf517fd040e1993666832ffac4fa6 SHA512 c7a16f3634111a43d45959e0406488dc7417848403a6261204b58f67d62688f888f733ca23f3eac3a2dc76955c185ce845d63a6dc1e5a0fba54fb115202414d0 WHIRLPOOL c1ebe0e3adbd74da772778589f59f30a2e288723d62cf8bc686c1b0795daef4c31e9d38363b29dae9b162ccf856707f7a9eb34c8b31ca76042870d7adfa14e99
+DIST brightray-ee26c5218eeec199c54c92a7517a72d2dbd0adbf.tar.gz 82375 SHA256 37090168dfa0d776e28ecca88ef3ba57d3aa2937ef7dc4238e6685aa6f2b3e21 SHA512 7595f5a168d40c42687b8013b588e9c74d6f0047e71549a32d892fa3ca9de9d467303e635364bd779e94094aa9772b705ac027aad481b40d42c0c039ce8f3709 WHIRLPOOL 7b1686cfd9d2189942ab268485a7b230b99ef2a043a4e1b06aaf25c37a01a4278b35769fd73af5b838fdcb782f3a78a2821f95f6a91358d27f11149451437a17
+DIST browserify-14.0.0.tar.gz 1847439 SHA256 616e53fba090d14d673748c12e8ac215b6f7d6f74362666ca91065ce80386344 SHA512 fea8219ab2c5b422c15cc8c305a8aa0396f3de46c8d602eb4976af1d2b0a043214f808e3fa8e31cae0ad7c76d9ddc38239d0208911105f9c851efddfaf96b0c7 WHIRLPOOL 2d2a1dc6f5d5c0db2b43acee8b1dc69c6d3c431e1e0172bf4a3894b628e49dba1aa51155fa8f04e260ce2897ea8c562af200f3e569b9b38e0c783d34c7ae6087
+DIST chromium-47.0.2526.110.tar.xz 394673276 SHA256 65a86d9532e03f94844a4e9b1996af85baeb00c95effe962baa153352483463e SHA512 d1655e822776567101632696c7817067e9a85c0f74df22ea40b8fcb45b9571471d8bb1291bae4dd879d746ddb57206276db8df92ccb546bb00129bc26bb33bb8 WHIRLPOOL 047d5bd9f3cfc09b85288f8f6c24bc72ee2399992b2f02410d4ed651deb1b1141f390d0eb3e56728ac286a3b24fa0d3db9489399ae116fcd820d482f5a055ae3
+DIST chromium-49.0.2623.75.tar.xz 452264916 SHA256 a4fd4c85b12b021789d8afc33b27555396e47d9f67c8a062ee3609c4d6b582f5 SHA512 694f0ccd0a4ff10d8b19e52defb48f6d47daeaa47013f01c2924251f3c6ebaccb20813379c3b7dd6fd939138f25122ed7d1a56e1a6b80309aca65b6c854768fa WHIRLPOOL 00d5b37f425714e4bcb2b563759a8a7b084dc01b7abe6e90f21a3aa470c42944675b5a875e3e918506469cb6cd870038791566ad647b26bd4b11502beb97ecad
+DIST chromium-52.0.2743.82.tar.xz 458110272 SHA256 a7de6015df9cf685d68efd1e070ae9c706c723cd9395d079a7d43672a2c37eb4 SHA512 9bba841cb726bfa06888deefacfcee628e36d25de47dd0303d3fd1ce2f07922148d60befe934f44c33fcdfed6ce3dadfb9e3ee0828b66994807178a488051806 WHIRLPOOL f0d258882db85291262c2381aeb6d85ebf20a252344e114a2da35e75f79dc8b73de95b71926512537af17e109fd7a8dd04386d5b3ed610262d42d11bcc1a5707
+DIST chromium-56.0.2924.87.tar.xz 514429808 SHA256 9aac081ffccaae6497068100477a4e6ac7086bd15ad3c3cd009b9a760b7a53e0 SHA512 1c154004a9bca73e2491c73520a5f7d5c50c5b9d66e8e2660bf46585dd9b6ad3db706a9d824356f319794fa790bc3918ae6199843bcba717b9e74efbf26882c9 WHIRLPOOL ea18fa6d9ad5b296bc561e0fd13f596f3973ec3a020db62de4164b6edf251825a3f26768064ea70ee9e50696b18ec647dc5b9ca3c04dbb3d618ec609302675bc
+DIST electron-0.36.12.tar.gz 3068567 SHA256 8e4ee7ed37d32ad73f8cbfb132ce0009506a01a68d5a71bafd6858c6bc11f9a6 SHA512 37d016768e57f81b01338cea6d0d5eaa6ea72d83a2122b54c9c73e37b0afc7fb8351b0cb846afda29206379d5625657b815b002c2eb3c31babcd0cffa47ae3de WHIRLPOOL a358e353259d377dd59ae563f38b2fe185ade6d7a00bbad8c61831c92b4e200ac1f2f25b79564eae11d9082a569be342ccd4be6e400955cd65729e9299b48796
+DIST electron-0.37.8.tar.gz 3154625 SHA256 d6b01e800aa4cd54b680aa1d78e8c04ed99f82423bab37fe03ad5eb12310f0c0 SHA512 1469129cc6e07da2540ab67d2bb9e2dec4055da77b35bf0abf86a70e82e3ccf443e75edb25feac6c8855c5e841592738319e1a81a52d504e90a5ce9197153754 WHIRLPOOL 677fc9c5bd96d04de43a28c8db23921fb98d3d9a455c32da8235b15c72f2480cce16a3705ae258de1c2b3a5af8d11607c3f868bae248553e593a77c454f94582
+DIST electron-1.3.13.tar.gz 4560040 SHA256 36695722484da433e4bfd465c5688a3b1429365385b547973444c8d7ef0cd810 SHA512 c15b8303e1a18674fd828991a118bf670ccd052b35cac7d476b06e7903055fa905a93a79dced4186c70d30c7d220a3b7daa2a4f490b70c87134fbc393d54d94d WHIRLPOOL 4e027b48a076a208c4c83f7a82e8f591de9bf22b4c5146d50dc06772257768db6a996eea974ad6097838573f8e69828899c862b3b9271bd34c92d95e9502376b
+DIST electron-1.6.11.tar.gz 4938208 SHA256 b2e1ff38076b0554eae399ef16725643a9484fb923c90be0d65ec2cb1a17dfa3 SHA512 dc44ae9b9e69ed1b0a2b9f2faceea2bc8bac29b3897f1f95273b1e17268159d77b4ba7344e6b0383aa4196d21df203cca404a6356a8674b3dbab7452968cf60f WHIRLPOOL eb1853ab4d04fb77b6d1510d25dbcedd71ddc6431d451ab1a544e12bdf1cb362a8f4589849dacf0d022b0e57cb5fdbb66a7afaead9c8a4d47c118c008dbc55f7
+DIST electron-breakpad-e35167de7516448fcc2bf687ad580b9d8b6aedc2.tar.gz 5161275 SHA256 d361fe5f8a1c203ceb5844b4c1faf2f4f3d7860dc9fe2757b317dda968170511 SHA512 dce89f5976ddac0f87f70f11cc5fdf44a29198b302ed6eecd2c7530ccb33613563ef2ce797b7187c986d3b900b212eede8530e1e8f3b6a88ac727ff9623dd333 WHIRLPOOL f88865a72a2c7e6cc0327f9bef5a021deda91b16257fe7a3432982bf95aa0579c6934eeddc83f1516b6c7ae91769720fc18b9ec19df268141db801359dab2344
+DIST electron-brightray-909c49265493bd095c27cefd999567be2107899a.tar.gz 98022 SHA256 249424ca00a4b96ea22c58584952748f02376e92ee231e63230403e20e11fed0 SHA512 e1df1159a97c87e1edce9ea896d790e3004cc836d879385cdc5324c1961209ebf884fb7771861f4c6bf86b50ff1d8818540555bbcc77bf10987e0a68cd855127 WHIRLPOOL fe9bd8fb40c34e9278832a8660ab6b03f9ee0f900e9dce940107216d33c72a8e7ce13f7e5556d788c2a0ebabb0a536ff6cfb77e65ef96f4ea5a76441025baff6
+DIST electron-chromium-breakpad-c566c50d81f7b1edeaee9f11f5d07bda858d6b64.tar.gz 1141356 SHA256 ac8cd3e020dd437e60d2d29b712fb7019705a0706c895d6f7935b4f5ed2f2763 SHA512 9fb07facb147d401655cefea103cb1499de9ca27093c756a3b5d6ff1117a288ac491fedf01df61775ce6590e852e942cf7db1e135d6d30e94188283a53dd8e10 WHIRLPOOL fdcd9a90cf7d5156796679a21cd1210ad7e75c910d0f924168e20d8f1ccf61f803f5913a50766ddc2b7b08f864677d1bab6199e1fc06cd615b765f412297405e
+DIST electron-grit-9536fb6429147d27ef1563088341825db0a893cd.tar.gz 378461 SHA256 20b80507c29ce7b0eab57d814176fe1b1897a9b69add0bf073d5ba7b1b5d7c56 SHA512 515797740421d5f80912b33dab2039c35b2ae432a0c4351aa031461ef6c82b7a1775c3d4d41ba6c646f81ba3ddf3bbfcb35b81da1ef88b486a2a67d15f09ec86 WHIRLPOOL b6d395d549238f7552fa05eb3640ca8afd6781d998f7c9fdea8d34323b4b57ec77ca714fe4e14d97a5a44e1a4157260cd5e017d9b132fba3c32be49a57559430
+DIST electron-libchromiumcontent-e2ec6935fbf034207d5ad00fa905a4b2cdd60bb7.tar.gz 418797 SHA256 bdf1876c144a72ebb782abf8c00981fd25f317c69611255b6143e1822866ee6f SHA512 aa6d5b16be6e0a218042c11865751fb14b6f4ccf3252075e681309df853f03fda9a38b955749b1fe16f11a127f2aab181edcb3eed8511f69aa5c43395ff9f7f7 WHIRLPOOL e02893b291806d3fa0b2e0c4ae5b7b71a44637ebecd10fec922d03ec261dd152478f12fe9bf9dab60d520bb49cf947f62240edfe386fa355e6c283848fddef3d
+DIST electron-native-mate-fd0e7dc4ab778f0d1ccda6c9640464ea06ee771e.tar.gz 23926 SHA256 bbbcdd6de05ea677658df775dc3943820596654e5aecb0f25d1c1bdbb897f376 SHA512 8715c417473340163ca3db2754ab10619679ac72378ff5c7f63899fe891d5c83e7b3db6832af885de63eb5a732ed54f393bcc3aeb8ddd38569e74023c46f72ac WHIRLPOOL aff212822f12a111126116cee60f5c3e8bb3e53bfc7de1209315a7b7671b413e3428088f639b9c6c2132cd1b30f3bb9edf813b74feb74cd7a899ae902e723691
+DIST electron-node-6bcd8af891a991f8aa196e49e6bf908ebbe24cae.tar.gz 36600837 SHA256 6b7bb43be6d24bc55a6ccd4b8efd2f88d8d2fd7d8437d7aa33d813c649f791f7 SHA512 7fcafa01027bd68794a7cd2f049a7bdf45e1dd56622583bd5d53d662328e64619dd5dbeec295ff559b1b268e90bf6abf3d76cd6d00f055602bbaa7443e3a3450 WHIRLPOOL c5dd664910a59c7fb1d4aaf3c91b298b7266466596ce2a4f4f41ff6637db9e480450eaf1e9255ab810de13df1abbd769f32bdc73124bea9ab4ed013cda945bd0
+DIST electron-node-9b1683e7000481ec6214eafa3eef7ac4594eb410.tar.gz 46194500 SHA256 0204c0402ffb5c8a7ded1a8a65018fbeffd86ead38e95ee3341e10f5a4162170 SHA512 f258cf5597154e976e1e4c0b81f6b63e9b344e4a28492137b80d59dc841490d4ad69e6bab2456a6334a42e51dfe2862cc389e837a4baac90a698ff60e5b08ab4 WHIRLPOOL 651c793ca4ea7b144c79d842a565cd5870a2a7826b8e86929e9b1950ab1fe45d833a4d54ec549e120e7b69a724563ae583156ab7f8f77bef3c3f5263bcb6f64e
+DIST electron-node-a507a3c3816d6ac085ed46250c489a3d76ab8b3c.tar.gz 36578658 SHA256 56489ffa9d58b736008f5c1c2775bc10f3afe02d3c768035e7742893cc8e1d82 SHA512 a5b62c05ec7300a26b3feab3c1e796a87691d41fa7c039541574878491df51e9075685abc5d630fc62bca95bf821eeede041d4ab36caedaf76156844f1095ea6 WHIRLPOOL 8675b05753cf905cfb2fc0ebb19fc256489a7b932c57be291eb2fc7194de599c07f4120541f4a61cccdb43b09b6280c7c02f9565aef98129c584fdca4c154279
+DIST electron-node-c47e9bf9011de682d07c82f7f610a467f30cca60.tar.gz 44172045 SHA256 d0dad2c1ee6eea81fa6f55a70f4142eb7bffcc143532d50e848fea08b31d5ef7 SHA512 830cb5e4aa1956d0f67b0c5ad44241254596791b3bbc533a170b1b7bcb7a45137ff62b885a65a78a64323ad94f660c6b75142109d79256420b8d20a7d26acff7 WHIRLPOOL a69758c90ddbd3f75f9d62efb9cfefba9fe6c52c627fbcab103abe6e11916826c42e1b5072e203ce34657ac7fe9b79c2bc1621dd3b595626e138161bd91c6766
+DIST electron-pdf-viewer-a050a339cfeabcfb5f07c313161d2ee27b6c3a39.tar.gz 38431 SHA256 03a147dfc8273495cf47b53a2a03ca41e03695e1af66c51df9e49ca52ff51233 SHA512 a028b67c0644d4ddcfc5aee4e2abb305648eb666082ea2c151cb6b9b3972503093cadb32b102aa19b04c8e863c2ac55bb20cccbf2abbf7832f9cfd3c3618612e WHIRLPOOL 54dd4ff5fc59e057ce67f409629818accad0ee7c97e18e9cb86174cbfd845fdd7d370b291b2adddc91d81e3743eb744aa6c4f149a74f87cad3ffd32674c5f1e8
+DIST libchromiumcontent-27add4cfef98f21d5910539bebb47ae175f024c2.tar.gz 403724 SHA256 cf0342130f4bb929894249a381b6d6433f8d5b6d9331f4bd843250c4e66063b6 SHA512 7995fe40100b91f57ccc8fde445f136fda62d2c88a8a06d1b07aa588bcdb27905a542d62ec9cdf567b626439d8648fc749b73d7e9f52deaa94ead27e191a732f WHIRLPOOL 426d75c7ff7788d6dd208b68407bad7600090f6c1208823db65ef10ab7efcb8b8cbe9fce7ada6886a6711dfea0503a70a088e63f71221a8098cb62f3f3d1131c
+DIST libchromiumcontent-60c7ec9f9bf465a8c9c7ccc3fcd2aa1cdf644bac.tar.gz 402072 SHA256 69877d4b9def6dc69063f0bf37d9d59721c22acced45e271b3f36bde8446a37c SHA512 ddd52e58df1848edab6c514e0ef8e4155eccec6bec9d4e557dc0ee7d5c2cc4036f25d1786376b5b47a5122a266f00cd589ce665b8463549e9383d60292d180dc WHIRLPOOL 789be242983ab54e212df13c6f51c5c949d6a4ace21a548b99f17e292b37842ce0c748e29c17bd116a95a163ca2bd709dadc59ecacc9d3ab8c58143ddf9f2d71
+DIST libchromiumcontent-ad63d8ba890bcaad2f1b7e6de148b7992f4d3af7.tar.gz 400648 SHA256 36b46659fff3053ce273d3ed159fca74e18ebc873694f857a521d3c48fc079b1 SHA512 5fcb5e3dd98d5875ff7aa9f9f4d02af45487534d0301ca7a0a7adde934f528fedc3dfaf886b9031027e41309eb8ba658b72a56af4ad8dc44cce458b9c04a0e47 WHIRLPOOL 31d28804f91bbdece8709ddac359e7f5c079b034137734041f274838d138d8e141fe12c0ecf1e66f92b15e8c653526a1779d3bcc342e3ecc9a39a18c689a94a6
+DIST native-mate-0df2d882ea2286e6335f206b7002037fce66c4a5.tar.gz 23738 SHA256 d0ad6b3079fcfdf1adb09a68f5d8b7ac5b83c6d19b078993941b1a95ccac232b SHA512 fdd928a4b170636320e6cfd65753aec47c38380ef6f1b6dde255fbdcf3756abe8568e689e1214d768056187b243f979f16d4289ce8429a5ddd17b07f806ef731 WHIRLPOOL 762c4f2c093853731cbf8a79953e0da0bf66d6f1f08a08ad3ba2131b87113209bc93e138e974745b89da5dd9c14c0d5035dd686ad5b79ad7faba0b6076d2a6fb
+DIST native-mate-b5e5de626c6a57e44c7e6448d8bbaaac475d493c.tar.gz 23465 SHA256 e9a5340c51690100be798c3d8c76662f78b0f292b22e394a5703326c07fc2639 SHA512 d004f4ec3ca77d98b2b2bc271c830b769bb6396e70d8dbf25ede87c509ce95dea083d6e5b3d050647cdf3d0a6a21c6da91176eba90d7256ab80f5d23248a6bb1 WHIRLPOOL 66b0d5544d8e72692150541a8f7ecac7421edef2a4d3837a1f7a1dea785f99fb40492261654ad7b6c1a38fcf04a44d4afa832d20175eb34944437712bbb711ef
+DIST native-mate-e719eab878c264bb03188d0cd6eb9ad6882bc13a.tar.gz 23818 SHA256 82da85193f6924ce395004ce9dfd1198848cf8f14b7904321e67cad26a39f794 SHA512 4272648127fb0bf90b36d2c090bea718d560737c1c7443a5b3c0de12999ffe607429b2112ecee36ece5d26cde54e78964303250ffd350a19c132c9733b72c523 WHIRLPOOL c275163b9f3f424f5909f17c67f5b029f03bf76679296781bd6d74e64d903dd29cf5c28f1c4e399a049331f54f03175fe2c02de9ef6bf65040d9cef05be44a51
+EBUILD electron-0.36.12-r5.ebuild 23379 SHA256 a4cc890a21d9eb4b57c10be358e3478baf73a72b1116bd490be0bd155b154054 SHA512 32408c39d7242a434c3bed28a95abea6acd450c1e494e88d835825a51a45d4a445a189eb0e5f09b7da7cf3a127dffd6856d8165196580f449a5cda39421d25f0 WHIRLPOOL 7959c997c4a2877c15c578ac8a66063231181a4d376a5dcfd66ea252baca28ea04bbcf465d821f8e32315adbcbbed30ce9d6edb46b79279e0050ae48d254c1ca
+EBUILD electron-0.37.8-r2.ebuild 23755 SHA256 ed816fc53c0d39e777246e2872c0d0c0a476877c58bd2597e2c4b2f4ae0e91fa SHA512 4253f2b81deda03c2fd425ad115f0a73da2c0aee2a200c8ec9e0a57e087962e56e1f72153022f44e3866a3c35047b8a57af381449af044446ee43dbcfbafa7af WHIRLPOOL 4b8a477180a03dc6135f7a40ff0c9ee3fee419bd8570e1a8b6b8da36212c7e4bc65a2b62323a0f984c13e6aa79df8e4443834ff8f5fed49e269a558769a4b052
+EBUILD electron-1.3.13-r1.ebuild 24394 SHA256 48366b58fdc4ea8881547eb0cee6187f80dde89e3557245b2d428410952468e2 SHA512 60264761aedfeb4669f89e01ea526ddeb08e2547f5bd510e7767f6398a6e8419bc4d8a52452139df79bd09265dde14a50bb52bb5d3917ee187b4c1741d6fb050 WHIRLPOOL ac8cd833dd9b7feaa2c352cefc3fc68d000a5646ca334c3799772af62b0c0ad64dceb4009fa9dac3ee930b220caa894b95aaa391b875fe8170a79860164947bf
+EBUILD electron-1.6.11-r1.ebuild 28367 SHA256 57bfa4b3220f8341940bb31d5ce137394f707244624fc5d4c25befca89c19c28 SHA512 deed4646179584575831a3c09fa94e30351db921e7f50cdfe70eed170b0f75626beababfb87cc708a575ab10485ba499125ad924f09eeee2b84fbb90619f8f7d WHIRLPOOL 9b6ff12241bd2e8a56477ee82c68b5d1dd8e2492a58432919225bdae47304edee151a87edaf88a827b52e05cd799eed1b97f417986e45614368b830714772773
+MISC ChangeLog 7412 SHA256 54faeab34ebcc39bb9abe01ce5ad8b6acf970e0248156fb0ef978fedc6b05581 SHA512 a3fe8eac0023bd1bf4fcd29c007634b3c91d567611420981b052cd287f254aaf9b8fd3a5af92f5cba6d755e4fd96673b836f94819d0c254bfff7bfef44febd91 WHIRLPOOL 50ff8773beef4ff7b62ad7ee56e236519b93e7226a082ffa29b28a86f2a88706c20d19d475c7bc23981ce895cec08e9b65f40bb1d4a4ce658bc8b59301861c7c
+MISC metadata.xml 1200 SHA256 e578897b4c00427d4dc628b9066d6cabafacaf55ed0c5c5f80ad82bd5d6d36a4 SHA512 a37063e88ba9dac58cc18c88e8b510e0d1d1ddd4e53017a6c92a73e281c0bdb3e87636136c52bc309a81a5c1df02079994409aaa70dce5e0130654d952cd744c WHIRLPOOL 14b3610dc4f57931342a000bb331ccce8d84361ca8ff6288d58837e2e0ca60070b63831ded478b746c40f1e6b258087f6e530c4c4e65aecaf3e4a56ffbe13bb4
diff --git a/dev-util/electron/electron-0.36.12-r5.ebuild b/dev-util/electron/electron-0.36.12-r5.ebuild
new file mode 100644
index 000000000000..8dfee5f2d5e4
--- /dev/null
+++ b/dev-util/electron/electron-0.36.12-r5.ebuild
@@ -0,0 +1,740 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
+ hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
+ sv sw ta te th tr uk vi zh-CN zh-TW"
+
+inherit check-reqs chromium-2 eutils flag-o-matic multilib multiprocessing pax-utils \
+ portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator virtualx
+
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent/VERSION
+CHROMIUM_VERSION="47.0.2526.110"
+# Keep this in sync with vendor/brightray
+BRIGHTRAY_COMMIT="9bc1d21b69ac99bed546d42035dc1205ea6b04af"
+# Keep this in sync with vendor/node
+NODE_COMMIT="a507a3c3816d6ac085ed46250c489a3d76ab8b3c"
+# Keep this in sync with vendor/native_mate
+NATIVE_MATE_COMMIT="e719eab878c264bb03188d0cd6eb9ad6882bc13a"
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent
+LIBCHROMIUMCONTENT_COMMIT="ad63d8ba890bcaad2f1b7e6de148b7992f4d3af7"
+# Keep this in sync with package.json#devDependencies
+ASAR_VERSION="0.12.1"
+
+CHROMIUM_P="chromium-${CHROMIUM_VERSION}"
+BRIGHTRAY_P="brightray-${BRIGHTRAY_COMMIT}"
+NODE_P="node-${NODE_COMMIT}"
+NATIVE_MATE_P="native-mate-${NATIVE_MATE_COMMIT}"
+LIBCHROMIUMCONTENT_P="libchromiumcontent-${LIBCHROMIUMCONTENT_COMMIT}"
+ASAR_P="asar-${ASAR_VERSION}"
+
+DESCRIPTION="Cross platform application development framework based on web technologies"
+HOMEPAGE="https://electron.atom.io/"
+SRC_URI="
+ https://commondatastorage.googleapis.com/chromium-browser-official/${CHROMIUM_P}.tar.xz
+ https://github.com/electron/electron/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/electron/brightray/archive/${BRIGHTRAY_COMMIT}.tar.gz -> ${BRIGHTRAY_P}.tar.gz
+ https://github.com/electron/node/archive/${NODE_COMMIT}.tar.gz -> electron-${NODE_P}.tar.gz
+ https://github.com/zcbenz/native-mate/archive/${NATIVE_MATE_COMMIT}.tar.gz -> ${NATIVE_MATE_P}.tar.gz
+ https://github.com/electron/libchromiumcontent/archive/${LIBCHROMIUMCONTENT_COMMIT}.tar.gz -> ${LIBCHROMIUMCONTENT_P}.tar.gz
+ https://github.com/elprans/asar/releases/download/v${ASAR_VERSION}-gentoo/asar-build.tar.gz -> ${ASAR_P}.tar.gz
+"
+
+S="${WORKDIR}/${CHROMIUM_P}"
+ELECTRON_S="${WORKDIR}/${P}"
+NODE_S="${S}/vendor/node"
+BRIGHTRAY_S="${S}/vendor/brightray"
+NATIVE_MATE_S="${S}/vendor/native_mate"
+LIBCC_S="${BRIGHTRAY_S}/vendor/libchromiumcontent"
+
+LICENSE="BSD"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~amd64"
+IUSE="custom-cflags cups gnome gnome-keyring hidpi kerberos lto neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc"
+RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
+
+# Native Client binaries are compiled with different set of flags, bug #452066.
+QA_FLAGS_IGNORED=".*\.nexe"
+
+# Native Client binaries may be stripped by the build system, which uses the
+# right tools for it, bug #469144 .
+QA_PRESTRIPPED=".*\.nexe"
+
+RDEPEND="!<dev-util/electron-0.36.12-r4
+ >=app-accessibility/speech-dispatcher-0.8:=
+ app-arch/bzip2:=
+ app-arch/snappy:=
+ >=app-eselect/eselect-electron-1.0.0
+ cups? ( >=net-print/cups-1.3.11:= )
+ >=dev-libs/elfutils-0.149
+ dev-libs/expat:=
+ dev-libs/glib:=
+ >=dev-libs/icu-55.1:=
+ >=dev-libs/jsoncpp-0.5.0-r1:=
+ >=dev-libs/libevent-1.4.13:=
+ dev-libs/libxml2:=[icu]
+ dev-libs/libxslt:=
+ dev-libs/nspr:=
+ >=dev-libs/nss-3.14.3:=
+ dev-libs/re2:=
+ gnome? ( >=gnome-base/gconf-2.24.0:= )
+ gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
+ >=media-libs/alsa-lib-1.0.19:=
+ media-libs/flac:=
+ media-libs/fontconfig:=
+ media-libs/freetype:=
+ >=media-libs/harfbuzz-0.9.41:=[icu(+)]
+ media-libs/libexif:=
+ >=media-libs/libjpeg-turbo-1.2.0-r1:=
+ media-libs/libpng:0=
+ >=media-libs/libwebp-0.4.0:=
+ media-libs/speex:=
+ pulseaudio? ( media-sound/pulseaudio:= )
+ system-ffmpeg? ( >=media-video/ffmpeg-2.7.2:=[opus,vorbis,vpx] )
+ sys-apps/dbus:=
+ sys-apps/pciutils:=
+ >=sys-libs/libcap-2.22:=
+ sys-libs/zlib:=[minizip]
+ virtual/udev
+ x11-libs/cairo:=
+ x11-libs/gdk-pixbuf:=
+ x11-libs/gtk+:2=
+ x11-libs/libdrm
+ x11-libs/libnotify:=
+ x11-libs/libX11:=
+ x11-libs/libXcomposite:=
+ x11-libs/libXcursor:=
+ x11-libs/libXdamage:=
+ x11-libs/libXext:=
+ x11-libs/libXfixes:=
+ >=x11-libs/libXi-1.6.0:=
+ x11-libs/libXinerama:=
+ x11-libs/libXrandr:=
+ x11-libs/libXrender:=
+ x11-libs/libXScrnSaver:=
+ x11-libs/libXtst:=
+ x11-libs/pango:=
+ kerberos? ( virtual/krb5 )
+ >=net-libs/http-parser-2.6.2:=
+ >=dev-libs/libuv-1.8.0:=
+ >=dev-libs/openssl-1.0.2g:0=[-bindist]"
+DEPEND="${RDEPEND}
+ !arm? (
+ dev-lang/yasm
+ )
+ dev-lang/perl
+ dev-perl/JSON
+ >=dev-util/gperf-3.0.3
+ dev-util/ninja
+ sys-apps/hwids[usb(+)]
+ >=sys-devel/bison-2.4.3
+ sys-devel/flex
+ virtual/pkgconfig"
+
+# For nvidia-drivers blocker, see bug #413637 .
+RDEPEND+="
+ x11-misc/xdg-utils
+ virtual/opengl
+ virtual/ttf-fonts
+ selinux? ( sec-policy/selinux-chromium )
+ tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )"
+
+# Python dependencies. The DEPEND part needs to be kept in sync
+# with python_check_deps.
+DEPEND+=" $(python_gen_any_dep '
+ dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/jsmin[${PYTHON_USEDEP}]
+ dev-python/ply[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+')"
+python_check_deps() {
+ has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/beautifulsoup:4[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/jinja[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/jsmin[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/ply[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
+}
+
+if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
+ EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
+fi
+
+pkg_pretend() {
+ if [[ $(tc-getCC)$ == *gcc* ]] && \
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
+ die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
+ fi
+
+ # LTO pass requires more file descriptors
+ if use lto; then
+ local lto_n_rlimit_min="16384"
+ local maxfiles=$(ulimit -n -H)
+ if [ "${maxfiles}" -lt "${lto_n_rlimit_min}" ]; then
+ eerror ""
+ eerror "Building with USE=\"lto\" requires file descriptor" \
+ "limit to be no less than ${lto_n_rlimit_min}."
+ eerror "The current limit for portage is ${maxfiles}."
+ eerror "Please add the following to /etc/security/limits.conf:"
+ eerror ""
+ eerror " root hard nofile ${lto_n_rlimit_min}"
+ eerror " root soft nofile ${lto_n_rlimit_min}"
+ eerror ""
+ die
+ fi
+ fi
+
+ # Check build requirements, bug #541816 and bug #471810 .
+ CHECKREQS_MEMORY="3G"
+ use lto && CHECKREQS_MEMORY="5G"
+ CHECKREQS_DISK_BUILD="10G"
+ eshopts_push -s extglob
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ CHECKREQS_DISK_BUILD="25G"
+ fi
+ eshopts_pop
+ check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+ # Make sure the build system will use the right python, bug #344367.
+ python-any-r1_pkg_setup
+
+ chromium_suid_sandbox_check_kernel_config
+}
+
+_unnest_patches() {
+ local _s="${1%/}/" relpath out
+
+ for f in $(find "${_s}" -mindepth 2 -name *.patch -printf \"%P\"\\n); do
+ relpath="$(dirname ${f})"
+ out="${_s}/${relpath////_}_$(basename ${f})"
+ sed -r -e "s|^([-+]{3}) (.*)$|\1 ${relpath}/\2 ${f}|g" > "${out}"
+ done
+}
+
+_get_install_suffix() {
+ local c=(${SLOT//\// })
+ local slot=${c[0]}
+ local suffix
+
+ if [[ "${slot}" == "0" ]]; then
+ suffix=""
+ else
+ suffix="-${slot}"
+ fi
+
+ echo -n "${suffix}"
+}
+
+_get_install_dir() {
+ echo -n "/usr/$(get_libdir)/electron$(_get_install_suffix)"
+}
+
+src_prepare() {
+ # Merge Electron code and its submodules into the Chromium source tree
+ # so that everything can be configured and built in a single pass.
+ #
+ rsync -a --ignore-existing "${ELECTRON_S}/" "${S}/" || die
+ rm -r "${NODE_S}" &&
+ mv "${WORKDIR}/${NODE_P}" "${NODE_S}" || die
+ rm -r "${BRIGHTRAY_S}" &&
+ mv "${WORKDIR}/${BRIGHTRAY_P}" "${BRIGHTRAY_S}" || die
+ rm -r "${NATIVE_MATE_S}" &&
+ mv "${WORKDIR}/${NATIVE_MATE_P}" "${NATIVE_MATE_S}" || die
+ rm -r "${LIBCC_S}" &&
+ mv "${WORKDIR}/${LIBCHROMIUMCONTENT_P}" "${LIBCC_S}" || die
+ rm -r "${S}/vendor/breakpad" &&
+ ln -s "../breakpad" "${S}/vendor/breakpad" || die
+ ln -s "${WORKDIR}/${ASAR_P}/node_modules" "${S}/node_modules" || die
+
+ # electron patches
+ epatch "${FILESDIR}/${P}.patch"
+
+ # node patches
+ cd "${NODE_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-node.patch"
+ epatch "${FILESDIR}/electron-vendor-node-external-snapshots-r0.patch"
+ # make sure node uses the correct version of v8
+ rm -r deps/v8 || die
+ ln -s ../../../v8 deps/ || die
+
+ # make sure we use python2.* while using gyp
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
+
+ # less verbose install output (stating the same as portage, basically)
+ sed -i -e "/print/d" tools/install.py || die
+
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
+ local LIBDIR=$(get_libdir)
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
+
+ # brightray patches
+ cd "${BRIGHTRAY_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-brightray.patch"
+
+ # libcc patches
+ cd "${LIBCC_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-libchromiumcontent.patch"
+
+ # chromium patches
+ cd "${S}" || die
+ epatch "${FILESDIR}/chromium-system-ffmpeg-r0.patch"
+ epatch "${FILESDIR}/chromium-system-jinja-r7.patch"
+ epatch "${FILESDIR}/chromium-disable-widevine.patch"
+ epatch "${FILESDIR}/chromium-remove-gardiner-mod-font.patch"
+ epatch "${FILESDIR}/chromium-shared-v8.patch"
+ epatch "${FILESDIR}/chromium-lto-fixes.patch"
+ epatch "${FILESDIR}/chromium-cups-fix.patch"
+
+ # libcc chromium patches
+ _unnest_patches "${LIBCC_S}/patches"
+
+ EPATCH_SOURCE="${LIBCC_S}/patches" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_EXCLUDE="third_party_icu*" \
+ EPATCH_MULTI_MSG="Applying libchromiumcontent patches..." \
+ epatch
+
+ # build scripts
+ mkdir -p "${S}/chromiumcontent" || die
+ cp -a "${LIBCC_S}/chromiumcontent" "${S}/" || die
+ cp -a "${LIBCC_S}/tools/linux/" "${S}/tools/" || die
+
+ local conditional_bundled_libraries=""
+ if ! use system-ffmpeg; then
+ conditional_bundled_libraries+=" third_party/ffmpeg"
+ fi
+
+ # Remove most bundled libraries. Some are still needed.
+ build/linux/unbundle/remove_bundled_libraries.py \
+ ${conditional_bundled_libraries} \
+ 'base/third_party/dmg_fp' \
+ 'base/third_party/dynamic_annotations' \
+ 'base/third_party/icu' \
+ 'base/third_party/nspr' \
+ 'base/third_party/superfasthash' \
+ 'base/third_party/symbolize' \
+ 'base/third_party/valgrind' \
+ 'base/third_party/xdg_mime' \
+ 'base/third_party/xdg_user_dirs' \
+ 'breakpad/src/third_party/curl' \
+ 'chrome/third_party/mozilla_security_manager' \
+ 'courgette/third_party' \
+ 'crypto/third_party/nss' \
+ 'net/third_party/mozilla_security_manager' \
+ 'net/third_party/nss' \
+ 'third_party/WebKit' \
+ 'third_party/analytics' \
+ 'third_party/angle' \
+ 'third_party/angle/src/third_party/compiler' \
+ 'third_party/boringssl' \
+ 'third_party/brotli' \
+ 'third_party/cacheinvalidation' \
+ 'third_party/catapult' \
+ 'third_party/catapult/tracing/third_party/components/polymer' \
+ 'third_party/catapult/tracing/third_party/d3' \
+ 'third_party/catapult/tracing/third_party/gl-matrix' \
+ 'third_party/catapult/tracing/third_party/jszip' \
+ 'third_party/catapult/tracing/third_party/tvcm' \
+ 'third_party/catapult/tracing/third_party/tvcm/third_party/rcssmin' \
+ 'third_party/catapult/tracing/third_party/tvcm/third_party/rjsmin' \
+ 'third_party/cld_2' \
+ 'third_party/cros_system_api' \
+ 'third_party/cython/python_flags.py' \
+ 'third_party/devscripts' \
+ 'third_party/dom_distiller_js' \
+ 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
+ 'third_party/fips181' \
+ 'third_party/flot' \
+ 'third_party/google_input_tools' \
+ 'third_party/google_input_tools/third_party/closure_library' \
+ 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
+ 'third_party/hunspell' \
+ 'third_party/iccjpeg' \
+ 'third_party/jstemplate' \
+ 'third_party/khronos' \
+ 'third_party/leveldatabase' \
+ 'third_party/libXNVCtrl' \
+ 'third_party/libaddressinput' \
+ 'third_party/libjingle' \
+ 'third_party/libphonenumber' \
+ 'third_party/libsecret' \
+ 'third_party/libsrtp' \
+ 'third_party/libudev' \
+ 'third_party/libusb' \
+ 'third_party/libvpx_new' \
+ 'third_party/libvpx_new/source/libvpx/third_party/x86inc' \
+ 'third_party/libxml/chromium' \
+ 'third_party/libwebm' \
+ 'third_party/libyuv' \
+ 'third_party/lss' \
+ 'third_party/lzma_sdk' \
+ 'third_party/mesa' \
+ 'third_party/modp_b64' \
+ 'third_party/mojo' \
+ 'third_party/mt19937ar' \
+ 'third_party/npapi' \
+ 'third_party/openmax_dl' \
+ 'third_party/opus' \
+ 'third_party/ots' \
+ 'third_party/pdfium' \
+ 'third_party/pdfium/third_party/agg23' \
+ 'third_party/pdfium/third_party/base' \
+ 'third_party/pdfium/third_party/bigint' \
+ 'third_party/pdfium/third_party/freetype' \
+ 'third_party/pdfium/third_party/lcms2-2.6' \
+ 'third_party/pdfium/third_party/libjpeg' \
+ 'third_party/pdfium/third_party/libopenjpeg20' \
+ 'third_party/pdfium/third_party/zlib_v128' \
+ 'third_party/polymer' \
+ 'third_party/protobuf' \
+ 'third_party/qcms' \
+ 'third_party/readability' \
+ 'third_party/sfntly' \
+ 'third_party/skia' \
+ 'third_party/smhasher' \
+ 'third_party/sqlite' \
+ 'third_party/tcmalloc' \
+ 'third_party/usrsctp' \
+ 'third_party/web-animations-js' \
+ 'third_party/webdriver' \
+ 'third_party/webrtc' \
+ 'third_party/widevine' \
+ 'third_party/x86inc' \
+ 'third_party/zlib/google' \
+ 'url/third_party/mozilla' \
+ 'v8/src/third_party/fdlibm' \
+ 'v8/src/third_party/valgrind' \
+ --do-remove || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=""
+
+ # Never tell the build system to "enable" SSE2, it has a few unexpected
+ # additions, bug #336871.
+ myconf+=" -Ddisable_sse2=1"
+
+ # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
+ myconf+=" -Ddisable_nacl=1"
+
+ # Disable glibc Native Client toolchain, we don't need it (bug #417019).
+ # myconf+=" -Ddisable_glibc=1"
+
+ # TODO: also build with pnacl
+ # myconf+=" -Ddisable_pnacl=1"
+
+ # It would be awkward for us to tar the toolchain and get it untarred again
+ # during the build.
+ # myconf+=" -Ddisable_newlib_untar=1"
+
+ # Make it possible to remove third_party/adobe.
+ echo > "${T}/flapper_version.h" || die
+ myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
+
+ # Use system-provided libraries.
+ # TODO: use_system_hunspell (upstream changes needed).
+ # TODO: use_system_libsrtp (bug #459932).
+ # TODO: use_system_libusb (http://crbug.com/266149).
+ # TODO: use_system_libvpx (http://crbug.com/494939).
+ # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
+ # TODO: use_system_protobuf (bug #525560).
+ # TODO: use_system_ssl (http://crbug.com/58087).
+ # TODO: use_system_sqlite (http://crbug.com/22208).
+ myconf+="
+ -Duse_system_bzip2=1
+ -Duse_system_ffmpeg=$(usex system-ffmpeg 1 0)
+ -Duse_system_flac=1
+ -Duse_system_harfbuzz=1
+ -Duse_system_icu=1
+ -Duse_system_jsoncpp=1
+ -Duse_system_libevent=1
+ -Duse_system_libjpeg=1
+ -Duse_system_libpng=1
+ -Duse_system_libwebp=1
+ -Duse_system_libxml=1
+ -Duse_system_libxslt=1
+ -Duse_system_minizip=1
+ -Duse_system_nspr=1
+ -Duse_system_re2=1
+ -Duse_system_snappy=1
+ -Duse_system_speex=1
+ -Duse_system_xdg_utils=1
+ -Duse_system_zlib=1"
+
+ # Needed for system icu - we don't need additional data files.
+ myconf+=" -Dicu_use_data_file_flag=0"
+
+ # TODO: patch gyp so that this arm conditional is not needed.
+ if ! use arm; then
+ myconf+="
+ -Duse_system_yasm=1"
+ fi
+
+ # Optional dependencies.
+ # TODO: linux_link_kerberos, bug #381289.
+ myconf+="
+ $(gyp_use cups)
+ $(gyp_use gnome use_gconf)
+ $(gyp_use gnome-keyring use_gnome_keyring)
+ $(gyp_use gnome-keyring linux_link_gnome_keyring)
+ $(gyp_use hidpi enable_hidpi)
+ $(gyp_use kerberos)
+ $(gyp_use lto)
+ $(gyp_use pulseaudio)
+ $(gyp_use tcmalloc use_allocator tcmalloc none)"
+
+ # Use explicit library dependencies instead of dlopen.
+ # This makes breakages easier to detect by revdep-rebuild.
+ myconf+="
+ -Dlinux_link_gsettings=1
+ -Dlinux_link_libpci=1
+ -Dlinux_link_libspeechd=1
+ -Dlibspeechd_h_prefix=speech-dispatcher/"
+
+ # TODO: use the file at run time instead of effectively compiling it in.
+ myconf+="
+ -Dusb_ids_path=/usr/share/misc/usb.ids"
+
+ # Save space by removing DLOG and DCHECK messages (about 6% reduction).
+ myconf+="
+ -Dlogging_like_official_build=1"
+
+ if [[ $(tc-getCC) == *clang* ]]; then
+ myconf+=" -Dclang=1"
+ else
+ myconf+=" -Dclang=0"
+ fi
+
+ # Never use bundled gold binary. Disable gold linker flags for now.
+ # Do not use bundled clang.
+ myconf+="
+ -Dclang_use_chrome_plugins=0
+ -Dhost_clang=0
+ -Dlinux_use_bundled_binutils=0
+ -Dlinux_use_bundled_gold=0
+ -Dlinux_use_gold_flags=0"
+
+ ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
+ myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
+
+ # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
+ # Note: these are for Gentoo use ONLY. For your own distribution,
+ # please get your own set of keys. Feel free to contact chromium@gentoo.org
+ # for more info.
+ myconf+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
+ -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
+ -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
+
+ local myarch="$(tc-arch)"
+ if [[ $myarch = amd64 ]] ; then
+ target_arch=x64
+ ffmpeg_target_arch=x64
+ elif [[ $myarch = x86 ]] ; then
+ target_arch=ia32
+ ffmpeg_target_arch=ia32
+ elif [[ $myarch = arm ]] ; then
+ target_arch=arm
+ ffmpeg_target_arch=$(usex neon arm-neon arm)
+ # TODO: re-enable NaCl (NativeClient).
+ local CTARGET=${CTARGET:-${CHOST}}
+ if [[ $(tc-is-softfloat) == "no" ]]; then
+
+ myconf+=" -Darm_float_abi=hard"
+ fi
+ filter-flags "-mfpu=*"
+ use neon || myconf+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
+
+ if [[ ${CTARGET} == armv[78]* ]]; then
+ myconf+=" -Darmv7=1"
+ else
+ myconf+=" -Darmv7=0"
+ fi
+ myconf+=" -Dsysroot=
+ $(gyp_use neon arm_neon)
+ -Ddisable_nacl=1"
+ else
+ die "Failed to determine target arch, got '$myarch'."
+ fi
+
+ myconf+=" -Dtarget_arch=${target_arch}"
+
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system.
+ # Depending on GCC version the warnings are different and we don't want
+ # the build to fail because of that.
+ myconf+=" -Dwerror="
+
+ # Disable fatal linker warnings, bug 506268.
+ myconf+=" -Ddisable_fatal_linker_warnings=1"
+
+ # Avoid CFLAGS problems, bug #352457, bug #390147.
+ if ! use custom-cflags; then
+ replace-flags "-Os" "-O2"
+ strip-flags
+
+ # Prevent linker from running out of address space, bug #471810 .
+ if use x86; then
+ filter-flags "-g*"
+ fi
+
+ # Prevent libvpx build failures. Bug 530248, 544702, 546984.
+ if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
+ filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
+ fi
+ fi
+
+ # Make sure the build system will use the right tools, bug #340795.
+ tc-export AR CC CXX NM
+
+ # Tools for building programs to be executed on the build system, bug #410883.
+ if tc-is-cross-compiler; then
+ export AR_host=$(tc-getBUILD_AR)
+ export CC_host=$(tc-getBUILD_CC)
+ export CXX_host=$(tc-getBUILD_CXX)
+ export NM_host=$(tc-getBUILD_NM)
+ fi
+
+ # Bug 491582.
+ export TMPDIR="${WORKDIR}/temp"
+ mkdir -p -m 755 "${TMPDIR}" || die
+
+ if ! use system-ffmpeg; then
+ local build_ffmpeg_args=""
+ if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
+ build_ffmpeg_args+=" --disable-asm"
+ fi
+
+ # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
+ einfo "Configuring bundled ffmpeg..."
+ pushd third_party/ffmpeg > /dev/null || die
+ chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
+ --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
+ chromium/scripts/copy_config.sh || die
+ chromium/scripts/generate_gyp.py || die
+ popd > /dev/null || die
+ fi
+
+ third_party/libaddressinput/chromium/tools/update-strings.py || die
+
+ einfo "Configuring bundled nodejs..."
+ pushd vendor/node > /dev/null || die
+ # Make sure gyp_node does not run
+ echo '#!/usr/bin/env python' > tools/gyp_node.py || die
+ # --shared-libuv cannot be used as electron's node fork
+ # patches uv_loop structure.
+ ./configure --shared-openssl --shared-http-parser \
+ --shared-zlib --without-npm --with-intl=system-icu \
+ --without-dtrace --dest-cpu=${target_arch} \
+ --prefix="" || die
+ popd > /dev/null || die
+
+ # libchromiumcontent configuration
+ myconf+=" -Dcomponent=static_library"
+ myconf+=" -Dmac_mas_build=0"
+ myconf+=' -Dicu_small="false"'
+ myconf+=" -Dlibchromiumcontent_component=0"
+ myconf+=" -Dlibrary=static_library"
+ myconf+=" -Dmas_build=0"
+
+ einfo "Configuring electron..."
+ build/linux/unbundle/replace_gyp_files.py ${myconf} || die
+
+ myconf+=" -Ivendor/node/config.gypi
+ -Icommon.gypi
+ atom.gyp"
+
+ egyp_chromium ${myconf} || die
+}
+
+eninja() {
+ if [[ -z ${NINJAOPTS+set} ]]; then
+ local jobs=$(makeopts_jobs)
+ local loadavg=$(makeopts_loadavg)
+
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+ NINJAOPTS+=" -j ${jobs}"
+ fi
+ if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
+ NINJAOPTS+=" -l ${loadavg}"
+ fi
+ fi
+ set -- ninja -v ${NINJAOPTS} "$@"
+ echo "$@"
+ "$@"
+}
+
+src_compile() {
+ local ninja_targets="electron" compile_target="out/R"
+
+ eninja -C ${compile_target} mksnapshot || die
+ pax-mark -m ${compile_target}/mksnapshot
+
+ eninja -C ${compile_target} nodebin || die
+ pax-mark -m ${compile_target}/nodebin
+
+ # Even though ninja autodetects number of CPUs, we respect
+ # user's options, for debugging with -j 1 or any other reason.
+ eninja -C ${compile_target} ${ninja_targets} || die
+}
+
+src_install() {
+ local install_dir="$(_get_install_dir)"
+ local install_suffix="$(_get_install_suffix)"
+ local LIBDIR="${ED}/usr/$(get_libdir)"
+
+ pushd out/R/locales > /dev/null || die
+ chromium_remove_language_paks
+ popd > /dev/null || die
+
+ # Install Electron
+ insinto "${install_dir}"
+ exeinto "${install_dir}"
+ newexe out/R/nodebin node
+ doexe out/R/electron
+ doins out/R/libv8.so
+ doins out/R/libnode.so
+ fperms +x "${install_dir}/libv8.so" "${install_dir}/libnode.so"
+ doins out/R/content_shell.pak
+ doins out/R/natives_blob.bin
+ doins out/R/snapshot_blob.bin
+ rm -r out/R/resources/inspector || die
+ doins -r out/R/resources
+ doins -r out/R/locales
+ dosym "${install_dir}/electron" "/usr/bin/electron${install_suffix}"
+
+ # Install Node headers
+ HEADERS_ONLY=1 \
+ "${S}/vendor/node/tools/install.py" install "${ED}" "/usr" || die
+ # set up a symlink structure that npm expects..
+ dodir /usr/include/node/deps/{v8,uv}
+ dosym . /usr/include/node/src
+ for var in deps/{uv,v8}/include; do
+ dosym ../.. /usr/include/node/${var}
+ done
+
+ dodir "/usr/include/electron${install_suffix}"
+ mv "${ED}/usr/include/node" \
+ "${ED}/usr/include/electron${install_suffix}/node" || die
+}
+
+pkg_postinst() {
+ eselect electron update
+}
+
+pkg_prerm() {
+ eselect electron update
+}
diff --git a/dev-util/electron/electron-0.37.8-r2.ebuild b/dev-util/electron/electron-0.37.8-r2.ebuild
new file mode 100644
index 000000000000..d4bf4ae0d2f4
--- /dev/null
+++ b/dev-util/electron/electron-0.37.8-r2.ebuild
@@ -0,0 +1,750 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
+ hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
+ sv sw ta te th tr uk vi zh-CN zh-TW"
+
+inherit check-reqs chromium-2 eutils flag-o-matic multilib multiprocessing \
+ pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs \
+ versionator virtualx
+
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent/VERSION
+CHROMIUM_VERSION="49.0.2623.75"
+# Keep this in sync with vendor/brightray
+BRIGHTRAY_COMMIT="8dbaeed37b9c4fb8ae985670b142f659bb265fb4"
+# Keep this in sync with vendor/node
+NODE_COMMIT="6bcd8af891a991f8aa196e49e6bf908ebbe24cae"
+# Keep this in sync with vendor/native_mate
+NATIVE_MATE_COMMIT="0df2d882ea2286e6335f206b7002037fce66c4a5"
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent
+LIBCHROMIUMCONTENT_COMMIT="60c7ec9f9bf465a8c9c7ccc3fcd2aa1cdf644bac"
+# Keep this in sync with package.json#devDependencies
+ASAR_VERSION="0.12.1"
+
+CHROMIUM_P="chromium-${CHROMIUM_VERSION}"
+BRIGHTRAY_P="brightray-${BRIGHTRAY_COMMIT}"
+NODE_P="node-${NODE_COMMIT}"
+NATIVE_MATE_P="native-mate-${NATIVE_MATE_COMMIT}"
+LIBCHROMIUMCONTENT_P="libchromiumcontent-${LIBCHROMIUMCONTENT_COMMIT}"
+ASAR_P="asar-${ASAR_VERSION}"
+
+DESCRIPTION="Cross platform application development framework based on web technologies"
+HOMEPAGE="https://electron.atom.io/"
+SRC_URI="
+ https://commondatastorage.googleapis.com/chromium-browser-official/${CHROMIUM_P}.tar.xz
+ https://github.com/electron/electron/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/electron/brightray/archive/${BRIGHTRAY_COMMIT}.tar.gz -> ${BRIGHTRAY_P}.tar.gz
+ https://github.com/electron/node/archive/${NODE_COMMIT}.tar.gz -> electron-${NODE_P}.tar.gz
+ https://github.com/zcbenz/native-mate/archive/${NATIVE_MATE_COMMIT}.tar.gz -> ${NATIVE_MATE_P}.tar.gz
+ https://github.com/electron/libchromiumcontent/archive/${LIBCHROMIUMCONTENT_COMMIT}.tar.gz -> ${LIBCHROMIUMCONTENT_P}.tar.gz
+ https://github.com/elprans/asar/releases/download/v${ASAR_VERSION}-gentoo/asar-build.tar.gz -> ${ASAR_P}.tar.gz
+"
+
+S="${WORKDIR}/${CHROMIUM_P}"
+ELECTRON_S="${WORKDIR}/${P}"
+NODE_S="${S}/vendor/node"
+BRIGHTRAY_S="${S}/vendor/brightray"
+NATIVE_MATE_S="${S}/vendor/native_mate"
+LIBCC_S="${BRIGHTRAY_S}/vendor/libchromiumcontent"
+
+LICENSE="BSD"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~amd64"
+IUSE="custom-cflags cups debug gnome gnome-keyring hidpi kerberos lto neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc"
+RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
+
+# Native Client binaries are compiled with different set of flags, bug #452066.
+QA_FLAGS_IGNORED=".*\.nexe"
+
+# Native Client binaries may be stripped by the build system, which uses the
+# right tools for it, bug #469144 .
+QA_PRESTRIPPED=".*\.nexe"
+
+RDEPEND="!<dev-util/electron-0.36.12-r4
+ >=app-accessibility/speech-dispatcher-0.8:=
+ app-arch/bzip2:=
+ app-arch/snappy:=
+ >=app-eselect/eselect-electron-1.0.0
+ cups? ( >=net-print/cups-1.3.11:= )
+ >=dev-libs/elfutils-0.149
+ dev-libs/expat:=
+ dev-libs/glib:=
+ >=dev-libs/icu-55.1:=
+ >=dev-libs/jsoncpp-0.5.0-r1:=
+ >=dev-libs/libevent-1.4.13:=
+ dev-libs/libxml2:=[icu]
+ dev-libs/libxslt:=
+ dev-libs/nspr:=
+ >=dev-libs/nss-3.14.3:=
+ dev-libs/re2:=
+ gnome? ( >=gnome-base/gconf-2.24.0:= )
+ gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
+ >=media-libs/alsa-lib-1.0.19:=
+ media-libs/flac:=
+ media-libs/fontconfig:=
+ media-libs/freetype:=
+ >=media-libs/harfbuzz-0.9.41:=[icu(+)]
+ media-libs/libexif:=
+ >=media-libs/libjpeg-turbo-1.2.0-r1:=
+ media-libs/libpng:0=
+ >=media-libs/libwebp-0.4.0:=
+ media-libs/speex:=
+ pulseaudio? ( media-sound/pulseaudio:= )
+ system-ffmpeg? ( >=media-video/ffmpeg-2.7.2:=[opus,vorbis,vpx] )
+ sys-apps/dbus:=
+ sys-apps/pciutils:=
+ >=sys-libs/libcap-2.22:=
+ sys-libs/zlib:=[minizip]
+ virtual/udev
+ x11-libs/cairo:=
+ x11-libs/gdk-pixbuf:=
+ x11-libs/gtk+:2=
+ x11-libs/libdrm
+ x11-libs/libnotify:=
+ x11-libs/libX11:=
+ x11-libs/libXcomposite:=
+ x11-libs/libXcursor:=
+ x11-libs/libXdamage:=
+ x11-libs/libXext:=
+ x11-libs/libXfixes:=
+ >=x11-libs/libXi-1.6.0:=
+ x11-libs/libXinerama:=
+ x11-libs/libXrandr:=
+ x11-libs/libXrender:=
+ x11-libs/libXScrnSaver:=
+ x11-libs/libXtst:=
+ x11-libs/pango:=
+ kerberos? ( virtual/krb5 )
+ >=net-libs/http-parser-2.6.2:=
+ >=dev-libs/openssl-1.0.2g:0=[-bindist]"
+DEPEND="${RDEPEND}
+ !arm? (
+ dev-lang/yasm
+ )
+ dev-lang/perl
+ dev-perl/JSON
+ >=dev-util/gperf-3.0.3
+ dev-util/ninja
+ sys-apps/hwids[usb(+)]
+ >=sys-devel/bison-2.4.3
+ sys-devel/flex
+ virtual/pkgconfig"
+
+# For nvidia-drivers blocker, see bug #413637 .
+RDEPEND+="
+ x11-misc/xdg-utils
+ virtual/opengl
+ virtual/ttf-fonts
+ selinux? ( sec-policy/selinux-chromium )
+ tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )"
+
+# Python dependencies. The DEPEND part needs to be kept in sync
+# with python_check_deps.
+DEPEND+=" $(python_gen_any_dep '
+ dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/jinja[${PYTHON_USEDEP}]
+ dev-python/jsmin[${PYTHON_USEDEP}]
+ dev-python/ply[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+')"
+python_check_deps() {
+ has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/beautifulsoup:4[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/jinja[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/jsmin[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/ply[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
+}
+
+if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
+ EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
+fi
+
+pkg_pretend() {
+ if [[ $(tc-getCC)$ == *gcc* ]] && \
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
+ die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
+ fi
+
+ # LTO pass requires more file descriptors
+ if use lto; then
+ local lto_n_rlimit_min="16384"
+ local maxfiles=$(ulimit -n -H)
+ if [ "${maxfiles}" -lt "${lto_n_rlimit_min}" ]; then
+ eerror ""
+ eerror "Building with USE=\"lto\" requires file descriptor" \
+ "limit to be no less than ${lto_n_rlimit_min}."
+ eerror "The current limit for portage is ${maxfiles}."
+ eerror "Please add the following to /etc/security/limits.conf:"
+ eerror ""
+ eerror " root hard nofile ${lto_n_rlimit_min}"
+ eerror " root soft nofile ${lto_n_rlimit_min}"
+ eerror ""
+ die
+ fi
+ fi
+
+ # Check build requirements, bug #541816 and bug #471810 .
+ CHECKREQS_MEMORY="3G"
+ use lto && CHECKREQS_MEMORY="5G"
+ CHECKREQS_DISK_BUILD="10G"
+ eshopts_push -s extglob
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ CHECKREQS_DISK_BUILD="25G"
+ fi
+ eshopts_pop
+ check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+ # Make sure the build system will use the right python, bug #344367.
+ python-any-r1_pkg_setup
+
+ chromium_suid_sandbox_check_kernel_config
+}
+
+_unnest_patches() {
+ local _s="${1%/}/" relpath out
+
+ for f in $(find "${_s}" -mindepth 2 -name *.patch -printf \"%P\"\\n); do
+ relpath="$(dirname ${f})"
+ out="${_s}/${relpath////_}_$(basename ${f})"
+ sed -r -e "s|^([-+]{3}) (.*)$|\1 ${relpath}/\2 ${f}|g" > "${out}"
+ done
+}
+
+_get_install_suffix() {
+ local c=(${SLOT//\// })
+ local slot=${c[0]}
+ local suffix
+
+ if [[ "${slot}" == "0" ]]; then
+ suffix=""
+ else
+ suffix="-${slot}"
+ fi
+
+ echo -n "${suffix}"
+}
+
+_get_install_dir() {
+ echo -n "/usr/$(get_libdir)/electron$(_get_install_suffix)"
+}
+
+src_prepare() {
+ # Merge Electron code and its submodules into the Chromium source tree
+ # so that everything can be configured and built in a single pass.
+ #
+ rsync -a --ignore-existing "${ELECTRON_S}/" "${S}/" || die
+ rm -r "${NODE_S}" &&
+ mv "${WORKDIR}/${NODE_P}" "${NODE_S}" || die
+ rm -r "${BRIGHTRAY_S}" &&
+ mv "${WORKDIR}/${BRIGHTRAY_P}" "${BRIGHTRAY_S}" || die
+ rm -r "${NATIVE_MATE_S}" &&
+ mv "${WORKDIR}/${NATIVE_MATE_P}" "${NATIVE_MATE_S}" || die
+ rm -r "${LIBCC_S}" &&
+ mv "${WORKDIR}/${LIBCHROMIUMCONTENT_P}" "${LIBCC_S}" || die
+ rm -r "${S}/vendor/breakpad" &&
+ ln -s "../breakpad" "${S}/vendor/breakpad" || die
+ ln -s "${WORKDIR}/${ASAR_P}/node_modules" "${S}/node_modules" || die
+
+ # electron patches
+ epatch "${FILESDIR}/${P}.patch"
+
+ # node patches
+ cd "${NODE_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-node.patch"
+ epatch "${FILESDIR}/electron-vendor-node-external-snapshots-r0.patch"
+ # make sure node uses the correct version of v8
+ rm -r deps/v8 || die
+ ln -s ../../../v8 deps/ || die
+
+ # make sure we use python2.* while using gyp
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
+
+ # less verbose install output (stating the same as portage, basically)
+ sed -i -e "/print/d" tools/install.py || die
+
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
+ local LIBDIR=$(get_libdir)
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
+
+ # brightray patches
+ cd "${BRIGHTRAY_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-brightray.patch"
+
+ # libcc patches
+ cd "${LIBCC_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-libchromiumcontent.patch"
+
+ # chromium patches
+ cd "${S}" || die
+ epatch "${FILESDIR}/chromium-system-ffmpeg-r2.patch"
+ epatch "${FILESDIR}/chromium-system-jinja-r7.patch"
+ epatch "${FILESDIR}/chromium-disable-widevine.patch"
+ epatch "${FILESDIR}/chromium-last-commit-position-r0.patch"
+ epatch "${FILESDIR}/chromium-snapshot-toolchain-r1.patch"
+ epatch "${FILESDIR}/chromium-remove-gardiner-mod-font.patch"
+ epatch "${FILESDIR}/chromium-shared-v8.patch"
+ epatch "${FILESDIR}/chromium-lto-fixes.patch"
+ epatch "${FILESDIR}/chromium-icu-58-r0.patch"
+ epatch "${FILESDIR}/chromium-cups-fix.patch"
+
+ # libcc chromium patches
+ _unnest_patches "${LIBCC_S}/patches"
+
+ EPATCH_SOURCE="${LIBCC_S}/patches" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_EXCLUDE="third_party_icu*" \
+ EPATCH_MULTI_MSG="Applying libchromiumcontent patches..." \
+ epatch
+
+ # build scripts
+ mkdir -p "${S}/chromiumcontent" || die
+ cp -a "${LIBCC_S}/chromiumcontent" "${S}/" || die
+ cp -a "${LIBCC_S}/tools/linux/" "${S}/tools/" || die
+
+ local conditional_bundled_libraries=""
+ if ! use system-ffmpeg; then
+ conditional_bundled_libraries+=" third_party/ffmpeg"
+ fi
+
+ # Remove most bundled libraries. Some are still needed.
+ build/linux/unbundle/remove_bundled_libraries.py \
+ ${conditional_bundled_libraries} \
+ 'base/third_party/dmg_fp' \
+ 'base/third_party/dynamic_annotations' \
+ 'base/third_party/icu' \
+ 'base/third_party/nspr' \
+ 'base/third_party/superfasthash' \
+ 'base/third_party/symbolize' \
+ 'base/third_party/valgrind' \
+ 'base/third_party/xdg_mime' \
+ 'base/third_party/xdg_user_dirs' \
+ 'breakpad/src/third_party/curl' \
+ 'chrome/third_party/mozilla_security_manager' \
+ 'courgette/third_party' \
+ 'crypto/third_party/nss' \
+ 'net/third_party/mozilla_security_manager' \
+ 'net/third_party/nss' \
+ 'third_party/WebKit' \
+ 'third_party/analytics' \
+ 'third_party/angle' \
+ 'third_party/angle/src/third_party/compiler' \
+ 'third_party/angle/src/third_party/murmurhash' \
+ 'third_party/angle/src/third_party/trace_event' \
+ 'third_party/boringssl' \
+ 'third_party/brotli' \
+ 'third_party/cacheinvalidation' \
+ 'third_party/catapult' \
+ 'third_party/catapult/third_party/py_vulcanize' \
+ 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \
+ 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \
+ 'third_party/catapult/tracing/third_party/components/polymer' \
+ 'third_party/catapult/tracing/third_party/d3' \
+ 'third_party/catapult/tracing/third_party/gl-matrix' \
+ 'third_party/catapult/tracing/third_party/jszip' \
+ 'third_party/cld_2' \
+ 'third_party/cros_system_api' \
+ 'third_party/cython/python_flags.py' \
+ 'third_party/devscripts' \
+ 'third_party/dom_distiller_js' \
+ 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
+ 'third_party/fips181' \
+ 'third_party/flot' \
+ 'third_party/google_input_tools' \
+ 'third_party/google_input_tools/third_party/closure_library' \
+ 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
+ 'third_party/hunspell' \
+ 'third_party/iccjpeg' \
+ 'third_party/jstemplate' \
+ 'third_party/khronos' \
+ 'third_party/leveldatabase' \
+ 'third_party/libXNVCtrl' \
+ 'third_party/libaddressinput' \
+ 'third_party/libjingle' \
+ 'third_party/libphonenumber' \
+ 'third_party/libsecret' \
+ 'third_party/libsrtp' \
+ 'third_party/libudev' \
+ 'third_party/libusb' \
+ 'third_party/libvpx_new' \
+ 'third_party/libvpx_new/source/libvpx/third_party/x86inc' \
+ 'third_party/libxml/chromium' \
+ 'third_party/libwebm' \
+ 'third_party/libyuv' \
+ 'third_party/lss' \
+ 'third_party/lzma_sdk' \
+ 'third_party/mesa' \
+ 'third_party/modp_b64' \
+ 'third_party/mojo' \
+ 'third_party/mt19937ar' \
+ 'third_party/npapi' \
+ 'third_party/openmax_dl' \
+ 'third_party/opus' \
+ 'third_party/ots' \
+ 'third_party/pdfium' \
+ 'third_party/pdfium/third_party/agg23' \
+ 'third_party/pdfium/third_party/base' \
+ 'third_party/pdfium/third_party/bigint' \
+ 'third_party/pdfium/third_party/freetype' \
+ 'third_party/pdfium/third_party/lcms2-2.6' \
+ 'third_party/pdfium/third_party/libjpeg' \
+ 'third_party/pdfium/third_party/libopenjpeg20' \
+ 'third_party/pdfium/third_party/zlib_v128' \
+ 'third_party/polymer' \
+ 'third_party/protobuf' \
+ 'third_party/qcms' \
+ 'third_party/re2' \
+ 'third_party/sfntly' \
+ 'third_party/skia' \
+ 'third_party/smhasher' \
+ 'third_party/sqlite' \
+ 'third_party/tcmalloc' \
+ 'third_party/usrsctp' \
+ 'third_party/web-animations-js' \
+ 'third_party/webdriver' \
+ 'third_party/webrtc' \
+ 'third_party/widevine' \
+ 'third_party/woff2' \
+ 'third_party/x86inc' \
+ 'third_party/zlib/google' \
+ 'url/third_party/mozilla' \
+ 'v8/src/third_party/fdlibm' \
+ 'v8/src/third_party/valgrind' \
+ --do-remove || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=""
+
+ # Never tell the build system to "enable" SSE2, it has a few unexpected
+ # additions, bug #336871.
+ myconf+=" -Ddisable_sse2=1"
+
+ # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
+ myconf+=" -Ddisable_nacl=1"
+
+ # Disable glibc Native Client toolchain, we don't need it (bug #417019).
+ # myconf+=" -Ddisable_glibc=1"
+
+ # TODO: also build with pnacl
+ # myconf+=" -Ddisable_pnacl=1"
+
+ # It would be awkward for us to tar the toolchain and get it untarred again
+ # during the build.
+ # myconf+=" -Ddisable_newlib_untar=1"
+
+ # Make it possible to remove third_party/adobe.
+ echo > "${T}/flapper_version.h" || die
+ myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
+
+ # Use system-provided libraries.
+ # TODO: use_system_hunspell (upstream changes needed).
+ # TODO: use_system_libsrtp (bug #459932).
+ # TODO: use_system_libusb (http://crbug.com/266149).
+ # TODO: use_system_libvpx (http://crbug.com/494939).
+ # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
+ # TODO: use_system_protobuf (bug #525560).
+ # TODO: use_system_ssl (http://crbug.com/58087).
+ # TODO: use_system_sqlite (http://crbug.com/22208).
+ myconf+="
+ -Duse_system_bzip2=1
+ -Duse_system_ffmpeg=$(usex system-ffmpeg 1 0)
+ -Duse_system_flac=1
+ -Duse_system_harfbuzz=1
+ -Duse_system_icu=1
+ -Duse_system_jsoncpp=1
+ -Duse_system_libevent=1
+ -Duse_system_libjpeg=1
+ -Duse_system_libpng=1
+ -Duse_system_libwebp=1
+ -Duse_system_libxml=1
+ -Duse_system_libxslt=1
+ -Duse_system_minizip=1
+ -Duse_system_nspr=1
+ -Duse_system_snappy=1
+ -Duse_system_speex=1
+ -Duse_system_xdg_utils=1
+ -Duse_system_zlib=1"
+
+ # Needed for system icu - we don't need additional data files.
+ myconf+=" -Dicu_use_data_file_flag=0"
+
+ # TODO: patch gyp so that this arm conditional is not needed.
+ if ! use arm; then
+ myconf+="
+ -Duse_system_yasm=1"
+ fi
+
+ # Optional dependencies.
+ # TODO: linux_link_kerberos, bug #381289.
+ myconf+="
+ $(gyp_use cups)
+ $(gyp_use gnome use_gconf)
+ $(gyp_use gnome-keyring use_gnome_keyring)
+ $(gyp_use gnome-keyring linux_link_gnome_keyring)
+ $(gyp_use hidpi enable_hidpi)
+ $(gyp_use kerberos)
+ $(gyp_use lto)
+ $(gyp_use pulseaudio)
+ $(gyp_use tcmalloc use_allocator tcmalloc none)"
+
+ # Use explicit library dependencies instead of dlopen.
+ # This makes breakages easier to detect by revdep-rebuild.
+ myconf+="
+ -Dlinux_link_gsettings=1
+ -Dlinux_link_libpci=1
+ -Dlinux_link_libspeechd=1
+ -Dlibspeechd_h_prefix=speech-dispatcher/"
+
+ # TODO: use the file at run time instead of effectively compiling it in.
+ myconf+="
+ -Dusb_ids_path=/usr/share/misc/usb.ids"
+
+ # Save space by removing DLOG and DCHECK messages (about 6% reduction).
+ myconf+="
+ -Dlogging_like_official_build=1"
+
+ if [[ $(tc-getCC) == *clang* ]]; then
+ myconf+=" -Dclang=1"
+ else
+ myconf+=" -Dclang=0"
+ fi
+
+ # Never use bundled gold binary. Disable gold linker flags for now.
+ # Do not use bundled clang.
+ myconf+="
+ -Dclang_use_chrome_plugins=0
+ -Dhost_clang=0
+ -Dlinux_use_bundled_binutils=0
+ -Dlinux_use_bundled_gold=0
+ -Dlinux_use_gold_flags=0
+ -Dsysroot="
+
+ ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
+ myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
+
+ # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
+ # Note: these are for Gentoo use ONLY. For your own distribution,
+ # please get your own set of keys. Feel free to contact chromium@gentoo.org
+ # for more info.
+ myconf+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
+ -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
+ -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
+
+ local myarch="$(tc-arch)"
+ if [[ $myarch = amd64 ]] ; then
+ target_arch=x64
+ ffmpeg_target_arch=x64
+ elif [[ $myarch = x86 ]] ; then
+ target_arch=ia32
+ ffmpeg_target_arch=ia32
+ elif [[ $myarch = arm ]] ; then
+ target_arch=arm
+ ffmpeg_target_arch=$(usex neon arm-neon arm)
+ # TODO: re-enable NaCl (NativeClient).
+ local CTARGET=${CTARGET:-${CHOST}}
+ if [[ $(tc-is-softfloat) == "no" ]]; then
+
+ myconf+=" -Darm_float_abi=hard"
+ fi
+ filter-flags "-mfpu=*"
+ use neon || myconf+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
+
+ if [[ ${CTARGET} == armv[78]* ]]; then
+ myconf+=" -Darmv7=1"
+ else
+ myconf+=" -Darmv7=0"
+ fi
+ myconf+=" -Dsysroot=
+ $(gyp_use neon arm_neon)
+ -Ddisable_nacl=1"
+ else
+ die "Failed to determine target arch, got '$myarch'."
+ fi
+
+ myconf+=" -Dtarget_arch=${target_arch}"
+
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system.
+ # Depending on GCC version the warnings are different and we don't want
+ # the build to fail because of that.
+ myconf+=" -Dwerror="
+
+ # Disable fatal linker warnings, bug 506268.
+ myconf+=" -Ddisable_fatal_linker_warnings=1"
+
+ # Avoid CFLAGS problems, bug #352457, bug #390147.
+ if ! use custom-cflags; then
+ replace-flags "-Os" "-O2"
+ strip-flags
+
+ # Prevent linker from running out of address space, bug #471810 .
+ if use x86; then
+ filter-flags "-g*"
+ fi
+
+ # Prevent libvpx build failures. Bug 530248, 544702, 546984.
+ if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
+ filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
+ fi
+ fi
+
+ # Make sure the build system will use the right tools, bug #340795.
+ tc-export AR CC CXX NM
+
+ # Tools for building programs to be executed on the build system, bug #410883.
+ if tc-is-cross-compiler; then
+ export AR_host=$(tc-getBUILD_AR)
+ export CC_host=$(tc-getBUILD_CC)
+ export CXX_host=$(tc-getBUILD_CXX)
+ export NM_host=$(tc-getBUILD_NM)
+ fi
+
+ # Bug 491582.
+ export TMPDIR="${WORKDIR}/temp"
+ mkdir -p -m 755 "${TMPDIR}" || die
+
+ if ! use system-ffmpeg; then
+ local build_ffmpeg_args=""
+ if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
+ build_ffmpeg_args+=" --disable-asm"
+ fi
+
+ # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
+ einfo "Configuring bundled ffmpeg..."
+ pushd third_party/ffmpeg > /dev/null || die
+ chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
+ --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
+ chromium/scripts/copy_config.sh || die
+ chromium/scripts/generate_gyp.py || die
+ popd > /dev/null || die
+ fi
+
+ third_party/libaddressinput/chromium/tools/update-strings.py || die
+
+ touch chrome/test/data/webui/i18n_process_css_test.html || die
+
+ einfo "Configuring bundled nodejs..."
+ pushd vendor/node > /dev/null || die
+ # Make sure gyp_node does not run
+ echo '#!/usr/bin/env python' > tools/gyp_node.py || die
+ # --shared-libuv cannot be used as electron's node fork
+ # patches uv_loop structure.
+ ./configure --shared-openssl --shared-http-parser \
+ --shared-zlib --without-npm --with-intl=system-icu \
+ --without-dtrace --dest-cpu=${target_arch} \
+ --prefix="" || die
+ popd > /dev/null || die
+
+ # libchromiumcontent configuration
+ myconf+=" -Dcomponent=static_library"
+ myconf+=" -Dmac_mas_build=0"
+ myconf+=' -Dicu_small="false"'
+ myconf+=" -Dlibchromiumcontent_component=0"
+ myconf+=" -Dlibrary=static_library"
+ myconf+=" -Dmas_build=0"
+
+ einfo "Configuring electron..."
+ build/linux/unbundle/replace_gyp_files.py ${myconf} || die
+
+ myconf+=" -Ivendor/node/config.gypi
+ -Icommon.gypi
+ electron.gyp"
+
+ egyp_chromium ${myconf} || die
+}
+
+eninja() {
+ if [[ -z ${NINJAOPTS+set} ]]; then
+ local jobs=$(makeopts_jobs)
+ local loadavg=$(makeopts_loadavg)
+
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+ NINJAOPTS+=" -j ${jobs}"
+ fi
+ if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
+ NINJAOPTS+=" -l ${loadavg}"
+ fi
+ fi
+ set -- ninja -v ${NINJAOPTS} "$@"
+ echo "$@"
+ "$@"
+}
+
+src_compile() {
+ local ninja_targets="electron" compile_target="out/R"
+
+ eninja -C ${compile_target} mksnapshot || die
+ pax-mark -m ${compile_target}/mksnapshot
+
+ eninja -C ${compile_target} nodebin || die
+ pax-mark -m ${compile_target}/nodebin
+
+ # Even though ninja autodetects number of CPUs, we respect
+ # user's options, for debugging with -j 1 or any other reason.
+ eninja -C ${compile_target} ${ninja_targets} || die
+}
+
+src_install() {
+ local install_dir="$(_get_install_dir)"
+ local install_suffix="$(_get_install_suffix)"
+ local LIBDIR="${ED}/usr/$(get_libdir)"
+
+ pushd out/R/locales > /dev/null || die
+ chromium_remove_language_paks
+ popd > /dev/null || die
+
+ # Install Electron
+ insinto "${install_dir}"
+ exeinto "${install_dir}"
+ newexe out/R/nodebin node
+ doexe out/R/electron
+ doins out/R/libv8.so
+ doins out/R/libnode.so
+ fperms +x "${install_dir}/libv8.so" "${install_dir}/libnode.so"
+ doins out/R/content_shell.pak
+ doins out/R/natives_blob.bin
+ doins out/R/snapshot_blob.bin
+ rm -r out/R/resources/inspector || die
+ doins -r out/R/resources
+ doins -r out/R/locales
+ dosym "${install_dir}/electron" "/usr/bin/electron${install_suffix}"
+
+ pax-mark -rm "${ED}/${install_dir}/electron"
+
+ # Install Node headers
+ HEADERS_ONLY=1 \
+ "${S}/vendor/node/tools/install.py" install "${ED}" "/usr" || die
+ # set up a symlink structure that npm expects..
+ dodir /usr/include/node/deps/{v8,uv}
+ dosym . /usr/include/node/src
+ for var in deps/{uv,v8}/include; do
+ dosym ../.. /usr/include/node/${var}
+ done
+
+ dodir "/usr/include/electron${install_suffix}"
+ mv "${ED}/usr/include/node" \
+ "${ED}/usr/include/electron${install_suffix}/node" || die
+}
+
+pkg_postinst() {
+ eselect electron update
+}
+
+pkg_prerm() {
+ eselect electron update
+}
diff --git a/dev-util/electron/electron-1.3.13-r1.ebuild b/dev-util/electron/electron-1.3.13-r1.ebuild
new file mode 100644
index 000000000000..c00fd0f61608
--- /dev/null
+++ b/dev-util/electron/electron-1.3.13-r1.ebuild
@@ -0,0 +1,763 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
+ hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
+ sv sw ta te th tr uk vi zh-CN zh-TW"
+
+inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib \
+ multiprocessing pax-utils portability python-any-r1 readme.gentoo-r1 \
+ toolchain-funcs versionator virtualx xdg-utils
+
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent/VERSION
+CHROMIUM_VERSION="52.0.2743.82"
+# Keep this in sync with vendor/brightray
+BRIGHTRAY_COMMIT="ee26c5218eeec199c54c92a7517a72d2dbd0adbf"
+# Keep this in sync with vendor/node
+NODE_COMMIT="c47e9bf9011de682d07c82f7f610a467f30cca60"
+# Keep this in sync with vendor/native_mate
+NATIVE_MATE_COMMIT="b5e5de626c6a57e44c7e6448d8bbaaac475d493c"
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent
+LIBCHROMIUMCONTENT_COMMIT="27add4cfef98f21d5910539bebb47ae175f024c2"
+# Keep this in sync with package.json#devDependencies
+ASAR_VERSION="0.12.1"
+
+CHROMIUM_P="chromium-${CHROMIUM_VERSION}"
+BRIGHTRAY_P="brightray-${BRIGHTRAY_COMMIT}"
+NODE_P="node-${NODE_COMMIT}"
+NATIVE_MATE_P="native-mate-${NATIVE_MATE_COMMIT}"
+LIBCHROMIUMCONTENT_P="libchromiumcontent-${LIBCHROMIUMCONTENT_COMMIT}"
+ASAR_P="asar-${ASAR_VERSION}"
+
+DESCRIPTION="Cross platform application development framework based on web technologies"
+HOMEPAGE="https://electron.atom.io/"
+SRC_URI="
+ https://commondatastorage.googleapis.com/chromium-browser-official/${CHROMIUM_P}.tar.xz
+ https://github.com/electron/electron/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/electron/brightray/archive/${BRIGHTRAY_COMMIT}.tar.gz -> ${BRIGHTRAY_P}.tar.gz
+ https://github.com/electron/node/archive/${NODE_COMMIT}.tar.gz -> electron-${NODE_P}.tar.gz
+ https://github.com/zcbenz/native-mate/archive/${NATIVE_MATE_COMMIT}.tar.gz -> ${NATIVE_MATE_P}.tar.gz
+ https://github.com/electron/libchromiumcontent/archive/${LIBCHROMIUMCONTENT_COMMIT}.tar.gz -> ${LIBCHROMIUMCONTENT_P}.tar.gz
+ https://github.com/elprans/asar/releases/download/v${ASAR_VERSION}-gentoo/asar-build.tar.gz -> ${ASAR_P}.tar.gz
+"
+
+S="${WORKDIR}/${CHROMIUM_P}"
+ELECTRON_S="${WORKDIR}/${P}"
+NODE_S="${S}/vendor/node"
+BRIGHTRAY_S="${S}/vendor/brightray"
+NATIVE_MATE_S="${S}/vendor/native_mate"
+LIBCC_S="${BRIGHTRAY_S}/vendor/libchromiumcontent"
+
+LICENSE="BSD"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~amd64"
+IUSE="custom-cflags cups gnome gnome-keyring hidpi kerberos lto neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc"
+RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
+
+# Native Client binaries are compiled with different set of flags, bug #452066.
+QA_FLAGS_IGNORED=".*\.nexe"
+
+# Native Client binaries may be stripped by the build system, which uses the
+# right tools for it, bug #469144 .
+QA_PRESTRIPPED=".*\.nexe"
+
+RDEPEND="!<dev-util/electron-0.36.12-r4
+ >=app-accessibility/speech-dispatcher-0.8:=
+ app-arch/bzip2:=
+ app-arch/snappy:=
+ >=app-eselect/eselect-electron-1.0.0
+ cups? ( >=net-print/cups-1.3.11:= )
+ >=dev-libs/elfutils-0.149
+ dev-libs/expat:=
+ dev-libs/glib:=
+ >=dev-libs/icu-55.1:=
+ >=dev-libs/jsoncpp-0.5.0-r1:=
+ >=dev-libs/libevent-1.4.13:=
+ dev-libs/libxml2:=[icu]
+ dev-libs/libxslt:=
+ dev-libs/nspr:=
+ >=dev-libs/nss-3.14.3:=
+ dev-libs/re2:=
+ gnome? ( >=gnome-base/gconf-2.24.0:= )
+ gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
+ >=media-libs/alsa-lib-1.0.19:=
+ media-libs/flac:=
+ media-libs/fontconfig:=
+ media-libs/freetype:=
+ >=media-libs/harfbuzz-0.9.41:=[icu(+)]
+ media-libs/libexif:=
+ >=media-libs/libjpeg-turbo-1.2.0-r1:=
+ media-libs/libpng:0=
+ >=media-libs/libwebp-0.4.0:=
+ media-libs/speex:=
+ pulseaudio? ( media-sound/pulseaudio:= )
+ system-ffmpeg? ( >=media-video/ffmpeg-2.7.2:=[opus,vorbis,vpx] )
+ sys-apps/dbus:=
+ sys-apps/pciutils:=
+ >=sys-libs/libcap-2.22:=
+ sys-libs/zlib:=[minizip]
+ virtual/udev
+ x11-libs/cairo:=
+ x11-libs/gdk-pixbuf:=
+ x11-libs/gtk+:2=
+ x11-libs/libdrm
+ x11-libs/libnotify:=
+ x11-libs/libX11:=
+ x11-libs/libXcomposite:=
+ x11-libs/libXcursor:=
+ x11-libs/libXdamage:=
+ x11-libs/libXext:=
+ x11-libs/libXfixes:=
+ >=x11-libs/libXi-1.6.0:=
+ x11-libs/libXinerama:=
+ x11-libs/libXrandr:=
+ x11-libs/libXrender:=
+ x11-libs/libXScrnSaver:=
+ x11-libs/libXtst:=
+ x11-libs/pango:=
+ kerberos? ( virtual/krb5 )
+ >=net-libs/http-parser-2.6.2:=
+ >=dev-libs/libuv-1.8.0:=
+ >=dev-libs/openssl-1.0.2g:0=[-bindist]"
+DEPEND="${RDEPEND}
+ !arm? (
+ dev-lang/yasm
+ )
+ dev-lang/perl
+ dev-perl/JSON
+ >=dev-util/gperf-3.0.3
+ dev-util/ninja
+ sys-apps/hwids[usb(+)]
+ >=sys-devel/bison-2.4.3
+ sys-devel/flex
+ virtual/pkgconfig"
+
+# For nvidia-drivers blocker, see bug #413637 .
+RDEPEND+="
+ x11-misc/xdg-utils
+ virtual/opengl
+ virtual/ttf-fonts
+ selinux? ( sec-policy/selinux-chromium )
+ tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )"
+
+# Python dependencies. The DEPEND part needs to be kept in sync
+# with python_check_deps.
+DEPEND+=" $(python_gen_any_dep '
+ dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
+ dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/jsmin[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+')"
+python_check_deps() {
+ has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
+ has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/jsmin[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
+}
+
+if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
+ EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
+fi
+
+pkg_pretend() {
+ if [[ $(tc-getCC)$ == *gcc* ]] && \
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
+ die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
+ fi
+
+ # LTO pass requires more file descriptors
+ if use lto; then
+ local lto_n_rlimit_min="16384"
+ local maxfiles=$(ulimit -n -H)
+ if [ "${maxfiles}" -lt "${lto_n_rlimit_min}" ]; then
+ eerror ""
+ eerror "Building with USE=\"lto\" requires file descriptor" \
+ "limit to be no less than ${lto_n_rlimit_min}."
+ eerror "The current limit for portage is ${maxfiles}."
+ eerror "Please add the following to /etc/security/limits.conf:"
+ eerror ""
+ eerror " root hard nofile ${lto_n_rlimit_min}"
+ eerror " root soft nofile ${lto_n_rlimit_min}"
+ eerror ""
+ die
+ fi
+ fi
+
+ # Check build requirements, bug #541816 and bug #471810 .
+ CHECKREQS_MEMORY="3G"
+ use lto && CHECKREQS_MEMORY="5G"
+ CHECKREQS_DISK_BUILD="10G"
+ eshopts_push -s extglob
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ CHECKREQS_DISK_BUILD="25G"
+ fi
+ eshopts_pop
+ check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+ # Make sure the build system will use the right python, bug #344367.
+ python-any-r1_pkg_setup
+
+ chromium_suid_sandbox_check_kernel_config
+}
+
+_unnest_patches() {
+ local _s="${1%/}/" relpath out
+
+ for f in $(find "${_s}" -mindepth 2 -name *.patch -printf \"%P\"\\n); do
+ relpath="$(dirname ${f})"
+ out="${_s}/${relpath////_}_$(basename ${f})"
+ sed -r -e "s|^([-+]{3}) (.*)$|\1 ${relpath}/\2 ${f}|g" > "${out}"
+ done
+}
+
+_get_install_suffix() {
+ local c=(${SLOT//\// })
+ local slot=${c[0]}
+ local suffix
+
+ if [[ "${slot}" == "0" ]]; then
+ suffix=""
+ else
+ suffix="-${slot}"
+ fi
+
+ echo -n "${suffix}"
+}
+
+_get_install_dir() {
+ echo -n "/usr/$(get_libdir)/electron$(_get_install_suffix)"
+}
+
+src_prepare() {
+ # Merge Electron code and its submodules into the Chromium source tree
+ # so that everything can be configured and built in a single pass.
+ #
+ rsync -a --ignore-existing "${ELECTRON_S}/" "${S}/" || die
+ rm -r "${NODE_S}" &&
+ mv "${WORKDIR}/${NODE_P}" "${NODE_S}" || die
+ rm -r "${BRIGHTRAY_S}" &&
+ mv "${WORKDIR}/${BRIGHTRAY_P}" "${BRIGHTRAY_S}" || die
+ rm -r "${NATIVE_MATE_S}" &&
+ mv "${WORKDIR}/${NATIVE_MATE_P}" "${NATIVE_MATE_S}" || die
+ rm -r "${LIBCC_S}" &&
+ mv "${WORKDIR}/${LIBCHROMIUMCONTENT_P}" "${LIBCC_S}" || die
+ rm -r "${S}/vendor/breakpad" &&
+ ln -s "../breakpad" "${S}/vendor/breakpad" || die
+ ln -s "${WORKDIR}/${ASAR_P}/node_modules" "${S}/node_modules" || die
+
+ # electron patches
+ epatch "${FILESDIR}/${PN}-1.3.6.patch"
+
+ # node patches
+ cd "${NODE_S}" || die
+ epatch "${FILESDIR}/${P}-vendor-node.patch"
+ epatch "${FILESDIR}/electron-vendor-node-external-snapshots-r0.patch"
+ # make sure node uses the correct version of v8
+ rm -r deps/v8 || die
+ ln -s ../../../v8 deps/ || die
+
+ # make sure we use python2.* while using gyp
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
+
+ # less verbose install output (stating the same as portage, basically)
+ sed -i -e "/print/d" tools/install.py || die
+
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
+ local LIBDIR=$(get_libdir)
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
+
+ # brightray patches
+ cd "${BRIGHTRAY_S}" || die
+ epatch "${FILESDIR}/${PN}-1.3.6-vendor-brightray.patch"
+
+ # libcc patches
+ cd "${LIBCC_S}" || die
+ epatch "${FILESDIR}/${PN}-1.3.6-vendor-libchromiumcontent.patch"
+
+ # chromium patches
+ cd "${S}" || die
+ epatch "${FILESDIR}/chromium-system-ffmpeg-r2.patch"
+ epatch "${FILESDIR}/chromium-disable-widevine.patch"
+ epatch "${FILESDIR}/chromium-last-commit-position-r0.patch"
+ epatch "${FILESDIR}/chromium-snapshot-toolchain-r1.patch"
+ epatch "${FILESDIR}/chromium-remove-gardiner-mod-font.patch"
+ epatch "${FILESDIR}/chromium-pdfium-r0.patch"
+ epatch "${FILESDIR}/chromium-system-zlib-r0.patch"
+ epatch "${FILESDIR}/chromium-linker-warnings-r0.patch"
+ epatch "${FILESDIR}/chromium-ffmpeg-license-r0.patch"
+ epatch "${FILESDIR}/chromium-shared-v8-r1.patch"
+ epatch "${FILESDIR}/chromium-lto-fixes-r1.patch"
+ epatch "${FILESDIR}/chromium-icu-58-r1.patch"
+ epatch "${FILESDIR}/chromium-cups-fix.patch"
+ # libcc chromium patches
+ _unnest_patches "${LIBCC_S}/patches"
+
+ EPATCH_SOURCE="${LIBCC_S}/patches" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_EXCLUDE="third_party_icu*" \
+ EPATCH_MULTI_MSG="Applying libchromiumcontent patches..." \
+ epatch
+
+ # build scripts
+ mkdir -p "${S}/chromiumcontent" || die
+ cp -a "${LIBCC_S}/chromiumcontent" "${S}/" || die
+ cp -a "${LIBCC_S}/tools/linux/" "${S}/tools/" || die
+
+ local conditional_bundled_libraries=""
+ if ! use system-ffmpeg; then
+ conditional_bundled_libraries+=" third_party/ffmpeg"
+ fi
+
+ # Remove most bundled libraries. Some are still needed.
+ build/linux/unbundle/remove_bundled_libraries.py \
+ ${conditional_bundled_libraries} \
+ 'base/third_party/dmg_fp' \
+ 'base/third_party/dynamic_annotations' \
+ 'base/third_party/icu' \
+ 'base/third_party/nspr' \
+ 'base/third_party/superfasthash' \
+ 'base/third_party/symbolize' \
+ 'base/third_party/valgrind' \
+ 'base/third_party/xdg_mime' \
+ 'base/third_party/xdg_user_dirs' \
+ 'breakpad/src/third_party/curl' \
+ 'breakpad/src/third_party/musl' \
+ 'chrome/third_party/mozilla_security_manager' \
+ 'courgette/third_party' \
+ 'net/third_party/mozilla_security_manager' \
+ 'net/third_party/nss' \
+ 'third_party/WebKit' \
+ 'third_party/analytics' \
+ 'third_party/angle' \
+ 'third_party/angle/src/third_party/compiler' \
+ 'third_party/angle/src/third_party/libXNVCtrl' \
+ 'third_party/angle/src/third_party/murmurhash' \
+ 'third_party/angle/src/third_party/trace_event' \
+ 'third_party/boringssl' \
+ 'third_party/brotli' \
+ 'third_party/cacheinvalidation' \
+ 'third_party/catapult' \
+ 'third_party/catapult/third_party/py_vulcanize' \
+ 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \
+ 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \
+ 'third_party/catapult/tracing/third_party/components/polymer' \
+ 'third_party/catapult/tracing/third_party/d3' \
+ 'third_party/catapult/tracing/third_party/gl-matrix' \
+ 'third_party/catapult/tracing/third_party/jszip' \
+ 'third_party/cld_2' \
+ 'third_party/cros_system_api' \
+ 'third_party/cython/python_flags.py' \
+ 'third_party/devscripts' \
+ 'third_party/dom_distiller_js' \
+ 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
+ 'third_party/fips181' \
+ 'third_party/flot' \
+ 'third_party/google_input_tools' \
+ 'third_party/google_input_tools/third_party/closure_library' \
+ 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
+ 'third_party/hunspell' \
+ 'third_party/iccjpeg' \
+ 'third_party/jinja2' \
+ 'third_party/jstemplate' \
+ 'third_party/khronos' \
+ 'third_party/leveldatabase' \
+ 'third_party/libXNVCtrl' \
+ 'third_party/libaddressinput' \
+ 'third_party/libjingle' \
+ 'third_party/libjpeg_turbo' \
+ 'third_party/libphonenumber' \
+ 'third_party/libpng' \
+ 'third_party/libsecret' \
+ 'third_party/libsrtp' \
+ 'third_party/libudev' \
+ 'third_party/libusb' \
+ 'third_party/libvpx' \
+ 'third_party/libvpx/source/libvpx/third_party/x86inc' \
+ 'third_party/libwebm' \
+ 'third_party/libxml/chromium' \
+ 'third_party/libyuv' \
+ 'third_party/lss' \
+ 'third_party/lzma_sdk' \
+ 'third_party/markupsafe' \
+ 'third_party/mesa' \
+ 'third_party/modp_b64' \
+ 'third_party/mt19937ar' \
+ 'third_party/openh264' \
+ 'third_party/openmax_dl' \
+ 'third_party/opus' \
+ 'third_party/ots' \
+ 'third_party/pdfium' \
+ 'third_party/pdfium/third_party/agg23' \
+ 'third_party/pdfium/third_party/base' \
+ 'third_party/pdfium/third_party/bigint' \
+ 'third_party/pdfium/third_party/freetype' \
+ 'third_party/pdfium/third_party/lcms2-2.6' \
+ 'third_party/pdfium/third_party/libjpeg' \
+ 'third_party/pdfium/third_party/libopenjpeg20' \
+ 'third_party/pdfium/third_party/libpng16' \
+ 'third_party/pdfium/third_party/libtiff' \
+ 'third_party/pdfium/third_party/zlib_v128' \
+ 'third_party/ply' \
+ 'third_party/polymer' \
+ 'third_party/protobuf' \
+ 'third_party/protobuf/third_party/six' \
+ 'third_party/qcms' \
+ 'third_party/re2' \
+ 'third_party/sfntly' \
+ 'third_party/skia' \
+ 'third_party/smhasher' \
+ 'third_party/sqlite' \
+ 'third_party/tcmalloc' \
+ 'third_party/usrsctp' \
+ 'third_party/web-animations-js' \
+ 'third_party/webdriver' \
+ 'third_party/webrtc' \
+ 'third_party/widevine' \
+ 'third_party/woff2' \
+ 'third_party/x86inc' \
+ 'third_party/zlib/google' \
+ 'url/third_party/mozilla' \
+ 'v8/src/third_party/fdlibm' \
+ 'v8/src/third_party/valgrind' \
+ --do-remove || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=""
+
+ # Never tell the build system to "enable" SSE2, it has a few unexpected
+ # additions, bug #336871.
+ myconf+=" -Ddisable_sse2=1"
+
+ # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
+ myconf+=" -Ddisable_nacl=1"
+
+ # Disable glibc Native Client toolchain, we don't need it (bug #417019).
+ # myconf+=" -Ddisable_glibc=1"
+
+ # TODO: also build with pnacl
+ # myconf+=" -Ddisable_pnacl=1"
+
+ # It would be awkward for us to tar the toolchain and get it untarred again
+ # during the build.
+ # myconf+=" -Ddisable_newlib_untar=1"
+
+ # Make it possible to remove third_party/adobe.
+ echo > "${T}/flapper_version.h" || die
+ myconf+=" -Dflapper_version_h_file=${T}/flapper_version.h"
+
+ # Use system-provided libraries.
+ # TODO: use_system_hunspell (upstream changes needed).
+ # TODO: use_system_libsrtp (bug #459932).
+ # TODO: use_system_libusb (http://crbug.com/266149).
+ # TODO: use_system_libvpx (http://crbug.com/494939).
+ # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
+ # TODO: use_system_protobuf (bug #525560).
+ # TODO: use_system_ssl (http://crbug.com/58087).
+ # TODO: use_system_sqlite (http://crbug.com/22208).
+ myconf+="
+ -Duse_system_bzip2=1
+ -Duse_system_ffmpeg=$(usex system-ffmpeg 1 0)
+ -Duse_system_flac=1
+ -Duse_system_harfbuzz=1
+ -Duse_system_icu=1
+ -Duse_system_jsoncpp=1
+ -Duse_system_libevent=1
+ -Duse_system_libwebp=1
+ -Duse_system_libxml=1
+ -Duse_system_libxslt=1
+ -Duse_system_minizip=1
+ -Duse_system_nspr=1
+ -Duse_system_snappy=1
+ -Duse_system_speex=1
+ -Duse_system_xdg_utils=1
+ -Duse_system_zlib=1"
+
+ # Needed for system icu - we don't need additional data files.
+ myconf+=" -Dicu_use_data_file_flag=0"
+ myconf+=" -Dgenerate_character_data=0"
+
+ # TODO: patch gyp so that this arm conditional is not needed.
+ if ! use arm; then
+ myconf+="
+ -Duse_system_yasm=1"
+ fi
+
+ # Optional dependencies.
+ # TODO: linux_link_kerberos, bug #381289.
+ myconf+="
+ $(gyp_use cups)
+ $(gyp_use gnome use_gconf)
+ $(gyp_use gnome-keyring use_gnome_keyring)
+ $(gyp_use gnome-keyring linux_link_gnome_keyring)
+ $(gyp_use hidpi enable_hidpi)
+ $(gyp_use kerberos)
+ $(gyp_use lto)
+ $(gyp_use pulseaudio)
+ $(gyp_use tcmalloc use_allocator tcmalloc none)"
+
+ # Use explicit library dependencies instead of dlopen.
+ # This makes breakages easier to detect by revdep-rebuild.
+ myconf+="
+ -Dlinux_link_gsettings=1
+ -Dlinux_link_libpci=1
+ -Dlinux_link_libspeechd=1
+ -Dlibspeechd_h_prefix=speech-dispatcher/"
+
+ # TODO: use the file at run time instead of effectively compiling it in.
+ myconf+="
+ -Dusb_ids_path=/usr/share/misc/usb.ids"
+
+ # Save space by removing DLOG and DCHECK messages (about 6% reduction).
+ myconf+="
+ -Dlogging_like_official_build=1"
+
+ if [[ $(tc-getCC) == *clang* ]]; then
+ myconf+=" -Dclang=1"
+ else
+ myconf+=" -Dclang=0"
+ fi
+
+ # Never use bundled gold binary. Disable gold linker flags for now.
+ # Do not use bundled clang.
+ myconf+="
+ -Dclang_use_chrome_plugins=0
+ -Dhost_clang=0
+ -Dlinux_use_bundled_binutils=0
+ -Dlinux_use_bundled_gold=0
+ -Dlinux_use_gold_flags=0
+ -Dsysroot="
+
+ ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
+ myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
+
+ # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
+ # Note: these are for Gentoo use ONLY. For your own distribution,
+ # please get your own set of keys. Feel free to contact chromium@gentoo.org
+ # for more info.
+ local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
+ local google_default_client_id="329227923882.apps.googleusercontent.com"
+ local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
+ myconf+=" -Dgoogle_api_key=${google_api_key}
+ -Dgoogle_default_client_id=${google_default_client_id}
+ -Dgoogle_default_client_secret=${google_default_client_secret}"
+
+ local myarch="$(tc-arch)"
+ if [[ $myarch = amd64 ]] ; then
+ target_arch=x64
+ ffmpeg_target_arch=x64
+ elif [[ $myarch = x86 ]] ; then
+ target_arch=ia32
+ ffmpeg_target_arch=ia32
+ elif [[ $myarch = arm64 ]] ; then
+ target_arch=arm64
+ ffmpeg_target_arch=arm64
+ elif [[ $myarch = arm ]] ; then
+ target_arch=arm
+ ffmpeg_target_arch=$(usex neon arm-neon arm)
+ # TODO: re-enable NaCl (NativeClient).
+ local CTARGET=${CTARGET:-${CHOST}}
+ if [[ $(tc-is-softfloat) == "no" ]]; then
+
+ myconf_gyp+=" -Darm_float_abi=hard"
+ fi
+ filter-flags "-mfpu=*"
+ use neon || myconf_gyp+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
+
+ if [[ ${CTARGET} == armv[78]* ]]; then
+ myconf_gyp+=" -Darmv7=1"
+ else
+ myconf_gyp+=" -Darmv7=0"
+ fi
+ myconf_gyp+=" -Dsysroot=
+ $(gyp_use neon arm_neon)
+ -Ddisable_nacl=1"
+ else
+ die "Failed to determine target arch, got '$myarch'."
+ fi
+
+ myconf+=" -Dtarget_arch=${target_arch}"
+
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system.
+ # Depending on GCC version the warnings are different and we don't want
+ # the build to fail because of that.
+ myconf+=" -Dwerror="
+
+ # Disable fatal linker warnings, bug 506268.
+ myconf+=" -Ddisable_fatal_linker_warnings=1"
+
+ # Avoid CFLAGS problems, bug #352457, bug #390147.
+ if ! use custom-cflags; then
+ replace-flags "-Os" "-O2"
+ strip-flags
+
+ # Prevent linker from running out of address space, bug #471810 .
+ if use x86; then
+ filter-flags "-g*"
+ fi
+
+ # Prevent libvpx build failures. Bug 530248, 544702, 546984.
+ if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
+ filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 \
+ -mno-avx -mno-avx2
+ fi
+ fi
+
+ # Make sure the build system will use the right tools, bug #340795.
+ tc-export AR CC CXX NM
+
+ # Tools for building programs to be executed on the build system, bug #410883.
+ if tc-is-cross-compiler; then
+ export AR_host=$(tc-getBUILD_AR)
+ export CC_host=$(tc-getBUILD_CC)
+ export CXX_host=$(tc-getBUILD_CXX)
+ export NM_host=$(tc-getBUILD_NM)
+ fi
+
+ # Bug 491582.
+ export TMPDIR="${WORKDIR}/temp"
+ mkdir -p -m 755 "${TMPDIR}" || die
+
+ if ! use system-ffmpeg; then
+ local build_ffmpeg_args=""
+ if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
+ build_ffmpeg_args+=" --disable-asm"
+ fi
+
+ # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
+ einfo "Configuring bundled ffmpeg..."
+ pushd third_party/ffmpeg > /dev/null || die
+ chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
+ --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
+ chromium/scripts/copy_config.sh || die
+ chromium/scripts/generate_gyp.py || die
+ popd > /dev/null || die
+ fi
+
+ third_party/libaddressinput/chromium/tools/update-strings.py || die
+
+ touch chrome/test/data/webui/i18n_process_css_test.html || die
+
+ einfo "Configuring bundled nodejs..."
+ pushd vendor/node > /dev/null || die
+ # Make sure gyp_node does not run
+ echo '#!/usr/bin/env python' > tools/gyp_node.py || die
+ # --shared-libuv cannot be used as electron's node fork
+ # patches uv_loop structure.
+ ./configure --shared --without-bundled-v8 --shared-openssl \
+ --shared-http-parser --shared-zlib --without-npm \
+ --with-intl=system-icu --without-dtrace \
+ --dest-cpu=${target_arch} --prefix="" || die
+ popd > /dev/null || die
+
+ # libchromiumcontent configuration
+ myconf+=" -Dcomponent=static_library"
+ myconf+=" -Dmac_mas_build=0"
+ myconf+=' -Dicu_small="false"'
+ myconf+=" -Dlibchromiumcontent_component=0"
+ myconf+=" -Dlibrary=static_library"
+ myconf+=" -Dmas_build=0"
+
+ einfo "Configuring electron..."
+ build/linux/unbundle/replace_gyp_files.py ${myconf} || die
+
+ myconf+=" -Ivendor/node/config.gypi
+ -Icommon.gypi
+ electron.gyp"
+
+ egyp_chromium ${myconf} || die
+}
+
+eninja() {
+ if [[ -z ${NINJAOPTS+set} ]]; then
+ local jobs=$(makeopts_jobs)
+ local loadavg=$(makeopts_loadavg)
+
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+ NINJAOPTS+=" -j ${jobs}"
+ fi
+ if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
+ NINJAOPTS+=" -l ${loadavg}"
+ fi
+ fi
+ set -- ninja -v ${NINJAOPTS} "$@"
+ echo "$@"
+ "$@"
+}
+
+src_compile() {
+ local ninja_targets="electron" compile_target="out/R"
+
+ eninja -C ${compile_target} mksnapshot || die
+ pax-mark -m ${compile_target}/mksnapshot
+
+ eninja -C ${compile_target} nodebin || die
+ pax-mark -m ${compile_target}/nodebin
+
+ # Even though ninja autodetects number of CPUs, we respect
+ # user's options, for debugging with -j 1 or any other reason.
+ eninja -C ${compile_target} ${ninja_targets} || die
+}
+
+src_install() {
+ local install_dir="$(_get_install_dir)"
+ local install_suffix="$(_get_install_suffix)"
+ local LIBDIR="${ED}/usr/$(get_libdir)"
+
+ pushd out/R/locales > /dev/null || die
+ chromium_remove_language_paks
+ popd > /dev/null || die
+
+ # Install Electron
+ insinto "${install_dir}"
+ exeinto "${install_dir}"
+ newexe out/R/nodebin node
+ doexe out/R/electron
+ doins out/R/libv8.so
+ doins out/R/libnode.so
+ fperms +x "${install_dir}/libv8.so" "${install_dir}/libnode.so"
+ doins out/R/content_shell.pak
+ doins out/R/natives_blob.bin
+ doins out/R/snapshot_blob.bin
+ rm -r out/R/resources/inspector || die
+ doins -r out/R/resources
+ doins -r out/R/locales
+ dosym "${install_dir}/electron" "/usr/bin/electron${install_suffix}"
+
+ pax-mark -rm "${ED}/${install_dir}/electron"
+
+ # Install Node headers
+ HEADERS_ONLY=1 \
+ "${S}/vendor/node/tools/install.py" install "${ED}" "/usr" || die
+ # set up a symlink structure that npm expects..
+ dodir /usr/include/node/deps/{v8,uv}
+ dosym . /usr/include/node/src
+ for var in deps/{uv,v8}/include; do
+ dosym ../.. /usr/include/node/${var}
+ done
+
+ dodir "/usr/include/electron${install_suffix}"
+ mv "${ED}/usr/include/node" \
+ "${ED}/usr/include/electron${install_suffix}/node" || die
+}
+
+pkg_postinst() {
+ eselect electron update
+}
+
+pkg_prerm() {
+ eselect electron update
+}
diff --git a/dev-util/electron/electron-1.6.11-r1.ebuild b/dev-util/electron/electron-1.6.11-r1.ebuild
new file mode 100644
index 000000000000..7c2e7f50ae87
--- /dev/null
+++ b/dev-util/electron/electron-1.6.11-r1.ebuild
@@ -0,0 +1,885 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python2_7 )
+
+CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
+ hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
+ sv sw ta te th tr uk vi zh-CN zh-TW"
+
+inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib \
+ multiprocessing pax-utils portability python-any-r1 toolchain-funcs \
+ versionator virtualx xdg-utils
+
+# Keep this in sync with vendor/brightray/vendor/libchromiumcontent/VERSION
+CHROMIUM_VERSION="56.0.2924.87"
+# Keep this in sync with vendor/breakpad
+BREAKPAD_COMMIT="c566c50d81f7b1edeaee9f11f5d07bda858d6b64"
+# Keep this in sync with vendor/breakpad/src (and find the corresponding
+# commit in https://github.com/google/breakpad/)
+BREAKPAD_SRC_COMMIT="e35167de7516448fcc2bf687ad580b9d8b6aedc2"
+# Keep this in sync with vendor/brightray
+BRIGHTRAY_COMMIT="909c49265493bd095c27cefd999567be2107899a"
+# Keep this in sync with vendor/node
+NODE_COMMIT="9b1683e7000481ec6214eafa3eef7ac4594eb410"
+# Keep this in sync with vendor/native_mate
+NATIVE_MATE_COMMIT="fd0e7dc4ab778f0d1ccda6c9640464ea06ee771e"
+# Keep this in sync with vendor/pdf_viewer
+PDF_VIEWER_COMMIT="a050a339cfeabcfb5f07c313161d2ee27b6c3a39"
+# Keep this in sync with vendor/pdf_viewer/vendor/grit
+GRIT_COMMIT="9536fb6429147d27ef1563088341825db0a893cd"
+# Keep this in sync with script/lib/config.py:LIBCHROMIUMCONTENT_COMMIT
+LIBCHROMIUMCONTENT_COMMIT="e2ec6935fbf034207d5ad00fa905a4b2cdd60bb7"
+# Keep this in sync with package.json#devDependencies
+ASAR_VERSION="0.12.1"
+BROWSERIFY_VERSION="14.0.0"
+
+CHROMIUM_P="chromium-${CHROMIUM_VERSION}"
+BREAKPAD_P="chromium-breakpad-${BREAKPAD_COMMIT}"
+BREAKPAD_SRC_P="breakpad-${BREAKPAD_SRC_COMMIT}"
+BRIGHTRAY_P="brightray-${BRIGHTRAY_COMMIT}"
+NODE_P="node-${NODE_COMMIT}"
+NATIVE_MATE_P="native-mate-${NATIVE_MATE_COMMIT}"
+PDF_VIEWER_P="pdf-viewer-${PDF_VIEWER_COMMIT}"
+GRIT_P="grit-${GRIT_COMMIT}"
+LIBCHROMIUMCONTENT_P="libchromiumcontent-${LIBCHROMIUMCONTENT_COMMIT}"
+ASAR_P="asar-${ASAR_VERSION}"
+BROWSERIFY_P="browserify-${BROWSERIFY_VERSION}"
+
+DESCRIPTION="Cross platform application development framework based on web technologies"
+HOMEPAGE="http://electron.atom.io/"
+SRC_URI="
+ https://commondatastorage.googleapis.com/chromium-browser-official/${CHROMIUM_P}.tar.xz
+ https://github.com/electron/electron/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/electron/chromium-breakpad/archive/${BREAKPAD_COMMIT}.tar.gz -> electron-${BREAKPAD_P}.tar.gz
+ https://github.com/google/breakpad/archive/${BREAKPAD_SRC_COMMIT}.tar.gz -> electron-${BREAKPAD_SRC_P}.tar.gz
+ https://github.com/electron/brightray/archive/${BRIGHTRAY_COMMIT}.tar.gz -> electron-${BRIGHTRAY_P}.tar.gz
+ https://github.com/electron/node/archive/${NODE_COMMIT}.tar.gz -> electron-${NODE_P}.tar.gz
+ https://github.com/zcbenz/native-mate/archive/${NATIVE_MATE_COMMIT}.tar.gz -> electron-${NATIVE_MATE_P}.tar.gz
+ https://github.com/electron/pdf-viewer/archive/${PDF_VIEWER_COMMIT}.tar.gz -> electron-${PDF_VIEWER_P}.tar.gz
+ https://github.com/elprans/grit/archive/${GRIT_COMMIT}.tar.gz -> electron-${GRIT_P}.tar.gz
+ https://github.com/electron/libchromiumcontent/archive/${LIBCHROMIUMCONTENT_COMMIT}.tar.gz -> electron-${LIBCHROMIUMCONTENT_P}.tar.gz
+ https://github.com/elprans/asar/releases/download/v${ASAR_VERSION}-gentoo/asar-build.tar.gz -> ${ASAR_P}.tar.gz
+ https://github.com/elprans/node-browserify/releases/download/${BROWSERIFY_VERSION}-gentoo/browserify-build.tar.gz -> ${BROWSERIFY_P}.tar.gz
+"
+
+S="${WORKDIR}/${P}"
+CHROMIUM_S="${S}/chromium"
+NODE_S="${S}/vendor/node"
+BREAKPAD_S="${S}/vendor/breakpad"
+BREAKPAD_SRC_S="${BREAKPAD_S}/src"
+BRIGHTRAY_S="${S}/vendor/brightray"
+NATIVE_MATE_S="${S}/vendor/native_mate"
+PDF_VIEWER_S="${S}/vendor/pdf_viewer"
+GRIT_S="${PDF_VIEWER_S}/vendor/grit"
+LIBCC_S="${BRIGHTRAY_S}/vendor/libchromiumcontent"
+
+LICENSE="BSD"
+SLOT="$(get_version_component_range 1-2)"
+KEYWORDS="~amd64"
+IUSE="cups custom-cflags gnome gnome-keyring kerberos lto neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc"
+RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
+
+# Native Client binaries are compiled with different set of flags, bug #452066.
+QA_FLAGS_IGNORED=".*\.nexe"
+
+# Native Client binaries may be stripped by the build system, which uses the
+# right tools for it, bug #469144 .
+QA_PRESTRIPPED=".*\.nexe"
+
+COMMON_DEPEND="
+ app-arch/bzip2:=
+ >=app-eselect/eselect-electron-2.0
+ cups? ( >=net-print/cups-1.3.11:= )
+ >=dev-libs/elfutils-0.149
+ dev-libs/expat:=
+ dev-libs/glib:2
+ dev-libs/icu:=
+ >=dev-libs/jsoncpp-0.5.0-r1:=
+ dev-libs/nspr:=
+ >=dev-libs/nss-3.14.3:=
+ >=dev-libs/re2-0.2016.05.01:=
+ gnome? ( >=gnome-base/gconf-2.24.0:= )
+ gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
+ >=media-libs/alsa-lib-1.0.19:=
+ media-libs/fontconfig:=
+ media-libs/freetype:=
+ media-libs/libexif:=
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:=
+ media-libs/libvpx:=[svc]
+ media-libs/speex:=
+ pulseaudio? ( media-sound/pulseaudio:= )
+ system-ffmpeg? ( >=media-video/ffmpeg-3:= )
+ sys-apps/dbus:=
+ sys-apps/pciutils:=
+ >=sys-libs/libcap-2.22:=
+ virtual/udev
+ x11-libs/cairo:=
+ x11-libs/gdk-pixbuf:2
+ x11-libs/libdrm
+ x11-libs/libX11:=
+ x11-libs/libXcomposite:=
+ x11-libs/libXcursor:=
+ x11-libs/libXdamage:=
+ x11-libs/libXext:=
+ x11-libs/libXfixes:=
+ >=x11-libs/libXi-1.6.0:=
+ x11-libs/libXinerama:=
+ x11-libs/libXrandr:=
+ x11-libs/libXrender:=
+ x11-libs/libXScrnSaver:=
+ x11-libs/libXtst:=
+ x11-libs/pango:=
+ app-arch/snappy:=
+ dev-libs/libxml2:=[icu]
+ dev-libs/libxslt:=
+ media-libs/flac:=
+ >=media-libs/harfbuzz-1.3.1:=[icu(+)]
+ >=media-libs/libwebp-0.4.0:=
+ sys-libs/zlib:=[minizip]
+ kerberos? ( virtual/krb5 )
+"
+# For nvidia-drivers blocker, see bug #413637 .
+RDEPEND="${COMMON_DEPEND}
+ !<dev-util/electron-0.36.12-r4
+ x11-misc/xdg-utils
+ virtual/opengl
+ virtual/ttf-fonts
+ x11-libs/gtk+:2
+ selinux? ( sec-policy/selinux-chromium )
+ tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
+"
+# dev-vcs/git - https://bugs.gentoo.org/593476
+DEPEND="${COMMON_DEPEND}
+ >=app-arch/gzip-1.7
+ !arm? (
+ dev-lang/yasm
+ )
+ dev-lang/perl
+ dev-perl/JSON
+ >=dev-util/gperf-3.0.3
+ dev-util/ninja
+ sys-apps/hwids[usb(+)]
+ >=sys-devel/bison-2.4.3
+ sys-devel/flex
+ virtual/pkgconfig
+ dev-vcs/git
+ x11-libs/gtk+:2
+ x11-libs/gtk+:3
+ $(python_gen_any_dep '
+ dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
+ >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
+ dev-python/html5lib[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ ')
+"
+
+# Keep this in sync with the python_gen_any_dep call.
+python_check_deps() {
+ has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
+ has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
+ has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
+}
+
+if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
+ EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
+fi
+
+pre_build_checks() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ local -x CPP="$(tc-getCXX) -E"
+ if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
+ # bugs: #601654
+ die "At least clang 3.9.1 is required"
+ fi
+ if tc-is-gcc && ! version_is_at_least 4.9 "$(gcc-version)"; then
+ # bugs: #535730, #525374, #518668, #600288
+ die "At least gcc 4.9 is required"
+ fi
+ fi
+
+ # LTO pass requires more file descriptors
+ if use lto; then
+ local lto_n_rlimit_min="16384"
+ local maxfiles=$(ulimit -n -H)
+ if [ "${maxfiles}" -lt "${lto_n_rlimit_min}" ]; then
+ eerror ""
+ eerror "Building with USE=\"lto\" requires file descriptor" \
+ "limit to be no less than ${lto_n_rlimit_min}."
+ eerror "The current limit for portage is ${maxfiles}."
+ eerror "Please add the following to /etc/security/limits.conf:"
+ eerror ""
+ eerror " root hard nofile ${lto_n_rlimit_min}"
+ eerror " root soft nofile ${lto_n_rlimit_min}"
+ eerror ""
+ die
+ fi
+ fi
+
+ # Check build requirements, bug #541816 and bug #471810 .
+ CHECKREQS_MEMORY="3G"
+ use lto && CHECKREQS_MEMORY="7G"
+ CHECKREQS_DISK_BUILD="5G"
+ eshopts_push -s extglob
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ CHECKREQS_DISK_BUILD="25G"
+ CHECKREQS_MEMORY="16G"
+ fi
+ eshopts_pop
+ check-reqs_pkg_pretend
+}
+
+pkg_pretend() {
+ pre_build_checks
+}
+
+pkg_setup() {
+ pre_build_checks
+
+ # Make sure the build system will use the right python, bug #344367.
+ python-any-r1_pkg_setup
+
+ chromium_suid_sandbox_check_kernel_config
+}
+
+_unnest_patches() {
+ local _s="${1%/}/" relpath out
+
+ for f in $(find "${_s}" -mindepth 2 -name *.patch -printf \"%P\"\\n); do
+ relpath="$(dirname ${f})"
+ out="${_s}/${relpath////_}_$(basename ${f})"
+ sed -r -e "s|^([-+]{3}) (.*)$|\1 ${relpath}/\2 ${f}|g" > "${out}"
+ done
+}
+
+_get_install_suffix() {
+ local c=(${SLOT//\// })
+ local slot=${c[0]}
+ local suffix
+
+ if [[ "${slot}" == "0" ]]; then
+ suffix=""
+ else
+ suffix="-${slot}"
+ fi
+
+ echo -n "${suffix}"
+}
+
+_get_install_dir() {
+ echo -n "/usr/$(get_libdir)/electron$(_get_install_suffix)"
+}
+
+_get_target_arch() {
+ local myarch="$(tc-arch)"
+ local target_arch
+
+ if [[ $myarch = amd64 ]] ; then
+ target_arch=x64
+ elif [[ $myarch = x86 ]] ; then
+ target_arch=ia32
+ elif [[ $myarch = arm64 ]] ; then
+ target_arch=arm64
+ elif [[ $myarch = arm ]] ; then
+ target_arch=arm
+ else
+ die "Failed to determine target arch, got '$myarch'."
+ fi
+
+ echo -n "${target_arch}"
+}
+
+src_prepare() {
+ mv "${WORKDIR}/${CHROMIUM_P}" "${CHROMIUM_S}" || die
+ rm -r "${NODE_S}" &&
+ mv "${WORKDIR}/${NODE_P}" "${NODE_S}" || die
+ rm -r "${BREAKPAD_S}" &&
+ mv "${WORKDIR}/${BREAKPAD_P}" "${BREAKPAD_S}" || die
+ rm -r "${BREAKPAD_SRC_S}" &&
+ mv "${WORKDIR}/${BREAKPAD_SRC_P}/src" "${BREAKPAD_SRC_S}" || die
+ rm -r "${BRIGHTRAY_S}" &&
+ mv "${WORKDIR}/${BRIGHTRAY_P}" "${BRIGHTRAY_S}" || die
+ rm -r "${NATIVE_MATE_S}" &&
+ mv "${WORKDIR}/${NATIVE_MATE_P}" "${NATIVE_MATE_S}" || die
+ rm -r "${PDF_VIEWER_S}" &&
+ mv "${WORKDIR}/${PDF_VIEWER_P}" "${PDF_VIEWER_S}" || die
+ rm -r "${GRIT_S}" &&
+ mv "${WORKDIR}/${GRIT_P}" "${GRIT_S}" || die
+ rm -r "${LIBCC_S}" &&
+ mv "${WORKDIR}/${LIBCHROMIUMCONTENT_P}" "${LIBCC_S}" || die
+ rsync -a "${WORKDIR}/${ASAR_P}/node_modules/" \
+ "${S}/node_modules/" || die
+ rsync -a "${WORKDIR}/${BROWSERIFY_P}/node_modules/" \
+ "${S}/node_modules/" || die
+
+ # electron patches
+ cd "${ELECTRON_S}" || die
+ eapply "${FILESDIR}/${P}.patch"
+
+ # node patches
+ cd "${NODE_S}" || die
+ eapply "${FILESDIR}/${P}-vendor-node.patch"
+ eapply "${FILESDIR}/${PN}-vendor-node-external-snapshots-r2.patch"
+ # make sure node uses the correct version of v8
+ rm -r deps/v8 || die
+ ln -s "${CHROMIUM_S}/v8" deps/ || die
+
+ # make sure we use python2.* while using gyp
+ sed -i -e "s/python/${EPYTHON}/" \
+ deps/npm/node_modules/node-gyp/gyp/gyp || die
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" \
+ deps/npm/node_modules/node-gyp/lib/configure.js || die
+
+ python_fix_shebang "${CHROMIUM_S}/build/gyp_chromium"
+ python_fix_shebang "${S}/tools/"
+
+ # less verbose install output (stating the same as portage, basically)
+ sed -i -e "/print/d" tools/install.py || die
+
+ # proper libdir, hat tip @ryanpcmcquen
+ # https://github.com/iojs/io.js/issues/504
+ local LIBDIR=$(get_libdir)
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
+
+ # brightray patches
+ cd "${BRIGHTRAY_S}" || die
+ eapply "${FILESDIR}/${P}-vendor-brightray.patch"
+
+ # libchromiumcontent patches
+ cd "${LIBCC_S}" || die
+ eapply "${FILESDIR}/${P}-vendor-libchromiumcontent.patch"
+
+ # chromium patches
+ cd "${CHROMIUM_S}" || die
+
+ eapply "${FILESDIR}/chromium-FORTIFY_SOURCE.patch"
+ eapply "${FILESDIR}/chromium-glibc-2.24.patch"
+ eapply "${FILESDIR}/chromium-56-gcc4.patch"
+ eapply "${FILESDIR}/chromium-system-ffmpeg-r4.patch"
+ eapply "${FILESDIR}/chromium-disable-widevine.patch"
+ eapply "${FILESDIR}/chromium-remove-gardiner-mod-font-r1.patch"
+ eapply "${FILESDIR}/chromium-shared-v8-r2.patch"
+ eapply "${FILESDIR}/chromium-lto-fixes-r3.patch"
+
+ # libcc chromium patches
+ _unnest_patches "${LIBCC_S}/patches"
+
+ EPATCH_SOURCE="${LIBCC_S}/patches" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ EPATCH_EXCLUDE="third_party_icu*" \
+ EPATCH_MULTI_MSG="Applying libchromiumcontent patches..." \
+ epatch
+
+ # Merge chromiumcontent component into chromium source tree.
+ mkdir -p "${CHROMIUM_S}/chromiumcontent" || die
+ cp -a "${LIBCC_S}/chromiumcontent" "${CHROMIUM_S}/" || die
+ cp -a "${LIBCC_S}/tools/linux/" "${CHROMIUM_S}/tools/" || die
+
+ local keeplibs=(
+ base/third_party/dmg_fp
+ base/third_party/dynamic_annotations
+ base/third_party/icu
+ base/third_party/nspr
+ base/third_party/superfasthash
+ base/third_party/symbolize
+ base/third_party/valgrind
+ base/third_party/xdg_mime
+ base/third_party/xdg_user_dirs
+ breakpad/src/third_party/curl
+ chrome/third_party/mozilla_security_manager
+ courgette/third_party
+ net/third_party/mozilla_security_manager
+ net/third_party/nss
+ third_party/WebKit
+ third_party/analytics
+ third_party/angle
+ third_party/angle/src/common/third_party/numerics
+ third_party/angle/src/third_party/compiler
+ third_party/angle/src/third_party/libXNVCtrl
+ third_party/angle/src/third_party/murmurhash
+ third_party/angle/src/third_party/trace_event
+ third_party/boringssl
+ third_party/brotli
+ third_party/cacheinvalidation
+ third_party/catapult
+ third_party/catapult/third_party/polymer
+ third_party/catapult/third_party/py_vulcanize
+ third_party/catapult/third_party/py_vulcanize/third_party/rcssmin
+ third_party/catapult/third_party/py_vulcanize/third_party/rjsmin
+ third_party/catapult/tracing/third_party/d3
+ third_party/catapult/tracing/third_party/gl-matrix
+ third_party/catapult/tracing/third_party/jszip
+ third_party/catapult/tracing/third_party/mannwhitneyu
+ third_party/ced
+ third_party/cld_2
+ third_party/cld_3
+ third_party/cros_system_api
+ third_party/devscripts
+ third_party/dom_distiller_js
+ third_party/fips181
+ third_party/flatbuffers
+ third_party/flot
+ third_party/google_input_tools
+ third_party/google_input_tools/third_party/closure_library
+ third_party/google_input_tools/third_party/closure_library/third_party/closure
+ third_party/hunspell
+ third_party/iccjpeg
+ third_party/inspector_protocol
+ third_party/jinja2
+ third_party/jstemplate
+ third_party/khronos
+ third_party/leveldatabase
+ third_party/libXNVCtrl
+ third_party/libaddressinput
+ third_party/libjingle
+ third_party/libphonenumber
+ third_party/libsecret
+ third_party/libsrtp
+ third_party/libudev
+ third_party/libusb
+ third_party/libwebm
+ third_party/libxml/chromium
+ third_party/libyuv
+ third_party/lss
+ third_party/lzma_sdk
+ third_party/markupsafe
+ third_party/mesa
+ third_party/modp_b64
+ third_party/mt19937ar
+ third_party/openh264
+ third_party/openmax_dl
+ third_party/opus
+ third_party/ots
+ third_party/pdfium
+ third_party/pdfium/third_party/agg23
+ third_party/pdfium/third_party/base
+ third_party/pdfium/third_party/bigint
+ third_party/pdfium/third_party/freetype
+ third_party/pdfium/third_party/lcms2-2.6
+ third_party/pdfium/third_party/libjpeg
+ third_party/pdfium/third_party/libopenjpeg20
+ third_party/pdfium/third_party/libpng16
+ third_party/pdfium/third_party/libtiff
+ third_party/pdfium/third_party/zlib_v128
+ third_party/ply
+ third_party/polymer
+ third_party/protobuf
+ third_party/protobuf/third_party/six
+ third_party/qcms
+ third_party/sfntly
+ third_party/skia
+ third_party/smhasher
+ third_party/sqlite
+ third_party/tcmalloc
+ third_party/usrsctp
+ third_party/web-animations-js
+ third_party/webdriver
+ third_party/webrtc
+ third_party/widevine
+ third_party/woff2
+ third_party/x86inc
+ third_party/zlib/google
+ url/third_party/mozilla
+ v8/src/third_party/valgrind
+ v8/third_party/inspector_protocol
+
+ # gyp -> gn leftovers
+ base/third_party/libevent
+ third_party/adobe
+ third_party/speech-dispatcher
+ third_party/usb_ids
+ third_party/xdg-utils
+ third_party/yasm/run_yasm.py
+ )
+ if ! use system-ffmpeg; then
+ keeplibs+=( third_party/ffmpeg )
+ fi
+
+ # Remove most bundled libraries. Some are still needed.
+ build/linux/unbundle/remove_bundled_libraries.py \
+ "${keeplibs[@]}" --do-remove || die
+
+ cd "${S}" || die
+
+ eapply_user
+}
+
+src_configure() {
+ local myconf_gn=""
+ local myconf_gyp=""
+
+ cd "${CHROMIUM_S}" || die
+
+ # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
+ myconf_gn+=" is_debug=false"
+
+ # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
+ myconf_gn+=" enable_nacl=false"
+
+ # Use system-provided libraries.
+ # TODO: use_system_hunspell (upstream changes needed).
+ # TODO: use_system_libsrtp (bug #459932).
+ # TODO: use_system_libusb (http://crbug.com/266149).
+ # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
+ # TODO: use_system_protobuf (bug #525560).
+ # TODO: use_system_ssl (http://crbug.com/58087).
+ # TODO: use_system_sqlite (http://crbug.com/22208).
+
+ # libevent: https://bugs.gentoo.org/593458
+ local gn_system_libraries="
+ flac
+ harfbuzz-ng
+ icu
+ libjpeg
+ libpng
+ libvpx
+ libwebp
+ libxml
+ libxslt
+ re2
+ snappy
+ yasm
+ zlib"
+ if use system-ffmpeg; then
+ gn_system_libraries+=" ffmpeg"
+ fi
+ build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries} || die
+
+ # Optional dependencies.
+ myconf_gn+=" use_cups=$(usex cups true false)"
+ myconf_gn+=" use_gconf=$(usex gnome true false)"
+ myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
+ myconf_gn+=" use_gtk3=false"
+ myconf_gn+=" use_kerberos=$(usex kerberos true false)"
+ myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
+
+ # TODO: link_pulseaudio=true for GN.
+
+ myconf_gn+=" fieldtrial_testing_like_official_build=true"
+
+ if tc-is-clang; then
+ myconf_gn+=" is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false"
+ else
+ myconf_gn+=" is_clang=false"
+ fi
+
+ # Never use bundled gold binary. Disable gold linker flags for now.
+ # Do not use bundled clang.
+ # Trying to use gold results in linker crash.
+ myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false"
+
+ ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
+ myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
+ myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
+
+ # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
+ # Note: these are for Gentoo use ONLY. For your own distribution,
+ # please get your own set of keys. Feel free to contact chromium@gentoo.org
+ # for more info.
+ local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
+ local google_default_client_id="329227923882.apps.googleusercontent.com"
+ local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
+ myconf_gn+=" google_api_key=\"${google_api_key}\""
+ myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
+ myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
+
+ local target_arch=$(_get_target_arch)
+ local ffmpeg_target_arch="${target_arch}"
+
+ if [[ ${ffmpeg_target_arch} = arm ]]; then
+ ffmpeg_target_arch=$(usex neon arm-neon arm)
+ fi
+
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system.
+ # Depending on GCC version the warnings are different and we don't want
+ # the build to fail because of that.
+ myconf_gn+=" treat_warnings_as_errors=false"
+
+ # Disable fatal linker warnings, bug 506268.
+ myconf_gn+=" fatal_linker_warnings=false"
+
+ # Avoid CFLAGS problems, bug #352457, bug #390147.
+ if ! use custom-cflags; then
+ replace-flags "-Os" "-O2"
+ strip-flags
+
+ filter-flags "-Wl,--as-needed"
+
+ # Prevent linker from running out of address space, bug #471810 .
+ if use x86; then
+ filter-flags "-g*"
+ fi
+
+ # Prevent libvpx build failures. Bug 530248, 544702, 546984.
+ if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
+ filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
+ fi
+ fi
+
+ # Make sure the build system will use the right tools, bug #340795.
+ tc-export AR CC CXX NM
+
+ # https://bugs.gentoo.org/588596
+ append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
+
+ # Define a custom toolchain for GN
+ myconf_gn+=" custom_toolchain=\"${FILESDIR}/toolchain:default\""
+
+ use lto && myconf_gn+=" allow_posix_link_time_opt=true"
+
+ # Tools for building programs to be executed on the build system, bug #410883.
+ if tc-is-cross-compiler; then
+ export AR_host=$(tc-getBUILD_AR)
+ export CC_host=$(tc-getBUILD_CC)
+ export CXX_host=$(tc-getBUILD_CXX)
+ export NM_host=$(tc-getBUILD_NM)
+ fi
+
+ # Bug 491582.
+ export TMPDIR="${WORKDIR}/temp"
+ mkdir -p -m 755 "${TMPDIR}" || die
+
+ if ! use system-ffmpeg; then
+ local build_ffmpeg_args=""
+ if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
+ build_ffmpeg_args+=" --disable-asm"
+ fi
+
+ # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
+ einfo "Configuring bundled ffmpeg..."
+ pushd third_party/ffmpeg > /dev/null || die
+ chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
+ --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
+ chromium/scripts/copy_config.sh || die
+ chromium/scripts/generate_gn.py || die
+ popd > /dev/null || die
+ fi
+
+ third_party/libaddressinput/chromium/tools/update-strings.py || die
+
+ touch chrome/test/data/webui/i18n_process_css_test.html || die
+
+ einfo "Configuring bundled nodejs..."
+ pushd "${S}/vendor/node" > /dev/null || die
+ # Make sure gyp_node does not run
+ echo '#!/usr/bin/env python' > tools/gyp_node.py || die
+ # --shared-libuv cannot be used as electron's node fork
+ # patches uv_loop structure.
+ ./configure --shared --without-bundled-v8 --shared-openssl \
+ --shared-http-parser --shared-zlib --without-npm \
+ --with-intl=system-icu --without-dtrace \
+ --dest-cpu=${target_arch} --prefix="" || die
+ popd > /dev/null || die
+
+ # libchromiumcontent configuration
+ myconf_gn+=" root_extra_deps = [\"//chromiumcontent:chromiumcontent\"]"
+ myconf_gn+=" is_electron_build = true"
+ myconf_gn+=" is_component_build = false"
+
+ einfo "Configuring chromiumcontent..."
+ # TODO: bootstrapped gn binary hangs when using tcmalloc with portage's sandbox.
+ tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${myconf_gn} use_allocator=\"none\"" || die
+ # Remove the glibc allocator shim so that it doesn't get picked up
+ # by Electron's build_libs script.
+ rm out/Release/obj/base/allocator/unified_allocator_shim/allocator_shim_default_dispatch_to_glibc.o || die
+
+ myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
+ out/Release/gn gen --args="${myconf_gn}" out/Release || die
+
+ cd "${S}" || die
+}
+
+eninja() {
+ if [[ -z ${NINJAOPTS+set} ]]; then
+ local jobs=$(makeopts_jobs)
+ local loadavg=$(makeopts_loadavg)
+
+ if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
+ NINJAOPTS+=" -j ${jobs}"
+ fi
+ if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
+ NINJAOPTS+=" -l ${loadavg}"
+ fi
+ fi
+ set -- ninja -v ${NINJAOPTS} "$@"
+ echo "$@"
+ "$@" || die
+}
+
+src_compile() {
+ local compile_target="${S}/out/R"
+ local myconf_gyp=""
+ local chromium_target="${CHROMIUM_S}/out/Release"
+ local libcc_path="${S}/vendor/brightray/vendor/libchromiumcontent"
+ local libcc_dist_path="${libcc_path}/dist/main"
+ local libcc_dist_static_path="${libcc_dist_path}/static_library"
+ local libcc_dist_shared_path="${libcc_dist_path}/shared_library"
+ local libcc_output="${CHROMIUM_S}/out/Release/obj/chromiumcontent"
+ local libcc_output_shared="${libcc_output}-shared"
+ local target_arch=$(_get_target_arch)
+
+ tc-export AR CC CXX NM
+
+ mkdir -p "${compile_target}" || die
+
+ cd "${CHROMIUM_S}" || die
+
+ # Build mksnapshot and pax-mark it.
+ eninja -C "${chromium_target}" mksnapshot || die
+ pax-mark m "${chromium_target}/mksnapshot"
+
+ # Build chromedriver.
+ eninja -C "${chromium_target}" chromedriver
+ cp -a "${chromium_target}/chromedriver" "${compile_target}/" || die
+
+ # Build libchromiumcontent components.
+ eninja -C "${chromium_target}" chromiumcontent:chromiumcontent
+
+ cd "${S}" || die
+
+ # Gather and prepare built components of libchromiumcontent.
+ CHROMIUM_BUILD_DIR="${chromium_target}" \
+ python2 "${libcc_path}"/script/create-dist \
+ --target_arch=${target_arch} \
+ --component=static_library \
+ --no_zip || die
+
+ # v8 is built as a shared library, so copy it manually
+ # for generate_filenames_gypi to find.
+ mkdir -p "${libcc_dist_shared_path}" || die
+ cp "${chromium_target}/libv8.so" "${libcc_dist_shared_path}" || die
+
+ python2 "${libcc_path}"/tools/generate_filenames_gypi.py \
+ "${libcc_dist_path}/filenames.gypi" \
+ "${CHROMIUM_S}" \
+ "${libcc_dist_shared_path}" \
+ "${libcc_dist_static_path}"
+
+ # Configure electron.
+ myconf_gyp+="
+ $(gyp_use cups)
+ $(gyp_use gnome use_gconf)
+ $(gyp_use gnome-keyring use_gnome_keyring)
+ $(gyp_use gnome-keyring linux_link_gnome_keyring)
+ $(gyp_use lto)"
+
+ if [[ $(tc-getCC) == *clang* ]]; then
+ myconf_gyp+=" -Dclang=1"
+ else
+ myconf_gyp+=" -Dclang=0"
+ fi
+
+ # Never use bundled gold binary. Disable gold linker flags for now.
+ # Do not use bundled clang.
+ myconf_gyp+="
+ -Dclang_use_chrome_plugins=0
+ -Dhost_clang=0
+ -Dlinux_use_bundled_binutils=0
+ -Dlinux_use_bundled_gold=0
+ -Dlinux_use_gold_flags=0
+ -Dsysroot="
+
+ myconf_gyp+=" -Dtarget_arch=${target_arch}"
+
+ # Make sure that -Werror doesn't get added to CFLAGS by the build system.
+ # Depending on GCC version the warnings are different and we don't want
+ # the build to fail because of that.
+ myconf_gyp+=" -Dwerror="
+
+ # Disable fatal linker warnings, bug 506268.
+ myconf_gyp+=" -Ddisable_fatal_linker_warnings=1"
+
+ # Needed for system icu - we don't need additional data files.
+ myconf_gyp+=" -Dicu_use_data_file_flag=0"
+ myconf_gyp+=" -Dgenerate_character_data=0"
+
+ myconf_gyp+=" -Dlibchromiumcontent_component=0"
+ myconf_gyp+=" -Dcomponent=static_library"
+ myconf_gyp+=" -Dlibrary=static_library"
+ myconf_gyp+=" -Ivendor/node/config.gypi -Icommon.gypi electron.gyp"
+
+ EGYP_CHROMIUM_COMMAND="${CHROMIUM_S}/build/gyp_chromium" \
+ egyp_chromium ${myconf_gyp} || die
+
+ # Copy libv8 and snapshot files so the node binary can find them.
+ mkdir -p "${compile_target}/lib/" || die
+ cp "${chromium_target}/libv8.so" "${compile_target}/lib/" || die
+ cp "${chromium_target}/natives_blob.bin" "${compile_target}" || die
+ cp "${chromium_target}/snapshot_blob.bin" "${compile_target}" || die
+
+ # Copy generated shim headers.
+ mkdir -p "${compile_target}/gen" || die
+ cp -r "${chromium_target}/gen/shim_headers" \
+ "${compile_target}/gen" || die
+
+ # Build the Node binary and pax-mark it.
+ eninja -C ${compile_target} nodebin
+ pax-mark m ${compile_target}/nodebin
+
+ # Finally, build Electron.
+ eninja -C ${compile_target} electron
+ pax-mark m ${compile_target}/electron
+
+ echo "v${PV}" > ${compile_target}/version
+}
+
+src_install() {
+ local install_dir="$(_get_install_dir)"
+ local install_suffix="$(_get_install_suffix)"
+ local LIBDIR="${ED}/usr/$(get_libdir)"
+
+ pushd out/R/locales > /dev/null || die
+ chromium_remove_language_paks
+ popd > /dev/null || die
+
+ # Install Electron
+ insinto "${install_dir}"
+ exeinto "${install_dir}"
+ newexe out/R/nodebin node
+ doexe out/R/electron
+ doexe out/R/chromedriver
+ doins out/R/libv8.so
+ doins out/R/libnode.so
+ fperms +x "${install_dir}/libv8.so" "${install_dir}/libnode.so"
+ doins out/R/natives_blob.bin
+ doins out/R/snapshot_blob.bin
+ doins out/R/blink_image_resources_200_percent.pak
+ doins out/R/content_resources_200_percent.pak
+ doins out/R/content_shell.pak
+ doins out/R/pdf_viewer_resources.pak
+ doins out/R/ui_resources_200_percent.pak
+ doins out/R/views_resources_200_percent.pak
+ doins -r out/R/resources
+ doins -r out/R/locales
+ dosym "${install_dir}/electron" "/usr/bin/electron${install_suffix}"
+
+ doins out/R/version
+
+ # Install Node headers
+ HEADERS_ONLY=1 \
+ "${S}/vendor/node/tools/install.py" install "${ED}" "/usr" || die
+ # set up a symlink structure that npm expects..
+ dodir /usr/include/node/deps/{v8,uv}
+ dosym . /usr/include/node/src
+ for var in deps/{uv,v8}/include; do
+ dosym ../.. /usr/include/node/${var}
+ done
+
+ dodir "/usr/include/electron${install_suffix}"
+ mv "${ED}/usr/include/node" \
+ "${ED}/usr/include/electron${install_suffix}/node" || die
+}
+
+pkg_postinst() {
+ electron-config update
+}
+
+pkg_postrm() {
+ electron-config update
+}
diff --git a/dev-util/electron/files/chromium-56-gcc4.patch b/dev-util/electron/files/chromium-56-gcc4.patch
new file mode 100644
index 000000000000..e3188668ce5a
--- /dev/null
+++ b/dev-util/electron/files/chromium-56-gcc4.patch
@@ -0,0 +1,48 @@
+From 888874f761fdd69bb9448b3905627289b5fd66dd Mon Sep 17 00:00:00 2001
+From: floppymaster <floppymaster@gmail.com>
+Date: Thu, 19 Jan 2017 20:20:45 -0800
+Subject: [PATCH] Allow GCC 4.9 to compile Chromium
+
+In order to implicit cast an lvalue to an rvalue when returning
+from a function, the return type and type of variable in the return
+statement previously had to be exactly the same. When this was not
+the case, std::move was required. For instance, when returning a
+std::unique_ptr<Derived> variable in a function with a
+std::unique_ptr<Base> return type, std::move is required.
+
+DR 1579 changed this, and allows for implicitly converting
+to the return type, if the return type has a constructor(T&&), where
+T is the type of the local variable being returned. DR 1579 was
+implemented in GCC 5, but not in GCC 4.9 and below. By explicitly
+qualifying the local variable with std::move, we allow for compiling
+with GCC 4.9 and incur no performance penalty. The code is still
+absolutely correct to the word of C++11.
+
+BUG=chromium:682965
+
+See also:
+* https://bugs.gentoo.org/show_bug.cgi?id=600288
+* https://stackoverflow.com/questions/22018115/converting-stdunique-ptrderived-to-stdunique-ptrbase#comment33375875_22018521
+* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3833.html#1579
+
+Review-Url: https://codereview.webrtc.org/2642053003
+Cr-Commit-Position: refs/heads/master@{#16175}
+---
+ AUTHORS | 1 +
+ webrtc/modules/desktop_capture/screen_capturer_x11.cc | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc
++++ b/third_party/webrtc/modules/desktop_capture/screen_capturer_x11.cc
+@@ -412,7 +412,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
+ return nullptr;
+ }
+
+- return capturer;
++ return std::move(capturer);
+ }
+
+ } // namespace webrtc
+--
+2.11.0
+
diff --git a/dev-util/electron/files/chromium-FORTIFY_SOURCE.patch b/dev-util/electron/files/chromium-FORTIFY_SOURCE.patch
new file mode 100644
index 000000000000..c6477d690872
--- /dev/null
+++ b/dev-util/electron/files/chromium-FORTIFY_SOURCE.patch
@@ -0,0 +1,27 @@
+Drop _FORTIFY_SOURCE=2 from defines
+
+Gentoo toolchains enable this by default. Removing this prevents spammy
+warnings about the macro being redefined.
+
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -1069,19 +1069,6 @@ config("chromium_code") {
+ "__STDC_FORMAT_MACROS",
+ ]
+
+- if (!is_debug && !using_sanitizer &&
+- (!is_linux || !is_clang || is_official_build)) {
+- # _FORTIFY_SOURCE isn't really supported by Clang now, see
+- # http://llvm.org/bugs/show_bug.cgi?id=16821.
+- # It seems to work fine with Ubuntu 12 headers though, so use it in
+- # official builds.
+- #
+- # Non-chromium code is not guaranteed to compile cleanly with
+- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
+- # disabled, so only do that for Release build.
+- defines += [ "_FORTIFY_SOURCE=2" ]
+- }
+-
+ if (is_mac || is_ios) {
+ cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
+ cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
diff --git a/dev-util/electron/files/chromium-cups-fix.patch b/dev-util/electron/files/chromium-cups-fix.patch
new file mode 100644
index 000000000000..bbd462a8081e
--- /dev/null
+++ b/dev-util/electron/files/chromium-cups-fix.patch
@@ -0,0 +1,12 @@
+index 8bacfd7..b469a1c 100644
+--- a/printing/backend/print_backend_cups.cc
++++ b/printing/backend/print_backend_cups.cc
+
+@@ -4,6 +4,7 @@
+
+ #include "printing/backend/print_backend_cups.h"
+
++#include <cups/ppd.h>
+ #include <dlfcn.h>
+ #include <errno.h>
+ #include <pthread.h>
diff --git a/dev-util/electron/files/chromium-disable-widevine.patch b/dev-util/electron/files/chromium-disable-widevine.patch
new file mode 100644
index 000000000000..5b166463c88c
--- /dev/null
+++ b/dev-util/electron/files/chromium-disable-widevine.patch
@@ -0,0 +1,9 @@
+--- a/third_party/widevine/cdm/stub/widevine_cdm_version.h
++++ b/third_party/widevine/cdm/stub/widevine_cdm_version.h
+@@ -10,6 +10,5 @@
+
+ #include "third_party/widevine/cdm/widevine_cdm_common.h"
+
+-#define WIDEVINE_CDM_AVAILABLE
+
+ #endif // WIDEVINE_CDM_VERSION_H_
diff --git a/dev-util/electron/files/chromium-ffmpeg-license-r0.patch b/dev-util/electron/files/chromium-ffmpeg-license-r0.patch
new file mode 100644
index 000000000000..8e44cbdbb0ac
--- /dev/null
+++ b/dev-util/electron/files/chromium-ffmpeg-license-r0.patch
@@ -0,0 +1,44 @@
+From 3c9d5afe45bf1c4656b8f630525433f29017cd08 Mon Sep 17 00:00:00 2001
+From: Chris Cunningham <chcunningham@chromium.org>
+Date: Tue, 21 Jun 2016 10:52:45 -0700
+Subject: [PATCH] Avoid ffmpeg licences/credits checking generated autorename_ files.
+
+We generated these renames as a fix for http://crbug.com/495833. The
+generated rename contains no license or credits info and should be
+skipped to avoid confusing license/credits scripts. Care must be
+taken to not also skip the underlying include file from upstream ffmpeg.
+
+Found by: Zoltan Kuscsik
+
+BUG=495833
+
+Change-Id: I3359f4de0281b5f057d4b109ab2a4f31895b5cb1
+---
+
+diff --git a/chromium/scripts/generate_gyp.py b/chromium/scripts/generate_gyp.py
+index c3fd3c0..94c2aad 100755
+--- a/third_party/ffmpeg/chromium/scripts/generate_gyp.py
++++ b/third_party/ffmpeg/chromium/scripts/generate_gyp.py
+@@ -790,6 +790,9 @@
+ # Prefix added to renamed files as part of
+ RENAME_PREFIX = 'autorename'
+
++# Match an absolute path to a generated auotorename_ file.
++RENAME_REGEX = re.compile('.*' + RENAME_PREFIX + '_.+');
++
+ # Content for the rename file. #includes the original file to ensure the two
+ # files stay in sync.
+ RENAME_CONTENT = """// File automatically generated. See crbug.com/495833.
+@@ -1020,6 +1023,12 @@
+ for source in source_set.sources:
+ GetIncludedSources(source, source_dir, sources_to_check)
+
++ # Remove autorename_ files now that we've grabbed their underlying includes.
++ # We generated autorename_ files above and should not consider them for
++ # licensing or credits.
++ sources_to_check = filter(lambda s: not RENAME_REGEX.search(s),
++ sources_to_check)
++
+ if not CheckLicensesForStaticLinking(sources_to_check, source_dir,
+ options.print_licenses):
+ exit('GENERATE FAILED: invalid licenses detected.')
diff --git a/dev-util/electron/files/chromium-glibc-2.24.patch b/dev-util/electron/files/chromium-glibc-2.24.patch
new file mode 100644
index 000000000000..f7bfd816433f
--- /dev/null
+++ b/dev-util/electron/files/chromium-glibc-2.24.patch
@@ -0,0 +1,15 @@
+--- a/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp.orig 2017-01-05 20:50:56.329369189 +0000
++++ b/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp 2017-01-05 20:51:32.926099779 +0000
+@@ -242,6 +242,12 @@
+ ASSERT(!(len & kSystemPageOffsetMask));
+ #if OS(POSIX)
+ int ret = madvise(addr, len, MADV_FREE);
++ if (ret != 0 && errno == EINVAL) {
++ // MADV_FREE only works on Linux 4.5+ . If request failed,
++ // retry with older MADV_DONTNEED . Note that MADV_FREE
++ // being defined at compile time doesn't imply runtime support.
++ ret = madvise(addr, len, MADV_DONTNEED);
++ }
+ RELEASE_ASSERT(!ret);
+ #else
+ setSystemPagesInaccessible(addr, len);
diff --git a/dev-util/electron/files/chromium-icu-58-r0.patch b/dev-util/electron/files/chromium-icu-58-r0.patch
new file mode 100644
index 000000000000..ca402f6e4a89
--- /dev/null
+++ b/dev-util/electron/files/chromium-icu-58-r0.patch
@@ -0,0 +1,51 @@
+--- a/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp.orig 2016-11-11 13:21:19.747054059 -0500
++++ b/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp 2016-11-11 13:24:34.474939062 -0500
+@@ -26,6 +26,9 @@
+ #include "wtf/StdLibExtras.h"
+ #include "wtf/text/CharacterNames.h"
+
++#include <unicode/uchar.h>
++#include <unicode/uvernum.h>
++
+ namespace blink {
+
+ unsigned numGraphemeClusters(const String& string)
+@@ -122,13 +125,19 @@
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // DEL
+ };
+
++#if U_ICU_VERSION_MAJOR_NUM >= 58
++#define BA_LB_COUNT (U_LB_COUNT - 3)
++#else
++#define BA_LB_COUNT U_LB_COUNT
++#endif
++
+ // Line breaking table for CSS word-break: break-all. This table differs from
+ // asciiLineBreakTable in:
+ // - Indices are Line Breaking Classes defined in UAX#14 Unicode Line Breaking
+ // Algorithm: http://unicode.org/reports/tr14/#DescriptionOfProperties
+ // - 1 indicates additional break opportunities. 0 indicates to fallback to
+ // normal line break, not "prohibit break."
+-static const unsigned char breakAllLineBreakClassTable[][U_LB_COUNT / 8 + 1] = {
++static const unsigned char breakAllLineBreakClassTable[][BA_LB_COUNT / 8 + 1] = {
+ // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AI
+@@ -178,7 +187,7 @@
+ #undef AL
+
+ static_assert(WTF_ARRAY_LENGTH(asciiLineBreakTable) == asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar + 1, "asciiLineBreakTable should be consistent");
+-static_assert(WTF_ARRAY_LENGTH(breakAllLineBreakClassTable) == U_LB_COUNT, "breakAllLineBreakClassTable should be consistent");
++static_assert(WTF_ARRAY_LENGTH(breakAllLineBreakClassTable) == BA_LB_COUNT, "breakAllLineBreakClassTable should be consistent");
+
+ static inline bool shouldBreakAfter(UChar lastCh, UChar ch, UChar nextCh)
+ {
+@@ -209,7 +218,7 @@
+
+ static inline bool shouldBreakAfterBreakAll(ULineBreak lastLineBreak, ULineBreak lineBreak)
+ {
+- if (lineBreak >= 0 && lineBreak < U_LB_COUNT && lastLineBreak >= 0 && lastLineBreak < U_LB_COUNT) {
++ if (lineBreak >= 0 && lineBreak < BA_LB_COUNT && lastLineBreak >= 0 && lastLineBreak < BA_LB_COUNT) {
+ const unsigned char* tableRow = breakAllLineBreakClassTable[lastLineBreak];
+ return tableRow[lineBreak / 8] & (1 << (lineBreak % 8));
+ }
diff --git a/dev-util/electron/files/chromium-icu-58-r1.patch b/dev-util/electron/files/chromium-icu-58-r1.patch
new file mode 100644
index 000000000000..9e6e5fd72d70
--- /dev/null
+++ b/dev-util/electron/files/chromium-icu-58-r1.patch
@@ -0,0 +1,128 @@
+From 424584b4984bde7c831f42e9fb47f1ad583a1c46 Mon Sep 17 00:00:00 2001
+From: jshin <jshin@chromium.org>
+Date: Fri, 21 Oct 2016 01:15:50 -0700
+Subject: [PATCH] Update aspirational_scripts per Unicode 9
+
+This is a preparation to update ICU to 58.1.
+Without this change, ICU update CL cannot be tested on
+trybots because a compile will fail due to '#error' checking
+if ICU version is less than 58.
+
+BUG=637001
+TEST=None
+TBR=pkasting@chromium.org
+
+Review-Url: https://chromiumcodereview.appspot.com/2436113003
+Cr-Commit-Position: refs/heads/master@{#426749}
+---
+ components/url_formatter/url_formatter.cc | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
+index 4455db3..2b82c0c 100644
+--- a/components/url_formatter/url_formatter.cc
++++ b/components/url_formatter/url_formatter.cc
+@@ -431,7 +431,7 @@
+ // are added to the allowed set. The list has to be updated when a new
+ // version of Unicode is released. The current version is 8.0.0 and ICU 58
+ // will have Unicode 9.0 data.
+-#if U_ICU_VERSION_MAJOR_NUM < 58
++#if U_ICU_VERSION_MAJOR_NUM < 60
+ const icu::UnicodeSet aspirational_scripts(
+ icu::UnicodeString(
+ // Unified Canadian Syllabics
+@@ -445,13 +445,13 @@
+ // Yi
+ "\\uA000-\\uA48C"
+ // Miao
+- "\\U00016F00-\\U00016F44\\U00016F50-\\U00016F7F"
++ "\\U00016F00-\\U00016F44\\U00016F50-\\U00016F7E"
+ "\\U00016F8F-\\U00016F9F]",
+ -1, US_INV),
+ *status);
+ allowed_set.addAll(aspirational_scripts);
+ #else
+-#error "Update aspirational_scripts per Unicode 9.0"
++#error "Update aspirational_scripts per Unicode 10.0"
+ #endif
+
+ // U+0338 is included in the recommended set, while U+05F4 and U+2027 are in
+--
+2.10.2
+
+From e60b571faa3f14dd9119a6792dccf12f8bf80192 Mon Sep 17 00:00:00 2001
+From: jshin <jshin@chromium.org>
+Date: Fri, 21 Oct 2016 12:20:05 -0700
+Subject: [PATCH] Prepare to upgrade ICU to 58 part 2
+
+U_LB_COUNT is assumed to be 40 in Blink line breaking code, but it's
+43 in ICU 58/Unicode 9.
+
+Three new classes (Emoji Base, Emoji Modifier, and ZWJ) should behave
+identically whether or not 'word-break: break-all' is in effect.
+
+BUG=637001
+TEST=TextBreakIterator.cpp is compiled without an error with ICU 58.
+R=kojii@chromium.org
+CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
+
+Review-Url: https://chromiumcodereview.appspot.com/2440923002
+Cr-Commit-Position: refs/heads/master@{#426860}
+---
+ .../WebKit/Source/platform/text/TextBreakIterator.cpp | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp b/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp
+index 568dc0a..36121eb 100644
+--- a/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp
++++ b/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp
+@@ -27,6 +27,9 @@
+ #include "wtf/StdLibExtras.h"
+ #include "wtf/text/CharacterNames.h"
+
++#include <unicode/uchar.h>
++#include <unicode/uvernum.h>
++
+ namespace blink {
+
+ unsigned numGraphemeClusters(const String& string)
+@@ -123,13 +126,18 @@
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0) }, // DEL
+ };
+
++#if U_ICU_VERSION_MAJOR_NUM >= 58
++#define BA_LB_COUNT (U_LB_COUNT - 3)
++#else
++#define BA_LB_COUNT U_LB_COUNT
++#endif
+ // Line breaking table for CSS word-break: break-all. This table differs from
+ // asciiLineBreakTable in:
+ // - Indices are Line Breaking Classes defined in UAX#14 Unicode Line Breaking
+ // Algorithm: http://unicode.org/reports/tr14/#DescriptionOfProperties
+ // - 1 indicates additional break opportunities. 0 indicates to fallback to
+ // normal line break, not "prohibit break."
+-static const unsigned char breakAllLineBreakClassTable[][U_LB_COUNT / 8 + 1] = {
++static const unsigned char breakAllLineBreakClassTable[][BA_LB_COUNT / 8 + 1] = {
+ // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI
+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX
+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AI
+@@ -179,7 +187,7 @@
+ #undef AL
+
+ static_assert(WTF_ARRAY_LENGTH(asciiLineBreakTable) == asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar + 1, "asciiLineBreakTable should be consistent");
+-static_assert(WTF_ARRAY_LENGTH(breakAllLineBreakClassTable) == U_LB_COUNT, "breakAllLineBreakClassTable should be consistent");
++static_assert(WTF_ARRAY_LENGTH(breakAllLineBreakClassTable) == BA_LB_COUNT, "breakAllLineBreakClassTable should be consistent");
+
+ static inline bool shouldBreakAfter(UChar lastCh, UChar ch, UChar nextCh)
+ {
+@@ -210,7 +218,7 @@
+
+ static inline bool shouldBreakAfterBreakAll(ULineBreak lastLineBreak, ULineBreak lineBreak)
+ {
+- if (lineBreak >= 0 && lineBreak < U_LB_COUNT && lastLineBreak >= 0 && lastLineBreak < U_LB_COUNT) {
++ if (lineBreak >= 0 && lineBreak < BA_LB_COUNT && lastLineBreak >= 0 && lastLineBreak < BA_LB_COUNT) {
+ const unsigned char* tableRow = breakAllLineBreakClassTable[lastLineBreak];
+ return tableRow[lineBreak / 8] & (1 << (lineBreak % 8));
+ }
+--
+2.10.2
diff --git a/dev-util/electron/files/chromium-jinja-fix.patch b/dev-util/electron/files/chromium-jinja-fix.patch
new file mode 100644
index 000000000000..83ac33be31b6
--- /dev/null
+++ b/dev-util/electron/files/chromium-jinja-fix.patch
@@ -0,0 +1,24 @@
+--- a/third_party/WebKit/Source/platform/v8_inspector/v8_inspector.gyp
+--- b/third_party/WebKit/Source/platform/v8_inspector/v8_inspector.gyp
+@@ -53,21 +53,10 @@
+ 'type': 'none',
+ 'dependencies': ['protocol_version'],
+ 'variables': {
+- 'conditions': [
+- ['debug_devtools=="node"', {
+- # Node build
+- 'jinja_module_files': [
+- '../../deps/jinja2/jinja2/__init__.py',
+- '../../deps/markupsafe/markupsafe/__init__.py', # jinja2 dep
+- ],
+- }, {
+ 'jinja_module_files': [
+ '<(DEPTH)/third_party/jinja2/__init__.py',
+ '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+- }
+- ],
+- ],
+ },
+ 'actions': [
+ {
diff --git a/dev-util/electron/files/chromium-last-commit-position-r0.patch b/dev-util/electron/files/chromium-last-commit-position-r0.patch
new file mode 100644
index 000000000000..344ed4c7deb7
--- /dev/null
+++ b/dev-util/electron/files/chromium-last-commit-position-r0.patch
@@ -0,0 +1,26 @@
+--- tools/gn/gn_main.cc.orig 2015-11-12 11:49:56.260549036 +0000
++++ tools/gn/gn_main.cc 2015-11-12 11:50:14.780931485 +0000
+@@ -11,13 +11,7 @@
+ #include "tools/gn/standard_out.h"
+ #include "tools/gn/switches.h"
+
+-// Only the GN-generated build makes this header for now.
+-// TODO(brettw) consider adding this if we need it in GYP.
+-#if defined(GN_BUILD)
+-#include "tools/gn/last_commit_position.h"
+-#else
+ #define LAST_COMMIT_POSITION "UNKNOWN"
+-#endif
+
+ namespace {
+
+--- tools/gn/BUILD.gn.orig 2015-11-12 11:50:43.513524769 +0000
++++ tools/gn/BUILD.gn 2015-11-12 11:50:57.697817632 +0000
+@@ -227,7 +227,6 @@
+
+ deps = [
+ ":gn_lib",
+- ":last_commit_position",
+ "//base",
+ "//build/config/sanitizers:deps",
+ ]
diff --git a/dev-util/electron/files/chromium-linker-warnings-r0.patch b/dev-util/electron/files/chromium-linker-warnings-r0.patch
new file mode 100644
index 000000000000..97d5e1670bdb
--- /dev/null
+++ b/dev-util/electron/files/chromium-linker-warnings-r0.patch
@@ -0,0 +1,18 @@
+--- build/config/compiler/BUILD.gn.orig 2016-05-30 13:50:15.341749039 +0000
++++ build/config/compiler/BUILD.gn 2016-05-30 13:50:30.502061407 +0000
+@@ -203,15 +203,6 @@
+ cflags += [ "-fstack-protector" ]
+ }
+ }
+-
+- # Linker warnings.
+- if (!(is_chromeos && current_cpu == "arm") &&
+- !(is_android && use_order_profiling) && !is_mac && !is_ios) {
+- # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
+- # TODO(lizeb,pasko): Fix link errors when linking with order_profiling=1
+- # crbug.com/485542
+- ldflags += [ "-Wl,--fatal-warnings" ]
+- }
+ }
+
+ if (is_clang && is_debug) {
diff --git a/dev-util/electron/files/chromium-lto-fixes-r1.patch b/dev-util/electron/files/chromium-lto-fixes-r1.patch
new file mode 100644
index 000000000000..b8bd8558b520
--- /dev/null
+++ b/dev-util/electron/files/chromium-lto-fixes-r1.patch
@@ -0,0 +1,36 @@
+diff --git a/build/common.gypi.orig b/build/common.gypi
+index cce7b3c..3b905c0 100644
+--- a/build/common.gypi.orig
++++ b/build/common.gypi
+@@ -6096,7 +6096,7 @@
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'ldflags': [
+- '-flto=32',
++ '-flto=4'
+ ],
+ }],
+ ],
+@@ -6248,7 +6248,7 @@
+ },
+ }],
+ # TODO(pcc): Make these flags work correctly with CFI.
+- ['use_lto!=0 and cfi_vptr==0', {
++ ['use_lto!=0 and cfi_vptr==0 and clang==1', {
+ 'target_defaults': {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+
+diff --git a/build/android/disable_gcc_lto.gypi.orig b/build/android/disable_gcc_lto.gypi
+index a733c7a..57570f8 100644
+--- a/build/android/disable_gcc_lto.gypi.orig
++++ b/build/android/disable_gcc_lto.gypi
+@@ -8,7 +8,7 @@
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'conditions': [
+- ['OS=="android" and clang==0 and (use_lto==1 or use_lto_o2==1)', {
++ ['(OS=="android" or OS=="linux") and clang==0 and (use_lto==1 or use_lto_o2==1)', {
+ 'cflags!': [
+ '-flto',
+ '-ffat-lto-objects',
diff --git a/dev-util/electron/files/chromium-lto-fixes-r3.patch b/dev-util/electron/files/chromium-lto-fixes-r3.patch
new file mode 100644
index 000000000000..10493e6fd388
--- /dev/null
+++ b/dev-util/electron/files/chromium-lto-fixes-r3.patch
@@ -0,0 +1,108 @@
+From 2f2028a19fd12477fcd9050ea354174f33b68b46 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 21 Aug 2017 10:16:44 -0400
+Subject: [PATCH] LTO fixes
+
+---
+ build/config/compiler/BUILD.gn | 35 +++++++++++++++++++++++++----------
+ build/config/posix/BUILD.gn | 2 +-
+ build/toolchain/gcc_ar_wrapper.py | 12 +++++++++++-
+ 3 files changed, 37 insertions(+), 12 deletions(-)
+
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index d0510b8..583f186 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -448,20 +448,35 @@ config("compiler") {
+ } else {
+ # Note: ThinLTO does not currently have this feature implemented
+ # For Full LTO, it provides a measurable runtime speedup of Chrome.
+- cflags += [
+- "-flto",
+- "-fwhole-program-vtables",
+- ]
+- ldflags += [
+- "-flto",
+- "-fwhole-program-vtables",
+- ]
++ if (is_clang) {
++ cflags += [
++ "-flto",
++ "-fwhole-program-vtables"
++ ]
++ ldflags += [
++ "-flto",
++ "-fwhole-program-vtables"
++ ]
++ } else {
++ cflags += [
++ "-flto=4",
++ "-fno-fat-lto-objects",
++ "-fuse-linker-plugin",
++ "--param=lto-partitions=1",
++ ]
++ ldflags += [
++ "-flto=4",
++ "-fno-fat-lto-objects",
++ "-fuse-linker-plugin",
++ "--param=lto-partitions=1",
++ ]
++ }
+
+ # Apply a lower LTO optimization level as the default is too slow.
+ if (is_linux) {
+ if (use_lld) {
+ ldflags += [ "-Wl,--lto-O1" ]
+- } else {
++ } else if (is_clang) {
+ ldflags += [ "-Wl,-plugin-opt,O1" ]
+ }
+ } else if (is_mac) {
+@@ -478,7 +493,7 @@ config("compiler") {
+ # targeting ARM, without this flag, LTO produces a .text section that is
+ # larger than the maximum call displacement, preventing the linker from
+ # relocating calls (http://llvm.org/PR22999).
+- if (is_linux) {
++ if (is_linux && is_clang) {
+ ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
+ }
+ }
+diff --git a/build/config/posix/BUILD.gn b/build/config/posix/BUILD.gn
+index d7e917a..fc68864 100644
+--- a/build/config/posix/BUILD.gn
++++ b/build/config/posix/BUILD.gn
+@@ -21,7 +21,7 @@ config("compiler") {
+ if ((allow_posix_link_time_opt || is_cfi) && !is_nacl) {
+ arflags = [
+ "--plugin",
+- rebase_path("$clang_base_path/lib/LLVMgold.so", root_build_dir),
++ "auto"
+ ]
+ }
+ }
+diff --git a/build/toolchain/gcc_ar_wrapper.py b/build/toolchain/gcc_ar_wrapper.py
+index de53df0..39c7b56 100755
+--- a/build/toolchain/gcc_ar_wrapper.py
++++ b/build/toolchain/gcc_ar_wrapper.py
+@@ -47,7 +47,17 @@ def main():
+
+ command = [args.ar, args.operation]
+ if args.plugin is not None:
+- command += ['--plugin', args.plugin]
++ if args.plugin == 'auto':
++ gcc = os.environ.get('CC', '/usr/bin/cc')
++ gcc_ver = subprocess.check_output([gcc, '-dumpversion'],
++ universal_newlines=True)
++ gcc_ver = gcc_ver.strip(' \n')
++ plugin = '/usr/libexec/gcc/x86_64-pc-linux-gnu/{}/liblto_plugin.so'. \
++ format(gcc_ver)
++ else:
++ plugin = args.plugin
++
++ command += ['--plugin', plugin]
+ command.append(args.output)
+ command += args.inputs
+
+--
+2.14.1
+
diff --git a/dev-util/electron/files/chromium-lto-fixes.patch b/dev-util/electron/files/chromium-lto-fixes.patch
new file mode 100644
index 000000000000..7de3df1b26f6
--- /dev/null
+++ b/dev-util/electron/files/chromium-lto-fixes.patch
@@ -0,0 +1,26 @@
+diff --git a/build/common.gypi.orig b/build/common.gypi
+index cce7b3c..3b905c0 100644
+--- a/build/common.gypi.orig
++++ b/build/common.gypi
+@@ -6096,7 +6096,7 @@
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'ldflags': [
+- '-flto=32',
++ '-flto=4'
+ ],
+ }],
+ ],
+diff --git a/build/android/disable_gcc_lto.gypi.orig b/build/android/disable_gcc_lto.gypi
+index a733c7a..57570f8 100644
+--- a/build/android/disable_gcc_lto.gypi.orig
++++ b/build/android/disable_gcc_lto.gypi
+@@ -8,7 +8,7 @@
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'conditions': [
+- ['OS=="android" and clang==0 and (use_lto==1 or use_lto_o2==1)', {
++ ['(OS=="android" or OS=="linux") and clang==0 and (use_lto==1 or use_lto_o2==1)', {
+ 'cflags!': [
+ '-flto',
+ '-ffat-lto-objects',
diff --git a/dev-util/electron/files/chromium-pdfium-r0.patch b/dev-util/electron/files/chromium-pdfium-r0.patch
new file mode 100644
index 000000000000..2ba268467ef8
--- /dev/null
+++ b/dev-util/electron/files/chromium-pdfium-r0.patch
@@ -0,0 +1,17 @@
+--- third_party/pdfium/xfa/fxbarcode/utils.h.orig 2016-05-30 10:24:54.071773744 +0000
++++ third_party/pdfium/xfa/fxbarcode/utils.h 2016-05-30 10:25:15.808219373 +0000
+@@ -26,12 +26,10 @@
+ #endif
+ #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
+ #define FXSYS_isnan(x) _isnan(x)
+-#elif(_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_)
++#elif(_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_ || \
++ _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_)
+ #include <cmath>
+ #define FXSYS_isnan(x) std::isnan(x)
+-#elif(_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_)
+-#include <math.h>
+-#define FXSYS_isnan(x) isnan(x)
+ #endif
+ #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
+ #define FXSYS_nan() (std::numeric_limits<float>::quiet_NaN())
diff --git a/dev-util/electron/files/chromium-remove-gardiner-mod-font-r1.patch b/dev-util/electron/files/chromium-remove-gardiner-mod-font-r1.patch
new file mode 100644
index 000000000000..f59549094107
--- /dev/null
+++ b/dev-util/electron/files/chromium-remove-gardiner-mod-font-r1.patch
@@ -0,0 +1,13 @@
+diff --git a/components/test_runner/BUILD.gn~ b/components/test_runner/BUILD.gn
+index 3ac8955..6a968cb 100644
+--- a/components/test_runner/BUILD.gn~
++++ b/components/test_runner/BUILD.gn
+@@ -155,8 +155,6 @@ if (use_x11) {
+ copy("copy_x11_fonts") {
+ visibility = [ ":*" ]
+ sources = [
+- "//third_party/gardiner_mod/GardinerModBug.ttf",
+- "//third_party/gardiner_mod/GardinerModCat.ttf",
+ "resources/fonts/fonts.conf",
+ ]
+ outputs = [
diff --git a/dev-util/electron/files/chromium-remove-gardiner-mod-font.patch b/dev-util/electron/files/chromium-remove-gardiner-mod-font.patch
new file mode 100644
index 000000000000..cf1955ffbfd2
--- /dev/null
+++ b/dev-util/electron/files/chromium-remove-gardiner-mod-font.patch
@@ -0,0 +1,13 @@
+diff --git a/test_runner.gyp b/test_runner.gyp
+index 30ffa75..8838bdf 100644
+--- a/components/test_runner/test_runner.gyp
++++ b/components/test_runner/test_runner.gyp
+@@ -162,8 +162,6 @@
+ 'files': [
+ 'resources/fonts/AHEM____.TTF',
+ 'resources/fonts/fonts.conf',
+- '../../third_party/gardiner_mod/GardinerModBug.ttf',
+- '../../third_party/gardiner_mod/GardinerModCat.ttf',
+ ]
+ }],
+ }],
diff --git a/dev-util/electron/files/chromium-shared-v8-r1.patch b/dev-util/electron/files/chromium-shared-v8-r1.patch
new file mode 100644
index 000000000000..eb4d998d9b03
--- /dev/null
+++ b/dev-util/electron/files/chromium-shared-v8-r1.patch
@@ -0,0 +1,15 @@
+diff --git a/v8/src/v8.gyp.orig b/v8/src/v8.gyp
+index bcb5801..3162456 100644
+--- a/v8/src/v8.gyp.orig
++++ b/v8/src/v8.gyp
+@@ -48,8 +48,8 @@
+ }, {
+ 'toolsets': ['target'],
+ }],
+- ['component=="shared_library"', {
+- 'type': '<(component)',
++ ['v8_target_type=="shared_library"', {
++ 'type': 'shared_library',
+ 'sources': [
+ # Note: on non-Windows we still build this file so that gyp
+ # has some sources to link into the component.
diff --git a/dev-util/electron/files/chromium-shared-v8-r2.patch b/dev-util/electron/files/chromium-shared-v8-r2.patch
new file mode 100644
index 000000000000..475da8193a92
--- /dev/null
+++ b/dev-util/electron/files/chromium-shared-v8-r2.patch
@@ -0,0 +1,79 @@
+diff --git a/v8/BUILD.gn.orig b/v8/BUILD.gn
+index 8587356..4365e03 100644
+--- a/v8/BUILD.gn
++++ b/v8/BUILD.gn
+@@ -113,7 +113,7 @@ config("internal_config") {
+
+ include_dirs = [ "." ]
+
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "BUILDING_V8_SHARED" ]
+ }
+ }
+@@ -127,14 +127,14 @@ config("internal_config_base") {
+ # This config should be applied to code using the libplatform.
+ config("libplatform_config") {
+ include_dirs = [ "include" ]
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "USING_V8_PLATFORM_SHARED" ]
+ }
+ }
+
+ # This config should be applied to code using the libbase.
+ config("libbase_config") {
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "USING_V8_BASE_SHARED" ]
+ }
+ libs = []
+@@ -151,7 +151,7 @@ config("libsampler_config") {
+ # This config should only be applied to code using V8 and not any V8 code
+ # itself.
+ config("external_config") {
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "USING_V8_SHARED" ]
+ }
+ include_dirs = [ "include" ]
+@@ -2265,7 +2265,7 @@ v8_component("v8_libbase") {
+
+ defines = []
+
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "BUILDING_V8_BASE_SHARED" ]
+ }
+
+@@ -2355,7 +2355,7 @@ v8_component("v8_libplatform") {
+
+ configs = [ ":internal_config_base" ]
+
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "BUILDING_V8_PLATFORM_SHARED" ]
+ }
+
+@@ -2498,7 +2498,7 @@ group("gn_all") {
+ }
+ }
+
+-if (is_component_build) {
++if (is_component_build || is_electron_build) {
+ v8_component("v8") {
+ sources = [
+ "src/v8dll-main.cc",
+diff --git a/v8/src/inspector/BUILD.gn b/v8/src/inspector/BUILD.gn
+index 6ebb91c..b6a2489 100644
+--- a/v8/src/inspector/BUILD.gn
++++ b/v8/src/inspector/BUILD.gn
+@@ -106,7 +106,7 @@ config("inspector_config") {
+ "/wd4996", # Deprecated function call.
+ ]
+ }
+- if (is_component_build) {
++ if (is_component_build || is_electron_build) {
+ defines = [ "BUILDING_V8_SHARED" ]
+ }
+ }
diff --git a/dev-util/electron/files/chromium-shared-v8.patch b/dev-util/electron/files/chromium-shared-v8.patch
new file mode 100644
index 000000000000..67d97c8b3974
--- /dev/null
+++ b/dev-util/electron/files/chromium-shared-v8.patch
@@ -0,0 +1,15 @@
+diff --git a/v8/tools/gyp/v8.gyp.orig b/v8/tools/gyp/v8.gyp
+index bcb5801..3162456 100644
+--- a/v8/tools/gyp/v8.gyp.orig
++++ b/v8/tools/gyp/v8.gyp
+@@ -48,8 +48,8 @@
+ }, {
+ 'toolsets': ['target'],
+ }],
+- ['component=="shared_library"', {
+- 'type': '<(component)',
++ ['v8_target_type=="shared_library"', {
++ 'type': 'shared_library',
+ 'sources': [
+ # Note: on non-Windows we still build this file so that gyp
+ # has some sources to link into the component.
diff --git a/dev-util/electron/files/chromium-snapshot-toolchain-r1.patch b/dev-util/electron/files/chromium-snapshot-toolchain-r1.patch
new file mode 100644
index 000000000000..56f35b303077
--- /dev/null
+++ b/dev-util/electron/files/chromium-snapshot-toolchain-r1.patch
@@ -0,0 +1,23 @@
+--- v8/snapshot_toolchain.gni.orig 2016-01-07 15:47:46.772435180 +0000
++++ v8/snapshot_toolchain.gni 2016-01-07 15:48:06.144841801 +0000
+@@ -28,19 +28,4 @@
+ # The snapshot needs to be compiled for the host, but compiled with
+ # a toolchain that matches the bit-width of the target.
+
+-# TODO(GYP): For now we only support 32-bit little-endian target builds from an
+-# x64 Linux host. Eventually we need to support all of the host/target
+-# configurations v8 runs on.
+-if (host_cpu == "x64" && host_os == "linux") {
+- if (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86") {
+- snapshot_toolchain = "//build/toolchain/linux:clang_x86"
+- } else if (target_cpu == "x64" || target_cpu == "arm64" || target_cpu == "mips64el") {
+- snapshot_toolchain = "//build/toolchain/linux:clang_x64"
+- } else {
+- assert(false, "Need environment for this arch: $target_cpu")
+- }
+-} else {
+- snapshot_toolchain = default_toolchain
+-}
+-
+-
++snapshot_toolchain = default_toolchain
diff --git a/dev-util/electron/files/chromium-system-ffmpeg-r0.patch b/dev-util/electron/files/chromium-system-ffmpeg-r0.patch
new file mode 100644
index 000000000000..667e0ecb2a72
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-ffmpeg-r0.patch
@@ -0,0 +1,54 @@
+diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
+index 677bd76..23a21f8 100644
+--- a/media/ffmpeg/ffmpeg_common.h
++++ b/media/ffmpeg/ffmpeg_common.h
+@@ -19,20 +19,12 @@
+
+ // Include FFmpeg header files.
+ extern "C" {
+-// Disable deprecated features which result in spammy compile warnings. This
+-// list of defines must mirror those in the 'defines' section of the ffmpeg.gyp
+-// file or the headers below will generate different structures.
+-#define FF_API_PIX_FMT_DESC 0
+-#define FF_API_OLD_DECODE_AUDIO 0
+-#define FF_API_DESTRUCT_PACKET 0
+-#define FF_API_GET_BUFFER 0
+
+ // Temporarily disable possible loss of data warning.
+ // TODO(scherkus): fix and upstream the compiler warnings.
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+-#include <libavformat/internal.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/imgutils.h>
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index 155e980..7ba327a 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -966,24 +966,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
+ // If no estimate is found, the stream entry will be kInfiniteDuration().
+ std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
+ kInfiniteDuration());
+- const AVFormatInternal* internal = format_context->internal;
+- if (internal && internal->packet_buffer &&
+- format_context->start_time != static_cast<int64>(AV_NOPTS_VALUE)) {
+- struct AVPacketList* packet_buffer = internal->packet_buffer;
+- while (packet_buffer != internal->packet_buffer_end) {
+- DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
+- start_time_estimates.size());
+- const AVStream* stream =
+- format_context->streams[packet_buffer->pkt.stream_index];
+- if (packet_buffer->pkt.pts != static_cast<int64>(AV_NOPTS_VALUE)) {
+- const base::TimeDelta packet_pts =
+- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
+- if (packet_pts < start_time_estimates[stream->index])
+- start_time_estimates[stream->index] = packet_pts;
+- }
+- packet_buffer = packet_buffer->next;
+- }
+- }
+
+ AVStream* audio_stream = NULL;
+ AudioDecoderConfig audio_config;
diff --git a/dev-util/electron/files/chromium-system-ffmpeg-r2.patch b/dev-util/electron/files/chromium-system-ffmpeg-r2.patch
new file mode 100644
index 000000000000..8d67ef3898df
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-ffmpeg-r2.patch
@@ -0,0 +1,50 @@
+--- a/media/ffmpeg/ffmpeg_common.h 2015-11-27 12:01:56.155462264 +0000
++++ b/media/ffmpeg/ffmpeg_common.h 2015-11-27 12:03:03.348846300 +0000
+@@ -19,10 +19,6 @@
+
+ // Include FFmpeg header files.
+ extern "C" {
+-// Disable deprecated features which result in spammy compile warnings. This
+-// list of defines must mirror those in the 'defines' section of BUILD.gn file &
+-// ffmpeg.gyp file or the headers below will generate different structures!
+-#define FF_API_CONVERGENCE_DURATION 0
+ // Upstream libavcodec/utils.c still uses the deprecated
+ // av_dup_packet(), causing deprecation warnings.
+ // The normal fix for such things is to disable the feature as below,
+@@ -36,7 +32,6 @@
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+-#include <libavformat/internal.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/imgutils.h>
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index 155e980..7ba327a 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -1034,24 +1034,6 @@
+ // If no estimate is found, the stream entry will be kInfiniteDuration().
+ std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
+ kInfiniteDuration());
+- const AVFormatInternal* internal = format_context->internal;
+- if (internal && internal->packet_buffer &&
+- format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+- struct AVPacketList* packet_buffer = internal->packet_buffer;
+- while (packet_buffer != internal->packet_buffer_end) {
+- DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
+- start_time_estimates.size());
+- const AVStream* stream =
+- format_context->streams[packet_buffer->pkt.stream_index];
+- if (packet_buffer->pkt.pts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+- const base::TimeDelta packet_pts =
+- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
+- if (packet_pts < start_time_estimates[stream->index])
+- start_time_estimates[stream->index] = packet_pts;
+- }
+- packet_buffer = packet_buffer->next;
+- }
+- }
+
+ AVStream* audio_stream = NULL;
+ AudioDecoderConfig audio_config;
diff --git a/dev-util/electron/files/chromium-system-ffmpeg-r4.patch b/dev-util/electron/files/chromium-system-ffmpeg-r4.patch
new file mode 100644
index 000000000000..3abfc163e8a2
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-ffmpeg-r4.patch
@@ -0,0 +1,48 @@
+--- a/media/ffmpeg/ffmpeg_common.h.orig 2016-09-09 13:16:07.757294768 +0000
++++ b/media/ffmpeg/ffmpeg_common.h 2016-09-09 13:16:41.705989273 +0000
+@@ -22,10 +22,6 @@
+
+ // Include FFmpeg header files.
+ extern "C" {
+-// Disable deprecated features which result in spammy compile warnings. This
+-// list of defines must mirror those in the 'defines' section of FFmpeg's
+-// BUILD.gn file or the headers below will generate different structures!
+-#define FF_API_CONVERGENCE_DURATION 0
+ // Upstream libavcodec/utils.c still uses the deprecated
+ // av_dup_packet(), causing deprecation warnings.
+ // The normal fix for such things is to disable the feature as below,
+@@ -35,7 +35,6 @@
+ MSVC_PUSH_DISABLE_WARNING(4244);
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+-#include <libavformat/internal.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
+ #include <libavutil/imgutils.h>
+--- a/media/filters/ffmpeg_demuxer.cc.orig 2016-09-09 14:21:40.185828912 +0000
++++ b/media/filters/ffmpeg_demuxer.cc 2016-09-09 14:21:52.894089352 +0000
+@@ -1185,24 +1185,6 @@
+ // If no estimate is found, the stream entry will be kInfiniteDuration.
+ std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
+ kInfiniteDuration);
+- const AVFormatInternal* internal = format_context->internal;
+- if (internal && internal->packet_buffer &&
+- format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+- struct AVPacketList* packet_buffer = internal->packet_buffer;
+- while (packet_buffer != internal->packet_buffer_end) {
+- DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
+- start_time_estimates.size());
+- const AVStream* stream =
+- format_context->streams[packet_buffer->pkt.stream_index];
+- if (packet_buffer->pkt.pts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
+- const base::TimeDelta packet_pts =
+- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
+- if (packet_pts < start_time_estimates[stream->index])
+- start_time_estimates[stream->index] = packet_pts;
+- }
+- packet_buffer = packet_buffer->next;
+- }
+- }
+
+ std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
+
diff --git a/dev-util/electron/files/chromium-system-jinja-r11.patch b/dev-util/electron/files/chromium-system-jinja-r11.patch
new file mode 100644
index 000000000000..0b3c9b72478b
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-jinja-r11.patch
@@ -0,0 +1,79 @@
+--- third_party/WebKit/Source/bindings/scripts/scripts.gyp.orig 2014-08-19 09:55:10.330972228 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gyp 2014-08-19 09:55:26.387286232 +0000
+@@ -54,7 +54,6 @@
+ 'actions': [{
+ 'action_name': 'cache_jinja_templates',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ 'code_generator_v8.py',
+ '<@(code_generator_template_files)',
+ ],
+--- third_party/WebKit/Source/build/scripts/scripts.gypi.orig 2014-08-19 10:00:00.216521733 +0000
++++ third_party/WebKit/Source/build/scripts/scripts.gypi 2014-08-19 10:00:11.464735099 +0000
+@@ -2,10 +2,6 @@
+ {
+ 'variables': {
+ 'scripts_for_in_files': [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- '<(DEPTH)/third_party/jinja2/__init__.py',
+- '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ 'hasher.py',
+ 'in_file.py',
+ 'in_generator.py',
+--- third_party/WebKit/Source/bindings/scripts/scripts.gypi.orig 2014-08-19 10:53:02.824618979 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gypi 2014-08-19 10:53:20.784957370 +0000
+@@ -12,9 +12,6 @@
+ '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+ 'idl_lexer_parser_files': [
+- # PLY (Python Lex-Yacc)
+- '<(DEPTH)/third_party/ply/lex.py',
+- '<(DEPTH)/third_party/ply/yacc.py',
+ # Web IDL lexer/parser (base parser)
+ '<(DEPTH)/tools/idl_parser/idl_lexer.py',
+ '<(DEPTH)/tools/idl_parser/idl_node.py',
+--- third_party/WebKit/Source/build/scripts/scripts.gni.orig 2016-06-02 09:54:28.510152077 +0000
++++ third_party/WebKit/Source/build/scripts/scripts.gni 2016-06-02 09:54:50.966612510 +0000
+@@ -9,10 +9,6 @@
+ _scripts_dir = "//third_party/WebKit/Source/build/scripts"
+
+ scripts_for_in_files = [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- "//third_party/jinja2/__init__.py",
+- "//third_party/markupsafe/__init__.py", # jinja2 dep
+ "$_scripts_dir/hasher.py",
+ "$_scripts_dir/in_file.py",
+ "$_scripts_dir/in_generator.py",
+--- third_party/WebKit/Source/bindings/scripts/BUILD.gn.orig 2016-06-02 10:03:01.100658943 +0000
++++ third_party/WebKit/Source/bindings/scripts/BUILD.gn 2016-06-02 10:03:13.240907715 +0000
+@@ -36,7 +36,7 @@
+ action("cached_jinja_templates") {
+ script = "code_generator_v8.py"
+
+- inputs = jinja_module_files + [ "code_generator_v8.py" ] +
++ inputs = [ "code_generator_v8.py" ] +
+ code_generator_template_files
+
+ # Dummy file to track dependency.
+--- third_party/WebKit/Source/platform/v8_inspector/v8_inspector.gyp.orig 2016-06-03 12:31:49.844954196 +0000
++++ third_party/WebKit/Source/platform/v8_inspector/v8_inspector.gyp 2016-06-03 12:32:01.869198425 +0000
+@@ -60,7 +60,6 @@
+ {
+ 'action_name': 'generateV8InspectorProtocolBackendSources',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ # The python script in action below.
+ '../inspector_protocol/CodeGenerator.py',
+ # Input files for the script.
+--- third_party/WebKit/Source/core/inspector/inspector.gyp.orig 2016-06-03 12:38:20.712891692 +0000
++++ third_party/WebKit/Source/core/inspector/inspector.gyp 2016-06-03 12:38:31.197104557 +0000
+@@ -52,7 +52,6 @@
+ {
+ 'action_name': 'generateInspectorProtocolBackendSources',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ # The python script in action below.
+ '../../platform/inspector_protocol/CodeGenerator.py',
+ # Input files for the script.
diff --git a/dev-util/electron/files/chromium-system-jinja-r7.patch b/dev-util/electron/files/chromium-system-jinja-r7.patch
new file mode 100644
index 000000000000..fe28e12c333c
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-jinja-r7.patch
@@ -0,0 +1,35 @@
+--- third_party/WebKit/Source/bindings/scripts/scripts.gyp.orig 2014-08-19 09:55:10.330972228 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gyp 2014-08-19 09:55:26.387286232 +0000
+@@ -54,7 +54,6 @@
+ 'actions': [{
+ 'action_name': 'cache_jinja_templates',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ 'code_generator_v8.py',
+ '<@(code_generator_template_files)',
+ ],
+--- third_party/WebKit/Source/build/scripts/scripts.gypi.orig 2014-08-19 10:00:00.216521733 +0000
++++ third_party/WebKit/Source/build/scripts/scripts.gypi 2014-08-19 10:00:11.464735099 +0000
+@@ -2,10 +2,6 @@
+ {
+ 'variables': {
+ 'scripts_for_in_files': [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- '<(DEPTH)/third_party/jinja2/__init__.py',
+- '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ 'hasher.py',
+ 'in_file.py',
+ 'in_generator.py',
+--- third_party/WebKit/Source/bindings/scripts/scripts.gypi.orig 2014-08-19 10:53:02.824618979 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gypi 2014-08-19 10:53:20.784957370 +0000
+@@ -12,9 +12,6 @@
+ '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+ 'idl_lexer_parser_files': [
+- # PLY (Python Lex-Yacc)
+- '<(DEPTH)/third_party/ply/lex.py',
+- '<(DEPTH)/third_party/ply/yacc.py',
+ # Web IDL lexer/parser (base parser)
+ '<(DEPTH)/tools/idl_parser/idl_lexer.py',
+ '<(DEPTH)/tools/idl_parser/idl_node.py',
diff --git a/dev-util/electron/files/chromium-system-jinja-r9.patch b/dev-util/electron/files/chromium-system-jinja-r9.patch
new file mode 100644
index 000000000000..1de9083f307c
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-jinja-r9.patch
@@ -0,0 +1,71 @@
+--- third_party/WebKit/Source/bindings/scripts/scripts.gyp.orig 2014-08-19 09:55:10.330972228 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gyp 2014-08-19 09:55:26.387286232 +0000
+@@ -54,7 +54,6 @@
+ 'actions': [{
+ 'action_name': 'cache_jinja_templates',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ 'code_generator_v8.py',
+ '<@(code_generator_template_files)',
+ ],
+--- third_party/WebKit/Source/build/scripts/scripts.gypi.orig 2014-08-19 10:00:00.216521733 +0000
++++ third_party/WebKit/Source/build/scripts/scripts.gypi 2014-08-19 10:00:11.464735099 +0000
+@@ -2,10 +2,6 @@
+ {
+ 'variables': {
+ 'scripts_for_in_files': [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- '<(DEPTH)/third_party/jinja2/__init__.py',
+- '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ 'hasher.py',
+ 'in_file.py',
+ 'in_generator.py',
+--- third_party/WebKit/Source/bindings/scripts/scripts.gypi.orig 2014-08-19 10:53:02.824618979 +0000
++++ third_party/WebKit/Source/bindings/scripts/scripts.gypi 2014-08-19 10:53:20.784957370 +0000
+@@ -12,9 +12,6 @@
+ '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+ 'idl_lexer_parser_files': [
+- # PLY (Python Lex-Yacc)
+- '<(DEPTH)/third_party/ply/lex.py',
+- '<(DEPTH)/third_party/ply/yacc.py',
+ # Web IDL lexer/parser (base parser)
+ '<(DEPTH)/tools/idl_parser/idl_lexer.py',
+ '<(DEPTH)/tools/idl_parser/idl_node.py',
+--- third_party/WebKit/Source/platform/inspector_protocol/protocol.gyp.orig 2016-03-23 15:10:41.522637837 +0000
++++ third_party/WebKit/Source/platform/inspector_protocol/protocol.gyp 2016-03-23 15:10:56.938953740 +0000
+@@ -6,9 +6,6 @@
+ 'variables': {
+ 'blink_platform_output_dir': '<(SHARED_INTERMEDIATE_DIR)/blink/platform',
+ 'jinja_module_files': [
+- # jinja2/__init__.py contains version string, so sufficient for package
+- '<(DEPTH)/third_party/jinja2/__init__.py',
+- '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+ },
+
+--- third_party/WebKit/Source/build/scripts/scripts.gni.orig 2016-06-02 09:54:28.510152077 +0000
++++ third_party/WebKit/Source/build/scripts/scripts.gni 2016-06-02 09:54:50.966612510 +0000
+@@ -9,10 +9,6 @@
+ _scripts_dir = "//third_party/WebKit/Source/build/scripts"
+
+ scripts_for_in_files = [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- "//third_party/jinja2/__init__.py",
+- "//third_party/markupsafe/__init__.py", # jinja2 dep
+ "$_scripts_dir/hasher.py",
+ "$_scripts_dir/in_file.py",
+ "$_scripts_dir/in_generator.py",
+--- third_party/WebKit/Source/bindings/scripts/BUILD.gn.orig 2016-06-02 10:03:01.100658943 +0000
++++ third_party/WebKit/Source/bindings/scripts/BUILD.gn 2016-06-02 10:03:13.240907715 +0000
+@@ -36,7 +36,7 @@
+ action("cached_jinja_templates") {
+ script = "code_generator_v8.py"
+
+- inputs = jinja_module_files + [ "code_generator_v8.py" ] +
++ inputs = [ "code_generator_v8.py" ] +
+ code_generator_template_files
+
+ # Dummy file to track dependency.
diff --git a/dev-util/electron/files/chromium-system-zlib-r0.patch b/dev-util/electron/files/chromium-system-zlib-r0.patch
new file mode 100644
index 000000000000..3bf38e5904fa
--- /dev/null
+++ b/dev-util/electron/files/chromium-system-zlib-r0.patch
@@ -0,0 +1,19 @@
+--- build/linux/unbundle/zlib.gn.orig 2016-05-30 13:09:56.987716771 +0000
++++ build/linux/unbundle/zlib.gn 2016-05-30 13:12:36.879014187 +0000
+@@ -9,11 +9,16 @@
+ headers = [ "zlib.h" ]
+ }
+
++config("system_zlib") {
++ defines = [ "USE_SYSTEM_ZLIB=1" ]
++}
++
+ source_set("zlib") {
+ deps = [
+ ":zlib_shim",
+ ]
+ libs = [ "z" ]
++ public_configs = [ ":system_zlib" ]
+ }
+
+ shim_headers("minizip_shim") {
diff --git a/dev-util/electron/files/electron-0.36.12-vendor-brightray.patch b/dev-util/electron/files/electron-0.36.12-vendor-brightray.patch
new file mode 100644
index 000000000000..7acbe04ff9d7
--- /dev/null
+++ b/dev-util/electron/files/electron-0.36.12-vendor-brightray.patch
@@ -0,0 +1,144 @@
+From 4ec57d1c20b841c6121a77f1539b0c759a031904 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:14:58 -0500
+Subject: [PATCH] brightray build fixes
+
+---
+ brightray.gyp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
+ brightray.gypi | 21 ++++++++-------------
+ 2 files changed, 56 insertions(+), 17 deletions(-)
+
+diff --git a/brightray.gyp b/brightray.gyp
+index d7120ea..d0fd603 100644
+--- a/brightray.gyp
++++ b/brightray.gyp
+@@ -1,7 +1,7 @@
+ {
+ 'variables': {
+ # The libraries brightray will be compiled to.
+- 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gconf-2.0 gmodule-2.0 nss'
++ 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gmodule-2.0 nss'
+ },
+ 'includes': [
+ 'filenames.gypi',
+@@ -9,6 +9,11 @@
+ 'targets': [
+ {
+ 'target_name': 'brightray',
++ 'dependencies': [
++ 'cups',
++ 'gconf',
++ '<(libchromiumcontent_src_dir)/chromiumcontent/chromiumcontent.gyp:chromiumcontent_all'
++ ],
+ 'type': 'static_library',
+ 'include_dirs': [
+ '.',
+@@ -100,12 +105,9 @@
+ }, {
+ 'link_settings': {
+ 'libraries': [
+- # Link with ffmpeg.
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ # Following libraries are required by libchromiumcontent:
+ '-lasound',
+ '-lcap',
+- '-lcups',
+ '-lrt',
+ '-ldl',
+ '-lresolv',
+@@ -274,5 +276,47 @@
+ }], # OS=="win"
+ ],
+ },
++ {
++ 'target_name': 'gconf',
++ 'type': 'none',
++ 'conditions': [
++ ['use_gconf==1 and _toolset=="target"', {
++ 'direct_dependent_settings': {
++ 'cflags': [
++ '<!@(<(pkg-config) --cflags gconf-2.0)',
++ ],
++ 'defines': [
++ 'USE_GCONF',
++ ],
++ },
++ 'link_settings': {
++ 'ldflags': [
++ '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
++ ],
++ 'libraries': [
++ '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
++ ],
++ },
++ }],
++ ],
++ },
++ {
++ 'target_name': 'cups',
++ 'type': 'none',
++ 'conditions': [
++ ['use_cups==1', {
++ 'direct_dependent_settings': {
++ 'defines': [
++ 'USE_CUPS',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '-lcups',
++ ],
++ },
++ },
++ }],
++ ],
++ },
+ ],
+ }
+diff --git a/brightray.gypi b/brightray.gypi
+index 4513fa9..95bdfa1 100644
+--- a/brightray.gypi
++++ b/brightray.gypi
+@@ -1,9 +1,14 @@
+ {
+- 'includes': [
+- 'vendor/download/libchromiumcontent/filenames.gypi',
+- ],
+ 'variables': {
+ 'libchromiumcontent_component%': 1,
++ 'libchromiumcontent_src_dir': '<(DEPTH)',
++ 'libchromiumcontent_shared_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_static_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_shared_libraries': [],
++ 'libchromiumcontent_static_libraries': [],
++ 'libchromiumcontent_shared_v8_libraries': [],
++ 'libchromiumcontent_static_v8_libraries': [],
++ 'pkg-config%': 'pkg-config',
+ 'conditions': [
+ # The "libchromiumcontent_component" is defined when calling "gyp".
+ ['libchromiumcontent_component', {
+@@ -258,22 +263,12 @@
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags': [
+- '-O2',
+- # Generate symbols, will be stripped later.
+- '-g',
+- # Don't emit the GCC version ident directives, they just end up
+- # in the .comment section taking up binary size.
+- '-fno-ident',
+ # Put data and code in their own sections, so that unused symbols
+ # can be removed at link time with --gc-sections.
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'ldflags': [
+- # Specifically tell the linker to perform optimizations.
+- # See http://lwn.net/Articles/192624/ .
+- '-Wl,-O1',
+- '-Wl,--as-needed',
+ '-Wl,--gc-sections',
+ ],
+ }], # OS=="linux"
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.36.12-vendor-libchromiumcontent.patch b/dev-util/electron/files/electron-0.36.12-vendor-libchromiumcontent.patch
new file mode 100644
index 000000000000..168d8db477a9
--- /dev/null
+++ b/dev-util/electron/files/electron-0.36.12-vendor-libchromiumcontent.patch
@@ -0,0 +1,75 @@
+From b7022129450eaf2136746f5332956e76848796ef Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:12:12 -0500
+Subject: [PATCH] libchromiumcontent build fixes
+
+---
+ chromiumcontent/chromiumcontent.gyp | 6 +++---
+ chromiumcontent/chromiumcontent.gypi | 26 --------------------------
+ 2 files changed, 3 insertions(+), 29 deletions(-)
+
+diff --git a/chromiumcontent/chromiumcontent.gyp b/chromiumcontent/chromiumcontent.gyp
+index 52a1d36..db74a52 100644
+--- a/chromiumcontent/chromiumcontent.gyp
++++ b/chromiumcontent/chromiumcontent.gyp
+@@ -24,11 +24,11 @@
+ },
+ {
+ 'target_name': 'chromiumcontent',
+- # Build chromiumcontent as shared_library otherwise some static libraries
+- # will not build.
+- 'type': 'shared_library',
++ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/base/base.gyp:base_prefs',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
+ '<(DEPTH)/components/components.gyp:cdm_renderer',
+ '<(DEPTH)/components/components.gyp:devtools_discovery',
+ '<(DEPTH)/components/components.gyp:devtools_http_handler',
+diff --git a/chromiumcontent/chromiumcontent.gypi b/chromiumcontent/chromiumcontent.gypi
+index 37c572b..3f4dcea 100644
+--- a/chromiumcontent/chromiumcontent.gypi
++++ b/chromiumcontent/chromiumcontent.gypi
+@@ -1,17 +1,5 @@
+ {
+ 'variables': {
+- # Enalbe using proprietary codecs.
+- 'proprietary_codecs': 1,
+- 'ffmpeg_branding': 'Chrome',
+- # Enable support for Widevine CDM.
+- 'enable_widevine': 1,
+- # Using libc++ requires building for >= 10.7.
+- 'mac_deployment_target': '10.8',
+- # The 10.8 SDK does not work well with C++11.
+- 'mac_sdk_min': '10.9',
+- # Use the standard way of linking with msvc runtime.
+- 'win_use_allocator_shim': 0,
+- 'win_release_RuntimeLibrary': '2',
+ # The V8 libraries.
+ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
+ # The icu libraries.
+@@ -22,20 +10,6 @@
+ 'v8_use_external_startup_data': 1,
+ }],
+ ['OS=="linux"', {
+- # Enable high DPI support on Linux.
+- 'enable_hidpi': 1,
+- # Use Dbus.
+- 'use_dbus': 1,
+- # Make Linux build contain debug symbols, this flag will add '-g' to
+- # cflags.
+- 'linux_dump_symbols': 1,
+- # The Linux build of libchromiumcontent.so depends on, but doesn't
+- # provide, tcmalloc by default. Disabling tcmalloc here also prevents
+- # any conflicts when linking to binaries or libraries that don't use
+- # tcmalloc.
+- 'linux_use_tcmalloc': 0,
+- # Force using gold linker.
+- 'linux_use_bundled_gold': 1,
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'arm_version': 7,
+--
+2.4.10
+
diff --git a/dev-util/electron/files/electron-0.36.12-vendor-node.patch b/dev-util/electron/files/electron-0.36.12-vendor-node.patch
new file mode 100644
index 000000000000..85f34b6178fe
--- /dev/null
+++ b/dev-util/electron/files/electron-0.36.12-vendor-node.patch
@@ -0,0 +1,109 @@
+From 56b57ea7f0c111bfd9c719060cf17346e638fdd1 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 10 Feb 2016 14:45:13 -0500
+Subject: [PATCH] Build fixes
+
+---
+ node.gyp | 5 +++--
+ src/node.cc | 8 --------
+ src/node.js | 2 ++
+ src/node_main.cc | 2 ++
+ 4 files changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/node.gyp b/node.gyp
+index d431210..fea5e07 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -1,6 +1,7 @@
+ {
+ 'variables': {
+ 'v8_use_snapshot%': 'false',
++ 'v8_gyp_path%': 'deps/v8/tools/gyp/v8.gyp',
+ 'node_use_dtrace%': 'false',
+ 'node_use_lttng%': 'false',
+ 'node_use_etw%': 'false',
+@@ -89,8 +90,8 @@
+ 'dependencies': [
+ 'node_js2c#host',
+ 'deps/cares/cares.gyp:cares',
+- # 'deps/v8/tools/gyp/v8.gyp:v8',
+- # 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+
+ 'include_dirs': [
+diff --git a/src/node.cc b/src/node.cc
+index 7df6053..cbe1538 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -4085,15 +4085,11 @@ static void StartNodeInstance(void* arg) {
+ SealHandleScope seal(isolate);
+ bool more;
+ do {
+-#if 0
+ v8::platform::PumpMessageLoop(default_platform, isolate);
+-#endif
+ more = uv_run(env->event_loop(), UV_RUN_ONCE);
+
+ if (more == false) {
+-#if 0
+ v8::platform::PumpMessageLoop(default_platform, isolate);
+-#endif
+ EmitBeforeExit(env);
+
+ // Emit `beforeExit` if the loop became alive either after emitting
+@@ -4153,10 +4149,8 @@ int Start(int argc, char** argv) {
+ #endif
+
+ const int thread_pool_size = 4;
+-#if 0
+ default_platform = v8::platform::CreateDefaultPlatform(thread_pool_size);
+ V8::InitializePlatform(default_platform);
+-#endif
+ V8::Initialize();
+
+ int exit_code = 1;
+@@ -4173,10 +4167,8 @@ int Start(int argc, char** argv) {
+ }
+ V8::Dispose();
+
+-#if 0
+ delete default_platform;
+ default_platform = nullptr;
+-#endif
+
+ delete[] exec_argv;
+ exec_argv = nullptr;
+diff --git a/src/node.js b/src/node.js
+index 37aa371..a835d0a 100644
+--- a/src/node.js
++++ b/src/node.js
+@@ -40,7 +40,9 @@
+ startup.globalConsole();
+ } // not isRenderer
+
++ if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
+ startup.initAsarSupport();
++ }
+
+ startup.processAssert();
+ startup.processConfig();
+diff --git a/src/node_main.cc b/src/node_main.cc
+index 58e747e..24949f3 100644
+--- a/src/node_main.cc
++++ b/src/node_main.cc
+@@ -40,8 +40,10 @@ int wmain(int argc, wchar_t *wargv[]) {
+ }
+ #else
+ // UNIX
++#include <stdlib.h>
+ int main(int argc, char *argv[]) {
+ setvbuf(stderr, NULL, _IOLBF, 1024);
++ putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
+ return node::Start(argc, argv);
+ }
+ #endif
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.36.12.patch b/dev-util/electron/files/electron-0.36.12.patch
new file mode 100644
index 000000000000..ec21b25af508
--- /dev/null
+++ b/dev-util/electron/files/electron-0.36.12.patch
@@ -0,0 +1,257 @@
+From 293b40208c981a3a18a1ccd5c5ea0a50611e2356 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:16:40 -0500
+Subject: [PATCH] electron build fixes
+
+---
+ atom.gyp | 55 +++++++++++++++++++++++++++++++++++++++++++------------
+ common.gypi | 29 +++++++++++++++++++++++------
+ filenames.gypi | 1 -
+ tools/js2asar.py | 11 ++++++-----
+ 4 files changed, 72 insertions(+), 24 deletions(-)
+
+diff --git a/atom.gyp b/atom.gyp
+index 5554adb..61ec47c 100644
+--- a/atom.gyp
++++ b/atom.gyp
+@@ -29,6 +29,7 @@
+ 'type': 'executable',
+ 'dependencies': [
+ 'js2asar',
++ 'nodebin',
+ '<(project_name)_lib',
+ ],
+ 'sources': [
+@@ -177,7 +178,7 @@
+ ],
+ }, {
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:dump_syms#host',
++ 'breakpad/breakpad.gyp:dump_syms#host',
+ ],
+ }], # OS=="win"
+ ['OS=="linux"', {
+@@ -194,7 +195,7 @@
+ }, {
+ 'copied_libraries': [
+ '<(PRODUCT_DIR)/lib/libnode.so',
+- '<(libchromiumcontent_dir)/libffmpeg.so',
++ '<(PRODUCT_DIR)/lib/libv8.so',
+ ],
+ }],
+ ],
+@@ -202,9 +203,6 @@
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '<@(copied_libraries)',
+- '<(libchromiumcontent_dir)/locales',
+- '<(libchromiumcontent_dir)/icudtl.dat',
+- '<(libchromiumcontent_dir)/content_shell.pak',
+ '<(libchromiumcontent_dir)/natives_blob.bin',
+ '<(libchromiumcontent_dir)/snapshot_blob.bin',
+ ],
+@@ -242,15 +240,14 @@
+ '<@(lib_sources)',
+ ],
+ 'include_dirs': [
+- '.',
+ 'chromium_src',
++ '.',
+ 'vendor/brightray',
+ 'vendor/native_mate',
+ # Include atom_natives.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
+ # Include directories for uv and node.
+ 'vendor/node/src',
+- 'vendor/node/deps/http_parser',
+ 'vendor/node/deps/uv/include',
+ # The `node.h` is using `#include"v8.h"`.
+ '<(libchromiumcontent_src_dir)/v8/include',
+@@ -301,8 +298,8 @@
+ 'vendor/node/deps/uv/uv.gyp:libuv',
+ 'vendor/node/deps/zlib/zlib.gyp:zlib',
+ # Build with breakpad support.
+- 'vendor/breakpad/breakpad.gyp:breakpad_handler',
+- 'vendor/breakpad/breakpad.gyp:breakpad_sender',
++ 'breakpad/breakpad.gyp:breakpad_handler',
++ 'breakpad/breakpad.gyp:breakpad_sender',
+ ],
+ }], # OS=="win"
+ ['OS=="mac" and mas_build==0', {
+@@ -333,7 +330,7 @@
+ # Make binary search for libraries under current directory, so we
+ # don't have to manually set $LD_LIBRARY_PATH:
+ # http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
+- '-rpath \$$ORIGIN',
++ '-Wl,-rpath=\$$ORIGIN/',
+ # Make native module dynamic loading work.
+ '-rdynamic',
+ ],
+@@ -344,10 +341,10 @@
+ '-Wno-reserved-user-defined-literal',
+ ],
+ 'include_dirs': [
+- 'vendor/breakpad/src',
++ 'breakpad/src',
+ ],
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:breakpad_client',
++ 'breakpad/breakpad.gyp:breakpad_client',
+ ],
+ }], # OS=="linux"
+ ],
+@@ -355,6 +352,9 @@
+ {
+ 'target_name': 'js2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'js2asar',
+@@ -376,6 +376,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ '<@(_inputs)',
+ ],
+@@ -403,6 +404,36 @@
+ }
+ ],
+ }, # target atom_js2c
++ {
++ 'target_name': 'nodebin',
++ 'type': 'executable',
++ 'sources': [
++ 'vendor/node/src/node_main.cc',
++ ],
++ 'dependencies': [
++ 'vendor/node/node.gyp:node',
++ ],
++ 'include_dirs': [
++ '.',
++ 'vendor/native_mate',
++ # Include atom_natives.h.
++ '<(SHARED_INTERMEDIATE_DIR)',
++ # Include directories for uv and node.
++ 'vendor/node/src',
++ 'vendor/node/deps/uv/include',
++ # The `node.h` is using `#include"v8.h"`.
++ '<(libchromiumcontent_src_dir)/v8/include',
++ # The `node.h` is using `#include"ares.h"`.
++ 'vendor/node/deps/cares/include',
++ ],
++ 'link_settings': {
++ 'ldflags': [
++ '-Wl,-rpath=\$$ORIGIN/',
++ # Make native module dynamic loading work.
++ '-rdynamic',
++ ],
++ },
++ }, # target nodebin
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+diff --git a/common.gypi b/common.gypi
+index 7c41c36..2da2fea 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -17,12 +17,6 @@
+ 'node_target_type': 'shared_library',
+ 'node_install_npm': 'false',
+ 'node_prefix': '',
+- 'node_shared_cares': 'false',
+- 'node_shared_http_parser': 'false',
+- 'node_shared_libuv': 'false',
+- 'node_shared_openssl': 'false',
+- 'node_shared_v8': 'true',
+- 'node_shared_zlib': 'false',
+ 'node_tag': '',
+ 'node_use_dtrace': 'false',
+ 'node_use_etw': 'false',
+@@ -35,10 +29,33 @@
+ 'V8_BASE': '',
+ 'v8_postmortem_support': 'false',
+ 'v8_enable_i18n_support': 'false',
++ 'v8_gyp_path': '<(DEPTH)/v8/tools/gyp/v8.gyp',
++ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
++ 'v8_target_type': 'shared_library',
++ 'v8_use_snapshot': 'true',
++ 'v8_use_external_startup_data': 1,
+ },
+ # Settings to compile node under Windows.
+ 'target_defaults': {
+ 'target_conditions': [
++ ['_target_name in <(v8_libraries) + ["node"]', {
++ 'cflags!': [
++ '-fvisibility=hidden',
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ 'cflags_cc!': [
++ '-fvisibility-inlines-hidden'
++ ],
++ }],
++
++ ['_target_name in <(v8_libraries) + ["mksnapshot"]', {
++ 'defines': [
++ 'V8_SHARED',
++ 'BUILDING_V8_SHARED',
++ ],
++ }],
++
+ ['_target_name in ["libuv", "http_parser", "openssl", "cares", "node", "zlib"]', {
+ 'msvs_disabled_warnings': [
+ 4013, # 'free' undefined; assuming extern returning int
+diff --git a/filenames.gypi b/filenames.gypi
+index f9e1955..84999a3 100644
+--- a/filenames.gypi
++++ b/filenames.gypi
+@@ -498,7 +498,6 @@
+ 'chromium_src/extensions/browser/app_window/size_constraints.h',
+ 'chromium_src/extensions/common/url_pattern.cc',
+ 'chromium_src/extensions/common/url_pattern.h',
+- 'chromium_src/library_loaders/libspeechd_loader.cc',
+ 'chromium_src/library_loaders/libspeechd.h',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.cc',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.h',
+diff --git a/tools/js2asar.py b/tools/js2asar.py
+index cb02e33..3d80a11 100755
+--- a/tools/js2asar.py
++++ b/tools/js2asar.py
+@@ -11,12 +11,13 @@ SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+ def main():
+- archive = sys.argv[1]
+- js_source_files = sys.argv[2:]
++ node = sys.argv[1]
++ archive = sys.argv[2]
++ js_source_files = sys.argv[3:]
+
+ output_dir = tempfile.mkdtemp()
+ copy_js(js_source_files, output_dir)
+- call_asar(archive, output_dir)
++ call_asar(node, archive, output_dir)
+ shutil.rmtree(output_dir)
+
+
+@@ -28,10 +29,10 @@ def copy_js(js_source_files, output_dir):
+ shutil.copy2(source_file, output_path)
+
+
+-def call_asar(archive, output_dir):
++def call_asar(node, archive, output_dir):
+ js_dir = os.path.join(output_dir, 'lib')
+ asar = os.path.join(SOURCE_ROOT, 'node_modules', 'asar', 'bin', 'asar')
+- subprocess.check_call([find_node(), asar, 'pack', js_dir, archive])
++ subprocess.check_call([node, asar, 'pack', js_dir, archive])
+
+
+ def find_node():
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.37.8-vendor-brightray.patch b/dev-util/electron/files/electron-0.37.8-vendor-brightray.patch
new file mode 100644
index 000000000000..4c68e4199e91
--- /dev/null
+++ b/dev-util/electron/files/electron-0.37.8-vendor-brightray.patch
@@ -0,0 +1,143 @@
+From e28b41fcc6d59d1774995c5a7b6aa4c634616481 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:14:58 -0500
+Subject: [PATCH] brightray build fixes
+
+---
+ brightray.gyp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
+ brightray.gypi | 20 +++++++-------------
+ 2 files changed, 55 insertions(+), 17 deletions(-)
+
+diff --git a/brightray.gyp b/brightray.gyp
+index 4a821d1..0897f9d 100644
+--- a/brightray.gyp
++++ b/brightray.gyp
+@@ -1,7 +1,7 @@
+ {
+ 'variables': {
+ # The libraries brightray will be compiled to.
+- 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gconf-2.0 gmodule-2.0 nss'
++ 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst gmodule-2.0 nss'
+ },
+ 'includes': [
+ 'filenames.gypi',
+@@ -9,6 +9,11 @@
+ 'targets': [
+ {
+ 'target_name': 'brightray',
++ 'dependencies': [
++ 'cups',
++ 'gconf',
++ '<(libchromiumcontent_src_dir)/chromiumcontent/chromiumcontent.gyp:chromiumcontent_all'
++ ],
+ 'type': 'static_library',
+ 'include_dirs': [
+ '.',
+@@ -101,12 +106,9 @@
+ }, {
+ 'link_settings': {
+ 'libraries': [
+- # Link with ffmpeg.
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ # Following libraries are required by libchromiumcontent:
+ '-lasound',
+ '-lcap',
+- '-lcups',
+ '-lrt',
+ '-ldl',
+ '-lresolv',
+@@ -302,5 +304,47 @@
+ }], # OS=="win"
+ ],
+ },
++ {
++ 'target_name': 'gconf',
++ 'type': 'none',
++ 'conditions': [
++ ['use_gconf==1 and _toolset=="target"', {
++ 'direct_dependent_settings': {
++ 'cflags': [
++ '<!@(<(pkg-config) --cflags gconf-2.0)',
++ ],
++ 'defines': [
++ 'USE_GCONF',
++ ],
++ },
++ 'link_settings': {
++ 'ldflags': [
++ '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
++ ],
++ 'libraries': [
++ '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
++ ],
++ },
++ }],
++ ],
++ },
++ {
++ 'target_name': 'cups',
++ 'type': 'none',
++ 'conditions': [
++ ['use_cups==1', {
++ 'direct_dependent_settings': {
++ 'defines': [
++ 'USE_CUPS',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '-lcups',
++ ],
++ },
++ },
++ }],
++ ],
++ },
+ ],
+ }
+diff --git a/brightray.gypi b/brightray.gypi
+index 8bae073..95bdfa1 100644
+--- a/brightray.gypi
++++ b/brightray.gypi
+@@ -1,9 +1,13 @@
+ {
+- 'includes': [
+- 'vendor/download/libchromiumcontent/filenames.gypi',
+- ],
+ 'variables': {
+ 'libchromiumcontent_component%': 1,
++ 'libchromiumcontent_src_dir': '<(DEPTH)',
++ 'libchromiumcontent_shared_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_static_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_shared_libraries': [],
++ 'libchromiumcontent_static_libraries': [],
++ 'libchromiumcontent_shared_v8_libraries': [],
++ 'libchromiumcontent_static_v8_libraries': [],
+ 'pkg-config%': 'pkg-config',
+ 'conditions': [
+ # The "libchromiumcontent_component" is defined when calling "gyp".
+@@ -259,22 +263,12 @@
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags': [
+- '-O2',
+- # Generate symbols, will be stripped later.
+- '-g',
+- # Don't emit the GCC version ident directives, they just end up
+- # in the .comment section taking up binary size.
+- '-fno-ident',
+ # Put data and code in their own sections, so that unused symbols
+ # can be removed at link time with --gc-sections.
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'ldflags': [
+- # Specifically tell the linker to perform optimizations.
+- # See http://lwn.net/Articles/192624/ .
+- '-Wl,-O1',
+- '-Wl,--as-needed',
+ '-Wl,--gc-sections',
+ ],
+ }], # OS=="linux"
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.37.8-vendor-libchromiumcontent.patch b/dev-util/electron/files/electron-0.37.8-vendor-libchromiumcontent.patch
new file mode 100644
index 000000000000..8115345b077d
--- /dev/null
+++ b/dev-util/electron/files/electron-0.37.8-vendor-libchromiumcontent.patch
@@ -0,0 +1,71 @@
+From bfa42ae7f5251a65fd90a68d0914384b7e63b8ad Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:12:12 -0500
+Subject: [PATCH] libchromiumcontent build fixes
+
+---
+ chromiumcontent/chromiumcontent.gyp | 6 +++---
+ chromiumcontent/chromiumcontent.gypi | 22 ----------------------
+ 2 files changed, 3 insertions(+), 25 deletions(-)
+
+diff --git a/chromiumcontent/chromiumcontent.gyp b/chromiumcontent/chromiumcontent.gyp
+index ddaa0b9..cc8c7c6 100644
+--- a/chromiumcontent/chromiumcontent.gyp
++++ b/chromiumcontent/chromiumcontent.gyp
+@@ -24,11 +24,11 @@
+ },
+ {
+ 'target_name': 'chromiumcontent',
+- # Build chromiumcontent as shared_library otherwise some static libraries
+- # will not build.
+- 'type': 'shared_library',
++ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/base/base.gyp:base_prefs',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
+ '<(DEPTH)/components/components.gyp:cdm_renderer',
+ '<(DEPTH)/components/components.gyp:devtools_discovery',
+ '<(DEPTH)/components/components.gyp:devtools_http_handler',
+diff --git a/chromiumcontent/chromiumcontent.gypi b/chromiumcontent/chromiumcontent.gypi
+index 73bc78a..53694e7 100644
+--- a/chromiumcontent/chromiumcontent.gypi
++++ b/chromiumcontent/chromiumcontent.gypi
+@@ -1,18 +1,5 @@
+ {
+ 'variables': {
+- # Don't use nacl.
+- 'disable_nacl': 1,
+- # Enalbe using proprietary codecs.
+- 'proprietary_codecs': 1,
+- # Build ffmpeg as shared library.
+- 'ffmpeg_component': 'shared_library',
+- # Enable support for Widevine CDM.
+- 'enable_widevine': 1,
+- # Using libc++ requires building for >= 10.7.
+- 'mac_deployment_target': '10.8',
+- # Use the standard way of linking with msvc runtime.
+- 'win_use_allocator_shim': 0,
+- 'win_release_RuntimeLibrary': '2',
+ # The V8 libraries.
+ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
+ # The icu libraries.
+@@ -23,15 +10,6 @@
+ 'v8_use_external_startup_data': 1,
+ }],
+ ['OS=="linux"', {
+- # Enable high DPI support on Linux.
+- 'enable_hidpi': 1,
+- # Use Dbus.
+- 'use_dbus': 1,
+- # Make Linux build contain debug symbols, this flag will add '-g' to
+- # cflags.
+- 'linux_dump_symbols': 1,
+- # Force using gold linker.
+- 'linux_use_bundled_gold': 1,
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'arm_version': 7,
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.37.8-vendor-node.patch b/dev-util/electron/files/electron-0.37.8-vendor-node.patch
new file mode 100644
index 000000000000..6e706c3ab49b
--- /dev/null
+++ b/dev-util/electron/files/electron-0.37.8-vendor-node.patch
@@ -0,0 +1,105 @@
+From ee5dd0d41e8426d6915c4b2b9095674ab4175fee Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 10 Feb 2016 14:45:13 -0500
+Subject: [PATCH] Build fixes
+
+---
+ lib/internal/bootstrap_node.js | 2 ++
+ node.gyp | 5 +++--
+ src/node.cc | 8 ++++----
+ src/node_main.cc | 2 ++
+ 4 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
+index f2edf80..dd2fdb4 100644
+--- a/lib/internal/bootstrap_node.js
++++ b/lib/internal/bootstrap_node.js
+@@ -53,7 +53,9 @@
+ setupGlobalConsole();
+ } // not isRenderer
+
++ if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
+ setupAsarSupport();
++ }
+
+ const _process = NativeModule.require('internal/process');
+
+diff --git a/node.gyp b/node.gyp
+index df3bb6a..fbe21d8 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -1,6 +1,7 @@
+ {
+ 'variables': {
+ 'v8_use_snapshot%': 'false',
++ 'v8_gyp_path%': 'deps/v8/tools/gyp/v8.gyp',
+ 'node_use_dtrace%': 'false',
+ 'node_use_lttng%': 'false',
+ 'node_use_etw%': 'false',
+@@ -107,8 +108,8 @@
+ 'dependencies': [
+ 'node_js2c#host',
+ 'deps/cares/cares.gyp:cares',
+- # 'deps/v8/tools/gyp/v8.gyp:v8',
+- # 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+
+ 'include_dirs': [
+diff --git a/src/node.cc b/src/node.cc
+index 66f31d0..961abc2 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -4240,13 +4240,13 @@ static void StartNodeInstance(void* arg) {
+ SealHandleScope seal(isolate);
+ bool more;
+ do {
+-#if 0
++#if 1
+ v8::platform::PumpMessageLoop(default_platform, isolate);
+ #endif
+ more = uv_run(env->event_loop(), UV_RUN_ONCE);
+
+ if (more == false) {
+-#if 0
++#if 1
+ v8::platform::PumpMessageLoop(default_platform, isolate);
+ #endif
+ EmitBeforeExit(env);
+@@ -4312,7 +4312,7 @@ int Start(int argc, char** argv) {
+ V8::SetEntropySource(crypto::EntropySource);
+ #endif
+
+-#if 0
++#if 1
+ default_platform = v8::platform::CreateDefaultPlatform(v8_thread_pool_size);
+ V8::InitializePlatform(default_platform);
+ V8::Initialize();
+@@ -4332,7 +4332,7 @@ int Start(int argc, char** argv) {
+ }
+ V8::Dispose();
+
+-#if 0
++#if 1
+ delete default_platform;
+ default_platform = nullptr;
+ #endif
+diff --git a/src/node_main.cc b/src/node_main.cc
+index dce72af..e567cc4 100644
+--- a/src/node_main.cc
++++ b/src/node_main.cc
+@@ -48,8 +48,10 @@ int wmain(int argc, wchar_t *wargv[]) {
+ }
+ #else
+ // UNIX
++#include <stdlib.h>
+ int main(int argc, char *argv[]) {
+ setvbuf(stderr, NULL, _IOLBF, 1024);
++ putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
+ return node::Start(argc, argv);
+ }
+ #endif
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-0.37.8.patch b/dev-util/electron/files/electron-0.37.8.patch
new file mode 100644
index 000000000000..943281cae834
--- /dev/null
+++ b/dev-util/electron/files/electron-0.37.8.patch
@@ -0,0 +1,391 @@
+From 79e5320a6544a24e45d275cf64bff27fbf6289f2 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:16:40 -0500
+Subject: [PATCH] electron build fixes
+
+---
+ common.gypi | 32 ++++++++++++++++++------
+ electron.gyp | 62 ++++++++++++++++++++++++++++++++++++++---------
+ filenames.gypi | 1 -
+ toolchain.gypi | 47 +----------------------------------
+ tools/atom_source_root.py | 5 ++++
+ tools/get-endianness.py | 4 +++
+ tools/js2asar.py | 13 +++++-----
+ 7 files changed, 92 insertions(+), 72 deletions(-)
+ create mode 100644 tools/atom_source_root.py
+ create mode 100644 tools/get-endianness.py
+
+diff --git a/common.gypi b/common.gypi
+index 1088beb..2364ebe 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -15,16 +15,11 @@
+ 'openssl_fips': '',
+ 'openssl_no_asm': 1,
+ 'node_release_urlbase': 'https://atom.io/download/atom-shell',
+- 'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
++ 'node_byteorder': '<!(python <(DEPTH)/tools/get-endianness.py)',
+ 'node_target_type': 'shared_library',
+ 'node_install_npm': 'false',
+ 'node_prefix': '',
+- 'node_shared_cares': 'false',
+- 'node_shared_http_parser': 'false',
+- 'node_shared_libuv': 'false',
+- 'node_shared_openssl': 'false',
+ 'node_shared_v8': 'true',
+- 'node_shared_zlib': 'false',
+ 'node_tag': '',
+ 'node_use_dtrace': 'false',
+ 'node_use_etw': 'false',
+@@ -36,11 +31,34 @@
+ 'uv_use_dtrace': 'false',
+ 'V8_BASE': '',
+ 'v8_postmortem_support': 'false',
+- 'v8_enable_i18n_support': 'false',
++ 'v8_enable_i18n_support': 'true',
++ 'v8_gyp_path': '<(DEPTH)/v8/tools/gyp/v8.gyp',
++ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
++ 'v8_target_type': 'shared_library',
++ 'v8_use_snapshot': 'true',
++ 'v8_use_external_startup_data': 1,
+ },
+ # Settings to compile node under Windows.
+ 'target_defaults': {
+ 'target_conditions': [
++ ['_target_name in <(v8_libraries) + ["node", "electron_lib"]', {
++ 'cflags!': [
++ '-fvisibility=hidden',
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ 'cflags_cc!': [
++ '-fvisibility-inlines-hidden'
++ ],
++ }],
++
++ ['_target_name in <(v8_libraries) + ["mksnapshot"]', {
++ 'defines': [
++ 'V8_SHARED',
++ 'BUILDING_V8_SHARED',
++ ],
++ }],
++
+ ['_target_name in ["libuv", "http_parser", "openssl", "cares", "node", "zlib"]', {
+ 'msvs_disabled_warnings': [
+ 4003, # not enough actual parameters for macro 'V'
+diff --git a/electron.gyp b/electron.gyp
+index 66ff2fd..e0e782c 100644
+--- a/electron.gyp
++++ b/electron.gyp
+@@ -30,6 +30,7 @@
+ 'dependencies': [
+ 'js2asar',
+ 'app2asar',
++ 'nodebin',
+ '<(project_name)_lib',
+ ],
+ 'sources': [
+@@ -165,7 +166,7 @@
+ ],
+ }, {
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:dump_syms#host',
++ 'breakpad/breakpad.gyp:dump_syms#host',
+ ],
+ }], # OS=="win"
+ ['OS=="linux"', {
+@@ -182,7 +183,7 @@
+ }, {
+ 'copied_libraries': [
+ '<(PRODUCT_DIR)/lib/libnode.so',
+- '<(libchromiumcontent_dir)/libffmpeg.so',
++ '<(PRODUCT_DIR)/lib/libv8.so',
+ ],
+ }],
+ ],
+@@ -190,9 +191,6 @@
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '<@(copied_libraries)',
+- '<(libchromiumcontent_dir)/locales',
+- '<(libchromiumcontent_dir)/icudtl.dat',
+- '<(libchromiumcontent_dir)/content_shell.pak',
+ '<(libchromiumcontent_dir)/natives_blob.bin',
+ '<(libchromiumcontent_dir)/snapshot_blob.bin',
+ ],
+@@ -216,6 +214,8 @@
+ 'GLIB_DISABLE_DEPRECATION_WARNINGS',
+ # Defined in Chromium but not exposed in its gyp file.
+ 'V8_USE_EXTERNAL_STARTUP_DATA',
++ 'V8_SHARED',
++ 'USING_V8_SHARED',
+ 'ENABLE_PLUGINS',
+ 'ENABLE_PEPPER_CDMS',
+ 'USE_PROPRIETARY_CODECS',
+@@ -224,15 +224,14 @@
+ '<@(lib_sources)',
+ ],
+ 'include_dirs': [
+- '.',
+ 'chromium_src',
++ '.',
+ 'vendor/brightray',
+ 'vendor/native_mate',
+ # Include atom_natives.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
+ # Include directories for uv and node.
+ 'vendor/node/src',
+- 'vendor/node/deps/http_parser',
+ 'vendor/node/deps/uv/include',
+ # The `node.h` is using `#include"v8.h"`.
+ '<(libchromiumcontent_src_dir)/v8/include',
+@@ -283,8 +282,8 @@
+ 'vendor/node/deps/uv/uv.gyp:libuv',
+ 'vendor/node/deps/zlib/zlib.gyp:zlib',
+ # Build with breakpad support.
+- 'vendor/breakpad/breakpad.gyp:breakpad_handler',
+- 'vendor/breakpad/breakpad.gyp:breakpad_sender',
++ 'breakpad/breakpad.gyp:breakpad_handler',
++ 'breakpad/breakpad.gyp:breakpad_sender',
+ ],
+ }], # OS=="win"
+ ['OS=="mac" and mas_build==0', {
+@@ -318,7 +317,7 @@
+ # Make binary search for libraries under current directory, so we
+ # don't have to manually set $LD_LIBRARY_PATH:
+ # http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
+- '-rpath \$$ORIGIN',
++ '-Wl,-rpath=\$$ORIGIN/',
+ # Make native module dynamic loading work.
+ '-rdynamic',
+ ],
+@@ -329,10 +328,10 @@
+ '-Wno-reserved-user-defined-literal',
+ ],
+ 'include_dirs': [
+- 'vendor/breakpad/src',
++ 'breakpad/src',
+ ],
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:breakpad_client',
++ 'breakpad/breakpad.gyp:breakpad_client',
+ ],
+ }], # OS=="linux"
+ ],
+@@ -340,6 +339,9 @@
+ {
+ 'target_name': 'js2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'js2asar',
+@@ -361,6 +363,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'lib',
+ '<@(_inputs)',
+@@ -371,6 +374,9 @@
+ {
+ 'target_name': 'app2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'app2asar',
+@@ -392,6 +398,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'default_app',
+ '<@(_inputs)',
+@@ -420,6 +427,37 @@
+ }
+ ],
+ }, # target atom_js2c
++ {
++ 'target_name': 'nodebin',
++ 'type': 'executable',
++ 'sources': [
++ 'vendor/node/src/node_main.cc',
++ ],
++ 'dependencies': [
++ 'vendor/node/node.gyp:node',
++ ],
++ 'include_dirs': [
++ '.',
++ 'vendor/native_mate',
++ # Include atom_natives.h.
++ '<(SHARED_INTERMEDIATE_DIR)',
++ # Include directories for uv and node.
++ 'vendor/node/src',
++ 'vendor/node/deps/http_parser',
++ 'vendor/node/deps/uv/include',
++ # The `node.h` is using `#include"v8.h"`.
++ '<(libchromiumcontent_src_dir)/v8/include',
++ # The `node.h` is using `#include"ares.h"`.
++ 'vendor/node/deps/cares/include',
++ ],
++ 'link_settings': {
++ 'ldflags': [
++ '-Wl,-rpath=\$$ORIGIN/',
++ # Make native module dynamic loading work.
++ '-rdynamic',
++ ],
++ },
++ }, # target nodebin
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+diff --git a/filenames.gypi b/filenames.gypi
+index 1c21394..3e07096 100644
+--- a/filenames.gypi
++++ b/filenames.gypi
+@@ -516,7 +516,6 @@
+ 'chromium_src/extensions/browser/app_window/size_constraints.h',
+ 'chromium_src/extensions/common/url_pattern.cc',
+ 'chromium_src/extensions/common/url_pattern.h',
+- 'chromium_src/library_loaders/libspeechd_loader.cc',
+ 'chromium_src/library_loaders/libspeechd.h',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.cc',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.h',
+diff --git a/toolchain.gypi b/toolchain.gypi
+index 11da28f..52c0316 100644
+--- a/toolchain.gypi
++++ b/toolchain.gypi
+@@ -16,7 +16,7 @@
+ 'arm_neon%': 1,
+
+ # Abosulte path to source root.
+- 'source_root%': '<!(node <(DEPTH)/tools/atom_source_root.js)',
++ 'source_root%': '<!(python <(DEPTH)/tools/atom_source_root.py)',
+ },
+
+ # Copy conditionally-set variables out one scope.
+@@ -40,34 +40,6 @@
+ 'mac_sdk%': '<!(python <(DEPTH)/tools/mac/find_sdk.py <(mac_sdk_min))',
+ }],
+
+- ['OS=="linux"', {
+- 'variables': {
+- # The system libdir used for this ABI.
+- 'system_libdir%': 'lib',
+-
+- # Setting the path to sysroot.
+- 'conditions': [
+- ['target_arch=="arm"', {
+- # sysroot needs to be an absolute path otherwise it generates
+- # incorrect results when passed to pkg-config
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_arm-sysroot',
+- }],
+- ['target_arch=="ia32"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_i386-sysroot',
+- }],
+- ['target_arch=="x64"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_amd64-sysroot',
+- }],
+- ],
+- },
+- # Copy conditionally-set variables out one scope.
+- 'sysroot%': '<(sysroot)',
+- 'system_libdir%': '<(system_libdir)',
+-
+- # Redirect pkg-config to search from sysroot.
+- 'pkg-config%': '<(source_root)/tools/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
+- }],
+-
+ # Set default compiler flags depending on ARM version.
+ ['arm_version==6', {
+ 'arm_arch%': 'armv6',
+@@ -136,23 +108,6 @@
+ },
+ }],
+
+- # Setup sysroot environment.
+- ['OS=="linux" and target_arch in ["arm", "ia32", "x64"]', {
+- 'target_defaults': {
+- 'target_conditions': [
+- ['_toolset=="target"', {
+- 'cflags': [
+- '--sysroot=<(sysroot)',
+- ],
+- 'ldflags': [
+- '--sysroot=<(sysroot)',
+- '<!(<(source_root)/tools/linux/sysroot_ld_path.sh <(sysroot))',
+- ],
+- }]
+- ],
+- },
+- }], # sysroot
+-
+ # Setup cross-compilation on Linux.
+ ['OS=="linux"', {
+ 'target_defaults': {
+diff --git a/tools/atom_source_root.py b/tools/atom_source_root.py
+new file mode 100644
+index 0000000..316e997
+--- /dev/null
++++ b/tools/atom_source_root.py
+@@ -0,0 +1,5 @@
++#!/usr/bin/env python
++
++import os.path
++
++print(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
+diff --git a/tools/get-endianness.py b/tools/get-endianness.py
+new file mode 100644
+index 0000000..3150793
+--- /dev/null
++++ b/tools/get-endianness.py
+@@ -0,0 +1,4 @@
++#!/usr/bin/env python
++
++import sys
++print(sys.byteorder)
+diff --git a/tools/js2asar.py b/tools/js2asar.py
+index 7860176..b08a38d 100755
+--- a/tools/js2asar.py
++++ b/tools/js2asar.py
+@@ -11,13 +11,14 @@ SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+ def main():
+- archive = sys.argv[1]
+- folder_name = sys.argv[2]
+- source_files = sys.argv[3:]
++ node = sys.argv[1]
++ archive = sys.argv[2]
++ folder_name = sys.argv[3]
++ source_files = sys.argv[4:]
+
+ output_dir = tempfile.mkdtemp()
+ copy_files(source_files, output_dir)
+- call_asar(archive, os.path.join(output_dir, folder_name))
++ call_asar(node, archive, os.path.join(output_dir, folder_name))
+ shutil.rmtree(output_dir)
+
+
+@@ -28,9 +29,9 @@ def copy_files(source_files, output_dir):
+ shutil.copy2(source_file, output_path)
+
+
+-def call_asar(archive, output_dir):
++def call_asar(node, archive, output_dir):
+ asar = os.path.join(SOURCE_ROOT, 'node_modules', 'asar', 'bin', 'asar')
+- subprocess.check_call([find_node(), asar, 'pack', output_dir, archive])
++ subprocess.check_call([node, asar, 'pack', output_dir, archive])
+
+
+ def find_node():
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-1.3.13-vendor-node.patch b/dev-util/electron/files/electron-1.3.13-vendor-node.patch
new file mode 100644
index 000000000000..8db4a0527df2
--- /dev/null
+++ b/dev-util/electron/files/electron-1.3.13-vendor-node.patch
@@ -0,0 +1,95 @@
+From fe90355a9b8db14ad94cae189ccb90cab0800d5b Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 10 Feb 2016 14:45:13 -0500
+Subject: [PATCH] Build fixes
+
+---
+ lib/internal/bootstrap_node.js | 2 ++
+ node.gyp | 13 ++++++++-----
+ src/node_main.cc | 2 ++
+ 3 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
+index 9505c7b8a..27d7b9da9 100644
+--- a/lib/internal/bootstrap_node.js
++++ b/lib/internal/bootstrap_node.js
+@@ -50,7 +50,9 @@
+ setupGlobalConsole();
+ }
+
++ if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
+ setupAsarSupport();
++ }
+
+ const _process = NativeModule.require('internal/process');
+
+diff --git a/node.gyp b/node.gyp
+index a6f7e6e5b..5b95c5778 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -1,6 +1,7 @@
+ {
+ 'variables': {
+ 'v8_use_snapshot%': 'false',
++ 'v8_gyp_path%': 'deps/v8/tools/gyp/v8.gyp',
+ 'node_use_dtrace%': 'false',
+ 'node_use_lttng%': 'false',
+ 'node_use_etw%': 'false',
+@@ -127,6 +128,8 @@
+
+ 'dependencies': [
+ 'node_js2c#host',
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+
+ 'include_dirs': [
+@@ -258,8 +261,8 @@
+ }],
+ [ 'node_use_bundled_v8=="true"', {
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8',
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+ }],
+ [ 'node_use_v8_platform=="true"', {
+@@ -869,13 +872,13 @@
+ }],
+ [ 'node_use_v8_platform=="true"', {
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform',
++ '<(v8_gyp_path):v8_libplatform',
+ ],
+ }],
+ [ 'node_use_bundled_v8=="true"', {
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8',
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+ }],
+ ]
+diff --git a/src/node_main.cc b/src/node_main.cc
+index bde397562..5b5a6dd99 100644
+--- a/src/node_main.cc
++++ b/src/node_main.cc
+@@ -49,11 +49,13 @@ int wmain(int argc, wchar_t *wargv[]) {
+ }
+ #else
+ // UNIX
++#include <stdlib.h>
+ int main(int argc, char *argv[]) {
+ // Disable stdio buffering, it interacts poorly with printf()
+ // calls elsewhere in the program (e.g., any logging from V8.)
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ setvbuf(stderr, nullptr, _IONBF, 0);
++ putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
+ return node::Start(argc, argv);
+ }
+ #endif
+--
+2.11.0
+
diff --git a/dev-util/electron/files/electron-1.3.6-vendor-brightray.patch b/dev-util/electron/files/electron-1.3.6-vendor-brightray.patch
new file mode 100644
index 000000000000..5f789e784479
--- /dev/null
+++ b/dev-util/electron/files/electron-1.3.6-vendor-brightray.patch
@@ -0,0 +1,143 @@
+From 08a13bec9d06a0ea3d86b8a3126cf83a200a8320 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:14:58 -0500
+Subject: [PATCH] brightray build fixes
+
+---
+ brightray.gyp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++----
+ brightray.gypi | 20 +++++++-------------
+ 2 files changed, 55 insertions(+), 17 deletions(-)
+
+diff --git a/brightray.gyp b/brightray.gyp
+index d089dba..a34b090 100644
+--- a/brightray.gyp
++++ b/brightray.gyp
+@@ -1,7 +1,7 @@
+ {
+ 'variables': {
+ # The libraries brightray will be compiled to.
+- 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss'
++ 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gmodule-2.0 nss'
+ },
+ 'includes': [
+ 'filenames.gypi',
+@@ -9,6 +9,11 @@
+ 'targets': [
+ {
+ 'target_name': 'brightray',
++ 'dependencies': [
++ 'cups',
++ 'gconf',
++ '<(libchromiumcontent_src_dir)/chromiumcontent/chromiumcontent.gyp:chromiumcontent_all'
++ ],
+ 'type': 'static_library',
+ 'include_dirs': [
+ '.',
+@@ -104,12 +109,9 @@
+ }, {
+ 'link_settings': {
+ 'libraries': [
+- # Link with ffmpeg.
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ # Following libraries are required by libchromiumcontent:
+ '-lasound',
+ '-lcap',
+- '-lcups',
+ '-lrt',
+ '-ldl',
+ '-lresolv',
+@@ -333,5 +335,47 @@
+ }], # OS=="win"
+ ],
+ },
++ {
++ 'target_name': 'gconf',
++ 'type': 'none',
++ 'conditions': [
++ ['use_gconf==1 and _toolset=="target"', {
++ 'direct_dependent_settings': {
++ 'cflags': [
++ '<!@(<(pkg-config) --cflags gconf-2.0)',
++ ],
++ 'defines': [
++ 'USE_GCONF',
++ ],
++ },
++ 'link_settings': {
++ 'ldflags': [
++ '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
++ ],
++ 'libraries': [
++ '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
++ ],
++ },
++ }],
++ ],
++ },
++ {
++ 'target_name': 'cups',
++ 'type': 'none',
++ 'conditions': [
++ ['use_cups==1', {
++ 'direct_dependent_settings': {
++ 'defines': [
++ 'USE_CUPS',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '-lcups',
++ ],
++ },
++ },
++ }],
++ ],
++ },
+ ],
+ }
+diff --git a/brightray.gypi b/brightray.gypi
+index 634aec0..8d86999 100644
+--- a/brightray.gypi
++++ b/brightray.gypi
+@@ -1,9 +1,13 @@
+ {
+- 'includes': [
+- 'vendor/download/libchromiumcontent/filenames.gypi',
+- ],
+ 'variables': {
+ 'libchromiumcontent_component%': 1,
++ 'libchromiumcontent_src_dir': '<(DEPTH)',
++ 'libchromiumcontent_shared_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_static_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)',
++ 'libchromiumcontent_shared_libraries': [],
++ 'libchromiumcontent_static_libraries': [],
++ 'libchromiumcontent_shared_v8_libraries': [],
++ 'libchromiumcontent_static_v8_libraries': [],
+ 'pkg-config%': 'pkg-config',
+ 'conditions': [
+ # The "libchromiumcontent_component" is defined when calling "gyp".
+@@ -234,22 +238,12 @@
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags': [
+- '-O2',
+- # Generate symbols, will be stripped later.
+- '-g',
+- # Don't emit the GCC version ident directives, they just end up
+- # in the .comment section taking up binary size.
+- '-fno-ident',
+ # Put data and code in their own sections, so that unused symbols
+ # can be removed at link time with --gc-sections.
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'ldflags': [
+- # Specifically tell the linker to perform optimizations.
+- # See http://lwn.net/Articles/192624/ .
+- '-Wl,-O1',
+- '-Wl,--as-needed',
+ '-Wl,--gc-sections',
+ ],
+ }], # OS=="linux"
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-1.3.6-vendor-libchromiumcontent.patch b/dev-util/electron/files/electron-1.3.6-vendor-libchromiumcontent.patch
new file mode 100644
index 000000000000..ed3815006164
--- /dev/null
+++ b/dev-util/electron/files/electron-1.3.6-vendor-libchromiumcontent.patch
@@ -0,0 +1,78 @@
+From 0448735817b941e5039616144aa836c2f08c9c54 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:12:12 -0500
+Subject: [PATCH] libchromiumcontent build fixes
+
+---
+ chromiumcontent/chromiumcontent.gyp | 7 ++++---
+ chromiumcontent/chromiumcontent.gypi | 21 ---------------------
+ 2 files changed, 4 insertions(+), 24 deletions(-)
+
+diff --git a/chromiumcontent/chromiumcontent.gyp b/chromiumcontent/chromiumcontent.gyp
+index 5278324..41e7de3 100644
+--- a/chromiumcontent/chromiumcontent.gyp
++++ b/chromiumcontent/chromiumcontent.gyp
+@@ -24,11 +24,11 @@
+ },
+ {
+ 'target_name': 'chromiumcontent',
+- # Build chromiumcontent as shared_library otherwise some static libraries
+- # will not build.
+- 'type': 'shared_library',
++ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/components/prefs/prefs.gyp:prefs',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
++ '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
+ '<(DEPTH)/components/components.gyp:cdm_renderer',
+ '<(DEPTH)/components/components.gyp:devtools_discovery',
+ '<(DEPTH)/components/components.gyp:devtools_http_handler',
+@@ -41,6 +41,7 @@
+ '<(DEPTH)/ppapi/ppapi_internal.gyp:ppapi_proxy',
+ '<(DEPTH)/ppapi/ppapi_internal.gyp:ppapi_ipc',
+ '<(DEPTH)/ppapi/ppapi_internal.gyp:ppapi_shared',
++ '<(DEPTH)/third_party/WebKit/Source/config.gyp:config',
+ '<(DEPTH)/third_party/webrtc/modules/modules.gyp:desktop_capture',
+ '<(DEPTH)/third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter',
+ '<(DEPTH)/third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
+diff --git a/chromiumcontent/chromiumcontent.gypi b/chromiumcontent/chromiumcontent.gypi
+index 6d605a2..bd28a21 100644
+--- a/chromiumcontent/chromiumcontent.gypi
++++ b/chromiumcontent/chromiumcontent.gypi
+@@ -1,17 +1,5 @@
+ {
+ 'variables': {
+- # Don't use nacl.
+- 'disable_nacl': 1,
+- # Enable using proprietary codecs.
+- 'proprietary_codecs': 1,
+- # Build ffmpeg as shared library.
+- 'ffmpeg_component': 'shared_library',
+- # Enable support for Widevine CDM.
+- 'enable_widevine': 1,
+- # Using libc++ requires building for >= 10.7.
+- 'mac_deployment_target': '10.8',
+- # Use the standard way of linking with msvc runtime.
+- 'win_use_allocator_shim': 0,
+ # The V8 libraries.
+ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
+ # The icu libraries.
+@@ -22,15 +10,6 @@
+ 'v8_use_external_startup_data': 1,
+ }],
+ ['OS=="linux"', {
+- # Enable high DPI support on Linux.
+- 'enable_hidpi': 1,
+- # Use Dbus.
+- 'use_dbus': 1,
+- # Make Linux build contain debug symbols, this flag will add '-g' to
+- # cflags.
+- 'linux_dump_symbols': 1,
+- # Force using gold linker.
+- 'linux_use_bundled_gold': 1,
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'arm_version': 7,
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-1.3.6-vendor-node.patch b/dev-util/electron/files/electron-1.3.6-vendor-node.patch
new file mode 100644
index 000000000000..6d55d87de68e
--- /dev/null
+++ b/dev-util/electron/files/electron-1.3.6-vendor-node.patch
@@ -0,0 +1,92 @@
+From 742d610e4936d7377dd66b8ec6213c6c0afa121f Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 10 Feb 2016 14:45:13 -0500
+Subject: [PATCH] Build fixes
+
+---
+ lib/internal/bootstrap_node.js | 2 ++
+ node.gyp | 13 ++++++++-----
+ src/node_main.cc | 2 ++
+ 3 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
+index 3e698ed..c748f64 100644
+--- a/lib/internal/bootstrap_node.js
++++ b/lib/internal/bootstrap_node.js
+@@ -50,7 +50,9 @@
+ setupGlobalConsole();
+ }
+
++ if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
+ setupAsarSupport();
++ }
+
+ const _process = NativeModule.require('internal/process');
+
+diff --git a/node.gyp b/node.gyp
+index 1ad0137..8f24426 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -1,6 +1,7 @@
+ {
+ 'variables': {
+ 'v8_use_snapshot%': 'false',
++ 'v8_gyp_path%': 'deps/v8/tools/gyp/v8.gyp',
+ 'node_use_dtrace%': 'false',
+ 'node_use_lttng%': 'false',
+ 'node_use_etw%': 'false',
+@@ -126,6 +127,8 @@
+
+ 'dependencies': [
+ 'node_js2c#host',
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+
+ 'include_dirs': [
+@@ -254,8 +257,8 @@
+ ],
+
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8',
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+ }],
+ [ 'node_use_v8_platform=="true"', {
+@@ -842,13 +845,13 @@
+ }],
+ [ 'node_use_v8_platform=="true"', {
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform',
++ '<(v8_gyp_path):v8_libplatform',
+ ],
+ }],
+ [ 'node_use_bundled_v8=="true"', {
+ 'dependencies': [
+- 'deps/v8/tools/gyp/v8.gyp:v8',
+- 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
++ '<(v8_gyp_path):v8',
++ '<(v8_gyp_path):v8_libplatform'
+ ],
+ }],
+ ]
+diff --git a/src/node_main.cc b/src/node_main.cc
+index 02082ba..641e8db 100644
+--- a/src/node_main.cc
++++ b/src/node_main.cc
+@@ -49,8 +49,10 @@ int wmain(int argc, wchar_t *wargv[]) {
+ }
+ #else
+ // UNIX
++#include <stdlib.h>
+ int main(int argc, char *argv[]) {
+ setvbuf(stderr, NULL, _IOLBF, 1024);
++ putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
+ return node::Start(argc, argv);
+ }
+ #endif
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-1.3.6.patch b/dev-util/electron/files/electron-1.3.6.patch
new file mode 100644
index 000000000000..57ebe31a27b9
--- /dev/null
+++ b/dev-util/electron/files/electron-1.3.6.patch
@@ -0,0 +1,422 @@
+From d6b2c31fe1b21d171ecedcd2a198bd5b8347bd98 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:16:40 -0500
+Subject: [PATCH] electron build fixes
+
+---
+ common.gypi | 52 ++++++++++++++++++++++++++++++++------
+ electron.gyp | 63 ++++++++++++++++++++++++++++++++++++-----------
+ filenames.gypi | 1 -
+ toolchain.gypi | 47 +----------------------------------
+ tools/atom_source_root.py | 5 ++++
+ tools/get-endianness.py | 4 +++
+ tools/js2asar.py | 13 +++++-----
+ 7 files changed, 110 insertions(+), 75 deletions(-)
+ create mode 100644 tools/atom_source_root.py
+ create mode 100644 tools/get-endianness.py
+
+diff --git a/common.gypi b/common.gypi
+index 52eba31..55f061a 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -17,24 +17,20 @@
+ 'use_openssl_def': 0,
+ 'OPENSSL_PRODUCT': 'libopenssl.a',
+ 'node_release_urlbase': 'https://atom.io/download/atom-shell',
+- 'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
++ 'node_byteorder': '<!(python <(DEPTH)/tools/get-endianness.py)',
+ 'node_target_type': 'shared_library',
+ 'node_install_npm': 'false',
+ 'node_prefix': '',
+ 'node_shared': 'true',
+- 'node_shared_cares': 'false',
+- 'node_shared_http_parser': 'false',
+- 'node_shared_libuv': 'false',
+- 'node_shared_openssl': 'false',
+ 'node_shared_v8': 'true',
+- 'node_shared_zlib': 'false',
+ 'node_tag': '',
++ 'node_module_version': '',
+ 'node_use_dtrace': 'false',
+ 'node_use_etw': 'false',
+ 'node_use_mdb': 'false',
+ 'node_use_openssl': 'true',
+ 'node_use_perfctr': 'false',
+- 'node_use_v8_platform': 'false',
++ 'node_use_v8_platform': 'true',
+ 'node_use_bundled_v8': 'false',
+ 'uv_library': 'static_library',
+ 'uv_parent_path': 'vendor/node/deps/uv',
+@@ -43,10 +39,37 @@
+ 'v8_postmortem_support': 'false',
+ 'v8_enable_i18n_support': 'false',
+ 'v8_inspector': 'false',
++ 'v8_gyp_path': '<(DEPTH)/v8/src/v8.gyp',
++ 'v8_libraries': '["v8", "v8_snapshot", "v8_nosnapshot", "v8_external_snapshot", "v8_base", "v8_libbase", "v8_libplatform"]',
++ 'v8_target_type': 'shared_library',
++ 'v8_use_snapshot': 'true',
++ 'v8_use_external_startup_data': 1,
+ },
+ # Settings to compile node under Windows.
+ 'target_defaults': {
+ 'target_conditions': [
++ ['_target_name in <(v8_libraries) + ["node"]', {
++ 'cflags!': [
++ '-fvisibility=hidden',
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ 'cflags_cc!': [
++ '-fvisibility-inlines-hidden'
++ ],
++ }],
++
++ ['_target_name in <(v8_libraries) + ["mksnapshot"]', {
++ 'defines': [
++ 'V8_SHARED',
++ 'BUILDING_V8_SHARED',
++ ],
++ }],
++
++ ['_target_name in ["icuuc", "icui18n"]', {
++ 'cflags_cc!': ['-fno-rtti']
++ }],
++
+ ['_target_name in ["libuv", "http_parser", "openssl", "openssl-cli", "cares", "node", "zlib"]', {
+ 'msvs_disabled_warnings': [
+ 4003, # not enough actual parameters for macro 'V'
+@@ -253,6 +276,21 @@
+ }], # OS=="win"
+ ],
+ }],
++ ['_target_name=="shell_runner_host_lib"', {
++ 'conditions': [
++ ['icu_use_data_file_flag==1', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
++ }, { # else icu_use_data_file_flag !=1
++ 'conditions': [
++ ['OS=="win"', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
++ }, {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
++ }],
++ ],
++ }],
++ ],
++ }],
+ ],
+ 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
+ 'msvs_disabled_warnings': [
+diff --git a/electron.gyp b/electron.gyp
+index eb671fd..7253b37 100644
+--- a/electron.gyp
++++ b/electron.gyp
+@@ -30,6 +30,7 @@
+ 'dependencies': [
+ 'js2asar',
+ 'app2asar',
++ 'nodebin',
+ '<(project_name)_lib',
+ ],
+ 'sources': [
+@@ -164,7 +165,7 @@
+ ],
+ }, {
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:dump_syms#host',
++ 'breakpad/breakpad.gyp:dump_syms#host',
+ ],
+ }], # OS=="win"
+ ['OS=="linux"', {
+@@ -181,7 +182,7 @@
+ }, {
+ 'copied_libraries': [
+ '<(PRODUCT_DIR)/lib/libnode.so',
+- '<(libchromiumcontent_dir)/libffmpeg.so',
++ '<(PRODUCT_DIR)/lib/libv8.so',
+ ],
+ }],
+ ],
+@@ -189,13 +190,8 @@
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '<@(copied_libraries)',
+- '<(libchromiumcontent_dir)/locales',
+- '<(libchromiumcontent_dir)/icudtl.dat',
+- '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
+- '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
++ '<(libchromiumcontent_dir)/repack/chrome_200_percent.pak',
+ '<(libchromiumcontent_dir)/content_shell.pak',
+- '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
+- '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
+ '<(libchromiumcontent_dir)/natives_blob.bin',
+ '<(libchromiumcontent_dir)/snapshot_blob.bin',
+ ],
+@@ -230,15 +226,14 @@
+ '<@(lib_sources)',
+ ],
+ 'include_dirs': [
+- '.',
+ 'chromium_src',
++ '.',
+ 'vendor/brightray',
+ 'vendor/native_mate',
+ # Include atom_natives.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
+ # Include directories for uv and node.
+ 'vendor/node/src',
+- 'vendor/node/deps/http_parser',
+ 'vendor/node/deps/uv/include',
+ # The `node.h` is using `#include"v8.h"`.
+ '<(libchromiumcontent_src_dir)/v8/include',
+@@ -289,8 +284,8 @@
+ 'vendor/node/deps/uv/uv.gyp:libuv',
+ 'vendor/node/deps/zlib/zlib.gyp:zlib',
+ # Build with breakpad support.
+- 'vendor/breakpad/breakpad.gyp:breakpad_handler',
+- 'vendor/breakpad/breakpad.gyp:breakpad_sender',
++ 'breakpad/breakpad.gyp:breakpad_handler',
++ 'breakpad/breakpad.gyp:breakpad_sender',
+ ],
+ }], # OS=="win"
+ ['OS=="mac" and mas_build==0', {
+@@ -328,7 +323,7 @@
+ # Make binary search for libraries under current directory, so we
+ # don't have to manually set $LD_LIBRARY_PATH:
+ # http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
+- '-rpath \$$ORIGIN',
++ '-Wl,-rpath=\$$ORIGIN/',
+ # Make native module dynamic loading work.
+ '-rdynamic',
+ ],
+@@ -339,10 +334,10 @@
+ '-Wno-reserved-user-defined-literal',
+ ],
+ 'include_dirs': [
+- 'vendor/breakpad/src',
++ 'breakpad/src',
+ ],
+ 'dependencies': [
+- 'vendor/breakpad/breakpad.gyp:breakpad_client',
++ 'breakpad/breakpad.gyp:breakpad_client',
+ ],
+ }], # OS=="linux"
+ ],
+@@ -350,6 +345,9 @@
+ {
+ 'target_name': 'js2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'js2asar',
+@@ -371,6 +369,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'lib',
+ '<@(_inputs)',
+@@ -381,6 +380,9 @@
+ {
+ 'target_name': 'app2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'app2asar',
+@@ -402,6 +404,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'default_app',
+ '<@(_inputs)',
+@@ -430,6 +433,36 @@
+ }
+ ],
+ }, # target atom_js2c
++ {
++ 'target_name': 'nodebin',
++ 'type': 'executable',
++ 'sources': [
++ 'vendor/node/src/node_main.cc',
++ ],
++ 'dependencies': [
++ 'vendor/node/node.gyp:node',
++ ],
++ 'include_dirs': [
++ '.',
++ 'vendor/native_mate',
++ # Include atom_natives.h.
++ '<(SHARED_INTERMEDIATE_DIR)',
++ # Include directories for uv and node.
++ 'vendor/node/src',
++ 'vendor/node/deps/uv/include',
++ # The `node.h` is using `#include"v8.h"`.
++ '<(libchromiumcontent_src_dir)/v8/include',
++ # The `node.h` is using `#include"ares.h"`.
++ 'vendor/node/deps/cares/include',
++ ],
++ 'link_settings': {
++ 'ldflags': [
++ '-Wl,-rpath=\$$ORIGIN/',
++ # Make native module dynamic loading work.
++ '-rdynamic',
++ ],
++ },
++ }, # target nodebin
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+diff --git a/filenames.gypi b/filenames.gypi
+index 9e20582..c7960a9 100644
+--- a/filenames.gypi
++++ b/filenames.gypi
+@@ -558,7 +558,6 @@
+ 'chromium_src/extensions/browser/app_window/size_constraints.h',
+ 'chromium_src/extensions/common/url_pattern.cc',
+ 'chromium_src/extensions/common/url_pattern.h',
+- 'chromium_src/library_loaders/libspeechd_loader.cc',
+ 'chromium_src/library_loaders/libspeechd.h',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.cc',
+ 'chromium_src/net/test/embedded_test_server/stream_listen_socket.h',
+diff --git a/toolchain.gypi b/toolchain.gypi
+index 1c5f8a7..2af11f5 100644
+--- a/toolchain.gypi
++++ b/toolchain.gypi
+@@ -16,7 +16,7 @@
+ 'arm_neon%': 1,
+
+ # Abosulte path to source root.
+- 'source_root%': '<!(node <(DEPTH)/tools/atom_source_root.js)',
++ 'source_root%': '<!(python <(DEPTH)/tools/atom_source_root.py)',
+ },
+
+ # Copy conditionally-set variables out one scope.
+@@ -40,34 +40,6 @@
+ 'mac_sdk%': '<!(python <(DEPTH)/tools/mac/find_sdk.py <(mac_sdk_min))',
+ }],
+
+- ['OS=="linux"', {
+- 'variables': {
+- # The system libdir used for this ABI.
+- 'system_libdir%': 'lib',
+-
+- # Setting the path to sysroot.
+- 'conditions': [
+- ['target_arch=="arm"', {
+- # sysroot needs to be an absolute path otherwise it generates
+- # incorrect results when passed to pkg-config
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_arm-sysroot',
+- }],
+- ['target_arch=="ia32"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_i386-sysroot',
+- }],
+- ['target_arch=="x64"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_amd64-sysroot',
+- }],
+- ],
+- },
+- # Copy conditionally-set variables out one scope.
+- 'sysroot%': '<(sysroot)',
+- 'system_libdir%': '<(system_libdir)',
+-
+- # Redirect pkg-config to search from sysroot.
+- 'pkg-config%': '<(source_root)/tools/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
+- }],
+-
+ # Set default compiler flags depending on ARM version.
+ ['arm_version==6', {
+ 'arm_arch%': 'armv6',
+@@ -136,23 +108,6 @@
+ },
+ }],
+
+- # Setup sysroot environment.
+- ['OS=="linux" and target_arch in ["arm", "ia32", "x64"]', {
+- 'target_defaults': {
+- 'target_conditions': [
+- ['_toolset=="target"', {
+- 'cflags': [
+- '--sysroot=<(sysroot)',
+- ],
+- 'ldflags': [
+- '--sysroot=<(sysroot)',
+- '<!(<(source_root)/tools/linux/sysroot_ld_path.sh <(sysroot))',
+- ],
+- }]
+- ],
+- },
+- }], # sysroot
+-
+ # Setup cross-compilation on Linux.
+ ['OS=="linux"', {
+ 'target_defaults': {
+diff --git a/tools/atom_source_root.py b/tools/atom_source_root.py
+new file mode 100644
+index 0000000..316e997
+--- /dev/null
++++ b/tools/atom_source_root.py
+@@ -0,0 +1,5 @@
++#!/usr/bin/env python
++
++import os.path
++
++print(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
+diff --git a/tools/get-endianness.py b/tools/get-endianness.py
+new file mode 100644
+index 0000000..3150793
+--- /dev/null
++++ b/tools/get-endianness.py
+@@ -0,0 +1,4 @@
++#!/usr/bin/env python
++
++import sys
++print(sys.byteorder)
+diff --git a/tools/js2asar.py b/tools/js2asar.py
+index adad175..ca76868 100755
+--- a/tools/js2asar.py
++++ b/tools/js2asar.py
+@@ -11,13 +11,14 @@ SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+ def main():
+- archive = sys.argv[1]
+- folder_name = sys.argv[2]
+- source_files = sys.argv[3:]
++ node = sys.argv[1]
++ archive = sys.argv[2]
++ folder_name = sys.argv[3]
++ source_files = sys.argv[4:]
+
+ output_dir = tempfile.mkdtemp()
+ copy_files(source_files, output_dir)
+- call_asar(archive, os.path.join(output_dir, folder_name))
++ call_asar(node, archive, os.path.join(output_dir, folder_name))
+ shutil.rmtree(output_dir)
+
+
+@@ -28,11 +29,11 @@ def copy_files(source_files, output_dir):
+ shutil.copy2(source_file, output_path)
+
+
+-def call_asar(archive, output_dir):
++def call_asar(node, archive, output_dir):
+ asar = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'asar')
+ if sys.platform in ['win32', 'cygwin']:
+ asar += '.cmd'
+- subprocess.check_call([asar, 'pack', output_dir, archive])
++ subprocess.check_call([node, asar, 'pack', output_dir, archive])
+
+
+ def safe_mkdir(path):
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-1.6.11-vendor-brightray.patch b/dev-util/electron/files/electron-1.6.11-vendor-brightray.patch
new file mode 100644
index 000000000000..a1a351195d00
--- /dev/null
+++ b/dev-util/electron/files/electron-1.6.11-vendor-brightray.patch
@@ -0,0 +1,163 @@
+From 610ee2681f9532a13f63edf78aab55b1dcb8abf2 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:14:58 -0500
+Subject: [PATCH] brightray build fixes
+
+---
+ brightray.gyp | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ brightray.gypi | 14 ++-----------
+ 2 files changed, 64 insertions(+), 16 deletions(-)
+
+diff --git a/brightray.gyp b/brightray.gyp
+index e60d17a..37e5159 100644
+--- a/brightray.gyp
++++ b/brightray.gyp
+@@ -1,7 +1,7 @@
+ {
+ 'variables': {
+ # The libraries brightray will be compiled to.
+- 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gconf-2.0 gmodule-2.0 nss'
++ 'linux_system_libraries': 'gtk+-2.0 dbus-1 x11 x11-xcb xcb xi xcursor xdamage xrandr xcomposite xext xfixes xrender xtst xscrnsaver gmodule-2.0 nss'
+ },
+ 'includes': [
+ 'filenames.gypi',
+@@ -9,6 +9,10 @@
+ 'targets': [
+ {
+ 'target_name': 'brightray',
++ 'dependencies': [
++ 'cups',
++ 'gconf',
++ ],
+ 'type': 'static_library',
+ 'include_dirs': [
+ '.',
+@@ -130,18 +134,30 @@
+ }, {
+ 'link_settings': {
+ 'libraries': [
+- # Link with ffmpeg.
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ # Following libraries are required by libchromiumcontent:
+ '-lasound',
+ '-lcap',
+- '-lcups',
+ '-lrt',
+ '-ldl',
+ '-lresolv',
+ '-lfontconfig',
+ '-lfreetype',
+ '-lexpat',
++ '-lre2',
++ '-ljpeg',
++ '-lsnappy',
++ '-lharfbuzz',
++ '-lpng',
++ '-lxml2',
++ '-lxslt',
++ '-lwebp',
++ '-lwebpdemux',
++ '-lavcodec',
++ '-lavformat',
++ '-lavutil',
++ '-lvpx',
++ '-lFLAC',
++ '-lminizip',
+ ],
+ },
+ }],
+@@ -390,5 +406,47 @@
+ }], # OS=="win"
+ ],
+ },
++ {
++ 'target_name': 'gconf',
++ 'type': 'none',
++ 'conditions': [
++ ['use_gconf==1 and _toolset=="target"', {
++ 'direct_dependent_settings': {
++ 'cflags': [
++ '<!@(<(pkg-config) --cflags gconf-2.0)',
++ ],
++ 'defines': [
++ 'USE_GCONF',
++ ],
++ },
++ 'link_settings': {
++ 'ldflags': [
++ '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
++ ],
++ 'libraries': [
++ '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
++ ],
++ },
++ }],
++ ],
++ },
++ {
++ 'target_name': 'cups',
++ 'type': 'none',
++ 'conditions': [
++ ['use_cups==1', {
++ 'direct_dependent_settings': {
++ 'defines': [
++ 'USE_CUPS',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '-lcups',
++ ],
++ },
++ },
++ }],
++ ],
++ },
+ ],
+ }
+diff --git a/brightray.gypi b/brightray.gypi
+index 064ae1a..95d6f14 100644
+--- a/brightray.gypi
++++ b/brightray.gypi
+@@ -1,6 +1,6 @@
+ {
+ 'includes': [
+- 'vendor/download/libchromiumcontent/filenames.gypi',
++ 'vendor/libchromiumcontent/dist/main/filenames.gypi',
+ ],
+ 'variables': {
+ 'libchromiumcontent_component%': 1,
+@@ -14,7 +14,7 @@
+ }, {
+ 'libchromiumcontent_dir%': '<(libchromiumcontent_static_libraries_dir)',
+ 'libchromiumcontent_libraries%': '<(libchromiumcontent_static_libraries)',
+- 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_static_v8_libraries)',
++ 'libchromiumcontent_v8_libraries%': '<(libchromiumcontent_shared_v8_libraries)',
+ }],
+ ],
+ },
+@@ -235,22 +235,12 @@
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags': [
+- '-O2',
+- # Generate symbols, will be stripped later.
+- '-g',
+- # Don't emit the GCC version ident directives, they just end up
+- # in the .comment section taking up binary size.
+- '-fno-ident',
+ # Put data and code in their own sections, so that unused symbols
+ # can be removed at link time with --gc-sections.
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'ldflags': [
+- # Specifically tell the linker to perform optimizations.
+- # See http://lwn.net/Articles/192624/ .
+- '-Wl,-O1',
+- '-Wl,--as-needed',
+ '-Wl,--gc-sections',
+ ],
+ }], # OS=="linux"
+--
+2.13.3
+
diff --git a/dev-util/electron/files/electron-1.6.11-vendor-libchromiumcontent.patch b/dev-util/electron/files/electron-1.6.11-vendor-libchromiumcontent.patch
new file mode 100644
index 000000000000..d724e41f1fdb
--- /dev/null
+++ b/dev-util/electron/files/electron-1.6.11-vendor-libchromiumcontent.patch
@@ -0,0 +1,86 @@
+From 0a28ad879b544f73f74491ddd58646750335bf1d Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Fri, 28 Apr 2017 17:22:38 -0400
+Subject: [PATCH] Gentoo build fixes
+
+---
+ chromiumcontent/BUILD.gn | 8 ++------
+ chromiumcontent/build_libs.py | 2 +-
+ script/create-dist | 4 ----
+ script/lib/config.py | 2 +-
+ 4 files changed, 4 insertions(+), 12 deletions(-)
+
+diff --git a/chromiumcontent/BUILD.gn b/chromiumcontent/BUILD.gn
+index e4e4166..25be865 100644
+--- a/chromiumcontent/BUILD.gn
++++ b/chromiumcontent/BUILD.gn
+@@ -343,12 +343,8 @@ if (is_electron_build && !is_component_build) {
+ }
+ }
+
+- static_library("v8") {
+- complete_static_lib = true
+- sources = []
+- if (defined(obj_v8)) {
+- sources += obj_v8
+- }
++ shared_library("v8") {
++ deps = [ "//v8:v8", "//v8:v8_libplatform" ]
+ }
+
+ } else {
+diff --git a/chromiumcontent/build_libs.py b/chromiumcontent/build_libs.py
+index e10f320..716c5f2 100644
+--- a/chromiumcontent/build_libs.py
++++ b/chromiumcontent/build_libs.py
+@@ -82,7 +82,7 @@ with open(args.out, 'w') as out:
+ "third_party/usrsctp",
+ "third_party/woff2",
+ "third_party/zlib",
+- "tools",
++ "tools/battor_agent",
+ "ui",
+ "url",
+ ])
+diff --git a/script/create-dist b/script/create-dist
+index aec75e5..64c7401 100755
+--- a/script/create-dist
++++ b/script/create-dist
+@@ -45,7 +45,6 @@ COMPONENTS = ['static_library', 'shared_library']
+ BINARIES = {
+ 'all': [
+ 'content_shell.pak',
+- 'icudtl.dat',
+ 'natives_blob.bin',
+ 'snapshot_blob.bin',
+ os.path.join('gen', 'blink', 'public', 'resources', 'blink_image_resources_200_percent.pak'),
+@@ -59,7 +58,6 @@ BINARIES = {
+ 'libffmpeg.dylib',
+ ],
+ 'linux': [
+- 'libffmpeg.so',
+ ],
+ 'win32': [
+ 'd3dcompiler_47.dll',
+@@ -312,8 +310,6 @@ def main():
+ copy_generated_sources(target_arch, component)
+ copy_locales(target_arch, component)
+
+- copy_ffmpeg(target_arch)
+- copy_sources()
+ generate_licenses()
+ if not args.no_zip:
+ create_zip(create_debug_archive)
+diff --git a/script/lib/config.py b/script/lib/config.py
+index 3455161..195b2a1 100644
+--- a/script/lib/config.py
++++ b/script/lib/config.py
+@@ -4,4 +4,4 @@ import os
+
+
+ def get_output_dir(source_root, target_arch, component):
+- return os.path.join(source_root, 'src', 'out-' + target_arch, component)
++ return os.environ.get('CHROMIUM_BUILD_DIR')
+--
+2.13.3
+
diff --git a/dev-util/electron/files/electron-1.6.11-vendor-node.patch b/dev-util/electron/files/electron-1.6.11-vendor-node.patch
new file mode 100644
index 000000000000..2f931771f91a
--- /dev/null
+++ b/dev-util/electron/files/electron-1.6.11-vendor-node.patch
@@ -0,0 +1,80 @@
+From fc6ba3a74ffa88b22435531d6522d934a52187e5 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 10 Feb 2016 14:45:13 -0500
+Subject: [PATCH] Build fixes
+
+---
+ lib/internal/bootstrap_node.js | 2 ++
+ node.gyp | 9 +++++++++
+ src/node_main.cc | 2 ++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
+index 085ea00fd0..cb49fc87a7 100644
+--- a/lib/internal/bootstrap_node.js
++++ b/lib/internal/bootstrap_node.js
+@@ -40,7 +40,9 @@
+ setupGlobalConsole();
+ }
+
++ if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
+ setupAsarSupport();
++ }
+
+ const _process = NativeModule.require('internal/process');
+
+diff --git a/node.gyp b/node.gyp
+index 95f24933fc..1434904324 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -17,6 +17,7 @@
+ 'node_shared_libuv%': 'false',
+ 'node_use_openssl%': 'true',
+ 'node_shared_openssl%': 'false',
++ 'node_v8_path%': 'deps/v8',
+ 'node_v8_options%': '',
+ 'node_enable_v8_vtunejit%': 'false',
+ 'node_core_target_name%': 'node',
+@@ -133,6 +134,7 @@
+ ],
+
+ 'include_dirs': [
++ '<(node_v8_path)/include',
+ 'src',
+ 'tools/msvs/genfiles',
+ 'deps/uv/src/ares',
+@@ -238,6 +240,13 @@
+ 'V8_DEPRECATION_WARNINGS=1',
+ ],
+
++ 'link_settings': {
++ 'ldflags': [
++ '-Wl,-rpath=\$$ORIGIN/',
++ # Make native module dynamic loading work.
++ '-rdynamic',
++ ],
++ },
+
+ 'conditions': [
+ [ 'node_shared=="false"', {
+diff --git a/src/node_main.cc b/src/node_main.cc
+index 16bda81ae6..fd559ef1c3 100644
+--- a/src/node_main.cc
++++ b/src/node_main.cc
+@@ -50,11 +50,13 @@ int wmain(int argc, wchar_t *wargv[]) {
+ }
+ #else
+ // UNIX
++#include <stdlib.h>
+ int main(int argc, char *argv[]) {
+ // Disable stdio buffering, it interacts poorly with printf()
+ // calls elsewhere in the program (e.g., any logging from V8.)
+ setvbuf(stdout, nullptr, _IONBF, 0);
+ setvbuf(stderr, nullptr, _IONBF, 0);
++ putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
+ return node::Start(argc, argv);
+ }
+ #endif
+--
+2.13.3
+
diff --git a/dev-util/electron/files/electron-1.6.11.patch b/dev-util/electron/files/electron-1.6.11.patch
new file mode 100644
index 000000000000..b40d471348ab
--- /dev/null
+++ b/dev-util/electron/files/electron-1.6.11.patch
@@ -0,0 +1,512 @@
+From b756fa976480791c76e9338a16ee2b0a29265b93 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Mon, 8 Feb 2016 15:16:40 -0500
+Subject: [PATCH] electron build fixes
+
+---
+ common.gypi | 43 ++++++++++++++++++++++-----
+ electron.gyp | 74 +++++++++++++++++++++++++++++++++++----------
+ toolchain.gypi | 76 +++++++++++++++++++----------------------------
+ tools/ar-flags.py | 15 ++++++++++
+ tools/atom_source_root.py | 5 ++++
+ tools/browserify.py | 24 +++++++++++++++
+ tools/get-endianness.py | 4 +++
+ tools/js2asar.py | 13 ++++----
+ 8 files changed, 179 insertions(+), 75 deletions(-)
+ create mode 100644 tools/ar-flags.py
+ create mode 100644 tools/atom_source_root.py
+ create mode 100644 tools/browserify.py
+ create mode 100644 tools/get-endianness.py
+
+diff --git a/common.gypi b/common.gypi
+index 7c1bf366a..c441ae04b 100644
+--- a/common.gypi
++++ b/common.gypi
+@@ -2,6 +2,7 @@
+ 'includes': [
+ 'toolchain.gypi',
+ 'vendor/brightray/brightray.gypi',
++ 'vendor/node/common.gypi',
+ ],
+ 'variables': {
+ # Tell crashpad to build as external project.
+@@ -16,26 +17,23 @@
+ 'openssl_no_asm': 1,
+ 'use_openssl_def': 0,
+ 'OPENSSL_PRODUCT': 'libopenssl.a',
+- 'node_release_urlbase': 'https://atom.io/download/atom-shell',
+- 'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
++ 'node_release_urlbase': 'https://atom.io/download/electron',
++ 'node_byteorder': '<!(python <(DEPTH)/tools/get-endianness.py)',
+ 'node_target_type': 'shared_library',
++ 'node_module_version': '',
+ 'node_install_npm': 'false',
+ 'node_prefix': '',
+ 'node_shared': 'true',
+- 'node_shared_cares': 'false',
+- 'node_shared_http_parser': 'false',
+- 'node_shared_libuv': 'false',
+- 'node_shared_openssl': 'false',
+ 'node_shared_v8': 'true',
+- 'node_shared_zlib': 'false',
+ 'node_tag': '',
+ 'node_use_dtrace': 'false',
+ 'node_use_etw': 'false',
+ 'node_use_mdb': 'false',
+ 'node_use_openssl': 'true',
+ 'node_use_perfctr': 'false',
+- 'node_use_v8_platform': 'false',
++ 'node_use_v8_platform': 'true',
+ 'node_use_bundled_v8': 'false',
++ 'node_v8_path': '<(DEPTH)/chromium/v8/',
+ 'node_enable_d8': 'false',
+ 'uv_library': 'static_library',
+ 'uv_parent_path': 'vendor/node/deps/uv',
+@@ -44,10 +42,16 @@
+ 'v8_postmortem_support': 'false',
+ 'v8_enable_i18n_support': 'false',
+ 'v8_inspector': 'false',
++ 'v8_use_snapshot': 'true',
++ 'v8_use_external_startup_data': 1,
+ },
+ # Settings to compile node under Windows.
+ 'target_defaults': {
+ 'target_conditions': [
++ ['_target_name in ["icuuc", "icui18n"]', {
++ 'cflags_cc!': ['-fno-rtti']
++ }],
++
+ ['_target_name in ["libuv", "http_parser", "openssl", "openssl-cli", "cares", "node", "zlib"]', {
+ 'msvs_disabled_warnings': [
+ 4003, # not enough actual parameters for macro 'V'
+@@ -128,6 +132,14 @@
+ ],
+ }],
+ ['_target_name=="node"', {
++ 'cflags!': [
++ '-fvisibility=hidden',
++ '-fdata-sections',
++ '-ffunction-sections',
++ ],
++ 'cflags_cc!': [
++ '-fvisibility-inlines-hidden',
++ ],
+ 'include_dirs': [
+ '<(libchromiumcontent_src_dir)',
+ '<(libchromiumcontent_src_dir)/third_party/icu/source/common',
+@@ -228,6 +240,21 @@
+ }], # OS=="win"
+ ],
+ }],
++ ['_target_name=="shell_runner_host_lib"', {
++ 'conditions': [
++ ['icu_use_data_file_flag==1', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
++ }, { # else icu_use_data_file_flag !=1
++ 'conditions': [
++ ['OS=="win"', {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
++ }, {
++ 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
++ }],
++ ],
++ }],
++ ],
++ }],
+ ],
+ 'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
+ 'msvs_disabled_warnings': [
+diff --git a/electron.gyp b/electron.gyp
+index b415525b1..4d0185561 100644
+--- a/electron.gyp
++++ b/electron.gyp
+@@ -191,7 +191,7 @@
+ }, {
+ 'copied_libraries': [
+ '<(PRODUCT_DIR)/lib/libnode.so',
+- '<(libchromiumcontent_dir)/libffmpeg.so',
++ '<@(libchromiumcontent_shared_v8_libraries)',
+ ],
+ }],
+ ],
+@@ -200,7 +200,6 @@
+ 'files': [
+ '<@(copied_libraries)',
+ '<(libchromiumcontent_dir)/locales',
+- '<(libchromiumcontent_dir)/icudtl.dat',
+ '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
+ '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
+ '<(libchromiumcontent_dir)/content_shell.pak',
+@@ -245,15 +244,17 @@
+ '<@(lib_sources)',
+ ],
+ 'include_dirs': [
+- '.',
+ 'chromium_src',
++ '.',
+ 'vendor/brightray',
+ 'vendor/native_mate',
++ # libicu headers shim.
++ '<(SHARED_INTERMEDIATE_DIR)/shim_headers/icui18n_shim',
++ '<(SHARED_INTERMEDIATE_DIR)/shim_headers/icuuc_shim',
+ # Include atom_natives.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
+ # Include directories for uv and node.
+ 'vendor/node/src',
+- 'vendor/node/deps/http_parser',
+ 'vendor/node/deps/uv/include',
+ # The `node.h` is using `#include"v8.h"`.
+ '<(libchromiumcontent_src_dir)/v8/include',
+@@ -342,11 +343,12 @@
+ '<@(lib_sources_nss)',
+ ],
+ 'link_settings': {
++ 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
+ 'ldflags': [
+ # Make binary search for libraries under current directory, so we
+ # don't have to manually set $LD_LIBRARY_PATH:
+ # http://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable
+- '-rpath \$$ORIGIN',
++ '-Wl,-rpath=\$$ORIGIN/',
+ # Make native module dynamic loading work.
+ '-rdynamic',
+ ],
+@@ -368,6 +370,9 @@
+ {
+ 'target_name': 'js2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'js2asar',
+@@ -389,6 +394,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'lib',
+ '<@(_inputs)',
+@@ -399,6 +405,9 @@
+ {
+ 'target_name': 'app2asar',
+ 'type': 'none',
++ 'dependencies': [
++ 'nodebin'
++ ],
+ 'actions': [
+ {
+ 'action_name': 'app2asar',
+@@ -420,6 +429,7 @@
+ 'action': [
+ 'python',
+ 'tools/js2asar.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(_outputs)',
+ 'default_app',
+ '<@(_inputs)',
+@@ -445,6 +455,7 @@
+ 'dependencies': [
+ # depend on this target to ensure the '<(js2c_input_dir)' is created
+ 'atom_js2c_copy',
++ 'nodebin'
+ ],
+ 'variables': {
+ 'sandbox_args': [
+@@ -474,11 +485,9 @@
+ '<(js2c_input_dir)/preload_bundle.js',
+ ],
+ 'action': [
+- 'npm',
+- 'run',
+- '--silent',
+- 'browserify',
+- '--',
++ 'python',
++ 'tools/browserify.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(sandbox_args)',
+ '-o',
+ '<@(_outputs)',
+@@ -493,12 +502,11 @@
+ '<(js2c_input_dir)/isolated_bundle.js',
+ ],
+ 'action': [
+- 'npm',
+- 'run',
+- '--silent',
+- 'browserify',
+- '--',
++ 'python',
++ 'tools/browserify.py',
++ '<(PRODUCT_DIR)/nodebin',
+ '<@(isolated_args)',
++ 'lib/isolated_renderer/init.js',
+ '-o',
+ '<@(_outputs)',
+ ],
+@@ -533,6 +541,42 @@
+ }
+ ],
+ }, # target atom_js2c
++ {
++ 'target_name': 'nodebin',
++ 'type': 'executable',
++ 'defines': [
++ 'ELECTRON_NODE_BUILD_NO_ASAR'
++ ],
++ 'sources': [
++ 'vendor/node/src/node_main.cc',
++ ],
++ 'dependencies': [
++ 'vendor/node/node.gyp:node',
++ ],
++ 'include_dirs': [
++ '.',
++ '<(node_v8_path)/include',
++ 'vendor/native_mate',
++ # Include atom_natives.h.
++ '<(SHARED_INTERMEDIATE_DIR)',
++ # Include directories for uv and node.
++ 'vendor/node/src',
++ 'vendor/node/deps/uv/include',
++ '<(libchromiumcontent_src_dir)',
++ # The `node.h` is using `#include"v8.h"`.
++ '<(libchromiumcontent_src_dir)/v8/include',
++ # The `node.h` is using `#include"ares.h"`.
++ 'vendor/node/deps/cares/include',
++ ],
++ 'link_settings': {
++ 'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
++ 'ldflags': [
++ '-Wl,-rpath=\$$ORIGIN/',
++ # Make native module dynamic loading work.
++ '-rdynamic',
++ ],
++ },
++ }, # target nodebin
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+diff --git a/toolchain.gypi b/toolchain.gypi
+index 1c5f8a713..c20ed1a0f 100644
+--- a/toolchain.gypi
++++ b/toolchain.gypi
+@@ -16,7 +16,7 @@
+ 'arm_neon%': 1,
+
+ # Abosulte path to source root.
+- 'source_root%': '<!(node <(DEPTH)/tools/atom_source_root.js)',
++ 'source_root%': '<!(python <(DEPTH)/tools/atom_source_root.py)',
+ },
+
+ # Copy conditionally-set variables out one scope.
+@@ -40,34 +40,6 @@
+ 'mac_sdk%': '<!(python <(DEPTH)/tools/mac/find_sdk.py <(mac_sdk_min))',
+ }],
+
+- ['OS=="linux"', {
+- 'variables': {
+- # The system libdir used for this ABI.
+- 'system_libdir%': 'lib',
+-
+- # Setting the path to sysroot.
+- 'conditions': [
+- ['target_arch=="arm"', {
+- # sysroot needs to be an absolute path otherwise it generates
+- # incorrect results when passed to pkg-config
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_arm-sysroot',
+- }],
+- ['target_arch=="ia32"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_i386-sysroot',
+- }],
+- ['target_arch=="x64"', {
+- 'sysroot%': '<(source_root)/vendor/debian_wheezy_amd64-sysroot',
+- }],
+- ],
+- },
+- # Copy conditionally-set variables out one scope.
+- 'sysroot%': '<(sysroot)',
+- 'system_libdir%': '<(system_libdir)',
+-
+- # Redirect pkg-config to search from sysroot.
+- 'pkg-config%': '<(source_root)/tools/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
+- }],
+-
+ # Set default compiler flags depending on ARM version.
+ ['arm_version==6', {
+ 'arm_arch%': 'armv6',
+@@ -136,23 +108,6 @@
+ },
+ }],
+
+- # Setup sysroot environment.
+- ['OS=="linux" and target_arch in ["arm", "ia32", "x64"]', {
+- 'target_defaults': {
+- 'target_conditions': [
+- ['_toolset=="target"', {
+- 'cflags': [
+- '--sysroot=<(sysroot)',
+- ],
+- 'ldflags': [
+- '--sysroot=<(sysroot)',
+- '<!(<(source_root)/tools/linux/sysroot_ld_path.sh <(sysroot))',
+- ],
+- }]
+- ],
+- },
+- }], # sysroot
+-
+ # Setup cross-compilation on Linux.
+ ['OS=="linux"', {
+ 'target_defaults': {
+@@ -179,6 +134,35 @@
+ 'ldflags': [
+ '-m64',
+ ],
++ 'conditions': [
++ ['use_lto==1 and clang==0', {
++ 'cflags': [
++ '-fno-fat-lto-objects',
++ '-fuse-linker-plugin',
++ '-flto=4',
++ '--param=lto-partitions=1',
++ ],
++ 'ldflags': [
++ '-fno-fat-lto-objects',
++ '-fuse-linker-plugin',
++ '-flto=4',
++ '--param=lto-partitions=1',
++ ],
++ 'arflags': [
++ '<!@(python <(DEPTH)/tools/ar-flags.py)',
++ ]
++ }],
++ ['use_lto==1 and clang==1', {
++ 'cflags': [
++ '-flto',
++ '-fwhole-program-vtables'
++ ],
++ 'ldflags': [
++ '-flto',
++ '-fwhole-program-vtables'
++ ],
++ }],
++ ],
+ }], # target_arch=="x64" and _toolset=="target"
+ ['target_arch=="arm" and _toolset=="target"', {
+ 'conditions': [
+diff --git a/tools/ar-flags.py b/tools/ar-flags.py
+new file mode 100644
+index 000000000..80b338a6e
+--- /dev/null
++++ b/tools/ar-flags.py
+@@ -0,0 +1,15 @@
++#!/usr/bin/env python
++
++import os
++import subprocess
++
++if __name__ == '__main__':
++ cc = os.environ.get('CC', '/usr/bin/cc')
++ gcc_version = subprocess.check_output(
++ [cc, '-dumpversion'], universal_newlines=True).strip(' \n')
++
++ lto_plugin = os.path.join(
++ '/usr/libexec/gcc/x86_64-pc-linux-gnu/', gcc_version,
++ 'liblto_plugin.so')
++
++ print('--plugin={}'.format(lto_plugin))
+diff --git a/tools/atom_source_root.py b/tools/atom_source_root.py
+new file mode 100644
+index 000000000..316e99701
+--- /dev/null
++++ b/tools/atom_source_root.py
+@@ -0,0 +1,5 @@
++#!/usr/bin/env python
++
++import os.path
++
++print(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
+diff --git a/tools/browserify.py b/tools/browserify.py
+new file mode 100644
+index 000000000..15472c953
+--- /dev/null
++++ b/tools/browserify.py
+@@ -0,0 +1,24 @@
++#!/usr/bin/env python
++
++import os
++import subprocess
++import sys
++
++SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
++
++
++def main():
++ node = sys.argv[1]
++ args = sys.argv[2:]
++
++ call_browserify(node, args)
++
++
++def call_browserify(node, args):
++ browserify = os.path.join(
++ SOURCE_ROOT, 'node_modules', '.bin', 'browserify')
++ subprocess.check_call([node, browserify] + args)
++
++
++if __name__ == '__main__':
++ sys.exit(main())
+diff --git a/tools/get-endianness.py b/tools/get-endianness.py
+new file mode 100644
+index 000000000..31507936f
+--- /dev/null
++++ b/tools/get-endianness.py
+@@ -0,0 +1,4 @@
++#!/usr/bin/env python
++
++import sys
++print(sys.byteorder)
+diff --git a/tools/js2asar.py b/tools/js2asar.py
+index adad1751e..ca7686893 100755
+--- a/tools/js2asar.py
++++ b/tools/js2asar.py
+@@ -11,13 +11,14 @@ SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+ def main():
+- archive = sys.argv[1]
+- folder_name = sys.argv[2]
+- source_files = sys.argv[3:]
++ node = sys.argv[1]
++ archive = sys.argv[2]
++ folder_name = sys.argv[3]
++ source_files = sys.argv[4:]
+
+ output_dir = tempfile.mkdtemp()
+ copy_files(source_files, output_dir)
+- call_asar(archive, os.path.join(output_dir, folder_name))
++ call_asar(node, archive, os.path.join(output_dir, folder_name))
+ shutil.rmtree(output_dir)
+
+
+@@ -28,11 +29,11 @@ def copy_files(source_files, output_dir):
+ shutil.copy2(source_file, output_path)
+
+
+-def call_asar(archive, output_dir):
++def call_asar(node, archive, output_dir):
+ asar = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'asar')
+ if sys.platform in ['win32', 'cygwin']:
+ asar += '.cmd'
+- subprocess.check_call([asar, 'pack', output_dir, archive])
++ subprocess.check_call([node, asar, 'pack', output_dir, archive])
+
+
+ def safe_mkdir(path):
+--
+2.14.1
+
diff --git a/dev-util/electron/files/electron-vendor-node-external-snapshots-r0.patch b/dev-util/electron/files/electron-vendor-node-external-snapshots-r0.patch
new file mode 100644
index 000000000000..d3fce0868cd4
--- /dev/null
+++ b/dev-util/electron/files/electron-vendor-node-external-snapshots-r0.patch
@@ -0,0 +1,116 @@
+From 820cb5ce8e1aa08e68fe0f2e3cbbe74972e7af84 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Sat, 11 Jun 2016 18:27:19 -0400
+Subject: [PATCH] Add support for external V8 snapshots
+
+---
+ src/node.cc | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 86 insertions(+)
+
+diff --git a/src/node.cc b/src/node.cc
+index 961abc2..4dac94b 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -4188,6 +4188,90 @@ Environment* CreateEnvironment(Isolate* isolate,
+ return env;
+ }
+
++#include <sys/mman.h>
++
++const char kProcSelfExe[] = "/proc/self/exe";
++const char kNativesFileName[] = "natives_blob.bin";
++const char kSnapshotFileName[] = "snapshot_blob.bin";
++const char *g_mapped_natives = nullptr;
++const char *g_mapped_snapshot = nullptr;
++
++static char* SnapshotPath(const char* filename) {
++ char *path;
++ char *dir;
++ ssize_t r;
++
++ path = reinterpret_cast<char*>(malloc(4096 + strlen(filename) + 2));
++ if (path == nullptr) {
++ fprintf(stderr, "out of memory\n");
++ ABORT();
++ }
++
++ r = readlink(kProcSelfExe, path, 4096 + 1);
++ if (r == -1) {
++ perror("could not determine node executable directory");
++ ABORT();
++ }
++
++ path[r] = '\0';
++
++ dir = strrchr(path, '/');
++
++ strcpy(dir + 1, filename);
++
++ return path;
++}
++
++static void LoadV8Snapshot(const char* name, const char** addr, size_t *size) {
++ char *path = SnapshotPath(name);
++ int fd;
++ struct stat sb;
++
++ fd = open(path, O_RDONLY);
++
++ if (fd == -1) {
++ fprintf(stderr, "could not open snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ if (fstat(fd, &sb) == -1) {
++ fprintf(stderr, "could not stat snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ *size = sb.st_size;
++
++ *addr = reinterpret_cast<const char*>(
++ mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0));
++ if (*addr == MAP_FAILED) {
++ fprintf(stderr, "could not read snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ close(fd);
++ free(path);
++}
++
++static void LoadV8Snapshots() {
++ size_t natives_size;
++ size_t snapshot_size;
++
++ LoadV8Snapshot(kNativesFileName, &g_mapped_natives, &natives_size);
++ LoadV8Snapshot(kSnapshotFileName, &g_mapped_snapshot, &snapshot_size);
++
++ v8::StartupData natives;
++ natives.data = g_mapped_natives;
++ natives.raw_size = natives_size;
++ V8::SetNativesDataBlob(&natives);
++
++ v8::StartupData snapshot;
++ snapshot.data = g_mapped_snapshot;
++ snapshot.raw_size = snapshot_size;
++ V8::SetSnapshotDataBlob(&snapshot);
++}
+
+ // Entry point for new node instances, also called directly for the main
+ // node instance.
+@@ -4301,6 +4385,8 @@ int Start(int argc, char** argv) {
+ const char** exec_argv;
+ Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
+
++ LoadV8Snapshots();
++
+ #if HAVE_OPENSSL
+ #ifdef NODE_FIPS_MODE
+ // In the case of FIPS builds we should make sure
+--
+2.7.3
+
diff --git a/dev-util/electron/files/electron-vendor-node-external-snapshots-r2.patch b/dev-util/electron/files/electron-vendor-node-external-snapshots-r2.patch
new file mode 100644
index 000000000000..b3cd18c2fe2b
--- /dev/null
+++ b/dev-util/electron/files/electron-vendor-node-external-snapshots-r2.patch
@@ -0,0 +1,117 @@
+From da7d4d995b31fcdc94158bbc4adc01bf9bab78a9 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Sat, 11 Jun 2016 18:27:19 -0400
+Subject: [PATCH] Add support for external V8 snapshots
+
+---
+ src/node.cc | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 87 insertions(+)
+
+diff --git a/src/node.cc b/src/node.cc
+index 66233d451..96e4e22d6 100644
+--- a/src/node.cc
++++ b/src/node.cc
+@@ -4493,6 +4493,91 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
+ return exit_code;
+ }
+
++#include <sys/mman.h>
++
++const char kProcSelfExe[] = "/proc/self/exe";
++const char kNativesFileName[] = "natives_blob.bin";
++const char kSnapshotFileName[] = "snapshot_blob.bin";
++const char *g_mapped_natives = nullptr;
++const char *g_mapped_snapshot = nullptr;
++
++static char* SnapshotPath(const char* filename) {
++ char *path;
++ char *dir;
++ ssize_t r;
++
++ path = reinterpret_cast<char*>(malloc(4096 + strlen(filename) + 2));
++ if (path == nullptr) {
++ fprintf(stderr, "out of memory\n");
++ ABORT();
++ }
++
++ r = readlink(kProcSelfExe, path, 4096 + 1);
++ if (r == -1) {
++ perror("could not determine node executable directory");
++ ABORT();
++ }
++
++ path[r] = '\0';
++
++ dir = strrchr(path, '/');
++
++ strcpy(dir + 1, filename);
++
++ return path;
++}
++
++static void LoadV8Snapshot(const char* name, const char** addr, size_t *size) {
++ char *path = SnapshotPath(name);
++ int fd;
++ struct stat sb;
++
++ fd = open(path, O_RDONLY);
++
++ if (fd == -1) {
++ fprintf(stderr, "could not open snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ if (fstat(fd, &sb) == -1) {
++ fprintf(stderr, "could not stat snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ *size = sb.st_size;
++
++ *addr = reinterpret_cast<const char*>(
++ mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0));
++ if (*addr == MAP_FAILED) {
++ fprintf(stderr, "could not read snapshot file '%s': %s\n",
++ path, sys_errlist[errno]);
++ ABORT();
++ }
++
++ close(fd);
++ free(path);
++}
++
++static void LoadV8Snapshots() {
++ size_t natives_size;
++ size_t snapshot_size;
++
++ LoadV8Snapshot(kNativesFileName, &g_mapped_natives, &natives_size);
++ LoadV8Snapshot(kSnapshotFileName, &g_mapped_snapshot, &snapshot_size);
++
++ v8::StartupData natives;
++ natives.data = g_mapped_natives;
++ natives.raw_size = natives_size;
++ V8::SetNativesDataBlob(&natives);
++
++ v8::StartupData snapshot;
++ snapshot.data = g_mapped_snapshot;
++ snapshot.raw_size = snapshot_size;
++ V8::SetSnapshotDataBlob(&snapshot);
++}
++
+ inline int Start(uv_loop_t* event_loop,
+ int argc, const char* const* argv,
+ int exec_argc, const char* const* exec_argv) {
+@@ -4557,6 +4642,8 @@ int Start(int argc, char** argv) {
+ const char** exec_argv;
+ Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
+
++ LoadV8Snapshots();
++
+ #if HAVE_OPENSSL
+ if (const char* extra = secure_getenv("NODE_EXTRA_CA_CERTS"))
+ crypto::UseExtraCaCerts(extra);
+--
+2.11.1
+
diff --git a/dev-util/electron/files/toolchain/BUILD.gn b/dev-util/electron/files/toolchain/BUILD.gn
new file mode 100644
index 000000000000..78f7b57e3be5
--- /dev/null
+++ b/dev-util/electron/files/toolchain/BUILD.gn
@@ -0,0 +1,19 @@
+import("//build/toolchain/gcc_toolchain.gni")
+
+gcc_toolchain("default") {
+ cc = getenv("CC")
+ cxx = getenv("CXX")
+ ar = getenv("AR")
+ nm = getenv("NM")
+ ld = cxx
+
+ extra_cflags = getenv("CFLAGS")
+ extra_cppflags = getenv("CPPFLAGS")
+ extra_cxxflags = getenv("CXXFLAGS")
+ extra_ldflags = getenv("LDFLAGS")
+
+ toolchain_args = {
+ current_cpu = current_cpu
+ current_os = current_os
+ }
+}
diff --git a/dev-util/electron/metadata.xml b/dev-util/electron/metadata.xml
new file mode 100644
index 000000000000..bb2475cf47a7
--- /dev/null
+++ b/dev-util/electron/metadata.xml
@@ -0,0 +1,26 @@
+<?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="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>Electron is a cross platform application development framework based on web technologies based on Chromium</longdescription>
+ <use>
+ <flag name="hidpi">Enable support for high-resolution screens (high dots per inch)</flag>
+ <flag name="lto">Build with link time optimization enabled</flag>
+ <flag name="pic">Disable optimized assembly code that is not PIC friendly</flag>
+ <flag name="proprietary-codecs">Enable proprietary codecs like H.264, MP3</flag>
+ <flag name="system-ffmpeg">Use system ffmpeg instead of the bundled one</flag>
+ <flag name="tcmalloc">Use bundled tcmalloc instead of system malloc</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">elprans/asar</remote-id>
+ <remote-id type="github">elprans/grit</remote-id>
+ <remote-id type="github">elprans/node-browserify</remote-id>
+ </upstream>
+</pkgmetadata>