My GNU Health package

  • Done
  • quality assurance status badge
Details
4 participants
  • Morgan.J.Smith
  • Maxim Cournoyer
  • phodina
  • zimoun
Owner
unassigned
Submitted by
phodina
Severity
normal
P
P
phodina wrote on 11 Dec 2022 18:48
NpH8OkRj54bg-Ai44dzMFpC4ZgdAKZbGi8VHhf4pis-sLrkQs_TLY9VVYPih6kZanTpyWWLnv3_CdbR3blxRlBVbAzuS4bRLFFABZdOI_6A=@protonmail.com
Hi,

here's libre medical package to track personal health.

----
Petr
Attachment: file
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.

Toggle diff (81 lines)
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
Z
Z
zimoun wrote on 12 Dec 2022 14:31
877cywpx35.fsf@gmail.com
Hi,

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

Toggle quote (2 lines)
> here's libre medical package to track personal health.

I tested with:

Toggle snippet (8 lines)
guix time-machine --branch=issue-59974 \
--commit=749c8e6d07caeb46f7686a705e62726214558bb1 \
--url=https://git.guix-patches.cbaines.net/git/guix-patches \
--disable-authentication \
-- shell mygnuhealth \
-- mygnuhealth

and it builds and seems to work.

Toggle quote (19 lines)
> + (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.

Toggle quote (2 lines)
> + (add-before 'check 'env-setup
> + (lambda* _
-^
Why?

Is lambda is not enough here?

Toggle quote (19 lines)
> + (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
P
P
phodina wrote on 13 Dec 2022 09:15
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 59974@debbugs.gnu.org)
oRlBT_hE-9BsJKb4c1RogSJWnrCEFWeqCYlxUePfNGQZuwP-21WwZiyVPW4fo6RPSKbLcycG62u6Ui68fw3rakt3aB-thWRF035RPvF3y2Q=@protonmail.com
Hi Simon,

Toggle quote (22 lines)
> > + (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.

Toggle quote (9 lines)
>
> > + (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
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.

Toggle diff (81 lines)
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
M
M
Maxim Cournoyer wrote on 16 Jan 2023 15:57
Re: bug#59974: My GNU Health package
(name . phodina)(address . phodina@protonmail.com)
87a62ia5nu.fsf_-_@gmail.com
Hi Petr,

phodina <phodina@protonmail.com> writes:

Toggle quote (39 lines)
> 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
P
P
phodina wrote on 17 Jan 2023 08:28
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
cDednQg1dqrDuSZJoFxAbQwMbnCjAjqI4aGh6EbP85U8_HYaniLHDOnT-u8LosMEPx9N96QsIiZOLQac7czQrtu4e3_KG6ru3oZ2MuuW63E=@protonmail.com
Hi Maxim,

Toggle quote (6 lines)
> 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.


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

Toggle diff (81 lines)
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
P
P
phodina wrote on 17 Jan 2023 08:30
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
6E6fkbvhMFx89Mx0hkgojJn2Rl99oPZwTebvrYLWYmUV1isJYVnYE--tokTSkRBc5o-IoklqepOhQYPpuL8gV2IEBtC2spAJI1zy8wkVtDo=@protonmail.com
Sorry,

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

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

Toggle diff (85 lines)
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
M
M
Maxim Cournoyer wrote on 17 Jan 2023 17:02
(name . phodina)(address . phodina@protonmail.com)
87lem1174p.fsf@gmail.com
Hi Petr,

phodina <phodina@protonmail.com> writes:

Toggle quote (27 lines)
> 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
M
M
Maxim Cournoyer wrote on 17 Jan 2023 17:11
(name . phodina)(address . phodina@protonmail.com)
87h6wp16qo.fsf@gmail.com
Hello,

phodina <phodina@protonmail.com> writes:

[...]

Toggle quote (4 lines)
> Patch V3 changes:
>
> * added `bash-minimal` and `python` as dependencies.

Thanks for V3!

Toggle quote (66 lines)
> ----
> 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.

Toggle quote (12 lines)
> + (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 :-)

Toggle quote (10 lines)
> + (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
M
M
Morgan.J.Smith wrote on 13 Feb 2023 02:08
[PATCH v4] gnu: Add mygnuhealth.
(address . 59974@debbugs.gnu.org)
DM5PR03MB316341DEB0D6E286ADF5776DC5DD9@DM5PR03MB3163.namprd03.prod.outlook.com
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(+)

Toggle diff (79 lines)
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
M
M
Maxim Cournoyer wrote on 21 Mar 2023 04:46
Re: bug#59974: My GNU Health package
(address . Morgan.J.Smith@outlook.com)
87fs9yu5qc.fsf_-_@gmail.com
Hi,

Morgan.J.Smith@outlook.com writes:

Toggle quote (13 lines)
> 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):

Toggle snippet (23 lines)
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

Applied!

--
Thanks,
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 59974@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59974
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch