gnu: qt: Enable SIMD instructions available on x86_64.
[jackhill/guix/guix.git] / gnu / packages / qt.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 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
19 (define-module (gnu packages qt)
20 #:use-module ((guix licenses) #:select (lgpl2.1 x11-style))
21 #:use-module (guix packages)
22 #:use-module (guix download)
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 libjpeg)
31 #:use-module (gnu packages libpng)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages mysql)
34 #:use-module (gnu packages openssl)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages xorg))
40
41 (define-public libxkbcommon
42 (package
43 (name "libxkbcommon")
44 (version "0.3.1")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append "http://xkbcommon.org/download/" name "-"
48 version ".tar.xz"))
49 (sha256
50 (base32
51 "13mk335r4dhi9qglzbp46ina1wz4qgcp8r7s06iq7j50pf0kb5ww"))))
52 (build-system gnu-build-system)
53 (inputs
54 `(("bison" ,bison)))
55 (home-page "http://xkbcommon.org/")
56 (synopsis "library to handle keyboard descriptions")
57 (description "Xkbcommon is a library to handle keyboard descriptions,
58 including loading them from disk, parsing them and handling their
59 state. It is mainly meant for client toolkits, window systems, and other
60 system applications; currently that includes Wayland, kmscon, GTK+, Qt,
61 Clutter, and more. Despite the name, it is not currently used by anything
62 X11 (yet).")
63 (license (x11-style "file://COPYING"
64 "See 'COPYING' in the distribution."))))
65
66 (define-public qt
67 (package
68 (name "qt")
69 (version "5.1.1")
70 (source (origin
71 (method url-fetch)
72 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
73 (string-copy version 0 (string-rindex version #\.))
74 "/" version
75 "/single/qt-everywhere-opensource-src-"
76 version ".tar.gz"))
77 (sha256
78 (base32
79 "1xl6n4ai0yfknaiawgyr0cyixk0d2j4262k13mmyj993nlnp81ac"))))
80 (build-system gnu-build-system)
81 (propagated-inputs
82 `(("mesa" ,mesa)))
83 (inputs
84 ;; FIXME: Add input ruby once available.
85 `(("alsa-lib" ,alsa-lib)
86 ("dbus" ,dbus)
87 ("fontconfig" ,fontconfig)
88 ("freetype" ,freetype)
89 ("glib" ,glib)
90 ("icu4c" ,icu4c)
91 ;; FIXME: Switch to current libjpeg with qt 5.1.2, see
92 ;; https://qt.gitorious.org/qt/qt/commit/2a9ea11f4dea51f9e75036aab8e7a23f0eb4bd1f/diffs
93 ("libjpeg" ,libjpeg-8)
94 ("libpng" ,libpng)
95 ("libx11" ,libx11)
96 ("libxi" ,libxi)
97 ("libxkbcommon" ,libxkbcommon)
98 ("libxrender" ,libxrender)
99 ("mysql" ,mysql)
100 ("openssl" ,openssl)
101 ("perl" ,perl)
102 ("pkg-config" ,pkg-config)
103 ("pulseaudio" ,pulseaudio)
104 ("python-wrapper" ,python-wrapper)
105 ("xcb-util" ,xcb-util)
106 ("xcb-util-image" ,xcb-util-image)
107 ("xcb-util-keysyms" ,xcb-util-keysyms)
108 ("xcb-util-renderutil" ,xcb-util-renderutil)
109 ("xcb-util-wm" ,xcb-util-wm)
110 ("zlib" ,zlib)))
111 (arguments
112 `(#:phases
113 (alist-replace
114 'configure
115 (lambda* (#:key outputs #:allow-other-keys)
116 (let ((out (assoc-ref outputs "out")))
117 (substitute* '("configure" "qtbase/configure")
118 (("/bin/pwd") (which "pwd")))
119 ;; do not pass "--enable-fast-install", which makes the
120 ;; configure process fail
121 (zero? (system*
122 "./configure"
123 "-verbose"
124 "-prefix" out
125 "-opensource"
126 "-confirm-license"
127 ;; drop special machine instructions not supported
128 ;; on all instances of the target
129 ,@(if (string-prefix? "x86_64"
130 (or (%current-target-system)
131 (%current-system)))
132 '()
133 '("-no-sse2"))
134 "-no-sse3"
135 "-no-ssse3"
136 "-no-sse4.1"
137 "-no-sse4.2"
138 "-no-avx"
139 "-no-avx2"
140 "-no-neon"
141 "-no-mips_dsp"
142 "-no-mips_dspr2"))))
143 %standard-phases)))
144 (home-page "http://qt-project.org/")
145 (synopsis "Cross-platform GUI library")
146 (description "Qt is a cross-platform application and UI framework for
147 developers using C++ or QML, a CSS & JavaScript like language.")
148 (license lgpl2.1)))
149
150 (define-public qt-4
151 (package (inherit qt)
152 (version "4.8.5")
153 (source (origin
154 (method url-fetch)
155 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
156 (string-copy version 0 (string-rindex version #\.))
157 "/" version
158 "/qt-everywhere-opensource-src-"
159 version ".tar.gz"))
160 (sha256
161 (base32
162 "0f51dbgn1dcck8pqimls2qyf1pfmsmyknh767cvw87c3d218ywpb"))
163 (patches (list (search-patch "qt4-tests.patch")))))
164 (arguments
165 `(#:phases
166 (alist-replace
167 'configure
168 (lambda* (#:key outputs #:allow-other-keys)
169 (let ((out (assoc-ref outputs "out")))
170 (substitute* '("configure")
171 (("/bin/pwd") (which "pwd")))
172 ;; do not pass "--enable-fast-install", which makes the
173 ;; configure process fail
174 (zero? (system*
175 "./configure"
176 "-verbose"
177 "-prefix" out
178 "-opensource"
179 "-confirm-license"
180 ;; drop special machine instructions not supported
181 ;; on all instances of the target
182 ,@(if (string-prefix? "x86_64"
183 (or (%current-target-system)
184 (%current-system)))
185 '()
186 '("-no-mmx"
187 "-no-3dnow"
188 "-no-sse"
189 "-no-sse2"))
190 "-no-sse3"
191 "-no-ssse3"
192 "-no-sse4.1"
193 "-no-sse4.2"
194 "-no-avx"
195 "-no-neon"))))
196 %standard-phases)))))