unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Removing configure flags?
@ 2018-09-10  9:27 HiPhish
  2018-09-10  9:57 ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: HiPhish @ 2018-09-10  9:27 UTC (permalink / raw)
  To: guix-devel

Hello everyone,

There is this shell scripting test framework called Roundup which I would like 
to package for Guix:
https://github.com/bmizerany/roundup
http://bmizerany.github.io/roundup/

It looks like the author has written his own configure script rather than 
using autotools to generate it, and it chokes on the default configure flags 
provided by Guix:
https://github.com/bmizerany/roundup/blob/master/configure

The culprits are the `--enable-fast-install` flag and the `--build` option. 
There is no need for either of those since it's all just shell scripts anyway, 
so is there a way to remove them? I know I can add flags, but I haven't found 
anything in the manual about removing some of the default flags.

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

* Re: Removing configure flags?
  2018-09-10  9:27 Removing configure flags? HiPhish
@ 2018-09-10  9:57 ` Danny Milosavljevic
  2018-09-11  0:04   ` Alex Vong
  0 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2018-09-10  9:57 UTC (permalink / raw)
  To: HiPhish; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

Hi,

you can replace the entire "configure" phase.

Search for "replace 'configure" in gnu/packages/*.scm .

You can find the entire block when you search for "--enable-fast-install" comments in gnu/packages/*.scm .

It is:

  (arguments
   `(#:phases
       (modify-phases %standard-phases
         (replace 'configure
           (lambda* (#:key inputs outputs (configure-flags '()) #:allow-other-keys)
             (apply invoke
                    `("./configure"
                      ,(string-append "--prefix=" out)
                      ,(string-append "--sysconfdir=/etc")
                      ,@configure-flags))))))

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Removing configure flags?
  2018-09-10  9:57 ` Danny Milosavljevic
@ 2018-09-11  0:04   ` Alex Vong
  2018-09-11 10:59     ` HiPhish
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Vong @ 2018-09-11  0:04 UTC (permalink / raw)
  To: HiPhish; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

Danny Milosavljevic <dannym@scratchpost.org> writes:

> Hi,
>
> you can replace the entire "configure" phase.
>
> Search for "replace 'configure" in gnu/packages/*.scm .
>
> You can find the entire block when you search for "--enable-fast-install" comments in gnu/packages/*.scm .
>
You can look at 'zlib' in 'compression.scm' for example.

> It is:
>
>   (arguments
>    `(#:phases
>        (modify-phases %standard-phases
>          (replace 'configure
>            (lambda* (#:key inputs outputs (configure-flags '()) #:allow-other-keys)
>              (apply invoke
>                     `("./configure"
>                       ,(string-append "--prefix=" out)
>                       ,(string-append "--sysconfdir=/etc")
>                       ,@configure-flags))))))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

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

* Re: Removing configure flags?
  2018-09-11  0:04   ` Alex Vong
@ 2018-09-11 10:59     ` HiPhish
  2018-09-12 17:17       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: HiPhish @ 2018-09-11 10:59 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel

Thanks to both of you I can now at least get the configure script to run, but 
it stops because it cannot find `cat`:

starting phase `configure'
building for Linux on localhost at Tue Sep 11 10:46:19 UTC 2018
looking for /bin/sh./configure: line 89: expr: command not found
 (nope)
looking for bash./configure: line 89: expr: command not found
./configure: line 89: expr: command not found
./configure: line 89: expr: command not found
 (nope)
looking for dash./configure: line 89: expr: command not found
./configure: line 89: expr: command not found
./configure: line 89: expr: command not found
 (nope)
looking for xdg-open./configure: line 89: expr: command not found
 (nope)
looking for firefox./configure: line 89: expr: command not found
 (nope)
looking for git./configure: line 89: expr: command not found
 (nope)
looking for ronn./configure: line 89: expr: command not found
./configure: line 89: expr: command not found
 (nope)
looking for shocco./configure: line 89: expr: command not found
 (nope)
warn: ronn is not installed. cannot rebuild manpages. no biggie.
warn: shocco is not installed. cannot rebuild manpages. no biggie.
okay, looks like you have everything we need. generating config files.
writing config.mk...
./configure: line 210: cat: command not found
Backtrace:
           4 (primitive-load "/gnu/store/1ilwn4mr3nb7pi6n0w4a6nkavdf…")
In ice-9/eval.scm:
   191:35  3 (_ #f)
In srfi/srfi-1.scm:
    640:9  2 (for-each #<procedure 958500 at /gnu/store/f95ghy8mx00…> …)
In /gnu/store/f95ghy8mx00fc22nrvswvnpqlfdkf2nk-module-import/guix/build/gnu-
build-system.scm:
   799:31  1 (_ _)
In /gnu/store/f95ghy8mx00fc22nrvswvnpqlfdkf2nk-module-import/guix/build/
utils.scm:
    616:6  0 (invoke _ . _)

Here is my package definition (irrelevant parts omitted):

(package
  (name "roundup")
  (build-system gnu-build-system)
  (arguments
    `(#:phases
      (modify-phases %standard-phases
        (replace 'configure
          (lambda* (#:key inputs outputs (configure-flags '()) #:allow-other-
keys)
            (let ((out (assoc-ref outputs "out")))
              (apply invoke
                `("./configure"
                  ,(string-append "--prefix=" out)
                  ,(string-append "--sysconfdir=/etc")
                  ,@configure-flags)))))))))

From my understanding, `cat` is part of coreutils, which is already an 
implicit input of the GNU build system. So the configure script should have 
it, shouldn't it?

On a related tangent: it looks like a phase is just a function which takes 
arbitrary keyword-arguments, right? Is this documented somewhere or is it 
"read the source code"? And what exactly are `outputs` and `inputs`? It looks 
like they are association lists where the keys are names and the values are 
directories.

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

* Re: Removing configure flags?
  2018-09-11 10:59     ` HiPhish
@ 2018-09-12 17:17       ` Ludovic Courtès
  2018-09-12 17:54         ` HiPhish
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-09-12 17:17 UTC (permalink / raw)
  To: HiPhish; +Cc: guix-devel

Hello,

HiPhish <hiphish@posteo.de> skribis:

> Thanks to both of you I can now at least get the configure script to run, but 
> it stops because it cannot find `cat`:
>
> starting phase `configure'
> building for Linux on localhost at Tue Sep 11 10:46:19 UTC 2018
> looking for /bin/sh./configure: line 89: expr: command not found
>  (nope)
> looking for bash./configure: line 89: expr: command not found
> ./configure: line 89: expr: command not found
> ./configure: line 89: expr: command not found

[...]

> From my understanding, `cat` is part of coreutils, which is already an 
> implicit input of the GNU build system. So the configure script should have 
> it, shouldn't it?

Indeed.  Could it be that ‘configure’ overrides PATH, setting it to,
say, /bin:/usr/bin?  (You mentioned ‘getconf PATH’ yesterday on IRC,
perhaps that’s related?)

HTH,
Ludo’.

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

* Re: Removing configure flags?
  2018-09-12 17:17       ` Ludovic Courtès
@ 2018-09-12 17:54         ` HiPhish
  0 siblings, 0 replies; 6+ messages in thread
From: HiPhish @ 2018-09-12 17:54 UTC (permalink / raw)
  To: guix-devel

I figured it out thanks to the people on IRC:

    (arguments
      `(;; Roundup has no check target (It does have a `test` target, but some
        ;; of its tests fail intentionally, bringing the entire build process
        ;; down)
        #:tests? #f
        ;; Explicitly set the shell because otherwise this value will be empty
        #:make-flags
        '("SHELL=bash")
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'fix-configure
            ;; getconf will return a static path, which will not contain the
            ;; value adjusted by Guix
            (λ _ (substitute* "configure" (("getconf PATH") "echo $PATH"))))
          (replace 'configure
            ;; Roundup is using a hand-written configure script which will 
choke
            ;; on the default configure flags. Therefore we invoke it with our
            ;; own flags.
            (lambda* (#:key outputs (configure-flags '()) #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (apply invoke
                  `("./configure"
                    ,(string-append "--prefix=" out)
                     "--sysconfdir=/etc"
                    ,@configure-flags))))))))


Ludovic Courtès wrote:
> Indeed.  Could it be that ‘configure’ overrides PATH, setting it to,
> say, /bin:/usr/bin?  (You mentioned ‘getconf PATH’ yesterday on IRC,
> perhaps that’s related?)
> 
> HTH,
> Ludo’.

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

end of thread, other threads:[~2018-09-12 17:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-10  9:27 Removing configure flags? HiPhish
2018-09-10  9:57 ` Danny Milosavljevic
2018-09-11  0:04   ` Alex Vong
2018-09-11 10:59     ` HiPhish
2018-09-12 17:17       ` Ludovic Courtès
2018-09-12 17:54         ` HiPhish

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).