pkgsrc-WIP-changes archive

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

avidemux: Fix building on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Frédéric Fauberteau <triaxx%NetBSD.org@localhost>
Pushed By:	frederic
Date:		Sun Jan 8 23:21:07 2023 +0100
Changeset:	906a0828306d33f994cece215f0b00b255ebbcce

Modified Files:
	avidemux/Makefile
	avidemux/Makefile.common
	avidemux/PLIST
	avidemux/buildlink3.mk
	avidemux/distinfo
	avidemux/options.mk
Added Files:
	avidemux/PLIST.Darwin
	avidemux/patches/patch-avidemux__core_ADM__coreSqlLight3_src_CMakeLists.txt
	avidemux/patches/patch-avidemux__core_ADM__coreUtils_src_CMakeLists.txt
	avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__crashdump__unix.cpp
	avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__folder__linux.cpp
	avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__memsupport.cpp
	avidemux/patches/patch-avidemux__core_ADM__core_src_CMakeLists.txt

Log Message:
avidemux: Fix building on NetBSD

pkgsrc changes:
---------------
  * Add patches to fix building on NetBSD.
  * Add missing audio device options.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=906a0828306d33f994cece215f0b00b255ebbcce

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 avidemux/Makefile                                  | 21 +++++++++++--
 avidemux/Makefile.common                           | 16 +++++++---
 avidemux/PLIST                                     | 35 +++++++++++++++++-----
 avidemux/PLIST.Darwin                              |  3 ++
 avidemux/buildlink3.mk                             | 18 +++++++++++
 avidemux/distinfo                                  |  6 ++++
 avidemux/options.mk                                | 30 ++++++++++++++++---
 ...mux__core_ADM__coreSqlLight3_src_CMakeLists.txt | 18 +++++++++++
 ...videmux__core_ADM__coreUtils_src_CMakeLists.txt | 16 ++++++++++
 ...ux__core_ADM__core_src_ADM__crashdump__unix.cpp | 17 +++++++++++
 ...emux__core_ADM__core_src_ADM__folder__linux.cpp | 16 ++++++++++
 ...videmux__core_ADM__core_src_ADM__memsupport.cpp | 16 ++++++++++
 ...tch-avidemux__core_ADM__core_src_CMakeLists.txt | 18 +++++++++++
 13 files changed, 213 insertions(+), 17 deletions(-)

diffs:
diff --git a/avidemux/Makefile b/avidemux/Makefile
index d7319167b6..a0630ab93e 100644
--- a/avidemux/Makefile
+++ b/avidemux/Makefile
@@ -10,10 +10,27 @@ USE_TOOLS+=	gmake perl
 CMAKE_ARG_PATH=			${WRKSRC}/avidemux_core
 CMAKE_MODULE_PATH_OVERRIDE=	${CMAKE_ARG_PATH}/CMakeLists.txt
 
+# XXX By default, macOS uses a case-insensitive filesystem.
+# Then VERSION is included by '#include<version>'.
 post-configure:
-	# By default, macOS uses a case-insensitive filesystem.
-	# Then the following file is included by '#include<version>'.
 	${RUN}${RM} -f ${WRKSRC}/${CONFIGURE_DIRS}/ffmpeg/source/VERSION
 
+# XXX wip/avidemux-plugings has build error: -lADM6xxx not found.
+# It can be fixed with unversioned .so file.
+.if ${SHLIB_TYPE} != "dylib"
+FFMPEG_VERSIONED_LIBRARIES=	libADM6avcodec.so.58
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6avformat.so.58
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6avutil.so.56
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6postproc.so.55
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6swscale.so.5
+
+post-install:
+.for library in ${FFMPEG_VERSIONED_LIBRARIES}
+	cd ${DESTDIR}${PREFIX}/lib && \
+		${LN} -sf ${library} ${library:R}
+.endfor
+.endif
+
 .include "../../databases/sqlite3/buildlink3.mk"
