;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2015, 2018, 2019 Ludovic Courtès ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner ;;; Copyright © 2016, 2017 ng0 ;;; Copyright © 2016 Thomas Danckaert ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus ;;; Copyright © 2017 Quiliro ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Nicolas Goaziou ;;; Copyright © 2018 Hartmut Goebel ;;; Copyright © 2018 Eric Bavier ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages qt) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix packages) #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages bison) #:use-module (gnu packages compression) #:use-module (gnu packages cups) #:use-module (gnu packages databases) #:use-module (gnu packages documentation) #:use-module (gnu packages fontutils) #:use-module (gnu packages flex) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gperf) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages linux) #:use-module (gnu packages maths) #:use-module (gnu packages nss) #:use-module (gnu packages pciutils) #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages ruby) #:use-module (gnu packages sdl) #:use-module (gnu packages sqlite) #:use-module (gnu packages tls) #:use-module (gnu packages vulkan) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu packages xml) #:use-module (srfi srfi-1)) (define-public grantlee (package (name "grantlee") (version "5.1.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/steveire/grantlee.git") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1dmah2gd6zd4fgz2f4ir11dazqg067hjz8xshhywhfsmavchi626")))) (native-inputs ;; Optional: lcov and cccc, both are for code coverage `(("doxygen" ,doxygen))) (inputs `(("qtbase" ,qtbase) ("qtscript" ,qtscript))) (build-system cmake-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'delete-broken-tests (lambda _ ;; TODO: Two date tests (for date01 and date02) fail for unknown ;; reasons. ;; Actual (result): "" ;; Expected (output): "01" ;; Actual (result): "" ;; Expected (output): "Jan. 1, 2008" (delete-file "templates/tests/testfilters.cpp") (substitute* "templates/tests/CMakeLists.txt" (("testfilters") "")) #t)) (add-before 'check 'check-setup (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (home-page "https://github.com/steveire/grantlee") (synopsis "Libraries for text templating with Qt") (description "Grantlee Templates can be used for theming and generation of other text such as code. The syntax uses the syntax of the Django template system, and the core design of Django is reused in Grantlee.") (license license:lgpl2.0+))) (define-public qt (package (name "qt") (version "5.11.3") (outputs '("out" "examples")) (source (origin (method url-fetch) (uri (string-append "http://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/single/qt-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0kgzy32s1fr22fxxfhcyncfryb3qxrznlr737r4y5khk4xj1g545")) (modules '((guix build utils))) (snippet '(begin ;; Remove qtwebengine, which relies on a bundled copy of ;; chromium. Not only does it fail compilation in qt 5.5: ;; 3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc:362:10: ;; error: cannot convert ‘bool’ to ‘boolean’ in return ;; it might also pose security problems. ;; Alternatively, we could use the "-skip qtwebengine" ;; configuration option. (delete-file-recursively "qtwebengine") ;; The following snippets are copied from their mondular-qt counterparts. (for-each (lambda (dir) (delete-file-recursively (string-append "qtbase/src/3rdparty/" dir))) (list "double-conversion" "freetype" "harfbuzz-ng" "libpng" "libjpeg" "pcre2" "sqlite" "xcb" "xkbcommon" "zlib")) (for-each (lambda (dir) (delete-file-recursively dir)) (list "qtimageformats/src/3rdparty" "qtmultimedia/examples/multimedia/spectrum/3rdparty" "qtwayland/examples" "qtscxml/tests/3rdparty" "qtcanvas3d/examples/canvas3d/3rdparty")) ;; Tests depend on this example, which depends on the 3rd party code. (substitute* "qtmultimedia/examples/multimedia/multimedia.pro" (("spectrum") "#")) (substitute* "qtxmlpatterns/tests/auto/auto.pro" (("qxmlquery") "# qxmlquery") (("xmlpatterns ") "# xmlpatterns")) (substitute* "qtwebglplugin/tests/plugins/platforms/platforms.pro" (("webgl") "# webgl")) (substitute* "qtscxml/tests/auto/auto.pro" (("scion") "#")) (substitute* "qtnetworkauth/tests/auto/auto.pro" (("oauth1 ") "# oauth1 ")) (substitute* "qtremoteobjects/tests/auto/qml/qml.pro" (("integration") "# integration") (("usertypes") "# usertypes")) #t)))) (build-system gnu-build-system) (propagated-inputs `(("mesa" ,mesa))) (inputs `(("alsa-lib" ,alsa-lib) ("bluez" ,bluez) ("cups" ,cups) ("dbus" ,dbus) ("double-conversion" ,double-conversion) ("expat" ,expat) ("fontconfig" ,fontconfig) ("freetype" ,freetype) ("glib" ,glib) ("gstreamer" ,gstreamer) ("gst-plugins-base" ,gst-plugins-base) ("harfbuzz" ,harfbuzz) ("icu4c" ,icu4c) ("jasper" ,jasper) ("libinput" ,libinput-minimal) ("libjpeg" ,libjpeg) ("libmng" ,libmng) ("libpci" ,pciutils) ("libpng" ,libpng) ("libtiff" ,libtiff) ("libwebp" ,libwebp) ("libx11" ,libx11) ("libxcomposite" ,libxcomposite) ("libxcursor" ,libxcursor) ("libxext" ,libxext) ("libxfixes" ,libxfixes) ("libxi" ,libxi) ("libxinerama" ,libxinerama) ("libxkbcommon" ,libxkbcommon) ("libxml2" ,libxml2) ("libxrandr" ,libxrandr) ("libxrender" ,libxrender) ("libxslt" ,libxslt) ("libxtst" ,libxtst) ("mtdev" ,mtdev) ("mariadb" ,mariadb) ("nss" ,nss) ("openssl" ,openssl) ("postgresql" ,postgresql) ("pulseaudio" ,pulseaudio) ("pcre2" ,pcre2) ("sqlite" ,sqlite-with-column-metadata) ("udev" ,eudev) ("unixodbc" ,unixodbc) ("wayland" ,wayland) ("xcb-util" ,xcb-util) ("xcb-util-image" ,xcb-util-image) ("xcb-util-keysyms" ,xcb-util-keysyms) ("xcb-util-renderutil" ,xcb-util-renderutil) ("xcb-util-wm" ,xcb-util-wm) ("zlib" ,zlib))) (native-inputs `(("bison" ,bison) ("flex" ,flex) ("gperf" ,gperf) ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-2) ("ruby" ,ruby) ("vulkan-headers" ,vulkan-headers) ("which" ,(@ (gnu packages base) which)))) (arguments `(#:parallel-build? #f ; Triggers race condition in qtbase module on Hydra. #:phases (modify-phases %standard-phases (add-after 'configure 'patch-bin-sh (lambda _ (substitute* '("qtbase/configure" "qtbase/mkspecs/features/qt_functions.prf" "qtbase/qmake/library/qmakebuiltins.cpp") (("/bin/sh") (which "sh"))) #t)) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (examples (assoc-ref outputs "examples"))) (substitute* '("configure" "qtbase/configure") (("/bin/pwd") (which "pwd"))) (substitute* "qtbase/src/corelib/global/global.pri" (("/bin/ls") (which "ls"))) ;; do not pass "--enable-fast-install", which makes the ;; configure process fail (invoke "./configure" "-verbose" "-prefix" out "-docdir" (string-append out "/share/doc/qt5") "-headerdir" (string-append out "/include/qt5") "-archdatadir" (string-append out "/lib/qt5") "-datadir" (string-append out "/share/qt5") "-examplesdir" (string-append examples "/share/doc/qt5/examples") ; 151MiB "-opensource" "-confirm-license" ;; These features require higher versions of Linux than the ;; minimum version of the glibc. See ;; src/corelib/global/minimum-linux_p.h. By disabling these ;; features Qt5 applications can be used on the oldest ;; kernels that the glibc supports, including the RHEL6 ;; (2.6.32) and RHEL7 (3.10) kernels. "-no-feature-getentropy" ; requires Linux 3.17 "-no-feature-renameat2" ; requires Linux 3.16 ;; Do not build examples; for the time being, we ;; prefer to save the space and build time. "-no-compile-examples" ;; Most "-system-..." are automatic, but some use ;; the bundled copy by default. "-system-sqlite" "-system-harfbuzz" "-system-pcre" ;; explicitly link with openssl instead of dlopening it "-openssl-linked" ;; explicitly link with dbus instead of dlopening it "-dbus-linked" ;; don't use the precompiled headers "-no-pch" ;; drop special machine instructions not supported ;; on all instances of the target ,@(if (string-prefix? "x86_64" (or (%current-target-system) (%current-system))) '() '("-no-sse2")) "-no-mips_dsp" "-no-mips_dspr2")))) (add-after 'install 'patch-mkspecs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (archdata (string-append out "/lib/qt5")) (mkspecs (string-append archdata "/mkspecs")) (qt_config.prf (string-append mkspecs "/features/qt_config.prf"))) ;; For each Qt module, let `qmake' uses search paths in the ;; module directory instead of all in QT_INSTALL_PREFIX. (substitute* qt_config.prf (("\\$\\$\\[QT_INSTALL_HEADERS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))") (("\\$\\$\\[QT_INSTALL_LIBS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_HOST_LIBS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_INSTALL_BINS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")) ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS. (substitute* (string-append mkspecs "/features/qt_functions.prf") (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2") "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})")) ;; Resolve qmake spec files within qtbase by absolute paths. (substitute* (map (lambda (file) (string-append mkspecs "/features/" file)) '("device_config.prf" "moc.prf" "qt_build_config.prf" "qt_config.prf" "winrt/package_manifest.prf")) (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata) (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)) #t))) (add-after 'unpack 'patch-paths ;; Use the absolute paths for dynamically loaded libs, otherwise ;; the lib will be searched in LD_LIBRARY_PATH which typically is ;; not set in guix. (lambda* (#:key inputs #:allow-other-keys) ;; libresolve (let ((glibc (assoc-ref inputs ,(if (%current-target-system) "cross-libc" "libc")))) (substitute* '("qtbase/src/network/kernel/qdnslookup_unix.cpp" "qtbase/src/network/kernel/qhostinfo_unix.cpp") (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b) (string-append a glibc "/lib/lib" b)))) ;; X11/locale (compose path) (substitute* "qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp" ;; Don't search in /usr/…/X11/locale, … (("^\\s*m_possibleLocations.append\\(QStringLiteral\\(\"/usr/.*/X11/locale\"\\)\\);" line) (string-append "// " line)) ;; … but use libx11's path (("^\\s*(m_possibleLocations.append\\(QStringLiteral\\()X11_PREFIX \"(/.*/X11/locale\"\\)\\);)" _ a b) (string-append a "\"" (assoc-ref inputs "libx11") b))) ;; libGL (substitute* "qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp" (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b) (string-append a (assoc-ref inputs "mesa") "/lib/lib" b))) ;; libXcursor (substitute* "qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp" (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b) (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)) (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b) (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))) #t))))) (native-search-paths (list (search-path-specification (variable "QMAKEPATH") (files '("lib/qt5"))) (search-path-specification (variable "QML2_IMPORT_PATH") (files '("lib/qt5/qml"))) (search-path-specification (variable "QT_PLUGIN_PATH") (files '("lib/qt5/plugins"))) (search-path-specification (variable "XDG_DATA_DIRS") (files '("share"))) (search-path-specification (variable "XDG_CONFIG_DIRS") (files '("etc/xdg"))))) (home-page "https://www.qt.io/") (synopsis "Cross-platform GUI library") (description "Qt is a cross-platform application and UI framework for developers using C++ or QML, a CSS & JavaScript like language.") (license (list license:lgpl2.1 license:lgpl3)) ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS; ;; see . ;; Qt 5: assembler error; see . (supported-systems (delete "mips64el-linux" %supported-systems)))) (define-public qt-4 (package (inherit qt) (version "4.8.7") (source (origin (method url-fetch) (uri (string-append "http://download.qt-project.org/official_releases/qt/" (string-copy version 0 (string-rindex version #\.)) "/" version "/qt-everywhere-opensource-src-" version ".tar.gz")) (sha256 (base32 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272")) (patches (search-patches "qt4-ldflags.patch")) (modules '((guix build utils))) (snippet ;; Remove webkit module, which is not built. '(begin (delete-file-recursively "src/3rdparty/webkit") #t)))) (inputs `(,@(fold alist-delete (package-inputs qt) '("harfbuzz" "libjpeg")) ("libjpeg" ,libjpeg-8) ("libsm" ,libsm))) (native-inputs `(,@(fold alist-delete (package-native-inputs qt) '("vulkan-headers")))) ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags, ;; but we can't make them a separate output because "out" and "examples" ;; would refer to each other. (outputs '("out" ;112MiB core + 37MiB examples "doc")) ;280MiB of HTML + code (arguments `(#:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs "doc"))) (substitute* '("configure") (("/bin/pwd") (which "pwd"))) (substitute* "src/corelib/global/global.pri" (("/bin/ls") (which "ls"))) (invoke "./configure" "-verbose" "-prefix" out "-nomake" "examples demos" ;; Note: Don't pass '-docdir' since 'qmake' and ;; libQtCore would record its value, thereby defeating ;; the whole point of having a separate output. "-datadir" (string-append out "/share/qt-" ,version "/data") "-importdir" (string-append out "/lib/qt-4" "/imports") "-plugindir" (string-append out "/lib/qt-4" "/plugins") "-translationdir" (string-append out "/share/qt-" ,version "/translations") "-demosdir" (string-append out "/share/qt-" ,version "/demos") "-examplesdir" (string-append out "/share/qt-" ,version "/examples") "-opensource" "-confirm-license" ;; explicitly link with dbus instead of dlopening it "-dbus-linked" ;; Skip the webkit module; it fails to build on armhf ;; and, apart from that, may pose security risks. "-no-webkit" ;; don't use the precompiled headers "-no-pch" ;; drop special machine instructions not supported ;; on all instances of the target ,@(if (string-prefix? "x86_64" (or (%current-target-system) (%current-system))) '() '("-no-mmx" "-no-3dnow" "-no-sse" "-no-sse2")) "-no-sse3" "-no-ssse3" "-no-sse4.1" "-no-sse4.2" "-no-avx")))) (add-after 'install 'move-doc (lambda* (#:key outputs #:allow-other-keys) ;; Because of qt4-documentation-path.patch, documentation ends up ;; being installed in OUT. Move it to the right place. (let* ((out (assoc-ref outputs "out")) (doc (assoc-ref outputs "doc")) (olddoc (string-append out "/doc")) (docdir (string-append doc "/share/doc/qt-" ,version))) (mkdir-p (dirname docdir)) ;; Note: We can't use 'rename-file' here because OUT and DOC are ;; different "devices" due to bind-mounts. (copy-recursively olddoc docdir) (delete-file-recursively olddoc) #t)))))))) (define-public qtbase (package (name "qtbase") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "071yc9iz14qs4s8yvrwllyfdzp5yjxsdpvbjxdrf0g5q69vqigy6")) ;; Use TZDIR to avoid depending on package "tzdata". (patches (search-patches "qtbase-use-TZDIR.patch" "qtbase-old-kernel.patch")) (modules '((guix build utils))) (snippet ;; corelib uses bundled harfbuzz, md4, md5, sha3 '(begin (with-directory-excursion "src/3rdparty" (for-each delete-file-recursively (list "double-conversion" "freetype" "harfbuzz-ng" "libpng" "libjpeg" "pcre2" "sqlite" "xcb" "xkbcommon" "zlib")) #t))))) (build-system gnu-build-system) (propagated-inputs `(("mesa" ,mesa) ("which" ,(@ (gnu packages base) which)))) (inputs `(("alsa-lib" ,alsa-lib) ("cups" ,cups) ("dbus" ,dbus) ("double-conversion" ,double-conversion) ("eudev" ,eudev) ("expat" ,expat) ("fontconfig" ,fontconfig) ("freetype" ,freetype) ("glib" ,glib) ("harfbuzz" ,harfbuzz) ("icu4c" ,icu4c) ("libinput" ,libinput-minimal) ("libjpeg" ,libjpeg) ("libmng" ,libmng) ("libpng" ,libpng) ("libx11" ,libx11) ("libxcomposite" ,libxcomposite) ("libxcursor" ,libxcursor) ("libxfixes" ,libxfixes) ("libxi" ,libxi) ("libxinerama" ,libxinerama) ("libxkbcommon" ,libxkbcommon) ("libxml2" ,libxml2) ("libxrandr" ,libxrandr) ("libxrender" ,libxrender) ("libxslt" ,libxslt) ("libxtst" ,libxtst) ("mtdev" ,mtdev) ("mariadb" ,mariadb) ("nss" ,nss) ("openssl" ,openssl) ("pcre2" ,pcre2) ("postgresql" ,postgresql) ("pulseaudio" ,pulseaudio) ("sqlite" ,sqlite-with-column-metadata) ("unixodbc" ,unixodbc) ("xcb-util" ,xcb-util) ("xcb-util-image" ,xcb-util-image) ("xcb-util-keysyms" ,xcb-util-keysyms) ("xcb-util-renderutil" ,xcb-util-renderutil) ("xcb-util-wm" ,xcb-util-wm) ("zlib" ,zlib))) (native-inputs `(("bison" ,bison) ("flex" ,flex) ("gperf" ,gperf) ("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-2) ("vulkan-headers" ,vulkan-headers) ("ruby" ,ruby))) (arguments `(#:phases (modify-phases %standard-phases (add-after 'configure 'patch-bin-sh (lambda _ (substitute* '("config.status" "configure" "mkspecs/features/qt_functions.prf" "qmake/library/qmakebuiltins.cpp") (("/bin/sh") (which "sh"))) #t)) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* "configure" (("/bin/pwd") (which "pwd"))) (substitute* "src/corelib/global/global.pri" (("/bin/ls") (which "ls"))) ;; The configuration files for other Qt5 packages are searched ;; through a call to "find_package" in Qt5Config.cmake, which ;; disables the use of CMAKE_PREFIX_PATH via the parameter ;; "NO_DEFAULT_PATH". Re-enable it so that the different ;; components can be installed in different places. (substitute* (find-files "." ".*\\.cmake") (("NO_DEFAULT_PATH") "")) ;; do not pass "--enable-fast-install", which makes the ;; configure process fail (invoke "./configure" "-verbose" "-prefix" out "-docdir" (string-append out "/share/doc/qt5") "-headerdir" (string-append out "/include/qt5") "-archdatadir" (string-append out "/lib/qt5") "-datadir" (string-append out "/share/qt5") "-examplesdir" (string-append out "/share/doc/qt5/examples") "-opensource" "-confirm-license" ;; These features require higher versions of Linux than the ;; minimum version of the glibc. See ;; src/corelib/global/minimum-linux_p.h. By disabling these ;; features Qt5 applications can be used on the oldest ;; kernels that the glibc supports, including the RHEL6 ;; (2.6.32) and RHEL7 (3.10) kernels. "-no-feature-getentropy" ; requires Linux 3.17 ;; Do not build examples; if desired, these could go ;; into a separate output, but for the time being, we ;; prefer to save the space and build time. "-no-compile-examples" ;; Most "-system-..." are automatic, but some use ;; the bundled copy by default. "-system-sqlite" "-system-harfbuzz" "-system-pcre" ;; explicitly link with openssl instead of dlopening it "-openssl-linked" ;; explicitly link with dbus instead of dlopening it "-dbus-linked" ;; don't use the precompiled headers "-no-pch" ;; drop special machine instructions that do not have ;; runtime detection ,@(if (string-prefix? "x86_64" (or (%current-target-system) (%current-system))) '() '("-no-sse2")) "-no-mips_dsp" "-no-mips_dspr2")))) (add-after 'install 'patch-mkspecs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (archdata (string-append out "/lib/qt5")) (mkspecs (string-append archdata "/mkspecs")) (qt_config.prf (string-append mkspecs "/features/qt_config.prf"))) ;; For each Qt module, let `qmake' uses search paths in the ;; module directory instead of all in QT_INSTALL_PREFIX. (substitute* qt_config.prf (("\\$\\$\\[QT_INSTALL_HEADERS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))") (("\\$\\$\\[QT_INSTALL_LIBS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_HOST_LIBS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") (("\\$\\$\\[QT_INSTALL_BINS\\]") "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")) ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS. (substitute* (string-append mkspecs "/features/qt_functions.prf") (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2") "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})")) ;; Resolve qmake spec files within qtbase by absolute paths. (substitute* (map (lambda (file) (string-append mkspecs "/features/" file)) '("device_config.prf" "moc.prf" "qt_build_config.prf" "qt_config.prf" "winrt/package_manifest.prf")) (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata) (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)) #t))) (add-after 'unpack 'patch-paths ;; Use the absolute paths for dynamically loaded libs, otherwise ;; the lib will be searched in LD_LIBRARY_PATH which typically is ;; not set in guix. (lambda* (#:key inputs #:allow-other-keys) ;; libresolve (let ((glibc (assoc-ref inputs ,(if (%current-target-system) "cross-libc" "libc")))) (substitute* '("src/network/kernel/qdnslookup_unix.cpp" "src/network/kernel/qhostinfo_unix.cpp") (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b) (string-append a glibc "/lib/lib" b)))) ;; X11/locale (compose path) (substitute* "src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp" ;; Don't search in /usr/…/X11/locale, … (("^\\s*m_possibleLocations.append\\(QStringLiteral\\(\"/usr/.*/X11/locale\"\\)\\);" line) (string-append "// " line)) ;; … but use libx11's path (("^\\s*(m_possibleLocations.append\\(QStringLiteral\\()X11_PREFIX \"(/.*/X11/locale\"\\)\\);)" _ a b) (string-append a "\"" (assoc-ref inputs "libx11") b))) ;; libGL (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp" (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b) (string-append a (assoc-ref inputs "mesa") "/lib/lib" b))) ;; libXcursor (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp" (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b) (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)) (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b) (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))) #t))))) (native-search-paths (list (search-path-specification (variable "QMAKEPATH") (files '("lib/qt5"))) (search-path-specification (variable "QML2_IMPORT_PATH") (files '("lib/qt5/qml"))) (search-path-specification (variable "QT_PLUGIN_PATH") (files '("lib/qt5/plugins"))) (search-path-specification (variable "XDG_DATA_DIRS") (files '("share"))) (search-path-specification (variable "XDG_CONFIG_DIRS") (files '("etc/xdg"))))) (home-page "https://www.qt.io/") (synopsis "Cross-platform GUI library") (description "Qt is a cross-platform application and UI framework for developers using C++ or QML, a CSS & JavaScript like language.") (license (list license:lgpl2.1 license:lgpl3)))) (define-public qtsvg (package (inherit qtbase) (name "qtsvg") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "14a4rprbj9f9rhixbk7143xdz34d7d39xh9v2sc1w43q9sf2rsi1")))) (propagated-inputs `()) (native-inputs `(("perl" ,perl))) (inputs `(("mesa" ,mesa) ("qtbase" ,qtbase) ("zlib" ,zlib))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'configure 'configure-qmake (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (qtbase (assoc-ref inputs "qtbase")) (tmpdir (string-append (getenv "TMPDIR"))) (qmake (string-append tmpdir "/qmake")) (qt.conf (string-append tmpdir "/qt.conf"))) ;; Use qmake with a customized qt.conf to override install ;; paths to $out. (symlink (which "qmake") qmake) (setenv "PATH" (string-append tmpdir ":" (getenv "PATH"))) (with-output-to-file qt.conf (lambda () (format #t "[Paths] Prefix=~a ArchData=lib/qt5 Data=share/qt5 Documentation=share/doc/qt5 Headers=include/qt5 Libraries=lib LibraryExecutables=lib/qt5/libexec Binaries=bin Tests=tests Plugins=lib/qt5/plugins Imports=lib/qt5/imports Qml2Imports=lib/qt5/qml Translations=share/qt5/translations Settings=etc/xdg Examples=share/doc/qt5/examples HostPrefix=~a HostData=lib/qt5 HostBinaries=bin HostLibraries=lib [EffectiveSourcePaths] HostPrefix=~a HostData=lib/qt5 " out out qtbase))) #t))) (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) ;; Valid QT_BUILD_PARTS variables are: ;; libs tools tests examples demos docs translations (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"))) (add-before 'check 'set-display (lambda _ ;; make Qt render "offscreen", required for tests (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) (synopsis "Qt module for displaying SVGs") (description "The QtSvg module provides classes for displaying the contents of SVG files."))) (define-public qtimageformats (package (inherit qtsvg) (name "qtimageformats") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0zq8igsjyyhxsjr43vpaasrqjw3x0g6rwqf8kaz7y9vs7ny63ch4")) (modules '((guix build utils))) (snippet '(begin (delete-file-recursively "src/3rdparty") #t)))) (native-inputs `()) (inputs `(("jasper" ,jasper) ("libmng" ,libmng) ("libtiff" ,libtiff) ("libwebp" ,libwebp) ("mesa" ,mesa) ("qtbase" ,qtbase) ("zlib" ,zlib))) (synopsis "Additional Image Format plugins for Qt") (description "The QtImageFormats module contains plugins for adding support for MNG, TGA, TIFF and WBMP image formats."))) (define-public qtx11extras (package (inherit qtsvg) (name "qtx11extras") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "11fd2mc20qmnyv1vqhaqad2q6m0i4lmkr432rmqvpkgphpkfp7pr")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl))) (inputs `(("mesa" ,mesa) ("qtbase" ,qtbase))) (synopsis "Qt Extras for X11") (description "The QtX11Extras module includes the library to access X11 from within Qt 5."))) (define-public qtxmlpatterns (package (inherit qtsvg) (name "qtxmlpatterns") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1vhfvgi39miqsx3iq7c9sii2sykq0yfng69b70i0smr20zihpl4b")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'disable-network-tests (lambda _ (substitute* "tests/auto/auto.pro" (("qxmlquery") "# qxmlquery") (("xmlpatterns ") "# xmlpatterns")) #t)))))) (native-inputs `(("perl" ,perl))) (inputs `(("qtbase" ,qtbase))) (synopsis "Qt XML patterns module") (description "The QtXmlPatterns module is a XQuery and XPath engine for XML and custom data models. It contains programs such as xmlpatterns and xmlpatternsvalidator."))) (define-public qtdeclarative (package (inherit qtsvg) (name "qtdeclarative") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1rhsf9bma2zwwpixk2fsg31x7c1pmsk144npypgc9w86swhkc9lf")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-2) ("qtsvg" ,qtsvg) ("qtxmlpatterns" ,qtxmlpatterns))) (inputs `(("mesa" ,mesa) ("qtbase" ,qtbase))) (synopsis "Qt QML module (Quick 2)") (description "The Qt QML module provides a framework for developing applications and libraries with the QML language. It defines and implements the language and engine infrastructure, and provides an API to enable application developers to extend the QML language with custom types and integrate QML code with JavaScript and C++."))) (define-public qtconnectivity (package (inherit qtsvg) (name "qtconnectivity") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0amks3qad31i7cha85kvcaxvlmmgkc3gm4jdkw2p02ixxfygr30l")))) (native-inputs `(("perl" ,perl) ("pkg-config" ,pkg-config) ("qtdeclarative" ,qtdeclarative))) (inputs `(("bluez" ,bluez) ("qtbase" ,qtbase))) (synopsis "Qt Connectivity module") (description "The Qt Connectivity modules provides modules for interacting with Bluetooth and NFC."))) (define-public qtwebsockets (package (inherit qtsvg) (name "qtwebsockets") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1ffmapfy68xwwbxbg19ng6b5h8v42cf78s21j7rgq49gm70r0402")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative))) (inputs `(("qtbase" ,qtbase))) (synopsis "Qt Web Sockets module") (description "WebSocket is a web-based protocol designed to enable two-way communication between a client application and a remote host. The Qt WebSockets module provides C++ and QML interfaces that enable Qt applications to act as a server that can process WebSocket requests, or a client that can consume data received from the server, or both."))) (define-public qtsensors (package (inherit qtsvg) (name "qtsensors") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0n88c8xi9pbyh7q1pcqv4yjv6nx62abflj8qgfr4qzb0sp8m6mx7")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:parallel-tests? _ #f) #f) ; can lead to race condition ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'fix-tests (lambda _ (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp" (("2000") "5000") ;lengthen test timeout (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test #t)))))) (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative))) (inputs `(("qtbase" ,qtbase))) (synopsis "Qt Sensors module") (description "The Qt Sensors API provides access to sensor hardware via QML and C++ interfaces. The Qt Sensors API also provides a motion gesture recognition API for devices."))) (define-public qtmultimedia (package (inherit qtsvg) (name "qtmultimedia") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0h9wx86zj20n4xc3qnml0i360x2dc1yd2z2af1flj8fwyzppi03j")) (modules '((guix build utils))) (snippet '(begin (delete-file-recursively "examples/multimedia/spectrum/3rdparty") ;; We also prevent the spectrum example from being built. (substitute* "examples/multimedia/multimedia.pro" (("spectrum") "#")) #t)))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:phases phases) `(modify-phases ,phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (invoke "qmake" "QT_BUILD_PARTS = libs tools tests" (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,") (string-append "PREFIX=" out))))))) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl) ("pkg-config" ,pkg-config) ("python" ,python-2) ("qtdeclarative" ,qtdeclarative))) (inputs `(("alsa-lib" ,alsa-lib) ("mesa" ,mesa) ("pulseaudio" ,pulseaudio) ("qtbase" ,qtbase) ;; Gstreamer is needed for the mediaplayer plugin ("gstreamer" ,gstreamer) ("gst-plugins-base" ,gst-plugins-base))) (synopsis "Qt Multimedia module") (description "The Qt Multimedia module provides set of APIs to play and record media, and manage a collection of media content. It also contains a set of plugins for interacting with pulseaudio and GStreamer."))) (define-public qtwayland (package (inherit qtsvg) (name "qtwayland") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1chz4wchgkzd45h143i5hkqg0whcgdbj37gkg7j4kj31whllzjb2")) (modules '((guix build utils))) (snippet ;; The examples try to build and cause the build to fail '(begin (delete-file-recursively "examples") #t)))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:phases phases) `(modify-phases ,phases (add-before 'check 'set-ld-library-path ;; ;; ;; Make the uninstalled libQt5WaylandClient.so.5 available to the ;; wayland platform plugin. (lambda _ (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib")) #t)))))) (native-inputs `(("glib" ,glib) ("perl" ,perl) ("pkg-config" ,pkg-config) ("qtdeclarative" ,qtdeclarative))) (inputs `(("fontconfig" ,fontconfig) ("freetype" ,freetype) ("libx11" ,libx11) ("libxcomposite" ,libxcomposite) ("libxext" ,libxext) ("libxkbcommon" ,libxkbcommon) ("libxrender" ,libxrender) ("mesa" ,mesa) ("mtdev" ,mtdev) ("qtbase" ,qtbase) ("wayland" ,wayland))) (synopsis "Qt Wayland module") (description "The Qt Wayland module provides the QtWayland client and compositor libraries."))) (define-public qtserialport (package (inherit qtsvg) (name "qtserialport") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1nkbfsxzgicwns3k11hhzjxy2hgrigj8xcw2by0jc1j71mnmxi4n")))) (native-inputs `(("perl" ,perl))) (inputs `(("qtbase" ,qtbase) ("eudev" ,eudev))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'patch-dlopen-paths (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/serialport/qtudev_p.h" ;; Use the absolute paths for dynamically loaded libs, ;; otherwise the lib will be searched in LD_LIBRARY_PATH which ;; typically is not set in guix. (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b) (string-append a (assoc-ref inputs "eudev") "/lib/lib" b))) #t)))))) (synopsis "Qt Serial Port module") (description "The Qt Serial Port module provides the library for interacting with serial ports from within Qt."))) (define-public qtserialbus (package (inherit qtsvg) (name "qtserialbus") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0vf12jk1ma0v0dlpliw1x9i04iaik1kjkiaby7gaxm2abprxwr2n")))) (inputs `(("qtbase" ,qtbase) ("qtserialport" ,qtserialport))) (synopsis "Qt Serial Bus module") (description "The Qt Serial Bus API provides classes and functions to access the various industrial serial buses and protocols, such as CAN, ModBus, and others."))) (define-public qtwebchannel (package (inherit qtsvg) (name "qtwebchannel") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1wrdawlqvcw84h8q52mvbjhp1vkd6fhz6c8ijlg9rw0s3fj4y99w")))) (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative) ("qtwebsockets" ,qtwebsockets))) (inputs `(("qtbase" ,qtbase))) (synopsis "Web communication library for Qt") (description "The Qt WebChannel module enables peer-to-peer communication between the host (QML/C++ application) and the client (HTML/JavaScript application). The transport mechanism is supported out of the box by the two popular web engines, Qt WebKit 2 and Qt WebEngine."))) (define-public qtwebglplugin (package (inherit qtsvg) (name "qtwebglplugin") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0wqz8lycmi7pffzy0pz5960w109lbk4mkbw0l1lh64avl6clq7b9")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'disable-network-tests (lambda _ (substitute* "tests/plugins/platforms/platforms.pro" (("webgl") "# webgl")) #t)))))) (native-inputs '()) (inputs `(("mesa" ,mesa) ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("qtwebsockets" ,qtwebsockets))) (synopsis "QPA plugin for running an application via a browser using streamed WebGL commands") (description "Qt back end that uses WebGL for rendering. It allows Qt applications (with some limitations) to run in a web browser that supports WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any compatible web browser without the use of plug-ins. The API is similar to OpenGL ES 2.0 and can be used in HTML5 canvas elements"))) (define-public qtwebview (package (inherit qtsvg) (name "qtwebview") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1njmn1n03dp4md8cz58cq2z6bsxd8nwlw0238zmavh7px3jzc9kh")))) (native-inputs `(("perl" ,perl))) (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (synopsis "Display web content in a QML application") (description "Qt WebView provides a way to display web content in a QML application without necessarily including a full web browser stack by using native APIs where it makes sense."))) (define-public qtlocation (package (inherit qtsvg) (name "qtlocation") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1sq0f41jwmsimv9a1wl2nk5nifjppm5j92rr4n4s7qwnnjjrir2q")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative) ("qtquickcontrols" ,qtquickcontrols) ("qtserialport" ,qtserialport))) (inputs `(("icu4c" ,icu4c) ("openssl" ,openssl) ("qtbase" ,qtbase) ("zlib" ,zlib))) (synopsis "Qt Location and Positioning modules") (description "The Qt Location module provides an interface for location, positioning and geolocation plugins."))) (define-public qttools (package (inherit qtsvg) (name "qttools") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "13lzdxxi02yhvx4mflhisl6aqv2fiss5m804cqccd1wvp8dyh1f2")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (native-inputs `(("perl" ,perl) ("qtdeclarative" ,qtdeclarative) ("vulkan-headers" ,vulkan-headers))) (inputs `(("mesa" ,mesa) ("qtbase" ,qtbase))) (synopsis "Qt Tools and Designer modules") (description "The Qt Tools module provides a set of applications to browse the documentation, translate applications, generate help files and other stuff that helps in Qt development."))) (define-public qtscript (package (inherit qtsvg) (name "qtscript") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "027cvggbcvwyz76cn1bl1zvqg0nq7iica1b7yx7xyy0hb36g715v")) (patches (search-patches "qtscript-disable-tests.patch")))) (native-inputs `(("perl" ,perl) ("qttools" ,qttools))) (inputs `(("qtbase" ,qtbase))) (synopsis "Qt Script module") (description "Qt provides support for application scripting with ECMAScript. The following guides and references cover aspects of programming with ECMAScript and Qt."))) (define-public qtquickcontrols (package (inherit qtsvg) (name "qtquickcontrols") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0dvmy31qbl76yy0j5y8m7mvnmqyg2c01fmlkn0snvc5h5ah5skjf")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (synopsis "Qt Quick Controls and other Quick modules") (description "The QtScript module provides classes for making Qt applications scriptable. This module provides a set of extra components that can be used to build complete interfaces in Qt Quick."))) (define-public qtquickcontrols2 (package (inherit qtsvg) (name "qtquickcontrols2") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "11nhpb0xckv5jjkqj5szr94c2rvyjwr89ch58hh64nsqaav30mpl")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (synopsis "Qt Quick Controls 2 and other Quick 2 modules") (description "The Qt Quick Controls 2 module contains the Qt Labs Platform module that provides platform integration: native dialogs, menus and menu bars, and tray icons. It falls back to Qt Widgets when a native implementation is not available."))) (define-public qtgraphicaleffects (package (inherit qtsvg) (name "qtgraphicaleffects") (version "5.11.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "1qjpdzkamf27cg5n1wsf0zk939lcgppgydfjzap9s4fxzj1nkn0l")))) (arguments (substitute-keyword-arguments (package-arguments qtsvg) ((#:tests? _ #f) #f))) ; TODO: Enable the tests (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (synopsis "Qt Graphical Effects module") (description "The Qt Graphical Effects module provides a set of QML types for adding visually impressive and configurable effects to user interfaces. Effects are visual items that can be added to Qt Quick user interface as UI components. The API consists of over 20 effects provided as separate QML types. The effects cover functional areas such as blending, masking, blurring, coloring, and many more."))) (define-public qtdeclarative-render2d ;; As of Qt-5.8.0 this module has been merged into qtdeclarative (package (inherit qtsvg) (name "qtdeclarative-render2d") (version "5.7.1") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases/qt/" (version-major+minor version) "/" version "/submodules/" name "-everywhere-src-" version ".tar.xz")) (sha256 (base32 "0zwch9vn17f3bpy300jcfxx6cx9qymk5j7khx0x9k1xqid4166c3")) (modules '((guix build utils))) (snippet '(begin (delete-file-recursively "tools/opengldummy/3rdparty") #t)))) (native-inputs `()) (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative))) (synopsis "Qt Declarative Render module") (description "The Qt Declarative Render 2D module provides a Raster backend for QtQuick scene graph.") (properties `((superseded . ,qtdeclarative))))) (define-public qtgamepad (package (inherit qtsvg) (na1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018, 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019, 2020 Christopher Howard <christopher@librehacker.com>
;;; Copyright © 2019, 2020 Evan Straw <evan.straw99@gmail.com>
;;; Copyright © 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2020 Charlie Ritter <chewzerita@posteo.net>
;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 João Pedro Simas <jpsimas@gmail.com>
;;; Copyright © 2021 Jack Hill <jackhill@jackhill.us>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages radio)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages astronomy)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages documentation)
  #:use-module (gnu packages engineering)
  #:use-module (gnu packages fltk)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gd)
  #:use-module (gnu packages geo)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages golang)
  #:use-module (gnu packages gps)
  #:use-module (gnu packages graphviz)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages image-processing)
  #:use-module (gnu packages javascript)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages logging)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages mp3)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages popt)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-science)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages sdl)
  #:use-module (gnu packages sphinx)
  #:use-module (gnu packages swig)
  #:use-module (gnu packages tcl)
  #:use-module (gnu packages tex)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages video)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system glib-or-gtk)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system go)
  #:use-module (guix build-system python)
  #:use-module (guix build-system qt))

