#!/bin/bash # $Id: chromium.SlackBuild,v 1.435 2024/11/08 15:24:18 root Exp root $ # Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for # any purpose with or without fee is hereby granted, provided that # the above copyright notice and this permission notice appear in all # copies. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # ----------------------------------------------------------------------------- # # Slackware SlackBuild script # =========================== # By: Eric Hameleers # For: chromium # Descr: Open Source version of Chrome Web Browser # URL: http://www.chromium.org/ # Build needs: - ninja; # - nodejs >= 20.13.0 # - gcc >= 8 , llvm >= 16 for bootstrapping gn; # - nasm >= 2.14 (yasm no longer being used); # - cmake >= 3.30.1 # - python3 >= 3.7, python3-setuptools; # - java runtime # - Internet access (for downloading toolchain bins) # Needs: # Changelog: # 31.0.1650.57-1: 18/nov/2013 by Eric Hameleers # * Initial build. # 31.0.1650.63-1: 18/Nov/2013 by Eric Hameleers # 31.0.1650.67-1: 19/dec/2013 by Eric Hameleers # * Update comes with several security fixes. # 32.0.1700.77-1: 14/jan/2014 by Eric Hameleers # * Update comes with several security fixes. # 32.0.1700.102-1: 29/jan/2014 by Eric Hameleers # * Update comes with several security fixes. # 32.0.1700.107-1: 04/feb/2014 by Eric Hameleers # * Update. # 33.0.1750.117-1: 21/feb/2014 by Eric Hameleers # * Update comes with several security fixes. # 33.0.1750.146-1: 04/mar/2014 by Eric Hameleers # * Update comes with several security fixes. # 33.0.1750.149-1: 11/mar/2014 by Eric Hameleers # * Update comes with several security fixes. # 33.0.1750.152-1: 18/mar/2014 by Eric Hameleers # * Update comes with several security fixes. # 34.0.1847.116-1: 09/apr/2014 by Eric Hameleers # * Update comes with several security fixes. # 34.0.1847.132-1: 25/apr/2014 by Eric Hameleers # * Update. # 34.0.1847.137-1: 14/may/2014 by Eric Hameleers # * Update. # 35.0.1916.114-1: 20/may/2014 by Eric Hameleers # * Update comes with several security fixes. # 35.0.1916.153-1: 10/jun/2014 by Eric Hameleers # * Update comes with several security fixes. # 36.0.1985.125-1: 16/jun/2014 by Eric Hameleers # * Update comes with several security fixes. # We can no longer download toolchain binaries in advance, # so the build will now require internet connectivity. # 36.0.1985.143-1: 12/aug/2014 by Eric Hameleers # * Update comes with security fixes, Chrome also comes with an # updated Flash plugin: 14.0.0.177. # 37.0.2062.94-1: 27/aug/2014 by Eric Hameleers # * Update comes with security fixes. # New: an embedded PDF viewer. # 37.0.2062.120-1: 09/sep/2014 by Eric Hameleers # * Update comes with security fixes, Chrome also comes with an # updated Flash plugin: 15.0.0.152. # 38.0.2125.101-1: 08/oct/2014 by Eric Hameleers # * Update comes with security fixes. # 38.0.2125.104-1: 18/oct/2014 by Eric Hameleers # * Update comes with security fixes. Chrome also updates its # Flash plugin to 15.0.0.189. # 38.0.2125.111-1: 28/oct/2014 by Eric Hameleers # * Update. # 38.0.2125.122-1: 11/nov/2014 by Eric Hameleers # * Update comes with security fixes. Chrome also updates its # Flash plugin to 15.0.0.223. # 39.0.2171.65-1: 17/nov/2014 by Eric Hameleers # * Update comes with security fixes. See # http://googlechromereleases.blogspot.nl/2014/11/stable-channel-update_18.html # 39.0.2171.71-1: 26/nov/2014 by Eric Hameleers # * Update comes with security fixes. Chrome also updates its # Flash plugin to 15.0.0.239. # 39.0.2171.95-1: 09/dec/2014 by Eric Hameleers # * Update comes with security fixes. Chrome also updates its # Flash plugin to 16.0.0.235. # 39.0.2171.95-2: 01/jan/2015 by Eric Hameleers # * Add support for the WIdevine CDM plugin (i.e. Netflix playback) # 39.0.2171.99-1: 14/jan/2015 by Eric Hameleers # * New release accompanied by pepperflash 16.0.0.257. # 40.0.2214.91-1: 21/jan/2015 by Eric Hameleers # * New release. # 40.0.2214.111-1: 06/feb/2015 by Eric Hameleers # * New release. # 41.0.2272.76-1: 05/mar/2015 by Eric Hameleers # * First release of Chromium 41 stable. # 41.0.2272.118-1: 02/apr/2015 by Eric Hameleers # * Security update. # 42.0.2311.90-1: 15/apr/2015 by Eric Hameleers # * First release of Chromium 42 stable. # 42.0.2311.135-1: 30/apr/2015 by Eric Hameleers # * Security update. # 43.0.2357.65-1: 20/may/2015 by Eric Hameleers # * Security update, first 43 version. # 43.0.2357.81-1: 29/may/2015 by Eric Hameleers # * Update. # 43.0.2357.124-1: 09/jun/2015 by Eric Hameleers # * Update. # 43.0.2357.125-1: 12/jun/2015 by Eric Hameleers # * Update. # 43.0.2357.125-2: 19/jun/2015 by Eric Hameleers # * Disable "OK Google" hotwording completely. # 43.0.2357.130-1: 22/jun/2015 by Eric Hameleers # * Update. # 43.0.2357.130-2: 25/jun/2015 by Eric Hameleers # * Fix broken password manager in KDE. # 43.0.2357.132-1: 08/jul/2015 by Eric Hameleers # * Update. # 43.0.2357.134-1: 15/jul/2015 by Eric Hameleers # * Update. # 44.0.2403.89-1: 22/jul/2015 by Eric Hameleers # * Update - first 44 release. # 44.0.2403.107-1: 25/jul/2015 by Eric Hameleers # * Update - emergency bugfix release. # 44.0.2403.155-1: 11/aug/2015 by Eric Hameleers # * Update. # 44.0.2403.157-1: 21/aug/2015 by Eric Hameleers # * Update. # 45.0.2454.85-1: 02/sep/2015 by Eric Hameleers # * Update - first 45 release. # 45.0.2454.93-1: 16/sep/2015 by Eric Hameleers # * Update. # 45.0.2454.101-1: 25/sep/2015 by Eric Hameleers # * Update. # 46.0.2490.71-1: 14/oct/2015 by Eric Hameleers # * First 46 release. # 46.0.2490.86-1: 22/nov/2015 by Eric Hameleers # * Security update. # 47.0.2526.73-1: 03/dec/2015 by Eric Hameleers # * First 47 release. # 48.0.2564.82-1: 24/jan/2016 by Eric Hameleers # * First 48 release. # 48.0.2564.97-1: 31/jan/2016 by Eric Hameleers # * Update. # 48.0.2564.109-1: 13/feb/2016 by Eric Hameleers # * Update. # 49.0.2623.75-1: 05/mar/2016 by Eric Hameleers # * First 49 release. Binary plugins such as widevine and # pepperflash are no longer available for 32-bit since # Google stopped providing binaries for 32-bit Chrome. # 49.0.2623.108-1: 25/feb/2016 by Eric Hameleers # * Update. # 49.0.2623.112-1: 08/apr/2016 by Eric Hameleers # * Update. # 50.0.2661.75-1: 14/apr/2016 by Eric Hameleers # * First 50 release. # 50.0.2661.94-1: 29/apr/2016 by Eric Hameleers # * Security update. # 50.0.2661.102-1: 12/may/2016 by Eric Hameleers # * Security update. # 51.0.2704.63-1: 26/may/2016 by Eric Hameleers # * First 51 release. # 51.0.2704.84-1: 07/jun/2016 by Eric Hameleers # * Update. # 51.0.2704.103-1: 17/jun/2016 by Eric Hameleers # * Update. # 52.0.2743.82-1: 24/jul/2016 by Eric Hameleers # * Update. # 52.0.2743.116-1: 04/aug/2016 by Eric Hameleers # * Update. # 53.0.2785.92-1: 06/sep/2016 by Eric Hameleers # * First 53 release. # 53.0.2785.92-2: 12/sep/2016 by Eric Hameleers # * Apply patch required for Slackware 14.1. # 54.0.2840.90-1: 03/nov/2016 by Eric Hameleers # * First 54 release. Build system changed from gyp to gn. # 54.0.2840.100-1: 17/nov/2016 by Eric Hameleers # * Updated. Security fix. Removed the VAAPI patch because # several people have issues with it. # 55.0.2883.75-1: 12/dec/2016 by Eric Hameleers # * First 55 release. # 56.0.2924.76-1: 30/jan/2017 by Eric Hameleers # * First 56 release. # 56.0.2924.76-2: 25/feb/2017 by Eric Hameleers # * Built for Slackware 14.1 with some additional patches. # 57.0.2987.98-1: 14/mar/2017 by Eric Hameleers # * First 57 release. # 58.0.3029.96-1: 04/may/2017 by Eric Hameleers # * Update to 58. # 59.0.3071.86-1: 06/jun/2017 by Eric Hameleers # * Update to 59. # 60.0.3112.78-1: 25/jun/2017 by Eric Hameleers # * Update to 60. # 61.0.3163.79-1: 11/sep/2017 by Eric Hameleers # * Update to 61. # 61.0.3163.100-1: 25/sep/2017 by Eric Hameleers # * Security update. # 62.0.3202.62-1: 18/oct/2017 by Eric Hameleers # * Update to 62. # 62.0.3202.75-1: 27/oct/2017 by Eric Hameleers # * Update, switch compiler to clang instead of gcc. # 62.0.3202.94-1: 25/nov/2017 by Eric Hameleers # * Update. # 63.0.3239.108-1: 17/dec/2017 by Eric Hameleers # * Update to 63. # 63.0.3239.132-1: 07/jan/2018 by Eric Hameleers # * Update. # 64.0.3282.119-1: 26/jan/2018 by Eric Hameleers # * Update to 64. # 64.0.3282.119-2: 29/jan/2018 by Eric Hameleers # * Enable HEVC support. # 64.0.3282.140-1: 05/feb/2018 by Eric Hameleers # * Update. # 64.0.3282.186-1: 06/mar/2018 by Eric Hameleers # * Update. # 65.0.3325.146-1: 09/mar/2018 by Eric Hameleers # * Update to M65. # 65.0.3325.162-1: 16/mar/2018 by Eric Hameleers # * Update. # 65.0.3325.181-1: 31/mar/2018 by Eric Hameleers # * Update. # 66.0.3359.117-1: 25/apr/2018 by Eric Hameleers # * Update to M66. # 66.0.3359.139-1: 25/apr/2018 by Eric Hameleers # * Security update (CVE-2018-6118). # 66.0.3359.181-1: 18/may/2018 by Eric Hameleers # * Update. # 67.0.3396.62-1: 31/may/2018 by Eric Hameleers # * Update to M67. # 67.0.3396.79-1: 08/jun/2018 by Eric Hameleers # * Update. # 67.0.3396.99-1: 02/jul/2018 by Eric Hameleers # * Update. # 68.0.3440.84-1: 01/aug/2018 by Eric Hameleers # * Update to 68. # 69.0.3497.81-1: 05/sep/2018 by Eric Hameleers # * Update to 69. # 69.0.3497.100-1: 28/sep/2018 by Eric Hameleers # * Update, trying to fix pulseaudio. # 70.0.3538.67-1: 24/oct/2018 by Eric Hameleers # * Update to 70. # 70.0.3538.102-1: 11/nov/2018 by Eric Hameleers # * Update. # 71.0.3578.80-1: 05/dec/2018 by Eric Hameleers # * Update to M71. # 72.0.3626.81-1: 31/jan/2019 by Eric Hameleers # * Update to M72. # 72.0.3626.121-1: 03/mar/2019 by Eric Hameleers # * Update to 72.0.3626.121. # 73.0.3683.75-1: 15/mar/2019 by Eric Hameleers # * Update to M73. # 73.0.3683.75-2: 17/mar/2019 by Eric Hameleers # * Fix 32bit build. # 73.0.3683.86-1: 31/mar/2019 by Eric Hameleers # * Update. # 73.0.3683.103-1: 14/apr/2019 by Eric Hameleers # * Update. # 74.0.3729.108-1: 24/apr/2019 by Eric Hameleers # * Update to M74. # 74.0.3729.169-1: 22/may/2019 by Eric Hameleers # * Update. # 75.0.3770.80-1: 08/jun/2019 by Eric Hameleers # * Update to M75. # 75.0.3770.90-1: 13/jun/2019 by Eric Hameleers # * Update. # 75.0.3770.100-1: 20/jun/2019 by Eric Hameleers # * Update. # 75.0.3770.100-2: 20/jun/2019 by Eric Hameleers # * Fix HEVC support. # 75.0.3770.142-1: 15/jul/2019 by Eric Hameleers # * Update. # 76.0.3809.87-1: 31/jul/2019 by Eric Hameleers # * Update to M76. # 76.0.3809.132-1: 30/aug/2019 by Eric Hameleers # * Update. # 77.0.3865.75-1: 11/sep/2019 by Eric Hameleers # * Update to M77. # 77.0.3865.90-1: 11/sep/2019 by Eric Hameleers # * Security update. # 77.0.3865.120-1: 10/oct/2019 by Eric Hameleers # * Security update. # 78.0.3904.70-1: 10/oct/2019 by Eric Hameleers # * Update to M78. # 78.0.3904.87-1: 01/nov/2019 by Eric Hameleers # * Critical security update. # 78.0.3904.97-1: 11/nov/2019 by Eric Hameleers # * Security update. # 78.0.3904.108-1: 19/nov/2019 by Eric Hameleers # * Security update. # 79.0.3945.79-1: 11/dec/2019 by Eric Hameleers # * Security update. # 79.0.3945.88-1: 18/dec/2019 by Eric Hameleers # * Security update. # 79.0.3945.117-1: 08/jan/2020 by Eric Hameleers # * Security update. # 79.0.3945.130-1: 19/jan/2020 by Eric Hameleers # * Security update. # 80.0.3987.87-1: 05/feb/2020 by Eric Hameleers # * Update to M80. # 80.0.3987.106-1: 14/feb/2020 by Eric Hameleers # * Updated. # 80.0.3987.122-1: 27/feb/2020 by Eric Hameleers # * Updated. # 80.0.3987.132-1: 04/mar/2020 by Eric Hameleers # * Updated. # 80.0.3987.149-1: 18/mar/2020 by Eric Hameleers # * Updated. # 81.0.4044.92-1: 08/apr/2020 by Eric Hameleers # * Update to M81. # 81.0.4044.113-1: 16/apr/2020 by Eric Hameleers # * Updated. # 81.0.4044.122-1: 25/apr/2020 by Eric Hameleers # * Updated. # 81.0.4044.129-1: 29/apr/2020 by Eric Hameleers # * Updated. # 81.0.4044.138-1: 06/may/2020 by Eric Hameleers # * Updated. # 83.0.4103.61-1: 20/may/2020 by Eric Hameleers # * Update to M83. # 83.0.4103.97-1: 07/jun/2020 by Eric Hameleers # * Updated. # 83.0.4103.106-1: 16/jun/2020 by Eric Hameleers # * Updated. # 83.0.4103.116-1: 23/jun/2020 by Eric Hameleers # * Updated. # Add support for VAAPI. This is off by default but # can be enabled by adding '--ignore-gpu-blacklist' and # then one of '--use-gl=desktop' or '--use-gl=egl'. # See https://chromium.googlesource.com/chromium/src/+/master/docs/gpu/vaapi.md#VaAPI-on-Linux # for the intended usage (Intel VAAPI and MESA VAAPI). # To support Nvidia and other GPUs, patches would be needed. # 84.0.4147.89-1: 20/jul/2020 by Eric Hameleers # * Update to M84. # 84.0.4147.94-1: 23/jul/2020 by Eric Hameleers # * Updated. Use a newer nodejs to make the sources compile # on 32bit Slackware 14, plus this also fixes the # broken development tools. # 84.0.4147.105-1: 01/aug/2020 by Eric Hameleers # * Updated. # 85.0.4183.83-1: 28/aug/2020 by Eric Hameleers # * Update to M85. # 85.0.4183.102-1: 09/sep/2020 by Eric Hameleers # * Updated. # 85.0.4183.121-1: 22/sep/2020 by Eric Hameleers # * Updated. # 86.0.4240.75-1: 07/oct/2020 by Eric Hameleers # * Update to M86. # 86.0.4240.111-1: 22/oct/2020 by Eric Hameleers # * Updated. # 86.0.4240.183-1: 03/nov/2020 by Eric Hameleers # * Updated. # 86.0.4240.198-1: 13/nov/2020 by Eric Hameleers # * Updated. # 87.0.4280.66-1: 23/nov/2020 by Eric Hameleers # * Update to M87. # 87.0.4280.88-1: 03/dec/2020 by Eric Hameleers # * Updated. # 87.0.4280.141-1: 07/jan/2021 by Eric Hameleers # * Updated. # 88.0.4324.96-1: 21/jan/2021 by Eric Hameleers # * Update to M88. # 88.0.4324.146-1: 04/feb/2021 by Eric Hameleers # * Updated. # 88.0.4324.150-1: 06/feb/2021 by Eric Hameleers # * Updated. # 88.0.4324.182-1: 17/feb/2021 by Eric Hameleers # * Updated. # 88.0.4324.190-1: 23/feb/2021 by Eric Hameleers # * Updated. # 89.0.4389.72-1: 03/mar/2021 by Eric Hameleers # * Update to M89. # 89.0.4389.82-1: 07/mar/2021 by Eric Hameleers # * Updated. # 89.0.4389.90-1: 13/mar/2021 by Eric Hameleers # * Updated. # 89.0.4389.114-1: 31/mar/2021 by Eric Hameleers # * Updated. # 89.0.4389.128-1: 14/apr/2021 by Eric Hameleers # * Updated. # 90.0.4430.72-1: 15/apr/2021 by Eric Hameleers # * Update to M90. # 90.0.4430.93-1: 28/apr/2021 by Eric Hameleers # * Updated. # 90.0.4430.212-1: 11/may/2021 by Eric Hameleers # * Updated. # 91.0.4472.101-1: 11/jun/2021 by Eric Hameleers # * Update. # 91.0.4472.114-1: 19/jun/2021 by Eric Hameleers # * Update. # 92.0.4515.107-1: 22/jul/2021 by Eric Hameleers # * Update to M92. # 92.0.4515.131-1: 05/aug/2021 by Eric Hameleers # * Update. # 92.0.4515.159-1: 17/aug/2021 by Eric Hameleers # * Update. # 93.0.4577.63-1: 01/sep/2021 by Eric Hameleers # * Update to M93. Add some mods that hopefully make building # on ARM platforms easier. # 93.0.4577.82-1: 13/sep/2021 by Eric Hameleers # * Update. # 94.0.4606.71-1: 02/oct/2021 by Eric Hameleers # * Update to M94. # 95.0.4638.69-1: 28/oct/2021 by Eric Hameleers # * Update to M95. # 96.0.4664.45-1: 15/nov/2021 by Eric Hameleers # * Update to M96. # 96.0.4664.93-1: 09/dec/2021 by Eric Hameleers # * Update. # 96.0.4664.110-1: 14/dec/2021 by Eric Hameleers # * Update. # 97.0.4692.71-1: 05/jan/2022 by Eric Hameleers # * Update to M97. # 97.0.4692.99-1: 20/jan/2022 by Eric Hameleers # * Update. # 98.0.4758.80-1: 02/feb/2022 by Eric Hameleers # * Update to M98. # 98.0.4758.102-1: 16/feb/2022 by Eric Hameleers # * Update. # 99.0.4844.51-1: 02/mar/2022 by Eric Hameleers # * Update to M99. # 99.0.4844.74-1: 16/mar/2022 by Eric Hameleers # * Update. # 99.0.4844.82-1: 24/mar/2022 by Eric Hameleers # * Update. # 99.0.4844.84-1: 27/mar/2022 by Eric Hameleers # * Emergency update. # 100.0.4896.60-1: 30/mar/2022 by Eric Hameleers # * Update to M100. # 100.0.4896.75-1: 05/apr/2022 by Eric Hameleers # * Update. # 100.0.4896.88-1: 12/apr/2022 by Eric Hameleers # * Update. # 100.0.4896.127-1:15/apr/2022 by Eric Hameleers # * Emergency update. # 101.0.4951.41-1: 28/apr/2022 by Eric Hameleers # * Update to M101. # 101.0.4951.54-1: 02/may/2022 by Eric Hameleers # * Update. # 101.0.4951.64-1: 11/may/2022 by Eric Hameleers # * Update. # 102.0.5005.61-1: 25/may/2022 by Eric Hameleers # * Update to M102. # 102.0.5005.115-1:10/jun/2022 by Eric Hameleers # * Update. # 103.0.5060.53-1: 25/jun/2022 by Eric Hameleers # * Update to M103. # 103.0.5060.134-1:20/jul/2022 by Eric Hameleers # * Update. # 104.0.5112.79-1: 02/aug/2022 by Eric Hameleers # * Update to M104. # 104.0.5112.101-1:17/aug/2022 by Eric Hameleers # * Update. # 105.0.5195.52-1: 02/aug/2022 by Eric Hameleers # * Update to M105. # 105.0.5195.102-1:04/aug/2022 by Eric Hameleers # * Update. # 105.0.5195.125-1:21/sep/2022 by Eric Hameleers # * Update. # 106.0.5249.61-1: 28/sep/2022 by Eric Hameleers # * Update to M106. # 106.0.5249.91-1: 02/oct/2022 by Eric Hameleers # * Update. # 106.0.5249.103-1:09/oct/2022 by Eric Hameleers # * Update. # 106.0.5249.119-1:18/oct/2022 by Eric Hameleers # * Update. # 107.0.5304.68-1: 26/oct/2022 by Eric Hameleers # * Update to M107. # 107.0.5304.87-1: 28/oct/2022 by Eric Hameleers # * Update. # 107.0.5304.110-1: 09/nov/2022 by Eric Hameleers # * Update. # 107.0.5304.121-1: 25/nov/2022 by Eric Hameleers # * Update. # 108.0.5359.71-1: 02/dec/2022 by Eric Hameleers # * Update to M108. # 108.0.5359.94-1: 02/dec/2022 by Eric Hameleers # * Update. # 108.0.5359.94-2: 06/dec/2022 by Eric Hameleers # * Fix undefined symbol "gbm_bo_get_modifier" on 14.2. # 108.0.5359.98-1: 08/dec/2022 by Eric Hameleers # * Update. # 108.0.5359.124-1: 17/dec/2022 by Eric Hameleers # * Update. # 109.0.5414.74-1: 15/jan/2023 by Eric Hameleers # * Update to M109. # 109.0.5414.74-2: 17/jan/2023 by Eric Hameleers # * System libdrm on Slackware 14.2 is too old. # 109.0.5414.119-1: 25/jan/2023 by Eric Hameleers # * Update. # 110.0.5481.77-1: 09/feb/2023 by Eric Hameleers # * Update to M110. # 110.0.5481.100-1:15/feb/2023 by Eric Hameleers # * Update. # 110.0.5481.177-1:26/feb/2023 by Eric Hameleers # * Update. # 111.0.5563.64-1: 09/mar/2023 by Eric Hameleers # * Update to M111. # 111.0.5563.110-1:23/mar/2023 by Eric Hameleers # * Update. # 111.0.5563.147-1:29/mar/2023 by Eric Hameleers # * Update. # 112.0.5615.49-1: 05/apr/2023 by Eric Hameleers # * Update to M112. # 112.0.5615.121-1:15/apr/2023 by Eric Hameleers # * Update. # 112.0.5615.165-1:20/apr/2023 by Eric Hameleers # * Update. # 113.0.5672.63-1: 03/may/2023 by Eric Hameleers # * Update to M113. # 113.0.5672.92-1: 15/may/2023 by Eric Hameleers # * Update. # 113.0.5672.126-1:16/may/2023 by Eric Hameleers # * Update. # 114.0.5735.45-1: 27/may/2023 by Eric Hameleers # * Update to M114. # 114.0.5735.90-1: 31/may/2023 by Eric Hameleers # * Update. # 114.0.5735.106-1:06/jun/2023 by Eric Hameleers # * Update. # 114.0.5735.133-1:13/jun/2023 by Eric Hameleers # * Update. # 114.0.5735.198-1:01/jul/2023 by Eric Hameleers # * Update. # 115.0.5790.170-1:03/aug/2023 by Eric Hameleers # * Update to M115. # 116.0.5845.96-1: 16/aug/2023 by Eric Hameleers # * Update to M116. In remembrance of Bram Molenaar (Vim BDFL) # whose burial I attended today. # 116.0.5845.110-1:23/aug/2023 by Eric Hameleers # * Update. # 116.0.5845.140-1:30/aug/2023 by Eric Hameleers # * Update. # 116.0.5845.179-1:05/sep/2023 by Eric Hameleers # * Update. # 116.0.5845.187-1:12/sep/2023 by Eric Hameleers # * Update. # 117.0.5938.62-1: 14/sep/2023 by Eric Hameleers # * Update to M117. # 117.0.5938.92-1: 27/sep/2023 by Eric Hameleers # * Update. # 117.0.5938.132-1:28/sep/2023 by Eric Hameleers # * Update. # 117.0.5938.149-1:04/oct/2023 by Eric Hameleers # * Update. # 118.0.5993.70-1: 12/oct/2023 by Eric Hameleers # * Update to M118. # 118.0.5993.88-1: 18/oct/2023 by Eric Hameleers # * Update. # 119.0.6045.105-1: 01/nov/2023 by Eric Hameleers # * Update to M119. # 119.0.6045.123-1: 01/nov/2023 by Eric Hameleers # * Update. # 119.0.6045.159-1: 16/nov/2023 by Eric Hameleers # * Update. # 119.0.6045.199-1: 29/nov/2023 by Eric Hameleers # * Update. # 120.0.6099.109-1: 13/dec/2023 by Eric Hameleers # * Update to M120. # 120.0.6099.129-1: 21/dec/2023 by Eric Hameleers # * Update. # 120.0.6099.199-1: 03/jan/2024 by Eric Hameleers # * Update. # 120.0.6099.216-1: 09/jan/2024 by Eric Hameleers # * Update. # 120.0.6099.224-1: 17/jan/2024 by Eric Hameleers # * Update. # 121.0.6167.85-1: 28/jan/2024 by Eric Hameleers # * Update to M121. # 121.0.6167.139-1: 31/jan/2024 by Eric Hameleers # * Update. # 122.0.6261.57-1: 21/feb/2024 by Eric Hameleers # * Update to M122. # 122.0.6261.128-1: 12/mar/2024 by Eric Hameleers # * Update. # 123.0.6312.58-1: 19/mar/2024 by Eric Hameleers # * Update to M123. # 123.0.6312.86-1: 26/mar/2024 by Eric Hameleers # * Update. # 123.0.6312.105-1: 04/apr/2024 by Eric Hameleers # * Update. # 123.0.6312.122-1: 10/apr/2024 by Eric Hameleers # * Update. # 124.0.6367.60-1: 17/apr/2024 by Eric Hameleers # * Update to M124. # 124.0.6367.118-1: 02/may/2024 by Eric Hameleers # * Update. # 124.0.6367.201-1: 10/may/2024 by Eric Hameleers # * Update. # 124.0.6367.207-1: 14/may/2024 by Eric Hameleers # * Update. # 125.0.6422.60-1: 17/may/2024 by Eric Hameleers # * Update to M125. # 125.0.6422.112-1: 25/may/2024 by Eric Hameleers # * Update. # 125.0.6422.141-1: 01/jun/2024 by Eric Hameleers # * Update. # 126.0.6478.55-1: 13/jun/2024 by Eric Hameleers # * Update to M126. # 126.0.6478.61-1: 15/jun/2024 by Eric Hameleers # * Update. # 126.0.6478.114-1: 19/jun/2024 by Eric Hameleers # * Update. # 126.0.6478.126-1: 25/jun/2024 by Eric Hameleers # * Update. # 126.0.6478.182-1: 17/jul/2024 by Eric Hameleers # * Update. MH17 10 years. # 127.0.6533.72-1: 24/jul/2024 by Eric Hameleers # * Update to M127. # 127.0.6533.88-1: 31/jul/2024 by Eric Hameleers # * Update. # 127.0.6533.99-1: 06/aug/2024 by Eric Hameleers # * Update. # 127.0.6533.119-1: 13/aug/2024 by Eric Hameleers # * Update. # 128.0.6613.84-1: 22/aug/2024 by Eric Hameleers # * Update to M128. # 128.0.6613.113-1: 29/aug/2024 by Eric Hameleers # * Update. # 128.0.6613.119-1: 02/sep/2024 by Eric Hameleers # * Update. # 128.0.6613.137-1: 11/sep/2024 by Eric Hameleers # * Update. # 129.0.6668.58-1: 18/sep/2024 by Eric Hameleers # * Update to M129. # 129.0.6668.70-1: 24/sep/2024 by Eric Hameleers # * Update. # 129.0.6668.89-1: 04/oct/2024 by Eric Hameleers # * Update. # 129.0.6668.100-1: 09/oct/2024 by Eric Hameleers # * Update. # 130.0.6723.58-1: 16/oct/2024 by Eric Hameleers # * Update to M130. # 130.0.6723.69-1: 26/oct/2024 by Eric Hameleers # * Update. # 130.0.6723.91-1: 30/oct/2024 by Eric Hameleers # * Update. # 130.0.6723.116-1: 05/nov/2024 by Eric Hameleers # * Update. # # ----------------------------------------------------------------------------- # # Run 'sh chromium.SlackBuild' to build a Slackware package. # The package (.txz) and .txt file as well as build logs are created in /tmp . # Install it using 'installpkg'. # # ----------------------------------------------------------------------------- # Build an ungoogled chromium package (default no): USE_UNGOOGLED=${USE_UNGOOGLED:-0} # Build a development version of chromium (default no): USE_DEV=${USE_DEV:-0} [ ${USE_DEV} -ne 0 ] && SRCEXT="-dev" || SRCEXT="" [ ${USE_UNGOOGLED} -ne 0 ] && SRCEXT="${SRCEXT}-ungoogled" # ----------------------------------------------------------------------------- SRCNAM=chromium PRGNAM=${SRCNAM}${SRCEXT} # chromium, chromium-dev, chromium-ungoogled, etc VERSION=${VERSION:-130.0.6723.116} UNGOOGLED=${UNGOOGLED:-130.0.6723.116-1} BUILD=${BUILD:-1} TAG=${TAG:-alien} # Cross-compiling 32bit binaries on 64bit Slackware; set to "YES": CROSS32=${CROSS32:-"NO"} # Debug build (disabled by default): USE_DEBUG=${USE_DEBUG:-0} # Differentiate between stable and development releases: if [ $USE_DEV -ne 0 ]; then CRFLAGS="CHROMIUM_DEV_FLAGS" CRUSERFLAGS="CHROMIUM_DEV_USER_FLAGS" elif [ $USE_UNGOOGLED -ne 0 ]; then CRFLAGS="CHROMIUM_UNGOOGLED_FLAGS" CRUSERFLAGS="CHROMIUM_UNGOOGLED_USER_FLAGS" else CRFLAGS="CHROMIUM_FLAGS" CRUSERFLAGS="CHROMIUM_USER_FLAGS" fi # If pulseaudio is installed we support it unless you explicitly disable it: if /usr/bin/pkg-config --exists libpulse 2>/dev/null ; then USE_PA=${USE_PA:-1} else USE_PA=${USE_PA:-0} fi # If wayland is installed we support it unless you explicitly disable it: if /usr/bin/pkg-config --exists wayland-client 2>/dev/null ; then USE_WAYLAND=${USE_WAYLAND:-1} else USE_WAYLAND=${USE_WAYLAND:-0} fi # Build Chromium using a debian sysroot for Slackware 15.0 or older; # FYI, this will actually also just work for Slackware > 15.0: if [ "$(cat /etc/slackware-version)" == "Slackware 15.0+" ]; then echo "-- Prefer system libraries, do not use debian sysroot." USE_SYSROOT=${USE_SYSROOT:-0} else echo "-- Using debian sysroot instead of system libraries." USE_SYSROOT=${USE_SYSROOT:-1} fi # Enable Qt6 UI when we do not need a debian sysroot. if [ ${USE_SYSROOT} -eq 0 ]; then if pkg-config --exists "Qt6Core >= 6.7.2" ; then USE_QT6=${USE_QT6:-1} else USE_QT6=${USE_QT6:-0} fi else USE_QT6=${USE_QT6:-0} fi # By default the ffmpeg and other component libraries are built statically # into the chromium binary. This takes more time at the linking stage but # will speed up the browser's startup. # You can instead build shared libraries, among which will be libffmpeg.so # (formerly libffmpegsumo.so) if you want to be able to swap the libffmpeg.so # library for someone else's library with more features: SHARED_FFMPEG=${SHARED_FFMPEG:-false} # other option is 'true' # The branding determines what (proprietary) codec support will be added: FFMPEG_BRANDING=${FFMPEG_BRANDING:-ChromeOS} # or "Chrome", or "Chromium" # HEVC support. Set to '0' to disable, '1' to enable: # Has never worked so far, need to look into working solution provided by # https://github.com/Alex313031/thorium/blob/main/infra/PATCHES.md FFMPEG_HEVC=${FFMPEG_HEVC:-0} # Use the clang compiler. Results in faster build and smaller binaries. # This default to "1" (on) because gcc support is getting stale # and the gcc of Slackware 14.2 is already too old. # You will have to download and apply lots of patches when using gcc anyway. # This script can compile google's modified clang from source, so that 32bit # can be supported on older Slackware (Google offers only 64bit pre-built # clang for download0: USE_CLANG=${USE_CLANG:-1} # Prefer using Google's custom clang as pre-built binaries or compile ourselves? # Possible values: 'src' or 'bin': GOOGLE_CLANG=${GOOGLE_CLANG:-"bin"} # Build a custom clang or use the system clang? # CLANG_MIN is the minimal clang version needed to compile chromium, # see 'CLANG_REVISION' in ./tools/clang/scripts/update.py : CLANG_MIN=19 if [ $(clang -dumpversion |cut -d. -f1) -ge ${CLANG_MIN} ]; then BUILD_CLANG=${BUILD_CLANG:-0} else BUILD_CLANG=${BUILD_CLANG:-1} fi # If you don't want to enable support for Widevine CDM # (content decryption module) say "0" here. USE_CDM=${USE_CDM:-1} # Chromium supports VAAPI (we disable it when the platform is not capable): USE_VAAPI=${USE_VAAPI:-1} # If you are OK with the "OK Google" hotwording feature which will # automatically download a binary blob with proprietary code, set this to "1". # Some people object to a download without consent so it is disabled by default: USE_HOTWORD=${USE_HOTWORD:-0} DOCS="AUTHORS BUILD.gn CODE_OF_CONDUCT.md DEPS LICENSE* OWNERS WATCHLISTS README*" # Get rid of depreciation warnings: if which magick 1>/dev/null 2>/dev/null ; then MAGICK="magick" else MAGICK="" fi # Where do we look for sources? SRCDIR=$(cd $(dirname $0); pwd) # Place to build (TMP) package (PKG) and output (OUTPUT) the program: TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Visible directory listing of anything Chrome related is: # http://gsdview.appspot.com/ # Official location (non-browsable) of the above is: # https://commondatastorage.googleapis.com/ # This package used to be built with Alien's Google API keys for Chromium. # The keys must be present in the file "chromium_apikeys". # If you rebuild this package, you can use your own API keys. See: # http://www.chromium.org/developers/how-tos/api-keys # This browser is now compiled without API keys. This will disable stuff like # browser sync and other functionality which accesses Google APIs. # The following variables must be set to access Google's public APIs: # _google_api_key # _google_default_client_id # _google_default_client_secret _google_api_key="" _google_default_client_id="" _google_default_client_secret="" if [ ${USE_UNGOOGLED} -eq 0 ]; then if [ -f ${HOME}/.chromium_apikeys ]; then . ${HOME}/.chromium_apikeys elif [ -f ${SRCDIR}/chromium_apikeys ]; then . ${SRCDIR}/chromium_apikeys fi if [ -z "$_google_api_key" ]; then cat <> /etc/${PRGNAM}/01-apikeys.conf # echo "export GOOGLE_DEFAULT_CLIENT_ID='yourclientid'" >> /etc/${PRGNAM}/01-apikeys.conf # echo "export GOOGLE_DEFAULT_CLIENT_SECRET='yourclientsecret'" >> /etc/${PRGNAM}/01-apikeys.conf Press Ctrl-C to abort this script and add your own Google API keys, or wait 10 seconds to continue compilation without adding keys. EOT sleep 10 fi fi ## ## --- with a little luck, you won't have to edit below this point --- ## ## # Automatically determine the architecture we're building on: MARCH=$( uname -m ) if [ -z "$ARCH" ]; then case "$MARCH" in i?86) export ARCH=i586 ;; armv7*) export ARCH=$MARCH ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$MARCH ;; esac fi case "$ARCH" in i?86) SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686" # Fix for using lld while linking chromium in a 32bit chroot: SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX="" DSSE="1" FFMPEG_ARCH="ia32" SYSROOT_ARCH="i386" SYSROOT_TARGET="i386-linux-gnu" PKGARCH="$ARCH" ;; x86_64) # Ensure that 32bit libraries are found first if we cross-compile: if [ "${CROSS32}" = "YES" ]; then SLKCFLAGS="-O2" SLKLDFLAGS="-L/usr/lib"; LIBDIRSUFFIX="" FFMPEG_ARCH="ia32" SYSROOT_ARCH="i386" SYSROOT_TARGET="i386-linux-gnu" PKGARCH="i586" else SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" FFMPEG_ARCH="x64" SYSROOT_ARCH="amd64" SYSROOT_TARGET="x86_64-linux-gnu" PKGARCH="$ARCH" fi #DSSE="0" DSSE="1" ;; armv7*) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX="" DSSE="1" # Widevine not supported (no binary library available): USE_CDM=0 # VAAPI not supported: USE_VAAPI=0 FFMPEG_ARCH="arm" SYSROOT_ARCH="arm" SYSROOT_TARGET="arm-linux-gnueabihf" PKGARCH="$ARCH" ;; *) SLKCFLAGS=${SLKCFLAGS:-"O2"} SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""} DSSE="1" # Widevine not supported by default: USE_CDM=0 # VAAPI not supported by default: USE_VAAPI=0 FFMPEG_ARCH="$ARCH" SYSROOT_ARCH="$ARCH" SYSROOT_TARGET="$ARCH-linux-gnu" PKGARCH="$ARCH" ;; esac case "$ARCH" in armv7*) TARGET=$ARCH-slackware-linux-gnueabi ;; arm*) TARGET=${SYSROOT_ARCH}-slackware-linux-gnueabihf ;; *) TARGET=$ARCH-slackware-linux ;; esac # Exit the script on errors: set -e trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR # Catch unitialized variables: set -u P1=${1:-1} # Save old umask and set to 0022: _UMASK_=$(umask) umask 0022 # Source locations: SOURCE[0]="$SRCDIR/${SRCNAM}-${VERSION}.tar.xz" SRCURL[0]="https://commondatastorage.googleapis.com/${SRCNAM}-browser-official/${SRCNAM}-${VERSION}.tar.xz" SOURCE[1]="$SRCDIR/widevine-versions.txt" SRCURL[1]="https://dl.google.com/widevine-cdm/versions.txt" if [ ${USE_UNGOOGLED} -ne 0 ]; then SOURCE[2]="$SRCDIR/ungoogled-chromium-${UNGOOGLED}.tar.gz" SRCURL[2]="https://github.com/ungoogled-software/ungoogled-chromium/archive/${UNGOOGLED}.tar.gz" fi # Create working directories: mkdir -p $OUTPUT # place for the package to be saved mkdir -p $TMP/tmp-$PRGNAM # location to build the source mkdir -p $PKG # place for the package to be built rm -rf $PKG/* # always erase old package's contents rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build rm -rf $OUTPUT/{configure,make,install,error,makepkg,patch}-$PRGNAM.log # remove old log files # Source file availability: for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do if ! [ -f ${SOURCE[$i]} ]; then echo "Source '$(basename ${SOURCE[$i]})' not available yet..." # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi if ! [ "x${SRCURL[$i]}" == "x" ]; then echo "Will download file to $(dirname $SOURCE[$i])" wget --no-check-certificate -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build." mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL exit 1 fi else echo "File '$(basename ${SOURCE[$i]})' not available. Aborting the build." exit 1 fi fi done if [ "$P1" == "--download" ]; then echo "Download complete." exit 0 fi # --- PACKAGE BUILDING --- echo "++" echo "|| $PRGNAM-$VERSION" echo "++" cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." tar -xf ${SOURCE[0]} if [ ${USE_UNGOOGLED} -ne 0 ]; then tar -xf ${SOURCE[2]} UGDIR=$TMP/tmp-$PRGNAM/ungoogled-chromium-${UNGOOGLED} # We do not wait for the ungoogled tarball if the only change is the version: if [ "${VERSION}"="120.0.6099.129" ] && [ ${UNGOOGLED}="120.0.6099.109-1" ]; then sed -i ungoogled-chromium-${UNGOOGLED}/chromium_version.txt \ -e "s/${UNGOOGLED}/${VERSION}/" fi fi cd ${SRCNAM}-${VERSION} if [ ${USE_UNGOOGLED} -ne 0 ]; then # Give chromium-ungoogled our own Slackware grey logo: for size in 16 32 ; do ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/default_200_percent/chromium/product_logo_$size.png ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/default_100_percent/chromium/product_logo_$size.png ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/default_100_percent/chromium/linux/product_logo_$size.png done for size in 24 48 64 128 256; do ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/chromium/product_logo_$size.png ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/chromium/linux/product_logo_$size.png done for size in 32 ; do ${MAGICK:-convert} ${SRCDIR}/${PRGNAM}.png -resize ${size}x${size} \ chrome/app/theme/chromium/linux/product_logo_$size.xpm done fi ## For chromium >= 102, download a specific build.py which allows us to ## compile our 32bit package successfully: #if [ ${VERSION%%.*} -ge 102 ]; then # wget --no-check-certificate -O - https://raw.githubusercontent.com/chromium/chromium/ad35291af36d609042e1d320adb1568daafef9a8/tools/clang/scripts/build.py > tools/clang/scripts/build.py #fi # Allow building against system libraries in official builds: sed -e 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ -i tools/generate_shim_headers/generate_shim_headers.py # Patches and bug fixes: touch $OUTPUT/patch-${PRGNAM}.log ## https://github.com/protocolbuffers/protobuf/issues/9792 #cat $SRCDIR/patches/chromium_protobuf_32bit.patch \ # | patch -p0 --verbose \ # 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log if [ ${USE_CLANG} -eq 1 ] && [ ${BUILD_CLANG} -eq 0 ]; then # Adjust expectations about where to find the clang libs on Slackware: cat $SRCDIR/patches/compiler-rt-adjust-paths.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log sed -i build/config/clang/BUILD.gn \ -e "s,clang_base_path/lib/clang/,clang_base_path/lib${LIBDIRSUFFIX}/clang/," sed -i build/rust/rust_bindgen.gni \ -e 's%_libclang_path += "/lib"%_libclang_path += "/lib'${LIBDIRSUFFIX}'"%' \ -e 's%"/lib/clang/"%"/lib'${LIBDIRSUFFIX}'/clang/"%' \ -e 's%"/lib/"%"/lib'${LIBDIRSUFFIX}'/"%' \ -e 's%"/lib"%"/lib'${LIBDIRSUFFIX}'"%' fi # Be compatible with gcc 10: cat $SRCDIR/patches/chromium_gcc10.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # Fix the link on 32bit: sed -e '/ldflags /s/-m32/&", "-Wl,-z,notext/' \ -i build/config/compiler/BUILD.gn \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log if [ "$ARCH" == "i586" ] ; then # Don't complain about unsupported flags when we add # "--disable-seccomp-sandbox" on 32bit OS: cat $SRCDIR/patches/chromium_slax_nobadflagsmessage.patch \ | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log fi # Prevent an error 'Looking for xmlReadMemory - not found ' building clang: sed \ -i tools/clang/scripts/build.py \ -e "s%'lib'%'lib$LIBDIRSUFFIX'%g" sed \ -i third_party/libxml/src/libxml2-config.cmake.in \ -e 's%set(LIBXML2_LIBRARY_DIR *${_libxml2_rootdir}/lib%&'${LIBDIRSUFFIX}'%' # Prevent an error: # 'c-index-test.c:679:3: error: unknown type name xmlRelaxNGPtr' building clang: sed \ -i tools/clang/scripts/build.py \ -e "/DLLVM_ENABLE_LIBXML2=FORCE_ON/a '-DCLANG_ENABLE_LIBXML2=OFF'," # Do not embed a tensorflow model: sed \ -i tools/clang/scripts/build.py \ -e "s/default='default' if sys.platform.startswith('linux') else ''/default=''/" # Slackware specific: # When compiling google's clang on 32bit Slackware or on ARM, add our triplets. # I am a python noob so this is clumsy, better implementation is welcome :-) cp $SRCDIR/patches/clang.toolchains.slackware.triple.diff . cat $SRCDIR/patches/chromium_slackware_triplet.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # Don't crap out when gzip does not support '--rsyncable' (Slackware < 14.2): if ! gzip --help |grep -q rsyncable ; then cat $SRCDIR/patches/chromium_no_rsyncable.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log fi if [ $FFMPEG_HEVC -eq 1 ]; then # Add essential proprietary codecs to the "chrome" branding of ffmpeg: cat $SRCDIR/patches/chromium_ffmpeg_prop.patch | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # Enable FFmpeg HEVC decoding (software fallback): cat $SRCDIR/patches/chromium_hevc_ffmpeg_decoding.patch \ | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # Support hevc with ac3: cat $SRCDIR/patches/chromium_hevc_ac3.patch \ | patch -p1 --verbose \ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # Add HEVC / AC3 bits to the Chromium customization; # Thanks to https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding # I changed StaZhu's patch to a couple of really long 'sed' commands, # because that gives me more clarity than applying his patch blindly. sed -i third_party/ffmpeg/ffmpeg_generated.gni \ -e '/((is_apple && ffmpeg_branding == "Chrome") || (is_win && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "ChromeOS"))/r'<(cat < third_party/ffmpeg/libavcodec/autorename_libavcodec_bswapdsp.c #include "bswapdsp.c" EOT for PLATFORM in Chromium ChromeOS Chrome ; do sed -e "/NULL/i \ \ \ \ &ff_hevc_decoder,&ff_ac3_decoder, &ff_eac3_decoder, &ff_ac3_fixed_decoder," \ -i third_party/ffmpeg/chromium/config/${PLATFORM}/linux/${FFMPEG_ARCH}/libavcodec/codec_list.c sed -e "/NULL/i \ \ \ \ &ff_hevc_parser, &ff_ac3_parser," \ -i third_party/ffmpeg/chromium/config/${PLATFORM}/linux/${FFMPEG_ARCH}/libavcodec/parser_list.c sed -e "/NULL/i \ \ \ \ &ff_ac3_demuxer, &ff_eac3_demuxer," \ -i third_party/ffmpeg/chromium/config/${PLATFORM}/linux/${FFMPEG_ARCH}/libavformat/demuxer_list.c done find third_party/ffmpeg/chromium -type f |xargs sed -i \ -e "s/CONFIG_BSWAPDSP 0/CONFIG_BSWAPDSP 1/" \ -e "s/CONFIG_DOVI_RPU 0/CONFIG_DOVI_RPU 1/" \ -e "s/CONFIG_HEVCPARSE 0/CONFIG_HEVCPARSE 1/" \ -e "s/CONFIG_HEVC_SEI 0/CONFIG_HEVC_SEI 1/" \ -e "s/CONFIG_HEVC_DECODER 0/CONFIG_HEVC_DECODER 1/" \ -e "s/CONFIG_HEVC_PARSER 0/CONFIG_HEVC_PARSER 1/" \ -e "s/CONFIG_AC3DSP 0/CONFIG_AC3DSP 1/" \ -e "s/CONFIG_EAC3_CORE_BSF 0/CONFIG_EAC3_CORE_BSF 1/" \ -e "s/CONFIG_AC3_DECODER 0/CONFIG_AC3_DECODER 1/" \ -e "s/CONFIG_AC3_FIXED_DECODER 0/CONFIG_AC3_FIXED_DECODER 1/" \ -e "s/CONFIG_EAC3_DECODER 0/CONFIG_EAC3_DECODER 1/" \ -e "s/CONFIG_AC3_AT_DECODER 0/CONFIG_AC3_AT_DECODER 1/" \ -e "s/CONFIG_EAC3_AT_DECODER 0/CONFIG_EAC3_AT_DECODER 1/" \ -e "s/CONFIG_AC3_PARSER 0/CONFIG_AC3_PARSER 1/" \ -e "s/CONFIG_AC3_DEMUXER 0/CONFIG_AC3_DEMUXER 1/" \ -e "s/CONFIG_EAC3_DEMUXER 0/CONFIG_EAC3_DEMUXER 1/" fi # When compiling google's clang, we want 32bit too - don't limit us, devs: sed -i tools/clang/scripts/build.py -e "s/x86_64-unknown-linux-gnu/${SYSROOT_TARGET}/g" if [ "$ARCH" == "i586" ] || [ "${CROSS32}" = "YES" ]; then sed -i tools/clang/scripts/build.py \ -e "s/sysroot_amd64\([,)]\)/sysroot_i386\1/" # \ #-e "s/LLVM_ENABLE_LLD=ON/LLVM_ENABLE_LLD=OFF/" ## Compile only the relevant back-end (X86): #sed -i tools/clang/scripts/build.py \ # -e "s/\(^ *targets = \).*$/\1'X86'/" # Non-functional vpython in the 32bit depot_tools: export VPYTHON_BYPASS="manually managed python not supported by chrome operations" fi # And fix the 32bit compilation while we are at it: sed -i tools/clang/scripts/build.py -e "s/ldflags = \[\]/ldflags = \['-latomic','-lpthread'\]/" ## Avoid failure because the built clang version is not what update.py expects: #sed -i tools/clang/scripts/update.py -e "s/RELEASE_VERSION = '16'/RELEASE_VERSION = '16.0.0'/" # ARM platform specifics: if [[ "$ARCH" =~ arm.* ]]; then # Fix the hard-coded bootstrap target 'X86': sed -i tools/clang/scripts/build.py \ -e "s/bootstrap_targets = 'X86'/bootstrap_targets = 'ARM'/" # Compile only the relevant back-ends (ARM, AArch64 and X86): sed -i tools/clang/scripts/build.py \ -e "s/\(^ *targets = \).*$/\1'ARM;X86;AArch64'/" fi ## When compiling google's clang, use the system cmake ## (prebuilt binary from google is only available as 64bit): #sed -i tools/clang/scripts/build.py -e 's/^ *AddCMakeToPath/#&/' # We require a 32bit gn binary, devs! sed -i BUILD.gn \ -e 's/target_os != "linux" || /target_os == "linux" || /' # Prevent a build failure (yes, 'x64' even on 32bit Slackware): mkdir -p third_party/node/linux/node-linux-x64/bin # In case a binary is already there: rm -f third_party/node/linux/node-linux-x64/bin/node ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ # Other binaries we need to provide ourselves: ln -s /usr/lib${LIBDIRSUFFIX}/java/bin/java third_party/jdk/current/bin/ rm -f third_party/ninja/ninja ln -s /usr/bin/ninja third_party/ninja/ninja if [ "$PRGNAM" != "$SRCNAM" ]; then # Save configuration in ~/.config/$PRGNAM: sed -e 's|filename = "chromium-browser|&'$SRCEXT'|' \ -e 's|confdir = "chromium|&'$SRCEXT'|' \ -i chrome/BUILD.gn sed -e 's|data_dir_basename = "chromium|&'$SRCEXT'|' \ -e 's|config_dir.Append("chromium|&'$SRCEXT'|' \ -i chrome/common/chrome_paths_linux.cc if [ -f chrome/browser/web_applications/external_web_app_manager.cc ]; then sed -e 's|/etc/chromium|&'$SRCEXT'|' \ -e 's|/usr/share/chromium|&'$SRCEXT'|' \ -i chrome/browser/web_applications/external_web_app_manager.cc else sed -e 's|/etc/chromium|&'$SRCEXT'|' \ -e 's|/usr/share/chromium|&'$SRCEXT'|' \ -i chrome/browser/web_applications/preinstalled_web_app_manager.cc fi sed -e 's|/etc/chromium|&'$SRCEXT'|' \ -e 's|/usr/share/chromium|&'$SRCEXT'|' \ -i chrome/common/chrome_paths.cc sed -e 's|/etc/chromium|&'$SRCEXT'|' \ -i components/policy/tools/template_writers/writer_configuration.py fi chown -R root:root . chmod -R u+w,go+r-w,a+X-s . echo Building ... [ ${USE_CLANG} -eq 1 ] && do_clang=true || do_clang=false [ ${BUILD_CLANG} -eq 1 ] && do_custclang=true || do_custclang=false [ ${USE_CDM} -eq 1 ] && do_cdm=true || do_cdm=false [ ${USE_HOTWORD} -eq 1 ] && do_hotword=true || do_hotword=false [ ${USE_PA} -eq 1 ] && do_pa=true || do_pa=false [ ${USE_QT6} -eq 1 ] && do_qt6=true || do_qt6=false [ ${USE_SYSROOT} -eq 1 ] && do_sysroot=true || do_sysroot=false [ ${USE_SYSROOT} -eq 1 ] && do_syslibs=false || do_syslibs=true [ ${USE_VAAPI} -eq 1 ] && do_vaapi=true || do_vaapi=false [ ${USE_WAYLAND} -eq 1 ] && do_wayland=true || do_wayland=false [ ${FFMPEG_HEVC} -eq 1 ] && do_hevc=true || do_hevc=false export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS -Wno-unknown-warning-option" export CFLAGS="$SLKCFLAGS -Wno-unused-local-typedefs -Wno-unknown-warning-option" export PATH="$TMP/tmp-$PRGNAM/privatebin:$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/third_party/depot_tools:$PATH" if [ ${USE_SYSROOT} -eq 1 ]; then SYSROOTDIR=$(basename $(ls $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/build/linux/ |grep ${SYSROOT_ARCH}-sysroot)) export CFLAGS="$CFLAGS -I$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/build/linux/${SYSROOTDIR}/usr/include/${SYSROOT_TARGET}/qt5" export CXXFLAGS="$CXXFLAGS -I$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/build/linux/${SYSROOTDIR}/usr/include/${SYSROOT_TARGET}/qt5" else export CFLAGS="$CFLAGS -I/usr/include/qt6" export CXXFLAGS="$CXXFLAGS -I/usr/include/qt6" fi if [ ${USE_QT6} -eq 1 ]; then export CFLAGS="$CFLAGS -I/usr/include/qt6" export CXXFLAGS="$CXXFLAGS -I/usr/include/qt6" fi # After building gn, run: # "./out/Release/gn args out/Release --list" # for a list of all variables. _chromium_conf=( 'blink_enable_generated_code_formatting=false' 'blink_symbol_level=0' "enable_hevc_parser_and_hw_decoder=${do_hevc}" "enable_platform_hevc=${do_hevc}" "enable_platform_hevc_decoding=${do_hevc}" "enable_platform_ac3_eac3_audio=${do_hevc}" "enable_platform_dolby_vision=${do_hevc}" 'enable_platform_mpeg_h_audio=true' 'enable_mse_mpeg2ts_stream_parser=true' 'enable_precompiled_headers=false' 'enable_pseudolocales=false' 'enable_webrtc=true' 'fatal_linker_warnings=false' "ffmpeg_branding=\"${FFMPEG_BRANDING}\"" "is_clang=${do_clang}" #"llvm_force_head_revision=${do_clang}" 'is_debug=false' "is_component_build=${SHARED_FFMPEG}" "is_component_ffmpeg=${SHARED_FFMPEG}" "link_pulseaudio=${do_pa}" "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\"" #'linux_strip_binary=true' 'linux_use_bundled_binutils=false' "ozone_platform_wayland=${do_wayland}" #"rtc_use_pipewire=${do_wayland}" #"rtc_link_pipewire=${do_wayland}" #'rtc_pipewire_version="0.3"' # Otherwise chromium tries to link absent 0.2 'proprietary_codecs=true' 'remove_webcore_debug_symbols=true' 'symbol_level=0' 'treat_warnings_as_errors=false' "usb_ids_path=\"/usr/share/hwdata/usb.ids\"" 'use_allocator="none"' 'use_bundled_fontconfig=false' 'use_cups=true' 'use_custom_libcxx=true' 'use_gconf=false' 'use_kerberos=false' 'use_lld=true' 'use_ozone=true' "use_pulseaudio=${do_pa}" "use_system_libffi=${do_syslibs}" "use_system_libjpeg=${do_syslibs}" "use_system_minigbm=${do_syslibs}" 'use_qt=false' "use_qt6=${do_qt6}" "moc_qt6_path=\"/usr/lib${LIBDIRSUFFIX}/qt6/bin\"" "use_sysroot=${do_sysroot}" "use_vaapi=${do_vaapi}" "use_xkbcommon=${do_wayland}" "extra_cxxflags=\"${CXXFLAGS}\"" "extra_ldflags=\"${LDFLAGS}\"" ) # Needed for Ungoogled Chromium 94 to prevent compile error related to # missing pref 'kGoogleServicesConsentedToSync' because 'is_debug=false' seems # to no longer suffice. Also, need to reduce crash proneness according to # https://groups.google.com/a/chromium.org/g/chromium-packagers/c/2E5AayFuFt4 : _chromium_conf+=( 'is_official_build=true' 'dcheck_always_on=false' ) if [ "$ARCH" == "x86_64" ]; then # Speed up the build: _chromium_conf+=( 'use_thin_lto=true' 'is_cfi=true' 'use_cfi_icall=true' ) else # Thin LTO requires more than 4 GB of RAM, skip it on 32bit: _chromium_conf+=( 'use_thin_lto=false' 'concurrent_links=1' ) fi if [ ${USE_UNGOOGLED} -ne 0 ]; then # Add ungoogled flags if requested: readarray -t -O ${#_chromium_conf[@]} _chromium_conf < ${UGDIR}/flags.gn else # Add remainder of standard chromium flags: # https://chromium.googlesource.com/chromium/src/+/refs/heads/main/testing/variations/README.md _chromium_conf+=( "clang_use_chrome_plugins=${do_custclang}" 'enable_hangout_services_extension=true' "enable_hotwording=${do_hotword}" 'enable_nacl=false' 'enable_nacl_nonsfi=false' 'enable_pepper_cdms=true' "enable_widevine=${do_cdm}" 'exclude_unwind_tables=true' 'disable_fieldtrial_testing_config=true' 'logging_like_official_build=true' ) fi # Add Google API key if defined: if [ -n "$_google_api_key" ]; then _chromium_conf+=( "google_api_key=\"$_google_api_key\"" ) # Also add client id/secret if it was provided: if [ -n "$_google_default_client_id" ]; then _chromium_conf+=( "google_default_client_id=\"$_google_default_client_id\"" "google_default_client_secret=\"$_google_default_client_secret\"" ) fi fi if [ $(cat /etc/slackware-version |cut -d' ' -f2- |cut -d. -f1) -lt 15 ]; then # For older Slackware: _chromium_conf+=( 'use_system_libdrm=false' ) fi if [ "$ARCH" == "i586" ] || [ "${CROSS32}" = "YES" ]; then _chromium_conf+=( 'target_cpu="x86"' 'v8_target_cpu="x86"' ) fi if [[ "$ARCH" =~ arm.* ]]; then _chromium_conf+=( 'target_cpu="arm"' 'v8_target_cpu="arm"' 'target_os="linux"' ) fi # Change this back when CRBUG 592268 is fixed (error during final link: # undefined reference to `base::i18n::GetRawIcuMemory()) # See https://bugs.chromium.org/p/chromium/issues/detail?id=592268 # icu_use_data_file_flag=false ## The array of possible replacements of embedded with system libraries is ## found in 'build/linux/unbundle/replace_gn_files.py': #gn_system_libraries=( # # 'bzip2' # # 'ffmpeg' # # 'flac' # # 'freetype2' # # 'harfbuzz' # # 'icu' # # 'libdrm' # # 'libevent' # # 'libjpeg' # # 'libpng' # # 'libvpx' # # 'libwebp' # # 'libxml' # # 'libxslt' # # 'opus' # # 're2' # # 'snappy' # # 'zlib' # ) # ## Unbundle the libraries which we use from the system. ## (taken from Arch Linux:) ## This *should* do what the remove_bundled_libraries.py script does, ## with the added benefit of not having to list all the remaining libraries: #echo "-- Unbundling system libraries from $PRGNAM sources." #for ULIB in ${gn_system_libraries[@]}; do # find -type f -path "*third_party/$ULIB/*" \ # \! -path "*third_party/$ULIB/chromium/*" \ # \! -path "*third_party/$ULIB/google/*" \ # \! -regex '.*\.\(gn\|gni\|isolate\)' \ # -delete #done # ## Change bundled libraries to system ones: #echo "-- Change bundled to system libraries in $PRGNAM sources." #python3 build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]} # # Do not make the build fail, see Chromium issue #386097: python3 third_party/libaddressinput/chromium/tools/update-strings.py \ 2>&1 | tee $OUTPUT/update_strings-${PRGNAM}.log # Use usb.ids at run time instead of compiling it in: sed -i services/device/public/cpp/usb/BUILD.gn \ -e 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' # Do not make the build fail, see https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion : touch chrome/test/data/webui/i18n_process_css_test.html # Do not make the build fail: if [ ! -f chrome/test/data/webui_test_resources.grd ]; then cat <chrome/test/data/webui_test_resources.grd EOF fi if [ ${USE_SYSROOT} -eq 1 ]; then # Take care of Debian/Ubuntu related missing header issues: SYSROOTDIR=$(basename $(ls build/linux/ |grep ${SYSROOT_ARCH}-sysroot)) ln -s ../../lib/${SYSROOT_TARGET}/glib-2.0/include/glibconfig.h \ build/linux/${SYSROOTDIR}/usr/include/glib-2.0/glibconfig.h ln -s ../../../lib/${SYSROOT_TARGET}/dbus-1.0/include/dbus/dbus-arch-deps.h \ build/linux/${SYSROOTDIR}/usr/include/dbus-1.0/dbus/dbus-arch-deps.h ln -s ../../lib/${SYSROOT_TARGET}/graphene-1.0/include/graphene-config.h \ build/linux/${SYSROOTDIR}/usr/include/graphene-1.0/graphene-config.h # Take care of Debian/Ubuntu related linker issues: #echo "/usr/lib/${SYSROOT_TARGET}/nss" >> \ # build/linux/${SYSROOTDIR}/etc/ld.so.conf.d/${SYSROOT_TARGET}.conf for SOFILE in build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}/nss/*.so ; do ln -sf nss/$(basename $SOFILE) \ build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}/ done ln -s libsqlite3.so.0 \ build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}/libsqlite3.so # The platform-specific alias for the ARM readelf binary is missing # from the debian sysroot image: if [ ! -f build/linux/${SYSROOTDIR}/usr/bin/${SYSROOT_TARGET}-readelf ]; then ln -s /usr/bin/readelf \ build/linux/${SYSROOTDIR}/usr/bin/${SYSROOT_TARGET}-readelf fi unset SYSROOTDIR #else # if ! pkg-config --atleast-version 1.14 libva; then # # The libva-1.14 release introduced an av1 encoder interface, # # so we remove that capability if our libva is too old (Slackware 15.0): # cat $SRCDIR/patches/chromium_av1-vaapi.patch \ # | patch -p1 --verbose \ # 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # cat $SRCDIR/patches/chromium_av1-vaapi2.patch \ # | patch -p1 --verbose \ # 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log # fi fi # Do not make the build fail on stripping chromedriver, # because Chromium installs a 64bit version of eu-strip on the 32bit & ARM OS: if [ "$ARCH" != "x86_64" ]; then if file $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin/eu-strip 2>/dev/null | grep -q "ELF 64-bit" ; then install -D -m0755 -t $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin /usr/bin/eu-strip fi fi # --- Compile --- # # Final link uses lots of file descriptors. ulimit -n 4096 # Compile google's internal clang sources if needed if [ ${USE_CLANG} -eq 1 ] && [ ${BUILD_CLANG} -eq 1 ]; then if [ "${GOOGLE_CLANG}" == "src" ]; then # Build clang from source instead of downloading: echo "-- Building google's clang toolchain." # Uses a sysroot image always for building LLVM, but since Chromium 121 the # sysroot has some includes in a wrong place. # So, let's download it ourselves and fix it before calling the build: pushd tools/clang/scripts SYSROOT_LOC=$(python3 -c "import build; loc = build.DownloadDebianSysroot('${SYSROOT_ARCH}') ; print(loc)" |tail -1) popd SYSROOTDIR=$(basename $(ls third_party/llvm-build-tools/ |grep ${SYSROOT_ARCH}_sysroot)) # Copy missing includes: rsync -Ha \ third_party/llvm-build-tools/${SYSROOTDIR}/usr/include/${SYSROOT_TARGET}/ \ third_party/llvm-build-tools/${SYSROOTDIR}/usr/include/ # Fix the script so that it does not again download and mangle the sysroot: sed \ -e "s%sysroot_${SYSROOT_ARCH} = DownloadDebianSysroot.*%sysroot_${SYSROOT_ARCH} = '"${SYSROOT_LOC}"'%" \ -i tools/clang/scripts/build.py unset SYSROOTDIR HDR2REM="" if [ "$ARCH" == "i586" ]; then # Actually 32bit compilation fails by not finding 'bits/c++config.h'. # I could only work around this using a kludge: # cp -ia /usr/include/c++/$(gcc -dumpversion)/${TARGET}/bits/* /usr/include/c++/$(gcc -dumpversion)/bits/ # Keep a list of the symlinks we'll be creating: for HDR in /usr/include/c++/$(gcc -dumpversion)/${TARGET}/bits/*.h ; do if [ ! -f /usr/include/c++/$(gcc -dumpversion)/bits/$(basename $HDR) ]; then ln -s $HDR /usr/include/c++/$(gcc -dumpversion)/bits/ HDR2REM="$(basename $HDR) $HDR2REM" fi done fi ####LDFLAGS="$LDFLAGS" \ export CFLAGS="" export CXXFLAGS="" export LDFLAGS="" python3 tools/clang/scripts/build.py \ --bootstrap \ --skip-checkout \ --pic \ --disable-asserts \ --host-cc /usr/bin/gcc \ --host-cxx /usr/bin/g++ \ --use-system-cmake \ --no-tools \ --without-android \ --without-fuchsia \ --without-zstd \ 2>&1 | tee $OUTPUT/clang_build-${PRGNAM}.log #--llvm-force-head-revision \ #--gcc-toolchain /usr \ #--host-cc /usr/bin/clang \ #--host-cxx /usr/bin/clang++ \ # Building gn for Chromium 110 fails when this file is not present: if [ ! -f third_party/llvm-build/Release+Asserts/cr_build_revision ]; then CLANG_REVISION=$(grep ^CLANG_REVISION tools/clang/scripts/update.py |cut -d= -f2 |tr -d " '") CLANG_SUB_REVISION=$(grep ^CLANG_SUB_REVISION tools/clang/scripts/update.py |cut -d= -f2 |tr -d " '") echo "${CLANG_REVISION}-${CLANG_SUB_REVISION}" > third_party/llvm-build/Release+Asserts/cr_build_revision fi # Ensure that only this new clang is used, ignoring the system version: MYCLANG_PATH="$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/third_party/llvm-build/Release+Asserts/bin" export PATH="$MYCLANG_PATH:$PATH" ### NOTE ### # Google does not even consider 32bit Linux as a valid target, so we have to # hack support for 'i386' into the build infrastructure ourselves. # High-over: # - add i386 target to ./tools/rust/build*.py # - compile openssl as *static* libraries and install bin, include and lib # into ./third_party/llvm-build-tools/openssl/ # - add ./third_party/llvm-build-tools/openssl/.cipdpkg/manifest.json # containing: # { # "format_version": "1.1", # "package_name": "infra/3pp/static_libs/openssl/linux-i386", # "install_mode": "copy" # } # - disable removing that openssl directory in build_rust.py # - ... and possibly lots more crap to fix ### END NOTE ### # Next, build Rust against our custom compiler: LDFLAGS="$LDFLAGS" \ python3 tools/rust/build_rust.py \ --skip-llvm-build \ --use-system-cmake \ 2>&1 | tee $OUTPUT/rust_build-${PRGNAM}.log # Ensure that only this new rust is used, ignoring the system version: MYRUST_PATH="$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/third_party/rust-toolchain" export PATH="$MYRUST_PATH:$PATH" else # Download prebuilt llvm and rust binaries instead of compiling them: python3 tools/rust/update_rust.py python3 tools/clang/scripts/update.py # Ensure that only this new clang is used, ignoring the system version: MYCLANG_ROOT="$TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/third_party/llvm-build/Release+Asserts" MYCLANG_PATH="${MYCLANG_ROOT}/bin" export PATH="$MYCLANG_PATH:$PATH" fi fi # For Chromium 92, disable ffmpeg re-configuration on 32bit OS, # to avoid linking errors like: # "FAILED: v8_context_snapshot_generator - ld.lld: error: undefined symbol: ff_psdsp_init_x86" if [ ${FFMPEG_HEVC} -eq 1 ] && [ "${FFMPEG_ARCH}" != "ia32" ]; then echo "-- Re-configuring bundled ffmpeg..." if [ ${FFMPEG_HEVC} -eq 1 ]; then echo " +- Adding HEVC support..." FFMPEG_CUSTOM_ARGS="--enable-decoder=hevc --enable-demuxer=hevc --enable-parser=hevc" else FFMPEG_CUSTOM_ARGS="" fi if [ "${FFMPEG_ARCH}" = "ia32" ]; then # Re-configure bundled ffmpeg to make it compile on 32bit Slackware: echo " +- Disabling assembler code..." FFMPEG_CUSTOM_ARGS="${FFMPEG_CUSTOM_ARGS} --disable-asm" fi cd third_party/ffmpeg ## To prevent error on x86_64: ## "clang-5.0: error: invalid linker name in argument '-fuse-ld=lld'" ## in third_party/ffmpeg/build.x64.linux/ChromeOS/ffbuild/config.log #sed -e "s/--extra-ldflags=-fuse-ld=lld/--extra-ldflags=''/" \ # -i chromium/scripts/build_ffmpeg.py # Actual reconfigure steps: python3 chromium/scripts/build_ffmpeg.py linux ${FFMPEG_ARCH} \ --branding ${FFMPEG_BRANDING} -- ${FFMPEG_CUSTOM_ARGS} \ 2>&1 | tee $OUTPUT/ffmpeg_configure-${PRGNAM}.log python3 chromium/scripts/copy_config.sh \ 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log # Runs into 'SyntaxError: invalid syntax' with Python2: python3 chromium/scripts/generate_gn.py \ 2>&1 | tee -a $OUTPUT/ffmpeg_configure-${PRGNAM}.log cd - 2>/dev/null fi if [ ${USE_UNGOOGLED} -ne 0 ]; then # Apply ungoogled-chromium patch kit: echo "-- Un-googling internal binaries:" # Argument '--keep-contingent-paths' ensures that the Google compiler binaries # and sysroots are not pruned (ungoogled-chromium issue #2960): python3 ${UGDIR}/utils/prune_binaries.py --keep-contingent-paths ./ ${UGDIR}/pruning.list || true echo "-- Un-googling sources; apply patches:" python3 ${UGDIR}/utils/patches.py apply ./ ${UGDIR}/patches # We will have to un-google internally used domain list later. fi if [ ${USE_UNGOOGLED} -ne 0 ]; then echo "-- Un-googling internally used domain list:" python3 ${UGDIR}/utils/domain_substitution.py apply \ -r ${UGDIR}/domain_regex.list \ -f ${UGDIR}/domain_substitution.list \ -c domainsubcache.tar.gz ./ fi # Generate the ninja build files: echo "-- Bootstrapping 'gn'." if [ "${GOOGLE_CLANG}" == "src" ] && [ ${BUILD_CLANG} -eq 1 ]; then # Symlink ld to lld to make gn linking stage succeed: cd $MYCLANG_PATH ; ln -s lld ld ; cd - 1>/dev/null fi if [ -e tools/gn/build/gen.py ]; then # Build the embedded version: LDFLAGS="$LDFLAGS" python3 tools/gn/bootstrap/bootstrap.py \ 2>&1 | tee $OUTPUT/gyp-${PRGNAM}.log #--use-custom-libcxx \ else # Download and build the latest: git clone https://gn.googlesource.com/gn gn.git pushd gn.git echo "-- Building externally downloaded gn version 0.$(git rev-list --count initial-commit..).$(git rev-parse --short=8 HEAD)" ./build/gen.py 2>&1 | tee /$OUTPUT/gyp-${PRGNAM}.log ninja -C out 2>&1 | tee -a /$OUTPUT/gyp-${PRGNAM}.log popd install -m0755 -D -t out/Release gn.git/out/gn fi #if [ "${GOOGLE_CLANG}" == "src" ] && [ ${BUILD_CLANG} -eq 1 ]; then # # Remove symlink again: # rm $MYCLANG_PATH/ld #fi if [ "${GOOGLE_CLANG}" == "src" ] && [ ${BUILD_CLANG} -eq 1 ]; then if [ -n "$HDR2REM" ]; then # Remove the temporary header symlinks we created earlier: ( cd /usr/include/c++/$(gcc -dumpversion)/bits/ && rm $HDR2REM) fi fi if [ ${USE_CLANG} -eq 1 ] && [ ${BUILD_CLANG} -eq 0 ]; then # Use system toolchain: # _chromium_conf+=( # 'custom_toolchain="//build/toolchain/linux/unbundle:default"' # 'host_toolchain="//build/toolchain/linux/unbundle:default"' # ) SL_CLANG=$(clang -dumpversion |cut -d. -f1) _chromium_conf+=( 'clang_base_path="/usr"' "clang_version=\"$SL_CLANG\"" 'chrome_pgo_phase=0' # needs newer clang to read the bundled PGO profile ) # Allow the use of nightly features with stable Rust compiler # https://github.com/ungoogled-software/ungoogled-chromium/pull/2696#issuecomment-1918173198 export RUSTC_BOOTSTRAP=1 _chromium_conf+=( 'rust_sysroot_absolute="/usr"' 'rust_bindgen_root="/usr"' "rustc_version=\"$(rustc --version)\"" ) fi echo "-- Generating ninja build files." out/Release/gn gen out/Release -v --args="${_chromium_conf[*]}" \ 2>&1 | tee -a $OUTPUT/gyp-${PRGNAM}.log # Compile everything: echo "-- Compiling the lot." if [ ${USE_CLANG} -eq 1 ] && [ ${BUILD_CLANG} -eq 1 ]; then # Use the clang that we build in-tree or downloaded, # instead of using the system version: echo "-- Using custom clang." export CC="$MYCLANG_PATH/clang" export CXX="$MYCLANG_PATH/clang++" export LD="$MYCLANG_PATH/lld" export AR="$MYCLANG_PATH/llvm-ar" export NM="$MYCLANG_PATH/llvm-nm" elif [ "$USE_CLANG" = "0" ]; then # Be careful not to override CC and CXX (may have been set by gcc5): echo "-- Using gcc/g++ compilers." export CC=${CC:-"gcc"} export CXX=${CXX:-"g++"} else # Use the system clang: echo "-- Using the system clang." export CC=clang export CXX=clang++ export LD=lld export AR=llvm-ar export NM=llvm-nm export LIBCLANG_PATH="/usr/lib${LIBDIRSUFFIX}" echo "-- Setting LIBCLANG_PATH to '$LIBCLANG_PATH'." fi export AS=as LDFLAGS="$LDFLAGS" \ LC_ALL=C \ VERBOSE=1 \ ninja -C out/Release \ chrome chrome_sandbox chromedriver \ 2>&1 | tee $OUTPUT/ninja-${PRGNAM}.log if [ $USE_UNGOOGLED -eq 0 ] && [ ! -f out/Release/chrome_crashpad_handler ] then # ungoogled-chromium has crash-reporting disabled: LDFLAGS="$LDFLAGS" \ LC_ALL=C \ ninja -C out/Release \ chrome_crashpad_handler \ 2>&1 | tee -a $OUTPUT/ninja-${PRGNAM}.log fi # Manually install everything: echo "-- Manually installing everything." # The main binary: install -D out/Release/chrome $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/${PRGNAM} # The sandbox: install -D -m4755 -o root -g root out/Release/chrome_sandbox \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome-sandbox # The Chromium implementation of the WebDriver wire protocol # (automated testing of web apps): install -D out/Release/chromedriver $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chromedriver if [ $USE_UNGOOGLED -eq 0 ]; then # Crashpad, the Chromium crash-reporting client: install -D out/Release/chrome_crashpad_handler $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_crashpad_handler fi # Copy libraries: for CRLIB in {libEGL,libGLESv2,libVkICD_mock_icd,libVkLayer_khronos_validation,libminigbm,libqt5_shim,libqt6_shim,libvk_swiftshader}.so libvulkan.so.1 do if [ -f "out/Release/$CRLIB" ]; then install -D -m0755 -o root -g root out/Release/$CRLIB \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/$CRLIB else echo "** Could not find '$CRLIB'; not necessarily an error." fi done install -D -m0755 -o root -g root out/Release/vk_swiftshader_icd.json \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/vk_swiftshader_icd.json # Copy over the remaining binaries: cp -a \ out/Release/angledata \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ # Un-googled chromium disables MEI Preload: if [ -d out/Release/MEIPreload ]; then cp -a \ out/Release/MEIPreload \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ fi cp -a \ out/Release/*.pak \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ if [ -f out/Release/libffmpeg*.so ]; then cp -a \ out/Release/libffmpeg*.so* \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ elif [ -f out/Release/lib/libffmpeg.so ]; then mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/ cp -a \ out/Release/lib/libffmpeg.so* \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/ fi for BLOB in out/Release/{natives_blob.bin,snapshot_blob.bin,v8_context_snapshot.bin}; do if [ -f $BLOB ]; then cp -a $BLOB $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ fi done # Install appdata: mkdir -p $PKG/usr/share/metainfo if [ $USE_UNGOOGLED -eq 0 ]; then # Remove text with relevance to Google only (thanks Arch): sed -n \ -e "s/chromium-browser\.desktop/chromium-browser${SRCEXT}.desktop/" \ -e '//d' \ -e '/

