Skip to content

Commit

Permalink
Updated by kodi-game-scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
fetzerch committed Sep 2, 2018
1 parent 1668e0a commit f163ef7
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
._*
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# game.libretro.mame2003_plus
# 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)
29 changes: 29 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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%
63 changes: 63 additions & 0 deletions depends/common/mame2003_plus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})")
1 change: 1 addition & 0 deletions depends/common/mame2003_plus/mame2003_plus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mame2003_plus https://github.com/libretro/mame2003-plus-libretro master
1 change: 1 addition & 0 deletions depends/common/mame2003_plus/windows-deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mingw
8 changes: 8 additions & 0 deletions depends/windows/mingw/01-make.bat.in.patch
Original file line number Diff line number Diff line change
@@ -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 %*
4 changes: 4 additions & 0 deletions depends/windows/mingw/02-MinGWConfig.cmake.in.patch
Original file line number Diff line number Diff line change
@@ -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)
36 changes: 36 additions & 0 deletions depends/windows/mingw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
1 change: 1 addition & 0 deletions depends/windows/mingw/mingw.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bb1f1a0b35b3d96bf9c15092da8ce969a84a134f7b08811292fbc9d84d48c65d
1 change: 1 addition & 0 deletions depends/windows/mingw/mingw.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mingw http://mirrors.kodi.tv/build-deps/win32/msys2/msys2-base-x86_64-20161025.tar.xz
22 changes: 22 additions & 0 deletions game.libretro.mame2003_plus/addon.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="game.libretro.mame2003_plus"
name="Arcade (MAME 2003-Plus - Experimental)"
version="0.78.0"
provider-name="Libretro">
<requires>
<import addon="game.libretro" version="1.0.0"/>
</requires>
<extension point="kodi.gameclient"
library_@PLATFORM@="@LIBRARY_FILENAME@">
<platforms></platforms>
<extensions>zip</extensions>
<supports_vfs>false</supports_vfs>
<supports_standalone>false</supports_standalone>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">Arcade (MAME 2003-Plus - Experimental) 0.78</summary>
<description lang="en_GB">Supported files: .zip</description>
<license>MAME</license>
<platform>@PLATFORM@</platform>
</extension>
</addon>

0 comments on commit f163ef7

Please sign in to comment.