Compile macOS using macports: Difference between revisions

From Strawberry Music Player Wiki
Jump to navigation Jump to search
(Created page with "Compiling on macOS using macports. == Install xcode tools == xcode-select --install == Install macports == Download and install macports from: https://www.macports.org/install.php == Prepare macports == sudo port -v selfupdate == Install dependencies == sudo port -N install glib2 pkgconfig cmake boost protobuf-cpp sqlite3 gnutls chromaprint fftw taglib sudo port -N install qt6-qtbase qt6-sqlite-plugin sudo port -N install qt6-qttools sudo...")
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Compiling on macOS using macports.
Compiling on macOS using macports.
This guide is currently not maintained and might no longer work.


== Install xcode tools ==
== Install xcode tools ==
Line 15: Line 18:
== Install dependencies ==
== Install dependencies ==


     sudo port -N install glib2 pkgconfig cmake boost protobuf-cpp sqlite3 gnutls chromaprint fftw taglib
     sudo port -N install glib2 pkgconfig cmake boost protobuf-cpp sqlite3 gnutls chromaprint fftw taglib libebur128 qt6-qtbase qt6-sqlite-plugin qt6-qttools gstreamer1 gstreamer1-gst-plugins-base gstreamer1-gst-plugins-good gstreamer1-gst-plugins-ugly gstreamer1-gst-libav libcdio libmtp libgpod libebur128
    sudo port -N install qt6-qtbase qt6-sqlite-plugin
    sudo port -N install qt6-qttools
    sudo port -N install gstreamer1 gstreamer1-gst-plugins-base gstreamer1-gst-plugins-good gstreamer1-gst-plugins-ugly gstreamer1-gst-libav
     sudo port -N install gstreamer1-gst-plugins-bad +faac +fdk_aac
     sudo port -N install gstreamer1-gst-plugins-bad +faac +fdk_aac
    sudo port -N install libcdio libmtp
    sudo port -N install libgpod


== Install create-dmg ==
== Install create-dmg ==
Line 27: Line 25:
     mkdir -p ~/build
     mkdir -p ~/build
     cd ~/build
     cd ~/build
     git clone https://github.com/create-dmg/create-dmg
     git clone --recursive https://github.com/create-dmg/create-dmg
     cd create-dmg
     cd create-dmg
     sudo make install
     sudo make install
Line 50: Line 48:
== Compile and create DMG ==
== Compile and create DMG ==


     cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/opt/local/lib/cmake -DBUILD_WITH_QT6=ON -DUSE_BUNDLE=ON
     /opt/local/libexec/qt6/bin/qt-cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_QT6=ON -DUSE_BUNDLE=ON
     make -j$(nproc)
     make -j 4
     make install
     make install
    install_name_tool -change "@rpath/QtCore.framework/Versions/A/QtCore" "/opt/local/libexec/qt6/lib/QtCore.Framework/Versions/A/QtCore" 3rdparty/macdeployqt/macdeployqt
    install_name_tool -change "@rpath/QtCore.framework/Versions/A/QtCore" "/opt/local/libexec/qt6/lib/QtCore.Framework/Versions/A/QtCore" ext/macdeploycheck/macdeploycheck
     make deploy
     make deploy
    make deploycheck
     make dmg
     make dmg



Latest revision as of 20:57, 22 November 2023

Compiling on macOS using macports.

This guide is currently not maintained and might no longer work.


Install xcode tools

   xcode-select --install

Install macports

Download and install macports from: https://www.macports.org/install.php

Prepare macports

   sudo port -v selfupdate

Install dependencies

   sudo port -N install glib2 pkgconfig cmake boost protobuf-cpp sqlite3 gnutls chromaprint fftw taglib libebur128 qt6-qtbase qt6-sqlite-plugin qt6-qttools gstreamer1 gstreamer1-gst-plugins-base gstreamer1-gst-plugins-good gstreamer1-gst-plugins-ugly gstreamer1-gst-libav libcdio libmtp libgpod libebur128
   sudo port -N install gstreamer1-gst-plugins-bad +faac +fdk_aac

Install create-dmg

   mkdir -p ~/build
   cd ~/build
   git clone --recursive https://github.com/create-dmg/create-dmg
   cd create-dmg
   sudo make install

Set environment variables

   export GIO_EXTRA_MODULES=/opt/local/lib/gio/modules
   export GST_PLUGIN_SCANNER=/opt/local/libexec/gstreamer-1.0/gst-plugin-scanner
   export GST_PLUGIN_PATH=/opt/local/lib/gstreamer-1.0

Prepare build

   mkdir -p ~/build
   cd ~/build
   git clone https://github.com/strawberrymusicplayer/strawberry
   cd strawberry
   mkdir build
   cd build

(If you already did `git clone`, do `git pull` to make sure you have the latest code).

Compile and create DMG

   /opt/local/libexec/qt6/bin/qt-cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_QT6=ON -DUSE_BUNDLE=ON
   make -j 4
   make install
   make deploy
   make deploycheck
   make dmg

You might get warnings in make deploy about missing gstreamer plugins because macports does not have all of them, they are not critical and Strawberry should still work.

Install

To install, either open the DMG, drag Strawberry over to Applications, or manually copy the strawberry.app folder over to /Applications/