From 9790d3e52ab9a4471daa62c359302642be1213b6 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Mon, 19 Mar 2018 21:41:52 +0100 Subject: [PATCH 1/2] config: Don't generate depends/windows/mingw for 2048 Don't override the MSVC build in the project's repository. --- kodi_game_scripting/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kodi_game_scripting/config.py b/kodi_game_scripting/config.py index 8e87b205..35f19ccc 100644 --- a/kodi_game_scripting/config.py +++ b/kodi_game_scripting/config.py @@ -26,7 +26,7 @@ # core: {(Libretro repo, Makefile, Directory)} ADDONS = { - '2048': ('libretro-2048', 'Makefile.libretro', '.', 'jni', {}), + '2048': ('libretro-2048', 'Makefile.libretro', '.', 'jni', {'nomingw': True}), '4do': ('4do-libretro', 'Makefile', '.', 'jni', {}), 'beetle-bsnes': ('beetle-bsnes-libretro', 'Makefile', '.', 'jni', {'soname': 'mednafen_snes'}), 'beetle-gba': ('beetle-gba-libretro', 'Makefile', '.', 'jni', {'soname': 'mednafen_gba'}), From 8deedd65d9a280b8a2f5e41e3f70b3e880690951 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Mon, 19 Nov 2018 20:31:19 +0100 Subject: [PATCH 2/2] templates: Conditionally generate mingw dependency --- kodi_game_scripting/template_processor.py | 2 ++ .../addon/depends/common/{{ game.name }}/windows-deps.txt | 1 - .../addon/depends/common/{{ game.name }}/windows-deps.txt.j2 | 3 +++ .../mingw/{01-make.bat.in.patch => 01-make.bat.in.patch.j2} | 2 ++ ...WConfig.cmake.in.patch => 02-MinGWConfig.cmake.in.patch.j2} | 2 ++ .../windows/mingw/{CMakeLists.txt => CMakeLists.txt.j2} | 2 ++ .../depends/windows/mingw/{mingw.sha256 => mingw.sha256.j2} | 2 ++ .../addon/depends/windows/mingw/{mingw.txt => mingw.txt.j2} | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) delete mode 100644 templates/addon/depends/common/{{ game.name }}/windows-deps.txt create mode 100644 templates/addon/depends/common/{{ game.name }}/windows-deps.txt.j2 rename templates/addon/depends/windows/mingw/{01-make.bat.in.patch => 01-make.bat.in.patch.j2} (81%) rename templates/addon/depends/windows/mingw/{02-MinGWConfig.cmake.in.patch => 02-MinGWConfig.cmake.in.patch.j2} (76%) rename templates/addon/depends/windows/mingw/{CMakeLists.txt => CMakeLists.txt.j2} (97%) rename templates/addon/depends/windows/mingw/{mingw.sha256 => mingw.sha256.j2} (61%) rename templates/addon/depends/windows/mingw/{mingw.txt => mingw.txt.j2} (68%) diff --git a/kodi_game_scripting/template_processor.py b/kodi_game_scripting/template_processor.py index abf2f23a..8c902bf4 100644 --- a/kodi_game_scripting/template_processor.py +++ b/kodi_game_scripting/template_processor.py @@ -129,6 +129,8 @@ def __getattr__(self, key): os.path.dirname(os.path.join(destination, outfile))) with open(outfile_path, 'w') as outfile_ctx: outfile_ctx.write(content) + else: + print(" Skipping empty file") # Other files are just copied else: diff --git a/templates/addon/depends/common/{{ game.name }}/windows-deps.txt b/templates/addon/depends/common/{{ game.name }}/windows-deps.txt deleted file mode 100644 index 90aa6aee..00000000 --- a/templates/addon/depends/common/{{ game.name }}/windows-deps.txt +++ /dev/null @@ -1 +0,0 @@ -mingw diff --git a/templates/addon/depends/common/{{ game.name }}/windows-deps.txt.j2 b/templates/addon/depends/common/{{ game.name }}/windows-deps.txt.j2 new file mode 100644 index 00000000..a8709167 --- /dev/null +++ b/templates/addon/depends/common/{{ game.name }}/windows-deps.txt.j2 @@ -0,0 +1,3 @@ +{% if not config.nomingw %} +mingw +{% endif %} diff --git a/templates/addon/depends/windows/mingw/01-make.bat.in.patch b/templates/addon/depends/windows/mingw/01-make.bat.in.patch.j2 similarity index 81% rename from templates/addon/depends/windows/mingw/01-make.bat.in.patch rename to templates/addon/depends/windows/mingw/01-make.bat.in.patch.j2 index 538b8240..207a96c9 100644 --- a/templates/addon/depends/windows/mingw/01-make.bat.in.patch +++ b/templates/addon/depends/windows/mingw/01-make.bat.in.patch.j2 @@ -1,3 +1,4 @@ +{% if not config.nomingw %} --- /dev/null +++ b/make.bat.in @@ -0,0 +1,5 @@ @@ -6,3 +7,4 @@ + +SET PATH=@CMAKE_CURRENT_SOURCE_DIR@\@MINGW_PATH@\bin;@CMAKE_CURRENT_SOURCE_DIR@\usr\bin;%PATH% +make.exe %* +{% endif %} diff --git a/templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch b/templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch.j2 similarity index 76% rename from templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch rename to templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch.j2 index b1776260..ba7e4d9f 100644 --- a/templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch +++ b/templates/addon/depends/windows/mingw/02-MinGWConfig.cmake.in.patch.j2 @@ -1,4 +1,6 @@ +{% if not config.nomingw %} --- /dev/null +++ b/MinGWConfig.cmake.in @@ -0,0 +1,1 @@ +set(MINGW_MAKE @CMAKE_CURRENT_SOURCE_DIR@/@MINGW_PATH@/bin/make.bat) +{% endif %} diff --git a/templates/addon/depends/windows/mingw/CMakeLists.txt b/templates/addon/depends/windows/mingw/CMakeLists.txt.j2 similarity index 97% rename from templates/addon/depends/windows/mingw/CMakeLists.txt rename to templates/addon/depends/windows/mingw/CMakeLists.txt.j2 index c70a8997..3dbd6de5 100644 --- a/templates/addon/depends/windows/mingw/CMakeLists.txt +++ b/templates/addon/depends/windows/mingw/CMakeLists.txt.j2 @@ -1,3 +1,4 @@ +{% if not config.nomingw %} cmake_minimum_required(VERSION 3.4) project(mingw) @@ -34,3 +35,4 @@ 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}) +{% endif %} diff --git a/templates/addon/depends/windows/mingw/mingw.sha256 b/templates/addon/depends/windows/mingw/mingw.sha256.j2 similarity index 61% rename from templates/addon/depends/windows/mingw/mingw.sha256 rename to templates/addon/depends/windows/mingw/mingw.sha256.j2 index fe7f0962..a8c0b105 100644 --- a/templates/addon/depends/windows/mingw/mingw.sha256 +++ b/templates/addon/depends/windows/mingw/mingw.sha256.j2 @@ -1 +1,3 @@ +{% if not config.nomingw %} bb1f1a0b35b3d96bf9c15092da8ce969a84a134f7b08811292fbc9d84d48c65d +{% endif %} diff --git a/templates/addon/depends/windows/mingw/mingw.txt b/templates/addon/depends/windows/mingw/mingw.txt.j2 similarity index 68% rename from templates/addon/depends/windows/mingw/mingw.txt rename to templates/addon/depends/windows/mingw/mingw.txt.j2 index 3fddb030..9efe5d18 100644 --- a/templates/addon/depends/windows/mingw/mingw.txt +++ b/templates/addon/depends/windows/mingw/mingw.txt.j2 @@ -1 +1,3 @@ +{% if not config.nomingw %} mingw http://mirrors.kodi.tv/build-deps/win32/msys2/msys2-base-x86_64-20161025.tar.xz +{% endif %}