From 4496b90db86e80ec3ac15277e72248a0982d78b9 Mon Sep 17 00:00:00 2001 From: m2Giles <69128853+m2Giles@users.noreply.github.com> Date: Mon, 13 May 2024 10:18:20 -0400 Subject: [PATCH] chore: use brew install script --- Containerfile | 2 +- build_files/base/brew.sh | 23 +++++++++++++++++++ build_files/base/build-base.sh | 1 + .../systemd/system/var-home-linuxbrew.mount | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 build_files/base/brew.sh diff --git a/Containerfile b/Containerfile index 2d466608990..f4c02dad8d0 100644 --- a/Containerfile +++ b/Containerfile @@ -32,7 +32,7 @@ COPY /system_files/shared/usr/etc/ublue-update/ublue-update.toml /tmp/ublue-upda # Copy Bluefin CLI packages COPY --from=bluefin-cli /usr/bin/atuin /usr/bin/atuin COPY --from=bluefin-cli /usr/share/bash-prexec /usr/share/bash-prexec -COPY --from=bluefin-cli /home/homebrew /usr/share/homebrew +# COPY --from=bluefin-cli /home/homebrew /usr/share/homebrew # COPY ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion COPY --from=akmods /rpms /tmp/akmods-rpms diff --git a/build_files/base/brew.sh b/build_files/base/brew.sh new file mode 100644 index 00000000000..abccb585616 --- /dev/null +++ b/build_files/base/brew.sh @@ -0,0 +1,23 @@ +#!/usr/bin/bash + +set -xeou pipefail + +curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh > /tmp/brew.sh +chmod +x /tmp/brew.sh + +# Convince the installer we are in CI +if [[ ! -f /.dockerenv ]]; then + touch /.dockerenv +fi + +# Make these so script will work +mkdir -p /var/home +mkdir -p /var/roothome + +# Install brew, Get portable Ruby +/tmp/brew.sh +/home/linuxbrew/.linuxbrew/bin/brew update + +# Copy to image and own by UID 1000 +cp -R /home/linuxbrew /usr/share/homebrew +chown -R 1000:1000 /usr/share/homebrew \ No newline at end of file diff --git a/build_files/base/build-base.sh b/build_files/base/build-base.sh index 17ec29c4481..d81399d7b67 100644 --- a/build_files/base/build-base.sh +++ b/build_files/base/build-base.sh @@ -9,6 +9,7 @@ set -ouex pipefail . /tmp/build/nvidia.sh . /tmp/build/image-info.sh . /tmp/build/fetch-install.sh +. /tmp/build/brew.sh . /tmp/build/fetch-quadlets.sh . /tmp/build/font-install.sh . /tmp/build/systemd.sh diff --git a/system_files/shared/usr/lib/systemd/system/var-home-linuxbrew.mount b/system_files/shared/usr/lib/systemd/system/var-home-linuxbrew.mount index 3b3f6847e02..bd10ff01821 100644 --- a/system_files/shared/usr/lib/systemd/system/var-home-linuxbrew.mount +++ b/system_files/shared/usr/lib/systemd/system/var-home-linuxbrew.mount @@ -5,6 +5,7 @@ After=cleanup-homebrew.service After=var-mount.mount ConditionPathIsDirectory=%S/homebrew ConditionPathIsDirectory=%C/homebrew +ConditionPathExists=!/var/home/linuxbrew/.linuxbrew [Mount] Type=overlay