public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/chromium-tools:master commit in: /
Date: Thu,  1 Sep 2022 19:24:35 +0000 (UTC)	[thread overview]
Message-ID: <1662060262.2075fce3f64bed3df495af5aad2295f336ddb49a.floppym@gentoo> (raw)

commit:     2075fce3f64bed3df495af5aad2295f336ddb49a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  1 19:24:03 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Sep  1 19:24:22 2022 +0000
URL:        https://gitweb.gentoo.org/proj/chromium-tools.git/commit/?id=2075fce3

Add package.sh

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 package.sh | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

diff --git a/package.sh b/package.sh
new file mode 100755
index 0000000..41dbd92
--- /dev/null
+++ b/package.sh
@@ -0,0 +1,115 @@
+#!/bin/bash -e
+
+MYPKG="chromium"
+MYVERSION="99.0.4844.51"
+#MYTARGETS=( "gcc_official" "gcc" "clang" "ozone" )
+MYTARGETS=( "gcc" "clang" "ozone" )
+
+MYRE2_SLOT="0/9"
+MYICU_SLOT="0/70.1"
+
+MYKEYWORD_PKGS=()
+#MYKEYWORD_PKGS+=( "dev-util/gn" )
+#MYKEYWORD_PKGS+=( "~media-video/ffmpeg-4.3.1" )
+#MYKEYWORD_PKGS+=( "dev-libs/re2:${MYRE2_SLOT}" )
+#MYKEYWORD_PKGS+=( "dev-libs/icu:${MYICU_SLOT}" )
+#MYKEYWORD_PKGS+=( "=media-libs/libwebp-1.2.2" )
+
+MYCATEGORY="www-client"
+MYPKGDIR="$(portageq pkgdir)"
+MYEBUILD="=${MYPKG}-${MYVERSION}"
+MYEMERGE_OPTS="-vuDN --with-bdeps=y --complete-graph"
+MYCCACHE_BASE="/var/tmp/ccache"
+MYCCACHE_USE=true
+MYUSE_FLAGS_BASE="-component-build -headless -custom-cflags cups hangouts js-type-check -kerberos pic proprietary-codecs pulseaudio suid -system-ffmpeg system-icu tcmalloc widevine"
+
+MYTARGET_USE_gcc_official=( "${MYCATEGORY}/${MYPKG} -wayland -screencast vaapi official" )
+MYTARGET_USE_gcc=( "${MYCATEGORY}/${MYPKG} -wayland -screencast -vaapi -official" )
+MYTARGET_USE_clang=( "${MYCATEGORY}/${MYPKG} -wayland -screencast -vaapi -official" )
+MYTARGET_USE_ozone=( "${MYCATEGORY}/${MYPKG} wayland screencast vaapi -official" )
+MYTARGET_USE_ozone+=( "x11-libs/gtk+ wayland" )
+MYTARGET_USE_ozone+=( "media-libs/mesa wayland" )
+
+MYCOMPILERS_gcc_official=( "gcc-9.3.0" )
+MYCOMPILERS_gcc=( "gcc-10.3.0" "gcc-11.2.0" )
+MYCOMPILERS_clang=( "clang-13" )
+MYCOMPILERS_ozone=( "gcc-11.2.0" )
+
+# merge ccache
+emerge ${MYEMERGE_OPTS} ccache
+if [[ ! -d "${MYCCACHE_BASE}" ]]; then
+	mkdir -p "${MYCCACHE_BASE}"
+	chown root:portage "${MYCCACHE_BASE}"
+	chmod 775 "${MYCCACHE_BASE}"
+fi
+
+# setup keywords
+rm -f "/etc/portage/package.accept_keywords/chromium"
+echo "=${MYCATEGORY}/${MYPKG}-${MYVERSION}" >> "/etc/portage/package.accept_keywords/chromium"
+
+for mypkg in "${MYKEYWORD_PKGS[@]}"; do
+	echo "$mypkg" >> "/etc/portage/package.accept_keywords/chromium"
+done
+
+# unmask chromium (dev channels are usually masked)
+rm -f "/etc/portage/package.unmask/chromium"
+echo "=${MYCATEGORY}/${MYPKG}-${MYVERSION}" >> "/etc/portage/package.unmask/chromium"
+
+# setup base USE flags
+echo "${MYCATEGORY}/${MYPKG} ${MYUSE_FLAGS_BASE}" > "/etc/portage/package.use/chromium-base"
+
+for mytarget in "${MYTARGETS[@]}"; do
+
+	# setup build USE flags
+	mytarget_use="MYTARGET_USE_${mytarget}[@]"
+	rm -f "/etc/portage/package.use/chromium-build"
+	for myuse in "${!mytarget_use}"; do
+		echo "${myuse}" >> "/etc/portage/package.use/chromium-build"
+	done
+
+	mycompilers="MYCOMPILERS_${mytarget}[@]"
+	for mycompiler in "${!mycompilers}"; do
+		mycc="x86_64-pc-linux-gnu-${mycompiler}"
+		if [[ ${mycompiler} = gcc* ]]; then
+			mycxx="x86_64-pc-linux-gnu-${mycompiler/gcc/g++}"
+		else
+			mycxx="x86_64-pc-linux-gnu-${mycompiler/clang/clang++}"
+		fi
+		rm -f "/etc/portage/env/chromium-cc.conf"
+		echo "CC=\"${mycc}\"" >> "/etc/portage/env/chromium-cc.conf"
+		echo "CXX=\"${mycxx}\"" >> "/etc/portage/env/chromium-cc.conf"
+		myversion="${mycompiler#*-}"
+		# remove installed package
+		emerge --depclean -v "${MYCATEGORY}/${MYPKG}"
+
+		mytargetdir="${mytarget}_${mycompiler%%-*}${myversion%%.*}"
+
+		# setup ccache
+		if [[ ! -d "${MYCCACHE_BASE}/${mytargetdir}" ]]; then
+			mkdir "${MYCCACHE_BASE}/${mytargetdir}"
+			chown root:portage "${MYCCACHE_BASE}/${mytargetdir}"
+			chmod 775 "${MYCCACHE_BASE}/${mytargetdir}"
+		fi
+		if [[ ! -f "${MYCCACHE_BASE}/${mytargetdir}/ccache.conf" ]]; then
+			cat <<- EOF > "${MYCCACHE_BASE}/${mytargetdir}/ccache.conf"
+				max_size = 10.0G
+				umask = 002
+				compression = false
+			EOF
+			chown root:portage "${MYCCACHE_BASE}/${mytargetdir}/ccache.conf"
+			chmod 664 "${MYCCACHE_BASE}/${mytargetdir}/ccache.conf"
+		fi
+		echo "CCACHE_DIR=\"${MYCCACHE_BASE}/${mytargetdir}\"" >> "/etc/portage/env/chromium-cc.conf"
+		if [[ ${MYCCACHE_USE} = true ]]; then
+			echo "FEATURES=\"ccache\"" >> "/etc/portage/env/chromium-cc.conf"
+		fi
+
+		# build chromium
+		emerge ${MYEMERGE_OPTS} "${MYEBUILD}"
+		# create binary package
+#		PKGDIR="${MYPKGDIR}/${mytargetdir}" quickpkg ${MYPKG} --include-config=y
+		# update access rights
+		find "${MYPKGDIR}" -type d -exec chmod 755 {} \;
+		find "${MYPKGDIR}" -type f -exec chmod 644 {} \;
+	done
+done


             reply	other threads:[~2022-09-01 19:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 19:24 Mike Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-25  4:03 [gentoo-commits] proj/chromium-tools:master commit in: / Matt Jolly
2025-03-10 13:43 Matt Jolly
2025-03-10 13:43 Matt Jolly
2024-10-23  3:50 Matt Jolly
2024-10-23  3:50 Matt Jolly
2024-10-10 21:52 Matt Jolly
2024-10-10 10:03 Matt Jolly
2024-09-27  0:52 Matt Jolly
2024-09-27  0:52 Matt Jolly
2024-09-27  0:52 Matt Jolly
2024-09-26  7:25 Matt Jolly
2024-09-26  5:29 Matt Jolly
2024-09-26  5:21 Matt Jolly
2024-09-26  3:03 Matt Jolly
2024-09-26  2:39 Matt Jolly
2024-09-26  2:36 Matt Jolly
2024-08-30  3:39 Matt Jolly
2024-06-01  7:22 Matt Jolly
2024-05-31 23:02 Matt Jolly
2024-03-28  2:39 Matt Jolly
2024-03-20 21:45 Matt Jolly
2024-03-20 21:45 Matt Jolly
2024-03-20 21:45 Matt Jolly
2024-03-20 21:45 Matt Jolly
2023-02-05 15:09 Stephan Hartmann
2022-09-01 19:33 Mike Gilbert
2022-05-06  9:55 Stephan Hartmann
2022-05-03 16:54 Mike Gilbert
2022-05-03 16:54 Mike Gilbert
2022-02-11 17:16 Stephan Hartmann
2022-02-05 16:29 Stephan Hartmann
2022-01-31 20:20 Stephan Hartmann
2020-11-21 19:34 Stephan Hartmann
2020-10-26 17:48 Mike Gilbert
2016-09-15 16:15 Mike Gilbert
2016-09-15 16:11 Mike Gilbert
2015-08-13 20:53 Mike Gilbert
2012-07-31 23:27 Mike Gilbert
2012-07-31 20:39 Mike Gilbert
2012-06-18  7:38 Paweł Hajdan
2011-10-25 16:36 Paweł Hajdan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1662060262.2075fce3f64bed3df495af5aad2295f336ddb49a.floppym@gentoo \
    --to=floppym@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox