Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Sep 2018 16:32:21 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r478807 - in head/multimedia: . aom aom/files ffmpeg
Message-ID:  <201809021632.w82GWLxm091263@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sun Sep  2 16:32:21 2018
New Revision: 478807
URL: https://svnweb.freebsd.org/changeset/ports/478807

Log:
  multimedia/aom: add new port
  
  AOMedia Video 1 (AV1), is an open, royalty-free video coding format
  designed for video transmissions over the Internet. It is being
  developed by the Alliance for Open Media (AOMedia), a consortium of
  firms from the semiconductor industry, video on demand providers, and
  web browser developers, founded in 2015.
  
  https://aomedia.org/

Added:
  head/multimedia/aom/
  head/multimedia/aom/Makefile   (contents, props changed)
  head/multimedia/aom/distinfo   (contents, props changed)
  head/multimedia/aom/files/
  head/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c   (contents, props changed)
  head/multimedia/aom/files/patch-aom__ports_ppc__cpudetect.c   (contents, props changed)
  head/multimedia/aom/files/patch-av1_encoder_rd.h   (contents, props changed)
  head/multimedia/aom/files/patch-build_cmake_aom__configure.cmake   (contents, props changed)
  head/multimedia/aom/files/patch-build_cmake_aom__optimization.cmake   (contents, props changed)
  head/multimedia/aom/pkg-descr   (contents, props changed)
  head/multimedia/aom/pkg-plist   (contents, props changed)
Modified:
  head/multimedia/Makefile   (contents, props changed)
  head/multimedia/ffmpeg/Makefile   (contents, props changed)

Modified: head/multimedia/Makefile
==============================================================================
--- head/multimedia/Makefile	Sun Sep  2 16:29:56 2018	(r478806)
+++ head/multimedia/Makefile	Sun Sep  2 16:32:21 2018	(r478807)
@@ -10,6 +10,7 @@
     SUBDIR += abby
     SUBDIR += acidrip
     SUBDIR += aegisub
+    SUBDIR += aom
     SUBDIR += aravis
     SUBDIR += asdcplib
     SUBDIR += assimp

Added: head/multimedia/aom/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/Makefile	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,32 @@
+# $FreeBSD$
+
+PORTNAME=	aom
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.0.0
+CATEGORIES=	multimedia
+MASTER_SITES=	LOCAL/jbeich # GitHub mirror is still importing...
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	AV1 Codec Library
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${BUILD_DEPENDS_${ARCH}}
+BUILD_DEPENDS_amd64=	nasm:devel/nasm
+BUILD_DEPENDS_i386=	nasm:devel/nasm
+
+USES=		cmake:outsource compiler:c++11-lib perl5
+USE_GITHUB=	yes
+USE_PERL5=	build
+USE_LDCONFIG=	yes
+GH_ACCOUNT=	jbeich # mirror
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_OFF=	ENABLE_DOCS ENABLE_TESTS
+
+post-patch:
+# Extract (snapshot) version from GH_TAGNAME instead of CHANGELOG
+	@${REINPLACE_CMD} 's,$${AOM_ROOT}/CHANGELOG,${GH_TAGNAME:S/^v//},' \
+		${WRKSRC}/build/cmake/version.cmake
+
+.include <bsd.port.mk>

Added: head/multimedia/aom/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/distinfo	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1535885385
+SHA256 (jbeich-aom-v1.0.0_GH0.tar.gz) = c6506418aaaa7cb787d5fd8a67ca3dd749139a6cceab72c6bc76c5f48247635b
+SIZE (jbeich-aom-v1.0.0_GH0.tar.gz) = 2776803

