guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 07/11] gnu: ncurses: support mingw.


From: Jan Nieuwenhuizen
Subject: Re: [PATCH 07/11] gnu: ncurses: support mingw.
Date: Wed, 10 Aug 2016 15:08:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Alex Kost writes:

Hi!

> Jan Nieuwenhuizen (2016-08-09 18:59 +0300) wrote:
>
>> Alex Kost writes:
>>
>>>> +                  (mingw-target? (lambda* (#:optional (target target))
>>>> +                                   (and target
>>>> +                                        (string-suffix? "-mingw32" 
>>>> target))))
>>>
>>> IIUC you don't use the same 'mingw-target?' procedure you added in an
>>> earlier patch, because it is placed in (guix utils), right?
>>
>> Yes, something like that: the function needs to be present at in the
>> builder, but I'm not sure how we can make that so.  I tried several
>> things but could not find a way to avoid this duplication.
>> mingw-target? is passed the TARGET from the post-install-phase.
>>
>>> I don't know if (guix build utils) would be a better place for it ,
>>
>> How would that work?  mingw-target? uses %current-build-system which is
>> defined in (guix utils).  I agree that it would be nice to remove this
>> duplication.
>
> I just had the same thought ("it would be nice to remove duplication"),
> but I see the problem you faced and I also don't know how to achieve
> the goal, so let's forget about this for now, it shouldn't prevent to
> merge this patchset, thanks!

Hmm...the patch removes the duplication, it also rebuilds everything of
course.  Would this be the way to do it, would we want to have this in
core-updates or is there a better way?

Is a mingw test important enough to have in and export from build utils?

Greetings, Jan

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm
index cf502f4..3af1700 100644
--- a/gnu/packages/ncurses.scm
+++ b/gnu/packages/ncurses.scm
@@ -71,15 +71,12 @@
         (post-install-phase
          `(lambda* (#:key outputs target #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
-                  (mingw-target? (lambda* (#:optional (target target))
-                                   (and target
-                                        (string-suffix? "-mingw32" target))))
                   (libraries '("curses" "ncurses" "form" "panel" "menu")))
               ;; When building a wide-character (Unicode) build, create 
backward
               ;; compatibility links from the the "normal" libraries to the
               ;; wide-character libraries (e.g. libncurses.so to 
libncursesw.so).
               (cond
-               ((mingw-target? target)
+               ((explicit-mingw-target? target)
                 (with-directory-excursion (string-append out "/bin")
                   (for-each
                    (lambda (lib)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 2988193..8b1c417 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -41,6 +41,7 @@
 
             directory-exists?
             executable-file?
+            explicit-mingw-target?
             symbolic-link?
             call-with-ascii-input-file
             elf-file?
@@ -140,6 +141,10 @@ introduce the version part."
     (and s
          (not (zero? (logand (stat:mode s) #o100))))))
 
+(define (explicit-mingw-target? target)
+  (and target
+       (string-suffix? "-mingw32" target)))
+
 (define (symbolic-link? file)
   "Return #t if FILE is a symbolic link (aka. \"symlink\".)"
   (eq? (stat:type (lstat file)) 'symlink))
diff --git a/guix/utils.scm b/guix/utils.scm
index e44504c..ebd9a0d 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -33,7 +33,7 @@
   #:use-module (rnrs io ports)
   #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!))
   #:use-module (guix combinators)
-  #:use-module ((guix build utils) #:select (dump-port))
+  #:use-module ((guix build utils) #:select (dump-port explicit-mingw-target?))
   #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync))
   #:use-module (ice-9 vlist)
   #:use-module (ice-9 format)
@@ -489,8 +489,7 @@ returned by `config.guess'."
   (make-parameter #f))
 
 (define* (mingw-target? #:optional (target (%current-target-system)))
-  (and target
-       (string-suffix? "-mingw32" target)))
+  (explicit-mingw-target? target))
 
 (define (package-name->name+version spec)
   "Given SPEC, a package name like \"address@hidden", return two values: 
\"foo\"
--8<---------------cut here---------------end--------------->8---


-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ®  http://AvatarAcademy.nl  



reply via email to

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