Skip to content

Attempting to add Darwin support for QGIS #71398

@ersinakinci

Description

@ersinakinci

Describe the bug
I'm attempting to add Darwin support for QGIS. As my first attempt, I've tried the naive path of changing https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/gis/qgis/unwrapped.nix#L54 from platforms = with lib.platforms; linux; to platforms = with lib.platforms; all; and running nix-shell. However, when building the dependencies, I run into this problem with the python module for Qscintilla:

Kairos:tmp ersin$ nix-shell -E "with import ../pkgs/top-level/impure.nix {}; libsForQt5.callPackage ../pkgs/applications/gis/qgis/unwrapped.nix { withGrass = false; }"
these derivations will be built:
  /nix/store/s9fx27g8p4m2q64wgk7lsrp44jsjka8i-python3.7-qscintilla-2.9.4.drv
  /nix/store/zdldyips2m3hwf1a2dc8dl9jh3llc17x-qtwebkit-5.212-alpha-01-26-2018.drv
these paths will be fetched (1.76 MiB download, 13.04 MiB unpacked):
  /nix/store/1y6wd1rk8v4krkhlx8cwsc6g27f0cy7d-qtwebchannel-5.11.3-dev
  /nix/store/ax02vbvxwjd3gwb7pqg34sjmvvq73iz3-qtsensors-5.11.3-dev
  /nix/store/c6pwax6zryik48z21lspxkmgfdfjhz8h-qtmultimedia-5.11.3-dev
  /nix/store/lm851ic3y8haisljnbkz0h0ffcflffrx-qtxmlpatterns-5.11.3-dev
  /nix/store/n3yknmr2sqlg0p3h53j44xgp5yhsjwv7-qttools-5.11.3-dev
  /nix/store/pgqklnbhzl0ykywv0zzwsn80wp9vg1by-qtdeclarative-5.11.3-dev
  /nix/store/xdkvl53b55zjm0k3g99cnbh17abrnvmn-qwt-6.1.2
  /nix/store/zcsyp52kc4dwnkw3sl8dmnpykmlllygh-qtlocation-5.11.3-dev
copying path '/nix/store/pgqklnbhzl0ykywv0zzwsn80wp9vg1by-qtdeclarative-5.11.3-dev' from 'https://cache.nixos.org'...
building '/nix/store/s9fx27g8p4m2q64wgk7lsrp44jsjka8i-python3.7-qscintilla-2.9.4.drv'...
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
unpacking sources
unpacking source archive /nix/store/7imkmyxwg710gx6dlj3n86rkdyw6yp8l-QScintilla_gpl-2.9.4.zip
source root is QScintilla_gpl-2.9.4
setting SOURCE_DATE_EPOCH to timestamp 1482706914 of file QScintilla_gpl-2.9.4/example-Qt4Qt5/mainwindow.h
patching sources
configuring
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/bin:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5-5.13.0.dist-info:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/dbus:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/dbus/mainloop:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic/port_v2:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic/port_v3:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic/widget-plugins:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic/Loader:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/lib/python3.7/site-packages/PyQt5/uic/Compiler:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWebSockets:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtPrintSupport:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtOpenGL:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtQml:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtBluetooth:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtNetwork:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtDesigner:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtMacExtras:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtHelp:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/Enginio:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QAxContainer:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtSvg:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtXml:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtAndroidExtras:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtRemoteObjects:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtSensors:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWinExtras:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWebKitWidgets:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtNetworkAuth:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtGui:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtNfc:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtSerialPort:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtQuick:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtDBus:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtX11Extras:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtQuickWidgets:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWebChannel:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWidgets:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtSql:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtMultimedia:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtLocation:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtPositioning:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtWebKit:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtCore:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtXmlPatterns:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtMultimediaWidgets:
/nix/store/v2xkr37gffg5gfscjmm5dj2bbh9bqjh0-python3.7-pyqt-5.13.0/share/sip/PyQt5/QtTest:
Configuring QScintilla 2.9.4...
QScintilla 2.9.4 is being used.
The QScintilla .sip files will be installed in
/nix/store/n8yi5cg89zw27qaii17b40a4x796a6mv-python3.7-qscintilla-2.9.4/share/sip/PyQt5.
QScintilla will be installed in
/nix/store/n8yi5cg89zw27qaii17b40a4x796a6mv-python3.7-qscintilla-2.9.4/lib/python3.7/site-packages/PyQt5.
PyQt 5.13.0 is being used.
Qt 5.11.3 is being used.
sip 4.19.18 is being used.
The sip executable is
/nix/store/xqzavp71hz075bpnzz4v3amj2d2cvkah-python3.7-sip-4.19.18/bin/sip.
QScintilla is being built with 'protected' redefined as 'public'.
The PEP 484 stubs will be installed in
/nix/store/n8yi5cg89zw27qaii17b40a4x796a6mv-python3.7-qscintilla-2.9.4/lib/python3.7/site-packages/PyQt5.
The QScintilla API file will be installed in
/nix/store/n8yi5cg89zw27qaii17b40a4x796a6mv-python3.7-qscintilla-2.9.4/api/python3.7/api/python.
Generating the C++ source for the Qsci module...
Generating the .pro file for the Qsci module...
Generating the QScintilla API file...
Generating the top-level .pro file...
Generating the Makefiles...
no configure script, doing nothing
building
build flags: SHELL=/nix/store/9jd5ihjm10rwm3m6aj1wwbyx7f3cc902-bash-4.4-p23/bin/bash
cd Qsci/ && ( test -e Makefile || /nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/bin/qmake -o Makefile /private/tmp/nix-build-python3.7-qscintilla-2.9.4.drv-0/QScintilla_gpl-2.9.4/Python/Qsci/Qsci.pro ) && make -f Makefile
make[1]: Entering directory '/private/tmp/nix-build-python3.7-qscintilla-2.9.4.drv-0/QScintilla_gpl-2.9.4/Python/Qsci'
clang++ -c -pipe -stdlib=libc++ -fno-exceptions -O2 -Wall -W -fPIC -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /nix/store/hrj338j7k2ghhbxvvrbb85ij65h876mh-qscintilla-qt5-2.9.4/include -I/nix/store/xqzavp71hz075bpnzz4v3amj2d2cvkah-python3.7-sip-4.19.18/include -isystem /nix/store/jz94a0lnq9p1i4wx1mrh2c9f1sppydq8-python3-3.7.4/include/python3.7m -isystem /nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/include/QtGui -isystem /nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/include/QtCore -I. -I/nix/store/srwv0hr8lcgdl8g0a67y6z8zs3xj1mf2-apple-framework-OpenGL/Library/Frameworks/OpenGL.framework/Headers -I/nix/store/40kgc5qczy3jpxznb3sxq7dzzmwv3dp4-apple-framework-AGL/Library/Frameworks/AGL.framework/Headers -I/nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/mkspecs/macx-clang -o sipQsciQsciLexerRuby.o sipQsciQsciLexerRuby.cpp
In file included from sip/qsciabstractapis.sip:24:
In file included from /nix/store/hrj338j7k2ghhbxvvrbb85ij65h876mh-qscintilla-qt5-2.9.4/include/Qsci/qsciabstractapis.h:33:
In file included from /nix/store/hrj338j7k2ghhbxvvrbb85ij65h876mh-qscintilla-qt5-2.9.4/include/Qsci/qsciscintilla.h:38:
In file included from /nix/store/hrj338j7k2ghhbxvvrbb85ij65h876mh-qscintilla-qt5-2.9.4/include/Qsci/qscicommand.h:31:
/nix/store/hrj338j7k2ghhbxvvrbb85ij65h876mh-qscintilla-qt5-2.9.4/include/Qsci/qsciscintillabase.h:30:10: fatal error: 'QAbstractScrollArea' file not found
#include <QAbstractScrollArea>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:534: sipQsciQsciLexerRuby.o] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-python3.7-qscintilla-2.9.4.drv-0/QScintilla_gpl-2.9.4/Python/Qsci'
make: *** [Makefile:45: sub-Qsci-make_first-ordered] Error 2
builder for '/nix/store/s9fx27g8p4m2q64wgk7lsrp44jsjka8i-python3.7-qscintilla-2.9.4.drv' failed with exit code 2
error: build of '/nix/store/5346sfiv2jfr14nnd8iznqilnydvv4hg-qtsensors-5.11.3.drv', '/nix/store/jbgqcan4rghm2s2y17vsxvh81w5j8yyq-qtxmlpatterns-5.11.3.drv', '/nix/store/klksr4awc1sbikiwhm964k6cz4vz0n0w-qwt-6.1.2.drv', '/nix/store/s9fx27g8p4m2q64wgk7lsrp44jsjka8i-python3.7-qscintilla-2.9.4.drv', '/nix/store/zdldyips2m3hwf1a2dc8dl9jh3llc17x-qtwebkit-5.212-alpha-01-26-2018.drv' failed
Kairos:tmp ersin$

