diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2020-01-03 09:01:24 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2020-01-03 09:01:24 +0000 |
commit | 18a03458d41a372d8b0362b80b02b18de264db72 (patch) | |
tree | ae30bbed408923f4d23a6c95966a8eef864f1016 | |
parent | d7fe4858d05db0c4d0e4eec6acaf21b03aae99ca (diff) | |
download | ports-18a03458d41a372d8b0362b80b02b18de264db72.tar.gz ports-18a03458d41a372d8b0362b80b02b18de264db72.zip |
Notes
-rw-r--r-- | multimedia/handbrake/Makefile | 12 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs | 21 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-gtk_configure.ac | 12 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-libhb_handbrake_ports.h | 36 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-libhb_module.defs | 32 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-libhb_ports.c | 41 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-libhb_qsv__common.c | 20 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-make_configure.py | 29 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-make_include_main.defs | 13 | ||||
-rw-r--r-- | multimedia/handbrake/files/patch-test_module.defs | 11 |
10 files changed, 224 insertions, 3 deletions
diff --git a/multimedia/handbrake/Makefile b/multimedia/handbrake/Makefile index b26d648fdb74..3faa1ea82302 100644 --- a/multimedia/handbrake/Makefile +++ b/multimedia/handbrake/Makefile @@ -3,7 +3,7 @@ PORTNAME= handbrake DISTVERSION= 1.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= multimedia DIST_SUBDIR= ${PORTNAME} @@ -80,12 +80,14 @@ NOPRECIOUSMAKEVARS= yes # for ffmpeg and x264 # Enforce linking to bundled libraries instead of system libraries LDFLAGS+= -L${BUILD_WRKSRC}/contrib/lib -OPTIONS_DEFINE= FDK_AAC X11 -OPTIONS_DEFAULT= X11 +OPTIONS_DEFINE= FDK_AAC MFX X11 +OPTIONS_DEFAULT= MFX X11 +OPTIONS_EXCLUDE_powerpc64= MFX OPTIONS_SUB= yes FDK_AAC_DESC= Enable non-free Fraunhofer FDK AAC codec +MFX_DESC= Intel MediaSDK (aka Quick Sync Video) X11_DESC= Build GTK+3 based GUI program FDK_AAC_CONFIGURE_ENABLE= fdk-aac @@ -94,6 +96,10 @@ LICENSE_NAME_FDK_AAC= Software License for The Fraunhofer FDK AAC Codec Library LICENSE_FILE_FDK_AAC= ${WRKDIR}/${DISTFILES:Mfdk*:R:R}/NOTICE LICENSE_PERMS_FDK_AAC= dist-mirror pkg-mirror auto-accept +MFX_LIB_DEPENDS= libmfx.so:multimedia/intel-media-sdk \ + libva-drm.so:multimedia/libva +MFX_CONFIGURE_ON= --enable-qsv + X11_CONFIGURE_ENV= COMPILER_PATH=${LOCALBASE}/bin X11_MAKE_ENV= COMPILER_PATH=${LOCALBASE}/bin X11_CONFIGURE_ON= --disable-gtk-update-checks diff --git a/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs b/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs new file mode 100644 index 000000000000..8803450232a6 --- /dev/null +++ b/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs @@ -0,0 +1,21 @@ +--- contrib/ffmpeg/module.defs.orig 2019-11-09 20:44:32 UTC ++++ contrib/ffmpeg/module.defs +@@ -1,7 +1,9 @@ + __deps__ := BZIP2 ZLIB FDKAAC LIBDAV1D LIBVPX LAME LIBOPUS LIBSPEEX XZ + ifeq (1,$(FEATURE.qsv)) ++ifeq (,$(filter $(HOST.system),freebsd)) + __deps__ += LIBMFX + endif ++endif + ifeq (1,$(FEATURE.vce)) + __deps__ += AMF + endif +@@ -60,7 +62,7 @@ FFMPEG.CONFIGURE.extra = \ + --cc="$(FFMPEG.GCC.gcc)" \ + --extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)" + +-ifeq (1-linux,$(FEATURE.qsv)-$(HOST.system)) ++ifneq (,$(filter $(FEATURE.qsv)-$(HOST.system),1-linux 1-freebsd)) + FFMPEG.CONFIGURE.extra += --enable-vaapi + FFMPEG.CONFIGURE.extra += --disable-xlib + else diff --git a/multimedia/handbrake/files/patch-gtk_configure.ac b/multimedia/handbrake/files/patch-gtk_configure.ac new file mode 100644 index 000000000000..82ad9f6dc410 --- /dev/null +++ b/multimedia/handbrake/files/patch-gtk_configure.ac @@ -0,0 +1,12 @@ +--- gtk/configure.ac.orig 2019-11-09 20:44:32 UTC ++++ gtk/configure.ac +@@ -227,6 +227,9 @@ case $host in + ;; + *-*-freebsd*) + HB_LIBS="$HB_LIBS -lpthread" ++ if test "x$use_qsv" = "xyes" ; then ++ HB_LIBS="$HB_LIBS -lva -lva-drm" ++ fi + ;; + *-*-netbsd*) + HB_LIBS="$HB_LIBS -pthread" diff --git a/multimedia/handbrake/files/patch-libhb_handbrake_ports.h b/multimedia/handbrake/files/patch-libhb_handbrake_ports.h new file mode 100644 index 000000000000..d80ad280daaf --- /dev/null +++ b/multimedia/handbrake/files/patch-libhb_handbrake_ports.h @@ -0,0 +1,36 @@ +--- libhb/handbrake/ports.h.orig 2019-11-09 20:44:32 UTC ++++ libhb/handbrake/ports.h +@@ -28,7 +28,7 @@ + + #if HB_PROJECT_FEATURE_QSV + #include "mfx/mfxstructures.h" +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) + #include <va/va_drm.h> + #endif + #endif +@@ -36,9 +36,9 @@ + /************************************************************************ + * HW accel display + ***********************************************************************/ +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) + extern const char* DRM_INTEL_DRIVER_NAME; +-#endif // SYS_LINUX ++#endif // SYS_LINUX || SYS_FREEBSD + + typedef struct + { +@@ -46,10 +46,10 @@ typedef struct + #if HB_PROJECT_FEATURE_QSV + mfxHandleType mfxType; + +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) + int vaFd; + VADisplay vaDisplay; +-#endif // SYS_LINUX ++#endif // SYS_LINUX || SYS_FREEBSD + #endif + } hb_display_t; + diff --git a/multimedia/handbrake/files/patch-libhb_module.defs b/multimedia/handbrake/files/patch-libhb_module.defs new file mode 100644 index 000000000000..f91fb8b75f66 --- /dev/null +++ b/multimedia/handbrake/files/patch-libhb_module.defs @@ -0,0 +1,32 @@ +--- libhb/module.defs.orig 2019-11-09 20:44:32 UTC ++++ libhb/module.defs +@@ -1,12 +1,16 @@ + __deps__ := A52DEC BZIP2 LIBVPX FFMPEG FREETYPE LAME LIBASS LIBDCA \ + LIBDVDREAD LIBDVDNAV LIBICONV LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBOGG \ +- LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX LIBGNURX JANSSON \ ++ LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBGNURX JANSSON \ + HARFBUZZ LIBOPUS LIBSPEEX LIBDAV1D + + ifeq (,$(filter $(HOST.system),darwin cygwin mingw)) + __deps__ += FONTCONFIG + endif + ++ifeq (,$(filter $(HOST.system),freebsd)) ++ __deps__ += LIBMFX ++endif ++ + $(eval $(call import.MODULE.defs,LIBHB,libhb,$(__deps__))) + $(eval $(call import.GCC,LIBHB)) + +@@ -111,7 +115,11 @@ LIBHB.dll.libs += $(CONTRIB.build/)lib/libfdk-aac.a + endif + + ifeq (1,$(FEATURE.qsv)) ++ifeq (,$(filter $(HOST.system),freebsd)) + LIBHB.dll.libs += $(CONTRIB.build/)lib/libmfx.a ++else ++ LIBHB.GCC.l += mfx ++endif + endif + + ifeq (1,$(FEATURE.x265)) diff --git a/multimedia/handbrake/files/patch-libhb_ports.c b/multimedia/handbrake/files/patch-libhb_ports.c new file mode 100644 index 000000000000..43b7a9e77fdf --- /dev/null +++ b/multimedia/handbrake/files/patch-libhb_ports.c @@ -0,0 +1,41 @@ +--- libhb/ports.c.orig 2019-11-09 20:44:32 UTC ++++ libhb/ports.c +@@ -28,7 +28,11 @@ + #if defined(SYS_DARWIN) || defined(SYS_FREEBSD) + #include <sys/types.h> + #include <sys/sysctl.h> ++#if HB_PROJECT_FEATURE_QSV && defined(SYS_FREEBSD) ++#include <libdrm/drm.h> ++#include <fcntl.h> + #endif ++#endif + + #ifdef SYS_OPENBSD + #include <sys/param.h> +@@ -1518,7 +1522,7 @@ char * hb_strndup(const char * src, size_t len) + } + + #if HB_PROJECT_FEATURE_QSV +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) + + #define MAX_NODES 16 + #define DRI_RENDER_NODE_START 128 +@@ -1676,7 +1680,7 @@ void hb_display_close(hb_display_t ** _d) + *_d = NULL; + } + +-#else // !SYS_LINUX ++#else // !SYS_LINUX && !SYS_FREEBSD + + hb_display_t * hb_display_init(const char * driver_name, + const char * const * interface_names) +@@ -1689,7 +1693,7 @@ void hb_display_close(hb_display_t ** _d) + (void)_d; + } + +-#endif // SYS_LINUX ++#endif // SYS_LINUX || SYS_FREEBSD + #else // !HB_PROJECT_FEATURE_QSV + + hb_display_t * hb_display_init(const char * driver_name, diff --git a/multimedia/handbrake/files/patch-libhb_qsv__common.c b/multimedia/handbrake/files/patch-libhb_qsv__common.c new file mode 100644 index 000000000000..23e44bf827f3 --- /dev/null +++ b/multimedia/handbrake/files/patch-libhb_qsv__common.c @@ -0,0 +1,20 @@ +--- libhb/qsv_common.c.orig 2019-11-09 20:44:32 UTC ++++ libhb/qsv_common.c +@@ -678,7 +678,7 @@ int hb_qsv_info_init() + */ + mfxSession session; + mfxVersion version = { .Major = 1, .Minor = 0, }; +-#ifdef SYS_LINUX ++#if defined(SYS_LINUX) || defined(SYS_FREEBSD) + mfxIMPL hw_preference = MFX_IMPL_VIA_ANY; + #else + mfxIMPL hw_preference = MFX_IMPL_VIA_D3D11; +@@ -738,7 +738,7 @@ int hb_qsv_info_init() + } + else + { +-#ifndef SYS_LINUX ++#if !defined(SYS_LINUX) && !defined(SYS_FREEBSD) + // Windows only: After D3D11 we will try D3D9 + if (hw_preference == MFX_IMPL_VIA_D3D11) + hw_preference = MFX_IMPL_VIA_D3D9; diff --git a/multimedia/handbrake/files/patch-make_configure.py b/multimedia/handbrake/files/patch-make_configure.py new file mode 100644 index 000000000000..dfc888a7f0b8 --- /dev/null +++ b/multimedia/handbrake/files/patch-make_configure.py @@ -0,0 +1,29 @@ +--- make/configure.py.orig 2019-11-09 20:44:32 UTC ++++ make/configure.py +@@ -1413,7 +1413,7 @@ def createCLI( cross = None ): + grp.add_argument( '--enable-nvenc', dest="enable_nvenc", default=IfHost( True, '*-*-linux*', '*-*-mingw*', none=False).value, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) ) + grp.add_argument( '--disable-nvenc', dest="enable_nvenc", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) ) + +- h = IfHost( 'Intel QSV video encoder/decoder', '*-*-linux*', '*-*-mingw*', none=argparse.SUPPRESS).value ++ h = IfHost( 'Intel QSV video encoder/decoder', '*-*-linux*', '*-*-freebsd*', '*-*-mingw*', none=argparse.SUPPRESS).value + grp.add_argument( '--enable-qsv', dest="enable_qsv", default=IfHost(True, "*-*-mingw*", none=False).value, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) ) + grp.add_argument( '--disable-qsv', dest="enable_qsv", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) ) + +@@ -1684,7 +1684,7 @@ try: + none=False).value + and options.enable_x265) + # Disable QSV on unsupported platforms +- options.enable_qsv = IfHost(options.enable_qsv, '*-*-linux*', ++ options.enable_qsv = IfHost(options.enable_qsv, '*-*-linux*', '*-*-freebsd*', + '*-*-mingw*', none=False).value + # Disable VCE on unsupported platforms + options.enable_vce = IfHost(options.enable_vce, '*-*-linux*', '*-*-mingw*', +@@ -2124,7 +2124,7 @@ int main() + stdout.write( 'Enable NVENC: %s' % options.enable_nvenc ) + stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' ) + stdout.write( 'Enable QSV: %s' % options.enable_qsv ) +- stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' ) ++ stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'freebsd' or host_tuple.system == 'mingw') else stdout.write( '\n' ) + stdout.write( 'Enable VCE: %s' % options.enable_vce ) + stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' ) + diff --git a/multimedia/handbrake/files/patch-make_include_main.defs b/multimedia/handbrake/files/patch-make_include_main.defs new file mode 100644 index 000000000000..ab9f3cbd4109 --- /dev/null +++ b/multimedia/handbrake/files/patch-make_include_main.defs @@ -0,0 +1,13 @@ +--- make/include/main.defs.orig 2019-11-09 20:44:32 UTC ++++ make/include/main.defs +@@ -52,8 +52,10 @@ MODULES += contrib/libdvdread + MODULES += contrib/libdvdnav + MODULES += contrib/libbluray + ++ifneq (,$(filter $(HOST.system),freebsd)) + ifeq (1,$(FEATURE.qsv)) + MODULES += contrib/libmfx ++endif + endif + + ifeq (1,$(FEATURE.vce)) diff --git a/multimedia/handbrake/files/patch-test_module.defs b/multimedia/handbrake/files/patch-test_module.defs new file mode 100644 index 000000000000..165c0a34b957 --- /dev/null +++ b/multimedia/handbrake/files/patch-test_module.defs @@ -0,0 +1,11 @@ +--- test/module.defs.orig 2019-11-09 20:44:32 UTC ++++ test/module.defs +@@ -25,7 +25,7 @@ endif + + ifeq (1,$(FEATURE.qsv)) + TEST.GCC.l += mfx +-ifeq ($(HOST.system),linux) ++ifneq (,$(filter $(HOST.system),linux freebsd)) + TEST.GCC.l += va va-drm + endif + endif |