[vlc-commits] contribs: improve UNPACK macro

Rémi Denis-Courmont git at videolan.org
Tue Jun 28 18:45:33 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 28 17:06:00 2011 +0300| [e6f8219d30852602085774e08bf2610614e5496f] | committer: Rémi Denis-Courmont

contribs: improve UNPACK macro

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e6f8219d30852602085774e08bf2610614e5496f
---

 contrib/src/a52/rules.mak      |    2 +-
 contrib/src/ebml/rules.mak     |    2 +-
 contrib/src/flac/rules.mak     |    2 +-
 contrib/src/live555/rules.mak  |    2 +-
 contrib/src/lua/rules.mak      |    2 +-
 contrib/src/main.mak           |   10 +++++-----
 contrib/src/matroska/rules.mak |    2 +-
 contrib/src/ogg/rules.mak      |    2 +-
 contrib/src/speex/rules.mak    |    2 +-
 contrib/src/theora/rules.mak   |    2 +-
 contrib/src/tremor/rules.mak   |    2 +-
 contrib/src/vorbis/rules.mak   |    2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/contrib/src/a52/rules.mak b/contrib/src/a52/rules.mak
index 9a2843a..fd3a40d 100644
--- a/contrib/src/a52/rules.mak
+++ b/contrib/src/a52/rules.mak
@@ -11,7 +11,7 @@ $(TARBALLS)/a52dec-$(A52DEC_VERSION).tar.gz:
 .sum-a52: a52dec-$(A52DEC_VERSION).tar.gz
 
 a52dec: a52dec-$(A52DEC_VERSION).tar.gz .sum-a52
-	$(UNPACK_GZ)
+	$(UNPACK)
 ifndef HAVE_FPU
 	(cd $@-$(A52DEC_VERSION) && patch -p0) < $(SRC)/a52/liba52-fixed.diff
 endif
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index 2bde089..21177af 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -10,7 +10,7 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.bz2:
 .sum-ebml: libebml-$(EBML_VERSION).tar.bz2
 
 libebml: libebml-$(EBML_VERSION).tar.bz2 .sum-ebml
-	$(UNPACK_BZ2)
+	$(UNPACK)
 	mv $@-$(EBML_VERSION) $@
 	touch $@
 
diff --git a/contrib/src/flac/rules.mak b/contrib/src/flac/rules.mak
index 520228e..5eb15cc 100644
--- a/contrib/src/flac/rules.mak
+++ b/contrib/src/flac/rules.mak
@@ -11,7 +11,7 @@ $(TARBALLS)/flac-$(FLAC_VERSION).tar.gz:
 .sum-flac: flac-$(FLAC_VERSION).tar.gz
 
 flac: flac-$(FLAC_VERSION).tar.gz .sum-flac
-	$(UNPACK_GZ)
+	$(UNPACK)
 	(cd $@-$(FLAC_VERSION) && patch -p1) < $(SRC)/flac/flac-win32.patch
 	(cd $@-$(FLAC_VERSION) && patch -p1) < $(SRC)/flac/libFLAC-pc.patch
 ifdef HAVE_MACOSX
diff --git a/contrib/src/live555/rules.mak b/contrib/src/live555/rules.mak
index 64ae134..843d72f 100644
--- a/contrib/src/live555/rules.mak
+++ b/contrib/src/live555/rules.mak
@@ -10,7 +10,7 @@ $(TARBALLS)/live555-latest.tar.gz:
 .sum-live555: live555-latest.tar.gz
 
 live555: live555-latest.tar.gz .sum-live555
-	$(UNPACK_GZ)
+	$(UNPACK)
 	patch -p0 < $(SRC)/live555/live-uselocale.patch
 	patch -p0 < $(SRC)/live555/live-inet_ntop.patch
 ifdef HAVE_WIN64
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index f28f035..2e25820 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -27,7 +27,7 @@ $(TARBALLS)/lua-$(LUA_VERSION).tar.gz:
 .sum-lua: lua-$(LUA_VERSION).tar.gz
 
 lua: lua-$(LUA_VERSION).tar.gz .sum-lua
