From 8b04c1e81fddd6af95516fb700fa57e18e16a8e1 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Thu, 12 Jan 2023 10:20:12 +0000
Subject: [PATCH 2/3] Second round of netbsd fixes

---
 cinelerra-5.1/cinelerra/Makefile |  5 ++++-
 cinelerra-5.1/configure.ac       | 16 ++++++++++++++++
 cinelerra-5.1/plugins/Makefile   | 12 ++++++++++--
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
index e293d3dd..5c358569 100644
--- a/cinelerra-5.1/cinelerra/Makefile
+++ b/cinelerra-5.1/cinelerra/Makefile
@@ -437,7 +437,10 @@ ifeq ($(WANT_CIN_3RDPARTY),no)
 LIBS += -lavfilter -lavformat -lavcodec -lavutil
 LIBS += -lswresample -lswscale
 PLATFORM = $(shell uname -s)
-ifneq (, $(filter $(PLATFORM), FreeBSD NetBSD))
+ifneq (, $(filter $(PLATFORM), NetBSD))
+LIBS += -lintl
+endif
+ifneq (, $(filter $(PLATFORM), FreeBSD))
 LIBS += -lintl -liconv
 LIBS += -lexecinfo
 endif
diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index f7415a2b..8839af99 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -1274,6 +1274,22 @@ if test "x$BSD" != "x" ; then
   echo "CFLAGS += -DNO_GDB"
 fi
 
+if test [ "$(uname)"] = "NetBSD" ; then
+echo "CFLAGS += -DNO_BTRACE"
+echo "CFLAGS += -DNO_CTX"
+echo "system_libs += -L/usr/pkg/lib/ffmpeg4"
+echo "system_libs += -L/usr/pkg/lib/"
+echo "system_libs += -lpng16"
+echo "system_libs += -lintl"
+echo "system_libs += -lossaudio"
+echo "CFLAGS += -I/usr/X11R7/include"
+echo "CFLAGS += -I/usr/pkg/include/ffmpeg4"
+echo "CFLAGS += $(pkg-config --cflags xft)"
+echo "CFLAGS += -I/usr/pkg/include"
+echo "CFLAGS += -I/usr/pkg/include/uuid"
+
+fi
+
 if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
   X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
 fi
diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
index 227faf80..9c3a6a30 100644
--- a/cinelerra-5.1/plugins/Makefile
+++ b/cinelerra-5.1/plugins/Makefile
@@ -170,9 +170,17 @@ DIRS = $(OPENCV_OBJS) \
 	theme_unflat \
 	theme_cakewalk \
 
-PLATFORM = $(shell uname -o)
+PLATFORM = $(shell uname)
+ifneq ($(PLATFORM), NetBSD)
+DIRS += cdripper theme_blond theme_blue
+endif
+
 ifneq ($(PLATFORM), FreeBSD)
-DIRS += cdripper theme_blond theme_blue 
+DIRS += theme_blond theme_blue 
+endif
+
+ifeq ($(PLATFORM), Linux)
+DIRS += cdripper
 endif
 
 # not maintained
-- 
2.34.1

