@@ -0,0 +1,48 @@
1+{ stdenv, fetchFromGitHub, makeWrapper, qmake, qt56 }:
2+
3+stdenv.mkDerivation rec {
4+ name = "qgo-${version}";
5+ version = "unstable-2016-06-23";
6+
7+ meta = with stdenv.lib; {
8+ description = "A Go client based on Qt5";
9+ longDescription = ''
10+ qGo is a Go Client based on Qt 5. It supports playing online at
11+ IGS-compatible servers (including some special tweaks for WING and LGS,
12+ also NNGS was reported to work) and locally against gnugo (or other
13+ GTP-compliant engines). It also has rudimentary support for editing SGF
14+ files and parital support for CyberORO/WBaduk, Tygem, Tom, and eWeiqi
15+ (developers of these backends are currently inactive, everybody is welcome
16+ to take them over).
17+
18+ Go is an ancient Chinese board game. It's called "圍棋(Wei Qi)" in
19+ Chinese, "囲碁(Yi Go)" in Japanese, "바둑(Baduk)" in Korean.
20+ '';
21+ homepage = "https://github.com/pzorin/qgo";
22+ license = licenses.gpl2;
23+ maintainers = with maintainers; [ zalakain ];
24+ };
25+
26+ src = fetchFromGitHub {
27+ owner = "pzorin";
28+ repo = "qgo";
29+ rev = "1e65b0c74914e534ea4d040f8f0ef8908383e374";
30+ sha256 = "1xzkayclmhsi07p9mnbf8185jw8n5ikxp2mik3x8qz1i6rmrfl5b";
31+ };
32+
33+ patches = [ ./fix-paths.patch ];
34+ postPatch = ''
35+ sed -i 's|@out@|'"''${out}"'|g' src/src.pro src/defines.h
36+ '';
37+ nativeBuildInputs = [ makeWrapper qmake ];
38+ # qt58 does not provide platform plugins
39+ # We need lib/qt*/plugins/platforms/libqxcb.so
40+ buildInputs = with qt56; [ qtbase.out qtmultimedia qttranslations ];
41+ enableParallelBuilding = true;
42+ postFixup = ''
43+ # libQt5XcbQpa is a platform plugin dependency and doesn't get linked
44+ patchelf --add-needed libQt5XcbQpa.so.5 $out/bin/qgo
45+ wrapProgram $out/bin/qgo \
46+ --set QT_QPA_PLATFORM_PLUGIN_PATH "${qt56.qtbase}/lib/qt-5.6/plugins/platforms/"
47+ '';
48+}