From 412d00728e4d924a21737c189b38d67b53c1bca9 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Sat, 18 Feb 2017 18:00:16 +0000 Subject: gnu: Add qjson. * gnu/packages/web.scm (qjson): New variable. Co-authored-by: Ricardo Wurmus --- gnu/packages/web.scm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 9fc47969ae..04886e06e3 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -21,6 +21,7 @@ ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2017 Kei Kebreau ;;; Copyright © 2017 Petter +;;; Copyright © 2017 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,6 +91,7 @@ #:use-module (gnu packages python) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages qt) #:use-module (gnu packages valgrind) #:use-module (gnu packages xml) #:use-module (gnu packages curl) @@ -510,6 +512,46 @@ easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects.") (license l:x11))) +(define-public qjson + (package + (name "qjson") + (version "0.9.0") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/flavio/qjson/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1m0h4rajj99hv9w4i381a8x81lxiv167lxk10ncvphpkfxs624p8")))) + (build-system cmake-build-system) + (arguments + ;; The tests require a X server + `(#:configure-flags '("-DQJSON_BUILD_TESTS=ON" + "-DCMAKE_CXX_FLAGS=-std=gnu++11 -fPIC") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'disable-broken-test + (lambda _ + ;; FIXME: One test fails. See + ;; https://github.com/flavio/qjson/issues/105 + (substitute* "tests/scanner/testscanner.cpp" + (("QTest::newRow\\(\"too large exponential\"\\)" line) + (string-append "//" line))) + #t)) + (add-before 'check 'render-offscreen + (lambda _ (setenv "QT_QPA_PLATFORM" "offscreen") #t))))) + (inputs + `(("qtbase" ,qtbase))) + (home-page "http://qjson.sourceforge.net") + (synopsis "Library that maps JSON data to QVariant objects") + (description "QJson is a Qt-based library that maps JSON data to +@code{QVariant} objects. JSON arrays will be mapped to @code{QVariantList} +instances, while JSON's objects will be mapped to @code{QVariantMap}.") + ;; Only version 2.1 of the license + (license l:lgpl2.1))) + (define-public krona-tools (package (name "krona-tools") -- cgit v1.2.3