diff options
author | Oleg Kosenkov <okosenkov@gmail.com> | 2021-05-31 14:01:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 19:01:49 +0100 |
commit | 971523621cfdd18855e6c57c77fafcc3c23d2a12 (patch) | |
tree | 93c853ceb015b2342a8902213f0e1303de554757 /Ports | |
parent | ed89cd93aa254dae8395fd7afb3668158e181056 (diff) | |
download | serenity-971523621cfdd18855e6c57c77fafcc3c23d2a12.zip |
Ports: Add opentyrian and opentyrian-data
Diffstat (limited to 'Ports')
-rw-r--r-- | Ports/AvailablePorts.md | 2 | ||||
-rwxr-xr-x | Ports/opentyrian-data/package.sh | 16 | ||||
-rwxr-xr-x | Ports/opentyrian/package.sh | 21 | ||||
-rw-r--r-- | Ports/opentyrian/patches/opentyrian.patch | 83 |
4 files changed, 122 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 9069f5bcaf..fd058441d7 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -93,6 +93,8 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`openttd`](openttd/) | OpenTTD | 1.11.0 | https://www.openttd.org/ | | [`openttd-opengfx`](openttd-opengfx/) | OpenGFX graphics for OpenTTD | 0.6.1 | https://www.openttd.org/ | | [`openttd-opensfx`](openttd-opensfx/) | OpenSFX audio files for OpenTTD | 1.0.1 | https://www.openttd.org/ | +| [`opentyrian`](opentyrian/) | OpenTyrian | 84b820f | https://github.com/opentyrian/opentyrian | +| [`opentyrian-data`](opentyrian-data/) | OpenTyrian graphics and audio | 1.0.0 | http://camanis.net/tyrian/tyrian21.zip | | [`oksh`](oksh/) | oksh | 6.8.1 | https://github.com/ibara/oksh | | [`patch`](patch/) | patch (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy | | [`pcre`](pcre/) | Perl-compatible Regular Expressions (PCRE) | 8.44 | https://www.pcre.org/ | diff --git a/Ports/opentyrian-data/package.sh b/Ports/opentyrian-data/package.sh new file mode 100755 index 0000000000..f61b90dfc4 --- /dev/null +++ b/Ports/opentyrian-data/package.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=opentyrian-data +version=1.0.0 +workdir=. +files="http://camanis.net/tyrian/tyrian21.zip tyrian21.zip 7790d09a2a3addcd33c66ef063d5900eb81cc9c342f4807eb8356364dd1d9277" +auth_type=sha256 + +build() { + run_nocd unzip -o tyrian21.zip + run_nocd rm -v tyrian21/*.exe +} + +install() { + run_nocd mkdir -p ${SERENITY_INSTALL_ROOT}/usr/local/share/games/opentyrian/ + run_nocd cp -a tyrian21/* ${SERENITY_INSTALL_ROOT}/usr/local/share/games/opentyrian/ +} diff --git a/Ports/opentyrian/package.sh b/Ports/opentyrian/package.sh new file mode 100755 index 0000000000..ecb7ba1fa7 --- /dev/null +++ b/Ports/opentyrian/package.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=opentyrian +version=84b820f852f3f6b812b4d00d6b3906adbbf3bbdb +useconfigure=true +files="https://github.com/opentyrian/opentyrian/archive/${version}.tar.gz ${version}.tar.gz 7429cc8e3468e3462b886cb99fe6cc0f5d232c193b68a94dc427493107c30dec" +auth_type=sha256 +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" +depends="SDL2 opentyrian-data" + +launcher_name=OpenTyrian +launcher_category=Games +launcher_command=/usr/local/bin/tyrian + +configure() { + run cmake $configopts +} + +install() { + run make install + install_launcher +} diff --git a/Ports/opentyrian/patches/opentyrian.patch b/Ports/opentyrian/patches/opentyrian.patch new file mode 100644 index 0000000000..ff18f878b6 --- /dev/null +++ b/Ports/opentyrian/patches/opentyrian.patch @@ -0,0 +1,83 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..dfb9649 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,4 @@ ++cmake_minimum_required(VERSION 3.16) ++project(opentyrian LANGUAGES C) ++install(FILES CREDITS NEWS README DESTINATION share/doc/opentyrian) ++add_subdirectory(src) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..b8d71b9 +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,67 @@ ++find_package(SDL2 REQUIRED) ++add_executable(tyrian ++ animlib.c ++ arg_parse.c ++ backgrnd.c ++ config.c ++ config_file.c ++ destruct.c ++ editship.c ++ episodes.c ++ file.c ++ font.c ++ fonthand.c ++ game_menu.c ++ helptext.c ++ joystick.c ++ jukebox.c ++ keyboard.c ++ lds_play.c ++ loudness.c ++ lvllib.c ++ lvlmast.c ++ mainint.c ++ menus.c ++ mouse.c ++ mtrand.c ++ musmast.c ++ network.c ++ nortsong.c ++ nortvars.c ++ opentyr.c ++ opl.c ++ palette.c ++ params.c ++ pcxload.c ++ pcxmast.c ++ picload.c ++ player.c ++ scroller.c ++ setup.c ++ shots.c ++ sizebuf.c ++ sndmast.c ++ sprite.c ++ starlib.c ++ std_support.c ++ tyrian2.c ++ varz.c ++ vga256d.c ++ vga_palette.c ++ video.c ++ video_scale.c ++ video_scale_hqNx.c ++ xmas.c) ++target_include_directories(tyrian PRIVATE . ${SDL2_INCLUDE_DIRS}) ++if("${SDL2_LIBRARIES}" STREQUAL "") ++ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") ++ set(SDL2_LIBRARIES "SDL2::SDL2") ++endif() ++ ++target_compile_options(tyrian PRIVATE -std=iso9899:1999 ) ++target_compile_definitions(tyrian PRIVATE ++ -DNDEBUG ++ -DTYRIAN_DIR=\"/usr/local/share/games/opentyrian\") ++target_link_libraries(tyrian m ${SDL2_LIBRARIES}) ++install(TARGETS tyrian ++ RUNTIME DESTINATION bin) |