From b5a728ae5f62c4fabf69dc7fb39883fcb210a69e Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 9 Jul 2023 18:50:31 -0600 Subject: [PATCH] Ports: Port gn This requires allowing ports to override fetch() since tar.gz sha256sums from googlesource.com are not deterministic. --- Ports/.port_include.sh | 3 ++- Ports/AvailablePorts.md | 1 + Ports/gn/package.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 Ports/gn/package.sh diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 26cf06676a..7608f70d08 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -310,7 +310,8 @@ do_download_file() { fi } -fetch() { +# FIXME: Don't allow overriding fetch, support multiple protocols instead. See #20004 +func_defined fetch || fetch() { pre_fetch tried_download_again=0 diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index dd5c96ebca..2bbde3a3e2 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -94,6 +94,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`gltron`](gltron/) | GLTron | 0.70 | http://gltron.org | | [`glu`](glu/) | Mesa GLU | 9.0.2 | https://gitlab.freedesktop.org/mesa/glu | | [`gmp`](gmp/) | GNU Multiple Precision Arithmetic Library (GMP) | 6.2.1 | https://gmplib.org/ | +| [`gn`](gn/) | GN Meta Build System | 2023.07.12 | https://gn.googlesource.com/gn/ | | [`gnuapl`](gnuapl/) | GNU APL | 1.8 | https://www.gnu.org/software/apl/ | | [`gnucobol`](gnucobol/) | GnuCOBOL | 3.1.2 | https://gnucobol.sourceforge.io/ | | [`gnupg`](gnupg/) | GnuPG | 2.3.0 | https://gnupg.org/software/index.html | diff --git a/Ports/gn/package.sh b/Ports/gn/package.sh new file mode 100755 index 0000000000..c9dc0548b5 --- /dev/null +++ b/Ports/gn/package.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='gn' +workdir='gn' +version='2023.07.12' +repository='https://gn.googlesource.com/gn' +git_rev='fae280eabe5d31accc53100137459ece19a7a295' +useconfigure='true' +# FIXME: The files and auth_type are lies here. See #20004 +files=('git') +auth_type='sha256' +depends=( + 'ninja' + 'python3' +) + +fetch() { + if [ ! -d ${workdir} ]; then + git clone ${repository} ${workdir} + fi + run git checkout ${git_rev} +} + +configure() { + run python3 build/gen.py --platform='serenity' --allow-warnings +} + +build() { + run ninja -C out +} + +install() { + run mkdir -p "${SERENITY_INSTALL_ROOT}/usr/local/bin" + run cp out/gn "${SERENITY_INSTALL_ROOT}/usr/local/bin" + run cp out/gn_unittests "${SERENITY_INSTALL_ROOT}/usr/local/bin" +}