/N;/

\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \ -e '/^ $PKG/usr/share/metainfo/${PRGNAM}.appdata.xml elif [ -f $SRCDIR/${PRGNAM}.appdata.xml ]; then # A customized un-googled version for this package: cat $SRCDIR/${PRGNAM}.appdata.xml \ > $PKG/usr/share/metainfo/${PRGNAM}.appdata.xml fi chmod 644 $PKG/usr/share/metainfo/${PRGNAM}.appdata.xml if [ $USE_DEBUG -eq 0 ]; then # Manually strip binaries: strip --strip-unneeded \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/{${PRGNAM},chrome-sandbox} \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chromedriver strip --strip-unneeded \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/*.so if [ $USE_UNGOOGLED -eq 0 ]; then strip --strip-unneeded \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_crashpad_handler fi if [ -f $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/libffmpeg*.so ]; then strip --strip-unneeded \ $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/lib/lib*.so fi fi # Add locales: cp -a out/Release/locales $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ ln -s locales $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/remoting_locales # Add resource files: cp -a out/Release/resources $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ # This step used to be done for us, now we need to do it manually. # First, fix an incompatibility with the 'date' command in Slackware before 15.0: sed -e 's/--rfc-email/-R/g' \ -i $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/chrome/installer/linux/common/installer.include # We source this script since its 'process_template' function is needed, # in order to generate man page and desktop file: source $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/chrome/installer/linux/common/installer.include PACKAGE=${PRGNAM} PROGNAME=${PRGNAM} MENUNAME="${PRGNAM^} Web Browser" USR_BIN_SYMLINK_NAME=${PRGNAM} # Install a man page: process_template chrome/app/resources/manpage.1.in out/Release/${PRGNAM}.1 install -D -m0644 out/Release/${PRGNAM}.1 $PKG/usr/man/man1/${PRGNAM}.1 # Add a desktop file: process_template chrome/installer/linux/common/desktop.template \ out/Release/${PRGNAM}.desktop install -D -m0644 out/Release/${PRGNAM}.desktop \ $PKG/usr/share/applications/${PRGNAM}.desktop # Install desktop icons: for size in 16 32; do install -D -m0644 \ chrome/app/theme/default_100_percent/chromium/product_logo_$size.png \ $PKG/usr/share/icons/hicolor/${size}x${size}/apps/${PRGNAM}.png ln -s ${PRGNAM}.png \ $PKG/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser${SRCEXT}.png done for size in 24 48 64 128 256; do install -D -m0644 \ chrome/app/theme/chromium/product_logo_$size.png \ $PKG/usr/share/icons/hicolor/${size}x${size}/apps/${PRGNAM}.png ln -s ${PRGNAM}.png \ $PKG/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser${SRCEXT}.png done # Without this file, chromium refuses to start: cp -a out/Release/icudtl.dat $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/ # Install a wrapper script: install -D -m0755 $SRCDIR/${SRCNAM}.sh $PKG/usr/bin/${PRGNAM} sed \ -e "s/@PRGNAM@/${PRGNAM}/g" \ -e "s/@SRCEXT@/${SRCEXT}/g" \ -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \ -e "s/@CRFLAGS@/${CRFLAGS}/g" \ -e "s/@CRUSERFLAGS@/${CRUSERFLAGS}/g" \ -i $PKG/usr/bin/${PRGNAM} # Make the chromedriver available in the $PATH : ln -s ../lib${LIBDIRSUFFIX}/${PRGNAM}/chromedriver $PKG/usr/bin/chromedriver${SRCEXT} # xdg-utils looks for "chromium-browser" so symlink it to the wrapper: ln -s ${PRGNAM} $PKG/usr/bin/chromium-browser${SRCEXT} # Move the 'default' file into place. # This allows users to override command-line options: mkdir -p $PKG/etc/${PRGNAM} cat $SRCDIR/${SRCNAM}.default | sed \ -e "s/@PRGNAM@/${PRGNAM}/g" \ -e "s/@SRCEXT@/${SRCEXT}/g" \ -e "s/@CRFLAGS@/${CRFLAGS}/g" \ -e "s/@CRUSERFLAGS@/${CRUSERFLAGS}/g" \ -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \ > $PKG/etc/${PRGNAM}/00-default.conf.new if [ $USE_UNGOOGLED -eq 0 ]; then if [ -z "$_google_api_key" ]; then # If the package was built without an API key, install the sample file: cat $SRCDIR/${SRCNAM}.apikeys.sample \ > $PKG/etc/${PRGNAM}/01-apikeys.conf.new else # Else add it to the docs: mkdir -p $PKG/usr/doc/${PRGNAM}-${VERSION} cat $SRCDIR/${SRCNAM}.apikeys.sample \ > $PKG/usr/doc/${PRGNAM}-${VERSION}/01-apikeys.conf fi fi # Add this to the doinst.sh: mkdir -p $PKG/install cat <> $PKG/install/doinst.sh # Handle the incoming configuration files: config() { for infile in \$1; do NEW="\$infile" OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`" # If there's no config file by that name, mv it over: if [ ! -r \$OLD ]; then mv \$NEW \$OLD elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then # toss the redundant copy rm \$NEW fi # Otherwise, we leave the .new copy for the admin to consider... done } config etc/${PRGNAM}/00-default.conf.new # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 fi # Update hicolor theme cache: if [ -d usr/share/icons/hicolor ]; then if [ -x /usr/bin/gtk-update-icon-cache ]; then chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null fi fi # Update the mime database: if [ -x usr/bin/update-mime-database ]; then chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 fi EOINS if [ -z "$_google_api_key" ] && [ $USE_UNGOOGLED -eq 0 ]; then echo "config etc/${PRGNAM}/01-apikeys.conf.new" >> $PKG/install/doinst.sh fi # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/patches cp -a $SRCDIR/patches/*.{diff,patch} $PKG/usr/doc/$PRGNAM-$VERSION/patches/ cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; # Compress the man page(s): if [ -d $PKG/usr/man ]; then find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done fi # Add a package description: [ $USE_DEV -eq 0 ] && DEV_SPECIFICS="" \ || DEV_SPECIFICS=" This package contains the development version." [ $USE_UNGOOGLED -eq 0 ] && UG_SPECIFICS="" \ || UG_SPECIFICS=" This package contains the un-googled version." mkdir -p $PKG/install cat <$PKG/install/slack-desc $PRGNAM: chromium (Open Source version of Chrome Web Browser) $PRGNAM: $PRGNAM: Chromium is the open-source project behind Google Chrome, $PRGNAM: an attempt at creating a safer, faster, and more stable browser. $PRGNAM:$DEV_SPECIFICS $PRGNAM:$UG_SPECIFICS $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: chromium home: http://www.chromium.org/ $PRGNAM: EOT # Build the package: cd $PKG makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log cd $OUTPUT md5sum ${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5 cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.txt # Restore the original umask: umask ${_UMASK_}