+.include "../../devel/libexecinfo/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/avidemux/Makefile.common b/avidemux/Makefile.common
index 0005db7798..89aca3a4d4 100644
--- a/avidemux/Makefile.common
+++ b/avidemux/Makefile.common
@@ -7,7 +7,7 @@ DISTNAME=	avidemux_2.8.1
 CATEGORIES?=	multimedia
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=avidemux/}
 
-MAINTAINER?=	pkgsrc-users%NetBSD.org@localhost
+MAINTAINER?=	triaxx%NetBSD.org@localhost
 HOMEPAGE?=	http://fixounet.free.fr/avidemux/
 LICENSE?=	gnu-gpl-v2
 
@@ -20,11 +20,19 @@ CONFIGURE_DIRS=	build
 .include "../../mk/bsd.prefs.mk"
 
 .if ${SHLIB_TYPE} == "dylib"
-SOEXT=		dylib
+PLIST.dylib=		yes
+SOEXT=			dylib
 .else
-SOEXT=		so
+PLIST.so=		yes
+SOEXT=			so
+.endif
+PLIST_SUBST+=		SOEXT=${SOEXT}
+PLIST_VARS+=		dylib so
+
+.if ${OPSYS} != "Darwin"
+PLIST.notdarwin=	yes
+PLIST_VARS+=		notdarwin
 .endif
-PLIST_SUBST+=	SOEXT=${SOEXT}
 
 post-extract:
 	${RUN}${MKDIR} -p ${WRKSRC}/${CONFIGURE_DIRS}
diff --git a/avidemux/PLIST b/avidemux/PLIST
index 8ea90f1a8d..d8f8fc00fb 100644
--- a/avidemux/PLIST
+++ b/avidemux/PLIST
@@ -134,6 +134,13 @@ include/avidemux/2.8/ADM_coreImageLoader/ADM_imageLoader.h
 include/avidemux/2.8/ADM_coreJobs/ADM_coreJobs.h
 include/avidemux/2.8/ADM_coreJobs/ADM_coreJobs_export.h
 include/avidemux/2.8/ADM_coreJobs/sqlJobs.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVA/ADM_coreLibVA.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVA/ADM_coreLibVA_internal.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVAEnc/ADM_coreLibVA_bitstream.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVAEnc/ADM_coreLibVA_buffer.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVAEnc/ADM_coreLibVA_encodingContext.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVAEnc/ADM_coreLibVA_h264Encoding.h
+${PLIST.vaapi}include/avidemux/2.8/ADM_coreLibVAEnc/ADM_coreLibVA_hevcEncoding.h
 include/avidemux/2.8/ADM_coreMuxer/ADM_coreMuxer6_export.h
 include/avidemux/2.8/ADM_coreMuxer/ADM_coreMuxerFfmpeg.h
 include/avidemux/2.8/ADM_coreMuxer/ADM_muxer.h
@@ -203,6 +210,8 @@ include/avidemux/2.8/ADM_coreUtils/FFcodecContext_param.h
 include/avidemux/2.8/ADM_coreUtils/fourcc.h
 include/avidemux/2.8/ADM_coreUtils/prefs.h
 include/avidemux/2.8/ADM_coreUtils/prefs2_list.h
+${PLIST.vdpau}include/avidemux/2.8/ADM_coreVdpau/ADM_coreVdpau.h
+${PLIST.vdpau}include/avidemux/2.8/ADM_coreVdpau/ADM_coreVdpauInternal.h
 include/avidemux/2.8/ADM_coreVideoCodec/ADM_codec.h
 include/avidemux/2.8/ADM_coreVideoCodec/ADM_codecEmpty.h
 include/avidemux/2.8/ADM_coreVideoCodec/ADM_codecFFVP9.h
@@ -230,7 +239,6 @@ include/avidemux/2.8/ADM_coreVideoFilter/ADM_coreVideoFilterInternal.h
 include/avidemux/2.8/ADM_coreVideoFilter/ADM_filterCategory.h
 include/avidemux/2.8/ADM_coreVideoFilter/ADM_videoFilterBridge.h
 include/avidemux/2.8/ADM_coreVideoFilter/ADM_videoFilterCache.h
