unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser.
@ 2021-11-20 15:37 Foo Chuan Wei
  2021-11-20 15:40 ` [bug#52000] [PATCH 1/2] gnu: Add qhexedit Foo Chuan Wei
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2021-11-20 15:37 UTC (permalink / raw)
  To: 52000

This patch series adds sqlitebrowser. There have been two previous
patches [1] [2] that were not accepted into Guix because they did not
unbundle the third-party libraries bundled with sqlitebrowser. This
patch does not use the bundled libraries.

[1]: https://issues.guix.gnu.org/34612
[2]: https://issues.guix.gnu.org/47640

Foo Chuan Wei (2):
  gnu: Add qhexedit.
  gnu: Add sqlitebrowser.

 gnu/packages/databases.scm | 91 ++++++++++++++++++++++++++++++++++++++
 gnu/packages/qt.scm        | 46 +++++++++++++++++++
 2 files changed, 137 insertions(+)


base-commit: 5b96e9651029d68c17a05e9ca75b25a0f129ecca
-- 
2.25.1





^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH 1/2] gnu: Add qhexedit.
  2021-11-20 15:37 [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser Foo Chuan Wei
@ 2021-11-20 15:40 ` Foo Chuan Wei
  2021-11-20 15:44 ` [bug#52000] [PATCH 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2021-11-20 15:40 UTC (permalink / raw)
  To: 52000

* gnu/packages/qt.scm (qhexedit): New variable.
---
 gnu/packages/qt.scm | 46 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 4625d2220d..a645875456 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3065,6 +3066,51 @@ being fully customizable and easy to extend.")
     ;; be used.
     (license (list license:gpl2 license:gpl3))))
 
+(define-public qhexedit
+  (package
+    (name "qhexedit")
+    (version "0.8.9")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Simsys/qhexedit2")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "src/qhexedit.pro"
+               (("^unix:DESTDIR = /usr/lib")
+                (string-append "unix:DESTDIR = "
+                               (assoc-ref outputs "out") "/lib")))))
+         (replace 'configure
+           (lambda _
+             (chdir "src")
+             (invoke "qmake" "qhexedit.pro")))
+         (add-after 'install 'install-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (include-dir (string-append out "/include")))
+               (mkdir-p include-dir)
+               (for-each (lambda (file)
+                           (install-file file include-dir))
+                         (find-files "." "\\.h$"))))))))
+    (native-inputs
+     `(("qtbase" ,qtbase-5)
+       ("qttools" ,qttools)))
+    (home-page "https://simsys.github.io")
+    (synopsis "Binary editor widget for Qt")
+    (description
+     "@code{QHexEdit} is a hex editor widget for the Qt framework.  It is a
+simple editor for binary data, just like @code{QPlainTextEdit} is for text
+data.")
+    (license license:lgpl2.1)))
 
 (define-public soqt
   (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH 2/2] gnu: Add sqlitebrowser.
  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 ` Foo Chuan Wei
  2021-11-21 10:36 ` [bug#52000] [PATCH v2 1/2] gnu: Add qhexedit Foo Chuan Wei
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2021-11-20 15:44 UTC (permalink / raw)
  To: 52000

* gnu/packages/databases.scm (sqlitebrowser): New variable.
---
 gnu/packages/databases.scm | 91 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5edc4e2cce..ca801489be 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -54,6 +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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -130,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)
@@ -4098,6 +4100,95 @@ PostreSQL, SQLite, ODBC and MySQL.")
 connecting to MS SQL and Sybase servers over TCP/IP.")
     (license license:lgpl2.0+)))
 
