From 2fecdfe4593471d5ec228ea0c4abf93e28856fa3 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Sun, 17 Nov 2024 22:17:25 +0300
Subject: [PATCH] Fix normal netbsd 10 amd64 build

---
 cinelerra-5.1/blds/netbsd.bld  | 6 +++---
 cinelerra-5.1/configure.ac     | 5 ++++-
 cinelerra-5.1/guicast/Makefile | 6 +++++-
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/cinelerra-5.1/blds/netbsd.bld b/cinelerra-5.1/blds/netbsd.bld
index 0e2c97a6..b121e0f8 100755
--- a/cinelerra-5.1/blds/netbsd.bld
+++ b/cinelerra-5.1/blds/netbsd.bld
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/usr/pkg/bin/bash
 #patch not needed anymore
-export CONFIG_SHELL=/bin/bash
+export CONFIG_SHELL=/usr/pkg/bin/bash
 export MAKE=gmake
 export C_INCLUDE_PATH=/usr/local/include:/usr/X11R7/include:/usr/pkg/include:/usr/pkg/include/ffmpeg6
 export CPLUS_INCLUDE_PATH=/usr/local/include
@@ -9,7 +9,7 @@ export LDFLAGS="-L/usr/X11R7/lib -L/usr/pkg/lib -L/usr/pkg/lib/ffmpeg6 "
 export CFLAGS1="-I/usr/pkg/include -I/usr/pkg/include/ffmpeg6 -pthread -I/usr/pkg/include -I/usr/pkg/include/OpenEXR -I/usr/pkg/include -I/usr/pkg/include/Imath"
 
 alias make=gmake
-( ./autogen.sh
+( bash ./autogen.sh
   BSD=1 CC=gcc CXX=g++ CFLAGS=" ${CFLAGS1} -g -fpermissive -O2" \
   ./configure --with-single-user \
     --disable-static-build --without-lv2 --disable-lame --disable-twolame \
diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index a1b1dabd..c48b64e1 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -1203,8 +1203,11 @@ AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 
 exec > global_config
-
+if test [ "$(uname)"] = "NetBSD" ; then
+echo "SHELL := /usr/pkg/bin/bash"
+else
 echo "SHELL := /bin/bash"
+fi
 echo "export SHELL"
 echo "WANT_JOBS := $WANT_JOBS"
 if test "x$WANT_CLANG" = "xyes" ; then
diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 49bd154c..67116252 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -130,7 +130,11 @@ python = $(shell which python)
 endif
 
 ifeq ($(python),)
-python += $(shell which python3.9)
+python = $(shell which python3.9)
+endif
+
+ifeq ($(python),)
+python = $(shell which python3.12)
 endif
 
 
-- 
2.46.1

