#!/bin/sh set -e # git won't build without msgfmt, and gettext-tools won't build on a # static-linked musl machine. make it a no-op if it's not available. which msgfmt 2> /dev/null \ || sed -i 's/MSGFMT = msgfmt/MSGFMT = echo/' Makefile make configure CFLAGS="$CFLAGS -g -O2 -Wall" \ LIBS="-lbearssl -lz" \ NO_REGEX=YesPlease \ NO_GETTEXT=YesPlease \ ./configure \ --without-tcltk \ --with-expat \ --with-libpcre2 \ --build=$(uname -m)-lix-linux-musl \ --prefix= ## explanation # # CFLAGS: do some completely optional optimization. # # LIBS: libcurl seems to depend on bearssl and zlib being included. git doesn't # seem to pull these in automatically, so it's done here with LIBS. # # NO_GETTEXT: gettext allows for internationalization. i.e., it lets git # replace english text with pre-translated strings based on the user's # locale. nothing wrong with that, except gettext does not appear to # compile on static-only musl machines. # # NO_REGEX: git relies on global regex constants that are not in musl. # # --without-tcltk: don't bother building "git gui." # # --with-expat: can't "git push" over http[s] without libexpat. # # --with-libpcre2: support perl-compatible regular expressions. # # --build: doesn't infer the right build triple on its own. # # --prefix: make sure git doesn't put anything in /usr/local. keep it simple.