all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: base: Added macro for choosing glibc for target system
@ 2014-04-21 17:39 Manolis Ragkousis
  2014-04-22 11:58 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Manolis Ragkousis @ 2014-04-21 17:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

I spent some time to find out why the glibc macro patch couldn't work
and it seems it just had to be defined before other packages tried to
inherit glibc in base.scm. It seems to work now.

[-- Attachment #2: gnu_add_glibc_macro.patch --]
[-- Type: text/x-patch, Size: 1994 bytes --]

From 1f35b5a3d93811dadac33dbce1ff74a704760a21 Mon Sep 17 00:00:00 2001
From: phant0mas <manolis837@gmail.com>
Date: Mon, 21 Apr 2014 20:13:52 +0300
Subject: [PATCH] gnu: base: Added macro for choosing glibc for target system

* gnu/packages/base.scm (glibc/linux): Renamed glibc to glibc/linux
* gnu/packages/base.scm (glibc-for-target): Choose which glibc to use
* gnu/packages/base.scm (glibc): Added macro to choose glibc
---
 gnu/packages/base.scm | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index e6a2242..423c9c7 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,7 +42,8 @@
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
-  #:use-module (ice-9 match))
+  #:use-module (ice-9 match)
+  #:export (glibc))
 
 ;;; Commentary:
 ;;;
@@ -364,7 +366,7 @@ library for working with executable and object formats is also included.")
    (license gpl3+)
    (home-page "http://www.gnu.org/software/binutils/")))
 
-(define-public glibc
+(define-public glibc/linux
   (package
    (name "glibc")
    (version "2.19")
@@ -508,6 +510,16 @@ with the Linux kernel.")
    (license lgpl2.0+)
    (home-page "http://www.gnu.org/software/libc/")))
 
+(define (glibc-for-target target)
+  "Return the glibc for TARGET, glibc/linux for a linux host or
+glibc/hurd for a hurd host"
+  (match target
+    ("i686-pc-gnu" glibc/hurd)
+    (_ glibc/linux)))
+
+(define-syntax glibc
+  (identifier-syntax (glibc-for-target (or (%current-target-system) (%current-system)))))
+
 (define-public tzdata
   (package
     (name "tzdata")
-- 
1.9.2


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

end of thread, other threads:[~2014-04-22 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 17:39 [PATCH] gnu: base: Added macro for choosing glibc for target system Manolis Ragkousis
2014-04-22 11:58 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.