View | Details | Raw Unified | Return to bug 242849 | Differences between
and this patch

Collapse All | Expand All

(-)b/multimedia/handbrake/Makefile (-3 / +9 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	handbrake
4
PORTNAME=	handbrake
5
DISTVERSION=	1.3.0
5
DISTVERSION=	1.3.0
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	multimedia
7
CATEGORIES=	multimedia
8
DIST_SUBDIR=	${PORTNAME}
8
DIST_SUBDIR=	${PORTNAME}
9
9
Lines 80-91 NOPRECIOUSMAKEVARS= yes # for ffmpeg and x264 Link Here
80
# Enforce linking to bundled libraries instead of system libraries
80
# Enforce linking to bundled libraries instead of system libraries
81
LDFLAGS+=	-L${BUILD_WRKSRC}/contrib/lib
81
LDFLAGS+=	-L${BUILD_WRKSRC}/contrib/lib
82
82
83
OPTIONS_DEFINE=		FDK_AAC X11
83
OPTIONS_DEFINE=		FDK_AAC MFX X11
84
OPTIONS_DEFAULT=	X11
84
OPTIONS_DEFAULT=	MFX X11
85
OPTIONS_EXCLUDE_powerpc64=	MFX
85
86
86
OPTIONS_SUB=	yes
87
OPTIONS_SUB=	yes
87
88
88
FDK_AAC_DESC=	Enable non-free Fraunhofer FDK AAC codec
89
FDK_AAC_DESC=	Enable non-free Fraunhofer FDK AAC codec
90
MFX_DESC=	Intel MediaSDK (aka Quick Sync Video)
89
X11_DESC=	Build GTK+3 based GUI program
91
X11_DESC=	Build GTK+3 based GUI program
90
92
91
FDK_AAC_CONFIGURE_ENABLE=	fdk-aac
93
FDK_AAC_CONFIGURE_ENABLE=	fdk-aac
Lines 94-99 LICENSE_NAME_FDK_AAC= Software License for The Fraunhofer FDK AAC Codec Library Link Here
94
LICENSE_FILE_FDK_AAC=		${WRKDIR}/${DISTFILES:Mfdk*:R:R}/NOTICE
96
LICENSE_FILE_FDK_AAC=		${WRKDIR}/${DISTFILES:Mfdk*:R:R}/NOTICE
95
LICENSE_PERMS_FDK_AAC=		dist-mirror pkg-mirror auto-accept
97
LICENSE_PERMS_FDK_AAC=		dist-mirror pkg-mirror auto-accept
96
98
99
MFX_LIB_DEPENDS=	libmfx.so:multimedia/intel-media-sdk \
100
			libva-drm.so:multimedia/libva
101
MFX_CONFIGURE_ON=	--enable-qsv
102
97
X11_CONFIGURE_ENV=	COMPILER_PATH=${LOCALBASE}/bin
103
X11_CONFIGURE_ENV=	COMPILER_PATH=${LOCALBASE}/bin
98
X11_MAKE_ENV=	COMPILER_PATH=${LOCALBASE}/bin
104
X11_MAKE_ENV=	COMPILER_PATH=${LOCALBASE}/bin
99
X11_CONFIGURE_ON=	--disable-gtk-update-checks
105
X11_CONFIGURE_ON=	--disable-gtk-update-checks
(-)b/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs (+21 lines)
Added Link Here
1
--- contrib/ffmpeg/module.defs.orig	2019-11-09 20:44:32 UTC
2
+++ contrib/ffmpeg/module.defs
3
@@ -1,7 +1,9 @@
4
 __deps__ := BZIP2 ZLIB FDKAAC LIBDAV1D LIBVPX LAME LIBOPUS LIBSPEEX XZ
5
 ifeq (1,$(FEATURE.qsv))
6
+ifeq (,$(filter $(HOST.system),freebsd))
7
 __deps__ += LIBMFX
8
 endif
9
+endif
10
 ifeq (1,$(FEATURE.vce))
11
 __deps__ += AMF
12
 endif
13
@@ -60,7 +62,7 @@ FFMPEG.CONFIGURE.extra = \
14
     --cc="$(FFMPEG.GCC.gcc)" \
15
     --extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)"
16
 
17
-ifeq (1-linux,$(FEATURE.qsv)-$(HOST.system))
18
+ifneq (,$(filter $(FEATURE.qsv)-$(HOST.system),1-linux 1-freebsd))
19
     FFMPEG.CONFIGURE.extra += --enable-vaapi
20
     FFMPEG.CONFIGURE.extra += --disable-xlib
21
 else
(-)b/multimedia/handbrake/files/patch-gtk_configure.ac (+12 lines)
Added Link Here
1
--- gtk/configure.ac.orig	2019-11-09 20:44:32 UTC
2
+++ gtk/configure.ac
3
@@ -227,6 +227,9 @@ case $host in
4
     ;;
5
   *-*-freebsd*)
6
     HB_LIBS="$HB_LIBS -lpthread"
