Enable bundling of jansson, require 2.11.

Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd
This commit is contained in:
Corey Farrell
2018-07-16 16:08:20 -04:00
parent c40412bd13
commit d2dace81d4
22 changed files with 642 additions and 354 deletions

View File

@@ -89,49 +89,22 @@ SHELL_ECHO_PREFIX := echo '[pjproject] '
_all: $(TARGETS)
define tarball_exists
(if [ -f $(TARBALL) -a -f $(PJMD5SUM) ] ; then exit 0 ;\
else exit 1; fi; )
endef
define verify_tarball
($(SHELL_ECHO_PREFIX) Verifying $(TARBALL) &&\
tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(CUT) -d' ' -f1) ;\
required_sum=$$($(GREP) -e $(TARBALL_FILE) $(PJMD5SUM) | $(CUT) -d' ' -f1) ;\
if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )
endef
define download_from_pjproject
($(SHELL_ECHO_PREFIX) Downloading $(TARBALL_URL) to $(TARBALL) ;\
$(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,60) $(TARBALL_URL) > $(TARBALL) &&\
$(SHELL_ECHO_PREFIX) Downloading $(PJPROJECT_URL)/MD5SUM.TXT to $(PJMD5SUM) &&\
$(DOWNLOAD_TO_STDOUT) $(call DOWNLOAD_TIMEOUT,5,60) $(PJPROJECT_URL)/MD5SUM.TXT > $(PJMD5SUM) &&\
$(verify_tarball))
endef
.DELETE_ON_ERROR:
DOWNLOAD_DIR := $(or $(EXTERNALS_CACHE_DIR),$(TMPDIR),$(wildcard /tmp),.)
TARBALL_FILE = pjproject-$(PJPROJECT_VERSION).tar.bz2
TARBALL = $(DOWNLOAD_DIR)/$(TARBALL_FILE)
TARBALL_URL = $(PJPROJECT_URL)/$(TARBALL_FILE)
PJMD5SUM = $(patsubst %.tar.bz2,%.md5,$(TARBALL))
$(DOWNLOAD_DIR)/$(TARBALL_FILE): ../versions.mak
$(CMD_PREFIX) ($(TARBALL_EXISTS) && $(TARBALL_VERIFY) && touch $@) || (rm -rf $@ ;\
$(TARBALL_DOWNLOAD)) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
$(TARBALL): ../versions.mak
$(CMD_PREFIX) ($(tarball_exists) && $(verify_tarball) && touch $@) || (rm -rf $@ ;\
$(download_from_pjproject)) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(download_from_pjproject))
source/.unpacked: $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
$(CMD_PREFIX) $(verify_tarball) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(download_from_pjproject))
source/.unpacked: $(DOWNLOAD_DIR)/$(TARBALL_FILE)
$(CMD_PREFIX) $(TARBALL_VERIFY) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
$(ECHO_PREFIX) Unpacking $<
-@rm -rf source pjproject-* >/dev/null 2>&1
-@rm -rf source pjproject-*/ >/dev/null 2>&1
$(CMD_PREFIX) $(TAR) -xjf $<
@mv pjproject-$(PJPROJECT_VERSION) source
$(ECHO_PREFIX) Applying patches "$(realpath patches)" "$(realpath .)/source"
$(CMD_PREFIX) ./apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"
$(CMD_PREFIX) ../apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"
-@touch source/.unpacked
source/version.mak: source/.unpacked

View File

@@ -4,9 +4,10 @@
# For future reference when upgrading bundled PJPROJECT the next time
# PJPROJECT is released.
# Teluu's download URL.
# PJPROJECT_URL ?= http://www.pjsip.org/release/$(PJPROJECT_VERSION)
# PACKAGE_URL ?= http://www.pjsip.org/release/$(PJPROJECT_VERSION)
PJPROJECT_URL ?= https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION)
PACKAGE_URL ?= https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION)
TARBALL_FILE = pjproject-$(PJPROJECT_VERSION).tar.bz2
# PJPROJECT_CONFIGURE_OPTS could come from the command line or could be
# set/modified by configure.m4 if the build or host tuples aren't the same

View File

@@ -1,33 +0,0 @@
#!/bin/sh
if [ "$1" = "-q" ] ; then
quiet=1
shift
fi
PATCH=${PATCH:-patch}
patchdir=${1:?You must supply a patches directory}
sourcedir=${2?:You must supply a source directory}
if [ ! -d "$patchdir" ] ; then
echo "$patchdir is not a directory" >&2
exit 1
fi
if [ ! -d "$sourcedir" ] ; then
echo "$sourcedir is not a directory" >&2
exit 1
fi
if [ ! "$(ls -A $patchdir/*.patch 2>/dev/null)" ] ; then
echo "No patches in $patchdir" >&2
exit 0
fi
for patchfile in "$patchdir"/*.patch ; do
[ -z $quiet ] && echo "Applying patch $(basename $patchfile)"
${PATCH} -d "$sourcedir" -p1 -s -i "$patchfile" || exit 1
done
exit 0

View File

@@ -0,0 +1,2 @@
8119f0d91a00b6f553099e6ee5358ade *pjproject-2.7.2.zip
fa3f0bc098c4bff48ddd92db1c016a7a pjproject-2.7.2.tar.bz2