Merge pull request #1129 from ublue-os/homebrew2

chore: use brew's installer
This commit is contained in:
m2 2024-05-16 01:35:47 -04:00 committed by GitHub
commit 84ef9d67b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 3 deletions

View File

@ -9,7 +9,6 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-40}"
FROM ghcr.io/ublue-os/akmods:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION} as akmods
FROM ghcr.io/ublue-os/akmods-extra:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION} as akmods-extra
FROM ghcr.io/ublue-os/bluefin-cli:latest as bluefin-cli
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bazzite
@ -539,8 +538,17 @@ RUN rpm-ostree install \
sed -i~ -E 's/=.\$\(command -v (nft|ip6?tables-legacy).*/=/g' /usr/lib/waydroid/data/scripts/waydroid-net.sh && \
ostree container commit
# Copy Homebrew
COPY --from=bluefin-cli /home/homebrew /usr/share/homebrew
# Homebrew
RUN touch /.dockerenv && \
mkdir -p /var/home && \
mkdir -p /var/roothome && \
curl -Lo /tmp/brew-install https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh && \
chmod +x /tmp/brew-install && \
/tmp/brew-install && \
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor && \
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/.git && \
cp -R /home/linuxbrew /usr/share/homebrew && \
ostree container commit
# Cleanup & Finalize
COPY system_files/overrides /

View File

@ -1,11 +1,18 @@
[Unit]
Description=Setup Brew
Wants=network-online.target
After=network-online.target
ConditionPathExists=!/etc/.linuxbrew
ConditionPathExists=!/var/home/linuxbrew/.linuxbrew
[Service]
Type=oneshot
Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ExecStart=/usr/bin/cp -R -n /usr/share/homebrew/.linuxbrew /var/home/linuxbrew
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew update
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew upgrade
ExecStart=/usr/bin/chown -R 1000:1000 /var/home/linuxbrew
ExecStart=/usr/bin/touch /etc/.linuxbrew

View File

@ -8,5 +8,8 @@ ConditionPathExists=/home/linuxbrew/.linuxbrew/bin/brew
# Override the user if different UID/User
User=1000
Type=oneshot
Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew update
StandardOutput=journal

View File

@ -8,5 +8,8 @@ ConditionPathExists=/home/linuxbrew/.linuxbrew/bin/brew
# Override the user if different UID/User
User=1000
Type=oneshot
Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew upgrade
StandardOutput=journal