-include/avidemux/2.8/ADM_coreVideoToolbox/ADM_coreVideoToolbox.h
 include/avidemux/2.8/cmake/ADM_coreConfig.cmake
 include/avidemux/2.8/cmake/ADM_coreConfig.h.cmake
 include/avidemux/2.8/cmake/DeployQt5.cmake
@@ -373,6 +381,7 @@ include/avidemux/2.8/libavcodec/codec_desc.h
 include/avidemux/2.8/libavcodec/codec_id.h
 include/avidemux/2.8/libavcodec/codec_par.h
 include/avidemux/2.8/libavcodec/packet.h
+${PLIST.vaapi}include/avidemux/2.8/libavcodec/vaapi.h
 include/avidemux/2.8/libavcodec/vdpau.h
 include/avidemux/2.8/libavcodec/version.h
 include/avidemux/2.8/libavcodec/videotoolbox.h
@@ -413,11 +422,21 @@ include/avidemux/2.8/libpostproc/postprocess.h
 include/avidemux/2.8/libpostproc/version.h
 include/avidemux/2.8/libswscale/swscale.h
 include/avidemux/2.8/libswscale/version.h
-lib/libADM6avcodec.58.${SOEXT}
-lib/libADM6avformat.58.${SOEXT}
-lib/libADM6avutil.56.${SOEXT}
-lib/libADM6postproc.55.${SOEXT}
-lib/libADM6swscale.5.${SOEXT}
+${PLIST.dylib}lib/libADM6avcodec.58.dylib
+${PLIST.so}lib/libADM6avcodec.so
+${PLIST.so}lib/libADM6avcodec.so.58
+${PLIST.dylib}lib/libADM6avformat.58.dylib
+${PLIST.so}lib/libADM6avformat.so
+${PLIST.so}lib/libADM6avformat.so.58
+${PLIST.dylib}lib/libADM6avutil.56.dylib
+${PLIST.so}lib/libADM6avutil.so
+${PLIST.so}lib/libADM6avutil.so.56
+${PLIST.dylib}lib/libADM6postproc.55.dylib
+${PLIST.so}lib/libADM6postproc.so
+${PLIST.so}lib/libADM6postproc.so.55
+${PLIST.dylib}lib/libADM6swscale.5.dylib
+${PLIST.so}lib/libADM6swscale.so
+${PLIST.so}lib/libADM6swscale.so.5
 lib/libADM_audioParser6.${SOEXT}
 lib/libADM_core6.${SOEXT}
 lib/libADM_coreAudio6.${SOEXT}
@@ -429,6 +448,8 @@ lib/libADM_coreDemuxerMpeg6.${SOEXT}
 lib/libADM_coreImage6.${SOEXT}
 lib/libADM_coreImageLoader6.${SOEXT}
 lib/libADM_coreJobs.${SOEXT}
+${PLIST.vaapi}lib/libADM_coreLibVA6.${SOEXT}
+${PLIST.vaapi}lib/libADM_coreLibVAEnc6.${SOEXT}
 lib/libADM_coreMuxer6.${SOEXT}
 lib/libADM_coreScript.${SOEXT}
 lib/libADM_coreSocket6.${SOEXT}
@@ -436,9 +457,9 @@ lib/libADM_coreSqlLight3.${SOEXT}
 lib/libADM_coreSubtitles6.${SOEXT}
 lib/libADM_coreUI6.${SOEXT}
 lib/libADM_coreUtils6.${SOEXT}
+${PLIST.vdpau}lib/libADM_coreVDPAU6.${SOEXT}
 lib/libADM_coreVideoCodec6.${SOEXT}
 lib/libADM_coreVideoEncoder6.${SOEXT}
 lib/libADM_coreVideoFilter6.${SOEXT}
-lib/libADM_coreVideoToolbox6.${SOEXT}
 @pkgdir include/avidemux/2.8/cmake/sql
 @pkgdir include/avidemux/2.8/cmake/osx
