Explorar el Código

Initial release

Nicole Portas hace 3 semanas
commit
ba2ccd5a12
Se han modificado 2 ficheros con 137 adiciones y 0 borrados
  1. 68 0
      README.md
  2. 69 0
      build_chrome_appimage.sh

+ 68 - 0
README.md

@@ -0,0 +1,68 @@
+# Chrome AppImage Builder (Dockerized)
+
+A fully containerized build script that creates a self-contained, portable `.AppImage` for **Google Chrome**.
+
+Following the "Nicole Method," this script uses Docker to isolate the build environment, ensuring your host system stays clean of Google’s dependencies, GPG keys, and repository bloat.
+
+## The Problem
+
+Installing Google Chrome on Linux usually involves adding third-party repositories, dealing with SUID sandbox issues, and having Google's update services linger in the background of your OS.
+
+## The Solution
+
+This script spins up a temporary Ubuntu container, fetches the latest official `.deb` from Google, relocates the binaries into a standard AppDir structure, and squashes it into a portable AppImage.
+
+-   **Zero Host Pollution:** No Google repos or dependencies installed on your machine.
+    
+-   **Banner-Free:** Pre-configured with `--test-type` to suppress "unsupported flag" warnings.
+    
+-   **Self-Contained:** Includes the latest Chrome binaries and required library shims.
+    
+-   **Portable:** Move the single `.AppImage` file between distros and it just fucking works.
+    
+
+----------
+
+## Prerequisites
+
+-   **Docker:** You need the Docker engine installed and your user added to the `docker` group.
+    
+-   **FUSE:** Required on your host to run the resulting AppImage.
+    
+
+## How to use it
+
+1.  **Clone the Repo** (or just save the script).
+    
+2.  **Run the Builder:**
+    
+    Bash
+    
+    ```
+    chmod +x make_chrome_appimage.sh
+    ./make_chrome_appimage.sh
+    
+    ```
+    
+3.  **Launch Chrome:** The finished file will be in the `/out` directory.
+    
+    Bash
+    
+    ```
+    chmod +x out/Google_Chrome-*.AppImage
+    ./out/Google_Chrome-*.AppImage
+    
+    ```
+    
+
+## Included Tweaks
+
+The `AppRun` script is pre-configured with the following flags to ensure a smooth "AppImage" experience:
+
+-   `--no-sandbox`: Ensures compatibility with FUSE mounts and container environments.
+    
+-   `--test-type`: Suppresses the "unsupported command-line flag" notification.
+    
+-   `--password-store=basic`: Avoids hangs caused by system keyring mismatches.
+    
+-   `--no-first-run`: Skips the annoying "Welcome to Chrome" setup tabs.

+ 69 - 0
build_chrome_appimage.sh

@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Exit on any error
+set -e
+
+# Configuration
+IMAGE_NAME="chrome-builder"
+OUTPUT_DIR="$(pwd)/out"
+mkdir -p "$OUTPUT_DIR"
+
+echo "Building the 'Nicole Edition' Chrome AppImage..."
+
+# 1. Create the Dockerfile
+cat <<EOF > Dockerfile.chrome
+FROM ubuntu:22.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# Install essential build tools and dependencies
+RUN apt-get update && apt-get install -y \\
+    wget curl file binutils desktop-file-utils \\
+    libglib2.0-bin fakeroot libnss3 libatk1.0-0 \\
+    libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 \\
+    libasound2 libpangocairo-1.0-0 libxkbcommon0 \\
+    libgtk-3-0 squashfs-tools zsync ca-certificates
+
+# Grab the modern appimagetool
+RUN curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o /usr/local/bin/appimagetool \\
+    && chmod +x /usr/local/bin/appimagetool
+
+WORKDIR /build
+
+# The Build Logic:
+# 1. Download the latest deb
+# 2. Extract version and contents
+# 3. Relocate binary from /opt to /usr/bin
+# 4. Grab the 256px logo from the new Google path
+# 5. Create AppRun with the banner-killer flag (--test-type)
+CMD wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O chrome.deb && \\
+    CHROME_VERSION=\$(dpkg-deb -f chrome.deb Version | cut -d- -f1) && \\
+    echo "Fucking version found: \$CHROME_VERSION" && \\
+    mkdir -p Chrome.AppDir/usr/bin && \\
+    dpkg-deb -x chrome.deb Chrome.AppDir/ && \\
+    cp -r Chrome.AppDir/opt/google/chrome/* Chrome.AppDir/usr/bin/ && \\
+    # Fix the Icon: New location is inside the opt/google/chrome folder
+    cp Chrome.AppDir/opt/google/chrome/product_logo_256.png Chrome.AppDir/google-chrome.png || touch Chrome.AppDir/google-chrome.png && \\
+    # Create the AppRun with banner-suppression
+    printf '#!/bin/sh\nHERE=\$(dirname \$(readlink -f "\${0}"))\nexport LD_LIBRARY_PATH="\${HERE}"/usr/lib:\$LD_LIBRARY_PATH\nexec "\${HERE}"/usr/bin/google-chrome --no-sandbox --test-type --no-first-run --password-store=basic "\$@"' > Chrome.AppDir/AppRun && \\
+    chmod +x Chrome.AppDir/AppRun && \\
+    # Create the Desktop entry
+    printf "[Desktop Entry]\nName=Google Chrome\nExec=google-chrome\nIcon=google-chrome\nType=Application\nCategories=Network;WebBrowser;" > Chrome.AppDir/google-chrome.desktop && \\
+    # Squash the bastard
+    /usr/local/bin/appimagetool --appimage-extract-and-run Chrome.AppDir "/out/Google_Chrome-\${CHROME_VERSION}-x86_64.AppImage"
+EOF
+
+# 2. Build the Docker Image
+docker build -t "$IMAGE_NAME" -f Dockerfile.chrome .
+
+# 3. Run and map output
+# Mapping current out dir to container /out
+docker run --rm -v "$OUTPUT_DIR:/out" "$IMAGE_NAME"
+
+# 4. Cleanup
+rm Dockerfile.chrome
+
+echo "------------------------------------------------"
+echo "Build complete! Check the /out folder."
+echo "Remember to: chmod +x $OUTPUT_DIR/Google_Chrome-*.AppImage"
+ls -lh "$OUTPUT_DIR"