[PATCH] gnu: Add ntp

2014-10-18 Thread John Darrington
* gnu/packages/ntp.scm: New file.
* gnu-system.am (gnu/packages/ntp.scm): Add it.
---
 gnu-system.am|1 +
 gnu/packages/ntp.scm |   47 +++
 2 files changed, 48 insertions(+)
 create mode 100644 gnu/packages/ntp.scm

diff --git a/gnu-system.am b/gnu-system.am
index 52c8343..c808c16 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -182,6 +182,7 @@ GNU_SYSTEM_MODULES =\
   gnu/packages/nettle.scm  \
   gnu/packages/node.scm\
   gnu/packages/noweb.scm   \
+  gnu/packages/ntp.scm \
   gnu/packages/nvi.scm \
   gnu/packages/ocaml.scm   \
   gnu/packages/ocrad.scm   \
diff --git a/gnu/packages/ntp.scm b/gnu/packages/ntp.scm
new file mode 100644
index 000..be35208
--- /dev/null
+++ b/gnu/packages/ntp.scm
@@ -0,0 +1,47 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright 2014  John Darrington 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages ntp)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages which)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu))
+
+(define-public ntp
+  (package
+   (name "ntp")
+   (version "4.2.6p5")
+   (source (origin
+   (method url-fetch)
+   (uri (string-append 
"http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-";
+(string-take version 3) "/ntp-" 
+version ".tar.gz"))
+   (sha256
+(base32
+ "077r69a41hasl8zf5c44km7cqgfhrkaj6a4jnr75j7nkz5qq7ayn"
+   (native-inputs `(("which" ,which)))
+   (build-system gnu-build-system)
+   (synopsis "Real time clock synchonization system")
+   (description "NTP is a system designed to synchronize the clocks of
+computers over a network.")
+   (license (x11-style 
+ "http://www.eecis.udel.edu/~mills/ntp/html/copyright.html";
+ "A non-copyleft free licence from the University of Delaware"))
+   (home-page "http://www.ntp.org";)))
-- 
1.7.10.4




Re: [PATCH] gnu: Add ntp

2014-10-18 Thread Mark H Weaver
John Darrington  writes:

> +(define-public ntp
> +  (package
> +   (name "ntp")
> +   (version "4.2.6p5")
> +   (source (origin
> + (method url-fetch)
> + (uri (string-append 
> "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-";
> +(string-take version 3) "/ntp-" 

Instead of 'string-take', please import (srfi srfi-1) and then do this:

  (string-join (take (string-split version #\.) 2)
   ".")

We use this pattern in a number of other places -- search for
"string-join" in gnu/packages/*.scm to find them.  I suppose we should
add a procedure specifically for this, but it can wait, and it should be
in a separate commit anyway.

> +version ".tar.gz"))
> + (sha256
> +  (base32
> +   "077r69a41hasl8zf5c44km7cqgfhrkaj6a4jnr75j7nkz5qq7ayn"
> +   (native-inputs `(("which" ,which)))
> +   (build-system gnu-build-system)
> +   (synopsis "Real time clock synchonization system")
> +   (description "NTP is a system designed to synchronize the clocks of
> +computers over a network.")
> +   (license (x11-style 
> + "http://www.eecis.udel.edu/~mills/ntp/html/copyright.html";
> + "A non-copyleft free licence from the University of Delaware"))
> +   (home-page "http://www.ntp.org";)))

Okay to commit with the change above.

Thanks!
  Mark



Re: [PATCH] gnu: Add ntp

2014-10-18 Thread Ian Denhardt
Quoting Mark H Weaver (2014-10-18 12:24:56)
>   (string-join (take (string-split version #\.) 2)
>".")



> I suppose we should add a procedure specifically for this, but
> it can wait, and it should be in a separate commit anyway.

I'm going to grab this and try to have a patch submitted today or
tomorrow. Does guix/utils.scm seem like a sensible place to put this?

-Ian


signature.asc
Description: signature


Re: [PATCH] gnu: Add ntp

2014-10-18 Thread Mark H Weaver
Ian Denhardt  writes:

> Quoting Mark H Weaver (2014-10-18 12:24:56)
>>   (string-join (take (string-split version #\.) 2)
>>".")
>
> 
>
>> I suppose we should add a procedure specifically for this, but
>> it can wait, and it should be in a separate commit anyway.
>
> I'm going to grab this and try to have a patch submitted today or
> tomorrow.

Sounds good!

> Does guix/utils.scm seem like a sensible place to put this?

Yes, it fits in well with 'version-compare' and 'version>?'.

Thanks,
  Mark



[PATCH 0/1] *** SUBJECT HERE ***

2014-10-18 Thread Ian Denhardt
Prompted by Mark Weaver's feedback on the ntp package patch earlier today, I
refactored the pattern:

(string-join (take (string-split version #\.) 2)
 ".")

Into a common procedure:

(version-take-api version)

..and modified the existing package recepies accordingly.

Ian Denhardt (1):
  Factor out a common pattern into a procedure.

 gnu/packages/backup.scm |  7 ---
 gnu/packages/cmake.scm  | 11 +--
 gnu/packages/gnome.scm  | 10 +-
 gnu/packages/gnutls.scm |  8 
 gnu/packages/mail.scm   |  9 -
 gnu/packages/mpd.scm|  6 +++---
 gnu/packages/mpi.scm|  8 
 guix/utils.scm  |  7 +++
 8 files changed, 36 insertions(+), 30 deletions(-)

-- 
1.9.1




[PATCH 1/1] Factor out a common pattern into a procedure.

2014-10-18 Thread Ian Denhardt
The procedure version-take-api extracts the "major.minor" part of
version strings; previously this was handled by an expression common to
several packages.

* guix/utils.scm (version-take-api): New procedure
* gnu/packages/backup.scm (duplicity): Use version-take-api.
* gnu/packages/cmake.scm (cmake): Likewise.
* gnu/packages/gnome.scm (libbonobo, libbonoboui): Likewise.
* gnu/packages/gnutls.scm (gnutls): Likewise.
* gnu/packages/mail.scm (gmime): Likewise.
* gnu/packages/mpd.scm (mpd): Likewise.
* gnu/packages/mpi.scm (openmpi): Likewise.
---
 gnu/packages/backup.scm |  7 ---
 gnu/packages/cmake.scm  | 11 +--
 gnu/packages/gnome.scm  | 10 +-
 gnu/packages/gnutls.scm |  8 
 gnu/packages/mail.scm   |  9 -
 gnu/packages/mpd.scm|  6 +++---
 gnu/packages/mpi.scm|  8 
 guix/utils.scm  |  7 +++
 8 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 1aef75e..328d3d8 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Eric Bavier 
+;;; Copyright © 2014 Ian Denhardt 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
   #:use-module (guix packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
@@ -38,8 +40,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages rsync)
   #:use-module (gnu packages ssh)
-  #:use-module (gnu packages xml)
-  #:use-module (srfi srfi-1))
+  #:use-module (gnu packages xml))
 
 (define-public duplicity
   (package
@@ -49,7 +50,7 @@
  (origin
   (method url-fetch)
   (uri (string-append "https://code.launchpad.net/duplicity/";
-  (string-join (take (string-split version #\.) 2) ".")
+  (version-take-api version)
   "-series/" version "/+download/duplicity-"
   version ".tar.gz"))
   (sha256
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 2c20c73..5b4f123 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013 Cyril Roelandt 
 ;;; Copyright © 2014 Mark H Weaver 
 ;;; Copyright © 2014 Eric Bavier 
+;;; Copyright © 2014 Ian Denhardt 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,14 +23,14 @@
   #:use-module ((guix licenses) #:select (bsd-3))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages file)
-  #:use-module (gnu packages xml)
-  #:use-module (srfi srfi-1))
+  #:use-module (gnu packages xml))
 
 (define-public cmake
   (package
@@ -39,8 +40,7 @@
  (method url-fetch)
  (uri (string-append
"http://www.cmake.org/files/v";
-   (string-join (take (string-split version #\.) 2)
-".")
+   (version-take-api version)
"/cmake-" version ".tar.gz"))
  (sha256
   (base32 "11q21vyrr6c6smyjy81k2k07zmn96ggjia9im9cxwvj0n88bm1fq"))
@@ -91,8 +91,7 @@
"--mandir=share/man"
,(string-append
  "--docdir=share/doc/cmake-"
- (string-join (take (string-split version #\.) 
2)
-  "."))
+ (version-take-api version))
%standard-phases)
 (inputs
  `(("file"   ,file)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index bbb3053..f0f1969 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge 
 ;;; Copyright © 2014 Ludovic Courtès 
+;;; Copyright © 2014 Ian Denhardt 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages bison)
@@ -42,8 +44,7 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages compression)
-  #:use-module (gnu packages xorg)
-  #:use-module (srfi srfi-1))
+  #:use-module (gnu packages xorg))
 
 (define-public brasero
   (package
@@ -706,8 +707,7 @@ featuring mature C, C++ and Python binding

Re: [PATCH 0/1] *** SUBJECT HERE ***

2014-10-18 Thread Ian Denhardt
Quoting Ian Denhardt (2014-10-18 22:18:00)
> ...

Ack, sorry for the goof on the subject.


signature.asc
Description: signature