Added: head/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,77 @@
+- Assume NEON is enabled on aarch64
+- Implement NEON runtime detection on FreeBSD
+
+--- aom_ports/arm_cpudetect.c.orig	2018-06-25 14:54:59 UTC
++++ aom_ports/arm_cpudetect.c
+@@ -38,7 +38,7 @@ static int arm_cpu_env_mask(void) {
+   return env && *env ? (int)strtol(env, NULL, 0) : ~0;
+ }
+ 
+-#if !CONFIG_RUNTIME_CPU_DETECT
++#if !CONFIG_RUNTIME_CPU_DETECT || defined(__ARM_NEON)
+ 
+ int arm_cpu_caps(void) {
+   /* This function should actually be a no-op. There is no way to adjust any of
+@@ -143,7 +143,61 @@ int arm_cpu_caps(void) {
+   }
+   return flags & mask;
+ }
+-#else  /* end __linux__ */
++#elif defined(__FreeBSD__)
++
++#if 0 // __has_include(<sys/auxv.h>)
++#include <sys/auxv.h>
++#else
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <elf.h>
++#include <errno.h>
++#include <unistd.h>
++
++static unsigned long getauxval(unsigned long type) {
++  Elf_Auxinfo auxv[AT_COUNT];
++  size_t len = sizeof(auxv);
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_AUXV,
++    getpid(),
++  };
++
++  if (sysctl(mib, nitems(mib), auxv, &len, NULL, 0) != -1) {
++    for (size_t i = 0; i < nitems(auxv); i++)
++      if ((unsigned long)auxv[i].a_type == type)
++        return auxv[i].a_un.a_val;
++
++    errno = ENOENT;
++  }
++  return 0;
++}
++#endif
++
++#ifndef AT_HWCAP
++#define AT_HWCAP 25 /* 16 on Linux */
++#endif
++
++#ifndef HWCAP_NEON
++#define HWCAP_NEON (1 << 12)
++#endif
++
++int arm_cpu_caps(void) {
++  int flags;
++  int mask;
++  unsigned long hwcaps;
++  if (!arm_cpu_env_flags(&flags)) {
++    return flags;
++  }
++  mask = arm_cpu_env_mask();
++  hwcaps = getauxval(AT_HWCAP);
++#if HAVE_NEON
++  if (hwcaps & HWCAP_NEON) flags |= HAS_NEON;
++#endif
++  return flags & mask;
++}
++#else /* end __FreeBSD__ */
+ #error \
+     "--enable-runtime-cpu-detect selected, but no CPU detection method " \
+ "available for your platform. Reconfigure with --disable-runtime-cpu-detect."

Added: head/multimedia/aom/files/patch-aom__ports_ppc__cpudetect.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/files/patch-aom__ports_ppc__cpudetect.c	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,68 @@
+- Implement VSX detection on FreeBSD
+
+--- aom_ports/ppc_cpudetect.c.orig	2018-06-25 14:54:59 UTC
++++ aom_ports/ppc_cpudetect.c
+@@ -9,12 +9,6 @@
+  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
+  */
+ 
+-#include <fcntl.h>
+-#include <unistd.h>
+-#include <stdint.h>
+-#include <asm/cputable.h>
+-#include <linux/auxvec.h>
+-
+ #include "config/aom_config.h"
+ 
+ #include "aom_ports/ppc.h"
+@@ -37,6 +31,13 @@ static int cpu_env_mask(void) {
+   return env && *env ? (int)strtol(env, NULL, 0) : ~0;
+ }
+ 
++#if defined(__linux__)
++#include <fcntl.h>
++#include <unistd.h>
++#include <stdint.h>
++#include <asm/cputable.h>
++#include <linux/auxvec.h>
++
+ int ppc_simd_caps(void) {
+   int flags;
+   int mask;
+@@ -75,6 +76,36 @@ out_close:
+   close(fd);
+   return flags & mask;
+ }
++#elif defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <machine/cpu.h>
++
++int ppc_simd_caps(void) {
++  int flags;
++  int mask;
++  u_long cpu_features = 0;
++  size_t sz = sizeof(cpu_features);
++
++  // If AOM_SIMD_CAPS is set then allow only those capabilities.
++  if (!cpu_env_flags(&flags)) {
++    return flags;
++  }
++
++  mask = cpu_env_mask();
++
++  sysctlbyname("hw.cpu_features", &cpu_features, &sz, NULL, 0);
++#if HAVE_VSX
++  if (cpu_features & PPC_FEATURE_HAS_VSX) flags |= HAS_VSX;
++#endif
++
++  return flags & mask;
++}
++#else
++#error \
++    "--enable-runtime-cpu-detect selected, but no CPU detection method " \
++"available for your platform. Reconfigure with --disable-runtime-cpu-detect."
++#endif   /* end __FreeBSD__ */
+ #else
+ // If there is no RTCD the function pointers are not used and can not be
+ // changed.

