Monday, 29 April 2019

[gccsdk] Updated SDL recipes

Index: libraries/sdl/libsdl-gfx1.2/setvars
===================================================================
--- libraries/sdl/libsdl-gfx1.2/setvars (revision 7231)
+++ libraries/sdl/libsdl-gfx1.2/setvars (working copy)
@@ -2,6 +2,12 @@
AB_ROVERSION=2
AB_CONFLAGS=--disable-mmx

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-gfx1.2-dev libsdl-gfx1.2"
+else
+AB_PACKAGES="libsdl-gfx1.2-dev"
+fi
+
ab_package() {
ab_create_app SDLGFX Apps/Library libsdl-gfx1.2-dev

@@ -25,6 +31,14 @@

cd $HERE

- $AB_HOME/add-riscpkg -unixlib -name LibSDLGFX1.2-Dev \
+ $AB_HOME/add-riscpkg -unixlib -package libsdl-gfx1.2-dev -name LibSDLGFX1.2-Dev \
-depends "LibSDL1.2-Dev"
+
+ if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+ ab_create_sharedlib_skeleton libsdl-gfx1.2
+ ab_add_sharedlib $S/.libs libSDL_gfx.so.15
+
+ $AB_HOME/add-riscpkg -package libsdl-gfx1.2 -name LibSDLGFX1.2 -depends SharedLibs \
+ -depends "LibSDL1.2" -section Library -copyrightfile $H/Copyright
+ fi
}
Index: libraries/sdl/libsdl-image1.2/depends
===================================================================
--- libraries/sdl/libsdl-image1.2/depends (revision 7231)
+++ libraries/sdl/libsdl-image1.2/depends (working copy)
@@ -1 +1,4 @@
libsdl1.2debian
+libjpeg8
+libpng16-16
+libtiff5
Index: libraries/sdl/libsdl-image1.2/setvars
===================================================================
--- libraries/sdl/libsdl-image1.2/setvars (revision 7231)
+++ libraries/sdl/libsdl-image1.2/setvars (working copy)
@@ -1,8 +1,14 @@
-AB_CONFLAGS="--enable-tif --enable-xmf --disable-png-shared --disable-tiff-shared --disable-jpg-shared"
+AB_CONFLAGS="--disable-png-shared --disable-tif-shared --disable-jpg-shared"
AB_ROVERSION=2

AB_INSTALL=yes

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-image1.2-dev libsdl-image1.2"
+else
+AB_PACKAGES="libsdl-image1.2-dev"
+fi
+
ab_package() {
ab_create_app SDLImage Apps/Library libsdl-image1.2-dev

@@ -29,15 +35,17 @@
cp $S/showimage.c $A/doc
cp $S/showimage$AB_EXEEXT $A

- $AB_HOME/add-riscpkg -unixlib -name LibSDLImage1.2-Dev \
+ $AB_HOME/add-riscpkg -unixlib -package libsdl-image1.2-dev -name LibSDLImage1.2-Dev \
-depends "LibJPEG8-Dev" -depends "LibPNG16-Dev" \
-depends "LibTIFF5-Dev" -depends "LibSDL1.2-Dev"

if [ "$RO_SHAREDLIBS" == "yes" ] ; then
- ab_create_sharedlib_skeleton libsdlimage1.2
+ ab_create_sharedlib_skeleton libsdl-image1.2
ab_add_sharedlib $S/.libs libSDL_image-1.2.so.0

- $AB_HOME/add-riscpkg -package libsdlimage1.2 -name LibSDLImage1.2 -depends SharedLibs \
+ $AB_HOME/add-riscpkg -package libsdl-image1.2 -name LibSDLImage1.2 -depends SharedLibs \
+ -depends "LibJPEG8" -depends "LibPNG16-16" \
+ -depends "LibTiff5" -depends "LibSDL1.2" \
-section Library -copyrightfile $H/Copyright
fi

Index: libraries/sdl/libsdl-mixer1.2/setvars
===================================================================
--- libraries/sdl/libsdl-mixer1.2/setvars (revision 7231)
+++ libraries/sdl/libsdl-mixer1.2/setvars (working copy)
@@ -1,9 +1,15 @@
AB_INSTALL=yes
AB_ROVERSION=2

-# Use internal mikmod modules, disable smpeg as we don't build it
-AB_CONFLAGS="--disable-music-mod-shared --disable-music-libmikmod --disable-music-flac --disable-music-mp3 --enable-music-ogg-tremor --disable-music-ogg-shared"
+# Disable smpeg, FLAC and FluidSynth as we don't build them.
+AB_CONFLAGS="--disable-music-mod-shared --disable-music-midi-fluidsynth --disable-music-flac --disable-music-mp3 --enable-music-ogg-tremor --disable-music-ogg-shared"

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-mixer1.2-dev libsdl-mixer1.2"
+else
+AB_PACKAGES="libsdl-mixer1.2-dev"
+fi
+
ab_package() {
ab_create_app SDLMixer Apps/Library libsdl-mixer1.2-dev

@@ -31,6 +37,15 @@

$AB_HOME/add-riscpkg -package libsdl-mixer1.2-dev -unixlib -name LibSDLMixer1.2-Dev -copyrightfile $S/COPYING \
-depends "Tremor-Dev" -depends "LibSDL1.2-Dev" -depends "LibMikMod-Dev"
+
+ if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+ ab_create_sharedlib_skeleton libsdl-mixer1.2
+ ab_add_sharedlib $S/.libs libSDL_mixer-1.2.so.0
+
+ $AB_HOME/add-riscpkg -package libsdl-mixer1.2 -name LibSDLMixer1.2 -depends SharedLibs \
+ -name LibSDL1.2 -depends Tremor -depends LibMikmod -section Library \
+ -copyrightfile $H/Copyright
+ fi
}

export LIBS='-logg'
Index: libraries/sdl/libsdl-net1.2/setvars
===================================================================
--- libraries/sdl/libsdl-net1.2/setvars (revision 7231)
+++ libraries/sdl/libsdl-net1.2/setvars (working copy)
@@ -6,6 +6,12 @@

export SED=sed

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-net1.2-dev libsdl-net1.2"
+else
+AB_PACKAGES="libsdl-net1.2-dev"
+fi
+
ab_package()
{
ab_create_app SDLNet Apps/Library libsdl-net1.2-dev
@@ -30,6 +36,15 @@

cd $HERE

- $AB_HOME/add-riscpkg -unixlib -name LibSDLNet1.2-Dev \
+ $AB_HOME/add-riscpkg -unixlib -package libsdl-net1.2-dev -name LibSDLNet1.2-Dev \
-depends "LibSDL1.2-Dev" -depver "1.2.15-2"
+
+ if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+ ab_create_sharedlib_skeleton libsdl-net1.2
+ ab_add_sharedlib $S/.libs libSDL_net-1.2.so.0
+
+ $AB_HOME/add-riscpkg -package libsdl-net1.2 -name LibSDLNet1.2 -depends SharedLibs \
+ -depends "LibSDL1.2" -depver "1.2.15-2" \
+ -section Library -copyrightfile $H/Copyright
+ fi
}
Index: libraries/sdl/libsdl-sound1.2/depends
===================================================================
--- libraries/sdl/libsdl-sound1.2/depends (revision 7231)
+++ libraries/sdl/libsdl-sound1.2/depends (working copy)
@@ -1 +1,6 @@
-libsdl1.2debian
\ No newline at end of file
+libsdl1.2debian
+libflac8
+libmikmod3
+libogg0
+libvorbis0a
+libspeex1
Index: libraries/sdl/libsdl-sound1.2/setvars
===================================================================
--- libraries/sdl/libsdl-sound1.2/setvars (revision 7231)
+++ libraries/sdl/libsdl-sound1.2/setvars (working copy)
@@ -1,6 +1,14 @@
AB_INSTALL=yes
AB_ROVERSION=2

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-sound1.2-dev libsdl-sound1.2"
+else
+AB_PACKAGES="libsdl-sound1.2-dev"
+fi
+
+export LIBS="-lvorbis -logg"
+
ab_package()
{
ab_create_app SDLSound Apps/Library libsdl-sound1.2-dev
@@ -25,8 +33,19 @@

cd $HERE

- $AB_HOME/add-riscpkg -unixlib -unixsound -name LibSDLSound1.2-Dev \
+ $AB_HOME/add-riscpkg -unixlib -package libsdl-sound1.2-dev -name LibSDLSound1.2-Dev \
-depends "LibSDL1.2-Dev" -depends "LibFlac-Dev" \
-depends "LibMikMod-Dev" -depends "LibOGG-Dev" \
- -depends "LibVorbis-Dev"
+ -depends "LibVorbis-Dev" -depends "LibSpeex-Dev"
+
+ if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+ ab_create_sharedlib_skeleton libsdl-sound1.2
+ ab_add_sharedlib $S/.libs libSDL_sound-1.0.so.1
+
+ $AB_HOME/add-riscpkg -package libsdl-sound1.2 -name LibSDLSound1.2 -section Library \
+ -depends SharedLibs \
+ -depends "LibSDL1.2" -depends "LibFlac" \
+ -depends "LibMikmod" -depends "LibOgg" \
+ -depends "LibVorbis" -depends "LibSpeex1"
+ fi
}
Index: libraries/sdl/libsdl-ttf2.0-0/depends
===================================================================
--- libraries/sdl/libsdl-ttf2.0-0/depends (revision 7231)
+++ libraries/sdl/libsdl-ttf2.0-0/depends (working copy)
@@ -1,5 +1,2 @@
libfreetype6
libsdl1.2debian
-libpng16-16
-libjpeg8
-libtiff5
Index: libraries/sdl/libsdl-ttf2.0-0/setvars
===================================================================
--- libraries/sdl/libsdl-ttf2.0-0/setvars (revision 7231)
+++ libraries/sdl/libsdl-ttf2.0-0/setvars (working copy)
@@ -3,6 +3,12 @@

./autogen.sh

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl-ttf2.0-dev libsdl-ttf2.0"
+else
+AB_PACKAGES="libsdl-ttf2.0-dev"
+fi
+
ab_package() {
ab_create_app SDLTTF Apps/Library libsdl-ttf2.0-dev

@@ -26,16 +32,17 @@

cd $HERE

- $AB_HOME/add-riscpkg -unixlib -name LibSDLTTF2.0-Dev \
+ $AB_HOME/add-riscpkg -unixlib -package libsdl-ttf2.0-dev -name LibSDLTTF2.0-Dev \
-depends "LibFreeType6-Dev" \
-depends "LibSDL1.2-Dev"

if [ "$RO_SHAREDLIBS" == "yes" ] ; then
- ab_create_sharedlib_skeleton libsdlttf2
+ ab_create_sharedlib_skeleton libsdl-ttf2.0
ab_add_sharedlib $S/.libs libSDL_ttf-2.0.so.0
-
- $AB_HOME/add-riscpkg -package libsdlttf2 -name LibSDLTTF2 -depends SharedLibs \
- -section Library -copyrightfile $H/Copyright
+
+ $AB_HOME/add-riscpkg -package libsdl-ttf2.0 -name LibSDLTTF2 -depends SharedLibs \
+ -depends LibFreeType6 -name LibSDL1.2 -section Library \
+ -copyrightfile $H/Copyright
fi
}

Index: libraries/sdl/libsdl1.2debian/setvars
===================================================================
--- libraries/sdl/libsdl1.2debian/setvars (revision 7231)
+++ libraries/sdl/libsdl1.2debian/setvars (working copy)
@@ -1,47 +1,80 @@
-AB_ROVERSION=3
+AB_HG=https://hg.libsdl.org/SDL/
+AB_HG_BRANCH=SDL-1.2
+AB_PVERSION=1.2.15
+AB_ROVERSION=4


AB_INSTALLDOCS="COPYING README README.RISCOS README-SDL.txt WhatsNew"
AB_SHORTDESC="Allows programs portable low level access to a video, audio, mouse, and keyboard"

-AB_INSTALL=yes
+# AB_INSTALL=yes
+AB_DISTCLEAN="rm -rf build build-vfp"

-# Package script uses installed library
-# zip built due to AB_INSTALL=yes
+# Build normal and VFP versions by default.
+BUILD_NORMAL=yes
+BUILD_VFP=yes

+if [ "$RO_SHAREDLIBS" == "yes" ] ; then
+AB_PACKAGES="libsdl1.2-dev libsdl1.2"
+else
+AB_PACKAGES="libsdl1.2-dev"
+fi
+
+./autogen.sh
+
+if [ "$BUILD_NORMAL" == "yes" ]; then
+ mkdir -p $S/build
+ ( cd $S/build; ENABLE_VFP=no $AB_CONFIG)
+fi
+
+if [ "$BUILD_VFP" == "yes" ]; then
+ mkdir -p $S/build-vfp
+ ( cd $S/build-vfp; CFLAGS="-mfpu=vfp -O3" $AB_CONFIG --prefix=$GCCSDK_INSTALL_ENV/vfp )
+fi
+
+ab_make() {
+ $AB_MAKE -C build $@
+ $AB_MAKE -C build install
+ $AB_MAKE -C build-vfp $@
+ $AB_MAKE -C build-vfp install
+}
+
ab_package() {
ab_create_app SDL Apps/Library libsdl1.2-dev

- HERE=`pwd`
- cd $A
- unzip $AB_OUTPUTLIB/$RO_PKG.zip
-
# Need to retype the converted manual files
- MANFILES=$(find man -type f)
- for FILE in $MANFILES ; do
- mv $FILE $FILE,faf
- done
+ #MANFILES=$(find man -type f)
+ #for FILE in $MANFILES ; do
+ # mv $FILE $FILE,faf
+ #done

- # Move headers libs and docs up one directory
- mv include/SDL SDL
- rm -rf include
- mv lib/*.a .
- rm -rf lib
+ ab_add_headers $GCCSDK_INSTALL_ENV/include/SDL $A/SDL

- cd doc
- docdir=`echo *`
- mv $docdir/* .
- rm -rf $docdir
+ if [ "$BUILD_NORMAL" == "yes" ] ; then
+ if [ -d "$S/build/build/.libs/" ]; then
+ cp -f $S/build/build/.libs/*.a $A
+ else
+ cp -f $S/build/build/*.a $A
+ fi
+ fi
+ if [ "$BUILD_VFP" == "yes" ] ; then
+ mkdir -p $A/vfp
+ if [ -d "$S/build-vfp/build/.libs/" ]; then
+ cp -f $S/build-vfp/build/.libs/*.a $A/vfp
+ else
+ cp -f $S/build-vfp/build/*.a $A/vfp
+ fi
+ fi

- cd $HERE
+ mkdir $A/doc
+ for i in $AB_INSTALLDOCS; do cp $S/$i $A/doc/$i,fff; done

- $AB_HOME/add-riscpkg -unixlib -name LibSDL1.2-Dev
+ $AB_HOME/add-riscpkg -unixlib -unixsound -package libsdl1.2-dev -name LibSDL1.2-Dev

-
if [ "$RO_SHAREDLIBS" == "yes" ] ; then
ab_create_sharedlib_skeleton libsdl1.2
ab_add_sharedlib $S/build/.libs libSDL-1.2.so.0
-
+
$AB_HOME/add-riscpkg -package libsdl1.2 -name LibSDL1.2 -depends SharedLibs \
- -section Library -copyrightfile $H/Copyright
+ -unixsound -section Library -copyrightfile $H/Copyright
fi
}
Hi

Attached is an updated recipe for SDL and its related libraries. The following changes are made:

 - SDL is now built from Mercurial instead of from the release archive provided by Debian.
 - SDL is now build with a VFP version as well as a regular version.
 - All libraries now package shared libraries.
 - All packages have the proper dependencies added.
 - SDL_sound is now built with libspeex.

In addition, I've also submitted a number of patches to the SDL Bugzilla, and I would appreciate it if someone more experienced than I am could take a look at them. The patches can be found at https://bugzilla.libsdl.org/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&op_sys=RISC%20OS&query_format=advanced

This also depends on this patch (http://www.riscos.info/pipermail/gcc/2019-January/006815.html) which I submitted a while ago, but hasn't been committed yet.

Regards
Cameron

No comments:

Post a Comment