diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9af82f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ags-v.3.4.4.1.tar.xz diff --git a/ags-clean-source.sh b/ags-clean-source.sh new file mode 100755 index 0000000..6f749df --- /dev/null +++ b/ags-clean-source.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e -x + +tmp=$(mktemp -d) + +trap cleanup EXIT +cleanup() { + set +e + [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" +} + +unset CDPATH +pwd=$(pwd) +ver=3.4.4.1 +fver=v.${ver} +dirname=ags-${fver} + +cd "$tmp" +wget https://github.com/adventuregamestudio/ags/archive/${fver}/ags-${fver}.tar.gz +tar xzf ags-${fver}.tar.gz +cd $dirname +rm Engine/libsrc/libcda-0.5/{bcd.doc,djgpp.c} +cd .. +tar Jcf "$pwd"/$dirname.tar.xz $dirname +cd - > /dev/null diff --git a/ags-use-system-alfont.patch b/ags-use-system-alfont.patch new file mode 100644 index 0000000..a1ad99b --- /dev/null +++ b/ags-use-system-alfont.patch @@ -0,0 +1,61 @@ +diff -up ags-v.3.4.4.1/Common/font/ttffontrenderer.cpp.alfont ags-v.3.4.4.1/Common/font/ttffontrenderer.cpp +--- ags-v.3.4.4.1/Common/font/ttffontrenderer.cpp.alfont 2019-09-25 18:48:18.000000000 +0200 ++++ ags-v.3.4.4.1/Common/font/ttffontrenderer.cpp 2019-10-02 11:51:57.716766800 +0200 +@@ -108,22 +108,6 @@ bool TTFFontRenderer::LoadFromDiskEx(int + if (alfptr == NULL) + return false; + +- // TODO: move this somewhere, should not be right here +-#if !defined(WINDOWS_VERSION) +- // FIXME: (!!!) this fix should be done differently: +- // 1. Find out which OUTLINE font was causing troubles; +- // 2. Replace outline method ONLY if that troublesome font is used as outline. +- // 3. Move this fix somewhere else!! (right after game load routine?) +- // +- // Check for the LucasFan font since it comes with an outline font that +- // is drawn incorrectly with Freetype versions > 2.1.3. +- // A simple workaround is to disable outline fonts for it and use +- // automatic outline drawing. +- if (get_font_outline(fontNumber) >=0 && +- strcmp(alfont_get_name(alfptr), "LucasFan-Font") == 0) +- set_font_outline(fontNumber, FONT_OUTLINE_AUTO); +-#endif +- + if (fontSize > 0) + alfont_set_font_size(alfptr, fontSize); + +diff -up ags-v.3.4.4.1/Engine/Makefile.alfont ags-v.3.4.4.1/Engine/Makefile +--- ags-v.3.4.4.1/Engine/Makefile.alfont 2019-10-02 11:51:57.716766800 +0200 ++++ ags-v.3.4.4.1/Engine/Makefile 2019-10-02 11:52:34.423037996 +0200 +@@ -13,7 +13,7 @@ include Makefile-defs.linux + endif + + include Makefile-objs +-OBJS_C_CPP = $(ALFONT) $(ALMP3) $(ALOGG) $(APEG) $(AASTR) $(HQ2X3X) $(AL_MIDI_PATCH) $(CDA) $(GLAD) $(PLUGINS) $(BASE) $(BASE_PLATFORM) ++OBJS_C_CPP = $(ALMP3) $(ALOGG) $(APEG) $(AASTR) $(HQ2X3X) $(AL_MIDI_PATCH) $(CDA) $(GLAD) $(PLUGINS) $(BASE) $(BASE_PLATFORM) + OBJS_C = $(OBJS_C_CPP:.cpp=.o) + OBJS = $(OBJS_C:.c=.o) + +diff -up ags-v.3.4.4.1/Engine/Makefile-defs.linux.alfont ags-v.3.4.4.1/Engine/Makefile-defs.linux +--- ags-v.3.4.4.1/Engine/Makefile-defs.linux.alfont 2019-09-25 18:48:18.000000000 +0200 ++++ ags-v.3.4.4.1/Engine/Makefile-defs.linux 2019-10-02 11:51:57.717766808 +0200 +@@ -4,6 +4,7 @@ CFLAGS := -O2 -g -fsigned-char -Wfatal-e + CXXFLAGS := -fno-rtti -Wno-write-strings $(CXXFLAGS) + LIBS := -rdynamic -laldmb -ldumb -Wl,-Bdynamic + LIBS += $(shell pkg-config --libs allegro) ++LIBS += -lalfont + LIBS += $(shell pkg-config --libs x11) + LIBS += $(shell pkg-config --libs ogg) + LIBS += $(shell pkg-config --libs theora) +diff -up ags-v.3.4.4.1/Engine/Makefile-objs.alfont ags-v.3.4.4.1/Engine/Makefile-objs +--- ags-v.3.4.4.1/Engine/Makefile-objs.alfont 2019-09-25 18:48:18.000000000 +0200 ++++ ags-v.3.4.4.1/Engine/Makefile-objs 2019-10-02 11:51:57.717766808 +0200 +@@ -59,8 +59,6 @@ PLUGINS = ../Plugins/AGSflashlight/agsfl + + HQ2X3X = libsrc/hq2x/hq2x3x.cpp + +-ALFONT = libsrc/alfont-2.0.9/alfont.c +- + ALMP3 = libsrc/almp3/almp3.c libsrc/almp3-2.0.5/decoder/common.c libsrc/almp3-2.0.5/decoder/dct64_i386.c libsrc/almp3-2.0.5/decoder/decode_i386.c libsrc/almp3-2.0.5/decoder/interface.c libsrc/almp3-2.0.5/decoder/layer2.c libsrc/almp3-2.0.5/decoder/layer3.c libsrc/almp3-2.0.5/decoder/tabinit.c + + ALOGG = libsrc/alogg/alogg.c diff --git a/ags-use-system-allegro.patch b/ags-use-system-allegro.patch new file mode 100644 index 0000000..12caf63 --- /dev/null +++ b/ags-use-system-allegro.patch @@ -0,0 +1,8 @@ +diff -up ags-v.3.4.4.1/Engine/Makefile-objs.allegro ags-v.3.4.4.1/Engine/Makefile-objs +--- ags-v.3.4.4.1/Engine/Makefile-objs.allegro 2019-10-02 11:52:59.022219358 +0200 ++++ ags-v.3.4.4.1/Engine/Makefile-objs 2019-10-02 11:54:22.579822128 +0200 +@@ -67,4 +67,3 @@ APEG = libsrc/apeg-1.2.1/adisplay.c libs + + AASTR = ../Common/libsrc/aastr-0.1.1/aarot.c ../Common/libsrc/aastr-0.1.1/aastr.c ../Common/libsrc/aastr-0.1.1/aautil.c + +-AL_MIDI_PATCH = libsrc/allegro-4.2.2-agspatch/midi.c diff --git a/ags.spec b/ags.spec new file mode 100644 index 0000000..219748e --- /dev/null +++ b/ags.spec @@ -0,0 +1,95 @@ +%global fver v.%{version} + +Name: ags +Summary: Engine for creating and running videogames of adventure (quest) genre +Version: 3.4.4.1 +URL: http://www.adventuregamestudio.co.uk/site/ags/ +Release: 1%{?dist} +# https://github.com/adventuregamestudio/ags/issues/949 +#Source0: https://github.com/adventuregamestudio/ags/archive/%{fver}/ags-%{fver}.tar.gz +Source0: ags-%{fver}.tar.xz +Source1: ags-clean-source.sh +# unbundle alfont +Patch0: %{name}-use-system-alfont.patch +# unbundle allegro +Patch1: %{name}-use-system-allegro.patch +License: Artistic 2.0 and BSD and Giftware and LGPLv2+ and Public Domain and zlib +BuildRequires: alfont-devel +BuildRequires: allegro-devel +BuildRequires: dumb-devel +BuildRequires: freetype-devel +BuildRequires: gcc-c++ +BuildRequires: libogg-devel +BuildRequires: libtheora-devel +BuildRequires: libvorbis-devel +BuildRequires: libXext-devel +BuildRequires: libXxf86vm-devel +# https://web.archive.org/web/20050323070052/http://www.inp.nsk.su/~bukinm/dusty/aastr/ (Giftware) +# dead upstream, might be possible to use aastr2: +# https://www.allegro.cc/resource/Libraries/Graphics/AASTR2 +Provides: bundled(aastr) = 0.1.1 +# https://web.archive.org/web/20060518092445/http://nekros.freeshell.org/delirium/alogg.html (BSD) +# dead upstream, internals are used, not trivial to unbundle +Provides: bundled(AllegroOGG) = 1.0.3 +# https://web.archive.org/web/20050305175733/http://nekros.freeshell.org/delirium/almp3.php (LGPLv2+) +# dead upstream, bundles parts of old mpg123, not trivial to separate +Provides: bundled(almp3) = 2.0.5 +# http://kcat.strangesoft.net/apeg.html (Public Domain) +Provides: bundled(apeg) = 1.2.1 +# https://web.archive.org/web/20090403045142/http://www.hiend3d.com/hq2x.html (LGPLv2+) +# dead upstream +Provides: bundled(hq2x3x) +# https://web.archive.org/web/20040104090747/http://www.alphalink.com.au/~tjaden/libcda/index.html (zlib) +# dead upstream +Provides: bundled(libcda) = 0.5 + +%description +Adventure Game Studio (AGS) - is the IDE and the engine meant for creating and +running videogames of adventure (aka "quest") genre. It has potential, although +limited, support for other genres as well. + +Originally created by Chris Jones back in 1999, AGS was opensourced in 2011 and +since continued to be developed by contributors. + +%prep +%setup -q -n %{name}-%{?commit:%{commit}}%{!?commit:%{fver}} +%patch0 -p1 -b .alfont +%patch1 -p1 -b .allegro +# delete unused bundled stuff +pushd Common/libinclude +rm -r OGG +rm -r theora +rm -r vorbis +rm aldumb.h +rm alfont{,dll}.h +rm dumb.h +popd +pushd Common/libsrc +rmdir googletest +popd +pushd Engine/libsrc +rm -r allegro-4.2.2-agspatch +rm -r alfont-2.0.9 +rm -r dumb-0.9.2 +popd +iconv -o Changes.txt.utf-8 -f iso8859-1 -t utf-8 Changes.txt && \ +touch -r Changes.txt Changes.txt.utf-8 && \ +mv Changes.txt.utf-8 Changes.txt + +%build +%set_build_flags +%make_build V=1 -C Engine + +%install +make V=1 -C Engine PREFIX=%{buildroot}%{_prefix} install + +%files +%license License.txt +%doc Changes.txt Copyright.txt OPTIONS.md README.md +%{_bindir}/ags + +%changelog +* Wed Oct 02 2019 Dominik Mierzejewski - 3.4.4.1-1 +- initial Fedora package of 3.4.4.1 release +- remove non-free Engine/libsrc/libcda-0.5/{bcd.doc,djgpp.c} from tarball +- convert Changes.txt to UTF-8 diff --git a/sources b/sources new file mode 100644 index 0000000..db12233 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ags-v.3.4.4.1.tar.xz) = 34b124cd6173a4b6f0615cb2c0c3c60f34e61af0b24fd438301a50570ee4ea890da2fd39d56a5ee2fb8e1f7b97c60f7473658d219db3f653af83e793a2e832fa