-	$(UNPACK_GZ)
+	$(UNPACK)
 	(cd $@-$(LUA_VERSION) && patch -p1) < $(SRC)/lua/lua-noreadline.patch
 ifdef HAVE_MACOSX
 	(cd $@-$(LUA_VERSION) && \
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index d2e9b32..4b9b7ff 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -162,11 +162,11 @@ checksum = (cd $(TARBALLS) && $(1)sum -c -) < \
 		$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS
 CHECK_SHA256 = $(call checksum,sha512,SHA512)
 CHECK_SHA512 = $(call checksum,sha512,SHA512)
-untar = $(RM) -R $@; tar xv$(1)f $<
-UNPACK_GZ = $(call untar,z)
-UNPACK_BZ2 = $(call untar,j)
-UNPACK_XZ = $(call untar,J)
-UNPACK_ZIP = $(RM) -R $@; unzip $<
+UNPACK = $(RM) -R $@ \
+	$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
+	$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \
+	$(foreach f,$(filter %.tar.xz,$^), && tar xvJf $(f)) \
+	$(foreach f,$(filter %.zip,$^), && unzip $(f))
 
 #
 # Per-package build rules
diff --git a/contrib/src/matroska/rules.mak b/contrib/src/matroska/rules.mak
index dc876bc..39a13e3 100644
--- a/contrib/src/matroska/rules.mak
+++ b/contrib/src/matroska/rules.mak
@@ -12,7 +12,7 @@ $(TARBALLS)/libmatroska-$(MATROSKA_VERSION).tar.bz2:
 .sum-matroska: libmatroska-$(MATROSKA_VERSION).tar.bz2
 
 libmatroska: libmatroska-$(MATROSKA_VERSION).tar.bz2 .sum-matroska
-	$(UNPACK_BZ2)
+	$(UNPACK)
 	mv $@-$(MATROSKA_VERSION) $@
 	touch $@
 
diff --git a/contrib/src/ogg/rules.mak b/contrib/src/ogg/rules.mak
index ef4aa3e..dce79d4 100644
--- a/contrib/src/ogg/rules.mak
+++ b/contrib/src/ogg/rules.mak
@@ -14,7 +14,7 @@ $(TARBALLS)/libogg-$(OGG_VERSION).tar.xz:
 .sum-ogg: libogg-$(OGG_VERSION).tar.xz
 
 libogg: libogg-$(OGG_VERSION).tar.xz .sum-ogg
-	$(UNPACK_XZ)
+	$(UNPACK)
 	(cd $@-$(OGG_VERSION) && patch -p1) < $(SRC)/ogg/libogg-1.1.patch
 ifdef HAVE_WINCE
 	(cd $@-$(OGG_VERSION) && patch -p1) < $(SRC)/ogg/libogg-wince.patch
diff --git a/contrib/src/speex/rules.mak b/contrib/src/speex/rules.mak
index b8f241d..eaf790a 100644
--- a/contrib/src/speex/rules.mak
+++ b/contrib/src/speex/rules.mak
@@ -11,7 +11,7 @@ $(TARBALLS)/speex-$(SPEEX_VERSION).tar.gz:
 .sum-speex: speex-$(SPEEX_VERSION).tar.gz
 
 speex: speex-$(SPEEX_VERSION).tar.gz .sum-speex
-	$(UNPACK_GZ)
+	$(UNPACK)
 	mv $@-$(SPEEX_VERSION) $@
 	touch $@
 
diff --git a/contrib/src/theora/rules.mak b/contrib/src/theora/rules.mak
index 0dff8ff..9da427f 100644
--- a/contrib/src/theora/rules.mak
+++ b/contrib/src/theora/rules.mak
@@ -12,7 +12,7 @@ $(TARBALLS)/libtheora-$(THEORA_VERSION).tar.xz:
 .sum-theora: libtheora-$(THEORA_VERSION).tar.xz
 
 libtheora: libtheora-$(THEORA_VERSION).tar.xz .sum-theora
-	$(UNPACK_XZ)
+	$(UNPACK)
 	(cd $@-$(THEORA_VERSION) && patch -p1) < $(SRC)/theora/libtheora-includes.patch
 ifdef HAVE_WIN64
 	cd $@ && autoreconf -fi -I m4
diff --git a/contrib/src/tremor/rules.mak b/contrib/src/tremor/rules.mak
index 20a929b..dc0ca27 100644
--- a/contrib/src/tremor/rules.mak
+++ b/contrib/src/tremor/rules.mak
@@ -15,7 +15,7 @@ $(TARBALLS)/tremor-svn.tar.xz:
 
 tremor: tremor-svn.tar.xz .sum-tremor
 	# Stuff that does not depend on libogg
-	$(UNPACK_XZ)
+	$(UNPACK)
 	(cd tremor-svn && patch -p0) < $(SRC)/tremor/tremor.patch
 	rm -f tremor-svn/ogg.h tremor-svn/os_types.h
 	echo '#include <ogg/ogg.h>' > tremor-svn/ogg.h
diff --git a/contrib/src/vorbis/rules.mak b/contrib/src/vorbis/rules.mak
index b1be2f3..cd43f66 100644
--- a/contrib/src/vorbis/rules.mak
+++ b/contrib/src/vorbis/rules.mak
@@ -17,7 +17,7 @@ $(TARBALLS)/libvorbis-$(VORBIS_VERSION).tar.xz:
 .sum-vorbis: libvorbis-$(VORBIS_VERSION).tar.xz
 
 libvorbis: libvorbis-$(VORBIS_VERSION).tar.xz .sum-vorbis
-	$(UNPACK_XZ)
+	$(UNPACK)
 	mv $@-$(VORBIS_VERSION) $@
 	touch $@
 



More information about the vlc-commits mailing list