all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mypaint package
@ 2019-01-26  4:37 Yoshinori Arai
  2019-01-26 20:41 ` Maxim Cournoyer
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshinori Arai @ 2019-01-26  4:37 UTC (permalink / raw)
  To: help-guix

Hello,

I have made mypaint git version package. I have some question about guix
package development.

During develop the package, add gobject-introspection for propagated-inputs
to resolve the python module import error, which is
gi.require_version('GdkPixBuf','2.0').

But this case can't resolve it. Then remove gobject-introspection
package from propagated-inputs. I add librsvg, gdk-pixbuf+svg, gtk+,
hicolor-icon-theme for propagated-inputs finally.

After package build is successfully finished, I installed the package to test
then found some error as like gobject-instrospection. Then I remove installed
package and edit package file and build, install...

Q1. Why is gobject-introspection in my profile? I have not install it
individualy.

Q2. A hicolor-icon-theme is already installed in my profile. Is it need for
propageted-inputs of mypaint-git package?

mypaint-git package definition is as follows,

(define-module (mypaint)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system python)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages swig)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gimp)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages web)
  #:use-module (gnu packages python))

(define-public libmypaint-git
  (let ((commit "0c07191409bd257084d4ea7576deb832aac8868b")
        (revision "1"))
    (package
      (name "libmypaint-git")
      (version (git-version "2.0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/mypaint/libmypaint.git")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "0x5yacdj4bfm298ijv64igv06yjr401g6giln5wrdpv0pixg8ig3"))))
      (build-system gnu-build-system)
      (native-inputs
       `(("intltool" ,intltool)
         ("libtool" ,libtool)
         ("automake" ,automake)
         ("autoconf" ,autoconf)
         ("python-2" ,python-2)  ;need to generate headers in autogen.sh
         ("pkg-config" ,pkg-config)))
      ;; As needed by 'libmypaint.pc'.
      (propagated-inputs
       `(("json-c" ,json-c)
         ("gobject-introspection" ,gobject-introspection)))
      (inputs
       `(("glib" ,glib)))
      (home-page "http://mypaint.org/")
      (synopsis "The brush library")
      (description "This library used by MyPaint. A number of other painting programs use it too")
      (license license:isc))))

