pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia x264: added version 20220601



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3b805e8dcf63
branches:  trunk
changeset: 385791:3b805e8dcf63
user:      adam <adam%pkgsrc.org@localhost>
date:      Mon Sep 26 17:00:21 2022 +0000

description:
x264: added version 20220601

x264 is a free software library and application for encoding video streams into
the H.264/MPEG-4 AVC compression format.

diffstat:

 multimedia/Makefile                             |    3 +-
 multimedia/x264/DESCR                           |    2 +
 multimedia/x264/Makefile                        |   76 +++++++++++++
 multimedia/x264/PLIST                           |    8 +
 multimedia/x264/buildlink3.mk                   |   23 ++++
 multimedia/x264/distinfo                        |    7 +
 multimedia/x264/options.mk                      |   16 ++
 multimedia/x264/patches/patch-configure         |  135 ++++++++++++++++++++++++
 multimedia/x264/patches/patch-encoder_analyse.c |   15 ++
 9 files changed, 284 insertions(+), 1 deletions(-)

diffs (truncated from 331 to 300 lines):

diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/Makefile
--- a/multimedia/Makefile       Mon Sep 26 16:31:20 2022 +0000
+++ b/multimedia/Makefile       Mon Sep 26 17:00:21 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.325 2022/09/24 20:22:49 adam Exp $
+# $NetBSD: Makefile,v 1.326 2022/09/26 17:00:21 adam Exp $
 #
 
 COMMENT=       Multimedia utilities
@@ -213,6 +213,7 @@
 SUBDIR+=       tstools
 SUBDIR+=       vlc
 SUBDIR+=       win32-codecs
+SUBDIR+=       x264
 SUBDIR+=       x264-devel
 SUBDIR+=       x265
 SUBDIR+=       xawtv
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/DESCR     Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,2 @@
+x264 is a free software library and application for encoding video streams into
+the H.264/MPEG-4 AVC compression format.
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/Makefile  Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,76 @@
+# $NetBSD: Makefile,v 1.1 2022/09/26 17:00:21 adam Exp $
+
+# Download https://code.videolan.org/videolan/x264/-/archive/stable/x264-stable.tar.bz2
+# Rename to x264-<last-commit-date>.tar.bz2 and upload to MASTER_SITE_LOCAL.
+
+DISTNAME=      x264-20220601
+CATEGORIES=    multimedia
+MASTER_SITES=  ${MASTER_SITE_LOCAL}
+EXTRACT_SUFX=  .tar.bz2
+
+MAINTAINER=    adam%NetBSD.org@localhost
+HOMEPAGE=      https://www.videolan.org/developers/x264.html
+COMMENT=       GPL licensed H.264 encoder
+LICENSE=       gnu-gpl-v2
+
+WRKSRC=                ${WRKDIR}/x264-stable
+
+.include "../../mk/bsd.prefs.mk"
+
+# Assembler code still needs to be disabled on at least SunOS.
+# NetBSD/i386 needs ASM disabled to avoid text relocations.
+# NetBSD/mips needs ASM disabled because it uses the MSA extension
+# (requires MIPS64 revision 2) and fails to build.
+.if ${OPSYS} == "SunOS" || \
+    !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || \
+    !empty(MACHINE_PLATFORM:MNetBSD-*-mips*)
+CONFIGURE_ARGS+=       --disable-asm
+.elif ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
+    (${OPSYS} == "Darwin" && ${MACHINE_ARCH} == "aarch64")
+TOOL_DEPENDS+=         nasm>=2.13.0:../../devel/nasm
+.endif
+
+USE_TOOLS+=            bash gmake
+USE_LIBTOOL=           yes
+HAS_CONFIGURE=         yes
+CONFIG_SHELL=          ${BASH}
+CONFIGURE_ARGS+=       --enable-shared
+CONFIGURE_ARGS+=       --enable-static
+CONFIGURE_ARGS+=       --enable-pic
+CONFIGURE_ARGS+=       --prefix=${PREFIX}
+.if ${OPSYS} == "Darwin"
+USE_TOOLS+=            perl
+.else
+CONFIGURE_ARGS+=       --disable-opencl
+.endif
+MAKE_ENV+=             SH=${SH:Q}
+
+# tries to use /usr/ucb/install to create multiple directories
+# PR pkg/56512
+MAKE_FLAGS.SunOS+=     INSTALL=${INSTALL:Q}
+
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) || !empty(MACHINE_PLATFORM:MDarwin-*-aarch64)
+# XXX Consider passing this whether cross-compiling or not.
+CONFIGURE_ARGS+=       --host=${MACHINE_GNU_PLATFORM}
+.endif
+
+BUILD_TARGET=          default
+INSTALL_TARGET=                install-lib-shared install-lib-static install-cli
+INSTALLATION_DIRS=     bin
+REPLACE_SH=            version.sh
+
+.include "../../mk/dlopen.buildlink3.mk"
+
+CHECK_BUILTIN.pthread:=        yes
+.include "../../mk/pthread.builtin.mk"
+CHECK_BUILTIN.pthread:=        no
+
+.if ${USE_BUILTIN.pthread:M[Yy][Ee][Ss]}
+X264_BUILD_THREADS_SUPPORT=    yes
+.else
+X264_BUILD_THREADS_SUPPORT=    ${DLOPEN_REQUIRE_PTHREADS}
+.endif
+
+.include "options.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/PLIST     Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1 2022/09/26 17:00:21 adam Exp $
+bin/x264
+include/x264.h
+include/x264_config.h
+lib/libx264.a
+lib/libx264.so
+lib/libx264.so.164
+lib/pkgconfig/x264.pc
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/buildlink3.mk     Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,23 @@
+# $NetBSD: buildlink3.mk,v 1.1 2022/09/26 17:00:21 adam Exp $
+
+BUILDLINK_TREE+=       x264
+
+.if !defined(X264_BUILDLINK3_MK)
+X264_BUILDLINK3_MK:=
+
+# NOTE: When changing BUILDLINK_A[BP]I_DEPENDS.x264, please record
+#      the value of X264_BUILD in x264.h along with the appropriate
+#      dependency specification.  Perhaps we should incorporate this
+#      into the version number and/or pkg-config file?
+BUILDLINK_API_DEPENDS.x264+=   x264>=20220601 # X264_BUILD 164
+BUILDLINK_ABI_DEPENDS.x264+=   x264>=20220601
+BUILDLINK_PKGSRCDIR.x264?=     ../../multimedia/x264
+pkgbase:= x264
+.include "../../mk/pkg-build-options.mk"
+
+.if ${PKG_BUILD_OPTIONS.x264:Mthreads}
+.  include "../../mk/pthread.buildlink3.mk"
+.endif
+.endif # X264_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -x264
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/distinfo  Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2022/09/26 17:00:21 adam Exp $
+
+BLAKE2s (x264-20220601.tar.bz2) = 2990b29a9425fc9ad246905ddad2a9c0e888919fb1c3fd28b96209af823a085a
+SHA512 (x264-20220601.tar.bz2) = 73b8be945a2a82ea7af5039f5baa816440292887c1cad2672556f699a9d80eb8fbc2d5e44826cb36fecbbe83e6e75095c9ccd352bd2cb128caff7d4d7ed84e81
+Size (x264-20220601.tar.bz2) = 777576 bytes
+SHA1 (patch-configure) = c986b2ad87f940bd2cf1a96f471bd497e075b872
+SHA1 (patch-encoder_analyse.c) = 2057583899e029a4c2173c511293e6a35cf80f78
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/options.mk        Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: options.mk,v 1.1 2022/09/26 17:00:21 adam Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.x264
+PKG_SUPPORTED_OPTIONS= threads
+
+.if !empty(X264_BUILD_THREADS_SUPPORT:M[Yy][Ee][Ss])
+PKG_SUGGESTED_OPTIONS+=        threads
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mthreads)
+.  include "../../mk/pthread.buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-pthread
+.endif
diff -r 1b41d500c79d -r 3b805e8dcf63 multimedia/x264/patches/patch-configure
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/x264/patches/patch-configure   Mon Sep 26 17:00:21 2022 +0000
@@ -0,0 +1,135 @@
+$NetBSD: patch-configure,v 1.1 2022/09/26 17:00:21 adam Exp $
+
+Add support for DragonFly.
+Use 'amd64' as a synonym for 'x86_64'.
+Avoid endian test failure for -flto.
+Do not force compiler optimisations.
+If we fail an assembly test, continue as if --disable-asm
+was passed.
+
+--- configure.orig     2022-09-13 09:25:28.000000000 +0000
++++ configure
+@@ -664,6 +664,10 @@ case $host_os in
+         SYS="FREEBSD"
+         libm="-lm"
+         ;;
++    dragonfly*)
++        SYS="DRAGONFLY"
++        LDFLAGS="$LDFLAGS -lm"
++        ;;
+     kfreebsd*-gnu)
+         SYS="FREEBSD"
+         define HAVE_MALLOC_H
+@@ -764,7 +768,7 @@ case $host_cpu in
+             ASFLAGS="$ASFLAGS -f elf32"
+         fi
+         ;;
+-    x86_64)
++    x86_64|amd64)
+         ARCH="X86_64"
+         AS="${AS-nasm}"
+         AS_EXT=".asm"
+@@ -793,14 +797,15 @@ case $host_cpu in
+         fi
+         ;;
+     powerpc*)
+-        ARCH="PPC"
+         if [ $asm = auto ] ; then
+             define HAVE_ALTIVEC
+             AS="${AS-${CC}}"
+             AS_EXT=".c"
+             if [ $SYS = MACOSX ] ; then
++                ARCH="POWERPC"
+                 CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
+             else
++                ARCH="PPC"
+                 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
+                 define HAVE_ALTIVEC_H
+             fi
+@@ -839,6 +844,18 @@ case $host_cpu in
+             AS="${AS-${CC}}"
+         fi
+         ;;
++    aarch64|arm64*)
++        ARCH="AARCH64"
++        stack_alignment=16
++        if [ "$SYS" = MACOSX ] ; then
++            AS="${AS-${CC}}"
++            ASFLAGS="$ASFLAGS -DPREFIX -DPIC"
++        elif [ "$SYS" = WINDOWS ] && [ "$compiler" = CL ] ; then
++            AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo}"
++        else
++            AS="${AS-${CC}}"
++        fi
++        ;;
+     arm*)
+         ARCH="ARM"
+         if [ "$SYS" = MACOSX ] ; then
+@@ -985,8 +1002,8 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
+         ASFLAGS="$ASFLAGS -c"
+     else
+         echo "You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS."
+-        echo "If you really want to run on such a CPU, configure with --disable-asm."
+-        exit 1
++      echo "Disabling asm"
++      asm="no"
+     fi
+ fi
+ 
+@@ -1000,8 +1017,8 @@ if [ $asm = auto -a $ARCH = AARCH64 ] ; 
+         ASFLAGS="$ASFLAGS -c"
+     else
+         echo "no NEON support, try adding -mfpu=neon to CFLAGS"
+-        echo "If you really want to run on such a CPU, configure with --disable-asm."
+-        exit 1
++      echo "Disabling asm"
++      asm="no"
+     fi
+ fi
+ 
+@@ -1019,8 +1036,8 @@ if [ $asm = auto -a $ARCH = MIPS ] ; the
+         define HAVE_MSA
+     else
+         echo "You specified a pre-MSA CPU in your CFLAGS."
+-        echo "If you really want to run on such a CPU, configure with --disable-asm."
+-        exit 1
++      echo "Disabling asm"
++      asm="no"
+     fi
+ fi
+ 
+@@ -1037,7 +1054,7 @@ ASFLAGS="$ASFLAGS -DSTACK_ALIGNMENT=$sta
+ CPU_ENDIAN="little-endian"
+ if [ $compiler = GNU ]; then
+     echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
+-    $CC $CFLAGS -fno-lto conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
++    $CC $CPPFLAGS -fno-lto conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
+     if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then
+         define WORDS_BIGENDIAN
+         CPU_ENDIAN="big-endian"
+@@ -1060,7 +1077,7 @@ fi
+ 
+ # autodetect options that weren't forced nor disabled
+ 
+-libpthread=""
++libpthread="$PTHREAD_LDFLAGS $PTHREAD_LIBS"
+ if [ "$SYS" = "WINDOWS" -a "$thread" = "posix" ] ; then
+     if [ "$gpl" = "no" ] ; then
+         echo "Warning: pthread-win32 is LGPL and is therefore not supported with --disable-gpl"
+@@ -1319,7 +1336,7 @@ if [ "$pic" = "yes" ] ; then
+     [ "$SYS" != WINDOWS -a "$SYS" != CYGWIN ] && CFLAGS="$CFLAGS -fPIC"
+     [[ "$ASFLAGS" != *"-DPIC"* ]] && ASFLAGS="$ASFLAGS -DPIC"
+     # resolve textrels in the x86 asm
+-    cc_check stdio.h "-shared -Wl,-Bsymbolic" && SOFLAGS="$SOFLAGS -Wl,-Bsymbolic"



Home | Main Index | Thread Index | Old Index