Skip to content

Instantly share code, notes, and snippets.

What would you like to do?


This document describes how to compile GQRX using native OSX Qt 5 and libraries from brew.


Skip any part if you have corresponding component already installed.

Mac OS X 10.10 Yosemite

Didn't check other versions.


Install using instructions from official homebrew site.

Install XCode

Actually you need just Command Line Tools, you can find that dmg package here: (apple id required).


Install Qt 5.5 Opensource:

  • go to official page;
  • click “Download Now” button and download .dmg package;
  • open and install Qt 5.5 into $HOME/Qt

I have checked Qt version 5.3 and I think any 5.* version will do, btw.

Also make sure that you don't have qt installed via homebrew, it will break build and introduce weird compile errors.


brew install cmake


Open terminal and execute the following commands:

brew tap chleggett/gr-osmosdr
brew install gr-osmosdr

If you have troubles here try to install Cheetah manually:

pip install Cheetah

Thanks to .

Compiling gqrx

Download gqrx itself:

mkdir ~/gqrx-osx
cd ~/gqrx-osx
git clone
mkdir build
cd build
export Qt5_DIR=~/Qt/5.5/clang_64/lib/cmake/Qt5
cmake ../gqrx

At this moment you have compiled working version of gqrx in the directory src, you can start it from the terminal:


If you want standalone .app file without any external dependencies, execute this magic:

mkdir -p
echo 'APPL????' >
cp ../gqrx/resources/icons/gqrx.icns
cp src/gqrx

Now create file with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">



    <string>Created by Qt/CMake</string>




Now convert gqrx.dmg to a redistributable package, first step:

~/Qt/5.5/clang_64/bin/macdeployqt -verbose=3 2> macdeployqt.log

Before the next step you need to get script, it's in the same gist below, or you can just download it using this commands:

curl -L -o
chmod +x

Execute it (in the durectory ~/gqrx-osx/build!):


You should see a few lines of text followed by text Finished!, if you don't see Finished! then something gone wrong.

At the end you should get file that doesn't contain any non-system external dependencies.

import os
import subprocess
import re
import shutil
from pprint import pprint as pp
OTR_RE = re.compile('^\t([^ ]+) (.+)')
SPLIT = re.compile('[\n\r]+')
LP_RE = re.compile('@loader_path/(.+)$')
LIB_PATHS = ['/usr/local/opt/boost/lib/']
lib_deps = {}
def iteration(pass_num):
print '\nFixing dependencied, pass: {0}'.format(pass_num)
for root, dirs, files in os.walk(FPREFIX):
for fn in files:
if not fn.endswith('.dylib'):
lib_path = os.path.join(root, fn)
deps = []
output = subprocess.check_output(['otool', '-L', lib_path])
for line in SPLIT.split(output):
mo = OTR_RE.match(line)
if mo is None:
d =
if d.startswith('/System/') or d.startswith('/usr/lib') or d.startswith('@executable_path'):
lib_deps[lib_path.replace(FPREFIX, '')] = deps
counter = 0
for lib_name, deps in lib_deps.iteritems():
for d in deps:
mo = LP_RE.match(d)
if mo is None:
counter += 1
lib =
new_fn = os.path.join(FPREFIX, lib)
missing = lib_deps.get(lib, None) is None
if missing:
print 'Library `{0}` is missing, trying to fix'.format(lib)
for p in LIB_PATHS:
fn = os.path.join(p, lib)
if os.path.exists(fn):
print ' found {0}, copy to {1}'.format(fn, new_fn)
shutil.copy(fn, new_fn)
os.chmod(new_fn, 0o644)
# fix ID
cmd = ['install_name_tool', '-id', '@executable_path/../Frameworks/{0}'.format(lib), new_fn]
print 'File `{0}`: referense to shared library broken: `{1}`, trying to fix'.format(os.path.join(FPREFIX, lib_name), lib)
cmd = ['install_name_tool', '-change', '@loader_path/{0}'.format(lib), '@executable_path/../Frameworks/{0}'.format(lib), \
os.path.join(FPREFIX, lib_name)]
return counter
for x in range(30):
if iteration(x+1) == 0:
print 'Finished!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment