unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59974] My GNU Health package
@ 2022-12-11 17:48 phodina via Guix-patches via
  2022-12-12 13:31 ` zimoun
  2023-02-13  1:08 ` [bug#59974] [PATCH v4] gnu: Add mygnuhealth Morgan.J.Smith
  0 siblings, 2 replies; 10+ messages in thread
From: phodina via Guix-patches via @ 2022-12-11 17:48 UTC (permalink / raw)
  To: 59974, zimon.toutoune


[-- Attachment #1.1: Type: text/plain, Size: 70 bytes --]

Hi,

here's libre medical package to track personal health.

----
Petr

[-- Attachment #1.2: Type: text/html, Size: 166 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-mygnuhealth.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-mygnuhealth.patch, Size: 3698 bytes --]

From ad70dc3965898743dadf3f19f39c129316dd2d1b Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 11 Dec 2022 18:10:17 +0100
Subject: [PATCH] gnu: Add mygnuhealth.

* gnu/packages/medical.scm (mygnuhealth): New variable.

diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..3be8064ffa 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,12 +21,66 @@
 (define-module (gnu packages medical)
   #:use-module (guix build-system python)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages kde-frameworks) ; kirigami
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
 
+(define-public mygnuhealth
+  (package
+    (name "mygnuhealth")
+    (version "1.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "MyGNUHealth" version))
+              (sha256
+               (base32
+                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'install 'wrap-executable
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let ((out (assoc-ref outputs "out"))
+                                  (qml "/lib/qt5/qml"))
+                              (wrap-program (string-append #$output
+                                                           "/bin/mygnuhealth")
+                                            `("QML2_IMPORT_PATH" ":" prefix
+                                              (,(string-append out qml)
+                                               ,@(map (lambda (i)
+                                                     (string-append
+                                                      (assoc-ref inputs i) qml))
+                                               '("kirigami"
+                                                 "qtdeclarative"
+                                                 "qtgraphicaleffects"
+                                                 "qtquickcontrols"
+                                                 "qtquickcontrols2"))))))))
+                        (add-before 'check 'env-setup
+                          (lambda* _
+                            (mkdir-p "/tmp/mygh/")
+                            (setenv "HOME" "/tmp"))))))
+    (native-inputs (list python-pyside-2))
+    (inputs (list qtbase-5
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5
+                  kirigami))
+    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
+                             python-tinydb))
+    (home-page "https://www.gnuhealth.org")
+    (synopsis "The GNU Health Personal Health Record")
+    (description
+     "This package provides GNUHealth Personal Health Record
+application for desktop and mobile devices that integrates with the GNU
+Health Federation.")
+    (license gpl3+)))
+
 (define-public openmolar-1
   (package
    (name "openmolar")
-- 
2.38.1


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

* [bug#59974] My GNU Health package
  2022-12-11 17:48 [bug#59974] My GNU Health package phodina via Guix-patches via
@ 2022-12-12 13:31 ` zimoun
  2022-12-13  8:15   ` phodina via Guix-patches via
  2023-02-13  1:08 ` [bug#59974] [PATCH v4] gnu: Add mygnuhealth Morgan.J.Smith
  1 sibling, 1 reply; 10+ messages in thread
From: zimoun @ 2022-12-12 13:31 UTC (permalink / raw)
  To: phodina, 59974

Hi,

On Sun, 11 Dec 2022 at 17:48, phodina via Guix-patches via <guix-patches@gnu.org> wrote:

> here's libre medical package to track personal health.

I tested with:

--8<---------------cut here---------------start------------->8---
guix time-machine --branch=issue-59974                                        \
                  --commit=749c8e6d07caeb46f7686a705e62726214558bb1           \
                  --url=https://git.guix-patches.cbaines.net/git/guix-patches \
                  --disable-authentication                                    \
     -- shell mygnuhealth                                                     \
     -- mygnuhealth
--8<---------------cut here---------------end--------------->8---

and it builds and seems to work.

> +    (arguments
> +     (list #:phases #~(modify-phases %standard-phases
> +                        (add-after 'install 'wrap-executable
> +                          (lambda* (#:key inputs outputs #:allow-other-keys)
> +                            (let ((out (assoc-ref outputs "out"))
> +                                  (qml "/lib/qt5/qml"))
> +                              (wrap-program (string-append #$output
> +                                                           "/bin/mygnuhealth")
> +                                            `("QML2_IMPORT_PATH" ":" prefix
> +                                              (,(string-append out qml)
> +                                               ,@(map (lambda (i)
> +                                                     (string-append
> +                                                      (assoc-ref inputs i) qml))
> +                                               '("kirigami"
> +                                                 "qtdeclarative"
> +                                                 "qtgraphicaleffects"
> +                                                 "qtquickcontrols"
> +                                                 "qtquickcontrols2"))))))))

Here, I have another indentation.  I do not have an opinion.

> +                        (add-before 'check 'env-setup
> +                          (lambda* _
                                   -^
                               Why?

Is lambda is not enough here?

> +                            (mkdir-p "/tmp/mygh/")
> +                            (setenv "HOME" "/tmp"))))))
> +    (native-inputs (list python-pyside-2))
> +    (inputs (list qtbase-5
> +                  qtdeclarative-5
> +                  qtgraphicaleffects
> +                  qtquickcontrols-5
> +                  qtquickcontrols2-5
> +                  kirigami))
> +    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
> +                             python-tinydb))
> +    (home-page "https://www.gnuhealth.org")
> +    (synopsis "The GNU Health Personal Health Record")
> +    (description
> +     "This package provides GNUHealth Personal Health Record
> +application for desktop and mobile devices that integrates with the GNU
> +Health Federation.")
> +    (license gpl3+)))

LGTM.

Cheers,
simon




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

* [bug#59974] My GNU Health package
  2022-12-12 13:31 ` zimoun
@ 2022-12-13  8:15   ` phodina via Guix-patches via
  2023-01-16 14:57     ` Maxim Cournoyer
  0 siblings, 1 reply; 10+ messages in thread
From: phodina via Guix-patches via @ 2022-12-13  8:15 UTC (permalink / raw)
  To: zimoun; +Cc: 59974

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

Hi Simon,

> > + (arguments
> > + (list #:phases #~(modify-phases %standard-phases
> > + (add-after 'install 'wrap-executable
> > + (lambda* (#:key inputs outputs #:allow-other-keys)
> > + (let ((out (assoc-ref outputs "out"))
> > + (qml "/lib/qt5/qml"))
> > + (wrap-program (string-append #$output
> > + "/bin/mygnuhealth")
> > + `("QML2_IMPORT_PATH" ":" prefix
> > + (,(string-append out qml)
> > + ,@(map (lambda (i)
> > + (string-append
> > + (assoc-ref inputs i) qml))
> > + '("kirigami"
> > + "qtdeclarative"
> > + "qtgraphicaleffects"
> > + "qtquickcontrols"
> > + "qtquickcontrols2"))))))))
> 
> 
> Here, I have another indentation. I do not have an opinion.

To me it's also reasonable. I just use 'guix style PKG' and fix the results if they have weird indentation.

> 
> > + (add-before 'check 'env-setup
> > + (lambda* _
> 
> -^
> Why?
> 
> Is lambda is not enough here?

I guess it was just copy paste of the the previous phase and I realized the keywords aren't necessary. Fixed to use just lambda as suggested. 

I also made some small changes to use gexp and 'out' variable in the phase 'wrap-executable'.


Thanks!

----
Petr 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v2-0001-gnu-Add-mygnuhealth.patch --]
[-- Type: text/x-patch; name=v2-0001-gnu-Add-mygnuhealth.patch, Size: 3670 bytes --]

From 960dfac430fdb7315d344b8bae60669712d9f43a Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 11 Dec 2022 18:10:17 +0100
Subject: [PATCH v2] gnu: Add mygnuhealth.

* gnu/packages/medical.scm (mygnuhealth): New variable.

diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..c41d8c8b3d 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,12 +21,66 @@
 (define-module (gnu packages medical)
   #:use-module (guix build-system python)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages kde-frameworks) ; kirigami
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
 
+(define-public mygnuhealth
+  (package
+    (name "mygnuhealth")
+    (version "1.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "MyGNUHealth" version))
+              (sha256
+               (base32
+                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'install 'wrap-executable
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (let ((out #$output)
+                                  (qml "/lib/qt5/qml"))
+                              (wrap-program (string-append out
+                                                           "/bin/mygnuhealth")
+                                            `("QML2_IMPORT_PATH" ":" prefix
+                                              (,(string-append out qml)
+                                               ,@(map (lambda (i)
+                                                     (string-append
+                                                      (assoc-ref inputs i) qml))
+                                               '("kirigami"
+                                                 "qtdeclarative"
+                                                 "qtgraphicaleffects"
+                                                 "qtquickcontrols"
+                                                 "qtquickcontrols2"))))))))
+                        (add-before 'check 'env-setup
+                          (lambda _
+                            (mkdir-p "/tmp/mygh/")
+                            (setenv "HOME" "/tmp"))))))
+    (native-inputs (list python-pyside-2))
+    (inputs (list qtbase-5
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5
+                  kirigami))
+    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
+                             python-tinydb))
+    (home-page "https://www.gnuhealth.org")
+    (synopsis "The GNU Health Personal Health Record")
+    (description
+     "This package provides GNUHealth Personal Health Record
+application for desktop and mobile devices that integrates with the GNU
+Health Federation.")
+    (license gpl3+)))
+
 (define-public openmolar-1
   (package
    (name "openmolar")
-- 
2.38.1


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

* [bug#59974] My GNU Health package
  2022-12-13  8:15   ` phodina via Guix-patches via
@ 2023-01-16 14:57     ` Maxim Cournoyer
  2023-01-17  7:28       ` phodina via Guix-patches via
  0 siblings, 1 reply; 10+ messages in thread
From: Maxim Cournoyer @ 2023-01-16 14:57 UTC (permalink / raw)
  To: phodina; +Cc: 59974, zimoun

Hi Petr,

phodina <phodina@protonmail.com> writes:

> Hi Simon,
>
>> > + (arguments
>> > + (list #:phases #~(modify-phases %standard-phases
>> > + (add-after 'install 'wrap-executable
>> > + (lambda* (#:key inputs outputs #:allow-other-keys)
>> > + (let ((out (assoc-ref outputs "out"))
>> > + (qml "/lib/qt5/qml"))
>> > + (wrap-program (string-append #$output
>> > + "/bin/mygnuhealth")
>> > + `("QML2_IMPORT_PATH" ":" prefix
>> > + (,(string-append out qml)
>> > + ,@(map (lambda (i)
>> > + (string-append
>> > + (assoc-ref inputs i) qml))
>> > + '("kirigami"
>> > + "qtdeclarative"
>> > + "qtgraphicaleffects"
>> > + "qtquickcontrols"
>> > + "qtquickcontrols2"))))))))
>> 
>> 
>> Here, I have another indentation. I do not have an opinion.
>
> To me it's also reasonable. I just use 'guix style PKG' and fix the results if they have weird indentation.
>
>> 
>> > + (add-before 'check 'env-setup
>> > + (lambda* _
>> 
>> -^
>> Why?
>> 
>> Is lambda is not enough here?
>
> I guess it was just copy paste of the the previous phase and I realized the keywords aren't necessary. Fixed to use just lambda as suggested. 
>
> I also made some small changes to use gexp and 'out' variable in the phase 'wrap-executable'.

Would wrap-script instead of wrap-program work here (I think it does for
Python and other interpreted languages)?  This tends to produce cleaner
--help message, when $0 (arg0) is used in these, and it looks better in
'top' since there's only one script and not a .mygnuhealth-real wrapped
one.

Otherwise LGTM, thanks for Simon for the review!

-- 
Thanks,
Maxim




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

* [bug#59974] My GNU Health package
  2023-01-16 14:57     ` Maxim Cournoyer
@ 2023-01-17  7:28       ` phodina via Guix-patches via
  2023-01-17  7:30         ` phodina via Guix-patches via
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: phodina via Guix-patches via @ 2023-01-17  7:28 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 59974, zimoun

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

Hi Maxim,

> Would wrap-script instead of wrap-program work here (I think it does for
> Python and other interpreted languages)? This tends to produce cleaner
> --help message, when $0 (arg0) is used in these, and it looks better in
> 'top' since there's only one script and not a .mygnuhealth-real wrapped
> one.

I've changed the `wrap-program` to `wrap-script` but it fails to run:

$ $ /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth
/gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth: /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real: #f: bad interpreter: No such file or directory
/gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth: line 3: /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real: Success

$ head /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real
#!#f --no-auto-compile
#!#; Guix wrapper

Haven't used the `wrap-script` before but here it puts completely wrong shebang.

Seems this behavior has been already reported but not resolved. [1]

Patch V3 changes:

* added `bash-minimal` and `python` as dependencies.

1 https://issues.guix.gnu.org/40039

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v3-0001-gnu-Add-mygnuhealth.patch --]
[-- Type: text/x-patch; name=v3-0001-gnu-Add-mygnuhealth.patch, Size: 3670 bytes --]

From a997a19afaacb9cff523bff39231b176c4553921 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 11 Dec 2022 18:10:17 +0100
Subject: [PATCH v3] gnu: Add mygnuhealth.

* gnu/packages/medical.scm (mygnuhealth): New variable.

diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..c41d8c8b3d 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,12 +21,66 @@
 (define-module (gnu packages medical)
   #:use-module (guix build-system python)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages kde-frameworks) ; kirigami
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
 
+(define-public mygnuhealth
+  (package
+    (name "mygnuhealth")
+    (version "1.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "MyGNUHealth" version))
+              (sha256
+               (base32
+                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'install 'wrap-executable
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (let ((out #$output)
+                                  (qml "/lib/qt5/qml"))
+                              (wrap-program (string-append out
+                                                           "/bin/mygnuhealth")
+                                            `("QML2_IMPORT_PATH" ":" prefix
+                                              (,(string-append out qml)
+                                               ,@(map (lambda (i)
+                                                     (string-append
+                                                      (assoc-ref inputs i) qml))
+                                               '("kirigami"
+                                                 "qtdeclarative"
+                                                 "qtgraphicaleffects"
+                                                 "qtquickcontrols"
+                                                 "qtquickcontrols2"))))))))
+                        (add-before 'check 'env-setup
+                          (lambda _
+                            (mkdir-p "/tmp/mygh/")
+                            (setenv "HOME" "/tmp"))))))
+    (native-inputs (list python-pyside-2))
+    (inputs (list qtbase-5
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5
+                  kirigami))
+    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
+                             python-tinydb))
+    (home-page "https://www.gnuhealth.org")
+    (synopsis "The GNU Health Personal Health Record")
+    (description
+     "This package provides GNUHealth Personal Health Record
+application for desktop and mobile devices that integrates with the GNU
+Health Federation.")
+    (license gpl3+)))
+
 (define-public openmolar-1
   (package
    (name "openmolar")
-- 
2.38.1


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

* [bug#59974] My GNU Health package
  2023-01-17  7:28       ` phodina via Guix-patches via
@ 2023-01-17  7:30         ` phodina via Guix-patches via
  2023-01-17 16:02         ` Maxim Cournoyer
  2023-01-17 16:11         ` Maxim Cournoyer
  2 siblings, 0 replies; 10+ messages in thread
From: phodina via Guix-patches via @ 2023-01-17  7:30 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 59974, zimoun

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

Sorry,

left the changes in staged. Now the patch is correct.

----
Petr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v3-0001-gnu-Add-mygnuhealth.patch --]
[-- Type: text/x-patch; name=v3-0001-gnu-Add-mygnuhealth.patch, Size: 3817 bytes --]

From eba23361dbee4d305c1416c5c0c3d3da2e23b558 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 11 Dec 2022 18:10:17 +0100
Subject: [PATCH v3] gnu: Add mygnuhealth.

* gnu/packages/medical.scm (mygnuhealth): New variable.

diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..f3bdc8ad4b 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,12 +21,70 @@
 (define-module (gnu packages medical)
   #:use-module (guix build-system python)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
+  #:use-module (gnu packages bash) ; wrap-program
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages kde-frameworks) ; kirigami
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
 
+(define-public mygnuhealth
+  (package
+    (name "mygnuhealth")
+    (version "1.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "MyGNUHealth" version))
+              (sha256
+               (base32
+                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'install 'wrap-executable
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (let ((out #$output)
+                                  (qml "/lib/qt5/qml"))
+                              (wrap-program (string-append out
+                                                           "/bin/mygnuhealth")
+                                            `("QML2_IMPORT_PATH" ":" prefix
+                                              (,(string-append out qml)
+                                               ,@(map (lambda (i)
+                                                     (string-append
+                                                      (assoc-ref inputs i) qml))
+                                               '("kirigami"
+                                                 "qtdeclarative"
+                                                 "qtgraphicaleffects"
+                                                 "qtquickcontrols"
+                                                 "qtquickcontrols2"))))))))
+                        (add-before 'check 'env-setup
+                          (lambda _
+                            (mkdir-p "/tmp/mygh/")
+                            (setenv "HOME" "/tmp"))))))
+    (native-inputs (list python-pyside-2))
+    (inputs (list bash-minimal
+                  python
+                  qtbase-5
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5
+                  kirigami))
+    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
+                             python-tinydb))
+    (home-page "https://www.gnuhealth.org")
+    (synopsis "The GNU Health Personal Health Record")
+    (description
+     "This package provides GNUHealth Personal Health Record
+application for desktop and mobile devices that integrates with the GNU
+Health Federation.")
+    (license gpl3+)))
+
 (define-public openmolar-1
   (package
    (name "openmolar")
-- 
2.38.1


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

* [bug#59974] My GNU Health package
  2023-01-17  7:28       ` phodina via Guix-patches via
  2023-01-17  7:30         ` phodina via Guix-patches via
@ 2023-01-17 16:02         ` Maxim Cournoyer
  2023-01-17 16:11         ` Maxim Cournoyer
  2 siblings, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2023-01-17 16:02 UTC (permalink / raw)
  To: phodina; +Cc: 59974, zimoun

Hi Petr,

phodina <phodina@protonmail.com> writes:

> Hi Maxim,
>
>> Would wrap-script instead of wrap-program work here (I think it does for
>> Python and other interpreted languages)? This tends to produce cleaner
>> --help message, when $0 (arg0) is used in these, and it looks better in
>> 'top' since there's only one script and not a .mygnuhealth-real wrapped
>> one.
>
> I've changed the `wrap-program` to `wrap-script` but it fails to run:
>
> $ $ /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth
> /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth:
> /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real:
> #f: bad interpreter: No such file or directory
> /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/mygnuhealth:
> line 3:
> /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real:
> Success
>
> $ head /gnu/store/zxv1d25inf2iyc9bl5lf2wkrm951mvll-mygnuhealth-1.0.5/bin/.mygnuhealth-real
> #!#f --no-auto-compile
> #!#; Guix wrapper
>
> Haven't used the `wrap-script` before but here it puts completely wrong shebang.
>
> Seems this behavior has been already reported but not resolved. [1]

Too bad!  I'll try to find the time to look at it soon.

-- 
Thanks,
Maxim




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

* [bug#59974] My GNU Health package
  2023-01-17  7:28       ` phodina via Guix-patches via
  2023-01-17  7:30         ` phodina via Guix-patches via
  2023-01-17 16:02         ` Maxim Cournoyer
@ 2023-01-17 16:11         ` Maxim Cournoyer
  2 siblings, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2023-01-17 16:11 UTC (permalink / raw)
  To: phodina; +Cc: 59974, zimoun

Hello,

phodina <phodina@protonmail.com> writes:

[...]

> Patch V3 changes:
>
> * added `bash-minimal` and `python` as dependencies.

Thanks for V3!  

> ----
> Petr
>
> From a997a19afaacb9cff523bff39231b176c4553921 Mon Sep 17 00:00:00 2001
> From: Petr Hodina <phodina@protonmail.com>
> Date: Sun, 11 Dec 2022 18:10:17 +0100
> Subject: [PATCH v3] gnu: Add mygnuhealth.
>
> * gnu/packages/medical.scm (mygnuhealth): New variable.
>
> diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
> index 6c9cc757eb..c41d8c8b3d 100644
> --- a/gnu/packages/medical.scm
> +++ b/gnu/packages/medical.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
>  ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
> +;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -20,12 +21,66 @@
>  (define-module (gnu packages medical)
>    #:use-module (guix build-system python)
>    #:use-module (guix download)
> +  #:use-module (guix gexp)
>    #:use-module (guix licenses)
>    #:use-module (guix packages)
>    #:use-module (gnu packages databases)
> +  #:use-module (gnu packages kde-frameworks) ; kirigami
> +  #:use-module (gnu packages python-crypto)
> +  #:use-module (gnu packages python-web)
>    #:use-module (gnu packages python-xyz)
>    #:use-module (gnu packages qt))
>  
> +(define-public mygnuhealth
> +  (package
> +    (name "mygnuhealth")
> +    (version "1.0.5")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (pypi-uri "MyGNUHealth" version))
> +              (sha256
> +               (base32
> +                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
> +    (build-system python-build-system)
> +    (arguments
> +     (list #:phases #~(modify-phases %standard-phases
> +                        (add-after 'install 'wrap-executable
> +                          (lambda* (#:key inputs #:allow-other-keys)
> +                            (let ((out #$output)
> +                                  (qml "/lib/qt5/qml"))
> +                              (wrap-program (string-append out
> +                                                           "/bin/mygnuhealth")
> +                                            `("QML2_IMPORT_PATH" ":" prefix
> +                                              (,(string-append out qml)
> +                                               ,@(map (lambda (i)
> +                                                     (string-append
> +                                                      (assoc-ref inputs i) qml))
> +                                               '("kirigami"
> +                                                 "qtdeclarative"
> +                                                 "qtgraphicaleffects"
> +                                                 "qtquickcontrols"
> +                                                 "qtquickcontrols2"))))))))

Here it'd be nicer to use wrap-all-qt-programs from (guix build
qt-utils), to avoid hard coding the qt version in the QML wrapped path.

> +                        (add-before 'check 'env-setup
> +                          (lambda _
> +                            (mkdir-p "/tmp/mygh/")
> +                            (setenv "HOME" "/tmp"))))))
> +    (native-inputs (list python-pyside-2))
> +    (inputs (list qtbase-5
> +                  qtdeclarative-5
> +                  qtgraphicaleffects
> +                  qtquickcontrols-5
> +                  qtquickcontrols2-5
> +                  kirigami))

Sort k before q :-)

> +    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
> +                             python-tinydb))
> +    (home-page "https://www.gnuhealth.org")
> +    (synopsis "The GNU Health Personal Health Record")
> +    (description
> +     "This package provides GNUHealth Personal Health Record
> +application for desktop and mobile devices that integrates with the GNU
> +Health Federation.")
> +    (license gpl3+)))

The rest LGTM.

-- 
Thanks,
Maxim




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

* [bug#59974] [PATCH v4] gnu: Add mygnuhealth.
  2022-12-11 17:48 [bug#59974] My GNU Health package phodina via Guix-patches via
  2022-12-12 13:31 ` zimoun
@ 2023-02-13  1:08 ` Morgan.J.Smith
  2023-03-21  3:46   ` bug#59974: My GNU Health package Maxim Cournoyer
  1 sibling, 1 reply; 10+ messages in thread
From: Morgan.J.Smith @ 2023-02-13  1:08 UTC (permalink / raw)
  To: 59974; +Cc: phodina, maxim.cournoyer, zimon.toutoune

From: Petr Hodina <phodina@protonmail.com>

* gnu/packages/medical.scm (mygnuhealth): New variable.
---

Hello!

I hope I'm not over reaching or stealing anyone's thunder but I completed the
patch with Maxim's suggestions.

Please double check that the author stays as "Petr Hodina" and not me.  I
barely did anything.

Thanks,

Morgan

 gnu/packages/medical.scm | 52 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/medical.scm b/gnu/packages/medical.scm
index 6c9cc757eb..20f7411938 100644
--- a/gnu/packages/medical.scm
+++ b/gnu/packages/medical.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
+;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,13 +20,64 @@
 
 (define-module (gnu packages medical)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix licenses)
   #:use-module (guix packages)
+  #:use-module (gnu packages bash) ; wrap-program
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages kde-frameworks) ; kirigami
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt))
 
+(define-public mygnuhealth
+  (package
+    (name "mygnuhealth")
+    (version "1.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "MyGNUHealth" version))
+              (sha256
+               (base32
+                "1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:imported-modules `(,@%python-build-system-modules
+                           ,@%qt-build-system-modules)
+      #:modules `(((guix build qt-build-system) #:prefix qt:)
+                  (guix build python-build-system)
+                  (guix build utils))
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'install 'qt-wrap
+                     (assoc-ref qt:%standard-phases 'qt-wrap))
+                   (add-before 'check 'env-setup
+                     (lambda _
+                       (mkdir-p "/tmp/mygh/")
+                       (setenv "HOME" "/tmp"))))))
+    (native-inputs (list python-pyside-2))
+    (inputs (list bash-minimal
+                  kirigami
+                  python
+                  qtbase-5
+                  qtdeclarative-5
+                  qtgraphicaleffects
+                  qtquickcontrols-5
+                  qtquickcontrols2-5))
+    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
+                             python-tinydb))
+    (home-page "https://www.gnuhealth.org")
+    (synopsis "The GNU Health Personal Health Record")
+    (description
+     "This package provides GNUHealth Personal Health Record
+application for desktop and mobile devices that integrates with the GNU
+Health Federation.")
+    (license gpl3+)))
+
 (define-public openmolar-1
   (package
    (name "openmolar")
-- 
2.39.1





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

* bug#59974: My GNU Health package
  2023-02-13  1:08 ` [bug#59974] [PATCH v4] gnu: Add mygnuhealth Morgan.J.Smith
@ 2023-03-21  3:46   ` Maxim Cournoyer
  0 siblings, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2023-03-21  3:46 UTC (permalink / raw)
  To: Morgan.J.Smith; +Cc: 59974-done, phodina, zimon.toutoune

Hi,

Morgan.J.Smith@outlook.com writes:

> From: Petr Hodina <phodina@protonmail.com>
>
> * gnu/packages/medical.scm (mygnuhealth): New variable.
> ---
>
> Hello!
>
> I hope I'm not over reaching or stealing anyone's thunder but I completed the
> patch with Maxim's suggestions.
>
> Please double check that the author stays as "Petr Hodina" and not me.  I
> barely did anything.

Excellent.  I still added you as 'Co-author' for the much welcome
initiative, and moved the propagated-inputs to the inputs, as the
command is wrapped (and this is a user application, not a library):

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/medical.scm
@@ -63,13 +63,16 @@ (define-public mygnuhealth
     (inputs (list bash-minimal
                   kirigami
                   python
+                  python-bcrypt
+                  python-matplotlib
+                  python-requests
+                  python-tinydb
                   qtbase-5
                   qtdeclarative-5
                   qtgraphicaleffects
                   qtquickcontrols-5
-                  qtquickcontrols2-5))
-    (propagated-inputs (list python-bcrypt python-matplotlib python-requests
-                             python-tinydb))
+                  qtquickcontrols2-5
+                  qtsvg-5))
     (home-page "https://www.gnuhealth.org")
     (synopsis "The GNU Health Personal Health Record")
     (description
--8<---------------cut here---------------end--------------->8---

Applied!

-- 
Thanks,
Maxim




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

end of thread, other threads:[~2023-03-21  3:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11 17:48 [bug#59974] My GNU Health package phodina via Guix-patches via
2022-12-12 13:31 ` zimoun
2022-12-13  8:15   ` phodina via Guix-patches via
2023-01-16 14:57     ` Maxim Cournoyer
2023-01-17  7:28       ` phodina via Guix-patches via
2023-01-17  7:30         ` phodina via Guix-patches via
2023-01-17 16:02         ` Maxim Cournoyer
2023-01-17 16:11         ` Maxim Cournoyer
2023-02-13  1:08 ` [bug#59974] [PATCH v4] gnu: Add mygnuhealth Morgan.J.Smith
2023-03-21  3:46   ` bug#59974: My GNU Health package Maxim Cournoyer

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).