+(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"
+               (("auto json_parse_result = json::parse\\(cellData, nullptr, false\\);")
+                "auto json_parse_result = json::parse(cellData.toStdString(), nullptr, false);"))
+             (substitute* '("src/RemoteDock.cpp"
+                            "src/RemotePushDialog.cpp")
+               (("json obj = json::parse\\(reply, nullptr, false\\);")
+                "json obj = json::parse(reply.toStdString(), nullptr, false);"))
+             (substitute* "src/RemoteNetwork.cpp"
+               (("json obj = json::parse\\(reply->readAll\\(\\), nullptr, false\\);")
+                "json obj = json::parse((reply->readAll()).toStdString(), nullptr, false);")))))))
+    (native-inputs
+     `(("json-modern-cxx" ,json-modern-cxx)
+       ("qcustomplot" ,qcustomplot)
+       ("qhexedit" ,qhexedit)
+       ("qscintilla" ,qscintilla)
+       ("qtbase" ,qtbase-5)
+       ("qttools" ,qttools)
+       ("sqlite" ,sqlite)))
+    (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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH v2 1/2] gnu: Add qhexedit.
  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 ` Foo Chuan Wei
  2021-11-21 10:39 ` [bug#52000] [PATCH v2 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2021-11-21 10:36 UTC (permalink / raw)
  To: 52000

* gnu/packages/qt.scm (qhexedit): New variable.
---
Changes relative to PATCH v1:
* Move qtbase-5 from native-inputs to inputs.

 gnu/packages/qt.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 4625d2220d..fb783d356e 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3065,6 +3066,52 @@ being fully customizable and easy to extend.")
     ;; be used.
     (license (list license:gpl2 license:gpl3))))
 
+(define-public qhexedit
+  (package
+    (name "qhexedit")
+    (version "0.8.9")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Simsys/qhexedit2")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "src/qhexedit.pro"
+               (("^unix:DESTDIR = /usr/lib")
+                (string-append "unix:DESTDIR = "
+                               (assoc-ref outputs "out") "/lib")))))
+         (replace 'configure
+           (lambda _
+             (chdir "src")
+             (invoke "qmake" "qhexedit.pro")))
+         (add-after 'install 'install-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (include-dir (string-append out "/include")))
+               (mkdir-p include-dir)
+               (for-each (lambda (file)
+                           (install-file file include-dir))
+                         (find-files "." "\\.h$"))))))))
+    (inputs
+     `(("qtbase" ,qtbase-5)))
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (home-page "https://simsys.github.io")
+    (synopsis "Binary editor widget for Qt")
+    (description
+     "@code{QHexEdit} is a hex editor widget for the Qt framework.  It is a
+simple editor for binary data, just like @code{QPlainTextEdit} is for text
+data.")
+    (license license:lgpl2.1)))
 
 (define-public soqt
   (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")

base-commit: 9bfbba8af5b7efb952292c8b7d5e9ee57300c2bc
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH v2 2/2] gnu: Add sqlitebrowser.
  2021-11-20 15:37 [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser Foo Chuan Wei
                   ` (2 preceding siblings ...)
  2021-11-21 10:36 ` [bug#52000] [PATCH v2 1/2] gnu: Add qhexedit Foo Chuan Wei
@ 2021-11-21 10:39 ` Foo Chuan Wei
  2022-01-15  4:22 ` [bug#52000] [PATCH v3 1/2] gnu: Add qhexedit Foo Chuan Wei
  2022-01-15  4:24 ` [bug#52000] [PATCH v3 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
  5 siblings, 0 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2021-11-21 10:39 UTC (permalink / raw)
  To: 52000

* gnu/packages/databases.scm (sqlitebrowser): New variable.
---
Changes relative to PATCH v1:
* Move libraries from native-inputs to inputs.
* Reduce the length of some long string arguments given to substitute*.

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

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 5edc4e2cce..ab7b31392e 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -54,6 +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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -130,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)
@@ -4098,6 +4100,96 @@ PostreSQL, SQLite, ODBC and MySQL.")
 connecting to MS SQL and Sybase servers over TCP/IP.")
     (license license:lgpl2.0+)))
 
+(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
+     `(("json-modern-cxx" ,json-modern-cxx)
+       ("qcustomplot" ,qcustomplot)
+       ("qhexedit" ,qhexedit)
+       ("qscintilla" ,qscintilla)
+       ("qtbase" ,qtbase-5)
+       ("sqlite" ,sqlite)))
+    (native-inputs
+     `(("qttools" ,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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH v3 1/2] gnu: Add qhexedit.
  2021-11-20 15:37 [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser Foo Chuan Wei
                   ` (3 preceding siblings ...)
  2021-11-21 10:39 ` [bug#52000] [PATCH v2 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
@ 2022-01-15  4:22 ` Foo Chuan Wei
  2022-02-21 13:51   ` bug#52000: " Guillaume Le Vaillant
  2022-01-15  4:24 ` [bug#52000] [PATCH v3 2/2] gnu: Add sqlitebrowser Foo Chuan Wei
  5 siblings, 1 reply; 8+ messages in thread
From: Foo Chuan Wei @ 2022-01-15  4:22 UTC (permalink / raw)
  To: 52000

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

 gnu/packages/qt.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 01bf961bbf..223304822a 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3004,6 +3005,50 @@ being fully customizable and easy to extend.")
     ;; be used.
     (license (list license:gpl2 license:gpl3))))
 
+(define-public qhexedit
+  (package
+    (name "qhexedit")
+    (version "0.8.9")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Simsys/qhexedit2")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-path
+           (lambda* (#:key outputs #:allow-other-keys)
+             (substitute* "src/qhexedit.pro"
+               (("^unix:DESTDIR = /usr/lib")
+                (string-append "unix:DESTDIR = "
+                               (assoc-ref outputs "out") "/lib")))))
+         (replace 'configure
+           (lambda _
+             (chdir "src")
+             (invoke "qmake" "qhexedit.pro")))
+         (add-after 'install 'install-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (include-dir (string-append out "/include")))
+               (mkdir-p include-dir)
+               (for-each (lambda (file)
+                           (install-file file include-dir))
+                         (find-files "." "\\.h$"))))))))
+    (inputs (list qtbase-5))
+    (native-inputs (list qttools))
+    (home-page "https://simsys.github.io")
+    (synopsis "Binary editor widget for Qt")
+    (description
+     "@code{QHexEdit} is a hex editor widget for the Qt framework.  It is a
+simple editor for binary data, just like @code{QPlainTextEdit} is for text
+data.")
+    (license license:lgpl2.1)))
 
 (define-public soqt
   (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")

base-commit: 3c43f2b4f54dead73ce19427eb1e364581b7f2e0
-- 
2.25.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#52000] [PATCH v3 2/2] gnu: Add sqlitebrowser.
  2021-11-20 15:37 [bug#52000] [PATCH 0/2] gnu: Add sqlitebrowser Foo Chuan Wei
                   ` (4 preceding siblings ...)
  2022-01-15  4:22 ` [bug#52000] [PATCH v3 1/2] gnu: Add qhexedit Foo Chuan Wei
@ 2022-01-15  4:24 ` Foo Chuan Wei
  5 siblings, 0 replies; 8+ messages in thread
From: Foo Chuan Wei @ 2022-01-15  4:24 UTC (permalink / raw)
  To: 52000

* 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





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#52000: [PATCH v3 1/2] gnu: Add qhexedit.
  2022-01-15  4:22 ` [bug#52000] [PATCH v3 1/2] gnu: Add qhexedit Foo Chuan Wei
@ 2022-02-21 13:51   ` Guillaume Le Vaillant
  0 siblings, 0 replies; 8+ messages in thread
From: Guillaume Le Vaillant @ 2022-02-21 13:51 UTC (permalink / raw)
  To: Foo Chuan Wei; +Cc: 52000-done

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

Patch pushed as f2b841403921148eec4502ac23b55c1b75ab021e.
sqlitebrowser is already in Guix
(9183b8142b43082fee55a2730399243dea47ad0a).
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-21 14:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [bug#52000] [PATCH v3 2/2] gnu: Add sqlitebrowser Foo Chuan Wei

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).