Re: "move-phase-after"?
Am 07.09.2016 um 14:20 schrieb Ludovic Courtès: > Yeah, that’s what I would do. I don’t think we need to extend > ‘modify-phases’ just for this. Okay. So I'll hack it into the build instructions. -- Regards Hartmut Goebel | Hartmut Goebel | h.goe...@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |
Re: "move-phase-after"?
Hello, Danny Milosavljevic <dan...@scratchpost.org> skribis: > On Tue, 6 Sep 2016 10:03:34 +0200 > Hartmut Goebel <h.goe...@crazy-compilers.com> wrote: > >> for some package I need to switch the install and check phase. Could >> please someone point me to a function like "move-phase-after"? Thanks. > > I don't think this exists yet. > > See the ./guix/build/utils.scm for the macro definition. > > You would have to do something like > > (let ((check (assoc-ref %standard-phases 'check))) > (modify-phases %standard-phases > (delete 'check) > (add-after 'install 'check > check))) Yeah, that’s what I would do. I don’t think we need to extend ‘modify-phases’ just for this. Ludo’.
Re: "move-phase-after"?
On Tue, Sep 06, 2016 at 10:03:34AM +0200, Hartmut Goebel wrote: > Hi, > > for some package I need to switch the install and check phase. Could > please someone point me to a function like "move-phase-after"? Thanks. > Check out python-cysignals in python.scm for mixing build systems. I know I've seen something else for moving 'check after 'install. -- Efraim Flashner <efr...@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted signature.asc Description: PGP signature
Re: "move-phase-after"?
Maybe something like this (has NOT been tested): diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 2988193..c2cf25d 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -517,6 +517,7 @@ following forms: (replace ) (add-before ) (add-after ) + (move-after ) Where every <*-phase-name> is an automatically quoted symbol, and an expression evaluating to a procedure." @@ -526,7 +527,7 @@ an expression evaluating to a procedure." phases*)) (define-syntax %modify-phases - (syntax-rules (delete replace add-before add-after) + (syntax-rules (delete replace add-before add-after move-after) ((_ phases (delete old-phase-name)) (alist-delete old-phase-name phases)) ((_ phases (replace old-phase-name new-phase)) @@ -534,7 +535,11 @@ an expression evaluating to a procedure." ((_ phases (add-before old-phase-name new-phase-name new-phase)) (alist-cons-before old-phase-name new-phase-name new-phase phases)) ((_ phases (add-after old-phase-name new-phase-name new-phase)) - (alist-cons-after old-phase-name new-phase-name new-phase phases + (alist-cons-after old-phase-name new-phase-name new-phase phases)) +((_ phases (move-after a-phase-name source-phase-name)) + (let ((source-phase (assoc-ref phases source-phase-name))) + (alist-cons-after a-phase-name source-phase-name source-phase + (alist-delete source-phase-name phases)) ^L ;;; I'm still not sure whether we should make something like this easy - it sounds hacky to move phases like this.
Re: "move-phase-after"?
Hi, On Tue, 6 Sep 2016 10:03:34 +0200 Hartmut Goebel <h.goe...@crazy-compilers.com> wrote: > for some package I need to switch the install and check phase. Could > please someone point me to a function like "move-phase-after"? Thanks. I don't think this exists yet. See the ./guix/build/utils.scm for the macro definition. You would have to do something like (let ((check (assoc-ref %standard-phases 'check))) (modify-phases %standard-phases (delete 'check) (add-after 'install 'check check))) I think it would be possible to add such a thing to the macro. You can see what the macro expands to by using (tree-il->scheme (macroexpand ...)). See https://www.gnu.org/software/guile/docs/master/guile.html/Macro-Expansion.html It's expanding to something like this: (alist-replace 'a FN (alist-cons-after 'b FN (alist-cons-after 'c FN (alist-delete 'd %standard-phases Each of the alist-* results in a new list.
"move-phase-after"?
Hi, for some package I need to switch the install and check phase. Could please someone point me to a function like "move-phase-after"? Thanks. -- Regards Hartmut Goebel | Hartmut Goebel | h.goe...@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |