Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Makefile: move inline patch outside of makefile. - add a PATCH comman…
…d to Makefile.static - move patch to dedicated support/patches folder
  • Loading branch information
lekma authored and perexg committed Feb 4, 2016
1 parent e774324 commit d1e86a4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 32 deletions.
25 changes: 2 additions & 23 deletions Makefile.ffmpeg
Expand Up @@ -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
Expand Down Expand Up @@ -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: \
Expand Down
29 changes: 20 additions & 9 deletions Makefile.static
Expand Up @@ -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

Expand Down
23 changes: 23 additions & 0 deletions 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",

0 comments on commit d1e86a4

Please sign in to comment.