Difference between revisions of "Mac OS X"

From sigrok
Jump to navigation Jump to search
 
(48 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[File:sigrok macosx.png|right|thumb|320px|sigrok-gui on Mac OS X]]
This page describes how to build the sigrok subprojects on Mac OS X.


This page describes how to build sigrok on Mac OS X.
== Binary Disk Images (DMG) ==


== How to build and run the Qt GUI ==
We provide nightly Mac OS X disk image files (DMG) for [[PulseView]] and [[sigrok-cli]] (64bit x86 only; require OSX 10.9 Mavericks or higher). Please test and [http://sigrok.org/bugzilla/ report] any issues you encounter.


These instructions have been tested on a clean Mac OS X 10.6.8 install.
<gallery widths="120px" heights="70px" perrow="5">
File:Pulseview macosx dmg.png
File:Pulseview macosx.png
</gallery>


Step 1. Install MacPorts, follow the guide on [http://www.macports.org/install.php macports.org] (this step will require Xcode on your machine, which is also a dependency to build sigrok).
Downloads:


Step 2. Install Qt, download qt-mac-opensource-4.7.4.dmg from [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x qt.nokia.com].
* [https://sigrok.org/download/binary/pulseview/PulseView-NIGHTLY.dmg Pulseview-NIGHTLY.dmg]
* [https://sigrok.org/download/binary/sigrok-cli/sigrok-cli-NIGHTLY.dmg sigrok-cli-NIGHTLY.dmg]


Step 3. Install git.
The files are self-contained and ship with all required libraries, decoders and all freely distributable firmware files.
$ '''sudo port install git-core'''
This will also pull in a bunch of dependencies required by git-core (and some of them also by sigrok).  


Step 4. Install libusb, libzip and libftdi, the sigrok build dependencies.
If you need to provide additional firmware files, you can copy them to any of the standard paths where [[libsigrok]] searches for firmware files. See [http://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=README.devices README.devices] for details.
$ '''sudo port install libusb'''
$ '''sudo port install libzip'''
$ '''sudo port install libftdi'''


Step 5. Enter some directory where you want to store the sigrok source, and check it out.
== Building from source ==
$ '''cd some-directory'''
$ '''git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok'''


Step 6. Enter the sigrok source directory.
'''Note:''' This should generally not be necessary for users, please just use the provided [[Mac_OS_X#Binary_Disk_Images_.28DMG.29|nightly installers]] (see above).
$ '''cd sigrok'''


Step 7. Generate the platform specific configure script.
=== Building from source using Homebrew ===
$ '''./autogen.sh'''
This is the recommended way of building sigrok from source on Mac OS X.


Step 8. Generate the Makefiles for the current environment.
Install [http://brew.sh Homebrew] (not covered here, see Homebrew docs for details) and all sigrok build dependencies:
$ '''./configure'''


Step 9. Compile the sigrok libraries and the sigrok-cli command-line tool.
<small>
  $ '''make'''
  $ '''brew install libzip libftdi libusb libtool glibmm doxygen autoconf-archive sdcc python3 boost qt pkg-config cmake glib autoconf automake swig check'''
</small>


Step 10. Install sigrok libraries and sigrok-cli to /usr/local/lib/ and /usr/local/bin/.
Clone [http://sigrok.org/gitweb/?p=sigrok-util.git sigrok-util]:
$ '''sudo make install'''


Step 11. Enter the gui directory.
<small>
  $ '''cd gui'''
$ '''git clone git://sigrok.org/sigrok-util'''
  $ '''cd sigrok-util/cross-compile/macosx'''
$ '''./sigrok-native-macosx'''
</small>


Step 12. Prepare the Qt project to be built using make.
This script will download all the code, compile and install it in the '''$HOME/sr_macosx''' directory.
$ '''PKG_CONFIG_PATH=/usr/local/lib/pkgconfig qmake -spec macx-g++'''


Step 13. Compile the sigrok-gui application.
To conveniently use the tools you need to export the additional path.
$ '''make'''


Step 14. Open the sigrok-gui application just built.
<small>
  $ '''open -a sigrok-gui.app'''
  $ '''export PATH=$HOME/sr_macosx/bin:$PATH'''
</small>


== Notes ==
=== Building from source using MacPorts ===


To build on Snow Leopard (10.6) you need to use the [http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x Cocoa (32bit and 64bit) Qt libraries]. Don't use the default download link on that page but the one you can find further down the page.
Not supported by us. Please use one of the methods described above.


Currently we are using [http://www.macports.org/ macports] for the libusb dependency and are relying on the fact that macports are installed in /opt/local.
While it shouldn't be too much work to adapt the [http://sigrok.org/gitweb/?p=sigrok-util.git;a=blob;f=cross-compile/macosx/sigrok-native-macosx sigrok-native-macosx] script to also work for [https://www.macports.org/ MacPorts], this is currently not recommended or supported. Patches to support both Homebrew and MacPorts in that script are welcome, though.


== TODO ==
=== Building from source manually ===


* Find a sane way to bundle libusb with the sigrok.app.
Not supported by us. Please use one of the methods described above.
* Include an icon with the app.
* [[Mac OS X/Dylib|Set the relative paths in the binary's and DyLibs]]
* [[Mac OS X/Universal| Building universal DyLibs and binaries]]
* Bundle the dynamic libraries with [http://macdylibbundler.sourceforge.net MacDylibBundler]


== Resources ==
While this is technically possible if you know what you're doing, we don't recommend or support it. It's a lot easier to use the provided DMG files or build using the [http://sigrok.org/gitweb/?p=sigrok-util.git;a=blob;f=cross-compile/macosx/sigrok-native-macosx sigrok-native-macosx] script (see above).


* [http://doc.trolltech.com/qq/qq09-mac-deployment.html Qt: Deploying Applications on Mac OS X]
=== Building from source using existing Homebrew packages/taps ===
* [http://developer.apple.com/library/mac/#documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html Porting UNIX/Linux Applications to Mac OS X]
 
* [http://cairographics.org/end_to_end_build_for_mac_os_x CairoGraphics - End to End build for Mac OS X]
Not supported by us. Please use one of the methods described above.
* [http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Documentation about bundles]
 
There are various Homebrew recipies for sigrok, e.g. in [https://github.com/Homebrew/homebrew-science homebrew-science] or in [https://github.com/rene-dev/homebrew-sigrok rene-dev's homebrew-sigrok repo]. However, none of them are officially maintained or recommended or supported by us, and they might be incomplete and/or outdated, YMMV.

Latest revision as of 14:13, 17 July 2023

This page describes how to build the sigrok subprojects on Mac OS X.

Binary Disk Images (DMG)

We provide nightly Mac OS X disk image files (DMG) for PulseView and sigrok-cli (64bit x86 only; require OSX 10.9 Mavericks or higher). Please test and report any issues you encounter.

Downloads:

The files are self-contained and ship with all required libraries, decoders and all freely distributable firmware files.

If you need to provide additional firmware files, you can copy them to any of the standard paths where libsigrok searches for firmware files. See README.devices for details.

Building from source

Note: This should generally not be necessary for users, please just use the provided nightly installers (see above).

Building from source using Homebrew

This is the recommended way of building sigrok from source on Mac OS X.

Install Homebrew (not covered here, see Homebrew docs for details) and all sigrok build dependencies:

$ brew install libzip libftdi libusb libtool glibmm doxygen autoconf-archive sdcc python3 boost qt pkg-config cmake glib autoconf automake swig check

Clone sigrok-util:

$ git clone git://sigrok.org/sigrok-util
$ cd sigrok-util/cross-compile/macosx
$ ./sigrok-native-macosx

This script will download all the code, compile and install it in the $HOME/sr_macosx directory.

To conveniently use the tools you need to export the additional path.

$ export PATH=$HOME/sr_macosx/bin:$PATH

Building from source using MacPorts

Not supported by us. Please use one of the methods described above.

While it shouldn't be too much work to adapt the sigrok-native-macosx script to also work for MacPorts, this is currently not recommended or supported. Patches to support both Homebrew and MacPorts in that script are welcome, though.

Building from source manually

Not supported by us. Please use one of the methods described above.

While this is technically possible if you know what you're doing, we don't recommend or support it. It's a lot easier to use the provided DMG files or build using the sigrok-native-macosx script (see above).

Building from source using existing Homebrew packages/taps

Not supported by us. Please use one of the methods described above.

There are various Homebrew recipies for sigrok, e.g. in homebrew-science or in rene-dev's homebrew-sigrok repo. However, none of them are officially maintained or recommended or supported by us, and they might be incomplete and/or outdated, YMMV.