]> granicus.if.org Git - handbrake/commitdiff
contrib: add lzma support
authorJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 29 May 2018 19:50:22 +0000 (12:50 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 29 May 2018 21:29:29 +0000 (14:29 -0700)
lzma may be used by the ffmpeg tiff decoder which can be used in
matroska files.

contrib/ffmpeg/module.defs
contrib/xz/module.defs [new file with mode: 0644]
contrib/xz/module.rules [new file with mode: 0644]
gtk/configure.ac
libhb/module.defs
make/configure.py
make/include/contrib.defs
make/include/main.defs
test/module.defs

index 173bc34593407f9a195447d4173647bb395e45b4..d671dbe81561ea39f146551e5799ab75ca07d651 100644 (file)
@@ -1,4 +1,4 @@
-__deps__ := YASM FDKAAC LIBVPX LAME LIBOPUS LIBSPEEX
+__deps__ := YASM FDKAAC LIBVPX LAME LIBOPUS LIBSPEEX XZ
 ifeq (1,$(FEATURE.qsv))
 __deps__ += LIBMFX
 endif
@@ -63,6 +63,7 @@ FFMPEG.CONFIGURE.extra = \
     --disable-decoder=wmv3_crystalhd \
     --disable-bzlib \
     --disable-zlib \
+    --enable-lzma \
     --cc="$(FFMPEG.GCC.gcc)" \
     --extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)"
 
diff --git a/contrib/xz/module.defs b/contrib/xz/module.defs
new file mode 100644 (file)
index 0000000..eeeb286
--- /dev/null
@@ -0,0 +1,15 @@
+$(eval $(call import.MODULE.defs,XZ,xz))
+$(eval $(call import.CONTRIB.defs,XZ))
+
+XZ.FETCH.url     = https://download.handbrake.fr/handbrake/contrib/xz-5.2.4.tar.bz2
+XZ.FETCH.url    += https://tukaani.org/xz/xz-5.2.4.tar.bz2
+XZ.FETCH.sha256  = 3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf
+
+XZ.CONFIGURE.extra = \
+    --disable-xz \
+    --disable-xzdec \
+    --disable-lzmadec \
+    --disable-lzmainfo \
+    --disable-scripts \
+    --disable-doc
+
diff --git a/contrib/xz/module.rules b/contrib/xz/module.rules
new file mode 100644 (file)
index 0000000..af55a90
--- /dev/null
@@ -0,0 +1,2 @@
+$(eval $(call import.MODULE.rules,XZ))
+$(eval $(call import.CONTRIB.rules,XZ))
index e287bfdcc438ec9e0b5a4266641223f85691463b..3d4cd4879c4a9d8b9fa69883dbf9c49cb899f62c 100644 (file)
@@ -177,7 +177,7 @@ PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
 
 GHB_CFLAGS="$HBINC $GHB_CFLAGS"
 
-HB_LIBS="-lhandbrake -lavresample -lavformat -lavfilter -lavcodec -lavutil -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex"
+HB_LIBS="-lhandbrake -lavresample -lavformat -lavfilter -lavcodec -lavutil -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -llzma"
 
 case $host in
   *-*-mingw*)
index fae0be2ada8d46532bdb9b4ad9def4fa51ce1e52..cded5806d11e19de824f5f4b42d0580155021888 100644 (file)
@@ -185,6 +185,12 @@ else
     LIBHB.GCC.l += z
 endif
 
+ifneq ($(HAS.xz),1)
+LIBHB.dll.libs += $(CONTRIB.build/)lib/liblzma.a
+else
+    LIBHB.GCC.l += lzma
+endif
+
 LIBHB.GCC.args.extra.dylib++ += -Wl,--out-implib,$(LIBHB.lib)
 LIBHB.GCC.l += bcrypt ws2_32 uuid ole32
 ifeq ($(HAS.dlfcn),1)
index 99c9a5f499b974ec7a9624755f468fd4c537cc02..532c9ee1a8760cfa59394d74d3cf3c55b0c9937a 100644 (file)
@@ -1686,6 +1686,18 @@ int main ()
         libz = LDProbe( 'static zlib', '%s -static' % Tools.gcc.pathname, '-lz', libz_test )
         libz.run()
 
+        xz_test = """
+#include <stdio.h>
+#include <lzma.h>
+int main ()
+{
+  lzma_stream_decoder(NULL, 0, 0);
+  return 0;
+}
+"""
+        xz = LDProbe( 'static xz', '%s -static' % Tools.gcc.pathname, '-llzma', xz_test )
+        xz.run()
+
         iconv_test = """
 #include <stdio.h>
 #include <iconv.h>
@@ -1893,6 +1905,8 @@ int main()
             doc.add( 'HAS.bz2', 1 )
         if not libz.fail:
             doc.add( 'HAS.libz', 1 )
+        if not xz.fail:
+            doc.add( 'HAS.xz', 1 )
         if not iconv.fail:
             doc.add( 'HAS.iconv', 1 )
         if not regex.fail:
index 26c2248da9c896d1b531599dedf66b0940db7aca..5223fb45e1e5a6f686999c53940379782e82c989 100644 (file)
@@ -118,7 +118,7 @@ define import.CONTRIB.defs
         $(1).CONFIGURE.env.CFLAGS   = CFLAGS="-I$$(call fn.ABSOLUTE,$(CONTRIB.build/))include $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?c_std ?extra *D)"
         $(1).CONFIGURE.env.CXXFLAGS = CXXFLAGS="-I$$(call fn.ABSOLUTE,$(CONTRIB.build/))include $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?cxx_std ?extra *D)"
     endif
-    $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="-I$$(call fn.ABSOLUTE,$(CONTRIB.build/))include $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra *D)"
+    $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="-I$$(call fn.ABSOLUTE,$(CONTRIB.build/))include $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver *D)"
     $(1).CONFIGURE.env.LDFLAGS  = LDFLAGS="-L$$(call fn.ABSOLUTE,$(CONTRIB.build/))lib $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra.exe *D)"
     $(1).CONFIGURE.env.PKG_CONFIG_PATH  = PKG_CONFIG_PATH="$$(call fn.ABSOLUTE,$$(CONTRIB.build/))lib/pkgconfig"
 
index 7bbab9bce89f224129af0f58cae0ee46787d7ef4..b7719ff74ad7bca12fb52a94a617c64b2fbd8353 100644 (file)
@@ -102,6 +102,9 @@ ifneq (,$(filter $(BUILD.system),cygwin mingw))
 ifneq ($(HAS.iconv),1)
     MODULES += contrib/libiconv
 endif
+ifneq ($(HAS.xz),1)
+    MODULES += contrib/xz
+endif
 ifneq ($(HAS.libz),1)
     MODULES += contrib/zlib
 endif
index cc2d048bfd394d50d10ac3123028651bf7b0a010..f8c38238615d74e9ba8e852ab4a4a155a7418117 100644 (file)
@@ -17,7 +17,7 @@ TEST.GCC.l = \
         ass avresample avformat avfilter avcodec avutil swresample postproc mp3lame dvdnav \
         dvdread fribidi \
         samplerate swscale vpx theoraenc theoradec vorbis vorbisenc ogg x264 \
-        bluray freetype xml2 bz2 z jansson harfbuzz opus speex
+        bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma
 
 ifeq (,$(filter $(BUILD.system),darwin cygwin mingw))
     TEST.GCC.l += fontconfig