git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26835 from unaizalakain/init_qgo

qgo: init at unstable-2016-06-23

commita93225fc6c714b3035bb81e449a8365bec81d7ae authorJörg Thalheim <Mic92@users.noreply.github.com> dateSun 25 Jun 2017, 12:05 (9 years ago) parent7a10cc86e52efe
3 files changed+100
pkgs/games/qgo/default.nix+48 pkgs/games/qgo/fix-paths.patch+50 pkgs/top-level/all-packages.nix+2
pkgs/games/qgo/default.nixnew file+48
@@ -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+}
pkgs/games/qgo/fix-paths.patchnew file+50
@@ -0,0 +1,50 @@
1+diff --git a/src/defines.h b/src/defines.h
2+index 5d40955..82d0627 100644
3+--- a/src/defines.h
4++++ b/src/defines.h
5+@@ -48,7 +48,7 @@
6+ * GNUgo default level
7+ */
8+ #define DEFAULT_ENGINE "gnugo"
9+-#define DEFAULT_ENGINE_PATH "/usr/games/"
10++#define DEFAULT_ENGINE_PATH ""
11+ #define DEFAULT_ENGINE_OPTIONS "--mode gtp --quiet --level 10"
12+
13+
14+@@ -220,8 +220,8 @@ extern QString applicationPath;
15+ #define SOUND_PATH_PREFIX "qGo.app/Contents/Resources/Sounds/"
16+ #define TRANSLATIONS_PATH "qGo.app/Contents/Resources/Translations/"
17+ #else
18+- #define SOUND_PATH_PREFIX "/usr/share/qgo/sounds/"
19+- #define TRANSLATIONS_PATH "/usr/share/qgo/languages"
20++ #define SOUND_PATH_PREFIX "/@out@/share/qgo/sounds/"
21++ #define TRANSLATIONS_PATH "/@out@/share/qgo/languages"
22+ #endif
23+
24+ #endif
25+diff --git a/src/src.pro b/src/src.pro
26+index f989ce7..b7d691f 100644
27+--- a/src/src.pro
28++++ b/src/src.pro
29+@@ -165,17 +165,17 @@ SOURCES += displayboard.cpp \
30+ newgamedialog.cpp
31+
32+ unix*:!macx-* {
33+- QGO_INSTALL_PATH = /usr/share/qgo
34+- QGO_INSTALL_BIN_PATH = /usr/bin
35++ QGO_INSTALL_PATH = @out@/share/qgo
36++ QGO_INSTALL_BIN_PATH = /@out@/bin
37+
38+- icon.path = /usr/share/pixmaps
39++ icon.path = @out@/share/pixmaps
40+ icon.files = resources/pics/qgo.png
41+ icon.files += resources/pics/qgo_16x16.xpm
42+ icon.files += resources/pics/qgo_32x32.xpm
43+ icon.files += resources/pics/qgo_48x48.png
44+ icon.files += resources/pics/qgo_48x48.xpm
45+ INSTALLS += icon
46+- desktopfile.path = /usr/share/applications
47++ desktopfile.path = @out@/share/applications
48+ desktopfile.files = qgo.desktop
49+ INSTALLS += desktopfile
50+ }
pkgs/top-level/all-packages.nix+2
@@ -12937,6 +12937,8 @@ with pkgs;
1293712937
1293812938 poppler_data = callPackage ../data/misc/poppler-data { };
1293912939
12940+ qgo = libsForQt5.callPackage ../games/qgo { };
12941+
1294012942 quattrocento = callPackage ../data/fonts/quattrocento {};
1294112943
1294212944 quattrocento-sans = callPackage ../data/fonts/quattrocento-sans {};