diff options
author | Coelacanthus | 2021-03-04 14:26:45 +0800 |
---|---|---|
committer | Coelacanthus | 2021-03-04 14:26:45 +0800 |
commit | 34fa9c86994429e890ac1e9aea4b83e8d9e63a4b (patch) | |
tree | 741bef362b68c5c628ee238cbecf03678353f71c | |
parent | daf09ce62f937242dc50ba6e77ffc59930c35d9d (diff) | |
download | aur-34fa9c86994429e890ac1e9aea4b83e8d9e63a4b.tar.gz |
upgpkg: onscripter using CMake instead of plainmake
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | 0001-fix-smpeg-header-name.patch | 25 | ||||
-rw-r--r-- | 0002-fix-lua-header-name.patch | 25 | ||||
-rw-r--r-- | CMakeLists.txt | 78 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | avifile.patch | 19 |
6 files changed, 172 insertions, 31 deletions
@@ -1,7 +1,7 @@ pkgbase = onscripter pkgdesc = A game engine compatible to NScripter, to create and perform visual novel games pkgver = 20200722 - pkgrel = 1 + pkgrel = 2 url = http://onscripter.sourceforge.jp/onscripter.html arch = i686 arch = x86_64 @@ -9,12 +9,22 @@ pkgbase = onscripter depends = sdl_image depends = sdl_mixer depends = sdl_ttf + depends = sdl_sound depends = lua51 depends = fontconfig + depends = libjpeg + depends = bzip2 + depends = smpeg + depends = cmake + depends = ninja source = http://onscripter.sourceforge.jp/onscripter-20200722.tar.gz - source = avifile.patch + source = CMakeLists.txt + source = 0001-fix-smpeg-header-name.patch + source = 0002-fix-lua-header-name.patch b2sums = 5dbd734e5ca577e75cb51ef06018f0d6b862f1b13d913dc8e400a0725a22c8cca516e68432527c6c8ef62dc72fdc8985deb0ea63bcbb29386cac855bd8e4a3c0 - b2sums = a334dbc3802d3d909839a96192080ff9aa8737d5fb592ce3989f112a6746134501da5e292664ed4a09118b99ec001dcf8eb1607c0597c56e326744f02f9ae2c2 + b2sums = 96944b4a986592741cab0656d3eef9bf59893c27d96e3c29b56d8a1a0156b89a34fb02f27c2bf85c826820b84100ed80d3c8fef94c51c9f0bf5bd945bf06d396 + b2sums = 844669f2d20bfa4111b966286c60940008d42afa0eff64396cd48267cdfb4e90470d25269bdca6311e09fbd770360d1771e6ee62133563146ed0e5dcb1f459c7 + b2sums = 050d46bcac811af57ad9cec046a975abf70e01429d4517dad2cea32e1dc5d19b5b8831acbda834ef126249794a251097beaa6b34539f4e6ecac2d8522bf45222 pkgname = onscripter diff --git a/0001-fix-smpeg-header-name.patch b/0001-fix-smpeg-header-name.patch new file mode 100644 index 000000000000..58eddfea5a1d --- /dev/null +++ b/0001-fix-smpeg-header-name.patch @@ -0,0 +1,25 @@ +From 7fe1cfc106438634409edf1c26a29044424297d4 Mon Sep 17 00:00:00 2001 +From: Coelacanthus <coelacanthus@outlook.com> +Date: Thu, 4 Mar 2021 14:09:13 +0800 +Subject: [PATCH 1/2] fix smpeg header name + +--- + ONScripter.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ONScripter.h b/ONScripter.h +index ce8b348..5a3c538 100644 +--- a/ONScripter.h ++++ b/ONScripter.h +@@ -32,7 +32,7 @@ + #include <SDL_ttf.h> + #include <SDL_mixer.h> + #if defined(USE_SMPEG) +-#include <smpeg.h> ++#include <smpeg/smpeg.h> + #endif + + #define DEFAULT_VIDEO_SURFACE_FLAG (SDL_SWSURFACE) +-- +2.30.1 + diff --git a/0002-fix-lua-header-name.patch b/0002-fix-lua-header-name.patch new file mode 100644 index 000000000000..b64c84c85470 --- /dev/null +++ b/0002-fix-lua-header-name.patch @@ -0,0 +1,25 @@ +From 70cb003a7f2d3648f23c22572eb0c117f79ee4de Mon Sep 17 00:00:00 2001 +From: Coelacanthus <coelacanthus@outlook.com> +Date: Thu, 4 Mar 2021 14:18:51 +0800 +Subject: [PATCH 2/2] fix-lua-header-name + +--- + LUAHandler.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/LUAHandler.h b/LUAHandler.h +index 53bc602..f197307 100644 +--- a/LUAHandler.h ++++ b/LUAHandler.h +@@ -24,7 +24,7 @@ + #if !defined(__LUA_HANDLER_H__) && defined(USE_LUA) + #define __LUA_HANDLER_H__ + +-#include <lua.hpp> ++#include <lua5.1/lua.hpp> + + class ONScripter; + class ScriptHandler; +-- +2.30.1 + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..c61aa2aa7ff5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.19.0 ) + +project(onscripter LANGUAGES C CXX) + +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) + +set(HEADERS + BaseReader.h + ButtonLink.h + DirectReader.h + SarReader.h + NsaReader.h + ScriptHandler.h + ScriptParser.h + AnimationInfo.h + FontInfo.h + DirtyRect.h + LUAHandler.h + Encoding.h +) + +set(SOURCES + AnimationInfo.cpp + conv_shared.cpp + DirectReader.cpp + DirtyRect.cpp + Encoding.cpp + FontInfo.cpp + LUAHandler.cpp + NsaReader.cpp + ONScripter_animation.cpp + ONScripter_command.cpp + ONScripter.cpp + ONScripter_effect_breakup.cpp + ONScripter_effect_cascade.cpp + ONScripter_effect.cpp + ONScripter_event.cpp + ONScripter_file2.cpp + ONScripter_file.cpp + ONScripter_image.cpp + ONScripter_lut.cpp + ONScripter_rmenu.cpp + ONScripter_sound.cpp + ONScripter_text.cpp + resize_image.cpp + SarReader.cpp + ScriptHandler.cpp + ScriptParser_command.cpp + ScriptParser.cpp + sjis2utf16.cpp +) + +find_package(SDL REQUIRED) +find_package(SDL_sound REQUIRED) +find_package(SDL_mixer REQUIRED) +find_package(SDL_image REQUIRED) +find_package(SDL_ttf REQUIRED) +find_package(Lua51 REQUIRED) +find_package(BZip2 REQUIRED) +find_package(Fontconfig REQUIRED) +find_package(JPEG REQUIRED) + +# Find SMPEG +find_library(SMPEG_LIBRARY + NAMES smpeg SMPEG Smpeg SMpeg + PATHS + ENV SMPEGDIR + ENV SDLSOUNDDIR + ENV SDLDIR + /opt + PATH_SUFFIXES + lib + ) + +add_compile_definitions(LINUX USE_SMPEG USE_FONTCONFIG USE_OGG_VORBIS USE_CDROM USE_LUA) + +add_executable(onscripter onscripter_main.cpp ${HEADERS} ${SOURCES}) +target_link_libraries(onscripter SDL::SDL ${SDL_SOUND_LIBRARIES} ${SDL_IMAGE_LIBRARIES} ${SDL_MIXER_LIBRARIES} ${SDL_TTF_LIBRARIES} ${SMPEG_LIBRARY} ${LUA_LIBRARIES} ${BZIP2_LIBRARIES} Fontconfig::Fontconfig ${JPEG_LIBRARIES}) @@ -5,29 +5,51 @@ pkgname=onscripter pkgver=20200722 -pkgrel=1 +pkgrel=2 pkgdesc="A game engine compatible to NScripter, to create and perform visual novel games" arch=('i686' 'x86_64') url="http://onscripter.sourceforge.jp/onscripter.html" license=('GPL') -depends=('sdl_image' 'sdl_mixer' 'sdl_ttf' 'lua51' 'fontconfig') +depends=('sdl_image' + 'sdl_mixer' + 'sdl_ttf' + 'sdl_sound' + 'lua51' + 'fontconfig' + 'libjpeg' + 'bzip2' + 'smpeg' + 'cmake' + 'ninja' + ) source=("http://onscripter.sourceforge.jp/${pkgname}-${pkgver}.tar.gz" - 'avifile.patch') + 'CMakeLists.txt' + '0001-fix-smpeg-header-name.patch' + '0002-fix-lua-header-name.patch' + ) b2sums=('5dbd734e5ca577e75cb51ef06018f0d6b862f1b13d913dc8e400a0725a22c8cca516e68432527c6c8ef62dc72fdc8985deb0ea63bcbb29386cac855bd8e4a3c0' - 'a334dbc3802d3d909839a96192080ff9aa8737d5fb592ce3989f112a6746134501da5e292664ed4a09118b99ec001dcf8eb1607c0597c56e326744f02f9ae2c2') + '96944b4a986592741cab0656d3eef9bf59893c27d96e3c29b56d8a1a0156b89a34fb02f27c2bf85c826820b84100ed80d3c8fef94c51c9f0bf5bd945bf06d396' + '844669f2d20bfa4111b966286c60940008d42afa0eff64396cd48267cdfb4e90470d25269bdca6311e09fbd770360d1771e6ee62133563146ed0e5dcb1f459c7' + '050d46bcac811af57ad9cec046a975abf70e01429d4517dad2cea32e1dc5d19b5b8831acbda834ef126249794a251097beaa6b34539f4e6ecac2d8522bf45222') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" - patch -p1 -i ${srcdir}/avifile.patch + ln -s ${srcdir}/CMakeLists.txt + patch -p1 -i ${srcdir}/0001-fix-smpeg-header-name.patch + patch -p1 -i ${srcdir}/0002-fix-lua-header-name.patch } build() { - cd "${srcdir}/${pkgname}-${pkgver}" - make -f Makefile.Linux + cd "${srcdir}/${pkgname}-${pkgver}" + cmake . \ + -DCMAKE_BUILD_TYPE=Release \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=${pkgdir}/usr + ninja } package() { - cd "${srcdir}/${pkgname}-${pkgver}" - install -Dm755 onscripter "${pkgdir}/usr/bin/onscripter" + cd "${srcdir}/${pkgname}-${pkgver}" + install -Dm755 onscripter "${pkgdir}/usr/bin/onscripter" } diff --git a/avifile.patch b/avifile.patch deleted file mode 100644 index 5ecf32fd1a6f..000000000000 --- a/avifile.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/Makefile.Linux 2016-04-07 19:39:17.000000000 +0200 -+++ b/Makefile.Linux 2016-05-14 17:04:15.122758334 +0200 -@@ -42,11 +42,11 @@ - DEFS += -DUSE_CDROM - - # optional: avifile --DEFS += -DUSE_AVIFILE --INCS += `avifile-config --cflags` --LIBS += `avifile-config --libs` --TARGET += simple_aviplay$(EXESUFFIX) --EXT_OBJS += AVIWrapper$(OBJSUFFIX) -+# DEFS += -DUSE_AVIFILE -+# INCS += `avifile-config --cflags` -+# LIBS += `avifile-config --libs` -+# TARGET += simple_aviplay$(EXESUFFIX) -+# EXT_OBJS += AVIWrapper$(OBJSUFFIX) - - # optional: lua - DEFS += -DUSE_LUA |