diff --git a/avidemux/PLIST.Darwin b/avidemux/PLIST.Darwin
new file mode 100644
index 0000000000..a736564c4c
--- /dev/null
+++ b/avidemux/PLIST.Darwin
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+include/avidemux/2.8/ADM_coreVideoToolbox/ADM_coreVideoToolbox.h
+lib/libADM_coreVideoToolbox6.dylib
diff --git a/avidemux/buildlink3.mk b/avidemux/buildlink3.mk
index 23014cf20c..917f2076d9 100644
--- a/avidemux/buildlink3.mk
+++ b/avidemux/buildlink3.mk
@@ -9,6 +9,24 @@ BUILDLINK_API_DEPENDS.avidemux+=	avidemux>=2.8.1
 BUILDLINK_ABI_DEPENDS.avidemux+=	avidemux>=2.8.1
 BUILDLINK_PKGSRCDIR.avidemux?=		../../wip/avidemux
 
+# XXX Add unversioned .so files to buildlink directory to
+# avoir build errors with wip/avidemux-plugins.
+.if ${SHLIB_TYPE} != "dylib"
+BUILDLINK_TARGETS+=		buildlink-avidemux-libadm6-so
+
+FFMPEG_VERSIONED_LIBRARIES=	libADM6avcodec.so
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6avformat.so
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6avutil.so
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6postproc.so
+FFMPEG_VERSIONED_LIBRARIES+=	libADM6swscale.so
+
+.PHONY: buildlink-avidemux-libadm6-so
+buildlink-avidemux-libadm6-so:
+.for library in ${FFMPEG_VERSIONED_LIBRARIES}
+	${LN} -s ${PREFIX}/lib/${library} ${BUILDLINK_DIR}/lib/${library}
+.endfor
+.endif
+
 .endif # AVIDEMUX_BUILDLINK3_MK
 
 BUILDLINK_TREE+=	-avidemux
diff --git a/avidemux/distinfo b/avidemux/distinfo
index ae4a13ce40..adf4327e9b 100644
--- a/avidemux/distinfo
+++ b/avidemux/distinfo
@@ -3,3 +3,9 @@ $NetBSD$
 BLAKE2s (avidemux_2.8.1.tar.gz) = 6fb2f7f1f0686ac0fb60374e16347aaf1fdbc6f478369d564f27546ee69cb4aa
 SHA512 (avidemux_2.8.1.tar.gz) = c8df5c0d7f20fd9003560dee7cc0964ba810fc2786cefd525c09fd9f740339dd92a42989938ca48c16aca778ed5bd93a56572b0c6397fe04e47225cc109e7d75
 Size (avidemux_2.8.1.tar.gz) = 26126065 bytes
+SHA1 (patch-avidemux__core_ADM__coreSqlLight3_src_CMakeLists.txt) = c337c46603cb5aacc660160639872615b0d79d76
+SHA1 (patch-avidemux__core_ADM__coreUtils_src_CMakeLists.txt) = ff63a2cf4347e7724aa346bd0cbdbf42b900c7a9
+SHA1 (patch-avidemux__core_ADM__core_src_ADM__crashdump__unix.cpp) = 0a2ceddef061f0bf60bf8267e2c075f6aaf608e9
+SHA1 (patch-avidemux__core_ADM__core_src_ADM__folder__linux.cpp) = d501e2d83dd194db5bc7cb105c9eec38ef6fc806
+SHA1 (patch-avidemux__core_ADM__core_src_ADM__memsupport.cpp) = 69e7d5a52828f87fa64a9d021208b9ea50b2b8ba
+SHA1 (patch-avidemux__core_ADM__core_src_CMakeLists.txt) = 0de8d9e0da1db63861421ae44e693a5ffc2372d4
diff --git a/avidemux/options.mk b/avidemux/options.mk
index 27916ad5ec..33cfd19981 100644
--- a/avidemux/options.mk
+++ b/avidemux/options.mk
@@ -6,11 +6,12 @@ PKG_OPTIONS_OPTIONAL_GROUPS=	qt
 PKG_OPTIONS_GROUP.qt=		qt4 qt5 qt6
 
 ################################################################################
