* [bug#44309] [PATCH] gnu: gnucash: Enable python bindings.
@ 2020-10-29 15:29 Prafulla Giri
2020-11-01 4:44 ` [bug#44309] Further Cleanups Prafulla Giri
2020-11-02 13:52 ` [bug#44309] New and Improved Patch Prafulla Giri
0 siblings, 2 replies; 5+ messages in thread
From: Prafulla Giri @ 2020-10-29 15:29 UTC (permalink / raw)
To: 44309
[-- Attachment #1.1: Type: text/plain, Size: 291 bytes --]
Esteemed maintainers,
Attached is a patch that enables python bindings in gnucash.
I have also taken the liberty of adding native-search-paths field and
adding 'PYTHONPATH' to it for foreign distro users who might want to use
gnucash python bindings with host-os-supplied python.
Thanks!
[-- Attachment #1.2: Type: text/html, Size: 408 bytes --]
[-- Attachment #2: 0001-gnu-gnucash-Enable-python-bindings.patch --]
[-- Type: text/x-patch, Size: 2609 bytes --]
From a7ea4f9743441219940442be188238e363c4943f Mon Sep 17 00:00:00 2001
From: Prafulla Giri <pratheblackdiamond@gmail.com>
Date: Thu, 29 Oct 2020 20:47:37 +0545
Subject: [PATCH] gnu: gnucash: Enable python bindings.
* gnu/packages/gnucash.scm (gnucash):
[inputs]: Add python.
[arguments]<configure-flags>: Add '-DWITH_PYTHON=ON'
[native-search-paths]: New field. Add PYTHONPATH.
---
gnu/packages/gnucash.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 8f58ce332a..d5a356ab54 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -24,6 +24,7 @@
(define-module (gnu packages gnucash)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
@@ -48,6 +49,7 @@
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages python)
#:use-module (gnu packages tls)
#:use-module (gnu packages web)
#:use-module (gnu packages webkit)
@@ -82,6 +84,7 @@
("libxslt" ,libxslt)
("webkitgtk" ,webkitgtk)
("aqbanking" ,aqbanking)
+ ("python" ,python)
("perl-date-manip" ,perl-date-manip)
("perl-finance-quote" ,perl-finance-quote)
("tzdata" ,tzdata-for-tests)))
@@ -98,6 +101,7 @@
(outputs '("out" "doc" "debug"))
(arguments
`(#:test-target "check"
+ #:configure-flags '("-DWITH_PYTHON=ON")
#:make-flags '("GUILE_AUTO_COMPILE=0")
#:modules ((guix build cmake-build-system)
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
@@ -184,6 +188,16 @@
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
(add-after 'install 'glib-or-gtk-wrap
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+ ;; Export 'PYTHONPATH' for foreign-distro users who might want to
+ ;; use gnucash python bindings with their host-os-supplied python
+ (native-search-paths
+ (list
+ (search-path-specification
+ (variable "PYTHONPATH")
+ (files `(,(string-append "lib/python"
+ (version-major+minor
+ (package-version python))
+ "/site-packages"))))))
(home-page "https://www.gnucash.org/")
(synopsis "Personal and small business financial accounting software")
(description
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [bug#44309] Further Cleanups
2020-10-29 15:29 [bug#44309] [PATCH] gnu: gnucash: Enable python bindings Prafulla Giri
@ 2020-11-01 4:44 ` Prafulla Giri
2020-11-02 13:52 ` [bug#44309] New and Improved Patch Prafulla Giri
1 sibling, 0 replies; 5+ messages in thread
From: Prafulla Giri @ 2020-11-01 4:44 UTC (permalink / raw)
To: 44309
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]
I am wondering if the python bindings should be separated into an output.
gnucash:python perhaps. That is the route that the Ubuntu developers seem
to have taken. `apt show python3-gnucash`. It would actually make even more
sense with guix as one could use flatpak-installed gnucash for their daily
usage, and then from their /usr/bin/python3 or $GUIX_PROFILE/bin/python3
they could use gnucash programmatically via the bindings.
However, I am not sure if it is possible to specify a
search-path-specification for a particular output of a package. I don't
know much about splitting packages into outputs either. If we had
gnucash:python, and a user ran `guix install gnucash:python`, would that
only get the user /gnu/store/...-gnucash-x.y-python from the substitute
server and save them bandwidth?
If anybody is willing to give me some pointers as to how I could go about
cleanly splitting gnucash into gnucash:python - with the
native-search-path-specification for PYTHONPATH only being declared for
gnucash:python (and that will be an absolute must), I am more than happy to
clean this patch up.
Thank you.
[-- Attachment #2: Type: text/html, Size: 1228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#44309] New and Improved Patch
2020-10-29 15:29 [bug#44309] [PATCH] gnu: gnucash: Enable python bindings Prafulla Giri
2020-11-01 4:44 ` [bug#44309] Further Cleanups Prafulla Giri
@ 2020-11-02 13:52 ` Prafulla Giri
2020-11-10 21:10 ` bug#44309: " Marius Bakke
1 sibling, 1 reply; 5+ messages in thread
From: Prafulla Giri @ 2020-11-02 13:52 UTC (permalink / raw)
To: 44309
[-- Attachment #1.1: Type: text/plain, Size: 522 bytes --]
Esteemed maintainers,
Attached is an updated version of the patch.
I have removed the native-search-paths specification of PYTHONPATH. I have
also created a new output "python" that contains the python bindings. A new
phase
has been added that splits the python bindings into it's own separate
output. With that, users who only want to use gnucash programmatically can
use it with `guix environment --ad-hoc python gnucash:python`.
Please do let me know if there are any further corrections that I can make.
Thank you.
[-- Attachment #1.2: Type: text/html, Size: 659 bytes --]
[-- Attachment #2: 0001-gnu-gnucash-Enable-python-bindings.patch --]
[-- Type: text/x-patch, Size: 3170 bytes --]
From a7fc9565e89bd76e821dcf9df7d783bd5a9dcb51 Mon Sep 17 00:00:00 2001
From: Prafulla Giri <pratheblackdiamond@gmail.com>
Date: Thu, 29 Oct 2020 20:47:37 +0545
Subject: [PATCH] gnu: gnucash: Enable python bindings.
* gnu/packages/gnucash.scm (gnucash):
[inputs]: Add python.
[outputs]: Add new output 'python' for python bindings.
[arguments]<configure-flags>: Add '-DWITH_PYTHON=ON'
[arguments]: Add new build phase 'split-python-bindings'
---
gnu/packages/gnucash.scm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 8f58ce332a..525a2c53b8 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -24,6 +24,7 @@
(define-module (gnu packages gnucash)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
@@ -48,6 +49,7 @@
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages python)
#:use-module (gnu packages tls)
#:use-module (gnu packages web)
#:use-module (gnu packages webkit)
@@ -82,6 +84,7 @@
("libxslt" ,libxslt)
("webkitgtk" ,webkitgtk)
("aqbanking" ,aqbanking)
+ ("python" ,python)
("perl-date-manip" ,perl-date-manip)
("perl-finance-quote" ,perl-finance-quote)
("tzdata" ,tzdata-for-tests)))
@@ -95,9 +98,10 @@
(propagated-inputs
;; dconf is required at runtime according to README.dependencies.
`(("dconf" ,dconf)))
- (outputs '("out" "doc" "debug"))
+ (outputs '("out" "doc" "debug" "python"))
(arguments
`(#:test-target "check"
+ #:configure-flags '("-DWITH_PYTHON=ON")
#:make-flags '("GUILE_AUTO_COMPILE=0")
#:modules ((guix build cmake-build-system)
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
@@ -149,6 +153,20 @@
(symlink (string-append docs "/share/gnome")
(string-append doc-output "/share/gnome"))
#t)))
+ (add-after 'install 'split-python-bindings
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (python-output (assoc-ref outputs "python"))
+ (python-bindings (string-append
+ "lib/python"
+ ,(version-major+minor
+ (package-version python)))))
+ (mkdir-p (string-append python-output "/" python-bindings))
+ (copy-recursively
+ (string-append out "/" python-bindings)
+ (string-append python-output "/" python-bindings))
+ (delete-file-recursively
+ (string-append out "/" python-bindings)))))
(add-after 'install-docs 'wrap-programs
(lambda* (#:key inputs outputs #:allow-other-keys)
(for-each (lambda (prog)
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#44309: New and Improved Patch
2020-11-02 13:52 ` [bug#44309] New and Improved Patch Prafulla Giri
@ 2020-11-10 21:10 ` Marius Bakke
2020-11-11 9:26 ` [bug#44309] " Prafulla Giri
0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2020-11-10 21:10 UTC (permalink / raw)
To: Prafulla Giri, 44309-done
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
Prafulla Giri <pratheblackdiamond@gmail.com> writes:
> Esteemed maintainers,
>
> Attached is an updated version of the patch.
>
> I have removed the native-search-paths specification of PYTHONPATH. I have
> also created a new output "python" that contains the python bindings. A new
> phase
> has been added that splits the python bindings into it's own separate
> output. With that, users who only want to use gnucash programmatically can
> use it with `guix environment --ad-hoc python gnucash:python`.
>
> Please do let me know if there are any further corrections that I can make.
Looks great to me. Applied, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#44309] New and Improved Patch
2020-11-10 21:10 ` bug#44309: " Marius Bakke
@ 2020-11-11 9:26 ` Prafulla Giri
0 siblings, 0 replies; 5+ messages in thread
From: Prafulla Giri @ 2020-11-11 9:26 UTC (permalink / raw)
To: Marius Bakke; +Cc: 44309-done
[-- Attachment #1: Type: text/plain, Size: 746 bytes --]
Thank you!
On Wed, Nov 11, 2020 at 2:55 AM Marius Bakke <marius@gnu.org> wrote:
> Prafulla Giri <pratheblackdiamond@gmail.com> writes:
>
> > Esteemed maintainers,
> >
> > Attached is an updated version of the patch.
> >
> > I have removed the native-search-paths specification of PYTHONPATH. I
> have
> > also created a new output "python" that contains the python bindings. A
> new
> > phase
> > has been added that splits the python bindings into it's own separate
> > output. With that, users who only want to use gnucash programmatically
> can
> > use it with `guix environment --ad-hoc python gnucash:python`.
> >
> > Please do let me know if there are any further corrections that I can
> make.
>
> Looks great to me. Applied, thanks!
>
[-- Attachment #2: Type: text/html, Size: 1187 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-11 9:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-29 15:29 [bug#44309] [PATCH] gnu: gnucash: Enable python bindings Prafulla Giri
2020-11-01 4:44 ` [bug#44309] Further Cleanups Prafulla Giri
2020-11-02 13:52 ` [bug#44309] New and Improved Patch Prafulla Giri
2020-11-10 21:10 ` bug#44309: " Marius Bakke
2020-11-11 9:26 ` [bug#44309] " Prafulla Giri
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.