From: lekma Date: Wed, 3 Feb 2016 07:55:46 +0000 (+0100) Subject: Makefile: move inline patch outside of makefile. - add a PATCH command to Makefile... X-Git-Tag: v4.2.1~1076 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1e86a46e989e559c8791d69525f548e228badf8;p=thirdparty%2Ftvheadend.git Makefile: move inline patch outside of makefile. - add a PATCH command to Makefile.static - move patch to dedicated support/patches folder --- diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg index 43d8dccf6..7964fd796 100644 --- a/Makefile.ffmpeg +++ b/Makefile.ffmpeg @@ -30,6 +30,7 @@ FFMPEG = ffmpeg-2.8.2 FFMPEG_TB = $(FFMPEG).tar.bz2 FFMPEG_URL = http://ffmpeg.org/releases/$(FFMPEG_TB) FFMPEG_SHA1 = 1952aeb9ec3f569514d8db4f30c195b765392639 +FFMPEG_DIFFS = libavcodec.libvpxenc.diff EXTLIBS = libx264 libvorbis libvpx COMPONENTS = avutil avformat avcodec swresample swscale avfilter avresample @@ -374,29 +375,7 @@ $(LIB_ROOT)/$(FFMPEG)/.tvh_download: @mkdir -p $(LIB_ROOT)/build $(call DOWNLOAD,$(FFMPEG_URL),$(LIB_ROOT)/$(FFMPEG_TB),$(FFMPEG_SHA1)) $(call UNTAR,$(FFMPEG_TB),j) - @cd $(LIB_ROOT)/$(FFMPEG) && echo -en "\ ---- libavcodec/libvpxenc.c.old 2015-11-21 21:52:16.502341511 +0100\n\ -+++ libavcodec/libvpxenc.c 2015-11-21 21:53:18.164552128 +0100\n\ -@@ -104,19 +104,11 @@\n\ - \n\ - /** String mappings for enum vp8e_enc_control_id */\n\ - static const char *const ctlidstr[] = {\n\ -- [VP8E_UPD_ENTROPY] = \"VP8E_UPD_ENTROPY\",\n\ -- [VP8E_UPD_REFERENCE] = \"VP8E_UPD_REFERENCE\",\n\ -- [VP8E_USE_REFERENCE] = \"VP8E_USE_REFERENCE\",\n\ -- [VP8E_SET_ROI_MAP] = \"VP8E_SET_ROI_MAP\",\n\ -- [VP8E_SET_ACTIVEMAP] = \"VP8E_SET_ACTIVEMAP\",\n\ -- [VP8E_SET_SCALEMODE] = \"VP8E_SET_SCALEMODE\",\n\ - [VP8E_SET_CPUUSED] = \"VP8E_SET_CPUUSED\",\n\ - [VP8E_SET_ENABLEAUTOALTREF] = \"VP8E_SET_ENABLEAUTOALTREF\",\n\ - [VP8E_SET_NOISE_SENSITIVITY] = \"VP8E_SET_NOISE_SENSITIVITY\",\n\ -- [VP8E_SET_SHARPNESS] = \"VP8E_SET_SHARPNESS\",\n\ - [VP8E_SET_STATIC_THRESHOLD] = \"VP8E_SET_STATIC_THRESHOLD\",\n\ - [VP8E_SET_TOKEN_PARTITIONS] = \"VP8E_SET_TOKEN_PARTITIONS\",\n\ -- [VP8E_GET_LAST_QUANTIZER] = \"VP8E_GET_LAST_QUANTIZER\",\n\ - [VP8E_SET_ARNR_MAXFRAMES] = \"VP8E_SET_ARNR_MAXFRAMES\",\n\ - [VP8E_SET_ARNR_STRENGTH] = \"VP8E_SET_ARNR_STRENGTH\",\n\ - [VP8E_SET_ARNR_TYPE] = \"VP8E_SET_ARNR_TYPE\",\n" | patch -p0 + $(call PATCH,$(FFMPEG),$(FFMPEG_DIFFS)) @touch $@ $(LIB_ROOT)/$(FFMPEG)/.tvh_build: \ diff --git a/Makefile.static b/Makefile.static index 29051d0d4..fefebe045 100644 --- a/Makefile.static +++ b/Makefile.static @@ -83,24 +83,35 @@ liball: libcacheget libcacheput define DOWNLOAD @mkdir -p $(LIB_ROOT)/build @if test -z "$${TVHEADEND_FILE_CACHE}"; then \ - printf "WGET $(1)\n"; \ - wget --no-verbose -O $(2) $(1); \ + printf "WGET $(1)\n"; \ + wget --no-verbose -O $(2) $(1); \ else \ - file=$$(basename $(2)); \ - cp "$$TVHEADEND_FILE_CACHE/$${file}" $(2); \ + file=$$(basename $(2)); \ + cp "$$TVHEADEND_FILE_CACHE/$${file}" $(2); \ fi @{ \ - sum=$$(sha1sum $(2) | cut -d ' ' -f 1); \ - printf "SHA1SUM test '$${sum}' == '$(3)': "; \ - test "y$${sum}" = "y$(3)"; \ + sum=$$(sha1sum $(2) | cut -d ' ' -f 1); \ + printf "SHA1SUM test '$${sum}' == '$(3)': "; \ + test "y$${sum}" = "y$(3)"; \ } @echo "OK" endef define UNTAR @{ \ - printf "UNTAR $(1)\n"; \ - tar x -C $(LIB_ROOT) -$(2)f $(LIB_ROOT)/$(1); \ + printf "UNTAR $(1)\n"; \ + tar x -C $(LIB_ROOT) -$(2)f $(LIB_ROOT)/$(1); \ + } +endef + +define PATCH + @{ \ + cd $(LIB_ROOT)/$(1); \ + for f in $(2); do \ + p=$(ROOTDIR)/support/patches/$${f}; \ + printf "PATCH $${p}\n"; \ + patch -p0 -i $${p}; \ + done \ } endef diff --git a/support/patches/libavcodec.libvpxenc.diff b/support/patches/libavcodec.libvpxenc.diff new file mode 100644 index 000000000..1ba7bbaa2 --- /dev/null +++ b/support/patches/libavcodec.libvpxenc.diff @@ -0,0 +1,23 @@ +diff -urN ../ffmpeg-2.8.2.orig/libavcodec/libvpxenc.c ./libavcodec/libvpxenc.c +--- ../ffmpeg-2.8.2.orig/libavcodec/libvpxenc.c 2015-09-09 03:17:45.000000000 +0200 ++++ ./libavcodec/libvpxenc.c 2016-02-02 11:44:29.452988350 +0100 +@@ -104,19 +104,11 @@ + + /** String mappings for enum vp8e_enc_control_id */ + static const char *const ctlidstr[] = { +- [VP8E_UPD_ENTROPY] = "VP8E_UPD_ENTROPY", +- [VP8E_UPD_REFERENCE] = "VP8E_UPD_REFERENCE", +- [VP8E_USE_REFERENCE] = "VP8E_USE_REFERENCE", +- [VP8E_SET_ROI_MAP] = "VP8E_SET_ROI_MAP", +- [VP8E_SET_ACTIVEMAP] = "VP8E_SET_ACTIVEMAP", +- [VP8E_SET_SCALEMODE] = "VP8E_SET_SCALEMODE", + [VP8E_SET_CPUUSED] = "VP8E_SET_CPUUSED", + [VP8E_SET_ENABLEAUTOALTREF] = "VP8E_SET_ENABLEAUTOALTREF", + [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY", +- [VP8E_SET_SHARPNESS] = "VP8E_SET_SHARPNESS", + [VP8E_SET_STATIC_THRESHOLD] = "VP8E_SET_STATIC_THRESHOLD", + [VP8E_SET_TOKEN_PARTITIONS] = "VP8E_SET_TOKEN_PARTITIONS", +- [VP8E_GET_LAST_QUANTIZER] = "VP8E_GET_LAST_QUANTIZER", + [VP8E_SET_ARNR_MAXFRAMES] = "VP8E_SET_ARNR_MAXFRAMES", + [VP8E_SET_ARNR_STRENGTH] = "VP8E_SET_ARNR_STRENGTH", + [VP8E_SET_ARNR_TYPE] = "VP8E_SET_ARNR_TYPE",