Added: head/multimedia/aom/files/patch-av1_encoder_rd.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/files/patch-av1_encoder_rd.h	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,31 @@
+<stdint.h> isn't bootlegged via gtest.h on FreeBSD 10.* leading to
+
+In file included from test/horz_superres_test.cc:14:
+In file included from av1/encoder/encoder.h:36:
+av1/encoder/rd.h:304:26: error: use of undeclared identifier 'INT64_MAX'
+  rd_stats->ref_rdcost = INT64_MAX;
+                         ^
+av1/encoder/rd.h:325:20: error: use of undeclared identifier 'INT64_MAX'
+  rd_stats->dist = INT64_MAX;
+                   ^
+av1/encoder/rd.h:326:22: error: use of undeclared identifier 'INT64_MAX'
+  rd_stats->rdcost = INT64_MAX;
+                     ^
+av1/encoder/rd.h:327:19: error: use of undeclared identifier 'INT64_MAX'
+  rd_stats->sse = INT64_MAX;
+                  ^
+av1/encoder/rd.h:331:26: error: use of undeclared identifier 'INT64_MAX'
+  rd_stats->ref_rdcost = INT64_MAX;
+                         ^
+5 errors generated.
+
+--- av1/encoder/rd.h.orig	2018-06-25 14:54:59 UTC
++++ av1/encoder/rd.h
+@@ -13,6 +13,7 @@
+ #define AV1_ENCODER_RD_H_
+ 
+ #include <limits.h>
++#include <stdint.h>
+ 
+ #include "av1/common/blockd.h"
+ 

Added: head/multimedia/aom/files/patch-build_cmake_aom__configure.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/files/patch-build_cmake_aom__configure.cmake	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,52 @@
+- uname -p returns amd64 on FreeBSD/OpenBSD but x86_64 on DragonFly/NetBSD
+- Automatically fall back to generic without forcing downstream to maintain whitelist
+- More ELF platforms can use GNU assembler on non-x86
+
+--- build/cmake/aom_configure.cmake.orig	2018-06-25 14:54:59 UTC
++++ build/cmake/aom_configure.cmake
+@@ -51,6 +51,7 @@ endforeach()
+ # Detect target CPU.
+ if(NOT AOM_TARGET_CPU)
+   if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64" OR
++     "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64" OR
+      "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
+     if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
+       set(AOM_TARGET_CPU "x86")
+@@ -122,10 +123,8 @@ else()
+ endif()
+ 
+ if(NOT "${AOM_SUPPORTED_CPU_TARGETS}" MATCHES "${AOM_TARGET_CPU}")
+-  message(FATAL_ERROR
+-            "No RTCD support for ${AOM_TARGET_CPU}. Create it, or "
+-            "add -DAOM_TARGET_CPU=generic to your cmake command line for a "
+-            "generic build of libaom and tools.")
++  message(WARNING "No RTCD support for ${AOM_TARGET_CPU}. Assuming generic.")
++  set(AOM_TARGET_CPU generic)
+ endif()
+ 
+ if("${AOM_TARGET_CPU}" STREQUAL "x86" OR "${AOM_TARGET_CPU}" STREQUAL "x86_64")
+@@ -151,20 +150,15 @@ elseif("${AOM_TARGET_CPU}" MATCHES "arm")
+   if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+     set(AS_EXECUTABLE as)
+     set(AOM_AS_FLAGS -arch ${AOM_TARGET_CPU} -isysroot ${CMAKE_OSX_SYSROOT})
+-  elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
+-    if(NOT AS_EXECUTABLE)
+-      set(AS_EXECUTABLE as)
+-    endif()
+   elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Windows")
+     if(NOT AS_EXECUTABLE)
+       set(AS_EXECUTABLE ${CMAKE_C_COMPILER} -c -mimplicit-it=always)
+     endif()
++  else()
++    if(NOT AS_EXECUTABLE)
++      set(AS_EXECUTABLE as)
++    endif()
+   endif()
+-  if(NOT AS_EXECUTABLE)
+-    message(FATAL_ERROR
+-              "Unknown assembler for: ${AOM_TARGET_CPU}-${AOM_TARGET_SYSTEM}")
+-  endif()
+-
+   string(STRIP "${AOM_AS_FLAGS}" AOM_AS_FLAGS)
+ endif()
+ 

