summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPellegrino Prevete2023-01-11 04:16:47 +0000
committerPellegrino Prevete2023-01-11 04:16:47 +0000
commit337595fbcc9b96f174e096b0e1e7b2d4cb18580b (patch)
tree195b64467da4826becca0da1e56cf2d0e91ddda7
downloadaur-ps2-sdl_gfx.tar.gz
initial release
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD104
2 files changed, 117 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2281123b87d9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = ps2-sdl_gfx
+ pkgdesc = SDL graphics drawing primitives and other support functions (Sony Playstation® 2 videogame system port).
+ pkgver = 2.0.13
+ pkgrel = 1
+ url = https://github.com/ps2dev/ps2sdk-ports
+ arch = x86_64
+ license = LGPL
+ makedepends = ps2-sdk
+ makedepends = ps2-sdl
+ source = ps2-sdl_gfx::git+https://github.com/ps2dev/ps2sdk-ports#commit=e3f9bfd51e3266b3c68de19b76f6d378f6ec643b
+ sha256sums = SKIP
+
+pkgname = ps2-sdl_gfx
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b170218b3a57
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,104 @@
+# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>
+
+# shellcheck disable=SC2034
+_arch="mips"
+_platform="ps2"
+_iop="${_arch}el-${_platform}"
+_ee="${_arch}64r5900el-${_platform}-elf"
+_base="sdk"
+_ns="${_platform}${_base}"
+_pkgbase="${_platform}${_base}-ports"
+_pkg="sdlgfx"
+pkg="sdl_gfx"
+pkgname="${_platform}-${pkg}"
+pkgver="2.0.13"
+pkgrel=1
+_pkgdesc=("SDL graphics drawing primitives and other support functions "
+ "(Sony Playstation® 2 videogame system port).")
+pkgdesc="${_pkgdesc[*]}"
+arch=('x86_64')
+license=('LGPL')
+_ns="${_platform}${_base}"
+_github="https://github.com/ps2dev"
+_local="ssh://git@127.0.0.1:/home/git"
+url="${_github}/${_pkgbase}"
+makedepends=("${_platform}-sdk"
+ "${_platform}-sdl")
+optdepends=()
+_commit="e3f9bfd51e3266b3c68de19b76f6d378f6ec643b"
+source=("${pkgname}::git+${url}#commit=${_commit}")
+# source=("${pkgname}::git+${_local}/${pkgname}#commit=${_commit}")
+sha256sums=('SKIP')
+
+_ee_include="/usr/${_ee}/include"
+_ee_lib="/usr/${_ee}/lib"
+_sdk_include="/usr/include/${_platform}${_base}"
+_pe_include="/usr/${_ee}/include/pthread-embedded"
+_pe_lib="/usr/${_ee}/lib/pthread-embedded"
+
+prepare() {
+ cd "${srcdir}/${pkgname}"
+ local _mf _rep
+ local _mfs=($(find . | grep Makefile))
+ local _reps=("s~include \$(PS2SDK)/samples~include \$(PS2SDKDATADIR)/samples~g"
+ "s~\$(PS2SDK)/bin/bin2c~/usr/bin/bin2c~g"
+ "s~\$(PS2DEV)/isjpcm/bin~/usr/${_iop}\-irx/irx~g"
+ "s~-I\$(PS2DEV)/isjpcm/include~-include ${_ee_include}/sjpcm.h~g"
+ "s~-L\$(PS2DEV)/isjpcm/lib~${_ee_lib}/libsjpcm.a~g"
+ "s~-L\$(PS2SDK)/ee/lib~-L${_ee_lib}~g"
+ "s~-I\$(PS2SDK)/common/include~-I${_sdk_include}~g"
+ "s~-I\$(PS2SDK)/ee/include~-I${_ee_include}~g"
+ "s~-I\$(PS2SDK)/ports/include~-I${_ee_include}~g"
+ "s~-L\$(PS2SDK)/ports/lib~-L${_ee_lib} -r ~g"
+ "s~\$(PS2SDK)/iop/irx~/usr/${_iop}-irx/irx~g"
+ "s~\$(PS2SDK)/ee/lib~${_ee_lib}~g")
+
+ for _mf in "${_mfs[@]}"; do
+ for _rep in "${_reps[@]}"; do
+ sed -i "${_rep}" "${_mf}"
+ done
+ done
+ # sed -i "/strncasecmp/d" "madplay/ee/src/global.h"
+}
+
+build() {
+ export CFLAGS=""
+ export CXXFLAGS=""
+ export CPPFLAGS=""
+ export LDFLAGS=""
+ export IOP_CC=""
+ export EE_CC=""
+ export EE_INCS=""
+ export EE_CFLAGS=""
+ export EE_CFLAGS=""
+ export PS2SDKDATADIR=""
+
+ export PS2SDK="/usr"
+ export GSKIT="/usr/${_ee}"
+ export PS2SDKDATADIR="/usr/share/ps2sdk"
+
+ local _make_opts=(PS2SDKDATADIR="/usr/share/${_platform}${_base}"
+ GSKIT="/usr/${_ee}")
+
+ cd "${srcdir}/${pkgname}"
+ PS2SDKDATADIR="/usr/share/ps2sdk" \
+ GSKIT="/usr/${_ee}" \
+ make "${_make_opts[@]}" -C "${_pkg}"
+}
+
+# shellcheck disable=SC2154
+package() {
+
+ export CFLAGS=""
+ export CXXFLAGS=""
+ export CPPFLAGS=""
+ export LDFLAGS=""
+
+ local _make_opts=(PS2SDKDATADIR="/usr/share/${_platform}${_base}"
+ DESTDIR="${pkgdir}")
+
+ cd "${srcdir}/${pkgname}/"
+ make "${_make_opts[@]}" -C "${_pkg}" install
+ cd "${pkgdir}/usr"
+ mv "ports" "${_ee}"
+}