[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/96] gnu: ocaml: Use a helper function to download from ocaml-f
From: |
Julien Lepiller |
Subject: |
[PATCH 06/96] gnu: ocaml: Use a helper function to download from ocaml-forge. |
Date: |
Tue, 3 Jan 2017 20:10:47 +0100 |
* gnu/packages/ocaml.scm (ocaml-forge-origin): New procedure.
* gnu/packages/ocaml.scm (lablgtk): Use it.
---
gnu/packages/ocaml.scm | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 1554be217..6bb0e4826 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -50,6 +50,16 @@
#:use-module (gnu packages version-control)
#:use-module (gnu packages curl))
+;; A shortcut for files from ocaml forge. Downloaded files are computed from
+;; their number, not their name.
+(define (ocaml-forge-origin name version file-number hash)
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://forge.ocamlcore.org/frs/download.php/"
+ (number->string file-number) "/" name "-" version
+ ".tar.gz"))
+ (sha256 (base32 hash))))
+
(define-public ocaml
(package
(name "ocaml")
@@ -509,13 +519,8 @@ Knuthâs LR(1) parser construction technique.")
(name "lablgtk")
(version "2.18.5")
(source
- (origin
- (method url-fetch)
- (uri (string-append "https://forge.ocamlcore.org/frs/download.php/"
- "1627/lablgtk-2.18.5.tar.gz"))
- (sha256
- (base32
- "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib"))))
+ (ocaml-forge-origin name version 1627
+ "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib"))
(build-system gnu-build-system)
(native-inputs
`(("camlp4" ,camlp4)
--
2.11.0
- [PATCH 00/96] ocaml-build-system and packages, Julien Lepiller, 2017/01/03
- [PATCH 02/96] gnu: ocaml: Add CAML_LD_LIBRARY_PATH search-path, Julien Lepiller, 2017/01/03
- [PATCH 01/96] gnu: ocaml: Add a .file directive to generated .s files, Julien Lepiller, 2017/01/03
- [PATCH 03/96] gnu: camlp4: compile native, Julien Lepiller, 2017/01/03
- [PATCH 04/96] gnu: Add ocaml-build-system., Julien Lepiller, 2017/01/03
- [PATCH 05/96] gnu: ocaml: Use a prefix for license field., Julien Lepiller, 2017/01/03
- [PATCH 06/96] gnu: ocaml: Use a helper function to download from ocaml-forge.,
Julien Lepiller <=
- [PATCH 07/96] gnu: camlp4: Install camlp4 META file., Julien Lepiller, 2017/01/03
- [PATCH 08/96] gnu: Add ocaml-ounit., Julien Lepiller, 2017/01/03
- [PATCH 10/96] gnu: Add ocamlmod., Julien Lepiller, 2017/01/03