unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Prafulla Giri <pratheblackdiamond@gmail.com>
To: 44309@debbugs.gnu.org
Subject: [bug#44309] New and Improved Patch
Date: Mon, 2 Nov 2020 19:37:37 +0545	[thread overview]
Message-ID: <CAFw+=j2OPcgYo=0qve4URhUtCkOM3oGSiZV2sLs0bU7pbsXWnw@mail.gmail.com> (raw)
In-Reply-To: <CAFw+=j2NSyb3YywVU1t4JtPF-Y9JBoLjW-m5cqHQ9VEpuO+i0w@mail.gmail.com>


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


  parent reply	other threads:[~2020-11-02 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-11-10 21:10   ` bug#44309: New and Improved Patch Marius Bakke
2020-11-11  9:26     ` [bug#44309] " Prafulla Giri

Reply instructions:

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

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

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to='CAFw+=j2OPcgYo=0qve4URhUtCkOM3oGSiZV2sLs0bU7pbsXWnw@mail.gmail.com' \
    --to=pratheblackdiamond@gmail.com \
    --cc=44309@debbugs.gnu.org \
    /path/to/YOUR_REPLY

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

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