From 0949c99d7e40e36343a854c1c5d06a98f80c1965 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Sat, 19 Dec 2015 17:06:04 +0100
Subject: [PATCH] Set qt-menu.nib and fix tests

---
 ci/travis/test.sh | 11 +++++++----
 setup.py          | 13 +++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ci/travis/test.sh b/ci/travis/test.sh
index 66f99edc..0c74cc97 100755
--- a/ci/travis/test.sh
+++ b/ci/travis/test.sh
@@ -6,10 +6,13 @@ eval "$(pyenv virtualenv-init -)"
 cd $HOME/build/ucoin-io/sakia
 pyenv activate sakia-env
 
-export XVFBARGS="-screen 0 1280x1024x24"
-export DISPLAY=:99.0
-sh -e /etc/init.d/xvfb start
-sleep 3
+if [ $TRAVIS_OS_NAME == "linux" ]
+then
+    export XVFBARGS="-screen 0 1280x1024x24"
+    export DISPLAY=:99.0
+    sh -e /etc/init.d/xvfb start
+    sleep 3
+fi
 
 coverage run --source=sakia.core,sakia.gui,sakia.models run_tests.py
 
diff --git a/setup.py b/setup.py
index 81773159..7ba44bd5 100644
--- a/setup.py
+++ b/setup.py
@@ -78,6 +78,7 @@ print("Zip files : ")
 print(zipincludes)
 print("Packages : ")
 print(packages)
+print("Sys.path : ")
 print(sys.path)
 
 options = {"path": sys.path,
@@ -88,6 +89,18 @@ options = {"path": sys.path,
            "zip_includes": zipincludes
            }
 
+if sys.platform == "darwin":
+    libpath = str(QtCore.QLibraryInfo.location(
+                  QtCore.QLibraryInfo.LibrariesPath))
+    for subpath in ['QtGui.framework/Resources/qt_menu.nib',
+                    'Resources/qt_menu.nib']:
+        path = os.path.join(libpath, subpath)
+        if os.path.exists(path):
+            print("Qt menu nib : ")
+            print(path)
+            options["qt-menu-nib"] = path
+            break
+
 #############################################################################
 # preparation des cibles
 base = None
-- 
GitLab