-PKG_SUPPORTED_OPTIONS=		aften aom cli dca faac faad fdk-aac fontconfig \
-				freetype fribidi jack lame libvpx opencore-amr \
-				opus twolame vorbis x264 x265 xvid
+PKG_SUPPORTED_OPTIONS=		aften alsa aom cli dca faac faad fdk-aac \
+				fontconfig freetype fribidi jack lame libvpx \
+				opencore-amr opus oss pulseaudio twolame \
+				vorbis x264 x265 xvid
 PKG_SUGGESTED_OPTIONS=		cli faac faad fontconfig freetype fribidi lame \
-				qt5 vorbis x264 x265 xvid
+				pulseaudio qt5 vorbis x264 x265 xvid
 
 PLIST_VARS+=			${PKG_SUPPORTED_OPTIONS} ${PKG_OPTIONS_GROUP.qt}
 
@@ -37,6 +38,13 @@ PLIST.aften=		yes
 CMAKE_ARGS+=		-DAFTEN:BOOL=OFF
 .endif
 
+.if !empty(PKG_OPTIONS:Malsa)
+PLIST.alsa=		yes
+.include "../../audio/alsa-lib/buildlink3.mk"
+.else
+CMAKE_ARGS+=		-DALSA:BOOL=OFF
+.endif
+
 .if !empty(PKG_OPTIONS:Maom)
 PLIST.aom=		yes
 .include "../../multimedia/libaom/buildlink3.mk"
@@ -137,6 +145,20 @@ PLIST.opus=		yes
 CMAKE_ARGS+=		-DOPUS:BOOL=OFF -DOPUS_ENCODER:BOOL=OFF
 .endif
 
+.if !empty(PKG_OPTIONS:Moss)
+PLIST.oss=		yes
+.include "../../mk/oss.buildlink3.mk"
+.else
+CMAKE_ARGS+=		-DOSS:BOOL=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+PLIST.pulseaudio=	yes
+.include "../../audio/pulseaudio/buildlink3.mk"
+.else
+CMAKE_ARGS+=		-DPULSEAUDIO:BOOL=OFF
+.endif
+
 .if !empty(PKG_OPTIONS:Mqt4)
 PLIST.qt4=		yes
 CMAKE_ARGS+=		-DENABLE_QT4:BOOL=ON
