Thu Aug 17 07:43:40 2023 UTC ()
svt-av1: Fix build on SunOS.


(jperkin)
diff -r1.2 -r1.3 pkgsrc/multimedia/svt-av1/distinfo
diff -r0 -r1.1 pkgsrc/multimedia/svt-av1/patches/patch-CMakeLists.txt
diff -r0 -r1.1 pkgsrc/multimedia/svt-av1/patches/patch-third__party_cpuinfo_CMakeLists.txt
diff -r0 -r1.1 pkgsrc/multimedia/svt-av1/patches/patch-third__party_cpuinfo_src_init.c

cvs diff -r1.2 -r1.3 pkgsrc/multimedia/svt-av1/distinfo (expand / switch to unified diff)

--- pkgsrc/multimedia/svt-av1/distinfo 2023/07/19 13:14:02 1.2
+++ pkgsrc/multimedia/svt-av1/distinfo 2023/08/17 07:43:40 1.3
@@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
1$NetBSD: distinfo,v 1.2 2023/07/19 13:14:02 wiz Exp $ 1$NetBSD: distinfo,v 1.3 2023/08/17 07:43:40 jperkin Exp $
2 2
3BLAKE2s (svt-av1-1.5.0.tar.bz2) = efa954996cc42b0ad05c8b2b91604625fcd3f92c4f22db14bb4d4cccc08fa371 3BLAKE2s (svt-av1-1.5.0.tar.bz2) = efa954996cc42b0ad05c8b2b91604625fcd3f92c4f22db14bb4d4cccc08fa371
4SHA512 (svt-av1-1.5.0.tar.bz2) = d5aa7679aeaa1e19f21906a36a7214c72cdaee77e1b5c1946ded43f8381ec2d705e671130589207b65b920a4fcaa9ca1d0037f88ef8d2303125d7f7aa54e3a2e 4SHA512 (svt-av1-1.5.0.tar.bz2) = d5aa7679aeaa1e19f21906a36a7214c72cdaee77e1b5c1946ded43f8381ec2d705e671130589207b65b920a4fcaa9ca1d0037f88ef8d2303125d7f7aa54e3a2e
5Size (svt-av1-1.5.0.tar.bz2) = 9490521 bytes 5Size (svt-av1-1.5.0.tar.bz2) = 9490521 bytes
 6SHA1 (patch-CMakeLists.txt) = c9bf8c9628c51b63f9455706400e348faebd6ba0
 7SHA1 (patch-third__party_cpuinfo_CMakeLists.txt) = 5afbc2a716568aa529e9af85fd716d405a2ad751
 8SHA1 (patch-third__party_cpuinfo_src_init.c) = 26e8c0689ed9e7f7734c4cf7a3f7278fe3092fcb

File Added: pkgsrc/multimedia/svt-av1/patches/patch-CMakeLists.txt
$NetBSD: patch-CMakeLists.txt,v 1.1 2023/08/17 07:43:40 jperkin Exp $

Avoid incompatible linker flags on SunOS.

--- CMakeLists.txt.orig	2023-04-26 22:11:56.000000000 +0000
+++ CMakeLists.txt
@@ -209,7 +209,7 @@ if(UNIX)
             set(CMAKE_C_ARCHIVE_FINISH   "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
             set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
         endif()
-    else()
+    elseif(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now")
     endif()
 endif()

File Added: pkgsrc/multimedia/svt-av1/patches/patch-third__party_cpuinfo_CMakeLists.txt
$NetBSD: patch-third__party_cpuinfo_CMakeLists.txt,v 1.1 2023/08/17 07:43:40 jperkin Exp $

Support SunOS.

--- third_party/cpuinfo/CMakeLists.txt.orig	2023-04-26 22:11:56.000000000 +0000
+++ third_party/cpuinfo/CMakeLists.txt
@@ -72,7 +72,7 @@ IF(NOT CMAKE_SYSTEM_NAME)
       "Target operating system is not specified. "
       "cpuinfo will compile, but cpuinfo_initialize() will always fail.")
   SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
-ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android|DragonFly|FreeBSD|NetBSD|OpenBSD)$")
+ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android|DragonFly|FreeBSD|NetBSD|OpenBSD|SunOS)$")
   IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
     MESSAGE(WARNING
       "Target operating system \"${CMAKE_SYSTEM_NAME}\" is not supported in cpuinfo. "
@@ -95,7 +95,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM)
     IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
       LIST(APPEND CPUINFO_SRCS
         src/x86/linux/init.c)
-    ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(DragonFly|FreeBSD|NetBSD|OpenBSD)$")
+    ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(DragonFly|FreeBSD|NetBSD|OpenBSD|SunOS)$")
       LIST(APPEND CPUINFO_SRCS src/x86/bsd/init.c)
     ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
       LIST(APPEND CPUINFO_SRCS src/x86/mach/x86_mach_init.c)

File Added: pkgsrc/multimedia/svt-av1/patches/patch-third__party_cpuinfo_src_init.c
$NetBSD: patch-third__party_cpuinfo_src_init.c,v 1.1 2023/08/17 07:43:40 jperkin Exp $

Support SunOS.

--- third_party/cpuinfo/src/init.c.orig	2023-04-26 22:11:56.000000000 +0000
+++ third_party/cpuinfo/src/init.c
@@ -29,7 +29,7 @@ bool CPUINFO_ABI cpuinfo_initialize(void
         pthread_once(&init_guard, &cpuinfo_x86_linux_init);
     #elif defined(_WIN32) || defined(__CYGWIN__)
         InitOnceExecuteOnce(&init_guard, &cpuinfo_x86_windows_init, NULL, NULL);
-    #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
+    #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__sun)
         pthread_once(&init_guard, &cpuinfo_x86_bsd_init);
     #else
         cpuinfo_log_error("operating system is not supported in cpuinfo");