Skip to content

Commit

Permalink
ports: WIP sdl2 and sdl2_image ports / dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
byteduck committed Apr 11, 2024
1 parent af01684 commit 104556e
Show file tree
Hide file tree
Showing 18 changed files with 869 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ports/libjpeg/build.sh
@@ -0,0 +1,7 @@
#!/bin/bash
LIBJPEG_VER=9d
export DOWNLOAD_URL="https://ijg.org/files/jpegsrc.v$LIBJPEG_VER.tar.gz"
export DOWNLOAD_FILE="jpeg-$LIBJPEG_VER"
export PATCH_FILES=("config.sub.patch")
export USE_CONFIGURE="true"
export CONFIGURE_OPTIONS=("--disable-static" "--enable-shared")
12 changes: 12 additions & 0 deletions ports/libjpeg/config.sub.patch
@@ -0,0 +1,12 @@
diff --git a/config.sub b/config.sub
index 9ccf09a..63e2585 100755
--- a/config.sub
+++ b/config.sub
@@ -1364,6 +1364,7 @@ case $os in
# Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -duckos* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
8 changes: 8 additions & 0 deletions ports/libpng/build.sh
@@ -0,0 +1,8 @@
#!/bin/bash
LIBPNG_VER=1.6.40
export DOWNLOAD_URL="https://download.sourceforge.net/libpng/libpng-$LIBPNG_VER.tar.gz"
export DOWNLOAD_FILE="libpng-$LIBPNG_VER"
export PATCH_FILES=("config.sub.patch" "libtool-configure.patch")
export USE_CONFIGURE="true"
export CONFIGURE_OPTIONS=("--disable-static" "--enable-shared")
export DEPENDENCIES=("zlib")
12 changes: 12 additions & 0 deletions ports/libpng/config.sub.patch
@@ -0,0 +1,12 @@
diff --git a/config.sub b/config.sub
index d74fb6d..467efe1 100755
--- a/config.sub
+++ b/config.sub
@@ -1719,6 +1719,7 @@ case $os in
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | duckos* \
| *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
54 changes: 54 additions & 0 deletions ports/libpng/libtool-configure.patch
@@ -0,0 +1,54 @@
diff --git a/configure b/configure
index 668c3dd..8b0d98a 100755
--- a/configure
+++ b/configure
@@ -8649,6 +8649,9 @@ tpf*)
os2*)
lt_cv_deplibs_check_method=pass_all
;;
+duckos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac

fi
@@ -12125,6 +12128,10 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;

+ duckos*)
+ lt_prog_compiler_can_build_shared='yes'
+ ;;
+
*)
lt_prog_compiler_can_build_shared=no
;;
@@ -13657,6 +13664,10 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; }
hardcode_shlibpath_var=no
;;

+ duckos*)
+ ld_shlibs=yes
+ ;;
+
*)
ld_shlibs=no
;;
@@ -14281,6 +14292,17 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;

+duckos*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='duckOS linker'
+ ;;
+
freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
8 changes: 8 additions & 0 deletions ports/libtiff/build.sh
@@ -0,0 +1,8 @@
#!/bin/bash
LIBTIFF_VER=4.2.0
export DOWNLOAD_URL="http://download.osgeo.org/libtiff/tiff-$LIBTIFF_VER.tar.gz"
export DOWNLOAD_FILE="tiff-$LIBTIFF_VER"
export PATCH_FILES=("libtiff.patch")
export USE_CONFIGURE="true"
export DEPENDENCIES=("libjpeg" "zstd" "xz")
export CONFIGURE_OPTIONS=("--disable-static" "--enable-shared")
84 changes: 84 additions & 0 deletions ports/libtiff/libtiff.patch
@@ -0,0 +1,84 @@
diff --git a/config/config.sub b/config/config.sub
index 7ffe373..e62f766 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1369,6 +1369,7 @@ case $os in
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -duckos* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
diff --git a/configure b/configure
index 96362da..5870c55 100755
--- a/configure
+++ b/configure
@@ -6240,6 +6240,9 @@ tpf*)
os2*)
lt_cv_deplibs_check_method=pass_all
;;
+duckos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac

fi
@@ -9820,6 +9823,10 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;

+ duckos*)
+ lt_prog_compiler_can_build_shared=yes
+ ;;
+
*)
lt_prog_compiler_can_build_shared=no
;;
@@ -10923,6 +10930,10 @@ fi
hardcode_shlibpath_var=no
;;

+ duckos*)
+ ld_shlibs=yes
+ ;;
+
hpux9*)
if test yes = "$GCC"; then
archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
@@ -11961,6 +11972,17 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;

+duckos*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='duckOS linker'
+ ;;
+
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -16786,6 +16808,17 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;

+duckos*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='duckOS linker'
+ ;;
+
*)
dynamic_linker=no
;;
13 changes: 13 additions & 0 deletions ports/sdl2/build.sh
@@ -0,0 +1,13 @@
#!/bin/bash
SDL2_VER="2.30.2"
export DOWNLOAD_URL="https://github.com/libsdl-org/SDL/releases/download/release-$SDL2_VER/SDL2-$SDL2_VER.tar.gz"
export DOWNLOAD_FILE="SDL2-$SDL2_VER"
export USE_CONFIGURE="false"
export PATCH_FILES=("sdl2.patch")
export DEPENDENCIES=("libiconv")

prebuild() {
cmake "-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake-build/CMakeToolchain.txt" \
"-DPULSEAUDIO=OFF" "-DJACK=OFF" "-DPIPEWIRE=OFF" "-DSDL_LIBSAMPLERATE=OFF" \
"$DOWNLOAD_FILE"
}

0 comments on commit 104556e

Please sign in to comment.