diff --git a/avidemux/patches/patch-avidemux__core_ADM__coreSqlLight3_src_CMakeLists.txt b/avidemux/patches/patch-avidemux__core_ADM__coreSqlLight3_src_CMakeLists.txt
new file mode 100644
index 0000000000..13a38d2dbd
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__coreSqlLight3_src_CMakeLists.txt
@@ -0,0 +1,18 @@
+$NetBSD$
+
+The libdl library seems to be only available on Linux.
+
+--- avidemux_core/ADM_coreSqlLight3/src/CMakeLists.txt.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_coreSqlLight3/src/CMakeLists.txt
+@@ -12,7 +12,11 @@ IF (APPLE)
+ ENDIF (APPLE)
+ 
+ IF (UNIX)
++    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ 	TARGET_LINK_LIBRARIES(ADM_coreSqlLight3 dl)
++    else()
++	target_link_libraries(ADM_coreSqlLight3 m)
++    endif()
+ ENDIF (UNIX)
+ 
+ INCLUDE_DIRECTORIES(../include ${SQLITE3_INCLUDEDIR})
diff --git a/avidemux/patches/patch-avidemux__core_ADM__coreUtils_src_CMakeLists.txt b/avidemux/patches/patch-avidemux__core_ADM__coreUtils_src_CMakeLists.txt
new file mode 100644
index 0000000000..b3fd622ccd
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__coreUtils_src_CMakeLists.txt
@@ -0,0 +1,16 @@
+$NetBSD$
+
+The -ansi compiler option implies that JSON_ISO_STRICT is turned on.
+
+--- avidemux_core/ADM_coreUtils/src/CMakeLists.txt.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_coreUtils/src/CMakeLists.txt
+@@ -28,7 +28,8 @@ ADM_last.cpp
+ )
+ 
+ include_directories(../include Source "${PTHREAD_INCLUDE_DIR}")
+-add_definitions("-std=c++11")
++add_compile_options(-std=c++11)
++add_compile_definitions(JSON_ISO_STRICT)
+ ADM_ADD_SHARED_LIBRARY(ADM_coreUtils6 ${ADM_coreUtils_SRCS})
+ TARGET_LINK_LIBRARIES(ADM_coreUtils6 ADM_json ADM_core6 ADM_coreUI6 ADM_libavutil ADM_libavcodec )
+ 
diff --git a/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__crashdump__unix.cpp b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__crashdump__unix.cpp
new file mode 100644
index 0000000000..1ab1405658
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__crashdump__unix.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+NetBSD does not implement sighandler_t.
+
+--- avidemux_core/ADM_core/src/ADM_crashdump_unix.cpp.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_core/src/ADM_crashdump_unix.cpp
+@@ -40,8 +40,8 @@
+ static ADM_saveFunction *mysaveFunction=NULL;
+ static ADM_fatalFunction *myFatalFunction=NULL;
+ static ADM_sigIntFunction *mySigIntFunction=NULL;
+-static sighandler_t      oldSignalHandlerSigInt;
+-static sighandler_t      oldSignalHandlerSigSev;
++static void (*oldSignalHandlerSigInt)(int);
++static void (*oldSignalHandlerSigSev)(int);
+ void sig_segfault_handler(int signo);
+ void sig_sigint_handler(int signo);
+ 
diff --git a/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__folder__linux.cpp b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__folder__linux.cpp
new file mode 100644
index 0000000000..73f98ef985
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__folder__linux.cpp
@@ -0,0 +1,16 @@
+$NetBSD$
+
+The call canonicalize_file_name(path) is equivalent to the call
+realpath(name, NULL).
+
+--- avidemux_core/ADM_core/src/ADM_folder_linux.cpp.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_core/src/ADM_folder_linux.cpp
+@@ -39,7 +39,7 @@ static std::string ADM_i18nDir;
+ static std::string canonize(const std::string &in)
+ {
+     std::string out;
+-    char *simple2=canonicalize_file_name(in.c_str());
++    char *simple2=realpath(in.c_str(), NULL);
+     if(simple2)
+     {
+         out=std::string(simple2);
diff --git a/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__memsupport.cpp b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__memsupport.cpp
new file mode 100644
index 0000000000..bcdcd98e60
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__core_src_ADM__memsupport.cpp
@@ -0,0 +1,16 @@
+$NetBSD$
+
+memalign(3) is obsolete and not implemented on NetBSD. aligned_alloc(3) is the
+same as memalign(3).
+
+--- avidemux_core/ADM_core/src/ADM_memsupport.cpp.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_core/src/ADM_memsupport.cpp
+@@ -110,7 +110,7 @@ void *ADM_aligned_alloc(size_t size)
+ #ifdef _MSC_VER
+ 	return _aligned_malloc( size,16);
+ #else
+-    return memalign(16,size);
++    return aligned_alloc(16,size);
+ #endif
+ }
+ void ADM_aligned_free(void *ptr)
diff --git a/avidemux/patches/patch-avidemux__core_ADM__core_src_CMakeLists.txt b/avidemux/patches/patch-avidemux__core_ADM__core_src_CMakeLists.txt
new file mode 100644
index 0000000000..12134b38dc
--- /dev/null
+++ b/avidemux/patches/patch-avidemux__core_ADM__core_src_CMakeLists.txt
@@ -0,0 +1,18 @@
+$NetBSD$
+
+The libdl library seems to be only available on Linux.
+
+--- avidemux_core/ADM_core/src/CMakeLists.txt.orig	2022-09-17 13:59:17.000000000 +0000
++++ avidemux_core/ADM_core/src/CMakeLists.txt
+@@ -44,7 +44,11 @@ IF (WIN32)
+ ELSEIF (APPLE)
+ 	target_link_libraries(ADM_core6 "-framework Carbon")
+ elseif (UNIX)
++    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ 	target_link_libraries(ADM_core6 dl m)
++    else()
++	target_link_libraries(ADM_core6 execinfo m)
++    endif()
+ ENDIF (WIN32)
+ 
+ if (HAVE_EXECINFO)


Home | Main Index | Thread Index | Old Index