7
+    if test "x$use_qsv" = "xyes" ; then
8
+        HB_LIBS="$HB_LIBS -lva -lva-drm"
9
+    fi
10
     ;;
11
   *-*-netbsd*)
12
     HB_LIBS="$HB_LIBS -pthread"
(-)b/multimedia/handbrake/files/patch-libhb_handbrake_ports.h (+36 lines)
Added Link Here
1
--- libhb/handbrake/ports.h.orig	2019-11-09 20:44:32 UTC
2
+++ libhb/handbrake/ports.h
3
@@ -28,7 +28,7 @@
4
 
5
 #if HB_PROJECT_FEATURE_QSV
6
 #include "mfx/mfxstructures.h"
7
-#ifdef SYS_LINUX
8
+#if defined(SYS_LINUX) || defined(SYS_FREEBSD)
9
 #include <va/va_drm.h>
10
 #endif
11
 #endif
12
@@ -36,9 +36,9 @@
13
 /************************************************************************
14
  * HW accel display
15
  ***********************************************************************/
16
-#ifdef SYS_LINUX
17
+#if defined(SYS_LINUX) || defined(SYS_FREEBSD)
18
 extern const char* DRM_INTEL_DRIVER_NAME;
19
-#endif // SYS_LINUX
20
+#endif // SYS_LINUX || SYS_FREEBSD
21
 
22
 typedef struct
23
 {
24
@@ -46,10 +46,10 @@ typedef struct
25
 #if HB_PROJECT_FEATURE_QSV
26
     mfxHandleType   mfxType;
27
 
28
-#ifdef SYS_LINUX
29
+#if defined(SYS_LINUX) || defined(SYS_FREEBSD)
30
     int             vaFd;
31
     VADisplay       vaDisplay;
32
-#endif // SYS_LINUX
33
+#endif // SYS_LINUX || SYS_FREEBSD
34
 #endif
35
 } hb_display_t;
36
 
(-)b/multimedia/handbrake/files/patch-libhb_module.defs (+32 lines)
Added Link Here
1
--- libhb/module.defs.orig	2019-11-09 20:44:32 UTC
2
+++ libhb/module.defs
3
@@ -1,12 +1,16 @@
4
 __deps__ := A52DEC BZIP2 LIBVPX FFMPEG FREETYPE LAME LIBASS LIBDCA \
5
     LIBDVDREAD LIBDVDNAV LIBICONV LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBOGG \
6
-    LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX LIBGNURX JANSSON \
7
+    LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBGNURX JANSSON \
8
     HARFBUZZ LIBOPUS LIBSPEEX LIBDAV1D
9
 
10
 ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
11
     __deps__ += FONTCONFIG
12
 endif
13
 
14
+ifeq (,$(filter $(HOST.system),freebsd))
15
+    __deps__ += LIBMFX
16
+endif
17
+
18
 $(eval $(call import.MODULE.defs,LIBHB,libhb,$(__deps__)))
19
 $(eval $(call import.GCC,LIBHB))
20
 
21
@@ -111,7 +115,11 @@ LIBHB.dll.libs += $(CONTRIB.build/)lib/libfdk-aac.a
22
 endif
23
 
24
 ifeq (1,$(FEATURE.qsv))
25
+ifeq (,$(filter $(HOST.system),freebsd))
26
 LIBHB.dll.libs += $(CONTRIB.build/)lib/libmfx.a
27
+else
28
+    LIBHB.GCC.l += mfx
29
+endif
30
 endif
31
 
32
 ifeq (1,$(FEATURE.x265))
(-)b/multimedia/handbrake/files/patch-libhb_ports.c (+41 lines)
Added Link Here
1
--- libhb/ports.c.orig	2019-11-09 20:44:32 UTC
2
+++ libhb/ports.c
3
@@ -28,7 +28,11 @@
4
 #if defined(SYS_DARWIN) || defined(SYS_FREEBSD)
5
 #include <sys/types.h>
6
 #include <sys/sysctl.h>
7
+#if HB_PROJECT_FEATURE_QSV && defined(SYS_FREEBSD)
8
+#include <libdrm/drm.h>
9
+#include <fcntl.h>
10
 #endif
11
+#endif
12
 
13
 #ifdef SYS_OPENBSD
14
 #include <sys/param.h>
15
@@ -1518,7 +1522,7 @@ char * hb_strndup(const char * src, size_t len)
16
 }
17
 
18
 #if HB_PROJECT_FEATURE_QSV
19
-#ifdef SYS_LINUX
20
+#if defined(SYS_LINUX) || defined(SYS_FREEBSD)
21
 
22
 #define MAX_NODES             16
23
 #define DRI_RENDER_NODE_START 128
24
@@ -1676,7 +1680,7 @@ void hb_display_close(hb_display_t ** _d)
25
     *_d = NULL;
26
 }
27
 
28
-#else // !SYS_LINUX
29
+#else // !SYS_LINUX && !SYS_FREEBSD
30
 
