From 834d54415f289340e1b6e4630543c851128a4c06 Mon Sep 17 00:00:00 2001 From: Johannes Maibaum Date: Mon, 8 Dec 2014 12:40:38 -0500 Subject: [PATCH] OSX build fixes. * Make patches/wxwidgets-3.0.2_macosx_yosemite.patch usable. There were complaints here before that the patch does not work because it is a "metapatch" that tries to patch another patch (which is not in the tree and therefore fails). With this change, it becomes a normal patch again, that can be applied to the wxWidgets source tree as described in Documentation/compiling/mac-osx.txt. * Make scripts/library-repos-install.sh compatible with OSX: This involves checking for the correct option to enable extended regular expressions in sed during detect_pretty_repos, as the script uses "-r", which is only available in GNU sed. The sed shipped with Mac OSX is an older BSD descendant sed which needs "-E". This change has been tested to work on Mac OSX 10.10.1 and on an up-to-date Arch Linux. I also changed the error message during --install-prerequisites to inform users without apt-get or yum which programs need to be installed to use the script. * Add the execute flag to scripts/osx_build_wx.sh: At the moment, after fetching the source with bzr, one has to chmod the file by hand. This change change ensures consistency between the script and the build docs for OSX, which assumes the script to be executable. --- patches/wxwidgets-3.0.2_macosx_yosemite.patch | 39 +++++-------------- scripts/library-repos-install.sh | 18 ++++++++- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/patches/wxwidgets-3.0.2_macosx_yosemite.patch b/patches/wxwidgets-3.0.2_macosx_yosemite.patch index 1746d228bb..30e2587bee 100644 --- a/patches/wxwidgets-3.0.2_macosx_yosemite.patch +++ b/patches/wxwidgets-3.0.2_macosx_yosemite.patch @@ -1,31 +1,10 @@ -=== modified file 'patches/wxwidgets-3.0.2_macosx_yosemite.patch' ---- patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-04 19:24:22 +0000 -+++ patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-12 01:54:50 +0000 -@@ -1,15 +1,11 @@ --=== added file 'patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch' ----- patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 1970-01-01 00:00:00 +0000 --+++ patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 2014-10-29 18:17:55 +0000 --@@ -0,0 +1,11 @@ --+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 --++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 --+@@ -28,7 +28,7 @@ --+ #include "wx/hashmap.h" --+ #include "wx/filesys.h" --+ --+-#include --++#include --+ #include --+ #include --+ -+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 -++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 -+@@ -28,7 +28,7 @@ -+ #include "wx/hashmap.h" -+ #include "wx/filesys.h" -+ -+-#include -++#include -+ #include -+ #include -+ +--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 ++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 +@@ -28,7 +28,7 @@ + #include "wx/hashmap.h" + #include "wx/filesys.h" +-#include ++#include + #include + #include diff --git a/scripts/library-repos-install.sh b/scripts/library-repos-install.sh index aa129d3c8b..b02e7d2d54 100755 --- a/scripts/library-repos-install.sh +++ b/scripts/library-repos-install.sh @@ -70,7 +70,9 @@ install_prerequisites() sed else echo - echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to continue." + echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to" + echo "continue. Please make sure to install git, curl, and sed before using this" + echo "script." echo exit 1 fi @@ -107,11 +109,23 @@ cmake_uninstall() detect_pretty_repos() { + # Check for the correct option to enable extended regular expressions in + # sed. This is '-r' for GNU sed and '-E' for (older) BSD-like sed, as on + # Mac OSX. + if [ $(echo | sed -r '' &>/dev/null; echo $?) -eq 0 ]; then + SED_EREGEXP="-r" + elif [ $(echo | sed -E '' &>/dev/null; echo $?) -eq 0 ]; then + SED_EREGEXP="-E" + else + echo "Your sed command does not support extended regular expressions. Cannot continue." + exit 1 + fi + # Use github API to list repos for org KiCad, then subset the JSON reply for only # *.pretty repos PRETTY_REPOS=`curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> /dev/null \ | grep full_name | grep pretty \ - | sed -r 's:.+ "KiCad/(.+)",:\1:'` + | sed $SED_EREGEXP 's:.+ "KiCad/(.+)",:\1:'` #echo "PRETTY_REPOS:$PRETTY_REPOS"