From b4241805bdc8003d30873cc90ed9a1eb3acfc00f Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 19 Apr 2026 12:00:01 +0000 Subject: [PATCH 1/2] Cargo optimization. --- .cargo/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5a4d204e..98326397 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,6 @@ [build] -# rustc-wrapper = "sccache" +rustc-wrapper = "sccache" [target.x86_64-unknown-linux-gnu] linker = "clang" -# rustflags = ["-C", "link-arg=-fuse-ld=mold"] +rustflags = ["-C", "link-arg=-fuse-ld=mold"] From e364b75e9b0c51e8acd8409ecea78bb3bb0715ae Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 19 Apr 2026 12:24:51 +0000 Subject: [PATCH 2/2] Cargo optimization. --- .cargo/config.toml | 1 + DEV-DEPENDENCIES.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100755 DEV-DEPENDENCIES.sh diff --git a/.cargo/config.toml b/.cargo/config.toml index 98326397..8d724206 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,6 @@ [build] rustc-wrapper = "sccache" +jobs = 12 [target.x86_64-unknown-linux-gnu] linker = "clang" diff --git a/DEV-DEPENDENCIES.sh b/DEV-DEPENDENCIES.sh new file mode 100755 index 00000000..8112a815 --- /dev/null +++ b/DEV-DEPENDENCIES.sh @@ -0,0 +1,54 @@ +#!/bin/bash +set -e + +if [ "$EUID" -ne 0 ]; then + echo "Run as root (use sudo)" + exit 1 +fi + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +echo "Installing runtime dependencies first..." +bash "$SCRIPT_DIR/DEPENDENCIES.sh" + +echo "Installing dev/build dependencies..." +OS=$(grep -oP '(?<=^ID=).+' /etc/os-release 2>/dev/null | tr -d '"' || echo "unknown") + +install_debian() { + apt-get install -y -qq \ + clang lld build-essential pkg-config libssl-dev libpq-dev cmake git \ + libglib2.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ + libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev +} + +install_fedora() { + dnf install -y -q \ + clang lld gcc gcc-c++ make pkg-config openssl-devel postgresql-devel cmake git \ + glib2-devel gobject-introspection-devel gtk3-devel webkit2gtk3-devel \ + javascriptcoregtk-devel libappindicator-gtk3-devel librsvg2-devel libsoup3-devel +} + +install_arch() { + pacman -Sy --noconfirm \ + clang lld gcc make pkg-config openssl libpq cmake git \ + glib2 gtk3 webkit2gtk4 javascriptcoregtk libappindicator librsvg libsoup +} + +case $OS in + ubuntu|debian|linuxmint|pop) install_debian ;; + fedora|rhel|centos|rocky|almalinux) install_fedora ;; + arch|manjaro) install_arch ;; + *) echo "Unsupported OS: $OS"; exit 1 ;; +esac + +install_cargo_tools() { + CARGO_BIN="${HOME}/.cargo/bin" + if [ -f "$CARGO_BIN/cargo" ]; then + export PATH="$CARGO_BIN:$PATH" + . "$CARGO_BIN/env" 2>/dev/null + cargo install mold --locked 2>/dev/null || true + fi +} + +command -v mold &> /dev/null || install_cargo_tools + +echo "Dev dependencies installed!" \ No newline at end of file