all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Foo Chuan Wei <chuanwei.foo@hotmail.com>
To: 52000@debbugs.gnu.org
Subject: [bug#52000] [PATCH v3 2/2] gnu: Add sqlitebrowser.
Date: Sat, 15 Jan 2022 04:24:59 +0000	[thread overview]
Message-ID: <PU1PR01MB2155D7675224099B2A405AE58D559@PU1PR01MB2155.apcprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <PU1PR01MB2155C908FC5C1D89628553048D9D9@PU1PR01MB2155.apcprd01.prod.exchangelabs.com>

* gnu/packages/databases.scm (sqlitebrowser): New variable.
---
Changes relative to PATCH v2:
* Replace old-style inputs with new-style inputs.
* Update copyright year.

 gnu/packages/databases.scm | 92 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 4d7b090d03..b089af5e8b 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -54,7 +54,7 @@
 ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo@member.fsf.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
-;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2021, 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -131,6 +131,7 @@
   #: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 rdf)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages regex)
@@ -4156,6 +4157,95 @@ with no external dependencies.  The targets are small apps that would
 be blown away by a SQL-DB or an external database server.")
     (license license:expat)))
 
+(define-public sqlitebrowser
+  (package
+    (name "sqlitebrowser")
+    (version "3.12.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/sqlitebrowser/sqlitebrowser")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ljqzcx388mmni8lv9jz5r58alhsjrrqi4nzjnbfki94rn4ray6z"))
+       ;; Remove bundled libraries.
+       (modules '((guix build utils)))
+       (snippet '(delete-file-recursively "libs"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:configure-flags '("-DENABLE_TESTING=ON"
+                           ;; Force the use of non-bundled libraries.
+                           "-DFORCE_INTERNAL_QSCINTILLA=OFF"
+                           "-DFORCE_INTERNAL_QHEXEDIT=OFF"
+                           "-DFORCE_INTERNAL_QCUSTOMPLOT=OFF")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "CMakeLists.txt"
+               (("^    find_package\\(QScintilla 2.8.10 QUIET\\)" all)
+                (string-append
+                  all "\n"
+                  "    set(QSCINTILLA_FOUND TRUE)\n"
+                  "    set(QSCINTILLA_INCLUDE_DIR "
+                  (assoc-ref inputs "qscintilla") "/include)"))
+               (("^    find_package\\(QHexEdit\\)" all)
+                (string-append
+                  all "\n"
+                  "    set(QHexEdit_FOUND TRUE)\n"
+                  "    set(QHexEdit_INCLUDE_DIR "
+                  (assoc-ref inputs "qhexedit") "/include)"))
+               (("^set\\(JSON_DIR libs/json\\)")
+                (string-append "set(JSON_DIR "
+                               (assoc-ref inputs "json-modern-cxx") "/include)"))
+               (("^add_subdirectory\\(\\$\\{JSON_DIR\\}\\)")  ; No need to build.
+                ""))
+
+             (substitute* '("src/EditDialog.cpp"
+                            "src/ExportDataDialog.cpp"
+                            "src/RemoteCommitsModel.h"
+                            "src/RemoteDock.cpp"
+                            "src/RemoteLocalFilesModel.h"
+                            "src/RemoteModel.h"
+                            "src/RemoteNetwork.cpp"
+                            "src/RemotePushDialog.cpp"
+                            "src/sqlitedb.cpp"
+                            "src/sqlitetablemodel.cpp")
+               (("^#include <json.hpp>")
+                "#include <nlohmann/json.hpp>"))
+
+             ;; Fix compilation error:
+             ;; "no matching function for call to ‘input_adapter(const QByteArray&)’"
+             (substitute* "src/EditDialog.cpp"
+               (("json::parse\\(cellData, nullptr, false\\)")
+                "json::parse(cellData.toStdString(), nullptr, false)"))
+             (substitute* '("src/RemoteDock.cpp"
+                            "src/RemotePushDialog.cpp")
+               (("json::parse\\(reply, nullptr, false\\)")
+                "json::parse(reply.toStdString(), nullptr, false)"))
+             (substitute* "src/RemoteNetwork.cpp"
+               (("json::parse\\(reply->readAll\\(\\), nullptr, false\\)")
+                "json::parse((reply->readAll()).toStdString(), nullptr, false)")))))))
+    (inputs
+     (list json-modern-cxx
+           qcustomplot
+           qhexedit
+           qscintilla
+           qtbase-5
+           sqlite))
+    (native-inputs (list qttools))
+    (home-page "https://sqlitebrowser.org")
+    (synopsis "GUI editor for SQLite databases")
+    (description
+     "DB Browser for SQLite (DB4S) is a visual tool to create, design, and edit
+database files compatible with SQLite.  DB4S is for users and developers who
+want to create, search, and edit databases using a familiar spreadsheet-like
+interface, without needing to learn complicated SQL commands.")
+    ;; Dual licensing.
+    (license (list license:gpl3+ license:mpl2.0))))
+
 (define-public sequeler
   (package
     (name "sequeler")
-- 
2.25.1





      parent reply	other threads:[~2022-01-15  4:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-20 15:37 [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser Foo Chuan Wei
2021-11-20 15:40 ` [bug#52000] [PATCH 1/2] gnu: Add qhexedit Foo Chuan Wei
2021-11-20 15:44 ` [bug#52000] [PATCH 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
2021-11-21 10:36 ` [bug#52000] [PATCH v2 1/2] gnu: Add qhexedit Foo Chuan Wei
2021-11-21 10:39 ` [bug#52000] [PATCH v2 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
2022-01-15  4:22 ` [bug#52000] [PATCH v3 1/2] gnu: Add qhexedit Foo Chuan Wei
2022-02-21 13:51   ` bug#52000: " Guillaume Le Vaillant
2022-01-15  4:24 ` Foo Chuan Wei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PU1PR01MB2155D7675224099B2A405AE58D559@PU1PR01MB2155.apcprd01.prod.exchangelabs.com \
    --to=chuanwei.foo@hotmail.com \
    --cc=52000@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.