From d60b578de8f80f6ec873c015be6683bae66789ea Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 2 Feb 2015 15:58:01 +0100 Subject: [PATCH 1/5] mix on osx --- cmake/EthExecutableHelper.cmake | 3 ++- macdeployfix.sh | 38 +++++++++++++++++++++++++++++++++ mix/qml/main.qml | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 macdeployfix.sh diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index 88e2a3e16..be45031ce 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -71,8 +71,9 @@ macro(eth_install_executable EXECUTABLE) if (APPLE) # First have qt5 install plugins and frameworks add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND ${MACDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app ${eth_qml_dir} + COMMAND ${MACDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app -executable=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents/MacOS/${EXECUTABLE} ${eth_qml_dir} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents ) # This tool and next will inspect linked libraries in order to determine which dependencies are required diff --git a/macdeployfix.sh b/macdeployfix.sh new file mode 100644 index 000000000..0ff547d35 --- /dev/null +++ b/macdeployfix.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# solves problem with macdeployqt on Qt 5.4 RC +# http://qt-project.org/forums/viewthread/50118 + +BUILD_FOLDER_PATH=$1 +BUILD_QML_FOLDER_PATH="$BUILD_FOLDER_PATH/Resources/qml" +BUILD_PLUGINS_FOLDER_PATH="$BUILD_FOLDER_PATH/PlugIns" + +declare -a BROKEN_FILES; +k=0; +for j in $(find ${BUILD_QML_FOLDER_PATH} -name *.dylib); do + BROKEN_FILES[${k}]=$j + + ((k=k+1)) +done + + +for i in "${BROKEN_FILES[@]}"; do + REPLACE_STRING="$BUILD_FOLDER_PATH/" + APP_CONTENT_FILE=${i//$REPLACE_STRING/""} + IFS='/' read -a array <<< "$APP_CONTENT_FILE" + LENGTH=${#array[@]} + LAST_ITEM_INDEX=$((LENGTH-1)) + FILE=${array[${LENGTH} - 1]} + + ORIGINE_PATH=$(find ${BUILD_PLUGINS_FOLDER_PATH} -name ${FILE}) + ORIGINE_PATH=${ORIGINE_PATH//$REPLACE_STRING/""} + s="" + for((l=0;l<${LAST_ITEM_INDEX};l++)) do + s=$s"../" + done + s=$s$ORIGINE_PATH + echo "s: $s" + + REMOVE_BROKEN_ALIAS=$(rm -rf $i) + RESULT=$(ln -s $s $i) +done diff --git a/mix/qml/main.qml b/mix/qml/main.qml index a0a4ba423..657801b4b 100644 --- a/mix/qml/main.qml +++ b/mix/qml/main.qml @@ -4,6 +4,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 +import QtQuick.PrivateWidgets 1.1 import Qt.labs.settings 1.0 import org.ethereum.qml.QEther 1.0 From 7ff02f022996499df9c1a4b4b556a1ca978a4bbf Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 3 Feb 2015 09:34:57 +0100 Subject: [PATCH 2/5] fixed shell script error, when we were building target without qml files --- macdeployfix.sh | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 macdeployfix.sh diff --git a/macdeployfix.sh b/macdeployfix.sh old mode 100644 new mode 100755 index 0ff547d35..9a6ce1ebc --- a/macdeployfix.sh +++ b/macdeployfix.sh @@ -7,6 +7,12 @@ BUILD_FOLDER_PATH=$1 BUILD_QML_FOLDER_PATH="$BUILD_FOLDER_PATH/Resources/qml" BUILD_PLUGINS_FOLDER_PATH="$BUILD_FOLDER_PATH/PlugIns" +if [ ! -d ${BUILD_QML_FOLDER_PATH} ]; then + # we are not using any qml files + # gracefully exit + exit 0 +fi + declare -a BROKEN_FILES; k=0; for j in $(find ${BUILD_QML_FOLDER_PATH} -name *.dylib); do @@ -36,3 +42,4 @@ for i in "${BROKEN_FILES[@]}"; do REMOVE_BROKEN_ALIAS=$(rm -rf $i) RESULT=$(ln -s $s $i) done + From 068d8e4ebb46b7a96567130717b046a262634820 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 3 Feb 2015 15:40:34 +0100 Subject: [PATCH 3/5] verify_app instead of fixup_bundle --- cmake/EthExecutableHelper.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index be45031ce..b8276fe54 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -86,8 +86,8 @@ macro(eth_install_executable EXECUTABLE) # TODO check, how fixup_bundle works and if it is required install(CODE " include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") + set(BU_CHMOD_BUNDLE_ITEMS 1) + verify_app(\"${APP_BUNDLE_PATH}\") " COMPONENT RUNTIME ) # Cleanup duplicate libs from macdeployqt install(CODE " From 1045d14ad6c39dcc99743290aebe57ebcb526999 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 3 Feb 2015 16:43:14 +0100 Subject: [PATCH 4/5] fixed indention --- cmake/EthExecutableHelper.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index b8276fe54..6e859bf31 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -86,8 +86,8 @@ macro(eth_install_executable EXECUTABLE) # TODO check, how fixup_bundle works and if it is required install(CODE " include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - verify_app(\"${APP_BUNDLE_PATH}\") + set(BU_CHMOD_BUNDLE_ITEMS 1) + verify_app(\"${APP_BUNDLE_PATH}\") " COMPONENT RUNTIME ) # Cleanup duplicate libs from macdeployqt install(CODE " From 8bdf589117461f8ef21ca510960ccdfb65ec3bc7 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 4 Feb 2015 17:37:30 +0100 Subject: [PATCH 5/5] we do not have duplicate libs now, so we cant remove them --- cmake/EthExecutableHelper.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index 6e859bf31..427e0a9c4 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -83,19 +83,11 @@ macro(eth_install_executable EXECUTABLE) set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") endif () - # TODO check, how fixup_bundle works and if it is required install(CODE " include(BundleUtilities) set(BU_CHMOD_BUNDLE_ITEMS 1) verify_app(\"${APP_BUNDLE_PATH}\") " COMPONENT RUNTIME ) - # Cleanup duplicate libs from macdeployqt - install(CODE " - file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") - if (LINGER_RM) - file(REMOVE \${LINGER_RM}) - endif () - ") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # copy all dlls to executable directory