[Qgis-developer] Building on OSX with brew
larrys at dakotacarto.com
Fri Mar 28 17:45:17 PDT 2014
Just a quick note that the homebrew-osgeo repo (tap) is now under the OSGeo
user account ; switched over today. Since it was transferred on github,
the dakcarto/osgeo4mac tap should still work, since it is aliased by
github. If you run into issues, follow the new notes here , i.e. switch
taps. Sorry about the timing.
If you have the Kyngchaos stable QGIS packages installed, you may be better
off using the Homebrew python (and rebuilding), but only if you run into
significant Python issues, some of which many not show up until you run the
app. This is because the Kyngchaos GDAL.framework and others already have
*.pth files in your system site-packages.
This is the reason for the 'isolation' mode in the qgis-22 formula and the
use of the osgeo-osgeo4mac/enviro/python_startup.py script: to coexist, and
not interfere, with the Kyngchaos install. Isolation requires a separate
Python, for now, since initializing a virtualenv for QGIS.app on
double-click startup is not yet supported (at least I think it's not). In
isolation mode, no modules from /Library/* locations are loaded. So, you
will have to install all modules in Homebrew's site-packages, using
Be really nice to have a virtualenv creation and configuration GUI in the
main Options, as previously discussed.
On Fri, Mar 28, 2014 at 5:09 PM, Tim Sutton <lists at linfiniti.com> wrote:
> On Thu, Mar 27, 2014 at 9:05 PM, Larry Shaffer <larrys at dakotacarto.com>wrote:
>> Hi Tim,
>> On Thu, Mar 27, 2014 at 5:57 AM, Tim Sutton <lists at linfiniti.com> wrote:
>>> Hi Larry
>>> I finally have the time to sit down and try to get your recipe for
>>> building / debugging QGIS under QtCreator a try, but I cant seem to find
>>> your notes on this. I have two screenies showing some of the settings but
>>> not quite enough info to get it working. Currently I am getting this (see
>>>  below) output when trying to run cmake in QtCreator. I am building
>>> using options in .
>>> I also made this dirty hack so that some python libs could be found .
>>> Can you point me in the right direction of any notes etc you have?
>> I will add documentation about this to the site . I have been
>> debugging this setup and now having it working smoothly on Mac 10.7.5 and
>> 10.9.2. You can use the following notes for now and we can work on making
>> the online docs better, eventually including it in INSTALL somehow.
>> Basic instructions:
>> 1) Ensure deps are installed:
>> Install required build Python modules (use pip on system or Homebrew's
>> pip when using its Python). You can also tap homebrew/python for some more
>> complex modules :
>> * numpy <-- this is used by gdal.rb install, if building with python
>> option, which is the default
>> $ brew tap homebrew/science
>> $ brew tap dakcarto/osgeo4mac
>> $ brew install qgis-22 --only-dependencies --with-grass --with-globe
>> Install required run-time Python modules :
>> * psycopg2 matplotlib pyparsing
>> 2) Copy the following directory elsewhere and use it from there:
>> Note: it's important to not edit the scripts where they are located, in
>> the tap, because it is a git repo. You should keep that working tree clean
>> so that `brew update` always works.
>> Open and review scripts:
>> * qgis-cmake-options.py - for generating CMake option string for use in
>> Qt Creator when built off dependencies from homebrew-osgeo4mac tap. Edit
>> CMake options to suit your build needs. Note, the current script usually
>> has CMake options for building QGIS with *all* options that the current
>> Homebrew formula, e.g. qgis-22, supports, which can include things like
>> Oracle support, etc. You will probably want to edit it and comment out such
>> lines for an initial build. I add this as an external tool in Qt Creator
>> * qgis-set-app-env.py - for setting env vars in dev build and installed
>> QGIS.app, to ensure they are available on double-click run. Needs to stay
>> in the same directory as the next scripts.
>> * qgis-creator-build.sh - sets up the build environ and ensures the
>> QGIS.app in the build directory can find resources, so it can run from
>> * qgis-creator-install.sh - installs the app and ensures QGIS.app has
>> proper env variables, so it can be moved around on the filesystem.
>> Currently QGIS.app bundling beyond QGIS_MACAPP_BUNDLE=0 is not supported.
>> 3) Configure a Creator Qt version and kit [3, 4].
>> 4) Configure Creator project with prepended environment variables and to
>> use the build and install scripts .
>> This whole setup supports builds where the OSGeo4Mac deps are in a
>> non-standard Homebrew location, e.g. /usr/local/osgeo4mac or
>> /opt/osgeo4mac, instead of /usr/local. This allows for multiple build
>> scenarios, including placing the deps on an external drive, though that
>> requires building all deps with special 'bottle' parameters.
>> I've tried to make the setup as simple and flexible as possible, though
>> I'm sure it can use some work.
>> Let me know how it goes! :-)
>>  https://github.com/dakcarto/homebrew-osgeo4mac
>>  https://github.com/Homebrew/homebrew-python
>> In screen snaps, substitute the appropriate directories for your setup,
>> as per notes above:
>>  http://drive.dakotacarto.com/osgeo4mac/QtCreator_osgeo4mac_Kits.png
> Thanks very much Larry - I'm running through your notes now!
---- 8< ---snip------
> Tim Sutton - QGIS Project Steering Committee Member
> Please do not email me off-list with technical
> support questions. Using the lists will gain
> more exposure for your issues and the knowledge
> surrounding your issue will be shared with all.
> Irc: timlinux on #qgis at freenode.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer