From d69fe4f1b5c2a0afa34e1ecbc2dd2f7d1964b302 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 22:53:21 -1000 Subject: Build Git without translations or Tcl tools cgit never shows Git's translations or runs its Tcl tools, yet building needed libintl and msgfmt for one and, under make test, tclsh for the other, which a musl system such as Alpine lacks. --- Makefile | 17 +++++++++-------- README.txt | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index fe65cba..7c406cc 100644 --- a/Makefile +++ b/Makefile @@ -61,15 +61,16 @@ export CGIT_DATA_PATH CGIT_CONFIG CACHE_ROOT all: cgit -# NO_RUST keeps Cargo out of the build. Git 2.55 inverted the flag that used to -# be WITH_RUST, so Rust is now compiled in unless it is turned off, and leaving +# NO_GETTEXT and NO_TCLTK leave out Git's translations and its Tcl tools, none +# of which cgit uses, so the build needs no libintl, msgfmt or tclsh. NO_RUST +# keeps Cargo out of the build. Git 2.55 inverted the flag that used to be +# WITH_RUST, so Rust is now compiled in unless it is turned off, and leaving # this out would quietly make Cargo a build requirement. Git 3.0 drops the -# choice entirely, at which point this stops working and Rust becomes -# mandatory. Git's own build defaults prefix to $HOME and compiles it in as -# its fallback runtime prefix, so without the last flag every binary carries -# the home directory of whoever built it and no two builders get the same -# bytes. -GIT_BUILD_FLAGS = NO_CURL=1 NO_OPENSSL=1 NO_RUST=1 prefix='$(prefix)' +# choice entirely, at which point this stops working and Rust becomes mandatory. +# Git's own build defaults prefix to $HOME and compiles it in as its fallback +# runtime prefix, so without the last flag every binary carries the home +# directory of whoever built it and no two builders get the same bytes. +GIT_BUILD_FLAGS = NO_CURL=1 NO_GETTEXT=1 NO_OPENSSL=1 NO_RUST=1 NO_TCLTK=1 prefix='$(prefix)' # Apple's linker otherwise stamps each object's mtime into the debug map, so # two builds of the same sources would differ. diff --git a/README.txt b/README.txt index affddf6..4d3ab51 100644 --- a/README.txt +++ b/README.txt @@ -31,8 +31,8 @@ into /var/www/htdocs/cgit, and the Lua filters from custom/extensions into /usr/local/lib/cgit/filters. The locations and a few other things can be changed by providing a cgit.conf file, see the Makefile for details. -The only required library is zlib. cgit builds without OpenSSL or libcurl, so no -development packages for those are needed. +The only required library is zlib. cgit builds without OpenSSL, libcurl, +gettext or Tcl, so no development packages for those are needed. Lua is optional and only powers the lua: filter extensions, the filters in custom/extensions/. A plain build auto-detects a Lua through pkg-config, -- cgit