Skip to content

ktorrent: fix build with Qt 5.11#42071

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
erosennin:ktorrent-qt-5.11
Jun 16, 2018
Merged

ktorrent: fix build with Qt 5.11#42071
Mic92 merged 1 commit intoNixOS:masterfrom
erosennin:ktorrent-qt-5.11

Conversation

@erosennin
Copy link
Contributor

Motivation for this change

KTorrent fails to build with Qt 5.11 because of missing includes:

[ 90%] Building CXX object ktorrent/CMakeFiles/ktorrent_app.dir/dialogs/pastedialog.cpp.o
/build/ktorrent-5.1.0/ktorrent/groups/groupviewmodel.cpp: In member function 'void kt::GroupViewModel::groupRemoved(kt::Group*)':
/build/ktorrent-5.1.0/ktorrent/groups/groupviewmodel.cpp:186:21: warning: variable 'idx' set but not used [-Wunused-but-set-variable]
         QModelIndex idx = findGroup(g).parent();
                     ^~~
/build/ktorrent-5.1.0/ktorrent/groups/groupview.cpp: In constructor 'kt::GroupView::GroupView(kt::GroupManager*, kt::View*, kt::Core*, kt::GUI*, QWidget*)':
/build/ktorrent-5.1.0/ktorrent/groups/groupview.cpp:63:17: error: invalid use of incomplete type 'class QHeaderView'
         header()->hide();
                 ^~
In file included from /nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/qtreewidget.h:44:0,
                 from /nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/QTreeWidget:1,
                 from /build/ktorrent-5.1.0/ktorrent/groups/groupview.h:24,
                 from /build/ktorrent-5.1.0/ktorrent/groups/groupview.cpp:21:
/nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/qtreeview.h:53:7: note: forward declaration of 'class QHeaderView'
 class QHeaderView;
       ^~~~~~~~~~~
/build/ktorrent-5.1.0/ktorrent/groups/groupview.cpp:63:19: error: invalid use of incomplete type 'class QHeaderView'
         header()->hide();
                   ^~~~
In file included from /nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/qtreewidget.h:44:0,
                 from /nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/QTreeWidget:1,
                 from /build/ktorrent-5.1.0/ktorrent/groups/groupview.h:24,
                 from /build/ktorrent-5.1.0/ktorrent/groups/groupview.cpp:21:
/nix/store/ni5sy11fvw9yj5i8bihbvxprm2cy6d3q-qtbase-5.11.0-dev/include/QtWidgets/qtreeview.h:53:7: note: forward declaration of 'class QHeaderView'
 class QHeaderView;
       ^~~~~~~~~~~
make[2]: *** [ktorrent/CMakeFiles/ktorrent_app.dir/build.make:328: ktorrent/CMakeFiles/ktorrent_app.dir/groups/groupview.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:2011: ktorrent/CMakeFiles/ktorrent_app.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
builder for '/nix/store/v1n3hzqmcaxbljmrg6d8c6ilqf4lzxfh-ktorrent-5.1.0.drv' failed with exit code 2
error: build of '/nix/store/v1n3hzqmcaxbljmrg6d8c6ilqf4lzxfh-ktorrent-5.1.0.drv' failed

This PR backports a fix from upstream.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bkchr
Copy link
Contributor

bkchr commented Jun 15, 2018

Could someone merge this? @peterhoeg @adisbladis @ttuegel

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 15, 2018
@Mic92
Copy link
Member

Mic92 commented Jun 16, 2018

@GrahamcOfBorg build ktorrent

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: ktorrent

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ktorrent

Partial log (click to expand)

shrinking /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0/bin/ktorrent
shrinking /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0/bin/ktupnptest
shrinking /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0/bin/ktmagnetdownloader
strip is /nix/store/4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0/lib  /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0/bin
patching script interpreter paths in /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0
checking for references to /build in /nix/store/8lrdajxp0lay65ly1lrbwgsw00y0x0kj-ktorrent-5.1.0...
postPatchMkspecs
postPatchMkspecs
postPatchMkspecs

@Mic92 Mic92 merged commit a454730 into NixOS:master Jun 16, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: ktorrent

Partial log (click to expand)

shrinking /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0/lib/qt-5.11/plugins/ktorrent/ktorrent_infowidget.so
shrinking /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0/lib/qt-5.11/plugins/ktorrent/ktorrent_logviewer.so
shrinking /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0/lib/libktcore.so.16.0.0
strip is /nix/store/min150lkigznaayzpwvf8d4jdl1dqvx6-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0/lib  /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0/bin
patching script interpreter paths in /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0
checking for references to /build in /nix/store/zhwlrnwb9f1b1yj7dagcv78hxs3j9sj1-ktorrent-5.1.0...
postPatchMkspecs
postPatchMkspecs
postPatchMkspecs

@pSub pSub mentioned this pull request Jun 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants