haproxy/deps/quictls/Makefile

44 lines
1.9 KiB
Makefile
Raw Normal View History

OPENSSL_VERSION = 1.1.1o
BUILD_VERSION_REPOSHA = $(shell git rev-parse --short HEAD)
QUICTLS_BRANCH = OpenSSL_$(subst .,_,$(OPENSSL_VERSION))
QUICTLS_BUILD_VERSION = $(OPENSSL_VERSION)+quic-mangadex-$(BUILD_VERSION_REPOSHA)
QUICTLS_SOURCES = https://codeload.github.com/quictls/openssl/tar.gz/$(QUICTLS_BRANCH)+quic
QUICTLS_TARBALL = quictls-$(OPENSSL_VERSION).tar.gz
QUICTLS_BUILDIR = src
QUICTLS_DESTDIR = dist
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
QUICTLS_ARCHIVE = quictls-dist.tar.gz
2022-06-07 08:36:13 +05:30
all: build $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)
2022-06-07 08:36:13 +05:30
$(QUICTLS_TARBALL):
curl -sfS -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
2022-06-07 08:36:13 +05:30
$(QUICTLS_BUILDIR): $(QUICTLS_TARBALL)
@if ! [ -d "$(QUICTLS_BUILDIR)" ]; then mkdir -v "$(QUICTLS_BUILDIR)"; fi
tar -C $(QUICTLS_BUILDIR) --strip-components=1 -xf "$(QUICTLS_TARBALL)"
2022-06-07 08:36:13 +05:30
build: $(QUICTLS_BUILDIR)
cd "$(QUICTLS_BUILDIR)" && sed -i 's/^# define OPENSSL_VERSION_TEXT.*$\/# define OPENSSL_VERSION_TEXT "OpenSSL $(subst +,\+,$(QUICTLS_BUILD_VERSION)) $(shell date -u +'%e %b %Y')"/g' "include/openssl/opensslv.h"
cd "$(QUICTLS_BUILDIR)" && ./config --prefix="/opt/quictls" --openssldir="/opt/quictls" no-shared
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)" VERSION=$(OPENSSL_VERSION)+quic-mangadex-$(BUILD_VERSION_REPOSHA)
ldd "$(QUICTLS_BUILDIR)/apps/openssl" || true
"$(QUICTLS_BUILDIR)/apps/openssl" version
$(QUICTLS_DESTDIR): build
if ! [ -d "$(QUICTLS_DESTDIR)" ]; then mkdir -v "$(QUICTLS_DESTDIR)"; fi
$(MAKE) -C "$(QUICTLS_BUILDIR)" -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.
$(QUICTLS_ARCHIVE): $(QUICTLS_DESTDIR)
tar -C "$(QUICTLS_DESTDIR)" -cjf "$(QUICTLS_ARCHIVE)" "opt"
clean:
2022-06-07 08:36:13 +05:30
rm -fv "$(QUICTLS_TARBALL)"
rm -rf "$(QUICTLS_BUILDIR)"
rm -rf "$(QUICTLS_DESTDIR)"
rm -fv "$(QUICTLS_ARCHIVE)"
.PHONY: clean build