unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Thorsten Wilms <t_w_@freenet.de>
To: help-guix <help-guix@gnu.org>
Subject: Trying to package GIMP Resynthesizer
Date: Wed, 19 Sep 2018 14:25:23 +0200	[thread overview]
Message-ID: <3e52025a-2dde-3960-0bf9-984428dd320f@freenet.de> (raw)

Hi!

I'm trying to package https://github.com/bootchk/resynthesizer

Unfortunately, this happens:

---
$: guix build --keep-failed gimp-resynthesizer
checking that generated files are newer than configure... done
configure: creating ./config.status
./configure: line 9047: /bin/sh: No such file or directory
---

What I have so far:

---

(define-module (gimp-resynthesizer)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gimp))

;; GIMP does not respect any plugin search path environment variable, so 
after
;; installation users have to edit their GIMP settings to include
;; “$GUIX_PROFILE/lib/gimp/2.0/plug-ins” in
;; “Edit->Preferences->Folders->Plug Ins”.


(define-public gimp-resynthesizer
   (package
    (name "gimp-resynthesizer")
    (version "2.0.3")
    (source
     (origin
      (method url-fetch)
      (uri (string-append 
"https://github.com/bootchk/resynthesizer/archive/v"
			 version
			 ".tar.gz"))
      (sha256 (base32 
"0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("autoconf" ,autoconf-wrapper)
       ("automake" ,automake)
       ("glib" ,glib "bin") ; glib-gettextize
       ("intltool" ,intltool)
       ("pkg-config" ,pkg-config)))
    (inputs
     `(("gimp" ,gimp)
       ("gdk-pixbuf" ,gdk-pixbuf) ; needed by gimp-2.0.pc
       ("cairo" ,cairo)
       ("gegl" ,gegl)
       ("gtk+" ,gtk+-2) ; needed by gimpui-2.0.pc
       ("glib" ,glib)))
    (home-page "https://github.com/bootchk/resynthesizer")
    (synopsis "GIMP plugins for texture synthesis")
    (description
     "Resynthesizer plugins for GIMP. Encompasses tools for healing 
selections (content aware fill), enlarging the canvas and healing the 
border, increasing the resolution while adding detail and transfering 
the style of an image.")
    (license license:gpl3+)))

---

Since I hardly know what I'm doing, I have been bothering people in 
#guix and using gimp-fourier from gimp.scm as reference:

---

(define-public gimp-fourier
   (package
     (name "gimp-fourier")
     (version "0.4.3-2")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://registry.gimp.org/files/fourier-"
                                   version ".tar.gz"))
               (sha256
                (base32
                 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ;no tests
        #:phases
        (modify-phases %standard-phases
          ;; FIXME: The gegl package only installs "gegl-0.4.pc", but
          ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it.
          (replace 'configure
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "tmppkgconfig")
              (copy-file (string-append (assoc-ref inputs "gegl")
                                        "/lib/pkgconfig/gegl-0.4.pc")
                         "tmppkgconfig/gegl-0.3.pc")
              (setenv "PKG_CONFIG_PATH"
                      (string-append "tmppkgconfig:"
                                     (or (getenv "PKG_CONFIG_PATH") "")))
              #t))
          (add-after 'unpack 'set-prefix
            (lambda* (#:key outputs #:allow-other-keys)
              ;; gimptool-2.0 does not allow us to install to any target
              ;; directory.
              (let ((target (string-append (assoc-ref outputs "out")
                                           "/lib/gimp/"
                                           (car (string-split 
,(package-version gimp) #\.))
                                           ".0/plug-ins")))
                (substitute* "Makefile"
                  (("\\$\\(PLUGIN_INSTALL\\) fourier")
                   (string-append "cp fourier " target)))
                (mkdir-p target))
              #t)))))
     (inputs
      `(("fftw" ,fftw)
        ("gimp" ,gimp)
        ;; needed by gimp-2.0.pc
        ("gdk-pixbuf" ,gdk-pixbuf)
        ("gegl" ,gegl)
        ("cairo" ,cairo)
        ("glib" ,glib)
        ;; needed by gimpui-2.0.pc
        ("gtk+" ,gtk+-2)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (home-page "http://registry.gimp.org/node/19596")
     (synopsis "GIMP plug-in to edit image in fourier space")
     (description
      "This package provides a simple plug-in to apply the fourier 
transform on
an image, allowing you to work with the transformed image inside GIMP.  You
can draw or apply filters in fourier space and get the modified image 
with an
inverse fourier transform.")
     (license license:gpl3+)))

---

I suspect I will need the (add-after 'unpack 'set-prefix ...) form, too, 
but ... one step at a time and no cargo-culting :)

I've been told the patch-shebang phase should take care of references to 
/bin/sh, but didn't see that phase marked like the others 
(set-SOURCE-DATE-EPOCH, set-paths, install-locale, unpack, bootstrap). 
It does appear, though:
patch-shebang: configure: changing `/bin/sh' to 
`/gnu/store/rbrandv7anzjxqkr40d7fkanzssslk4b-bash-minimal-4.4.19/bin/sh'

Looking for the line where the error happens:
---
/tmp/guix-build-gimp-resynthesizer-2.0.3.drv-0/resynthesizer-2.0.3: sed 
-n -e 9047p configure
   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
---

configure includes these lines:
---
SHELL=${CONFIG_SHELL-/bin/sh}
SHELL = /bin/sh
SHELL=\${CONFIG_SHELL-$SHELL}
---

Is that already the problem and needs to be patched?

I tried

---
(arguments
     `(#:phases
       (modify-phases %standard-phases
	(add-after 'patch-shebang 'fix-sub-shells
	  (lambda _
             (substitute* "configure"
               (("/bin/sh") (which "sh")));
	    #t)))))
---

but that doesn't do ... anything, apparently.


-- 
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

             reply	other threads:[~2018-09-19 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 12:25 Thorsten Wilms [this message]
2018-09-20  2:55 ` Trying to package GIMP Resynthesizer Maxim Cournoyer
2018-09-20  9:25   ` Thorsten Wilms
2018-09-20 11:11     ` Ludovic Courtès
2018-09-20 13:43       ` Thorsten Wilms
2018-09-20 20:14         ` Thorsten Wilms
2018-09-21 11:19           ` Thorsten Wilms
2018-11-07 18:00             ` swedebugia

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=3e52025a-2dde-3960-0bf9-984428dd320f@freenet.de \
    --to=t_w_@freenet.de \
    --cc=help-guix@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.
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).