summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Behún <kabel@kernel.org>2022-05-29 10:50:32 +0200
committerStephan Hartmann <sultan@gentoo.org>2022-05-29 20:07:07 +0200
commitae7ec85b37979abac0c3372663e1a10d90765f10 (patch)
tree1d8302f0515e849befb88cfc32f3c129126b2672 /dev-util/web_page_replay_go
parentprofiles: update chromium mask (diff)
downloadgentoo-ae7ec85b37979abac0c3372663e1a10d90765f10.tar.gz
gentoo-ae7ec85b37979abac0c3372663e1a10d90765f10.tar.bz2
gentoo-ae7ec85b37979abac0c3372663e1a10d90765f10.zip
dev-util/web_page_replay_go: add package
This is needed for PGO on www-client/chromium. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Stephan Hartmann <sultan@gentoo.org>
Diffstat (limited to 'dev-util/web_page_replay_go')
-rw-r--r--dev-util/web_page_replay_go/Manifest2
-rw-r--r--dev-util/web_page_replay_go/files/wpr-usage.patch46
-rw-r--r--dev-util/web_page_replay_go/metadata.xml12
-rw-r--r--dev-util/web_page_replay_go/web_page_replay_go-20220314.ebuild50
4 files changed, 110 insertions, 0 deletions
diff --git a/dev-util/web_page_replay_go/Manifest b/dev-util/web_page_replay_go/Manifest
new file mode 100644
index 000000000000..0c6bf98d39c7
--- /dev/null
+++ b/dev-util/web_page_replay_go/Manifest
@@ -0,0 +1,2 @@
+DIST web_page_replay_go-20220314-deps.tar.xz 22639912 BLAKE2B 5b9c3753a419a809088b2ad468f44d79ed6ff004132b3e7680d06bda28bbf1a8ce622ea64e2590bc6e7f180a7bfd4d19be1561c9770b000e14d73dffa077056f SHA512 62dde2c4725f5aeba856bb35df04dbe96bf0727095673ef80e195acf600fc615c9f976139047b8cbf4e0cad4632d864e1cd4eede50f022802ffdf60dec56dd4c
+DIST web_page_replay_go-20220314.tar.gz 35660 BLAKE2B 1d24655b1aa3ca9a19430d6acb888ec7fed36ffbeb67f70ccfc419ff9fbf23ae14f95510ad4c514833cc5908d5f58a9e2ad4118c39689387c9d83548f4860017 SHA512 67dc0019d4239d2ff535c9cfbafc5e1a529c11dfc7040f8f10a651e57ac6978bb1b2da39f27d80893614a3fffec712b8a769204d3abb2ddb5cf4738f60e96f0c
diff --git a/dev-util/web_page_replay_go/files/wpr-usage.patch b/dev-util/web_page_replay_go/files/wpr-usage.patch
new file mode 100644
index 000000000000..fb43a9c9f166
--- /dev/null
+++ b/dev-util/web_page_replay_go/files/wpr-usage.patch
@@ -0,0 +1,46 @@
+From: Marek Behún <kabel@kernel.org>
+
+Make usage text in wpr.go does reflect usage information from README.md.
+
+diff --git a/wpr.go b/wpr.go
+--- a/wpr.go
++++ b/wpr.go
+@@ -28,25 +28,27 @@ const longUsage = `
+ %s [installroot|removeroot] [options]
+ %s [record|replay] [options] archive_file
+
+- Before: Install a test root CA.
+- $ GOPATH=$PWD go run src/wpr.go installroot
+-
+ To record web pages:
+- 1. Start this program in record mode.
+- $ GOPATH=$PWD go run src/wpr.go record archive.json
++ 1. Start wpr in record mode.
++ $ wpr record --http_port=8080 --https_port=8081 /tmp/archive.wprgo
+ 2. Load the web pages you want to record in a web browser. It is important to
+ clear browser caches before this so that all subresources are requested
+- from the network.
++ from the network. This can be done by specifying a new user-data-dir.
++ Example:
++ $ google-chrome-beta --user-data-dir=$foo \
++ --host-resolver-rules="MAP *:80 127.0.0.1:8080,MAP *:443 127.0.0.1:8081,EXCLUDE localhost"
++ --ignore-certificate-errors-spki-list=PhrPvGIaAMmd29hj8BCZOq096yj7uMpRNHpn5PDxI6I=
+ 3. Kill the process to stop recording.
+
+ To replay web pages:
+- 1. Start this program in replay mode with a previously recorded archive.
+- $ GOPATH=$PWD go run src/wpr.go replay archive.json
++ 1. Start wpr in replay mode.
++ $ wpr replay --http_port=8080 --https_port=8081 /tmp/archive.wprgo
+ 2. Load recorded pages in a web browser. A 404 will be served for any pages or
+ resources not in the recorded archive.
+-
+- After: Remove the test root CA.
+- $ GOPATH=$PWD go run src/wpr.go removeroot`
++ Example:
++ $ google-chrome-beta --user-data-dir=$foo \
++ --host-resolver-rules="MAP *:80 127.0.0.1:8080,MAP *:443 127.0.0.1:8081,EXCLUDE localhost"
++ --ignore-certificate-errors-spki-list=PhrPvGIaAMmd29hj8BCZOq096yj7uMpRNHpn5PDxI6I=`
+
+ type CertConfig struct {
+ // Flags common to all commands.
diff --git a/dev-util/web_page_replay_go/metadata.xml b/dev-util/web_page_replay_go/metadata.xml
new file mode 100644
index 000000000000..5cf03e9c318a
--- /dev/null
+++ b/dev-util/web_page_replay_go/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>kabel@kernel.org</email>
+ <name>Marek Behún</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>chromium@gentoo.org</email>
+ <name>Chromium in Gentoo Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-util/web_page_replay_go/web_page_replay_go-20220314.ebuild b/dev-util/web_page_replay_go/web_page_replay_go-20220314.ebuild
new file mode 100644
index 000000000000..0a45a851bcaa
--- /dev/null
+++ b/dev-util/web_page_replay_go/web_page_replay_go-20220314.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module
+
+DESCRIPTION="A performance testing tool for recording and replaying web pages"
+HOMEPAGE="https://chromium.googlesource.com/catapult/+/refs/heads/main/web_page_replay_go/"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+SRC_URI="https://github.com/elkablo/web_page_replay_go/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/elkablo/web_page_replay_go/releases/download/v${PV}/web_page_replay_go-${PV}-deps.tar.xz"
+S="${WORKDIR}/${P}/src"
+
+src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}/wpr-usage.patch"
+ )
+
+ default
+
+ # default certificate, key and inject script in /usr/share/web_page_replay_go
+ local f
+ for f in wpr.go webpagereplay/legacyformatconvertor.go; do
+ sed -i -e 's^"\(wpr_cert\.pem\|wpr_key\.pem\|deterministic\.js\)"^"/usr/share/web_page_replay_go/\1"^' "${f}" || die "sed-editing ${f} failed"
+ done
+}
+
+src_compile() {
+ local t
+
+ for t in wpr.go httparchive.go; do
+ go build ${GOFLAGS} -mod=mod "${t}" || die "compiling ${t} failed"
+ done
+}
+
+src_install() {
+ dobin wpr
+ dobin httparchive
+
+ insinto /usr/share/${PN}
+ doins ../deterministic.js
+ doins ../wpr_cert.pem
+ doins ../wpr_key.pem
+ doins ../wpr_public_hash.txt
+}