Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
doc:macosx [20/09/2019 11:42] scorpio810doc:macosx [09/01/2024 16:01] (Version actuelle) – [Macports arm64 Apple silicon environments MAC Mini M2] scorpio810
Ligne 1: Ligne 1:
 ~~NOCACHE~~ ~~NOCACHE~~
-====== QElectroTech sous MacOSX ======+===== QElectroTech sous MacOSX =====
  
  
 +===== Macports arm64 Apple silicon environments MAC Mini M2 =====
  
 +<code>
 +git clone https://invent.kde.org/graphics/digikam.git
 +cd digikam/project/bundles/macports/
 +
 +</code>
 +
 +<code=diff>diff --git a/project/bundles/3rdparty/ext_kf5/CMakeLists.txt b/project/bundles/3rdparty/ext_kf5/CMakeLists.txt
 +index 41a75f247f..04307322bd 100755
 +--- a/project/bundles/3rdparty/ext_kf5/CMakeLists.txt
 ++++ b/project/bundles/3rdparty/ext_kf5/CMakeLists.txt
 +@@ -107,7 +107,7 @@ function(InstallKDEComponent
 + 
 +                             CONFIGURE_COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/../../../../bootstrap.macports <SOURCE_DIR>/. &&
 +                                               sed -i '' -e "s/DBUILD_TESTING=ON/DBUILD_TESTING=OFF/g" <SOURCE_DIR>/bootstrap.macports &&
 +-                                              <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_frameworks} debug x86_64 "${argoptions}"
 ++                                              <SOURCE_DIR>/bootstrap.macports ${EXTPREFIX_frameworks} debug arm64 "${argoptions}"
 + 
 +                             BUILD_COMMAND cd <SOURCE_DIR>/build && $(MAKE)
 + 
 +diff --git a/project/bundles/macports/01-build-macports.sh b/project/bundles/macports/01-build-macports.sh
 +index 669ec675c1..82ac0ff093 100755
 +--- a/project/bundles/macports/01-build-macports.sh
 ++++ b/project/bundles/macports/01-build-macports.sh
 +@@ -210,7 +210,7 @@ EOF
 +         # No need to build with both architectures embeded (x86 and ARM) for Apple Silicon target
 + 
 +         cat << EOF >> "$INSTALL_PREFIX/etc/macports/variants.conf"
 +-+universal
 ++++arm64
 + EOF
 + 
 +     fi
 +@@ -275,25 +275,11 @@ port install \
 +              libpng \
 +              jpeg \
 +              tiff \
 +-             boost \
 +-             eigen3 \
 +              gettext \
 +              libusb \
 +-             libgphoto2 \
 +-             jasper \
 +-             lcms2 \
 +-             expat \
 +              libxml2 \
 +              libxslt \
 +              libical \
 +-             lensfun \
 +-             bison \
 +-             py38-lxml \
 +-             x265 \
 +-             libde265 \
 +-             libheif \
 +-             aom \
 +-             ffmpeg \
 +              wget +ssl \
 +              qt5-qtbase \
 +              qt5-qtdeclarative \
 +@@ -305,22 +291,11 @@ port install \
 +              qt5-qttranslations \
 +              qt5-qtimageformats \
 +              qt5-qtnetworkauth \
 +-             qt5-sqlite-plugin \
 +-             qt5-mysql-plugin $MP_MARIADB_VARIANT
 ++             qt5-sqlite-plugin
 + 
 +-port deactivate boost
 ++#port deactivate boost
 + 
 +-if [[ $DK_QTWEBENGINE = 1 ]] ; then
 + 
 +-    port install qt5-qtwebengine
 +-
 +-else
 +-
 +-    port install qt5-qtwebkit
 +-
 +-fi
 +-
 +-port activate boost
 + 
 + # port broken since a while. check later
 + #             sane-backends \
 +@@ -360,18 +335,7 @@ cmake $ORIG_WD/../3rdparty \
 +        -DKA_VERSION=$DK_KA_VERSION \
 +        -DKP_VERSION=$DK_KP_VERSION \
 +        -DKDE_VERSION=$DK_KDE_VERSION \
 +-       -DENABLE_QTVERSION=$DK_QTVERSION \
 +-       -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \
 +-       -Wno-dev
 +-
 +-if [[ $DK_QTWEBENGINE = 0 ]] ; then
 +-    cmake --build . --config RelWithDebInfo --target ext_qtwebkit    -- -j$CPU_CORES
 +-fi
 +-
 +-cmake --build . --config RelWithDebInfo --target ext_opencv      -- -j$CPU_CORES
 +-cmake --build . --config RelWithDebInfo --target ext_imagemagick -- -j$CPU_CORES
 +-cmake --build . --config RelWithDebInfo --target ext_libjxl      -- -j$CPU_CORES
 +-cmake --build . --config RelWithDebInfo --target ext_libavif     -- -j$CPU_CORES
 ++       -DENABLE_QTVERSION=$DK_QTVERSION
 + 
 + #################################################################################################
 + 
 +diff --git a/project/bundles/macports/02-build-extralibs.sh b/project/bundles/macports/02-build-extralibs.sh
 +index a94632c1a6..ca39301c7f 100755
 +--- a/project/bundles/macports/02-build-extralibs.sh
 ++++ b/project/bundles/macports/02-build-extralibs.sh
 +@@ -68,16 +68,15 @@ cmake $ORIG_WD/../3rdparty \
 +        -DKA_VERSION=$DK_KA_VERSION \
 +        -DKP_VERSION=$DK_KP_VERSION \
 +        -DKDE_VERSION=$DK_KDE_VERSION \
 +-       -DENABLE_QTVERSION=$DK_QTVERSION \
 +-       -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \
 +-       -Wno-dev
 ++       -DENABLE_QTVERSION=$DK_QTVERSION
 ++
 + 
 + # NOTE: The order to compile each component here is very important.
 + 
 + # core KF5 frameworks dependencies
 + cmake --build . --config RelWithDebInfo --target ext_extra-cmake-modules -- -j$CPU_CORES
 + cmake --build . --config RelWithDebInfo --target ext_kconfig             -- -j$CPU_CORES
 +-cmake --build . --config RelWithDebInfo --target ext_breeze-icons        -- -j$CPU_CORES
 ++#cmake --build . --config RelWithDebInfo --target ext_breeze-icons        -- -j$CPU_CORES
 + cmake --build . --config RelWithDebInfo --target ext_kcoreaddons         -- -j$CPU_CORES
 + cmake --build . --config RelWithDebInfo --target ext_kwindowsystem       -- -j$CPU_CORES
 + cmake --build . --config RelWithDebInfo --target ext_solid               -- -j$CPU_CORES
 +@@ -106,10 +105,10 @@ cmake --build . --config RelWithDebInfo --target ext_kimageformats       -- -j$C
 + #cmake --build . --config RelWithDebInfo --target ext_libksane            -- -j$CPU_CORES
 + 
 + # Calendar support
 +-cmake --build . --config RelWithDebInfo --target ext_kcalendarcore       -- -j$CPU_CORES
 ++#cmake --build . --config RelWithDebInfo --target ext_kcalendarcore       -- -j$CPU_CORES
 + 
 + # Breeze style support
 +-cmake --build . --config RelWithDebInfo --target ext_breeze              -- -j$CPU_CORES
 ++#cmake --build . --config RelWithDebInfo --target ext_breeze              -- -j$CPU_CORES
 + 
 + #################################################################################################
 + 
 +diff --git a/project/bundles/macports/config.sh b/project/bundles/macports/config.sh
 +index 37341eefb0..65c9e37442 100644
 +--- a/project/bundles/macports/config.sh
 ++++ b/project/bundles/macports/config.sh
 +@@ -16,7 +16,7 @@ BUILDING_DIR="`pwd`/temp.build"
 + ########################################################################
 + 
 + # Target macOS architecture: "x86_64" for Intel 64 bits, or "arm64" for Apple Silicon 64 bits.
 +-ARCH_TARGET="x86_64"
 ++ARCH_TARGET="arm64"
 + 
 + if [[ $ARCH_TARGET = "x86_64" ]] ; then
 + 
 +@@ -50,7 +50,7 @@ if [[ $ARCH_TARGET = "x86_64" ]] ; then
 + elif [[ $ARCH_TARGET = "arm64" ]] ; then
 + 
 +     # Apple Silicon is supported since macOS BigSur
 +-    OSX_MIN_TARGET="11.0"
 ++    OSX_MIN_TARGET="12.3"
 + 
 + else
 + 
 +@@ -128,7 +128,7 @@ DK_VERSION=master
 + DK_DEBUG=0
 + 
 + # Option to use QtWebEngine instead QtWebkit
 +-DK_QTWEBENGINE=1
 ++DK_QTWEBENGINE=0
 + 
 + # Sign bundles with GPG. Passphrase must be hosted in ~/.gnupg/dkorg-gpg-pwd.txt
 + DK_SIGN=0
 +</code>
 +
 +Add in your .bash_profile or in zsh profile [[https://support.apple.com/en-ca/HT208050|see]]
 +
 +<code>
 +PATH="/opt/digikam.org.arm64/libexec/qt5/bin:${PATH}"
 +PATH="/opt/digikam.org.arm64/bin:${PATH}"
 +export PATH=/opt/digikam.org.arm64/libexec:$PATH
 +export PATH=/opt/digikam.org.arm64/include:$PATH
 +</code>
 +
 +<code>
 +Copy your libs KF5 *.pri  /opt/digikam.org.arm64/mkspecs/modules/  to /opt/digikam.org.arm64/libexec/qt5/mkspecs/modules/
 +Edit your libs KF5 *.pri files in /opt/digikam.org.arm64/libexec/qt5/mkspecs/modules/ like this:
 +
 +QT.KCoreAddons.VERSION = 5.110.0
 +QT.KCoreAddons.MAJOR_VERSION = 5
 +QT.KCoreAddons.MINOR_VERSION = 110
 +QT.KCoreAddons.PATCH_VERSION = 0
 +QT.KCoreAddons.name = KF5CoreAddons
 +QT.KCoreAddons.module = KF5CoreAddons
 +QT.KCoreAddons.defines = 
 +QT.KCoreAddons.includes =  $$PWD/../../include/KF5/KCoreAddons
 +QT.KCoreAddons.private_includes =
 +QT.KCoreAddons.libs = $$PWD/../../lib
 +QT.KCoreAddons.depends = core
 +QT.KCoreAddons.module_config = 
 +
 +To:
 +
 +
 +QT.KCoreAddons.VERSION = 5.110.0
 +QT.KCoreAddons.MAJOR_VERSION = 5
 +QT.KCoreAddons.MINOR_VERSION = 110
 +QT.KCoreAddons.PATCH_VERSION = 0
 +QT.KCoreAddons.name = KF5CoreAddons
 +QT.KCoreAddons.module = KF5CoreAddons
 +QT.KCoreAddons.defines = 
 +QT.KCoreAddons.includes =  /opt/digikam.org.arm64/include/KF5/KCoreAddons
 +QT.KCoreAddons.private_includes =
 +QT.KCoreAddons.libs = /opt/digikam.org.arm64/lib
 +QT.KCoreAddons.depends = core
 +QT.KCoreAddons.module_config = 
 +
 +</code>
 +  
 +===== MacOS Macports environment (new 2023) =====
 +
 + 
 +We use now Digikam scripts, for create Qt 5.15.X compile environment with qt5-sqlite-plugin (Sqilte3) for database project exporting.\\
 +See:
 +https://invent.kde.org/graphics/digikam/-/tree/master/project/bundles/macports \\
 +First read the README file: \\
 +https://invent.kde.org/graphics/digikam/-/blob/master/project/bundles/macports/README
 +
 +We only use __01-build-macports.sh__ and __02-build-extralibs.sh script__ to build MacOS Macports environment for QET builds. 
 +
 +<code>
 +git clone https://invent.kde.org/graphics/digikam.git
 +cd digikam/project/bundles/macports/</code>
 +
 +//You can comment some packages which are not useful for QElectroTech \\
 +like qt5-qtwebengine, qt5-qtwebkit, etc.//
 +<code>
 +bash ./01-build-macports.sh
 +
 +</code>If ok then
 +
 +//you can comment some packages which are not useful for QElectroTech, \\
 +but keep ext_kcoreaddons and ext_kwidgetsaddons!//
 +<code>
 +bash ./02-build-extralibs.sh 
 +</code>
 +Add in your .bash_profile or in zsh profile [[https://support.apple.com/en-ca/HT208050|see]]
 +<code>
 +# Setting PATH for Qt5.15.x
 +PATH="/opt/digikam.org.x86_64/libexec/qt5/bin:${PATH}"
 +PATH="/opt/digikam.org.x86_64/bin:${PATH}"
 +export PATH=/opt/digikam.org.x86_64/libexec:$PATH
 +export PATH=/opt/digikam.org.x86_64/include:$PATH
 +
 +</code>
 +Note : On APPLE M1/2 chips replace in PATH  /opt/digikam.org.x86_64 by /opt/digikam.org.arm64 \\
 +but with Qt 5.15.8 environment can't compil like:
 +//Can't build QET with MacPorts and Digikam scripts, I have linking errors:
 +............building for macOS-arm64 but attempting to link with file config macOS-x86_64..... For KF5 libs...//
 +
 +
 +Get GIT sources
 +<code>
 +git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
 +</code>
 +Build bundle:
 +We need to add lang1 in qet_git directory with [[https://download.qelectrotech.org/qet/Qt_lang/lang1.zip|these unzipped files]] \\
 +And create a MAC_OS_X directory in your home otherwise bundles builds was located in /build-aux/mac-osx/ folder.
 +<code>
 +bash qet_git/misc/MacQetDeploy.sh 
 +</code>  
 +
 +===== MacOS Homebrew environment (old) =====
 +
 +* Note : we can't use Qt 5 sqlite3 plug-in without compile Qt 5 \\
 +[[https://invent.kde.org/packaging/homebrew-kde]]
  
  
  
 <code> <code>
-command xcode-select --install 
 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-brew tap kde-mac/kde + 
-brew install kde-mac/kde/kf5-karchive+brew install qt@5 
 + 
 +brew untap kde-mac/kde 2> /dev/null 
 +brew tap kde-mac/kde https://invent.kde.org/packaging/homebrew-kde.git --force-auto-update 
 +"$(brew --repo kde-mac/kde)/tools/do-caveats.sh" 
 + 
 brew install kde-mac/kde/kf5-kwidgetsaddons brew install kde-mac/kde/kf5-kwidgetsaddons
 brew install kde-mac/kde/kf5-kcoreaddons brew install kde-mac/kde/kf5-kcoreaddons
Ligne 20: Ligne 300:
 cp /usr/local/opt/kf5-kwidgetsaddons/mkspecs/modules/qt_KWidgetsAddons.pri  /usr/local/opt/qt5/mkspecs/modules/ cp /usr/local/opt/kf5-kwidgetsaddons/mkspecs/modules/qt_KWidgetsAddons.pri  /usr/local/opt/qt5/mkspecs/modules/
 cp /usr/local/opt/kf5-kcoreaddons/mkspecs/modules/qt_KCoreAddons.pri /usr/local/opt/qt5/mkspecs/modules/ cp /usr/local/opt/kf5-kcoreaddons/mkspecs/modules/qt_KCoreAddons.pri /usr/local/opt/qt5/mkspecs/modules/
-cp /usr/local/opt/kf5-karchive/mkspecs/modules/qt_KArchive.pri /usr/local/opt/qt5/mkspecs/modules/+
 </code> </code>
 +Edit KF5 .pri file $$PWD/.../ PATH like this
  
 +<code>QT.KCoreAddons.VERSION = 5.99.0
 +QT.KCoreAddons.MAJOR_VERSION = 5
 +QT.KCoreAddons.MINOR_VERSION = 99
 +QT.KCoreAddons.PATCH_VERSION = 0
 +QT.KCoreAddons.name = KF5CoreAddons
 +QT.KCoreAddons.module = KF5CoreAddons
 +QT.KCoreAddons.defines = 
 +QT.KCoreAddons.includes =  $$PWD/../../include/KF5/KCoreAddons
 +QT.KCoreAddons.private_includes =
 +QT.KCoreAddons.libs = $$PWD/../../lib
 +QT.KCoreAddons.depends = core
 +QT.KCoreAddons.module_config = 
 +
 +</code>
 +
 +to
 +<code>
 +
 +QT.KCoreAddons.VERSION = 5.99.0
 +QT.KCoreAddons.MAJOR_VERSION = 5
 +QT.KCoreAddons.MINOR_VERSION = 99
 +QT.KCoreAddons.PATCH_VERSION = 0
 +QT.KCoreAddons.name = KF5CoreAddons
 +QT.KCoreAddons.module = KF5CoreAddons
 +QT.KCoreAddons.defines = 
 +QT.KCoreAddons.includes =  /usr/local/opt/kf5-kcoreaddons/include/KF5/KCoreAddons
 +QT.KCoreAddons.private_includes =
 +QT.KCoreAddons.libs = /usr/local/opt/kf5-kcoreaddons/lib
 +QT.KCoreAddons.depends = core
 +QT.KCoreAddons.module_config = 
 +</code>
 +Same things for qt_KWidgetsAddons.pri
  
 <code> <code>
 cat .bash_profile  cat .bash_profile 
-# Setting PATH for Qt5.13.1 +# Setting PATH for Qt5.15.7 
-PATH="/usr/local/Cellar/qt/5.13.1/bin:${PATH}"+PATH="/usr/local/Cellar/qt@5/5.15.7/bin:${PATH}"
 export PATH=/usr/local/lib:$PATH export PATH=/usr/local/lib:$PATH
 export PATH export PATH
Ligne 34: Ligne 347:
  
 <code> <code>
-git clone git://git.tuxfamily.org/gitroot/qet/qet.git qet_git+git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
 </code> </code>
  
Ligne 45: Ligne 358:
 cd qet_git/ cd qet_git/
 qmake -spec macx-clang qmake -spec macx-clang
-make -j16+make -j24
 </code> </code>
  
  
 +===== Old Documentation =====
  
  
Ligne 55: Ligne 369:
 Testé sous El Capitan (10.11). Testé sous El Capitan (10.11).
  
-===== Préparation de l'environnement =====+==== Préparation de l'environnement ==== 
 ==== Compiler un programme C++ : XCode ==== ==== Compiler un programme C++ : XCode ====
 Pour disposer d'un compilateur C++ et de l'outil make, vous devez installer  Pour disposer d'un compilateur C++ et de l'outil make, vous devez installer 
Imprimer/exporter