Building SuperCollider 3.14.1 in NixOS

Hello everyone,

I’m working on updating the SuperCollider package in the nixpkgs repository. The package hasn’t been updated since version 3.13.1 and has the QtWebEngine disabled, which makes browsing local documentation somewhat limited. So far, I’ve been able to compile the language without Qt (see build_sans_qt.log), but there seem to be a few errors when compiling scide (in build_with_qt.log). The only file that I’ve changed here is the default.nix file, which I’m also posting.

I suspect that there might be some kind of subtly broken feature in Qt 6.11—unless of course if other people have managed to compile SC with Qt 6.11—though I don’t know enough C++ to say for certain. The main errors are as follows:

[ 59%] Building CXX object editors/sc-ide/CMakeFiles/libscide.dir/widgets/code_editor/overlay.cpp.o
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp: In member function 'virtual void ScIDE::GenericCodeEditor::mousePressEvent(QMouseEvent*)':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:701:46: error: no matching function for call to 'QString::arg(Qt::KeyboardModifiers)'
  701 |                                          .arg(e->modifiers())
      |                                              ^
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:701:46: note: there are 4 candidates
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: candidate 1: 'template<class T, typename std::enable_if<conjunction_v<std::disjunction<std::is_integral<_Tp>, std::conjunction<std::is_enum<_Tp>, std::negation<q23::is_scoped_enum<E, is_enum_v<E> > > > >, std::negation<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> > >, std::negation<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> > > >, bool>::type <anonymous> > QString QString::arg(T, int, int, QChar) const'
  360 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, int base = 10,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:359:53: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  359 |     template <typename T, if_integral_non_char<T> = true>
      |                                                     ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: candidate 2: 'template<class T, typename std::enable_if<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> >::value, bool>::type <anonymous> > QString QString::arg(T, int, char, int, QChar) const'
  375 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, char format = 'g', int precision = -1,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:374:50: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  374 |     template <typename T, if_floating_point<T> = true>
      |                                                  ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: candidate 3: 'template<class T, typename std::enable_if<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> >::value, bool>::type <anonymous> > QString QString::arg(const T&, int, QChar) const'
  380 |     [[nodiscard]] QString arg(const T &a, int fieldWidth = 0, QChar fillChar = u' ') const
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:379:47: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  379 |     template <typename T, if_string_like<T> = true>
      |                                               ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: candidate 4: 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const'
  400 |     arg(Args &&...args) const
      |     ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h: In substitution of 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const [with Args = {QFlags<Qt::KeyboardModifier>}]':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:701:46:   required from here
  701 |                                          .arg(e->modifiers())
      |                                              ^
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: error: no type named 'type' in 'struct std::enable_if<false, QString>'
  400 |     arg(Args &&...args) const
      |     ^~~
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp: In member function 'virtual void ScIDE::GenericCodeEditor::mouseDoubleClickEvent(QMouseEvent*)':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:735:46: error: no matching function for call to 'QString::arg(Qt::KeyboardModifiers)'
  735 |                                          .arg(e->modifiers())
      |                                              ^
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:735:46: note: there are 4 candidates
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: candidate 1: 'template<class T, typename std::enable_if<conjunction_v<std::disjunction<std::is_integral<_Tp>, std::conjunction<std::is_enum<_Tp>, std::negation<q23::is_scoped_enum<E, is_enum_v<E> > > > >, std::negation<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> > >, std::negation<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> > > >, bool>::type <anonymous> > QString QString::arg(T, int, int, QChar) const'
  360 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, int base = 10,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:359:53: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  359 |     template <typename T, if_integral_non_char<T> = true>
      |                                                     ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: candidate 2: 'template<class T, typename std::enable_if<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> >::value, bool>::type <anonymous> > QString QString::arg(T, int, char, int, QChar) const'
  375 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, char format = 'g', int precision = -1,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:374:50: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  374 |     template <typename T, if_floating_point<T> = true>
      |                                                  ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: candidate 3: 'template<class T, typename std::enable_if<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> >::value, bool>::type <anonymous> > QString QString::arg(const T&, int, QChar) const'
  380 |     [[nodiscard]] QString arg(const T &a, int fieldWidth = 0, QChar fillChar = u' ') const
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:379:47: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  379 |     template <typename T, if_string_like<T> = true>
      |                                               ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: candidate 4: 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const'
  400 |     arg(Args &&...args) const
      |     ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h: In substitution of 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const [with Args = {QFlags<Qt::KeyboardModifier>}]':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:735:46:   required from here
  735 |                                          .arg(e->modifiers())
      |                                              ^
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: error: no type named 'type' in 'struct std::enable_if<false, QString>'
  400 |     arg(Args &&...args) const
      |     ^~~
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp: In member function 'virtual void ScIDE::GenericCodeEditor::mouseReleaseEvent(QMouseEvent*)':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:769:46: error: no matching function for call to 'QString::arg(Qt::KeyboardModifiers)'
  769 |                                          .arg(e->modifiers())
      |                                              ^
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:769:46: note: there are 4 candidates
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: candidate 1: 'template<class T, typename std::enable_if<conjunction_v<std::disjunction<std::is_integral<_Tp>, std::conjunction<std::is_enum<_Tp>, std::negation<q23::is_scoped_enum<E, is_enum_v<E> > > > >, std::negation<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> > >, std::negation<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> > > >, bool>::type <anonymous> > QString QString::arg(T, int, int, QChar) const'
  360 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, int base = 10,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:360:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:359:53: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  359 |     template <typename T, if_integral_non_char<T> = true>
      |                                                     ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: candidate 2: 'template<class T, typename std::enable_if<std::disjunction<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Float16>, std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, qfloat16>, std::is_floating_point<_Tp> >::value, bool>::type <anonymous> > QString QString::arg(T, int, char, int, QChar) const'
  375 |     [[nodiscard]] QString arg(T a, int fieldWidth = 0, char format = 'g', int precision = -1,
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:375:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:374:50: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  374 |     template <typename T, if_floating_point<T> = true>
      |                                                  ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: candidate 3: 'template<class T, typename std::enable_if<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv< <template-parameter-1-1> >::type> >, std::is_convertible<T, QAnyStringView> >::value, bool>::type <anonymous> > QString QString::arg(const T&, int, QChar) const'
  380 |     [[nodiscard]] QString arg(const T &a, int fieldWidth = 0, QChar fillChar = u' ') const
      |                           ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:380:27: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:379:47: error: no type named 'type' in 'struct std::enable_if<false, bool>'
  379 |     template <typename T, if_string_like<T> = true>
      |                                               ^~~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: candidate 4: 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const'
  400 |     arg(Args &&...args) const
      |     ^~~
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: note: template argument deduction/substitution failed:
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h: In substitution of 'template<class ... Args> typename std::enable_if<((sizeof... (Args) >= 2) && conjunction_v<std::conjunction<std::negation<QtPrivate::treat_as_integral_arg<typename std::remove_cv<Args>::type> >, std::is_convertible<Args, QAnyStringView> >...>), QString>::type QString::arg(Args&& ...) const [with Args = {QFlags<Qt::KeyboardModifier>}]':
/build/SuperCollider-3.14.1-Source/editors/sc-ide/widgets/code_editor/editor.cpp:769:46:   required from here
  769 |                                          .arg(e->modifiers())
      |                                              ^
/nix/store/wzvm2pvf98a71v0scgfhmi01lqcxahfr-qtbase-6.11.0/include/QtCore/qstring.h:400:5: error: no type named 'type' in 'struct std::enable_if<false, QString>'
  400 |     arg(Args &&...args) const
      |     ^~~
[ 59%] Building CXX object lang/CMakeFiles/libsclang.dir/LangPrimSource/PyrPlatformPrim.cpp.o
[ 59%] Building CXX object editors/sc-ide/CMakeFiles/libscide.dir/widgets/code_editor/autocompleter.cpp.o
[ 59%] Building CXX object editors/sc-ide/CMakeFiles/libscide.dir/widgets/code_editor/completion_menu.cpp.o
[ 60%] Building CXX object editors/sc-ide/CMakeFiles/libscide.dir/widgets/settings/dialog.cpp.o
[ 60%] Building CXX object lang/CMakeFiles/libsclang.dir/LangPrimSource/PyrStringPrim.cpp.o
make[2]: *** [editors/sc-ide/CMakeFiles/libscide.dir/build.make:688: editors/sc-ide/CMakeFiles/libscide.dir/widgets/code_editor/editor.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

I’m out of ideas at the moment, so any suggestions would be appreciated.

default.nix.txt (3.4 KB)
build_sans_qt.log.txt (335.3 KB)
build_with_qt.log.txt (157.0 KB)

Hey,

see compilation error on slackware-current (linux) with 3.14.1 · Issue #7279 · supercollider/supercollider · GitHub

3.14.1 supports up to Qt 6.9 - if you want to use Qt 6.11 you need to use the development version or you need to apply the patch as stated here ide: Explicitly convert KeyboardModifiers to an integer type by xunil-cloud · Pull Request #7290 · supercollider/supercollider · GitHub

1 Like

monitoring this thread. I just started running Nix on my laptop.

also worth noting, in nixpkgs if you search supercollider, there are quite a few packages, some just plain supercollider, a few that are ‘supercollider with sc3 plugins’ (not really sure which to install)
also I think there are stand alone plugins you can install alongside supercollider.

not to derail this thread, but wondering what the best way to install supercollider w/ plugins is?

Heya @gman, I’d recommend installing the base supercollider package in your configuration, then installing plugins in your extension directory (try running Platform.userExtensionDir if you don’t know it). The only plugins available in the nixpkgs repository is the sc3-plugins package, which is just the community plugins. Neither supercolliderPlugins.sc3-plugins nor supercollider-with-plugins actually lets you use the SC plugins, since neither of them do a symbolic link with the supercollider package in the nix store—I’m trying to find a fix for that. Moreover, the current version of SC in the nix store (3.14.1, despite what it says on NixOS search) does not build with Qt WebEngine, which makes it quite difficult to browse your local documentation.

To get around the WebEngine issue, I would recommend that you either build SuperCollider locally—which isn’t terribly hard to do, I wrote a small walkthrough below—or use a flake to use a specific git repository’s commits as a package. The latter option is arguably better because of reproducibility—and you can follow my (incredibly messy and nonstandard) NixOS configuration if you’re comfortable with the Nix language—but there’s nothing wrong with not using it.


Building SuperCollider locally using a callPackage in your NixOS config

First, download default.nix from my fork of the nixpkgs repo and put it somewhere on your system—I’d recommend you put it into whatever directory your configuration is in. Next, add (callPackage ./<directory relative to your config> { }) into either environment.systemPackages or users.users.<your username>.packages, specifying build options in the curly braces (for example, you’d use useQtWebEngine = false; in the curly braces).

You should hopefully not have to do this soon, since my changes to nixpkgs got approved today (see https://github.com/NixOS/nixpkgs/pull/531489).

Using sc3-plugins without installation from nixpkgs

First, download the SC community plugins from the official website or github repository, then unzip the file into your user extension directory. Once you do that, you’ll want to add the following to your configuration.nix file:

programs.nix-ld = {
  enable = true;
  libraries = with pkgs; [
    fftw
    fftwFloat
  ];
};

This enables dynamic linking on your NixOS system, which is pretty crucial if you’re trying to use external libraries on the internet that aren’t built with NixOS in mind. One of the packages in sc3-lugins, I can’t remember which one, needs both fftw and fftwFloat to work properly, while all the others just use the bone-stock SuperCollider server stuff. (Please correct me if I’m wrong.)

That’s my current solution, but I am trying to find a fix for the packages in the nixpkgs repository so you don’t have to do this.


I’m planning on writing a NixOS wiki article for these fixes.

1 Like