Global cleanup for fully reproducible local build

This commit is contained in:
Tristan
2022-06-06 05:46:20 +01:00
parent 8cc1d4e0db
commit 5971388de4
15 changed files with 208 additions and 161 deletions

27
deps/lua/Makefile vendored Normal file
View File

@@ -0,0 +1,27 @@
LUA_VERSION = 5.3.6
LUA_SOURCES = https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
LUA_TARBALL = lua-$(LUA_VERSION).tar.gz
LUA_DESTDIR = dist
LUA_DESTDIR_ABS = $(shell realpath $(LUA_DESTDIR))
all: build $(LUA_DESTDIR)
src:
if ! [ -d "src" ]; then mkdir -v "src"; fi
src/lua-$(LUA_VERSION).tar.gz: src
curl -sSL -o "$(LUA_TARBALL)" "$(LUA_SOURCES)"
build: src/lua-$(LUA_VERSION).tar.gz
tar -C src --strip-components=1 -xf "$(LUA_TARBALL)"
$(MAKE) -C src -j$(shell nproc) linux
$(LUA_DESTDIR): build
if ! [ -d "$(LUA_DESTDIR)" ]; then mkdir -v "$(LUA_DESTDIR)"; fi
$(MAKE) -C src -j$(shell nproc) install INSTALL_TOP="$(LUA_DESTDIR_ABS)"
clean:
rm -rf "src"
rm -rf "$(LUA_DESTDIR)"
.PHONY: clean build

28
deps/pcre2/Makefile vendored Normal file
View File

@@ -0,0 +1,28 @@
PCRE2_VERSION = 10.40
PCRE2_SOURCES = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$(PCRE2_VERSION)/pcre2-$(PCRE2_VERSION).tar.gz
PCRE2_TARBALL = pcre2-$(PCRE2_VERSION).tar.gz
PCRE2_DESTDIR = dist
PCRE2_DESTDIR_ABS = $(shell realpath $(PCRE2_DESTDIR))
all: build dist
src:
if ! [ -d "src" ]; then mkdir -v "src"; fi
src/pcre2-$(PCRE2_VERSION).tar.gz: src
curl -sSL -o "$(PCRE2_TARBALL)" "$(PCRE2_SOURCES)"
build: src/pcre2-$(PCRE2_VERSION).tar.gz
tar -C src --strip-components=1 -xf "$(PCRE2_TARBALL)"
if [ -f "src/CmakeCache.txt" ]; then rm -v "src/CmakeCache.txt"; fi
cd "src" && cmake -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_JIT=ON -DCMAKE_INSTALL_PREFIX="$(PCRE2_DESTDIR_ABS)" . && make
dist: build
if ! [ -d "$(PCRE2_DESTDIR)" ]; then mkdir -v "$(PCRE2_DESTDIR)"; fi
cd "src" && make install
clean:
rm -rf "src"
.PHONY: clean build dist

37
deps/quictls/Makefile vendored Normal file
View File

@@ -0,0 +1,37 @@
QUICTLS_VERSION = OpenSSL_1_1_1o
QUICTLS_SOURCES = https://codeload.github.com/quictls/openssl/tar.gz/$(QUICTLS_VERSION)+quic
QUICTLS_TARBALL = quictls-$(QUICTLS_VERSION).tar.gz
QUICTLS_DESTDIR = dist
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
QUICTLS_ARCHIVE = quictls-$(QUICTLS_VERSION)-dist.tar.gz
all: build $(QUICTLS_DESTDIR) archive
src:
if ! [ -d "src" ]; then mkdir -v "src"; fi
src/quictls-$(QUICTLS_VERSION).tar.gz: src
curl -sSL -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
build: src/quictls-$(QUICTLS_VERSION).tar.gz
tar -C src --strip-components=1 -xf "$(QUICTLS_TARBALL)"
cd "src" && ./config --prefix="/opt/quictls" --openssldir="/opt/quictls" no-shared
$(MAKE) -C "src" -j "$(shell nproc)"
ldd "src/apps/openssl" || true
src/apps/openssl version
$(QUICTLS_DESTDIR):
if ! [ -d "$(QUICTLS_DESTDIR)" ]; then mkdir -v "$(QUICTLS_DESTDIR)"; fi
$(MAKE) -C "src" -j "$(shell nproc)" DESTDIR="$(QUICTLS_DESTDIR_ABS)" install_sw
# Take a moment to hate on how fucking shit the `tar` CLI is with me, especially regarding the awkward dance of path prefixes. Press S.
archive: $(QUICTLS_DESTDIR)
tar -C "$(QUICTLS_DESTDIR)" -cjf "$(QUICTLS_ARCHIVE)" "opt"
clean:
@rm -rf "src" || true
@rm -rf "$(QUICTLS_TARBALL)" || true
@rm -rf "$(QUICTLS_DESTDIR)" || true
@rm -v "$(QUICTLS_ARCHIVE)" || true
.PHONY: clean build $(QUICTLS_DESTDIR) dist archive