Created
June 12, 2025 16:49
-
-
Save PEMessage/cecfcfff6a5fe12c034be783159c8031 to your computer and use it in GitHub Desktop.
build-static-ag.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Credit: https://www.gkbrk.com/static-zstd-binary | |
docker run -t \ | |
-e UID="$(id -u)" \ | |
-e GID="$(id -g)" \ | |
-v "$PWD":/w \ | |
-w /tmp \ | |
--rm \ | |
-it \ | |
alpine:3.18 \ | |
sh -c " | |
set -e | |
apk add musl-dev gcc git make autoconf automake && | |
apk add pcre-dev pcre && | |
apk add zlib-dev zlib-static xz-dev xz-static && | |
mkdir -p /build && | |
cd /build && | |
git clone -b master https://github.com/satanson/the_silver_searcher . && | |
aclocal && | |
autoconf && | |
autoheader && | |
automake --add-missing | |
export CFLAGS='-fPIC -static -flto -O2' | |
./configure | |
make && | |
chown "$UID:$GID" ag && | |
chmod +x ag && | |
mv ag /w/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment