From f163ef773d45585b5fe6ef690da171bde9487cb3 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Sun, 2 Sep 2018 20:36:41 +0200 Subject: [PATCH] Updated by kodi-game-scripting --- .gitignore | 30 +++++++++ .travis.yml | 41 ++++++++++++ CMakeLists.txt | 14 +++++ README.md | 7 ++- appveyor.yml | 29 +++++++++ depends/common/mame2003_plus/CMakeLists.txt | 63 +++++++++++++++++++ .../common/mame2003_plus/mame2003_plus.txt | 1 + depends/common/mame2003_plus/windows-deps.txt | 1 + depends/windows/mingw/01-make.bat.in.patch | 8 +++ .../mingw/02-MinGWConfig.cmake.in.patch | 4 ++ depends/windows/mingw/CMakeLists.txt | 36 +++++++++++ depends/windows/mingw/mingw.sha256 | 1 + depends/windows/mingw/mingw.txt | 1 + game.libretro.mame2003_plus/addon.xml.in | 22 +++++++ 14 files changed, 257 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CMakeLists.txt create mode 100644 appveyor.yml create mode 100644 depends/common/mame2003_plus/CMakeLists.txt create mode 100644 depends/common/mame2003_plus/mame2003_plus.txt create mode 100644 depends/common/mame2003_plus/windows-deps.txt create mode 100644 depends/windows/mingw/01-make.bat.in.patch create mode 100644 depends/windows/mingw/02-MinGWConfig.cmake.in.patch create mode 100644 depends/windows/mingw/CMakeLists.txt create mode 100644 depends/windows/mingw/mingw.sha256 create mode 100644 depends/windows/mingw/mingw.txt create mode 100644 game.libretro.mame2003_plus/addon.xml.in diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5190662 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# build artifacts +build/ +obj-x86_64-linux-gnu/ +game.*/addon.xml + +# commonly used editors +# vim +*.swp + +# Eclipse +*.project +*.cproject +.classpath +.settings/ + +# Sublime +*.sublime-* + +# KDevelop 4 +*.kdev4 + +# gedit +*~ + +# CLion +.idea + +# OSX ignorables +.DS_Store +._* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4096043 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +language: cpp + +# +# Define the build matrix +# +# Travis defaults to building on Ubuntu Precise when building on +# Linux. We need Trusty in order to get up to date versions of +# cmake and g++. +# +env: + global: + - app_id=game.libretro.mame2003_plus + +matrix: + include: + - os: linux + dist: xenial + sudo: required + compiler: gcc + - os: linux + dist: xenial + sudo: required + compiler: clang + - os: osx + osx_image: xcode9 + - os: osx + osx_image: xcode9.3 + +# +# The addon source is automatically checked out in $TRAVIS_BUILD_DIR, +# we'll put the Kodi source on the same level +# +before_script: + - cd $TRAVIS_BUILD_DIR/.. + - git clone --depth=1 https://github.com/xbmc/xbmc.git + - cd ${app_id} && mkdir build && cd build + - mkdir -p definition/${app_id} + - echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt + - cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=$TRAVIS_BUILD_DIR/.. -DADDONS_DEFINITION_DIR=$TRAVIS_BUILD_DIR/build/definition -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../xbmc/addons -DPACKAGE_ZIP=1 $TRAVIS_BUILD_DIR/../xbmc/cmake/addons + +script: make -j$(getconf _NPROCESSORS_ONLN) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9f6d933 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(game.libretro.mame2003_plus) + +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) + +find_package(Kodi REQUIRED) +find_package(libretro-mame2003_plus REQUIRED) + +set(MAME2003_PLUS_CUSTOM_BINARY ${MAME2003_PLUS_LIB} + ${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) + +build_addon(${PROJECT_NAME} MAME2003_PLUS "") + +include(CPack) diff --git a/README.md b/README.md index f68bfb5..00f746c 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# game.libretro.mame2003_plus \ No newline at end of file +# game.libretro.mame2003_plus addon for Kodi + +This is a [Kodi](http://kodi.tv) game addon for Arcade (MAME 2003-Plus - Experimental). + +[![Build Status](https://travis-ci.org/kodi-game/game.libretro.mame2003_plus.svg?branch=master)](https://travis-ci.org/kodi-game/game.libretro.mame2003_plus) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/kodi-game/game.libretro.mame2003_plus?svg=true)](https://ci.appveyor.com/project/kodi-game/game-libretro-mame2003_plus) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..bbf466c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +version: BuildNr.{build} + +image: Visual Studio 2015 + +shallow_clone: true + +clone_folder: c:\projects\game.libretro.mame2003_plus + +environment: + app_id: game.libretro.mame2003_plus + + matrix: + - GENERATOR: "Visual Studio 14" + CONFIGURATION: Release + - GENERATOR: "Visual Studio 14 Win64" + CONFIGURATION: Release + +build_script: + - cd .. + - git clone --depth=1 https://github.com/xbmc/xbmc.git + - mklink /j xbmc\project\BuildDependencies\msys64 C:\msys64 + - cd %app_id% + - mkdir build + - cd build + - mkdir -p definition\%app_id% + - echo %app_id% %APPVEYOR_BUILD_FOLDER% %APPVEYOR_REPO_COMMIT% > definition\%app_id%\%app_id%.txt + - SET PATH=C:\Program Files (x86)\CMake\bin;C:\msys64\bin;C:\msys64\usr\bin;%PATH% + - cmake -T host=x64 -G "%GENERATOR%" -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons + - cmake --build . --config %CONFIGURATION% --target %app_id% diff --git a/depends/common/mame2003_plus/CMakeLists.txt b/depends/common/mame2003_plus/CMakeLists.txt new file mode 100644 index 0000000..88dee01 --- /dev/null +++ b/depends/common/mame2003_plus/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 3.1) +project(mame2003_plus) + +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) + +include(ExternalProject) + +string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) + +set(LIBRETRO_BINARY_DIR .) +set(LIBRETRO_SONAME mame2003_plus_libretro${CMAKE_SHARED_LIBRARY_SUFFIX}) +set(LIBRETRO_JNISONAME libretro${CMAKE_SHARED_LIBRARY_SUFFIX}) + +if(CMAKE_BUILD_TYPE MATCHES Debug) + set(LIBRETRO_DEBUG DEBUG=1) +endif() + +if(CORE_SYSTEM_NAME STREQUAL windows) + find_package(MinGW REQUIRED) + set(BUILD_COMMAND ${MINGW_MAKE} -j$ENV{NUMBER_OF_PROCESSORS} -C . -f Makefile platform=win ${LIBRETRO_DEBUG} GIT_VERSION=) +elseif(CORE_SYSTEM_NAME STREQUAL linux) + set(BUILD_COMMAND $(MAKE) -C . -f Makefile platform=unix ${LIBRETRO_DEBUG} GIT_VERSION=) +elseif(CORE_SYSTEM_NAME STREQUAL osx) + set(BUILD_COMMAND $(MAKE) -C . -f Makefile platform=osx ${LIBRETRO_DEBUG} GIT_VERSION=) +elseif(CORE_SYSTEM_NAME STREQUAL ios) + set(LIBRETRO_SONAME mame2003_plus_libretro_ios${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(BUILD_COMMAND IOSSDK=${CMAKE_OSX_SYSROOT} $(MAKE) -C . -f Makefile platform=ios ${LIBRETRO_DEBUG} GIT_VERSION=) +elseif(CORE_SYSTEM_NAME STREQUAL android) + if(NOT NDKROOT) + message(FATAL_ERROR "${PROJECT_NAME} needs NDKROOT for Android. Missing Toolchain file?") + endif() + if(CPU STREQUAL armeabi-v7a OR CPU STREQUAL arm64-v8a) + set(PLATFORM ${CPU}) + elseif(CPU STREQUAL i686) + set(PLATFORM x86) + else() + message(FATAL_ERROR "${PROJECT_NAME} needs Android ${CPU} build command in CMakeLists.txt!") + endif() + set(BUILD_COMMAND GNUMAKE=$(MAKE) ${NDKROOT}/ndk-build -C jni APP_ABI=${PLATFORM} V7NEONOPTIMIZATION=1 GIT_VERSION= + NDK_LIBS_OUT=${PROJECT_SOURCE_DIR}/${LIBRETRO_BINARY_DIR} ${LIBRETRO_DEBUG} V=1 + && cp ${PROJECT_SOURCE_DIR}/${LIBRETRO_BINARY_DIR}/${PLATFORM}/${LIBRETRO_JNISONAME} ${PROJECT_SOURCE_DIR}/${LIBRETRO_BINARY_DIR}/${LIBRETRO_SONAME}) +elseif(CORE_SYSTEM_NAME STREQUAL rbpi) + message(FATAL_ERROR "${PROJECT_NAME} needs RPi build command in CMakeLists.txt!") +elseif(CORE_SYSTEM_NAME STREQUAL freebsd) + set(BUILD_COMMAND $(MAKE) -C . -f Makefile platform=unix ${LIBRETRO_DEBUG} GIT_VERSION=) +else() + message(FATAL_ERROR "${PROJECT_NAME} - Unknown system: ${CORE_SYSTEM_NAME}") +endif() + +externalproject_add(${PROJECT_NAME} + SOURCE_DIR ${PROJECT_SOURCE_DIR} + PREFIX ${PROJECT_NAME} + CONFIGURE_COMMAND "" + INSTALL_COMMAND "" + BUILD_COMMAND ${BUILD_COMMAND} + BUILD_IN_SOURCE 1) + +# install the generated shared library +install(FILES ${PROJECT_SOURCE_DIR}/${LIBRETRO_BINARY_DIR}/${LIBRETRO_SONAME} + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + +# write the config.cmake script +file(WRITE ${CMAKE_INSTALL_PREFIX}/libretro-${PROJECT_NAME}-config.cmake "set(${PROJECT_NAME_UC}_LIB ${CMAKE_INSTALL_PREFIX}/lib/${LIBRETRO_SONAME})") diff --git a/depends/common/mame2003_plus/mame2003_plus.txt b/depends/common/mame2003_plus/mame2003_plus.txt new file mode 100644 index 0000000..3af201b --- /dev/null +++ b/depends/common/mame2003_plus/mame2003_plus.txt @@ -0,0 +1 @@ +mame2003_plus https://github.com/libretro/mame2003-plus-libretro master diff --git a/depends/common/mame2003_plus/windows-deps.txt b/depends/common/mame2003_plus/windows-deps.txt new file mode 100644 index 0000000..90aa6ae --- /dev/null +++ b/depends/common/mame2003_plus/windows-deps.txt @@ -0,0 +1 @@ +mingw diff --git a/depends/windows/mingw/01-make.bat.in.patch b/depends/windows/mingw/01-make.bat.in.patch new file mode 100644 index 0000000..538b824 --- /dev/null +++ b/depends/windows/mingw/01-make.bat.in.patch @@ -0,0 +1,8 @@ +--- /dev/null ++++ b/make.bat.in +@@ -0,0 +1,5 @@ ++@ECHO OFF ++SETLOCAL ++ ++SET PATH=@CMAKE_CURRENT_SOURCE_DIR@\@MINGW_PATH@\bin;@CMAKE_CURRENT_SOURCE_DIR@\usr\bin;%PATH% ++make.exe %* diff --git a/depends/windows/mingw/02-MinGWConfig.cmake.in.patch b/depends/windows/mingw/02-MinGWConfig.cmake.in.patch new file mode 100644 index 0000000..b177626 --- /dev/null +++ b/depends/windows/mingw/02-MinGWConfig.cmake.in.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/MinGWConfig.cmake.in +@@ -0,0 +1,1 @@ ++set(MINGW_MAKE @CMAKE_CURRENT_SOURCE_DIR@/@MINGW_PATH@/bin/make.bat) diff --git a/depends/windows/mingw/CMakeLists.txt b/depends/windows/mingw/CMakeLists.txt new file mode 100644 index 0000000..c70a899 --- /dev/null +++ b/depends/windows/mingw/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.4) + +project(mingw) + +foreach(repo msys mingw32 mingw64) + if(${repo} STREQUAL msys) + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}2/$arch\n") + else() + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}\n") + endif() +endforeach() + +include(CheckSymbolExists) +check_symbol_exists(_X86_ "Windows.h" _X86_) +check_symbol_exists(_AMD64_ "Windows.h" _AMD64_) + +if(_X86_) + set(HOST mingw-w64-i686) + set(MINGW_PATH "mingw32") +elseif(_AMD64_) + set(HOST mingw-w64-x86_64) + set(MINGW_PATH "mingw64") +else() + message(FATAL_ERROR "Unsupported architecture") +endif() + +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c "pacman-key --init" ERROR_QUIET) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c "pacman --noconfirm -S make ${HOST}-gcc") + +file(GLOB_RECURSE shared_libs ${CMAKE_CURRENT_SOURCE_DIR}/${MINGW_PATH}/*.dll.a) +file(REMOVE ${shared_libs}) + +configure_file(MinGWConfig.cmake.in MinGWConfig.cmake @ONLY) +configure_file(make.bat.in ${CMAKE_CURRENT_SOURCE_DIR}/${MINGW_PATH}/bin/make.bat @ONLY) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MinGWConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/depends/windows/mingw/mingw.sha256 b/depends/windows/mingw/mingw.sha256 new file mode 100644 index 0000000..fe7f096 --- /dev/null +++ b/depends/windows/mingw/mingw.sha256 @@ -0,0 +1 @@ +bb1f1a0b35b3d96bf9c15092da8ce969a84a134f7b08811292fbc9d84d48c65d diff --git a/depends/windows/mingw/mingw.txt b/depends/windows/mingw/mingw.txt new file mode 100644 index 0000000..3fddb03 --- /dev/null +++ b/depends/windows/mingw/mingw.txt @@ -0,0 +1 @@ +mingw http://mirrors.kodi.tv/build-deps/win32/msys2/msys2-base-x86_64-20161025.tar.xz diff --git a/game.libretro.mame2003_plus/addon.xml.in b/game.libretro.mame2003_plus/addon.xml.in new file mode 100644 index 0000000..b1d17b9 --- /dev/null +++ b/game.libretro.mame2003_plus/addon.xml.in @@ -0,0 +1,22 @@ + + + + + + + + zip + false + false + + + Arcade (MAME 2003-Plus - Experimental) 0.78 + Supported files: .zip + MAME + @PLATFORM@ + +