diff --git a/build.sh b/build.sh index 6a6190433..ece48ac1b 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# +# # KLayout Layout Viewer # Copyright (C) 2006-2017 Matthias Koefferlein # @@ -17,10 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# CURR_DIR=`pwd` RUN_MAKE=1 +IS_MAC="no" HAVE_QTBINDINGS=1 HAVE_64BIT_COORD=0 @@ -46,6 +47,16 @@ MAKE_OPT="" CONFIG="release" BUILD_EXPERT=0 +# Check if building on Mac OSX Darwin family +case `uname` in + Darwin*) + IS_MAC="yes" + ;; + *) + IS_MAC="no" + ;; +esac + # Check, whether build.sh is run from the top level folder if ! [ -e src ] || ! [ -e src/klayout.pro ]; then echo "*** ERROR: run build.sh from the top level folder" @@ -200,7 +211,7 @@ done echo "Scanning installation .." echo "" -# Import version info +# Import version info . ./version.sh echo "Version Info:" @@ -212,8 +223,8 @@ echo "" # if not given, try to detect the qmake binary if [ "$QMAKE" = "" ]; then for qmake in "qmake5" "qmake-qt5" "qmake4" "qmake-qt4" "qmake"; do - if [ "$QMAKE" = "" ] && [ "`$qmake -v 2>/dev/null`" != "" ]; then - QMAKE="$qmake" + if [ "$QMAKE" = "" ] && [ "`$qmake -v 2>/dev/null`" != "" ]; then + QMAKE="$qmake" fi done fi @@ -246,8 +257,8 @@ echo "" # if not given, locate ruby interpreter (prefer 1.9, then default, finally 1.8 as fallback) if [ "$RUBY" = "" ]; then for ruby in "ruby2.4" "ruby2.3" "ruby2.2" "ruby2.1" "ruby2" "ruby1.9" "ruby" "ruby1.8"; do - if [ "$RUBY" = "" ] && [ "`$ruby -e 'puts 1' 2>/dev/null`" = "1" ]; then - RUBY="$ruby" + if [ "$RUBY" = "" ] && [ "`$ruby -e 'puts 1' 2>/dev/null`" = "1" ]; then + RUBY="$ruby" fi done fi @@ -314,7 +325,7 @@ if [ "$RUBY" != "" ] && [ "$RUBY" != "-" ]; then RUBYINCLUDE2=`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['rubyarchhdrdir'] || '')"` fi if [ "$RUBYINCLUDE2" = "" ]; then - RUBYINCLUDE2="$RUBYHDRDIR"/`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['arch'] || '')"` + RUBYINCLUDE2="$RUBYHDRDIR"/`$RUBY -rrbconfig -e "puts (RbConfig::CONFIG['arch'] || '')"` fi echo " Ruby headers found: $RUBYINCLUDE and $RUBYINCLUDE2" fi @@ -329,11 +340,11 @@ if [ "$RUBY" != "" ] && [ "$RUBY" != "-" ]; then fi -# if not given, locate Python interpreter +# if not given, locate Python interpreter if [ "$PYTHON" = "" ]; then for python in "python3.5" "python3.4" "python3.3" "python3.2" "python3.1" "python3" "python2.8" "python2.7" "python2" "python"; do - if [ "$PYTHON" = "" ] && [ "`$python -c 'print(1)' 2>/dev/null`" = "1" ]; then - PYTHON="$python" + if [ "$PYTHON" = "" ] && [ "`$python -c 'print(1)' 2>/dev/null`" = "1" ]; then + PYTHON="$python" fi done fi @@ -468,11 +479,21 @@ mkdir -p $BUILD . $(dirname $(which $0))/version.sh # qmake needs absolute paths, so we get them now: -BUILD=`readlink -f $BUILD` -BIN=`readlink -f $BIN` +# OSX does not have `readlink -f` command. Use equivalent Perl script. +if [ "$IS_MAC" = "no" ]; then + BUILD=`readlink -f $BUILD` + BIN=`readlink -f $BIN` +else + BUILD=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BUILD` + BIN=`perl -MCwd -le 'print Cwd::abs_path(shift)' $BIN` +fi -if ( gmake -v >/dev/null 2>/dev/null ); then - MAKE_PRG=gmake +if [ "$IS_MAC" = "no" ]; then + if ( gmake -v >/dev/null 2>/dev/null ); then + MAKE_PRG=gmake + else + MAKE_PRG=make + fi else MAKE_PRG=make fi diff --git a/macbuild/macbuildQt4.sh b/macbuild/macbuildQt4.sh new file mode 100755 index 000000000..4153ebc0d --- /dev/null +++ b/macbuild/macbuildQt4.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Using Qt 4.8.7 from Mac Ports. +# +# Ruby: OSX native +# Python: OSX native +./build.sh \ + -release \ + -qmake /opt/local/libexec/qt4/bin/qmake \ + -build ./qt4.build.macos-high-sierra \ + -bin ./qt4.bin.macos-high-sierra \ + -option -j2 \ + -with-qtbinding \ + -qt4 \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ + -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ + -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ + -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ + -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ + | tee macbuildQt4.log diff --git a/macbuild/macbuildQt5.sh b/macbuild/macbuildQt5.sh new file mode 100755 index 000000000..32034dc0f --- /dev/null +++ b/macbuild/macbuildQt5.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Using Qt 5.9.3 from Mac Ports. +# +# Ruby: OSX native +# Python: OSX native +./build.sh \ + -release \ + -qmake /opt/local/libexec/qt5/bin/qmake \ + -build ./qt5.build.macos-high-sierra \ + -bin ./qt5.bin.macos-high-sierra \ + -option -j2 \ + -with-qtbinding \ + -qt5 \ + -ruby /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby \ + -python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python \ + -rbinc /System/Library/Frameworks/Ruby.framework/Headers \ + -rblib /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib \ + -pyinc /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 \ + -pylib /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib 2>&1 \ + | tee macbuildQt5.log diff --git a/scripts/mkqtdecl5/mkqtdecl.conf b/scripts/mkqtdecl5/mkqtdecl.conf index a704ebc95..ee58b82a4 100644 --- a/scripts/mkqtdecl5/mkqtdecl.conf +++ b/scripts/mkqtdecl5/mkqtdecl.conf @@ -1484,6 +1484,8 @@ final_class "QAccessibleObject" # because navigate cannot be implemented # final_class "QAccessiblePlugin" # because navigate cannot be implemented final_class "QAccessibleWidget" # because navigate cannot be implemented +no_copy_ctor "QIconEngine" + # -------------------------------------------------------------- # QtXml diff --git a/src/buddies/src/buddy_app.pri b/src/buddies/src/buddy_app.pri index 644bb5944..907d0e225 100644 --- a/src/buddies/src/buddy_app.pri +++ b/src/buddies/src/buddy_app.pri @@ -35,3 +35,5 @@ equals(HAVE_PYTHON, "1") { DEFINES += BD_TARGET=$$TARGET + +LIBS += $$RUBYLIBFILE diff --git a/src/db/db/dbArray.h b/src/db/db/dbArray.h index 083a02843..253a043bb 100644 --- a/src/db/db/dbArray.h +++ b/src/db/db/dbArray.h @@ -1208,7 +1208,7 @@ struct array_iterator typedef void pointer_type; typedef void difference_type; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; /** * @brief The default constructor diff --git a/src/db/db/dbHash.h b/src/db/db/dbHash.h index 57c9a5f45..28d56fc26 100644 --- a/src/db/db/dbHash.h +++ b/src/db/db/dbHash.h @@ -74,7 +74,7 @@ namespace DB_HASH_NAMESPACE }; #endif -#if defined(_WIN64) +#if defined(_WIN64) || defined(__APPLE__) /** * @brief Specialization missing for long long on WIN64 */ diff --git a/src/db/db/gsiDeclDbLayoutQuery.cc b/src/db/db/gsiDeclDbLayoutQuery.cc index 5f2b47ec2..0c417e0fc 100644 --- a/src/db/db/gsiDeclDbLayoutQuery.cc +++ b/src/db/db/gsiDeclDbLayoutQuery.cc @@ -70,7 +70,7 @@ struct LayoutQueryIteratorWrapper { typedef db::LayoutQueryIterator &reference; // Dummy declarations - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; diff --git a/src/db/db/gsiDeclDbShape.cc b/src/db/db/gsiDeclDbShape.cc index 69b926d5d..96dbf44c1 100644 --- a/src/db/db/gsiDeclDbShape.cc +++ b/src/db/db/gsiDeclDbShape.cc @@ -954,7 +954,7 @@ struct ConvertingIteratorWrapper typedef T value_type; typedef T reference; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; ConvertingIteratorWrapper (double dbu, const I &b, const I &e) : m_b (b), m_e (e), m_dbu (dbu) @@ -989,7 +989,7 @@ struct ConvertingFreeIteratorWrapper typedef T value_type; typedef T reference; typedef void pointer; - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; ConvertingFreeIteratorWrapper (double dbu, const I &b) : m_b (b), m_dbu (dbu) diff --git a/src/gsi/gsi/gsiIterators.h b/src/gsi/gsi/gsiIterators.h index 35c53253f..87d69fdcd 100644 --- a/src/gsi/gsi/gsiIterators.h +++ b/src/gsi/gsi/gsiIterators.h @@ -28,6 +28,8 @@ #include "tlTypeTraits.h" #include "gsiSerialisation.h" +#include + // For a comprehensive documentation see gsi.h namespace gsi diff --git a/src/gsiqt5/gsiDeclQtTypeTraits.h b/src/gsiqt5/gsiDeclQtTypeTraits.h index eba0986d8..dd68128e6 100644 --- a/src/gsiqt5/gsiDeclQtTypeTraits.h +++ b/src/gsiqt5/gsiDeclQtTypeTraits.h @@ -3418,6 +3418,7 @@ template <> struct type_traits : public type_traits { class QIconEngine_Adaptor; namespace tl { template <> struct type_traits : public type_traits { + typedef tl::false_tag has_copy_constructor; }; } diff --git a/src/gsiqt5/gsiDeclQt_4.cc b/src/gsiqt5/gsiDeclQt_4.cc index b7686491a..fdceadbce 100644 --- a/src/gsiqt5/gsiDeclQt_4.cc +++ b/src/gsiqt5/gsiDeclQt_4.cc @@ -21,9 +21,9 @@ */ /** -* @file gsiDeclQt_4.cc +* @file gsiDeclQt_4.cc * -* DO NOT EDIT THIS FILE. +* DO NOT EDIT THIS FILE. * This file has been created automatically */ @@ -153,9 +153,15 @@ static gsi::Enum decl_Qt_WindowType_Enum ("Qt_WindowType", gsi::enum_const ("MacWindowToolBarButtonHint", Qt::MacWindowToolBarButtonHint, "@brief Enum constant Qt::MacWindowToolBarButtonHint") + gsi::enum_const ("BypassGraphicsProxyWidget", Qt::BypassGraphicsProxyWidget, "@brief Enum constant Qt::BypassGraphicsProxyWidget") + gsi::enum_const ("NoDropShadowWindowHint", Qt::NoDropShadowWindowHint, "@brief Enum constant Qt::NoDropShadowWindowHint") + +#if defined(__APPLE__) + // Qt::WindowOkButtonHint and Qt::WindowCancelButtonHint are supported for Windows CE. + // By Kazunari Sekigawa (December 10, 2017) + gsi::enum_const ("WindowFullscreenButtonHint", Qt::WindowFullscreenButtonHint, "@brief Enum constant Qt::WindowFullscreenButtonHint"), +#else gsi::enum_const ("WindowFullscreenButtonHint", Qt::WindowFullscreenButtonHint, "@brief Enum constant Qt::WindowFullscreenButtonHint") + gsi::enum_const ("WindowOkButtonHint", Qt::WindowOkButtonHint, "@brief Enum constant Qt::WindowOkButtonHint") + gsi::enum_const ("WindowCancelButtonHint", Qt::WindowCancelButtonHint, "@brief Enum constant Qt::WindowCancelButtonHint"), +#endif "@qt\n@brief This class represents the Qt::WindowType enum"); static gsi::QFlagsClass decl_Qt_WindowType_Enums ("Qt_QFlags_WindowType", diff --git a/src/laybasic/laybasic/gsiDeclLayLayoutView.cc b/src/laybasic/laybasic/gsiDeclLayLayoutView.cc index 0d28c0693..3ce4c3c90 100644 --- a/src/laybasic/laybasic/gsiDeclLayLayoutView.cc +++ b/src/laybasic/laybasic/gsiDeclLayLayoutView.cc @@ -320,7 +320,7 @@ namespace { typedef lay::LayerPropertiesNodeRef value_type; typedef lay::LayerPropertiesNodeRef reference; // Dummy declarations required for std::iterator_traits - typedef void iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef void difference_type; typedef void pointer; diff --git a/version.sh b/version.sh index 192f149dc..700ecbd8d 100644 --- a/version.sh +++ b/version.sh @@ -5,8 +5,11 @@ KLAYOUT_VERSION="0.25" # The build date -KLAYOUT_VERSION_DATE=$(date --iso-8601) +KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d") # The short SHA hash of the commit -KLAYOUT_VERSION_REV=$(git rev-parse --short HEAD) +KLAYOUT_VERSION_REV=$(git rev-parse --short HEAD 2>/dev/null) +if [ "$KLAYOUT_VERSION_REV" = "" ]; then + KLAYOUT_VERSION_REV="LatestSourcePackage" +fi