I'm not sure how to satisfy the QAbstractScrollArea header file dependency. I did notice a file in qtbase in my store: /nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/include/QtWidgets/QAbstractScrollArea. My naive guess would be to pass -I/nix/store/jfj2fmclsd1fmly02sfga7ddf42yvpaj-qtbase-5.11.3-dev/include/QtWidgets to the compiler, but I don't know whether it's that trivial nor how to do this using Nix.

Any ideas?

To Reproduce
Steps to reproduce the behavior:

  1. Clone Nixpkgs repo from master
  2. mkdir nixpkgs/tmp && cd nixpkgs/tmp
  3. nix-shell -E "with import ../pkgs/top-level/impure.nix {}; libsForQt5.callPackage ../pkgs/applications/gis/qgis/unwrapped.nix { withGrass = false; }" or alternatively nix-shell -E "with import ../pkgs/top-level/impure.nix {}; callPackage ../pkgs/applications/gis/qgis "

Expected behavior
I should be dropped into a nix-shell with all my dependencies built and available to begin hacking on QGIS.

Screenshots
N/A (see shell output above)

Additional context
Background: this is my first time modifying a Nix expression in Nixpkgs, indeed my first serious attempt at any kind of Nix packaging. I've been studying Nix very intently for the past few weeks and have gone through the Nix pills, the Nix manual, the Nixpkgs manual, and parts of Dostra's PhD thesis. I'm a beginner but not totally unfamiliar :-).

I'm also not too familiar with packaging Qt.

Finally, note that I'm trying to use my globally-installed Nix tools with my cloned nixpkgs. I'm not sure whether this is explicitly supported, please let me know if there's a better way.

Metadata

 - system: `"x86_64-darwin"`
 - host os: `Darwin 18.7.0, macOS 10.14.6`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3`
 - channels(root): `"nixpkgs-20.03pre193309.c4196cca9ac"`
 - channels(ersin): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Note that the above output is from running nix run globally, whereas I'm trying to use my local cloned copy of nixpkgs. (Perhaps this is a problem?)

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
  - qgis
  - qgis-unwrapped
  - qscintilla

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions