[Top][All Lists]

[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


I'm trying to package

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
   (name "gimp-resynthesizer")
   (version "2.0.3")
     (method url-fetch)
(uri (string-append "";
(sha256 (base32 "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))))
   (build-system gnu-build-system)
    `(("autoconf" ,autoconf-wrapper)
      ("automake" ,automake)
      ("glib" ,glib "bin") ; glib-gettextize
      ("intltool" ,intltool)
      ("pkg-config" ,pkg-config)))
    `(("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 "";)
   (synopsis "GIMP plugins for texture synthesis")
"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
    (name "gimp-fourier")
    (version "0.4.3-2")
    (source (origin
              (method url-fetch)
              (uri (string-append "";
                                  version ".tar.gz"))
    (build-system gnu-build-system)
     `(#:tests? #f ;no tests
       (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")
             (setenv "PKG_CONFIG_PATH"
                     (string-append "tmppkgconfig:"
                                    (or (getenv "PKG_CONFIG_PATH") "")))
         (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")
(car (string-split ,(package-version gimp) #\.))
               (substitute* "Makefile"
                 (("\\$\\(PLUGIN_INSTALL\\) fourier")
                  (string-append "cp fourier " target)))
               (mkdir-p target))
     `(("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)))
     `(("pkg-config" ,pkg-config)))
    (home-page "";)
    (synopsis "GIMP plug-in to edit image in fourier space")
"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 = /bin/sh

Is that already the problem and needs to be patched?

I tried

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

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

Thorsten Wilms

thorwil's design for free software:

reply via email to

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