all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add ntp
@ 2014-10-18 15:11 John Darrington
  2014-10-18 16:24 ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: John Darrington @ 2014-10-18 15:11 UTC (permalink / raw)
  To: guix-devel; +Cc: 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 0000000..be35208
--- /dev/null
+++ b/gnu/packages/ntp.scm
@@ -0,0 +1,47 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright 2014  John Darrington <jmd@gnu.org>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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

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

* Re: [PATCH] gnu: Add ntp
  2014-10-18 15:11 [PATCH] gnu: Add ntp John Darrington
@ 2014-10-18 16:24 ` Mark H Weaver
  2014-10-18 18:08   ` Ian Denhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Mark H Weaver @ 2014-10-18 16:24 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

John Darrington <jmd@gnu.org> 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

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

* Re: [PATCH] gnu: Add ntp
  2014-10-18 16:24 ` Mark H Weaver
@ 2014-10-18 18:08   ` Ian Denhardt
  2014-10-18 22:03     ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Denhardt @ 2014-10-18 18:08 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

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

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

<snip>

> 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

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABAgAGBQJUQqyNAAoJEPZUuMfUyjy43CYP/R1LPUDdtDIgojVEEooQ5AiM
rPb9wBO4Q/Rn6ct7eEydt777guixAEjPDIIBK/6NUncOQ56bY9sbrYeAkObV/+2v
NP/2RKyBs1C2clNBYUeV+WVx0i1kAtfWZOUe4l7OnKOKaLcZ2yh6GfZXkTd6Oz33
GFI2mj7RYvgHYjrRytXVMya0IM3q/hz3cGLTTVxipFtqno0blG9x+SySZVSVHW26
KXiiVkAxbreIeGmCPprKr2F16IeKfiZPP538wtR4CyVJkL+mtosL1UboEZi2Ehe5
l8oalk8H0HHKqQvMVzJBn1y32nxSBsowuZ1N+Ye6JjLFA6Ket68BZP1X4KKusx3r
iPzJnYz2g9g8Tr+1Qy9DseOZGEcmhhYrpZFFKlYtDvoXataPpBUJ671KWJUmnuAR
CjTosO/F7C1DuFrBpZz0jZ0tDY1JiqpRNZw+TRjiBWm2R/CTN39++KwEeavTNQ2l
jIUhSM133Ay15zdzgS4CGnPXbbbkL9ol5R2y+rtlM/VcTFlCuxu2nlrYl5JWuXzg
7JdQ/CooPkrgs7yZ71KBaPWEdTMv8k712WbjwA/8qOuwScAJYvBUUhShyCyVUE6b
KLHcoXqkeEBxhTZE6kununmKe/p67bvsfKt2XjagHP1xiq0JbyOWOzUy6ty1TNBC
rGotZ4lAGBUodv43MGfo
=DMux
-----END PGP SIGNATURE-----

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

* Re: [PATCH] gnu: Add ntp
  2014-10-18 18:08   ` Ian Denhardt
@ 2014-10-18 22:03     ` Mark H Weaver
  0 siblings, 0 replies; 4+ messages in thread
From: Mark H Weaver @ 2014-10-18 22:03 UTC (permalink / raw)
  To: Ian Denhardt; +Cc: guix-devel

Ian Denhardt <ian@zenhack.net> writes:

> Quoting Mark H Weaver (2014-10-18 12:24:56)
>>   (string-join (take (string-split version #\.) 2)
>>                ".")
>
> <snip>
>
>> 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

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

end of thread, other threads:[~2014-10-18 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-18 15:11 [PATCH] gnu: Add ntp John Darrington
2014-10-18 16:24 ` Mark H Weaver
2014-10-18 18:08   ` Ian Denhardt
2014-10-18 22:03     ` Mark H Weaver

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.