You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
8.1 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages qt)
  19. #:use-module ((guix licenses) #:select (lgpl2.1 x11-style))
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix build utils)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (gnu packages)
  25. #:use-module (gnu packages bison)
  26. #:use-module (gnu packages compression)
  27. #:use-module (gnu packages fontutils)
  28. #:use-module (gnu packages glib)
  29. #:use-module (gnu packages icu4c)
  30. #:use-module (gnu packages image)
  31. #:use-module (gnu packages linux)
  32. #:use-module (gnu packages databases)
  33. #:use-module (gnu packages openssl)
  34. #:use-module (gnu packages perl)
  35. #:use-module (gnu packages pkg-config)
  36. #:use-module (gnu packages pulseaudio)
  37. #:use-module (gnu packages python)
  38. #:use-module (gnu packages gl)
  39. #:use-module (gnu packages xorg))
  40. (define-public libxkbcommon
  41. (package
  42. (name "libxkbcommon")
  43. (version "0.3.1")
  44. (source (origin
  45. (method url-fetch)
  46. (uri (string-append "http://xkbcommon.org/download/" name "-"
  47. version ".tar.xz"))
  48. (sha256
  49. (base32
  50. "13mk335r4dhi9qglzbp46ina1wz4qgcp8r7s06iq7j50pf0kb5ww"))))
  51. (build-system gnu-build-system)
  52. (native-inputs
  53. `(("bison" ,bison)))
  54. (home-page "http://xkbcommon.org/")
  55. (synopsis "library to handle keyboard descriptions")
  56. (description "Xkbcommon is a library to handle keyboard descriptions,
  57. including loading them from disk, parsing them and handling their
  58. state. It is mainly meant for client toolkits, window systems, and other
  59. system applications; currently that includes Wayland, kmscon, GTK+, Qt,
  60. Clutter, and more. Despite the name, it is not currently used by anything
  61. X11 (yet).")
  62. (license (x11-style "file://COPYING"
  63. "See 'COPYING' in the distribution."))))
  64. (define-public qt
  65. (package
  66. (name "qt")
  67. (version "5.2.1")
  68. (source (origin
  69. (method url-fetch)
  70. (uri (string-append "http://download.qt-project.org/official_releases/qt/"
  71. (string-copy version 0 (string-rindex version #\.))
  72. "/" version
  73. "/single/qt-everywhere-opensource-src-"
  74. version ".tar.xz"))
  75. (sha256
  76. (base32
  77. "0kkqrxpd9gqb52a2zj09d7vhd4adczpjg32vjvll5wyzmh092m85"))))
  78. (build-system gnu-build-system)
  79. (propagated-inputs
  80. `(("mesa" ,mesa)))
  81. (inputs
  82. ;; FIXME: Add input ruby once available.
  83. `(("alsa-lib" ,alsa-lib)
  84. ("dbus" ,dbus)
  85. ("fontconfig" ,fontconfig)
  86. ("freetype" ,freetype)
  87. ("glib" ,glib)
  88. ("icu4c" ,icu4c)
  89. ("libjpeg" ,libjpeg)
  90. ("libpng" ,libpng)
  91. ("libx11" ,libx11)
  92. ("libxi" ,libxi)
  93. ("libxkbcommon" ,libxkbcommon)
  94. ("libxrender" ,libxrender)
  95. ("mysql" ,mysql)
  96. ("openssl" ,openssl)
  97. ("pulseaudio" ,pulseaudio)
  98. ("python-wrapper" ,python-wrapper)
  99. ("xcb-util" ,xcb-util)
  100. ("xcb-util-image" ,xcb-util-image)
  101. ("xcb-util-keysyms" ,xcb-util-keysyms)
  102. ("xcb-util-renderutil" ,xcb-util-renderutil)
  103. ("xcb-util-wm" ,xcb-util-wm)
  104. ("zlib" ,zlib)))
  105. (native-inputs
  106. `(("perl" ,perl)
  107. ("pkg-config" ,pkg-config)))
  108. (arguments
  109. `(#:phases
  110. (alist-replace
  111. 'configure
  112. (lambda* (#:key outputs #:allow-other-keys)
  113. (let ((out (assoc-ref outputs "out")))
  114. (substitute* '("configure" "qtbase/configure")
  115. (("/bin/pwd") (which "pwd")))
  116. ;; do not pass "--enable-fast-install", which makes the
  117. ;; configure process fail
  118. (zero? (system*
  119. "./configure"
  120. "-verbose"
  121. "-prefix" out
  122. "-opensource"
  123. "-confirm-license"
  124. ;; drop special machine instructions not supported
  125. ;; on all instances of the target
  126. ,@(if (string-prefix? "x86_64"
  127. (or (%current-target-system)
  128. (%current-system)))
  129. '()
  130. '("-no-sse2"))
  131. "-no-sse3"
  132. "-no-ssse3"
  133. "-no-sse4.1"
  134. "-no-sse4.2"
  135. "-no-avx"
  136. "-no-avx2"
  137. "-no-neon"
  138. "-no-mips_dsp"
  139. "-no-mips_dspr2"))))
  140. %standard-phases)))
  141. (home-page "http://qt-project.org/")
  142. (synopsis "Cross-platform GUI library")
  143. (description "Qt is a cross-platform application and UI framework for
  144. developers using C++ or QML, a CSS & JavaScript like language.")
  145. (license lgpl2.1)))
  146. (define-public qt-4
  147. (package (inherit qt)
  148. (version "4.8.6")
  149. (source (origin
  150. (method url-fetch)
  151. (uri (string-append "http://download.qt-project.org/official_releases/qt/"
  152. (string-copy version 0 (string-rindex version #\.))
  153. "/" version
  154. "/qt-everywhere-opensource-src-"
  155. version ".tar.gz"))
  156. (sha256
  157. (base32
  158. "0b036iqgmbbv37dgwwfihw3mihjbnw3kb5kaisdy0qi8nn8xs54b"))
  159. (patches (list (search-patch "qt4-tests.patch")))))
  160. (inputs `(,@(alist-delete "libjpeg" (package-inputs qt))
  161. ("libjepg" ,libjpeg-8)
  162. ("libsm" ,libsm)))
  163. (arguments
  164. `(#:phases
  165. (alist-replace
  166. 'configure
  167. (lambda* (#:key outputs #:allow-other-keys)
  168. (let ((out (assoc-ref outputs "out")))
  169. (substitute* '("configure")
  170. (("/bin/pwd") (which "pwd")))
  171. ;; Explicitly link with icui18n, which is dlopened by
  172. ;; QtCore.so. The LDFLAGS are in fact added to other flags
  173. ;; determined by the configure phase.
  174. ;; According to the nix recipe, this may be necessary for
  175. ;; further libraries (cups, gtk-x11-2.0, libgdk-x11-2.0).
  176. (setenv "LDFLAGS" "-licui18n")
  177. ;; do not pass "--enable-fast-install", which makes the
  178. ;; configure process fail
  179. (zero? (system*
  180. "./configure"
  181. "-verbose"
  182. "-prefix" out
  183. "-opensource"
  184. "-confirm-license"
  185. ;; drop special machine instructions not supported
  186. ;; on all instances of the target
  187. ,@(if (string-prefix? "x86_64"
  188. (or (%current-target-system)
  189. (%current-system)))
  190. '()
  191. '("-no-mmx"
  192. "-no-3dnow"
  193. "-no-sse"
  194. "-no-sse2"))
  195. "-no-sse3"
  196. "-no-ssse3"
  197. "-no-sse4.1"
  198. "-no-sse4.2"
  199. "-no-avx"
  200. "-no-neon"))))
  201. %standard-phases)))))