31
 hb_display_t * hb_display_init(const char         *  driver_name,
32
                                const char * const * interface_names)
33
@@ -1689,7 +1693,7 @@ void hb_display_close(hb_display_t ** _d)
34
     (void)_d;
35
 }
36
 
37
-#endif // SYS_LINUX
38
+#endif // SYS_LINUX || SYS_FREEBSD
39
 #else // !HB_PROJECT_FEATURE_QSV
40
 
41
 hb_display_t * hb_display_init(const char         *  driver_name,
(-)b/multimedia/handbrake/files/patch-libhb_qsv__common.c (+20 lines)
Added Link Here
1
--- libhb/qsv_common.c.orig	2019-11-09 20:44:32 UTC
2
+++ libhb/qsv_common.c
3
@@ -678,7 +678,7 @@ int hb_qsv_info_init()
4
      */
5
     mfxSession session;
6
     mfxVersion version = { .Major = 1, .Minor = 0, };
7
-#ifdef SYS_LINUX
8
+#if defined(SYS_LINUX) || defined(SYS_FREEBSD)
9
     mfxIMPL hw_preference = MFX_IMPL_VIA_ANY;
10
 #else
11
     mfxIMPL hw_preference = MFX_IMPL_VIA_D3D11;
12
@@ -738,7 +738,7 @@ int hb_qsv_info_init()
13
         }
14
         else
15
         {
16
-#ifndef SYS_LINUX
17
+#if !defined(SYS_LINUX) && !defined(SYS_FREEBSD)
18
             // Windows only: After D3D11 we will try D3D9
19
             if (hw_preference == MFX_IMPL_VIA_D3D11)
20
                 hw_preference = MFX_IMPL_VIA_D3D9;
(-)b/multimedia/handbrake/files/patch-make_configure.py (+29 lines)
Added Link Here
1
--- make/configure.py.orig	2019-11-09 20:44:32 UTC
2
+++ make/configure.py
3
@@ -1413,7 +1413,7 @@ def createCLI( cross = None ):
4
     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) )
5
     grp.add_argument( '--disable-nvenc', dest="enable_nvenc", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) )
6
 
7
-    h = IfHost( 'Intel QSV video encoder/decoder', '*-*-linux*', '*-*-mingw*', none=argparse.SUPPRESS).value
8
+    h = IfHost( 'Intel QSV video encoder/decoder', '*-*-linux*', '*-*-freebsd*', '*-*-mingw*', none=argparse.SUPPRESS).value
9
     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) )
10
     grp.add_argument( '--disable-qsv', dest="enable_qsv", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) )
11
 
12
@@ -1684,7 +1684,7 @@ try:
13
                                         none=False).value
14
                                  and options.enable_x265)
15
     # Disable QSV on unsupported platforms
16
-    options.enable_qsv        = IfHost(options.enable_qsv, '*-*-linux*',
17
+    options.enable_qsv        = IfHost(options.enable_qsv, '*-*-linux*', '*-*-freebsd*',
18
                                        '*-*-mingw*', none=False).value
19
     # Disable VCE on unsupported platforms
20
     options.enable_vce        = IfHost(options.enable_vce, '*-*-linux*', '*-*-mingw*',
21
@@ -2124,7 +2124,7 @@ int main()
22
     stdout.write( 'Enable NVENC:       %s' % options.enable_nvenc )
23
     stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' )
24
     stdout.write( 'Enable QSV:         %s' % options.enable_qsv )
25
-    stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' )
26
+    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' )
27
     stdout.write( 'Enable VCE:         %s' % options.enable_vce )
28
     stdout.write( ' (%s)\n' % note_unsupported ) if not (host_tuple.system == 'linux' or host_tuple.system == 'mingw') else stdout.write( '\n' )
29
 
(-)b/multimedia/handbrake/files/patch-make_include_main.defs (+13 lines)
Added Link Here
1
--- make/include/main.defs.orig	2019-11-09 20:44:32 UTC
2
+++ make/include/main.defs
3
@@ -52,8 +52,10 @@ MODULES += contrib/libdvdread
4
 MODULES += contrib/libdvdnav
5
 MODULES += contrib/libbluray
6
 
7
+ifneq (,$(filter $(HOST.system),freebsd))
8
 ifeq (1,$(FEATURE.qsv))
9
     MODULES += contrib/libmfx
10
+endif
11
 endif
12
 
13
 ifeq (1,$(FEATURE.vce))
(-)b/multimedia/handbrake/files/patch-test_module.defs (+11 lines)
Added Link Here
1
--- test/module.defs.orig	2019-11-09 20:44:32 UTC
2
+++ test/module.defs
3
@@ -25,7 +25,7 @@ endif
4
 
5
 ifeq (1,$(FEATURE.qsv))
6
     TEST.GCC.l += mfx
7
-ifeq ($(HOST.system),linux)
8
+ifneq (,$(filter $(HOST.system),linux freebsd))
9
     TEST.GCC.l += va va-drm
10
 endif
11
 endif

Return to bug 242849