help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to package GIMP Resynthesizer


From: Thorsten Wilms
Subject: Trying to package GIMP Resynthesizer
Date: Wed, 19 Sep 2018 14:25:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]