Skip to content

Commit

Permalink
[build] Add nghttp2 from-source build (#38115)
Browse files Browse the repository at this point in the history
This allows building `nghttp2` when `USE_BINARYBUILDER_NGHTTP2=0`.
  • Loading branch information
staticfloat authored Oct 20, 2020
1 parent 7a0b1d8 commit 230491b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
1 change: 1 addition & 0 deletions deps/checksums/nghttp2-1.40.0.tar.bz2/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a8377476e1252b4ee755027af3781fc8
1 change: 1 addition & 0 deletions deps/checksums/nghttp2-1.40.0.tar.bz2/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bc3f6dd8ccc3c6891b61206eeb2a74019b2559b4d75409e022c1a9ad0745d50cf8db7ca8e076993ab04a17f87455dc38159bf085bd844366dac82506e44656a0
51 changes: 48 additions & 3 deletions deps/nghttp2.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
## nghttp2

ifneq ($(USE_BINARYBUILDER_NGHTTP2), 1)
ifneq ($(USE_SYSTEM_NGHTTP2), 1)
$(error "FIXME: Source build nghttp2 is not supported.")
endif

$(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2: | $(SRCCACHE)
$(JLDOWNLOAD) $@ https://github.com/nghttp2/nghttp2/releases/download/v$(NGHTTP2_VER)/$(notdir $@)

$(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/source-extracted: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2
$(JLCHECKSUM) $<
cd $(dir $<) && $(TAR) -jxf $<
touch -c $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/configure # old target
echo 1 > $@

$(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-configured: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/source-extracted
mkdir -p $(dir $@)
cd $(dir $@) && \
$(dir $<)/configure $(CONFIGURE_COMMON) --enable-lib-only
echo 1 > $@

$(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-compiled: $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-configured
$(MAKE) -C $(dir $<)
echo 1 > $@

$(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-checked: $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-compiled
ifeq ($(OS),$(BUILD_OS))
$(MAKE) -C $(dir $@) check $(NGHTTP2_CHECK_MFLAGS)
endif
echo 1 > $@

$(eval $(call staged-install, \
nghttp2,nghttp2-$(NGHTTP2_VER), \
MAKE_INSTALL,,, \
$$(INSTALL_NAME_CMD)libnghttp2.$$(SHLIB_EXT) $$(build_shlibdir)/libnghttp2.$$(SHLIB_EXT)))

clean-nghttp2:
-rm $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-configured $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-compiled
-$(MAKE) -C $(BUILDDIR)/nghttp2-$(NGHTTP2_VER) clean

distclean-nghttp2:
-rm -rf $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2 \
$(SRCCACHE)/nghttp2-$(NGHTTP2_VER) \
$(BUILDDIR)/nghttp2-$(NGHTTP2_VER)

get-nghttp2: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER).tar.bz2
extract-nghttp2: $(SRCCACHE)/nghttp2-$(NGHTTP2_VER)/source-extracted
configure-nghttp2: $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-configured
compile-nghttp2: $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-compiled
fastcheck-nghttp2: check-nghttp2
check-nghttp2: $(BUILDDIR)/nghttp2-$(NGHTTP2_VER)/build-checked

else

NGHTTP2_BB_URL_BASE := https://github.com/JuliaBinaryWrappers/nghttp2_jll.jl/releases/download/nghttp2-v$(NGHTTP2_VER)+$(NGHTTP2_BB_REL)
NGHTTP2_BB_NAME := nghttp2.v$(NGHTTP2_VER)

$(eval $(call bb-install,nghttp2,NGHTTP2,false))
endif

0 comments on commit 230491b

Please sign in to comment.