(define-public libfec
  ;; Use commit to get compilation fixes that are not in a release yet.
  (let ((commit "9750ca0a6d0a786b506e44692776b541f90daa91")
        (revision "1"))
    (package
      (name "libfec")
      (version (git-version "1.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/quiet/libfec")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0i6jhrdswr1wglyb9h39idpz5v9z13yhidvlbj34vxpyngrkhlvs"))))
      (build-system cmake-build-system)
      (arguments
       `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
         #:test-target "test_all"))
      (home-page "https://github.com/quiet/libfec")
      (synopsis "Forward error correction algorithms library")
      (description
       "This package provides a set of functions that implement several popular
@dfn{forward error correction} (FEC) algorithms and several low-level routines
useful in modems implemented with @dfn{digital signal processing} (DSP).")
      (license license:lgpl2.1))))

(define-public liquid-dsp
  (package
    (name "liquid-dsp")
    (version "1.3.2")
    (source
     (origin (method git-fetch)
             (uri (git-reference
                   (url "https://github.com/jgaeddert/liquid-dsp")
                   (commit (string-append "v" version))))
             (file-name (git-file-name name version))
             (sha256
              (base32 "1n6dbg13q8ga5qhg1yiszwly4jj0rxqr6f1xwm9waaly5z493xsd"))))
    (build-system gnu-build-system)
    (native-inputs
     (list autoconf automake))
    (inputs
     (list fftwf libfec))
    (arguments
     `(;; For reproducibility, disable use of SSE3, SSE4.1, etc.
       #:configure-flags '("--enable-simdoverride")
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'delete-static-library
           (lambda* (#:key outputs #:allow-other-keys)
             (delete-file (string-append (assoc-ref outputs "out")
                                         "/lib/libliquid.a")))))))
    (home-page "https://liquidsdr.org")
    (synopsis "Signal processing library for software-defined radios")
    (description
     "Liquid DSP is a @dfn{digital signal processing} (DSP) library designed
specifically for software-defined radios on embedded platforms.  The aim is to
provide a lightweight DSP library that does not rely on a myriad of external
dependencies or proprietary and otherwise cumbersome frameworks.  All signal
processing elements are designed to be flexible, scalable, and dynamic,
including filters, filter design, oscillators, modems, synchronizers, complex
mathematical operations, and much more.")
    (license license:expat)))

(define-public rtl-sdr
  (package
    (name "rtl-sdr")
    (version "0.6.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://git.osmocom.org/rtl-sdr/")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0lmvsnb4xw4hmz6zs0z5ilsah5hjz29g1s0050n59fllskqr3b8k"))))
    (build-system cmake-build-system)
    (inputs
     (list libusb))
    (native-inputs
     (list pkg-config))
    (arguments
     `(#:configure-flags '("-DDETACH_KERNEL_DRIVER=ON"
                           "-DINSTALL_UDEV_RULES=ON")
       #:tests? #f ; No tests
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-paths
           (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "CMakeLists.txt"
               (("DESTINATION \"/etc/udev/")
                (string-append "DESTINATION \""
                               (assoc-ref outputs "out")
                               "/lib/udev/")))
             #t)))))
    (home-page "https://osmocom.org/projects/sdr/wiki/rtl-sdr")
    (synopsis "Software defined radio driver for Realtek RTL2832U")
    (description "DVB-T dongles based on the Realtek RTL2832U can be used as a
cheap software defined radio, since the chip allows transferring the raw I/Q
samples to the host.  @code{rtl-sdr} provides drivers for this purpose.

The default Linux driver managing DVB-T dongles as TV devices doesn't work for
SDR purposes and clashes with this package.  Therefore you must prevent the
kernel from loading it automatically by adding the following line to your
system configuration:

@lisp
(kernel-arguments '(\"modprobe.blacklist=dvb_usb_rtl28xxu\"))
@end lisp

To install the rtl-sdr udev rules, you must extend 'udev-service-type' with
this package.  E.g.: @code{(udev-rules-service 'rtl-sdr rtl-sdr)}")
    (license license:gpl2+)))

(define-public airspyhf
  (package
    (name "airspyhf")
    (version "1.6.8")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/airspy/airspyhf")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0n699i5a9fzzhf80fcjlqq6p2a013rzlwmwv4nmwfafy6c8cr924"))))
    (build-system cmake-build-system)
    (native-inputs
     (list pkg-config))
    (inputs
     (list libusb))
    (arguments
     '(#:configure-flags '("-DINSTALL_UDEV_RULES=ON")
       #:tests? #f ; No tests
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-paths
           (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "tools/CMakeLists.txt"
               (("DESTINATION \"/etc/udev/")
                (string-append "DESTINATION \""
                               (assoc-ref outputs "out")
                               "/lib/udev/")))))
         (add-after 'fix-paths 'fix-udev-rules
           (lambda _
             (substitute* "tools/52-airspyhf.rules"
               ;; The plugdev group does not exist; use dialout as in
               ;; the hackrf package.
               (("GROUP=\"plugdev\"")
                "GROUP=\"dialout\"")))))))
    (home-page "https://github.com/airspy/airspyhf")
    (synopsis "Software defined radio driver for Airspy HF+")
    (description
     "This package provides the driver and utilities for controlling the Airspy
HF+ Software Defined Radio (SDR) over USB.

To install the airspyhf udev rules, you must extend @code{udev-service-type}
with this package.  E.g.: @code{(udev-rules-service 'airspyhf airspyhf)}")
    (license license:bsd-3)))

(define-public soapysdr
  (package
    (name "soapysdr")
    (version "0.8.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/pothosware/SoapySDR")
             (commit (string-append "soapy-sdr-" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "19f2x0pkxvf9figa0pl6xqlcz8fblvqb19mcnj632p0l8vk6qdv2"))))
    (build-system cmake-build-system)
    (native-inputs
     (list python swig))
    (native-search-paths
     (list (sea