(define-public mypaint-brushes-git
  (let ((commit "769ec941054725a195e77d8c55080344e2ab77e4")
        (revision "1"))
    (package
      (name "mypaint-brushes-git")
      (version (git-version "2.0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/mypaint/mypaint-brushes.git")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "0viilmad809qg12xw11p1yv0lwbgjfkcv82g2avwzdaa6wy783pf"))))
      (build-system gnu-build-system)
      (native-inputs
       `(("autoconf" ,autoconf)
         ("automake" ,automake)))
      (home-page "http://mypaint.org/")
      (synopsis "Brushes for MyPaint")
      (description "Brushes used by MyPaint and other software using libmypaint")
      (license license:cc0))))

(define-public mypaint-git
  (let ((commit "57685af8dbd65719d7874bc501094bade85d94e7")
        (revision "1"))
    (package
      (name "mypaint-git")
      (version (git-version "2.0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/mypaint/mypaint.git")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "14dmnwma8gsfd5hv3cvwkzyd3v392h4g1zp7i38295cf39yf61y6"))))
      (build-system python-build-system)
      (arguments
       `(#:python ,python-2
         #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'fix-for-buildconfig-and-test
             (lambda _
               (for-each make-file-writable (find-files "." ".*"))
               ;; FATAL: Cannot create cache dir '/homeless-shelter
               (setenv "HOME" "/tmp")))
           (replace 'install
             (lambda _
               (invoke "python" "setup.py" "managed_install"
                       (string-append "--prefix=" (assoc-ref %outputs "out"))))))))
      (native-inputs
       `(("pkg-config" ,pkg-config)
         ("lcms" ,lcms)
         ("libmypaint" ,libmypaint-git)
         ("mypaint-brushes" ,mypaint-brushes-git)))
      (inputs
       `(("python2-pygobject" ,python2-pygobject)
         ("swig" ,swig)
         ("gettext" ,gettext-minimal)
         ("python2-numpy" ,python2-numpy)
         ("python2-pycairo" ,python2-pycairo)))
      (propagated-inputs
       `(("gtk+" ,gtk+)
         ("librsvg" ,librsvg)
         ("gdk-pixbuf" ,gdk-pixbuf+svg)
         ("hicolor-icon-theme" ,hicolor-icon-theme)))
      (home-page "http://mypaint.org/")
      (synopsis "A simple drawing and painting program")
      (description "MyPaint is a fast, free, and easy graphics app for digital painters. It lets you focus on the art you make instead of the program you make it with. You can work on your canvas without clutter, and show the interface only when you need it. MyPaint works best with a graphics tablet.")
      (license license:gpl2+))))

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

* Re: mypaint package
  2019-01-26  4:37 mypaint package Yoshinori Arai
@ 2019-01-26 20:41 ` Maxim Cournoyer
  0 siblings, 0 replies; 2+ messages in thread
From: Maxim Cournoyer @ 2019-01-26 20:41 UTC (permalink / raw)
  To: Yoshinori Arai; +Cc: help-guix

Hi,

Yoshinori Arai <kumagusu08@gmail.com> writes:

> Hello,
>
> I have made mypaint git version package. I have some question about guix
> package development.
>
> During develop the package, add gobject-introspection for propagated-inputs
> to resolve the python module import error, which is
> gi.require_version('GdkPixBuf','2.0').
>
> But this case can't resolve it. Then remove gobject-introspection
> package from propagated-inputs. I add librsvg, gdk-pixbuf+svg, gtk+,
> hicolor-icon-theme for propagated-inputs finally.
>
> After package build is successfully finished, I installed the package to test
> then found some error as like gobject-instrospection. Then I remove installed
> package and edit package file and build, install...
>
> Q1. Why is gobject-introspection in my profile? I have not install it
> individualy.

Because this is how propagated-inputs work: they are installed along the
package who pulled them in the profile.  For this reason, we usually
only use propagated-inputs as a last resort as they don't mesh
with the functional model well and can conflict together.

> Q2. A hicolor-icon-theme is already installed in my profile. Is it need for
> propageted-inputs of mypaint-git package?

The policy regarding icons in Guix has been to let the user choice the
icons of their choice; you don't need to include icons as a
propagated-input in your package definition.

Some comments about your package definitions follow.

> mypaint-git package definition is as follows,
>
> (define-module (mypaint)
>   #:use-module ((guix licenses) #:prefix license:)
>   #:use-module (guix utils)
>   #:use-module (guix packages)
>   #:use-module (guix git-download)
>   #:use-module (guix build-system gnu)
>   #:use-module (guix build-system python)
>   #:use-module (gnu packages pkg-config)
>   #:use-module (gnu packages autotools)
>   #:use-module (gnu packages gettext)
>   #:use-module (gnu packages glib)
>   #:use-module (gnu packages swig)
>   #:use-module (gnu packages gtk)
>   #:use-module (gnu packages python)
>   #:use-module (gnu packages python-xyz)
>   #:use-module (gnu packages ghostscript)
>   #:use-module (gnu packages gimp)
>   #:use-module (gnu packages gnome)
>   #:use-module (gnu packages web)
>   #:use-module (gnu packages python))
>
> (define-public libmypaint-git
>   (let ((commit "0c07191409bd257084d4ea7576deb832aac8868b")
>         (revision "1"))
>     (package
>       (name "libmypaint-git")
>       (version (git-version "2.0.0" revision commit))
>       (source (origin
>                 (method git-fetch)
>                 (uri (git-reference
>                       (url "https://github.com/mypaint/libmypaint.git")
>                       (commit commit)))
>                 (file-name (git-file-name name version))
>                 (sha256
>                  (base32
>                   "0x5yacdj4bfm298ijv64igv06yjr401g6giln5wrdpv0pixg8ig3"))))
>       (build-system gnu-build-system)
>       (native-inputs
>        `(("intltool" ,intltool)
>          ("libtool" ,libtool)
>          ("automake" ,automake)
>          ("autoconf" ,autoconf)
>          ("python-2" ,python-2)  ;need to generate headers in autogen.sh
>          ("pkg-config" ,pkg-config)))
>       ;; As needed by 'libmypaint.pc'.
>       (propagated-inputs
>        `(("json-c" ,json-c)
>          ("gobject-introspection" ,gobject-introspection)))
>       (inputs
>        `(("glib" ,glib)))
>       (home-page "http://mypaint.org/")
>       (synopsis "The brush library")
>       (description "This library used by MyPaint. A number of other painting programs use it too")
>       (license license:isc))))

You should make use of the glib-or-gtk-build-system here; it would take
care of the glib dependency for you by wrapping the binary in a build
phase.

You shouldn't need the automake and autoconf inputs as these
dependencies come with the gnu-build-system (whose steps are reused by
most other build systems).

> (define-public mypaint-brushes-git
>   (let ((commit "769ec941054725a195e77d8c55080344e2ab77e4")
>         (revision "1"))
>     (package
>       (name "mypaint-brushes-git")
>       (version (git-version "2.0.0" revision commit))
>       (source (origin
>                 (method git-fetch)
>                 (uri (git-reference
>                       (url "https://github.com/mypaint/mypaint-brushes.git")
>                       (commit commit)))
>                 (file-name (git-file-name name version))
>                 (sha256
>                  (base32
>                   "0viilmad809qg12xw11p1yv0lwbgjfkcv82g2avwzdaa6wy783pf"))))
>       (build-system gnu-build-system)
>       (native-inputs
>        `(("autoconf" ,autoconf)
>          ("automake" ,automake)))
>       (home-page "http://mypaint.org/")
>       (synopsis "Brushes for MyPaint")
>       (description "Brushes used by MyPaint and other software using libmypaint")
>       (license license:cc0))))

Same here (regarding the autoconf and automake native inputs).

> (define-public mypaint-git
>   (let ((commit "57685af8dbd65719d7874bc501094bade85d94e7")
>         (revision "1"))
>     (package
>       (name "mypaint-git")
>       (version (git-version "2.0.0" revision commit))
>       (source (origin
>                 (method git-fetch)
>                 (uri (git-reference
>                       (url "https://github.com/mypaint/mypaint.git")
>                       (commit commit)))
>                 (file-name (git-file-name name version))
>                 (sha256
>                  (base32
>                   "14dmnwma8gsfd5hv3cvwkzyd3v392h4g1zp7i38295cf39yf61y6"))))
>       (build-system python-build-system)
>       (arguments
>        `(#:python ,python-2
>          #:phases
>          (modify-phases %standard-phases
>            (add-after 'unpack 'fix-for-buildconfig-and-test
>              (lambda _
>                (for-each make-file-writable (find-files "." ".*"))
>                ;; FATAL: Cannot create cache dir '/homeless-shelter
>                (setenv "HOME" "/tmp")))
>            (replace 'install
>              (lambda _
>                (invoke "python" "setup.py" "managed_install"
>                        (string-append "--prefix=" (assoc-ref %outputs "out"))))))))
>       (native-inputs
>        `(("pkg-config" ,pkg-config)
>          ("lcms" ,lcms)
>          ("libmypaint" ,libmypaint-git)
>          ("mypaint-brushes" ,mypaint-brushes-git)))
>       (inputs
>        `(("python2-pygobject" ,python2-pygobject)
>          ("swig" ,swig)
>          ("gettext" ,gettext-minimal)
>          ("python2-numpy" ,python2-numpy)
>          ("python2-pycairo" ,python2-pycairo)))
>       (propagated-inputs
>        `(("gtk+" ,gtk+)
>          ("librsvg" ,librsvg)
>          ("gdk-pixbuf" ,gdk-pixbuf+svg)
>          ("hicolor-icon-theme" ,hicolor-icon-theme)))
>       (home-page "http://mypaint.org/")
>       (synopsis "A simple drawing and painting program")
>       (description "MyPaint is a fast, free, and easy graphics app for digital painters. It lets you focus on the art you make instead of the program you make it with. You can work on your canvas without clutter, and show the interface only when you need it. MyPaint works best with a graphics tablet.")
>       (license license:gpl2+))))

As discussed above, the color theme can be removed from the propagated
inputs. You should also the glib-or-gtk-build-system here; this should
allow you to remove the propagated gtk+ library.

Python dependencies are typically propagated. That means that
python2-pygobject, python-numpy and python-pycairo probably need to be
listed under `propagated-inputs' rather than `inputs'.

swig and gettext are typically build dependencies and should probably
listed as `native-inputs'.

The librsvg and gdk-pixbuf+svg might be required only at build time (if
they are used to compile the Python->C wrappers), so I'd try moving them
to native-inputs and see if it works.

Otherwise it looks pretty good! Make sure to run the `guix lint' on your
package definitions.

I hope this helps!

Maxim

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

end of thread, other threads:[~2019-01-26 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-26  4:37 mypaint package Yoshinori Arai
2019-01-26 20:41 ` Maxim Cournoyer

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.