From 28ef36f7844ca48f234ff07fa9fb949d5c3adce6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 20 Mar 2018 22:52:50 +0000 Subject: [PATCH] Fix emulators/hatari pre-emptively for CMake 3.11. Build error is CMake Error at /usr/local/share/cmake/Modules/CheckIncludeFiles.cmake:63 (message): Unknown arguments: HAVE_SDL_CONFIG_H which comes because SDL_INCLUDE_DIR can contain more than one element, in which case the code falls over. Further explanation is in the patch. Approved by: tcberner (mentor, implicit) --- emulators/hatari/Makefile | 2 +- emulators/hatari/files/patch-CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 emulators/hatari/files/patch-CMakeLists.txt diff --git a/emulators/hatari/Makefile b/emulators/hatari/Makefile index 80abc5e0c8a6..e483c7d1ad70 100644 --- a/emulators/hatari/Makefile +++ b/emulators/hatari/Makefile @@ -3,7 +3,7 @@ PORTNAME= hatari PORTVERSION= 2.0.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= emulators MASTER_SITES= http://download.tuxfamily.org/hatari/${PORTVERSION}/ diff --git a/emulators/hatari/files/patch-CMakeLists.txt b/emulators/hatari/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..6f69561aa339 --- /dev/null +++ b/emulators/hatari/files/patch-CMakeLists.txt @@ -0,0 +1,20 @@ +${SDL_INCLUDE_DIR} can contain more than one directory, +so using it here as if it is a single directory can confuse +check_include_files. Instead, iterate over it. + +--- CMakeLists.txt.orig 2018-03-20 22:30:14.014771000 +0000 ++++ CMakeLists.txt 2018-03-20 22:31:23.332802000 +0000 +@@ -187,7 +187,12 @@ + check_include_files(termios.h HAVE_TERMIOS_H) + check_include_files(strings.h HAVE_STRINGS_H) + check_include_files(malloc.h HAVE_MALLOC_H) +-check_include_files(${SDL_INCLUDE_DIR}/SDL_config.h HAVE_SDL_CONFIG_H) ++foreach(_sid ${SDL_INCLUDE_DIR}) ++ check_include_files(${_sid}/SDL_config.h HAVE_SDL_CONFIG_H) ++ if(HAVE_SDL_CONFIG_H) ++ break() ++ endif() ++endforeach() + check_include_files(sys/time.h HAVE_SYS_TIME_H) + check_include_files(sys/times.h HAVE_SYS_TIMES_H) + check_include_files(utime.h HAVE_UTIME_H)