Added: head/multimedia/aom/files/patch-build_cmake_aom__optimization.cmake
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/files/patch-build_cmake_aom__optimization.cmake	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,61 @@
+ELF is also used on Solaris, BSDs, Haiku, Fuchsia, etc.
+
+--- build/cmake/aom_optimization.cmake.orig	2018-06-25 14:54:59 UTC
++++ build/cmake/aom_optimization.cmake
+@@ -83,24 +83,20 @@ function(get_asm_obj_format out_format)
+   if("${AOM_TARGET_CPU}" STREQUAL "x86_64")
+     if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+       set(objformat "macho64")
+-    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
+-      set(objformat "elf64")
+     elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS" OR "${AOM_TARGET_SYSTEM}"
+            STREQUAL "Windows")
+       set(objformat "win64")
+     else()
+-      message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_SYSTEM}")
++      set(objformat "elf64")
+     endif()
+   elseif("${AOM_TARGET_CPU}" STREQUAL "x86")
+     if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
+       set(objformat "macho32")
+-    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
+-      set(objformat "elf32")
+     elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS" OR "${AOM_TARGET_SYSTEM}"
+            STREQUAL "Windows")
+       set(objformat "win32")
+     else()
+-      message(FATAL_ERROR "Unknown obj format: ${AOM_TARGET_SYSTEM}")
++      set(objformat "elf32")
+     endif()
+   else()
+     message(FATAL_ERROR
+@@ -171,7 +167,13 @@ function(test_nasm)
+         message(FATAL_ERROR
+                   "Unsupported nasm: macho32 object format not supported.")
+       endif()
+-    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
++    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS" OR "${AOM_TARGET_SYSTEM}"
++           STREQUAL "Windows")
++      if(NOT "${nasm_helptext}" MATCHES "win32")
++        message(FATAL_ERROR
++                  "Unsupported nasm: win32 object format not supported.")
++      endif()
++    else()
+       if(NOT "${nasm_helptext}" MATCHES "elf32")
+         message(FATAL_ERROR
+                   "Unsupported nasm: elf32 object format not supported.")
+@@ -183,7 +185,13 @@ function(test_nasm)
+         message(FATAL_ERROR
+                   "Unsupported nasm: macho64 object format not supported.")
+       endif()
+-    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
++    elseif("${AOM_TARGET_SYSTEM}" STREQUAL "MSYS" OR "${AOM_TARGET_SYSTEM}"
++           STREQUAL "Windows")
++      if(NOT "${nasm_helptext}" MATCHES "win64")
++        message(FATAL_ERROR
++                  "Unsupported nasm: win64 object format not supported.")
++      endif()
++    else()
+       if(NOT "${nasm_helptext}" MATCHES "elf64")
+         message(FATAL_ERROR
+                   "Unsupported nasm: elf64 object format not supported.")

Added: head/multimedia/aom/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/pkg-descr	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,7 @@
+AOMedia Video 1 (AV1), is an open, royalty-free video coding format
+designed for video transmissions over the Internet. It is being
+developed by the Alliance for Open Media (AOMedia), a consortium of
+firms from the semiconductor industry, video on demand providers, and
+web browser developers, founded in 2015.
+
+WWW: https://aomedia.org/

Added: head/multimedia/aom/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/aom/pkg-plist	Sun Sep  2 16:32:21 2018	(r478807)
@@ -0,0 +1,14 @@
+bin/aomdec
+bin/aomenc
+include/aom/aom.h
+include/aom/aom_codec.h
+include/aom/aom_decoder.h
+include/aom/aom_encoder.h
+include/aom/aom_frame_buffer.h
+include/aom/aom_image.h
+include/aom/aom_integer.h
+include/aom/aomcx.h
+include/aom/aomdx.h
+lib/libaom.so
+lib/libaom.so.0
+libdata/pkgconfig/aom.pc

Modified: head/multimedia/ffmpeg/Makefile
==============================================================================
--- head/multimedia/ffmpeg/Makefile	Sun Sep  2 16:29:56 2018	(r478806)
+++ head/multimedia/ffmpeg/Makefile	Sun Sep  2 16:32:21 2018	(r478807)
@@ -41,12 +41,6 @@ OPTIONS_DEFAULT=	FONTCONFIG FREETYPE FREI0R GMP GNUTLS
 			OPENCV OPTIMIZED_CFLAGS OPUS RTCPU THEORA V4L VAAPI VDPAU \
 			VORBIS VPX X264 X265 XVID
 
-.if !exists(${.CURDIR:H:H}/multimedia/aom)
-# https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/c438899a7064
-# https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/43778a501f1b
-OPTIONS_EXCLUDE+=	AOM
-.endif
-
 .if !exists(${.CURDIR:H:H}/net/srt)
 # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/a2fc8dbae853
 OPTIONS_EXCLUDE+=	SRT



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809021632.w82GWLxm091263>