From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: [PATCH 07/11] gnu: ncurses: support mingw. Date: Wed, 10 Aug 2016 15:08:49 +0200 Message-ID: <87k2fovkim.fsf@gnu.org> References: <20160809064139.27872-1-janneke@gnu.org> <20160809064139.27872-8-janneke@gnu.org> <87mvkmcr9k.fsf@gmail.com> <8737mevspt.fsf@gnu.org> <8737mcc34h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXTG0-00031a-LN for guix-devel@gnu.org; Wed, 10 Aug 2016 09:09:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXTFv-0001uf-AZ for guix-devel@gnu.org; Wed, 10 Aug 2016 09:09:15 -0400 In-Reply-To: <8737mcc34h.fsf@gmail.com> (Alex Kost's message of "Wed, 10 Aug 2016 13:47:10 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel@gnu.org 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" ta= rget)))) >>> >>> 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 ba= ckward ;; compatibility links from the the "normal" libraries to the ;; wide-character libraries (e.g. libncurses.so to libncurse= sw.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 @@ =20 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)))))) =20 +(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-targ= et?)) #: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)) =20 (define* (mingw-target? #:optional (target (%current-target-system))) - (and target - (string-suffix? "-mingw32" target))) + (explicit-mingw-target? target)) =20 (define (package-name->name+version spec) "Given SPEC, a package name like \"foo@0.9.1b\", return two values: \"fo= o\" --8<---------------cut here---------------end--------------->8--- --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20