new package: openttd
This commit is contained in:
parent
a7756b9f2e
commit
17821de020
27
x11-packages/openttd-gfx/build.sh
Normal file
27
x11-packages/openttd-gfx/build.sh
Normal file
@ -0,0 +1,27 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://dev.openttdcoop.org/projects/opengfx
|
||||
TERMUX_PKG_DESCRIPTION="A free graphics set for openttd"
|
||||
TERMUX_PKG_LICENSE="GPL-2.0"
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
||||
TERMUX_PKG_VERSION=0.5.5
|
||||
TERMUX_PKG_SRCURL=https://bundles.openttdcoop.org/opengfx/releases/$TERMUX_PKG_VERSION/opengfx-$TERMUX_PKG_VERSION.zip
|
||||
TERMUX_PKG_SHA256=c648d56c41641f04e48873d83f13f089135909cc55342a91ed27c5c1683f0dfe
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
|
||||
termux_step_extract_package() {
|
||||
termux_download \
|
||||
"$TERMUX_PKG_SRCURL" \
|
||||
"$TERMUX_PKG_CACHEDIR/opengfx-$TERMUX_PKG_VERSION.zip" \
|
||||
"$TERMUX_PKG_SHA256"
|
||||
unzip -d "$TERMUX_PKG_SRCDIR" "$TERMUX_PKG_CACHEDIR/opengfx-$TERMUX_PKG_VERSION.zip"
|
||||
|
||||
cd "$TERMUX_PKG_SRCDIR"
|
||||
tar xf "opengfx-$TERMUX_PKG_VERSION.tar"
|
||||
}
|
||||
|
||||
termux_step_make_install() {
|
||||
cd "opengfx-$TERMUX_PKG_VERSION"
|
||||
install -d "$TERMUX_PREFIX"/share/openttd/data
|
||||
install -m600 *.grf "$TERMUX_PREFIX"/share/openttd/data
|
||||
install -m600 *.obg "$TERMUX_PREFIX"/share/openttd/data
|
||||
}
|
19
x11-packages/openttd-sfx/build.sh
Normal file
19
x11-packages/openttd-sfx/build.sh
Normal file
@ -0,0 +1,19 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://bundles.openttdcoop.org/opensfx
|
||||
TERMUX_PKG_DESCRIPTION="Free sound set for openttd"
|
||||
|
||||
# Here should be CCSP, but unfortunately Bintray doesn't allow
|
||||
# such license as well as other Creative Commons licenses except
|
||||
# the CC0.
|
||||
TERMUX_PKG_LICENSE="CC0-1.0"
|
||||
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
||||
TERMUX_PKG_VERSION=0.2.3
|
||||
TERMUX_PKG_SRCURL=https://bundles.openttdcoop.org/opensfx/releases/$TERMUX_PKG_VERSION/opensfx-$TERMUX_PKG_VERSION.zip
|
||||
TERMUX_PKG_SHA256=3574745ac0c138bae53b56972591db8d778ad9faffd51deae37a48a563e71662
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
|
||||
termux_step_make_install() {
|
||||
install -d "$TERMUX_PREFIX"/share/openttd/data
|
||||
install -m600 opensfx.* "$TERMUX_PREFIX"/share/openttd/data
|
||||
}
|
41
x11-packages/openttd/Makefile.lang.in.patch
Normal file
41
x11-packages/openttd/Makefile.lang.in.patch
Normal file
@ -0,0 +1,41 @@
|
||||
diff -uNr OpenTTD-1.9.1/Makefile.lang.in OpenTTD-1.9.1.mod/Makefile.lang.in
|
||||
--- OpenTTD-1.9.1/Makefile.lang.in 2019-04-08 22:37:59.000000000 +0300
|
||||
+++ OpenTTD-1.9.1.mod/Makefile.lang.in 2019-06-29 23:49:23.079658934 +0300
|
||||
@@ -39,23 +39,23 @@
|
||||
|
||||
strgen_base.o: $(SRC_DIR)/strgen/strgen_base.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSTRGEN -c -o $@ $<
|
||||
|
||||
strgen.o: $(SRC_DIR)/strgen/strgen.cpp $(SRC_DIR)/strgen/strgen.h $(SRC_DIR)/table/control_codes.h $(SRC_DIR)/table/strgen_tables.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSTRGEN -c -o $@ $<
|
||||
|
||||
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSTRGEN -c -o $@ $<
|
||||
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSTRGEN -c -o $@ $<
|
||||
|
||||
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSTRGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSTRGEN -c -o $@ $<
|
||||
|
||||
lang/english.txt: $(LANG_DIR)/english.txt
|
||||
$(Q)mkdir -p lang
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
$(STRGEN): alloc_func.o string.o strgen_base.o strgen.o getoptdata.o
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
|
||||
+ $(Q)g++ $^ -o $@
|
||||
|
||||
table/strings.h: lang/english.txt $(STRGEN)
|
||||
$(E) '$(STAGE) Generating $@'
|
37
x11-packages/openttd/Makefile.setting.in.patch
Normal file
37
x11-packages/openttd/Makefile.setting.in.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff -uNr OpenTTD-1.9.1/Makefile.setting.in OpenTTD-1.9.1.mod/Makefile.setting.in
|
||||
--- OpenTTD-1.9.1/Makefile.setting.in 2019-04-08 22:37:59.000000000 +0300
|
||||
+++ OpenTTD-1.9.1.mod/Makefile.setting.in 2019-06-30 00:06:14.541653021 +0300
|
||||
@@ -27,27 +27,27 @@
|
||||
|
||||
settingsgen.o: $(SRC_DIR)/settingsgen/settingsgen.cpp $(SRC_DIR)/string_func.h $(SRC_DIR)/strings_type.h $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/ini_type.h $(SRC_DIR)/core/smallvec_type.hpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
alloc_func.o: $(SRC_DIR)/core/alloc_func.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
getoptdata.o: $(SRC_DIR)/misc/getoptdata.cpp $(SRC_DIR)/misc/getoptdata.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/misc/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
string.o: $(SRC_DIR)/string.cpp $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
ini_load.o: $(SRC_DIR)/ini_load.cpp $(SRC_DIR)/core/alloc_func.hpp $(SRC_DIR)/core/mem_func.hpp $(SRC_DIR)/ini_type.h $(SRC_DIR)/string_func.h $(SRC_DIR)/safeguards.h
|
||||
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) -DSETTINGSGEN -c -o $@ $<
|
||||
+ $(Q)g++ -DSETTINGSGEN -c -o $@ $<
|
||||
|
||||
$(SETTINGSGEN): alloc_func.o string.o ini_load.o settingsgen.o getoptdata.o
|
||||
$(E) '$(STAGE) Compiling and Linking $@'
|
||||
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(CXXFLAGS_BUILD) $(LDFLAGS_BUILD) $^ -o $@
|
||||
+ $(Q)g++ $^ -o $@
|
||||
|
||||
table/settings.h: $(SETTINGSGEN) $(SRC_DIR)/table/settings.h.preamble $(SRC_DIR)/table/settings.h.postamble $(SRC_DIR)/table/*.ini
|
||||
$(E) '$(STAGE) Generating $@'
|
12
x11-packages/openttd/OpenTTD-1.9.1_src_ini.cpp.patch
Normal file
12
x11-packages/openttd/OpenTTD-1.9.1_src_ini.cpp.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr OpenTTD-1.9.1/src/ini.cpp OpenTTD-1.9.1.mod/src/ini.cpp
|
||||
--- OpenTTD-1.9.1/src/ini.cpp 2019-04-08 22:37:59.000000000 +0300
|
||||
+++ OpenTTD-1.9.1.mod/src/ini.cpp 2019-06-30 00:10:53.677008246 +0300
|
||||
@@ -79,7 +79,7 @@
|
||||
* APIs to do so. We only need to flush the data as the metadata itself
|
||||
* (modification date etc.) is not important to us; only the real data is.
|
||||
*/
|
||||
-#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
|
||||
+#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 && !defined(__ANDROID__)
|
||||
int ret = fdatasync(fileno(f));
|
||||
fclose(f);
|
||||
if (ret != 0) return false;
|
21
x11-packages/openttd/build.sh
Normal file
21
x11-packages/openttd/build.sh
Normal file
@ -0,0 +1,21 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://www.openttd.org/
|
||||
TERMUX_PKG_DESCRIPTION="An engine for running Transport Tycoon Deluxe"
|
||||
TERMUX_PKG_LICENSE="GPL-2.0"
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
||||
TERMUX_PKG_VERSION=1.9.1
|
||||
TERMUX_PKG_SRCURL=https://github.com/OpenTTD/OpenTTD/archive/$TERMUX_PKG_VERSION.tar.gz
|
||||
TERMUX_PKG_SHA256=af80c06e98ea8c96f74d188647f9dd04595ae34be92bd28823d4094ce0fc29e7
|
||||
TERMUX_PKG_DEPENDS="desktop-file-utils, fontconfig, hicolor-icon-theme, libicu, liblzma, liblzo, libpng, openttd-gfx, openttd-sfx, sdl"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
termux_step_configure() {
|
||||
CXXFLAGS+=" -DU_USING_ICU_NAMESPACE=1"
|
||||
|
||||
./configure \
|
||||
--prefix-dir="$TERMUX_PREFIX" \
|
||||
--binary-name=openttd \
|
||||
--binary-dir=bin \
|
||||
--data-dir=share/openttd \
|
||||
--doc-dir=share/doc/openttd \
|
||||
--menu-name=OpenTTD
|
||||
}
|
23
x11-packages/openttd/config.lib.patch
Normal file
23
x11-packages/openttd/config.lib.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff -uNr OpenTTD-1.9.1/config.lib OpenTTD-1.9.1.mod/config.lib
|
||||
--- OpenTTD-1.9.1/config.lib 2019-04-08 22:37:59.000000000 +0300
|
||||
+++ OpenTTD-1.9.1.mod/config.lib 2019-06-30 00:21:04.831588247 +0300
|
||||
@@ -1616,10 +1616,6 @@
|
||||
fi
|
||||
fi
|
||||
|
||||
- if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "OS2" ]; then
|
||||
- LIBS="$LIBS -lpthread"
|
||||
- fi
|
||||
-
|
||||
if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ]; then
|
||||
LIBS="$LIBS -lc"
|
||||
fi
|
||||
@@ -2651,7 +2647,7 @@
|
||||
log 2 "detecting $2"
|
||||
|
||||
if [ "$1" = "1" ] || [ "$1" = "" ] || [ "$1" = "2" ]; then
|
||||
- eval "$2=`ls -1 /usr/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`"
|
||||
+ eval "$2=`ls -1 @TERMUX_PREFIX@/include/$4*.h 2>/dev/null | egrep \"\/$5\$\"`"
|
||||
eval "res=\$$2"
|
||||
if [ -z "$res" ]; then
|
||||
log 2 " trying /usr/include/$4$5... no"
|
@ -0,0 +1,14 @@
|
||||
diff -uNr OpenTTD-1.9.1/src/3rdparty/squirrel/squirrel/sqvm.cpp OpenTTD-1.9.1.mod/src/3rdparty/squirrel/squirrel/sqvm.cpp
|
||||
--- OpenTTD-1.9.1/src/3rdparty/squirrel/squirrel/sqvm.cpp 2019-04-08 22:37:59.000000000 +0300
|
||||
+++ OpenTTD-1.9.1.mod/src/3rdparty/squirrel/squirrel/sqvm.cpp 2019-06-30 00:08:31.019272864 +0300
|
||||
@@ -6,7 +6,10 @@
|
||||
|
||||
#include <squirrel.h>
|
||||
#include "sqpcheader.h"
|
||||
+#pragma push_macro("type")
|
||||
+#undef type
|
||||
#include <math.h>
|
||||
+#pragma pop_macro("type")
|
||||
#include "sqopcodes.h"
|
||||
#include "sqfuncproto.h"
|
||||
#include "sqvm.h"
|
Loading…
Reference in New Issue
Block a user