Difference between revisions of "Mac OS X"

From sigrok
Jump to navigation Jump to search
(DMG file.)
 
(12 intermediate revisions by 3 users not shown)
Line 3: Line 3:
== Binary Disk Images (DMG) ==
== Binary Disk Images (DMG) ==


We provide nightly Mac OS X disk image files (DMG) for [[PulseView]]. Please test and [http://sigrok.org/bugzilla/ report] any issues you encounter.
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.
 
<gallery widths="120px" heights="70px" perrow="5">
File:Pulseview macosx dmg.png
File:Pulseview macosx.png
</gallery>


Downloads:
Downloads:


* [http://sigrok.org/jenkins/job/sigrok-native-macosx/platform=native-macosx/lastSuccessfulBuild/artifact/cross-compile/macosx/build_app/PulseView_nightly.dmg PulseView_nightly.dmg]
* [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]


The files are self-contained and ship with all required libraries, decoders and all freely distributable firmware files.
The files are self-contained and ship with all required libraries, decoders and all freely distributable firmware files.
Line 13: Line 19:
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.
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.


== Building using a script under Homebrew ==
== Building from source ==
 
'''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).


This is the recommended way of building sigrok from sources on MacOS at the moment. (and yes it is homebrew only)
=== Building from source using Homebrew ===
This is the recommended way of building sigrok from source on Mac OS X.


Install build dependencies:
Install [http://brew.sh Homebrew] (not covered here, see Homebrew docs for details) and all sigrok build dependencies:


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


Clone sigrok-util:
Clone [http://sigrok.org/gitweb/?p=sigrok-util.git sigrok-util]:


<small>
<small>
Line 31: Line 40:
</small>
</small>


This tool will download all the code, compile and install it in your home directory in '''sr_macosx''' directory. To use the tools you need to export the additional path.
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.


<small>
<small>
Line 37: Line 48:
</small>
</small>


You should be now able to access all the bleeding cutting edge sigrok tools from the command line. :)
=== Building from source using MacPorts ===
 
== Building using Homebrew ==
 
These instructions have been tested on Mac OS X 10.9.1.
 
=== Requirements ===
 
Install [http://brew.sh Homebrew].
 
Tap sigrok:
 
<small>
$ '''brew tap rene-dev/sigrok'''
</small>
 
If you want [[PulseView]], you must install unstable.
 
=== Unstable ===
 
<small>
$ '''brew install python3'''
$ '''brew install --HEAD libserialport'''
$ '''brew install --HEAD --with-libserialport libsigrok'''
$ '''brew install --HEAD libsigrokdecode'''
$ '''brew install --HEAD --with-libserialport sigrok-cli'''
$ '''brew install --HEAD pulseview'''
</small>
 
=== Stable ===
 
If you just want [[sigrok-cli]], you can install stable.
 
<small>
$ '''brew install sigrok-cli'''
</small>
 
== Building manually ==
 
These instructions have been tested on a clean install of Mac OS X 10.6.8, 10.8.4, 10.9.1 and 10.11.1.
 
=== Requirements ===
 
Install MacPorts, follow the guide on [http://www.macports.org/install.php macports.org] (this step will require Xcode and Command Line Tools for Xcode be installed on your machine, which are also a dependencies to build sigrok).
 
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] (Only needed for [[PulseView]]).
 
Install git (not needed at least with 10.8.4):
 
<small>
$ '''sudo port install git-core'''
</small>
 
This will also pull in a bunch of dependencies required by git-core (and some of them also by sigrok).
 
Install boost, libusb, libzip and libftdi, the libsigrok build dependencies:
 
<small>
$ '''sudo port install boost libusb libzip libftdi0'''
</small>
 
Install autoconf, automake, cmake, glib2.0+, python 3.3, libtool and pkgconfig to satisfy version dependencies in the build process.
 
<small>
$ '''sudo port install autoconf automake cmake glib2 python33 libtool pkgconfig'''
</small>
 
Set the PKG_CONFIG_PATH environment variable to reflect the future locations of libsigrok and libsigrokdecode for the sigrok-cli build process.
 
<small>
$ '''export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/'''
</small>
 
=== libserialport ===
 
[[libserialport]] is optional and required only for devices with serial connection, e.g. most multimeters. If not present during configuring libsigrok, the respective drivers in libsigrok will be disabled.
 
<small>
$ '''git clone git://sigrok.org/libserialport'''
$ '''cd libserialport'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>
 
=== libsigrok ===
 
<small>
$ '''git clone git://sigrok.org/libsigrok'''
$ '''cd libsigrok'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>
 
=== libsigrokdecode ===
 
<small>
$ '''git clone git://sigrok.org/libsigrokdecode'''
$ '''cd libsigrokdecode'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>
 
=== sigrok-cli ===
 
<small>
$ '''git clone git://sigrok.org/sigrok-cli'''
$ '''cd sigrok-cli'''
$ '''./autogen.sh'''
$ '''./configure'''
$ '''make'''
$ '''sudo make install'''
</small>
 
=== PulseView ===


$ '''git clone git://sigrok.org/pulseview'''
Not supported by us. Please use one of the methods described above.
$ '''cd pulseview'''
$ '''cmake .'''
$ '''make'''
$ '''sudo make install'''


Hint: if something goes wrong, you can see what cmake is doing by running
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.
$ '''cmake VERBOSE=1'''


== Notes ==
=== Building from source manually ===


* 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.
** Python framework incorrect build for OS X [http://bugs.python.org/issue15353 issue 15353]


== TODO ==
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).


* Find a sane way to bundle libusb with the sigrok.app.
=== Building from source using existing Homebrew packages/taps ===
* 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 ==
Not supported by us. Please use one of the methods described above.


* [http://doc.trolltech.com/qq/qq09-mac-deployment.html Qt: Deploying Applications on Mac OS X]
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.
* [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]
* [http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i-CH1-SW1 Documentation about bundles]
* [http://stackoverflow.com/questions/1596945/building-osx-app-bundle Stackoverflow - Building OSX App Bundle]

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.