2022-06-09 17:29:28 +05:30
|
|
|
OPENSSL_VERSION = 3.0.3
|
2022-06-07 16:30:30 +05:30
|
|
|
BUILD_VERSION_REPOSHA = $(shell git rev-parse --short HEAD)
|
2022-06-09 17:29:28 +05:30
|
|
|
QUICTLS_BUILD_VERSION = quic-mangadex-$(BUILD_VERSION_REPOSHA)
|
2022-06-07 16:30:30 +05:30
|
|
|
|
2022-06-09 17:29:28 +05:30
|
|
|
QUICTLS_SOURCES = https://codeload.github.com/quictls/openssl/tar.gz/openssl-$(OPENSSL_VERSION)+quic
|
2022-06-07 16:30:30 +05:30
|
|
|
QUICTLS_TARBALL = quictls-$(OPENSSL_VERSION).tar.gz
|
2022-06-06 11:22:47 +05:30
|
|
|
QUICTLS_BUILDIR = src
|
2022-06-06 10:16:20 +05:30
|
|
|
QUICTLS_DESTDIR = dist
|
|
|
|
QUICTLS_DESTDIR_ABS = $(shell realpath $(QUICTLS_DESTDIR))
|
2022-06-06 13:21:31 +05:30
|
|
|
QUICTLS_ARCHIVE = quictls-dist.tar.gz
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
all: build $(QUICTLS_DESTDIR) $(QUICTLS_ARCHIVE)
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(QUICTLS_TARBALL):
|
|
|
|
curl -sfS -o "$(QUICTLS_TARBALL)" "$(QUICTLS_SOURCES)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-07 08:36:13 +05:30
|
|
|
$(QUICTLS_BUILDIR): $(QUICTLS_TARBALL)
|
|
|
|
@if ! [ -d "$(QUICTLS_BUILDIR)" ]; then mkdir -v "$(QUICTLS_BUILDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
tar -C $(QUICTLS_BUILDIR) --strip-components=1 -xf "$(QUICTLS_TARBALL)"
|
2022-06-07 08:36:13 +05:30
|
|
|
|
|
|
|
build: $(QUICTLS_BUILDIR)
|
2022-06-09 17:29:28 +05:30
|
|
|
cd "$(QUICTLS_BUILDIR)" && sed -i 's/^BUILD_METADATA.*/BUILD_METADATA=$(QUICTLS_BUILD_VERSION)/g' "VERSION.dat"
|
|
|
|
cd "$(QUICTLS_BUILDIR)" && sed -i 's/^RELEASE_DATE.*/RELEASE_DATE="$(shell date -u +'%e %b %Y')"/g' "VERSION.dat"
|
2022-06-14 09:16:37 +05:30
|
|
|
cd "$(QUICTLS_BUILDIR)" && ./Configure --prefix="/opt/quictls" --openssldir="/opt/quictls" --libdir="lib" -DPURIFY no-shared
|
|
|
|
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)" VERSION=$(OPENSSL_VERSION)+quic-mangadex-$(BUILD_VERSION_REPOSHA) build_sw
|
2022-06-06 11:22:47 +05:30
|
|
|
ldd "$(QUICTLS_BUILDIR)/apps/openssl" || true
|
|
|
|
"$(QUICTLS_BUILDIR)/apps/openssl" version
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 11:22:47 +05:30
|
|
|
$(QUICTLS_DESTDIR): build
|
2022-06-06 10:16:20 +05:30
|
|
|
if ! [ -d "$(QUICTLS_DESTDIR)" ]; then mkdir -v "$(QUICTLS_DESTDIR)"; fi
|
2022-06-06 11:22:47 +05:30
|
|
|
$(MAKE) -C "$(QUICTLS_BUILDIR)" -j "$(shell nproc)" DESTDIR="$(QUICTLS_DESTDIR_ABS)" install_sw
|
2022-06-06 10:16:20 +05:30
|
|
|
|
|
|
|
# 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.
|
2022-06-06 11:22:47 +05:30
|
|
|
$(QUICTLS_ARCHIVE): $(QUICTLS_DESTDIR)
|
2022-06-06 10:16:20 +05:30
|
|
|
tar -C "$(QUICTLS_DESTDIR)" -cjf "$(QUICTLS_ARCHIVE)" "opt"
|
|
|
|
|
|
|
|
clean:
|
2022-06-07 08:36:13 +05:30
|
|
|
rm -fv "$(QUICTLS_TARBALL)"
|
2022-06-06 11:22:47 +05:30
|
|
|
rm -rf "$(QUICTLS_BUILDIR)"
|
|
|
|
rm -rf "$(QUICTLS_DESTDIR)"
|
|
|
|
rm -fv "$(QUICTLS_ARCHIVE)"
|
2022-06-06 10:16:20 +05:30
|
|
|
|
2022-06-06 11:22:47 +05:30
|
|
|
.PHONY: clean build
|