From cf632d0153366574fff919d9d93ef9c7888b1d61 Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 24 Nov 2024 00:28:55 +0100 Subject: [PATCH] www-client/cromite: 131.0.6778.85 --- www-client/cromite/Manifest | 9 + .../cromite/cromite-131.0.6778.85.ebuild | 1794 +++++++++++++++++ .../files/chromium-131-fontations.patch | 107 + .../chromium-131-oauth2-client-switches.patch | 39 + .../chromium-131-unbundle-icu-target.patch | 21 + .../files/chromium-131-webrtc-fixes.patch | 21 + www-client/cromite/files/compiler-131.patch | 322 +++ 7 files changed, 2313 insertions(+) create mode 100644 www-client/cromite/cromite-131.0.6778.85.ebuild create mode 100644 www-client/cromite/files/chromium-131-fontations.patch create mode 100644 www-client/cromite/files/chromium-131-oauth2-client-switches.patch create mode 100644 www-client/cromite/files/chromium-131-unbundle-icu-target.patch create mode 100644 www-client/cromite/files/chromium-131-webrtc-fixes.patch create mode 100644 www-client/cromite/files/compiler-131.patch diff --git a/www-client/cromite/Manifest b/www-client/cromite/Manifest index 9a8f3977..d3fd957e 100644 --- a/www-client/cromite/Manifest +++ b/www-client/cromite/Manifest @@ -9,8 +9,11 @@ DIST chromium-129.0.6668.70.tar.xz 6668765016 BLAKE2B a5abb239390d63aa234f4fc046 DIST chromium-129.0.6668.89.tar.xz 6673929928 BLAKE2B eea776a58c8fa4a9cd43f308e710055a925acaa55a76a6d89af6673cbac07113544f1affe219767f53be1f23a8d88b864fde1885e42ac9e8b4751439aef0ce47 SHA512 d49a00e2d76236e591af5db6ad4f0e1a8e13bc6f5001f5837b1c2f158f9c7f5814ca713ed3ad8fdc1edc10f9e156593b0974aa14002964a5ab337b0791d0ef3c DIST chromium-130.0.6723.116.tar.xz 6627714496 BLAKE2B 0a188e0b597098b25559b5af8f12d867c88c094e3dcecddcda89bcb30efd7a3f4f31aa2b6842f394b56a506e0e3dbc0b17a3b5d4a71d751e81ab9d0a19f20e1f SHA512 59d80a401a1b1ddd36f9715472297117d4467a08536e11727c6796dfd8bea5491f019c34f33cd41d6b2172b2e27bed86f5414c3d9cb3cfac14e036d66c2f366a DIST chromium-130.0.6723.58.tar.xz 6613711856 BLAKE2B 80ceb5418517aa19e8b0d1b0429aa0ac118e8e88a33e5385c5a2fcd7eb1119ef46e95cf2d1baa235ab023c222e92ae33c14825ec76988ecfab66d7663fe59790 SHA512 f9b609250bcf8e419dc34aafac942c447f22e264ee72d2f0970b2f08d5b9fa03c4ca362c9cfa0d7d277abdda2f0aeadeffcd250c92b7588cf48fc5ec1d26680b +DIST chromium-131.0.6778.85.tar.xz 7138205800 BLAKE2B ce0ff4f0fe1af8e887269a49aac4f5017a9902e338dc522701fd63edf9ab7840ae4f1c8cfae92f3ac52d4bc89133d9cce386c8c6071c3ea15dd8001e427304d3 SHA512 a48001916cc06c751eaef50e4de9f01afa6445f0f4216e7462ba2aaccb31709a03878a76c20e0f5c85f96cf24088361258cb4ed31be777ee88a62af23b7e85ce +DIST chromium-1f9a4db9f8f0d8b1561a6e264d2d88f064f19fbc.patch 1329 BLAKE2B 1a46b49046fb8dce10ac149c11208a8bc0172cc2b6337875a6e9ef453ea7b87be740dd0a832cb747944b33249d203ba9f9a3bdca309bd2392403e259010bf9b9 SHA512 082912878d0faa54959fd51a805e459d7b773d7f5239f20c50a48a68076dac57a946d4d7e257547bd524e9d3a2112ec363e538aa47967a718583b7ccd37c1574 DIST chromium-2d529e8960f7b46957445333ca25e6a53ca3141c.patch 1288 BLAKE2B 2ce0040ff59061d6176214bbba7dc921ba7786a1ecd044cab781476cb206310ce5f19ee00a637f062ab752ab34c6fe08fd24961c2ecef9bb111f4b66978e213e SHA512 928d9e647321647155986cd6b5bf55f2776d4a6325ec3715cf3168a3b0d4ec6a0d059169b41a2107481770fbd1f7c0f2e0e0ff62bdb8c8cd54c14528bf4ea6b2 DIST chromium-32e65e4c14034d82fd856b38f37e9389ed500495.patch 1195 BLAKE2B 60cfc65a99aad6aec0b11f78c55d846dda99933e6fd0aa3233db9e215cc95b3b8810ed29b3cedb762c0951258dba261afd00d539948805b32dd1c866126bf2d1 SHA512 c483883132452c90acd2f7a44ac5f7df6839ebea970bbd015d0cb89186cbfe48b58bd5c7d84a2f333eef81e6cc27dd9586737ab0d3965ea9b71a909141bae886 +DIST chromium-33af9dc7d2801995990d1bb36ef1d98e3f80ca18.patch 1381 BLAKE2B a8a8721d2caf4de06e83d6f248ad6d0e49ff1bb24f2a4d44a20bbd6bac9249a1bdea87619a6746452cfcd91cc1e514faf31e09eb57c1bb005177e1e23bc0d183 SHA512 99d679fd09c2da4db47f50c81bb7d97571bd7c56304c585e8b51d1ed8fd77cf50cd05e27ecd96d1e4841056d799cedc73e338b99cc9922ad51b238669ec000d7 DIST chromium-39583ff118920284de516d262979960e7159bcfc.patch 1391 BLAKE2B 28815a2a49a78791c74462442863e26c10fbe770e883d82a36b8793f2900c4feea0053f116d9029bfb66b53f2df133fbe8f92635dcd460e3405d34dc9afb5329 SHA512 0ade99c4c8c4acff35502b195b0c46b944f31f2e2c5beb0e9f63a345cceebb1c4dd21e9e3410484f40d75e3ebae170536f651edcaa0b5c8d50edb7272b62a492 DIST chromium-40c273b2c0f5f26e16e67428ceaafd8b339bb61f.patch 1745 BLAKE2B 8df526e88bd22bc27a00ad5fafabcda20865c5fa2bd0ac91523c3b22709a725c010e4290bbb400c3f96f4bce61ca4b13f472fc27e2da34a7a2afa57e912a3f75 SHA512 4debcfe22af457bc3606bb7e394abaf3efd8f6e544f86da4bd3e0e0be81a7201ff038253e8d54fea5765cd1cfb52950e21f98685cf79c5c1a22f8e448b9e894c DIST chromium-47fb59539e5744467eb6f7aae52f5a169910d56c.patch 1405 BLAKE2B e72e76133ef9e75eee65d5e7e840337912f93148ab6bc04d12d64c6d4b58c80fd4f3dfd9f033649948357e3956c6dac04561f9198d5bf443f03438a1dc72bc2e SHA512 714feb8e53b7510072407ac5c0d9026e978805d65a754d62dd53605f2d7dcdb8c5da1634c4a84614872c10f31d6ee2a5c15bb4d621a426ea939b38e42d5e39b8 @@ -20,19 +23,25 @@ DIST chromium-5c1e85eb085658187f4475ff5e56962473b6f10a.patch 1011 BLAKE2B 9e53d7 DIST chromium-7e28832cd3320d2b603e6ef9468581e1c65c14f1.patch 1339 BLAKE2B 8b8c9daa68f981b70627a07d9f7638c33158802d3ece8e7ab4e25734332944407810e8a2aa4f701d8153ccdd72138525598e23660feeb4b8a8e69893cc523d8d SHA512 10298ad3a257488add2e942e5522ac43e7979162acaf037122e437fe0a9734893e9bc03bd6a528d3052bb3ae2efe94fe61fb1fa051307db544e507d17603e4c3 DIST chromium-84fcdd0620a72aa73ea521c682fb246067f2c14d.patch 3730 BLAKE2B 62ac6bd2fbd9ac480b818d5766e466c59789783f038a6c1aee83861e9ebcfd257dea0e9888fa8fceff81923d72042d928593e13fd7685d8b24199dcacfe013c4 SHA512 fc2136d507de85432d8f8173536aae46b6efe98ce3471b4fcdbfc61a14e15b7c06aa8612a7cdedbc53ab95e7d6c703e449b0f34a7c6f85ba4a18bf05753a6b84 DIST chromium-8739a5b33176e82e06a746163c0c76de4908ced9.patch 1635 BLAKE2B 3c8a62403bf90e3e35f237f0774196b8a15669717a4ece79f5d8306fd2bdfe01f7c1f1715609578185c236a12d5cf9c4b4438a6400fc16e4a89e6f7f681c8820 SHA512 0323edb3fb4f34e50035588423af412c16d95ea06fdbc6ff82758b4e640cad803d40989195a2c9782b87759374e42f3d38110ff929224f8e3dce3dfef9a7fae1 +DIST chromium-8fa8d8f68f5bf71e70038994276e0225f006eb73.patch 1098 BLAKE2B 2fe1f1b70c18d80e2baedf26ea42e6907f64cab641ccebb2728e34fb6d7260dadafd7d5caf6f2a24bf5388d216b9c5a8308b689aa4cbc2edbf23d25cb69120de SHA512 16cfc6d27e8cc35c605d9d5aecab0587c88de20db66bd0988617693d97eb34eb529a135db7058ffc96f27c598dad28ebd03e74ddeb48bd8866cd639cb269ee85 DIST chromium-9cf5bed15b577aade699d1704bc2967f5bf6963e.patch 1659 BLAKE2B 15376b33acf970950e663786db6c300eb81c92b86e54bcea0347c1d1339be9fdf20ba60c10d2a7090648d8a1f3b6b0569de4d934f592b24f72a9af534734211e SHA512 c9e8dc5a14ca3d818eea83cba5883cba72873edea578dc70d8013f90a05a595444994f351d359e6dbb5044869b8ea9696385963b8a9116b08435aaaa41115e68 DIST chromium-b51da416e04ecc9edafff531f9678c6404e654b7.patch 1346 BLAKE2B f1215a48fcaf36b70b4cc1430f78d43e84d51089cc4cdfa8508e37574e0aa198bfd99ef99a627ca4b98e79547549a2844dac5debc7b8c026964db15bdaf849aa SHA512 7d1f79184e69d927e025371d3c50a997fe82ce9a328af7be4f7e459a92bb74b5cdc545c7d65974242ae084835cd59f3e1ce7924252cf79e5e698940052bd11d5 DIST chromium-c502d310d8cb91f1c1098a7287e75114023e57f0.patch 1391 BLAKE2B 4d7dbe9c2173d01756f99208804bafa2732d8992c9a9132905964a600103e8b8018aa188a2dfe96e0cf688686b585fffe05930cb3af734c26c648ccb9ad211df SHA512 0c3f681d8cf971511cc325db17bb36e81589c12404e70858a6f41dc3b41d1b0eb4ac8ccb02904218739625275683cd5fd94b7426c57e3d43ae8753303ef1d6aa DIST chromium-dc9db222b929f5da415216134b77d7f3bf141813.patch 1253 BLAKE2B f0480b418bc2b4f0a0a21a10a139f304760b1ffad093a22fca3618afffc452e2bd22e9139751508ef00814f1a5c78391a845632dbdffc205bf73ed2bcf35666e SHA512 929004b1286f15916a4d21b6b7c4f73a6da9d7ed704ad2d52fbc37fe0f967615be0a774890cd4cbc377f99bd8ea3e1560bc837e4dcc9527c4d052195265e5490 DIST chromium-fa382322809185a22a6b3614f425b05f95d8d526.patch 2512 BLAKE2B 413851d28052dcaef9ab354f455c942534647b47a92a90f82f0f5a31b283591b9af72a6aa5af787c9ca2f12cf81de90107a33671e5cea3a579ccf3c327d943ed SHA512 d2d3cf5c00ed256948c6a9025cb0929d963d66f455ddf73a73ee37c0494cb15dfe228d95bca953276018c8cf5920aa3f04de2de884ed96421cc84df74faeb534 +DIST chromium-openpower-a85b64f07b.tar.bz2 387899 BLAKE2B b01fda2d64ce73068d1536a10cc0896f07a4b714cdb25698b1df8b3252baa0c21c4209b307cf1cb554854f6d0bfe3cd35e06aaa8d02ac5d409a119335084c324 SHA512 05eee81677e8766808441c939bee68e2e6c58ec91f471d88a40181d2eda78614a0a6d27d92ff8f9dda564d12f3451bace4ff2727594748c5c238a3533038019b DIST chromium-ppc64le-gentoo-patches-1.tar.xz 5636 BLAKE2B 1d898939df023c59285b27bee552470483ea06375d1ee8d6947b89c5927c23cc7bfec6b49f3b376ece931d11a56f8e2a45791e0f92ad61974fc8c34c1082d89c SHA512 8a71cb007e47cda8e5fe5d185729389e65c48bd322c8ee8b3986bee8571427b959628f2666bda646a3f89ae64197c0957d3626845ff03461dbd5dee4c964d07c DIST chromium_127.0.6533.88-1raptor0~deb12u2.debian.tar.xz 8675684 BLAKE2B 868de8a681496c5da5aa9ebb8d27c84b35313038da85232c89d58f6ab7a4ac15866e8d0650d5283023aa38ab55da93f3b6a97280afdd1a3cf69a021517bfa8ab SHA512 3afea47fedad9c1374b238028ea642cde603f548af9992fdcff836745cf8c4243d0781f56e8710ca1bb22b0a552944c62a67a4799f8073fbe309d0f5a514c724 DIST cromite-00f5239a3c15b6c898b246664f654c19f25b9122.tar.gz 35904556 BLAKE2B 935f3c49b6cdac13e000cce0360bf2b3fd1603d1b8d0c491dd275456ea7b24bd0377b6e24f1a8025616dfdb09f3a9965d54969df1e4e07eadc40f9d0211b539b SHA512 fb323285e3e6d4ba2696ed0d68deb54f5696b4192b6d8ecb37c36d1eeb8bfd02df5a06330b32f9f957b795b111f8c8b48309c70f7aa277b443d8a02e4ca54df7 DIST cromite-38b33957e856350381acf1d3d66af866683a1fba.tar.gz 35870642 BLAKE2B bb5f947b165951d9d20a84436285ff53a1419848a53585c79f01a9712e2ec539829c1ac972c9327f86ba38e6452ac4fb6492e24ae27bb3a2c1685b46d86ee50b SHA512 3fcb863ac27b02b0f4d1690c8de0d71da86918c42a166461f9a221fa8e1487d8cb259f28128155923f7d7ef3ae833b99e6c2bec595a51aee79676a05d318beb4 DIST cromite-5a4953031c9c9322dda2d3bba3ef23d33c753005.tar.gz 35893352 BLAKE2B 5316dfe90e324fda9a8d58123ca013a48e80a8f9f69b9d083712209d09fff406021d9bc3f6620c472a24212e504e6f1702b4e189a4fd65c4e2034491d6462426 SHA512 9e525448bffb79f5906d9410f3423b643bfa618f331a8354a3b8801a529bbb9102f342dc33246fd0403bda48e8cff4a610f4bd0785e775276544f9a6344d1c8f +DIST cromite-5ae31e6b965f3f62c1ad886b5c843921baeedaea.tar.gz 36296583 BLAKE2B 4998b68f31ee51d9c05f102f432e5acd7c678d9c7f16635dd116b06ed28daf4d7410b4aff93a6dd8f22a69031dc0e930969da956420985d089d95f005074db8a SHA512 7a0b55f171b249c8a26b63974e2544bf224500df0cb6e09f6fb936b4e2c12d2bca6e16d7c70df43b883fa26ead500074c987e5903ab02cf38ecb802622770377 DIST cromite-92b738a28cbac49622d6bfb477e7e90af1bffe21.tar.gz 35887953 BLAKE2B 64b2249f90f00b3f16142ace02b696acdbba8a6396a001e20c32eb6724af1a5efec9a681c5dea5e34e329a866927eec9e865a234b56967589738da0479848556 SHA512 d9c87409ef459e7dac776be5b479bc96a93ae34027ad52e5ca73eec502164a8ebf773a19ff57eb746885501763835d50e0ab3da078b32e77aa6a52add8cfcb9e DIST cromite-bbcb812cffa4e2815760cd7fc3e34b00b4e39ea1.tar.gz 35885387 BLAKE2B fc0355920c8a5b946a782b6ce32fa52e7b22e9085c5a23b1aa345089a7d21fd86f017c33ec955c12b43e3eb9dd99bd831287fbd6115b8736151cfb256f79dcf0 SHA512 8528c6300e8bf9a5361cfcc7e8bb337b5f342a55b2e54e4097f8f69f244f13b2dd5e83c3b5546f1899748bd05f3f3fcb8828d3c180513820cefefe4cb0c0be4e DIST cromite-c609027f1a1a0961bb668668edd866e741579109.tar.gz 35875956 BLAKE2B 9a981dd7541c0926eddfeacc4446e2913044a03e3ae3c4ecfcc370ca6893bab22c000beb36d190e6999e5abf29783739cdf7bca70db763a846ffa2ffeae44814 SHA512 163e1ed7d9c38efc90b1bc554855597c90e6c2043d5c15c18b83bf7affc76a968f6c0fe5e9b8eff4159d16f405c6089e111b9845c547ac64ecff5a65037d0442 DIST cromite-d4e0398fed306a35df814f6217fe53099032af50.tar.gz 35889112 BLAKE2B 0aabe997c1d7248f6c503b740a333e96e7511d95154706df3c4e3de59342082346e9c9dcf836002d3c2646c0150832651c07b07fad8f214400c8e6bc7d76891b SHA512 ba3d7d7233ba592373690d9a5d88ecc64c7f28e366b9e4455eceb1536842a6f35335e9b659dd42a318ff5443704fc07c2d5a77e183944fca3efd446ad6e29c86 DIST cromite-eae1e049fa1afb405bd1debdebdbbd407af6d2ac.tar.gz 35908070 BLAKE2B c7e67bfba68e42092b51366ddb9a958fa9f40e6a32d9b43bd938a4fe8e55ef2411f95d3beceb5980c870df037b9264909454dd5474fdde0b0d71da7f81fbde24 SHA512 9e2d39aacfa293977d7d4febe0ac8edaae72ed466090f5e438de5ba69fbc52d3537de7a21ac73b72f64ba138f65d552957fbc024c66f7716fa66de0dc28e4c68 +DIST dawn-3ff08caa35db539fcc3dded353ec03c9f6a6efe7.patch 995 BLAKE2B 6b24659c4f9109aa6730e2722883876904e3a947e2718af907641c22c375ae5a0b038e52891f3cedf270192c4f8cc38b041aa161c754993bf7c66ff85394bf94 SHA512 889db2a08b7052e682deb6fdf1772fdaf98dadc1cbe16a2196533d83c1a6162178947fa42630d5f6b1582ad72a17dbd7b4a2b4fd2263a32c9c46be76aa7b0ff1 +DIST ink-047055e64ec01205365d0b1357bc2b00c547eb93.patch 2348 BLAKE2B 82578bb5a4ea22e4da0ea4974d3c1f71815c49a46aebed91c39c7edd0f18dd0b230321fcdd5191063aa6291f337a4e2afc870ab53edf3da65c66514f387bb549 SHA512 24d842913f7c935200dcad6212b2ec8609d8df5c866c1f83da0ba67f86858ae2ae1bdb3d20429276145e39b00da5700ede4474278f736b98d940dc11f680745d DIST ruy-587c2cf8b11d3c32fa26887063eda3171a3d353e.patch 684 BLAKE2B d00895efda90c4254ceb875e52d2959cb0d4c95cfc98775a02a6430f60f038c7da701316de40888e5f63ad907f087bff105d79ee9c9bd386bae5053de9517a64 SHA512 93c78353c0f3d50d4ebfcbf34b0b5d2c2bc3e1a38bc0e545d2e547010f540dbe2e0e284362810a554f58e300d3c770d35ec49ff87e565dc4b66537ac515109a5 +DIST webrtc-36e597995147c021798182a5ebe1681f11f730fd.patch 1559 BLAKE2B 7639fab0eb2d7ccd81f5c93cb5f06489238c006e306e7fd6efabbd618c57006235447157e4e145a466ae7c5d2a01c63e930568c5f7cbdeb9b86b81b16b1ecbff SHA512 4926e2811e22e8a8ca61efb928b9d22e932d57b86db3940b3fa1406b550d8d0c942073e230e5f078d5f817639672eadb2d051ee63a7329aa3cdb890880deed5c diff --git a/www-client/cromite/cromite-131.0.6778.85.ebuild b/www-client/cromite/cromite-131.0.6778.85.ebuild new file mode 100644 index 00000000..d1cddd8c --- /dev/null +++ b/www-client/cromite/cromite-131.0.6778.85.ebuild @@ -0,0 +1,1794 @@ +# Copyright 2009-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..13} ) +PYTHON_REQ_USE="xml(+)" + +CHROMIUM_LANGS="af am ar as az be bg bn bs ca cs cy da de el en-GB es es-419 et eu fa fi fil + fr fr-CA gl gu he hi hr hu hy id is it ja ka kk km kn ko ky lo lt lv mk ml mn mr ms my + nb ne nl or pa pl pt-BR pt-PT ro ru si sk sl sq sr sr-Latn sv sw ta te th tr uk ur uz + vi zh-CN zh-HK zh-TW zu" + +inherit check-reqs chromium-2 desktop flag-o-matic llvm ninja-utils pax-utils +inherit python-any-r1 qmake-utils readme.gentoo-r1 toolchain-funcs xdg-utils + +# Use following environment variables to customise the build +# EXTRA_GN — pass extra options to gn +# NINJAOPTS="-k0 -j8" useful to populate ccache even if ebuild is still failing + +CROMITE_COMMIT_ID="5ae31e6b965f3f62c1ad886b5c843921baeedaea" +# CROMITE_PR_COMMITS=( +# 8a749421011cf10f461bdd5619a0bfda6a4ae0f7 +# ) + +DESCRIPTION="Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser!" +HOMEPAGE="https://github.com/uazo/cromite" +PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6" +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${PV/_*}.tar.xz + https://github.com/uazo/${PN}/archive/${CROMITE_COMMIT_ID}.tar.gz -> ${PN}-${CROMITE_COMMIT_ID}.tar.gz + ppc64? ( + https://gitlab.solidsilicon.io/public-development/open-source/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2 + ) +" +# Gentoo tarball: +# https://chromium-tarballs.distfiles.gentoo.org/chromium-${PV/_*}.tar.xz -> chromium-${PV/_*}-gentoo.tar.xz + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +IUSE_SYSTEM_LIBS="abseil-cpp av1 brotli crc32c double-conversion ffmpeg +harfbuzz +icu jsoncpp +libevent libjxl +libusb libvpx +openh264 openjpeg +png re2 snappy woff2 +zstd" +IUSE="+X bluetooth cfi +clang convert-dict cups cpu_flags_arm_neon custom-cflags debug enable-driver gtk4 hangouts headless hevc kerberos libcxx nvidia +official optimize-thinlto optimize-webui override-data-dir pax-kernel pgo +proprietary-codecs pulseaudio qt5 qt6 screencast selinux thinlto vaapi wayland widevine" +RESTRICT=" + !system-ffmpeg? ( proprietary-codecs? ( bindist ) ) + !system-openh264? ( bindist ) +" +REQUIRED_USE=" + thinlto? ( clang ) + optimize-thinlto? ( thinlto ) + cfi? ( thinlto ) + pgo? ( clang ) + x86? ( !thinlto !widevine ) + debug? ( !official ) + screencast? ( wayland ) + !headless? ( || ( X wayland ) ) + !proprietary-codecs? ( !hevc ) + hevc? ( system-ffmpeg ) + vaapi? ( !system-av1 !system-libvpx ) +" + +declare -A CHROMIUM_COMMITS=( + ["587c2cf8b11d3c32fa26887063eda3171a3d353e"]="third_party/ruy/src" + ["3ff08caa35db539fcc3dded353ec03c9f6a6efe7"]="third_party/dawn" + ["36e597995147c021798182a5ebe1681f11f730fd"]="third_party/webrtc" + ["047055e64ec01205365d0b1357bc2b00c547eb93"]="third_party/ink/src" + ["-84fcdd0620a72aa73ea521c682fb246067f2c14d"]="." + ["33af9dc7d2801995990d1bb36ef1d98e3f80ca18"]="." #132+ + ["8fa8d8f68f5bf71e70038994276e0225f006eb73"]="." #132+ + ["1f9a4db9f8f0d8b1561a6e264d2d88f064f19fbc"]="." #132+ +) + +if [ ! -z "${CROMITE_PR_COMMITS[*]}" ]; then + for i in "${CROMITE_PR_COMMITS[@]}"; do + SRC_URI+="https://github.com/uazo/${PN}/commit/$i.patch?full_index=true -> ${PN}-$i.patch + " + done +fi + +if [ ! -z "${CHROMIUM_COMMITS[*]}" ]; then + for i in "${!CHROMIUM_COMMITS[@]}"; do + if [[ ${CHROMIUM_COMMITS[$i]} =~ webrtc ]]; then + #TODO: is it safe to use this mirror? + SRC_URI+="https://github.com/webrtc-mirror/webrtc/commit/${i/-}.patch?full_index=true -> webrtc-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ angle ]]; then + SRC_URI+="https://github.com/google/angle/commit/${i/-}.patch?full_index=true -> angle-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ quiche ]]; then + SRC_URI+="https://github.com/google/quiche/commit/${i/-}.patch?full_index=true -> quiche-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ dawn ]]; then + SRC_URI+="https://github.com/google/dawn/commit/${i/-}.patch?full_index=true -> dawn-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ ink ]]; then + SRC_URI+="https://github.com/google/ink/commit/${i/-}.patch?full_index=true -> ink-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ vulkan-utility-libraries ]]; then + SRC_URI+="https://github.com/KhronosGroup/Vulkan-Utility-Libraries/commit/${i/-}.patch?full_index=true -> vulkan-utility-libraries-${i/-}.patch + " + elif [[ ${CHROMIUM_COMMITS[$i]} =~ ruy ]]; then + SRC_URI+="https://github.com/google/ruy/commit/${i/-}.patch?full_index=true -> ruy-${i/-}.patch + " + else + SRC_URI+="https://github.com/chromium/chromium/commit/${i/-}.patch?full_index=true -> chromium-${i/-}.patch + " + fi + done +fi + + +for i in ${IUSE_SYSTEM_LIBS}; do + [[ $i =~ ^(\+)?(.*)$ ]] + IUSE+=" ${BASH_REMATCH[1]}system-${BASH_REMATCH[2]}" +done + +COMMON_X_DEPEND=" + x11-libs/libXcomposite:= + x11-libs/libXcursor:= + x11-libs/libXdamage:= + x11-libs/libXfixes:= + >=x11-libs/libXi-1.6.0:= + x11-libs/libXrandr:= + x11-libs/libXrender:= + x11-libs/libXtst:= + x11-libs/libxshmfence:= +" + +COMMON_SNAPSHOT_DEPEND=" + system-abseil-cpp? ( >=dev-cpp/abseil-cpp-20230125.2 ) + system-brotli? ( >=app-arch/brotli-9999 ) + system-crc32c? ( dev-libs/crc32c ) + system-double-conversion? ( dev-libs/double-conversion ) + system-woff2? ( media-libs/woff2 ) + system-snappy? ( app-arch/snappy ) + system-jsoncpp? ( dev-libs/jsoncpp ) + system-libevent? ( dev-libs/libevent ) + system-libjxl? ( media-libs/libjxl ) + system-openjpeg? ( media-libs/openjpeg:2= ) + system-re2? ( >=dev-libs/re2-0.2019.08.01:= ) + system-libvpx? ( >=media-libs/libvpx-1.13.0:=[postproc] ) + system-libusb? ( virtual/libusb:1 ) + system-icu? ( >=dev-libs/icu-71.1:= ) + >=dev-libs/libxml2-2.12.4:=[icu] + dev-libs/nspr:= + >=dev-libs/nss-3.26:= + dev-libs/libxslt:= + media-libs/fontconfig:= + >=media-libs/freetype-2.11.0-r1:= + system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] ) + media-libs/lcms + media-libs/libjpeg-turbo:= + system-png? ( media-libs/libpng:= ) + system-zstd? ( >=app-arch/zstd-1.5.5:= ) + >=media-libs/libwebp-0.4.0:= + media-libs/mesa:=[gbm(+)] + >=media-libs/openh264-1.6.0:= + system-av1? ( + >=media-libs/dav1d-1.0.0:= + >=media-libs/libaom-3.7.0:= + ) + sys-libs/zlib:= + x11-libs/libdrm:= + !headless? ( + dev-libs/glib:2 + >=media-libs/alsa-lib-1.0.19:= + pulseaudio? ( + || ( + media-libs/libpulse + >=media-sound/apulse-0.1.9 + ) + ) + sys-apps/pciutils:= + kerberos? ( virtual/krb5 ) + vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] ) + X? ( + x11-base/xorg-proto:= + x11-libs/libX11:= + x11-libs/libxcb:= + x11-libs/libXext:= + ) + x11-libs/libxkbcommon:= + wayland? ( + dev-libs/libffi:= + dev-libs/wayland:= + screencast? ( + media-video/pipewire:= + || ( + sys-apps/xdg-desktop-portal-gnome + sys-apps/xdg-desktop-portal-gtk + kde-plasma/xdg-desktop-portal-kde + gui-libs/xdg-desktop-portal-lxqt + gui-libs/xdg-desktop-portal-wlr + ) + ) + ) + ) +" + +COMMON_DEPEND=" + ${COMMON_SNAPSHOT_DEPEND} + app-arch/bzip2:= + dev-libs/expat:= + system-ffmpeg? ( + >=media-video/ffmpeg-4.3:= + || ( + media-video/ffmpeg[-samba] + >=net-fs/samba-4.5.10-r1[-debug(-)] + ) + >=media-libs/opus-1.3.1:= + ) + net-misc/curl[ssl] + sys-apps/dbus:= + media-libs/flac:= + sys-libs/zlib:=[minizip] + !headless? ( + X? ( ${COMMON_X_DEPEND} ) + >=app-accessibility/at-spi2-core-2.46.0:2 + media-libs/mesa:=[X?,wayland?] + cups? ( >=net-print/cups-1.3.11:= ) + virtual/udev + x11-libs/cairo:= + x11-libs/gdk-pixbuf:2 + x11-libs/pango:= + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtwidgets:5 + ) + qt6? ( dev-qt/qtbase:6[gui,widgets] ) + ) +" + +RDEPEND="${COMMON_DEPEND} + !headless? ( + || ( + x11-libs/gtk+:3[X?,wayland?] + gui-libs/gtk:4[X?,wayland?] + ) + qt5? ( dev-qt/qtgui:5[X?,wayland?] ) + qt6? ( dev-qt/qtbase:6[X?,wayland?] ) + ) + virtual/ttf-fonts + selinux? ( sec-policy/selinux-chromium ) + !override-data-dir? ( + !www-client/chromium + !www-client/chromium-bin + !www-client/ungoogled-chromium-bin + !www-client/ungoogled-chromium[-override-data-dir] + ) +" + +DEPEND="${COMMON_DEPEND} + !headless? ( + gtk4? ( gui-libs/gtk:4[X?,wayland?] ) + !gtk4? ( x11-libs/gtk+:3[X?,wayland?] ) + ) +" + +BDEPEND=" + ${COMMON_SNAPSHOT_DEPEND} + ${PYTHON_DEPS} + $(python_gen_any_dep ' + dev-python/setuptools[${PYTHON_USEDEP}] + ') + >=app-arch/gzip-1.7 + !headless? ( + qt5? ( dev-qt/qtcore:5 ) + qt6? ( dev-qt/qtbase:6 ) + ) + >=dev-build/gn-0.2114 + dev-build/ninja + dev-lang/perl + >=dev-util/gperf-3.0.3 + dev-vcs/git + >=net-libs/nodejs-7.6.0[inspector] + >=sys-devel/bison-2.4.3 + sys-devel/flex + virtual/pkgconfig + clang? ( + pgo? ( >sys-devel/clang-19.0.0_pre20240518 >sys-devel/lld-19.0.0_pre20240518 ) + !pgo? ( sys-devel/clang sys-devel/lld ) + ) + cfi? ( sys-devel/clang-runtime[sanitize] ) +" + +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then + EBUILD_DEATH_HOOKS+=" chromium_pkg_die"; +fi + +DISABLE_AUTOFORMATTING="yes" +DOC_CONTENTS=" +Some web pages may require additional fonts to display properly. +Try installing some of the following packages if some characters +are not displayed properly: +- media-fonts/arphicfonts +- media-fonts/droid +- media-fonts/ipamonafont +- media-fonts/noto +- media-fonts/ja-ipafonts +- media-fonts/takao-fonts +- media-fonts/wqy-microhei +- media-fonts/wqy-zenhei + +To fix broken icons on the Downloads page, you should install an icon +theme that covers the appropriate MIME types, and configure this as your +GTK+ icon theme. + +For native file dialogs in KDE, install kde-apps/kdialog. + +To make password storage work with your desktop environment you may +have install one of the supported credentials management applications: +- app-crypt/libsecret (GNOME) +- kde-frameworks/kwallet (KDE) +If you have one of above packages installed, but don't want to use +them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS +in /etc/chromium/default. +" + +S="${WORKDIR}/chromium-${PV/_*}" + +python_check_deps() { + python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]" +} + +pre_build_checks() { + # Check build requirements: bugs #471810, #541816, #914220 + # We're going to start doing maths here on the size of an unpacked source tarball, + # this should make updates easier as chromium continues to balloon in size. + local BASE_DISK=18 + local EXTRA_DISK=1 + local CHECKREQS_MEMORY="4G" + tc-is-cross-compiler && EXTRA_DISK=2 + if use thinlto || use pgo; then + CHECKREQS_MEMORY="9G" + tc-is-cross-compiler && EXTRA_DISK=4 + use pgo && EXTRA_DISK=8 + fi + if is-flagq '-g?(gdb)?([1-9])'; then + if use custom-cflags; then + EXTRA_DISK=13 + fi + CHECKREQS_MEMORY="16G" + fi + CHECKREQS_DISK_BUILD="$((BASE_DISK + EXTRA_DISK))G" + check-reqs_${EBUILD_PHASE_FUNC} +} + +pkg_pretend() { + if use libcxx; then + ewarn + ewarn "Building with libcxx, please be aware that system-*" + ewarn "and some other c++ dependencies need to be compiled" + ewarn "with the same c++ library as ungoogled-chromium itself" + ewarn "dev-libs/jsoncpp is most problematic, see #58 #49 #119 for details" + ewarn "Simplest solution would be to disable corresponding system-* flags" + ewarn + fi + if use cfi; then + ewarn + ewarn "Building with cfi is only possible if building with -stdlib=libc++" + ewarn "Make sure all dependencies are also built this way, see #40" + ewarn + fi + if use system-abseil-cpp; then + ewarn + ewarn "Chromium code is not very friendly to system abseil-cpp, see #218" + ewarn "If you know how to fix this, feel free to submit a PR" + ewarn + [[ -z "${NODIE}" ]] && die "The build will fail!" + fi + ewarn + ewarn "jxl is temporarily disabled in chromite, see:" + ewarn "https://github.com/uazo/cromite/issues/1365" + ewarn + pre_build_checks + + if use headless; then + local headless_unused_flags=("cups" "kerberos" "pulseaudio" "qt5" "qt6" "vaapi" "wayland") + for myiuse in ${headless_unused_flags[@]}; do + use ${myiuse} && ewarn "Ignoring USE=${myiuse}, USE=headless is set." + done + fi +} + +pkg_setup() { + pre_build_checks + + chromium_suid_sandbox_check_kernel_config +} + +src_unpack() { + # Here be dragons! + local XCLD="--exclude=chromium-${PV/_*}/third_party/instrumented_libs \ + --exclude=chromium-${PV/_*}/third_party/llvm \ + --exclude=chromium-${PV/_*}/third_party/llvm-build \ + --exclude=chromium-${PV/_*}/third_party/node/linux \ + --exclude=chromium-${PV/_*}/third_party/rust-src \ + --exclude=chromium-${PV/_*}/third_party/rust-toolchain \ + --exclude=chromium-${PV/_*}/build/linux/debian_bullseye_i386-sysroot \ + --exclude=chromium-${PV/_*}/build/linux/debian_bullseye_amd64-sysroot \ + --exclude=chromium-${PV/_*}/third_party/angle/third_party/VK-GL-CTS \ + " + + if ! use libcxx ; then + XCLD+=" --exclude=chromium-${PV/_*}/third_party/libc++" + fi + + if ! use pgo ; then + XCLD+=" --exclude=chromium-${PV/_*}/chrome/build/pgo_profiles" + fi + + einfo "Unpacking chromium-${PV/_*}.tar.xz to ${WORKDIR}" + # Gentoo tarball: + # tar ${XCLD} -xf "${DISTDIR}/chromium-${PV/_*}-gentoo.tar.xz" -C "${WORKDIR}" || die + tar ${XCLD} -xf "${DISTDIR}/chromium-${PV/_*}.tar.xz" -C "${WORKDIR}" || die + # Warned you! + + unpack cromite-${CROMITE_COMMIT_ID}.tar.gz + + if use ppc64; then + unpack chromium-openpower-${PPC64_HASH:0:10}.tar.bz2 + fi +} + +src_prepare() { + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + cp -f "${FILESDIR}/compiler-131.patch" "${T}/compiler.patch" + if ! use custom-cflags; then #See #25 #92 + sed -i '/default_stack_frames/Q' "${T}/compiler.patch" || die + fi + + # disable global media controls, crashes with libstdc++ + sed -i -e \ + "/\"GlobalMediaControlsCastStartStop\"/,+4{s/ENABLED/DISABLED/;}" \ + "chrome/browser/media/router/media_router_feature.cc" + + local PATCHES=( + "${T}/compiler.patch" + "${FILESDIR}/chromium-cross-compile.patch" + "${FILESDIR}/chromium-109-system-openh264.patch" + "${FILESDIR}/chromium-109-system-zlib.patch" + "${FILESDIR}/chromium-111-InkDropHost-crash.patch" + "${FILESDIR}/chromium-131-unbundle-icu-target.patch" + "${FILESDIR}/chromium-131-oauth2-client-switches.patch" + "${FILESDIR}/chromium-131-const-atomicstring-conversion.patch" + "${FILESDIR}/chromium-125-cloud_authenticator.patch" + "${FILESDIR}/chromium-123-qrcode.patch" + "${FILESDIR}/perfetto-system-zlib.patch" + "${FILESDIR}/chromium-127-cargo_crate.patch" + "${FILESDIR}/chromium-127-crabby.patch" + "${FILESDIR}/chromium-128-gtk-fix-prefers-color-scheme-query.patch" + "${FILESDIR}/chromium-128-cfi-split-lto-unit.patch" + "${FILESDIR}/chromium-131-fontations.patch" + "${FILESDIR}/chromium-129-no-link-builtins.patch" + "${FILESDIR}/restore-x86-r2.patch" + "${FILESDIR}/chromium-127-separate-qt56.patch" + "${FILESDIR}/chromium-131-webrtc-fixes.patch" + "${FILESDIR}/00LIN-Build-fixes.patch" + ) + + shopt -s globstar nullglob + # 130: moved the PPC64 patches into the chromium-patches repo + local patch + for patch in "${WORKDIR}/chromium-patches-${PATCH_V}"/**/*.patch; do + elog "Applying patch: ${patch}" + if [[ ${patch} == *"ppc64le"* ]]; then + use ppc64 && PATCHES+=( "${patch}" ) + else + PATCHES+=( "${patch}" ) + fi + done + + # # We can't use the bundled compiler builtins with the system toolchain + # # `grep` is a development convenience to ensure we fail early when google changes something. + # local builtins_match="if (is_clang && !is_nacl && !is_cronet_build) {" + # grep -q "${builtins_match}" build/config/compiler/BUILD.gn || die "Failed to disable bundled compiler builtins" + # sed -i -e "/${builtins_match}/,+2d" build/config/compiler/BUILD.gn + + if use ppc64; then + # Above this level there are ungoogled-chromium patches that we can't apply + local patchset_dir="${WORKDIR}/openpower-patches-${PPC64_HASH}/patches/ppc64le" + # Apply the OpenPOWER patches + local power9_patch="patches/ppc64le/core/baseline-isa-3-0.patch" + for patch in ${patchset_dir}/**/*.{patch,diff}; do + if [[ ${patch} == *"${power9_patch}" ]]; then + use cpu_flags_ppc_vsx3 && PATCHES+=( "${patch}" ) + else + PATCHES+=( "${patch}" ) + fi + done + + PATCHES+=( "${WORKDIR}/openpower-patches-${PPC64_HASH}/patches/upstream/blink-fix-size-assertions.patch" ) + fi + + shopt -u globstar nullglob + + ewarn + ewarn "Following features are disabled:" + ewarn " - Fontations Rust font stack" + ewarn " - Crabby Avif parser/decoder implementation in Rust" + ewarn + + if ! use libcxx ; then + PATCHES+=( + "${FILESDIR}/chromium-130-libstdc++.patch" + "${FILESDIR}/font-gc-r2.patch" + ) + fi + + if [ ! -z "${CHROMIUM_COMMITS[*]}" ]; then + for i in "${!CHROMIUM_COMMITS[@]}"; do + if [[ ${CHROMIUM_COMMITS[$i]} =~ webrtc ]]; then + patch_prefix="webrtc" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ angle ]]; then + patch_prefix="angle" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ quiche ]]; then + patch_prefix="quiche" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ dawn ]]; then + patch_prefix="dawn" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ ink ]]; then + patch_prefix="ink" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ vulkan-utility-libraries ]]; then + patch_prefix="vulkan-utility-libraries" + elif [[ ${CHROMIUM_COMMITS[$i]} =~ ruy ]]; then + patch_prefix="ruy" + else + patch_prefix="chromium" + fi + pushd "${CHROMIUM_COMMITS[$i]}" > /dev/null || die + if [[ $i = -* ]]; then + einfo "Reverting ${patch_prefix}-${i/-}.patch" + git_wrapper apply -R --exclude="*unittest.cc" --exclude="DEPS" \ + -p1 < "${DISTDIR}/${patch_prefix}-${i/-}.patch" + else + einfo "Applying ${patch_prefix}-${i/-}.patch" + git_wrapper apply --exclude="*unittest.cc" --exclude="DEPS" \ + -p1 < "${DISTDIR}/${patch_prefix}-${i/-}.patch" + fi + popd > /dev/null || die + done + fi + + if ! use bluetooth ; then + PATCHES+=( + "${FILESDIR}/disable-bluez-r1.patch" + ) + fi + + if use convert-dict ; then + PATCHES+=( + "${FILESDIR}/chromium-ucf-dict-utility-r1.patch" + ) + fi + + if use system-ffmpeg; then + PATCHES+=( + "${FILESDIR}/chromium-99-opus.patch" + ) + if has_version " gn leftovers + third_party/speech-dispatcher + third_party/usb_ids + third_party/xdg-utils + ) + if ! use system-harfbuzz; then + keeplibs+=( third_party/harfbuzz-ng ) + fi + + if ! use system-ffmpeg; then + keeplibs+=( third_party/ffmpeg third_party/opus ) + fi + + if ! use system-icu; then + keeplibs+=( third_party/icu ) + fi + + if ! use system-png; then + keeplibs+=( third_party/libpng ) + fi + + if ! use system-zstd; then + keeplibs+=( third_party/zstd ) + fi + + if ! use system-av1; then + keeplibs+=( + third_party/dav1d + third_party/libaom + third_party/libaom/source/libaom/third_party/fastfeat + third_party/libaom/source/libaom/third_party/SVT-AV1 + third_party/libaom/source/libaom/third_party/vector + third_party/libaom/source/libaom/third_party/x86inc + ) + fi + + if use libcxx; then + keeplibs+=( third_party/libc++ ) + fi + + if ! use system-openh264; then + keeplibs+=( third_party/openh264 ) + fi + + if ! use system-re2; then + keeplibs+=( third_party/re2 ) + fi + + # Arch-specific + if use arm64 || use ppc64 ; then + keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 ) + fi + # we need to generate ppc64 stuff because upstream does not ship it yet + # it has to be done before unbundling. + if use ppc64; then + pushd third_party/libvpx >/dev/null || die + mkdir -p source/config/linux/ppc64 || die + # requires git and clang, bug #832803 + # Revert https://chromium.googlesource.com/chromium/src/+/b463d0f40b08b4e896e7f458d89ae58ce2a27165%5E%21/third_party/libvpx/generate_gni.sh + # and https://chromium.googlesource.com/chromium/src/+/71ebcbce867dd31da5f8b405a28fcb0de0657d91%5E%21/third_party/libvpx/generate_gni.sh + # since we're not in a git repo + sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g; /^git -C/d; /git cl/d; /cd \$BASE_DIR\/\$LIBVPX_SRC_DIR/ign format --in-place \$BASE_DIR\/BUILD.gn\ngn format --in-place \$BASE_DIR\/libvpx_srcs.gni" \ + generate_gni.sh || die + ./generate_gni.sh || die + popd >/dev/null || die + + pushd third_party/ffmpeg >/dev/null || die + cp libavcodec/ppc/h264dsp.c libavcodec/ppc/h264dsp_ppc.c || die + cp libavcodec/ppc/h264qpel.c libavcodec/ppc/h264qpel_ppc.c || die + popd >/dev/null || die + fi + + keeplibs+=( third_party/ungoogled ) + + ebegin "Removing bundled libraries" + # Remove most bundled libraries. Some are still needed. + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove + eend $? || die + + # bundled eu-strip is for amd64 only and we don't want to pre-stripped binaries + mkdir -p buildtools/third_party/eu-strip/bin || die + ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die +} + +src_configure() { + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + local myconf_gn="" + + # Make sure the build system will use the right tools, bug #340795. + tc-export AR CC CXX NM + + if use clang && ! tc-is-clang ; then + einfo "Enforcing the use of clang due to USE=clang ..." + if tc-is-cross-compiler; then + CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}" + CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}" + BUILD_CC=${CBUILD}-clang + BUILD_CXX=${CBUILD}-clang++ + else + CC=${CHOST}-clang + CXX=${CHOST}-clang++ + fi + strip-unsupported-flags + elif ! use clang && ! tc-is-gcc ; then + einfo "Enforcing the use of gcc due to USE=-clang ..." + CC=${CHOST}-gcc + CXX=${CHOST}-g++ + strip-unsupported-flags + fi + + if tc-is-clang; then + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false" + else + myconf_gn+=" is_clang=false" + fi + + # Force lld for lto or pgo builds only, otherwise disable, bug 641556 + if use thinlto || use pgo || use nvidia; then + myconf_gn+=" use_lld=true" + else + myconf_gn+=" use_lld=false" + fi + + if use thinlto || use pgo; then + AR=llvm-ar + NM=llvm-nm + if tc-is-cross-compiler; then + BUILD_AR=llvm-ar + BUILD_NM=llvm-nm + fi + fi + + # Define a custom toolchain for GN + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" + + if tc-is-cross-compiler; then + tc-export BUILD_{AR,CC,CXX,NM} + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\"" + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\"" + myconf_gn+=" pkg_config=\"$(tc-getPKG_CONFIG)\"" + myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\"" + + # setup cups-config, build system only uses --libs option + if use cups; then + mkdir "${T}/cups-config" || die + cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die + export PATH="${PATH}:${T}/cups-config" + fi + + # Don't inherit PKG_CONFIG_PATH from environment + local -x PKG_CONFIG_PATH= + else + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" + fi + + # Disable rust for now; it's only used for testing and we don't need the additional bdep + myconf_gn+=" enable_rust=false" + + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. + myconf_gn+=" is_debug=$(usex debug true false)" + + # enable DCHECK with USE=debug only, increases chrome binary size by 30%, bug #811138. + # DCHECK is fatal by default, make it configurable at runtime, #bug 807881. + myconf_gn+=" dcheck_always_on=$(usex debug true false)" + myconf_gn+=" dcheck_is_configurable=$(usex debug true false)" + + myconf_gn+=" enable_iterator_debugging=$(usex debug true false)" + + if use debug; then + myconf_gn+=" symbol_level=2" + myconf_gn+=" blink_symbol_level=2" + myconf_gn+=" v8_symbol_level=2" + else + myconf_gn+=" symbol_level=0" + myconf_gn+=" blink_symbol_level=0" + myconf_gn+=" v8_symbol_level=0" + fi + + # Component build isn't generally intended for use by end users. It's mostly useful + # for development and debugging. + myconf_gn+=" is_component_build=false" + + # Disable nacl, we can't build without pnacl (http://crbug.com/269560). + myconf_gn+=" enable_nacl=false" + + local gn_system_libraries=( + flac + fontconfig + freetype + libdrm + libjpeg + libwebp + libxml + libxslt + zlib + ) + if use system-abseil-cpp; then + gn_system_libraries+=( + absl_algorithm + absl_base + absl_cleanup + absl_container + absl_debugging + absl_flags + absl_functional + absl_hash + absl_log + absl_log_internal + absl_memory + absl_meta + absl_numeric + absl_random + absl_status + absl_strings + absl_synchronization + absl_time + absl_types + absl_utility + ) + fi + if use system-brotli; then + gn_system_libraries+=( brotli ) + fi + if use system-crc32c; then + gn_system_libraries+=( crc32c ) + fi + if use system-double-conversion; then + gn_system_libraries+=( double-conversion ) + fi + if use system-woff2; then + gn_system_libraries+=( woff2 ) + fi + if use nvidia; then + gn_system_libraries+=( libXNVCtrl ) + fi + if use system-ffmpeg; then + gn_system_libraries+=( ffmpeg opus ) + fi + if use system-jsoncpp; then + gn_system_libraries+=( jsoncpp ) + fi + if use system-icu; then + gn_system_libraries+=( icu ) + fi + if use system-png; then + gn_system_libraries+=( libpng ) + myconf_gn+=" use_system_libpng=true" + fi + if use system-zstd; then + gn_system_libraries+=( zstd ) + fi + if use system-av1; then + gn_system_libraries+=( dav1d libaom ) + fi + if use system-libusb; then + gn_system_libraries+=( libusb ) + fi + if use system-libvpx; then + gn_system_libraries+=( libvpx ) + fi + if use system-libevent; then + gn_system_libraries+=( libevent ) + fi + if use system-libjxl; then + gn_system_libraries+=( libjxl ) + fi + use system-openh264 && gn_system_libraries+=( + openh264 + ) + use system-re2 && gn_system_libraries+=( + re2 + ) + use system-snappy && gn_system_libraries+=( + snappy + ) + + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die + + # TODO 131: The above call clobbers `enable_freetype = true` in the freetype gni file + # drop the last line, then append the freetype line and a new curly brace to end the block + local freetype_gni="build/config/freetype/freetype.gni" + sed -i -e '$d' ${freetype_gni} || die + echo " enable_freetype = true" >> ${freetype_gni} || die + echo "}" >> ${freetype_gni} || die + + # See dependency logic in third_party/BUILD.gn + myconf_gn+=" use_system_harfbuzz=$(usex system-harfbuzz true false)" + + # Optional dependencies. + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)" + myconf_gn+=" enable_widevine=$(usex widevine true false)" + + if use headless; then + myconf_gn+=" use_cups=false" + myconf_gn+=" use_kerberos=false" + myconf_gn+=" use_pulseaudio=false" + myconf_gn+=" use_vaapi=false" + myconf_gn+=" rtc_use_pipewire=false" + else + myconf_gn+=" use_cups=$(usex cups true false)" + myconf_gn+=" use_kerberos=$(usex kerberos true false)" + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)" + myconf_gn+=" use_vaapi=$(usex vaapi true false)" + myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)" + myconf_gn+=" gtk_version=$(usex gtk4 4 3)" + fi + + # Allows distributions to link pulseaudio directly (DT_NEEDED) instead of + # using dlopen. This helps with automated detection of ABI mismatches and + # prevents silent errors. + if use pulseaudio; then + myconf_gn+=" link_pulseaudio=true" + fi + + # Non-developer builds of Chromium (for example, non-Chrome browsers, or + # Chromium builds provided by Linux distros) should disable the testing config + myconf_gn+=" disable_fieldtrial_testing_config=true" + + myconf_gn+=" use_gold=false" + + # The sysroot is the oldest debian image that chromium supports, we don't need it + myconf_gn+=" use_sysroot=false" + + # This determines whether or not GN uses the bundled libcxx + if use libcxx; then + myconf_gn+=" use_custom_libcxx=true" + else + myconf_gn+=" use_custom_libcxx=false" + fi + + myconf_gn+=" use_bluez=$(usex bluetooth true false)" + + myconf_gn+=" is_cfi=$(usex cfi true false)" + + if use cfi; then + myconf_gn+=" use_cfi_icall=true" + myconf_gn+=" use_cfi_cast=true" + fi + + if use pgo; then + myconf_gn+=" chrome_pgo_phase=2" + myconf_gn+=" v8_enable_builtins_optimization=true" + else + myconf_gn+=" chrome_pgo_phase=0" + fi + + myconf_gn+=" optimize_webui=$(usex optimize-webui true false)" + myconf_gn+=" use_system_freetype=$(usex system-harfbuzz true false)" + myconf_gn+=" use_system_libopenjpeg2=$(usex system-openjpeg true false)" + myconf_gn+=" enable_pdf=true" + myconf_gn+=" use_system_lcms2=true" + myconf_gn+=" enable_print_preview=true" + myconf_gn+=" enable_platform_hevc=$(usex hevc true false)" + myconf_gn+=" enable_hevc_parser_and_hw_decoder=$(usex hevc true false)" + + # Ungoogled flags + myconf_gn+=" build_with_tflite_lib=false" + myconf_gn+=" enable_mdns=false" + myconf_gn+=" enable_mse_mpeg2ts_stream_parser=$(usex proprietary-codecs true false)" + myconf_gn+=" enable_reading_list=false" + myconf_gn+=" enable_remoting=false" + myconf_gn+=" enable_reporting=false" + myconf_gn+=" enable_service_discovery=false" + myconf_gn+=" exclude_unwind_tables=true" + myconf_gn+=" google_api_key=\"\"" + myconf_gn+=" google_default_client_id=\"\"" + myconf_gn+=" google_default_client_secret=\"\"" + # myconf_gn+=" safe_browsing_mode=0" + myconf_gn+=" use_official_google_api_keys=false" + myconf_gn+=" use_unofficial_version_number=false" + + # myconf_gn+=" enable_swiftshader=false" + + # Additional flags + myconf_gn+=" perfetto_use_system_zlib=true" + myconf_gn+=" use_system_zlib=true" + myconf_gn+=" use_system_libjpeg=true" + myconf_gn+=" rtc_build_examples=false" + myconf_gn+=" enable_chromium_prelude=false" + myconf_gn+=" enable_updater=false" + myconf_gn+=" enable_update_notifications=false" + + # Cromite flags + myconf_gn+=" use_v8_context_snapshot=false" + #TODO disabled temporarily + myconf_gn+=" enable_jxl_decoder=false" + + # Disable pseudolocales, only used for testing + myconf_gn+=" enable_pseudolocales=false" + + # Disable code formating of generated files + myconf_gn+=" blink_enable_generated_code_formatting=false" + + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)" + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)" + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\"" + + local myarch="$(tc-arch)" + + # Avoid CFLAGS problems + if ! use custom-cflags; then + filter-flags "-O*" "-Wl,-O*" #See #25 + strip-flags + + # Prevent linker from running out of address space, bug #471810 . + if use x86; then + filter-flags "-g*" + fi + + # Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646. + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a + fi + + if tc-is-gcc; then + # https://bugs.gentoo.org/904455 + local -x CPP="$(tc-getCXX) -E" + # https://bugs.gentoo.org/912381 + filter-lto + fi + fi + + local dest_cpu="" + + if [[ $myarch = amd64 ]] ; then + dest_cpu=x64 + myconf_gn+=" target_cpu=\"x64\"" + ffmpeg_target_arch=x64 + dest_cpu="x64" + elif [[ $myarch = x86 ]] ; then + myconf_gn+=" target_cpu=\"x86\"" + ffmpeg_target_arch=ia32 + dest_cpu="x86" + + # This is normally defined by compiler_cpu_abi in + # build/config/compiler/BUILD.gn, but we patch that part out. + append-flags -msse2 -mfpmath=sse -mmmx + elif [[ $myarch = arm64 ]] ; then + myconf_gn+=" target_cpu=\"arm64\"" + ffmpeg_target_arch=arm64 + dest_cpu="arm64" + elif [[ $myarch = arm ]] ; then + myconf_gn+=" target_cpu=\"arm\"" + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm) + dest_cpu="arm" + elif [[ $myarch = ppc64 ]] ; then + myconf_gn+=" target_cpu=\"ppc64\"" + ffmpeg_target_arch=ppc64 + dest_cpu="ppc64" + else + die "Failed to determine target arch, got '$myarch'." + fi + + if use thinlto; then + # We need to change the default value of import-instr-limit in + # LLVM to limit the text size increase. The default value is + # 100, and we change it to 30 to reduce the text size increase + # from 25% to 10%. The performance number of page_cycler is the + # same on two of the thinLTO configurations, we got 1% slowdown + # on speedometer when changing import-instr-limit from 100 to 30. + # append-ldflags "-Wl,-plugin-opt,-import-instr-limit=30" + sed -i '/import_instr_limit = 5/{s++import_instr_limit = 30+;h};${x;/./{x;q0};x;q1}' \ + build/config/compiler/BUILD.gn || die + + append-ldflags "-Wl,--thinlto-jobs=$(makeopts_jobs)" + fi + + myconf_gn+=" treat_warnings_as_errors=false" + # Disable fatal linker warnings, bug 506268. + myconf_gn+=" fatal_linker_warnings=false" + + # Disable external code space for V8 for ppc64. It is disabled for ppc64 + # by default, but cross-compiling on amd64 enables it again. + if tc-is-cross-compiler; then + if ! use amd64 && ! use arm64; then + myconf_gn+=" v8_enable_external_code_space=false" + fi + fi + + # Only enabled for clang, but gcc has endian macros too + myconf_gn+=" v8_use_libm_trig_functions=true" + + # Bug 491582. + export TMPDIR="${WORKDIR}/temp" + mkdir -p -m 755 "${TMPDIR}" || die + + # https://bugs.gentoo.org/654216 + addpredict /dev/dri/ #nowarn + + # Disable unknown warning message from clang. + if tc-is-clang; then + append-flags -Wno-unknown-warning-option + if tc-is-cross-compiler; then + export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option" + export BUILD_CFLAGS+=" -Wno-unknown-warning-option" + fi + fi + + # Explicitly disable ICU data file support for system-icu/headless builds. + if use system-icu || use headless; then + myconf_gn+=" icu_use_data_file=false" + fi + + # Don't need nocompile checks and GN crashes with our config + myconf_gn+=" enable_nocompile_tests=false" + + # 131 began laying the groundwork for replacing freetype with + # "Rust-based Fontations set of libraries plus Skia path rendering" + # We now need to opt-in + myconf_gn+=" enable_freetype=true" + + # Enable ozone wayland and/or headless support + myconf_gn+=" use_ozone=true ozone_auto_platforms=false" + myconf_gn+=" ozone_platform_headless=true" + if use headless; then + myconf_gn+=" ozone_platform=\"headless\"" + myconf_gn+=" use_xkbcommon=false use_gtk=false use_qt=false" + myconf_gn+=" use_glib=false use_gio=false" + myconf_gn+=" use_pangocairo=false use_alsa=false" + myconf_gn+=" use_libpci=false use_udev=false" + myconf_gn+=" enable_print_preview=false" + myconf_gn+=" enable_remoting=false" + else + myconf_gn+=" use_system_libdrm=true" + myconf_gn+=" use_system_minigbm=true" + myconf_gn+=" use_xkbcommon=true" + if use qt5 || use qt6; then + local cbuild_libdir=$(get_libdir) + if tc-is-cross-compiler; then + # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 + local cbuild_libdir=$($(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libxslt) + cbuild_libdir=${cbuild_libdir:2} + cbuild_libdir=${cbuild_libdir/% } + fi + if use qt5; then + if tc-is-cross-compiler; then + myconf_gn+=" moc_qt5_path=\"${EPREFIX}/${cbuild_libdir}/qt5/bin\"" + else + myconf_gn+=" moc_qt5_path=\"$(qt5_get_bindir)\"" + fi + fi + if use qt6; then + myconf_gn+=" moc_qt6_path=\"${EPREFIX}/usr/${cbuild_libdir}/qt6/libexec\"" + fi + + myconf_gn+=" use_qt=true" + myconf_gn+=" use_qt6=$(usex qt6 true false)" + else + myconf_gn+=" use_qt=false" + fi + myconf_gn+=" ozone_platform_x11=$(usex X true false)" + myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)" + myconf_gn+=" ozone_platform=$(usex wayland \"wayland\" \"x11\")" + use wayland && myconf_gn+=" use_system_libffi=true" + fi + + # Results in undefined references in chrome linking, may require CFI to work + if use arm64; then + myconf_gn+=" arm_control_flow_integrity=\"none\"" + fi + + # Enable official builds + myconf_gn+=" is_official_build=$(usex official true false)" + myconf_gn+=" use_thin_lto=$(usex thinlto true false)" + myconf_gn+=" thin_lto_enable_optimizations=$(usex optimize-thinlto true false)" + if use official; then + # Allow building against system libraries in official builds + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ + tools/generate_shim_headers/generate_shim_headers.py || die + else + myconf_gn+=" devtools_skip_typecheck=false" + fi + + # user CXXFLAGS might overwrite -march=armv8-a+crc+crypto, bug #851639 + if use arm64 && tc-is-gcc; then + sed -i '/^#if HAVE_ARM64_CRC32C/a #pragma GCC target ("+crc+crypto")' \ + third_party/crc32c/src/src/crc32c_arm64.cc || die + fi + + # skipping typecheck is only supported on amd64, bug #876157 + if ! use amd64; then + myconf_gn+=" devtools_skip_typecheck=false" + fi + + # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn) + append-cflags -Wno-builtin-macro-redefined + append-cxxflags -Wno-builtin-macro-redefined + append-cppflags "-D__DATE__= -D__TIME__= -D__TIMESTAMP__=" + + # TODO: uncomment + # myconf_gn+=" import(\"${WORKDIR}/cromite-${CROMITE_COMMIT_ID}/build/bromite.gn_args\")" + + local flags + einfo "Building with the following compiler settings:" + for flags in C{C,XX} AR NM RANLIB {C,CXX,CPP,LD}FLAGS EXTRA_GN ; do + einfo " ${flags} = \"${!flags}\"" + done + + einfo "Configuring Cromite ..." + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release + echo "$@" + "$@" || die + + # The "if" below should not be executed unless testing + if [ ! -z "${NODIE}" ]; then + # List all args + # gn args --list out/Release + + # Quick compiler check + eninja -C out/Release protoc torque + fi +} + +src_compile() { + # Final link uses lots of file descriptors. + ulimit -n 2048 + + # Calling this here supports resumption via FEATURES=keepwork + python_setup + + # Don't inherit PYTHONPATH from environment, bug #789021, #812689 + local -x PYTHONPATH= + + use convert-dict && eninja -C out/Release convert_dict + + # Build mksnapshot and pax-mark it. + if use pax-kernel; then + local x + for x in mksnapshot v8_context_snapshot_generator; do + if tc-is-cross-compiler; then + eninja -C out/Release "host/${x}" + pax-mark m "out/Release/host/${x}" + else + eninja -C out/Release "${x}" + pax-mark m "out/Release/${x}" + fi + done + fi + + # Even though ninja autodetects number of CPUs, we respect + # user's options, for debugging with -j 1 or any other reason. + eninja -C out/Release chrome + + use enable-driver && eninja -C out/Release chromedriver + #use suid && eninja -C out/Release chrome_sandbox + + pax-mark m out/Release/chrome + + use enable-driver && mv out/Release/chromedriver{.unstripped,} + + rm -f out/Release/locales/*.pak.info || die + + # # Build manpage; bug #684550 + # sed -e 's|@@PACKAGE@@|chromium-browser|g; + # s|@@MENUNAME@@|Chromium|g;' \ + # chrome/app/resources/manpage.1.in > \ + # out/Release/chromium-browser.1 || die + + # Build desktop file; bug #706786 + sed -e 's|@@MENUNAME@@|Cromite|g; + s|@@USR_BIN_SYMLINK_NAME@@|cromite-browser|g; + s|@@PACKAGE@@|cromite-browser|g; + s|\(^Exec=\)/usr/bin/|\1|g;' \ + chrome/installer/linux/common/desktop.template > \ + out/Release/cromite-browser-cromite.desktop || die + + # Build vk_swiftshader_icd.json; bug #827861 + sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' \ + third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > \ + out/Release/vk_swiftshader_icd.json || die +} + +src_install() { + local CHROMIUM_HOME="/usr/$(get_libdir)/cromite" + exeinto "${CHROMIUM_HOME}" + doexe out/Release/chrome + + if use convert-dict; then + newexe "${FILESDIR}/update-dicts.sh" update-dicts.sh + doexe out/Release/convert_dict + fi + + #if use suid; then + # newexe out/Release/chrome_sandbox chrome-sandbox + # fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" + #fi + + use enable-driver && doexe out/Release/chromedriver + doexe out/Release/chrome_crashpad_handler + + ozone_auto_session () { + use X && use wayland && ! use headless && echo true || echo false + } + local sedargs=( -e + "s:/usr/lib/:/usr/$(get_libdir)/:g; + s:@@OZONE_AUTO_SESSION@@:$(ozone_auto_session):g" + ) + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r7.sh" > cromite-launcher.sh || die + doexe cromite-launcher.sh + + # It is important that we name the target "chromium-browser", + # xdg-utils expect it; bug #355517. + dosym "${CHROMIUM_HOME}/cromite-launcher.sh" /usr/bin/cromite-browser + # keep the old symlink around for consistency + dosym "${CHROMIUM_HOME}/cromite-launcher.sh" /usr/bin/cromite + + use enable-driver && dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver + + # Allow users to override command-line options, bug #357629. + insinto /etc/cromite + newins "${FILESDIR}/chromium.default" "default" + + pushd out/Release/locales > /dev/null || die + chromium_remove_language_paks + popd + + insinto "${CHROMIUM_HOME}" + doins out/Release/*.bin + doins out/Release/*.pak + ( + shopt -s nullglob + local files=(out/Release/*.so out/Release/*.so.[0-9]) + [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}" + ) + + # Install bundled xdg-utils, avoids installing X11 libraries with USE="-X wayland" + doins out/Release/xdg-{settings,mime} + + if ! use system-icu && ! use headless; then + doins out/Release/icudtl.dat + fi + + doins -r out/Release/locales + #doins -r out/Release/MEIPreload + + # Install vk_swiftshader_icd.json; bug #827861 + doins out/Release/vk_swiftshader_icd.json + + if [[ -d out/Release/swiftshader ]]; then + insinto "${CHROMIUM_HOME}/swiftshader" + doins out/Release/swiftshader/*.so + fi + + use widevine && dosym WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so /usr/$(get_libdir)/chromium-browser/libwidevinecdm.so + + # # Install icons + # local branding size + # for size in 16 24 32 48 64 128 256 ; do + # case ${size} in + # 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; + # *) branding="chrome/app/theme/chromium" ;; + # esac + # newicon -s ${size} "${branding}/product_logo_${size}.png" \ + # chromium-browser.png + # done + # newicon -s 128 chrome/app/theme/chromium/win/tiles/SmallLogo.png cromite-browser.png + # newicon -s 256 chrome/app/theme/chromium/win/tiles/Logo.png cromite-browser.png + newicon -s 48 chrome/android/java/res_chromium_base/mipmap-mdpi/app_icon.png cromite-browser.png + newicon -s 72 chrome/android/java/res_chromium_base/mipmap-hdpi/app_icon.png cromite-browser.png + newicon -s 96 chrome/android/java/res_chromium_base/mipmap-xhdpi/app_icon.png cromite-browser.png + newicon -s 192 chrome/android/java/res_chromium_base/mipmap-xxxhdpi/app_icon.png cromite-browser.png + + # Install desktop entry + domenu out/Release/cromite-browser-cromite.desktop + + #TODO + # # Install GNOME default application entry (bug #303100). + # insinto /usr/share/gnome-control-center/default-apps + # newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml + + #TODO + # # Install manpage; bug #684550 + # doman out/Release/chromium-browser.1 + # dosym chromium-browser.1 /usr/share/man/man1/chromium.1 + + readme.gentoo_create_doc +} + +pkg_postrm() { + xdg_icon_cache_update + xdg_desktop_database_update +} + +pkg_postinst() { + xdg_icon_cache_update + xdg_desktop_database_update + readme.gentoo_print_elog + + if ! use headless; then + if use vaapi; then + elog "VA-API is disabled by default at runtime. You have to enable it" + elog "by adding --enable-features=VaapiVideoDecoder and " + elog "--disable-features=UseChromeOSDirectVideoDecoder to CHROMIUM_FLAGS" + elog "in /etc/chromium/default." + fi + if use screencast; then + elog "Screencast is disabled by default at runtime. Either enable it" + elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer" + elog "inside Chromium or add --enable-features=WebRTCPipeWireCapturer" + elog "to CHROMIUM_FLAGS in /etc/chromium/default." + elog + elog "Additional setup may be required for screencasting to work." + elog "See issue: https://github.com/PF4Public/gentoo-overlay/issues/314" + fi + if use gtk4; then + elog "Chromium prefers GTK3 over GTK4 at runtime. To override this" + elog "behaviour you need to pass --gtk-version=4, e.g. by adding it" + elog "to CHROMIUM_FLAGS in /etc/chromium/default." + fi + if use widevine; then + elog "widevine requires binary plugins, which are distributed separately" + elog "Make sure you have www-plugins/chrome-binary-plugins installed" + fi + if use qt5 && use qt6; then + elog "Chromium automatically selects Qt5 or Qt6 based on your desktop" + elog "environment. To override you need to pass --qt-version=5 or" + elog "--qt-version=6, e.g. by adding it to CHROMIUM_FLAGS in" + elog "/etc/chromium/default." + fi + fi +} + +eapply_wrapper () { + if [ ! -z "${NODIE}" ]; then + nonfatal eapply "$@" + else + eapply "$@" + fi +} + +git_wrapper () { + if [ ! -z "${NODIE}" ]; then + git "$@" + else + git "$@" || die + fi +} diff --git a/www-client/cromite/files/chromium-131-fontations.patch b/www-client/cromite/files/chromium-131-fontations.patch new file mode 100644 index 00000000..543795ba --- /dev/null +++ b/www-client/cromite/files/chromium-131-fontations.patch @@ -0,0 +1,107 @@ +--- a/skia/BUILD.gn ++++ b/skia/BUILD.gn +@@ -8,7 +8,6 @@ + import("//build/config/freetype/freetype.gni") + import("//build/config/rust.gni") + import("//build/config/sanitizers/sanitizers.gni") +-import("//build/rust/rust_static_library.gni") + import("//gpu/vulkan/features.gni") + import("//testing/test.gni") + import("//third_party/skia/gn/shared_sources.gni") +@@ -47,27 +46,6 @@ + ] + } + +-source_set("path_bridge") { +- sources = skia_fontations_path_bridge_sources +-} +- +-rust_static_library("bridge_rust_side") { +- allow_unsafe = true +- crate_root = skia_fontations_bridge_root +- sources = skia_fontations_bridge_sources +- cxx_bindings = skia_fontations_bridge_sources +- deps = [ +- ":path_bridge", +- "//third_party/rust/font_types/v0_7:lib", +- "//third_party/rust/read_fonts/v0_22:lib", +- "//third_party/rust/skrifa/v0_23:lib", +- ] +- configs -= [ "//build/config/compiler:chromium_code" ] +- configs += [ +- ":skia_config", +- "//build/config/compiler:no_chromium_code", +- ] +-} + + # External-facing config for dependent code. + config("skia_config") { +@@ -427,13 +405,7 @@ + sources += skia_ports_fontmgr_empty_sources + public += skia_ports_fontmgr_empty_public + } +- sources += skia_ports_typeface_fontations_sources +- +- # Fontations Rust/C++ bridge interfaces. +- deps += [ +- ":bridge_rust_side", +- ":path_bridge", +- ] ++ + } + + if (is_win) { +@@ -724,13 +696,7 @@ + # skia_core_and_effects rather than the other way around. + public_deps = [ "//third_party/dawn/include/dawn:cpp_headers" ] + } +- if (use_blink) { +- # Fontations Rust/C++ bridge interfaces, needed by SkTypeface. +- deps += [ +- ":bridge_rust_side", +- ":path_bridge", +- ] +- } ++ + visibility = [ ":skia" ] + } + +--- a/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc ++++ b/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc +@@ -12,7 +12,6 @@ + #include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h" + #include "third_party/skia/include/core/SkStream.h" + #include "third_party/skia/include/core/SkTypeface.h" +-#include "third_party/skia/include/ports/SkTypeface_fontations.h" + + #if BUILDFLAG(IS_WIN) + #include "third_party/blink/renderer/platform/fonts/win/dwrite_font_format_support.h" +@@ -54,7 +53,7 @@ + } + + sk_sp MakeTypefaceDefaultFontMgr(sk_sp data) { +-#if !(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) ++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) + if (RuntimeEnabledFeatures::FontationsFontBackendEnabled()) { + std::unique_ptr stream(new SkMemoryStream(data)); + return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); +@@ -82,10 +81,6 @@ + } + #endif + +-sk_sp MakeTypefaceFontations(sk_sp data) { +- std::unique_ptr stream(new SkMemoryStream(data)); +- return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); +-} + + sk_sp MakeVariationsTypeface( + sk_sp data, +@@ -187,7 +182,6 @@ + const FontFormatCheck format_check(data); + const FontInstantiator instantiator = { + MakeTypefaceDefaultFontMgr, +- MakeTypefaceFontations, + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) + MakeTypefaceFallback, + #endif + diff --git a/www-client/cromite/files/chromium-131-oauth2-client-switches.patch b/www-client/cromite/files/chromium-131-oauth2-client-switches.patch new file mode 100644 index 00000000..350775c9 --- /dev/null +++ b/www-client/cromite/files/chromium-131-oauth2-client-switches.patch @@ -0,0 +1,39 @@ +From 54951636d20fa798e148228118863b89a4580479 Mon Sep 17 00:00:00 2001 +From: Matt Jolly +Date: Sat, 12 Oct 2024 12:40:16 +1000 +Subject: [PATCH] www-client/chromium: work around dead oauth2 credentials - + 131 update + +131 moved a ton of things around; this is now in api_key_cache.cc + +Google doesn't let us bake in OAuth2 credentials, and for some time, +Google sign-in has been broken. Arch dealt with this in March, and so +did we to some degree, but in the last few months, our sign-in +credentials have been broken. It appears that we actually did remove API +credentials in March around Chrome 89, but they got added back, perhaps +when rotating newer versions to replace older versions. Work around this +by following Arch's lead: we remove the predefined credentials, as +before, but also we patch Chromium so that people can use their own +easily, using Arch's patch for that. +--- a/google_apis/api_key_cache.cc ++++ b/google_apis/api_key_cache.cc +@@ -214,14 +214,14 @@ ApiKeyCache::ApiKeyCache(const DefaultApiKeys& default_api_keys) { + + std::string default_client_id = CalculateKeyValue( + default_api_keys.google_default_client_id, +- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(), nullptr, ++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(), ::switches::kOAuth2ClientID, + std::string(), environment.get(), command_line, gaia_config, + default_api_keys.allow_override_via_environment, + default_api_keys.allow_unset_values); + std::string default_client_secret = CalculateKeyValue( + default_api_keys.google_default_client_secret, + STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), std::string(), +- nullptr, std::string(), environment.get(), command_line, gaia_config, ++ ::switches::kOAuth2ClientSecret, std::string(), environment.get(), command_line, gaia_config, + default_api_keys.allow_override_via_environment, + default_api_keys.allow_unset_values); + +-- +2.46.2 + diff --git a/www-client/cromite/files/chromium-131-unbundle-icu-target.patch b/www-client/cromite/files/chromium-131-unbundle-icu-target.patch new file mode 100644 index 00000000..618750f1 --- /dev/null +++ b/www-client/cromite/files/chromium-131-unbundle-icu-target.patch @@ -0,0 +1,21 @@ +From a665875b4013eed997bd042326a038e24f3296e7 Mon Sep 17 00:00:00 2001 +From: Matt Jolly +Date: Thu, 10 Oct 2024 14:36:51 +1000 +Subject: [PATCH] unbundle: add missing icu target + +--- a/build/linux/unbundle/icu.gn ++++ b/build/linux/unbundle/icu.gn +@@ -65,6 +65,10 @@ group("icuuc_public") { + public_deps = [ ":icuuc" ] + } + ++group("icui18n_hidden_visibility") { ++ public_deps = [ ":icuuc" ] ++} ++ + shim_headers("icui18n_shim") { + root_path = "source/i18n" + headers = [ +-- +2.46.2 + diff --git a/www-client/cromite/files/chromium-131-webrtc-fixes.patch b/www-client/cromite/files/chromium-131-webrtc-fixes.patch new file mode 100644 index 00000000..94ab1bd0 --- /dev/null +++ b/www-client/cromite/files/chromium-131-webrtc-fixes.patch @@ -0,0 +1,21 @@ +--- a/third_party/webrtc/rtc_base/ssl_stream_adapter.h ++++ b/third_party/webrtc/rtc_base/ssl_stream_adapter.h +@@ -15,6 +15,7 @@ + #include + + #include ++#include + #include + #include + +--- a/third_party/webrtc/rtc_base/openssl_stream_adapter.h ++++ b/third_party/webrtc/rtc_base/openssl_stream_adapter.h +@@ -102,7 +102,7 @@ + void Close() override; + StreamState GetState() const override; + +- std::optional GetTlsCipherSuiteName() const override; ++ std::optional GetTlsCipherSuiteName() const; + + bool GetSslCipherSuite(int* cipher) const override; + [[deprecated("Use GetSslVersionBytes")]] SSLProtocolVersion GetSslVersion() diff --git a/www-client/cromite/files/compiler-131.patch b/www-client/cromite/files/compiler-131.patch new file mode 100644 index 00000000..018b5439 --- /dev/null +++ b/www-client/cromite/files/compiler-131.patch @@ -0,0 +1,322 @@ +From 00683131977068f7ab8b44e919d03a453fb8fb8c Mon Sep 17 00:00:00 2001 +From: Matt Jolly +Date: Wed, 7 Aug 2024 20:12:06 +1000 +Subject: [PATCH] This patch configures the Chromium build to work + +... with Gentoo. + +This includes things like disabling rust nightly features. +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -305,9 +305,6 @@ config("compiler") { + + configs += [ + # See the definitions below. +- ":clang_revision", +- ":rustc_revision", +- ":compiler_cpu_abi", + ":compiler_codegen", + ":compiler_deterministic", + ] +@@ -556,54 +556,6 @@ + ldflags += [ "-Wl,-z,keep-text-section-prefix" ] + } + +- if (is_clang && !is_nacl) { +- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] +- if (save_reproducers_on_lld_crash && use_lld) { +- ldflags += [ +- "-fcrash-diagnostics=all", +- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir, +- ] +- } +- +- # TODO(hans): Remove this once Clang generates better optimized debug info +- # by default. https://crbug.com/765793 +- cflags += [ +- "-mllvm", +- "-instcombine-lower-dbg-declare=0", +- ] +- if (!is_debug && use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ] +- } +- } +- +- # TODO(crbug.com/40283598): This causes binary size growth and potentially +- # other problems. +- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version. +- if (default_toolchain != "//build/toolchain/cros:target" && +- !llvm_android_mainline) { +- cflags += [ +- "-mllvm", +- "-split-threshold-for-reg-with-hint=0", +- ] +- if (use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ] +- } +- } +- } +- +- # TODO(crbug.com/40192287): Investigate why/if this should be needed. +- if (is_win) { +- cflags += [ "/clang:-ffp-contract=off" ] +- } else { +- cflags += [ "-ffp-contract=off" ] +- } +- } + + # C11/C++11 compiler flags setup. + # --------------------------- +@@ -712,7 +660,7 @@ config("compiler") { + + cflags += [ + "-flto=thin", +- "-fsplit-lto-unit", ++ "-fno-split-lto-unit", + ] + + if (thin_lto_enable_cache) { +@@ -813,14 +761,12 @@ config("compiler") { + # TODO(crbug.com/40182783): investigate why this isn't effective on + # arm32. + if (!is_android || current_cpu == "arm64") { +- cflags += [ "-fwhole-program-vtables" ] + + if (toolchain_supports_rust_thin_lto) { + # whole-program-vtables implies -fsplit-lto-unit, and Rust needs to match + # behaviour. Rust needs to know the linker will be doing LTO in this case + # or it rejects the Zsplit-lto-unit flag. + rustflags += [ +- "-Zsplit-lto-unit", + "-Clinker-plugin-lto=yes", + ] + } else { +@@ -828,9 +774,6 @@ config("compiler") { + rustflags += [ "-Cembed-bitcode=no" ] + } + +- if (!is_win) { +- ldflags += [ "-fwhole-program-vtables" ] +- } + } + + # This flag causes LTO to create an .ARM.attributes section with the correct +@@ -1540,51 +1492,6 @@ + } + } + +- # Makes builds independent of absolute file path. +- if (is_clang && strip_absolute_paths_from_debug_symbols) { +- # If debug option is given, clang includes $cwd in debug info by default. +- # For such build, this flag generates reproducible obj files even we use +- # different build directory like "out/feature_a" and "out/feature_b" if +- # we build same files with same compile flag. +- # Other paths are already given in relative, no need to normalize them. +- if (is_nacl) { +- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. +- cflags += [ +- "-Xclang", +- "-fdebug-compilation-dir", +- "-Xclang", +- ".", +- ] +- } else { +- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= +- # and -fcoverage-compilation-dir=. +- cflags += [ "-ffile-compilation-dir=." ] +- +- # Convert absolute paths to relative paths. Expands to, for example: +- # -file-prefix-map /path/to/chromium/src=../.. +- swiftflags += [ +- "-file-prefix-map", +- rebase_path("//.", "") + "=" + rebase_path("//.", root_build_dir), +- ] +- } +- if (!is_win) { +- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) +- asmflags = [ "-Wa,-fdebug-compilation-dir,." ] +- } +- +- if (is_win && use_lld) { +- if (symbol_level == 2 || (is_clang && using_sanitizer)) { +- # Absolutize source file paths for PDB. Pass the real build directory +- # if the pdb contains source-level debug information and if linker +- # reproducibility is not critical. +- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ] +- } else { +- # Use a fake fixed base directory for paths in the pdb to make the pdb +- # output fully deterministic and independent of the build directory. +- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ] +- } +- } +- } + + # Tells the compiler not to use absolute paths when passing the default + # paths to the tools it invokes. We don't want this because we don't +@@ -1604,39 +1511,6 @@ + } + } + +-config("clang_revision") { +- if (is_clang && clang_base_path == default_clang_base_path && +- current_os != "zos") { +- update_args = [ +- "--print-revision", +- "--verify-version=$clang_version", +- ] +- if (llvm_force_head_revision) { +- update_args += [ "--llvm-force-head-revision" ] +- } +- clang_revision = exec_script("//tools/clang/scripts/update.py", +- update_args, +- "trim string") +- +- # This is here so that all files get recompiled after a clang roll and +- # when turning clang on or off. (defines are passed via the command line, +- # and build system rebuild things when their commandline changes). Nothing +- # should ever read this define. +- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ] +- } +-} +- +-config("rustc_revision") { +- if (rustc_revision != "") { +- # Similar to the above config, this is here so that all files get recompiled +- # after a rustc roll. Nothing should ever read this cfg. This will not be +- # set if a custom toolchain is used. +- rustflags = [ +- "--cfg", +- "cr_rustc_revision=\"$rustc_revision\"", +- ] +- } +-} + + config("compiler_arm_fpu") { + if (current_cpu == "arm" && !is_ios && !is_nacl) { +@@ -2006,11 +1865,7 @@ config("chromium_code") { + defines = [ "_HAS_NODISCARD" ] + } + } else { +- cflags = [ "-Wall" ] +- if (is_clang) { +- # Enable extra warnings for chromium_code when we control the compiler. +- cflags += [ "-Wextra" ] +- } ++ cflags = [] + + # In Chromium code, we define __STDC_foo_MACROS in order to get the + # C99 macros on Mac and Linux. +@@ -2019,24 +1874,6 @@ config("chromium_code") { + "__STDC_FORMAT_MACROS", + ] + +- if (!is_debug && !using_sanitizer && current_cpu != "s390x" && +- current_cpu != "s390" && current_cpu != "ppc64" && +- current_cpu != "mips" && current_cpu != "mips64" && +- current_cpu != "riscv64" && current_cpu != "loong64") { +- # 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. +- fortify_level = "2" +- +- # ChromeOS's toolchain supports a high-quality _FORTIFY_SOURCE=3 +- # implementation with a few custom glibc patches. Use that if it's +- # available. +- if (is_chromeos_device && !lacros_use_chromium_toolchain) { +- fortify_level = "3" +- } +- defines += [ "_FORTIFY_SOURCE=" + fortify_level ] +- } +- + if (is_apple) { + cflags_objc = [ "-Wimplicit-retain-self" ] + cflags_objcc = [ "-Wimplicit-retain-self" ] +@@ -2429,7 +2266,8 @@ config("default_stack_frames") { + # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 + # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 + # [2]: https://crrev.com/c/5447532 +-config("optimize") { ++config("optimize") { } ++config("xoptimize") { + if (is_win) { + cflags = [ "/O2" ] + common_optimize_on_cflags + +@@ -2470,7 +2308,8 @@ config("optimize") { + } + + # Turn off optimizations. +-config("no_optimize") { ++config("no_optimize") { } ++config("xno_optimize") { + if (is_win) { + cflags = [ + "/Od", # Disable optimization. +@@ -2510,7 +2349,8 @@ config("no_optimize") { + # Turns up the optimization level. Used to explicitly enable -O2 instead of + # -Os for select targets on platforms that use optimize_for_size. No-op + # elsewhere. +-config("optimize_max") { ++config("optimize_max") { } ++config("xoptimize_max") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2543,7 +2383,8 @@ config("optimize_max") { + # + # TODO(crbug.com/41259697) - rework how all of these configs are related + # so that we don't need this disclaimer. +-config("optimize_speed") { ++config("optimize_speed") { } ++config("xoptimize_speed") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2572,7 +2413,8 @@ config("optimize_speed") { + } + } + +-config("optimize_fuzzing") { ++config("optimize_fuzzing") { } ++config("xoptimize_fuzzing") { + cflags = [ "-O1" ] + common_optimize_on_cflags + rustflags = [ "-Copt-level=1" ] + ldflags = common_optimize_on_ldflags +@@ -2705,7 +2547,8 @@ config("win_pdbaltpath") { + } + + # Full symbols. +-config("symbols") { ++config("symbols") { } ++config("xsymbols") { + rustflags = [] + if (is_win) { + if (is_clang) { +@@ -2855,7 +2698,8 @@ config("symbols") { + # Minimal symbols. + # This config guarantees to hold symbol for stack trace which are shown to user + # when crash happens in unittests running on buildbot. +-config("minimal_symbols") { ++config("minimal_symbols") { } ++config("xminimal_symbols") { + rustflags = [] + if (is_win) { + # Functions, files, and line tables only. +@@ -2940,7 +2784,8 @@ config("minimal_symbols") { + # This configuration contains function names only. That is, the compiler is + # told to not generate debug information and the linker then just puts function + # names in the final debug information. +-config("no_symbols") { ++config("no_symbols") { } ++config("xno_symbols") { + if (is_win) { + ldflags = [ "/DEBUG" ] + +-- +2.45.2 +