Add OPA to Nixpkgs.
svn path=/nixpkgs/trunk/; revision=30578
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# Specifications for the "cryptokit" library:
|
||||
requires = ""
|
||||
description = "A library of cryptographic primitives for OCaml"
|
||||
version = "1.3"
|
||||
directory = "^"
|
||||
|
||||
archive(byte) = "cryptokit.cma"
|
||||
archive(native) = "cryptokit.cmxa"
|
||||
@@ -1,40 +1,24 @@
|
||||
{stdenv, fetchurl, zlib, ocaml}:
|
||||
{stdenv, fetchurl, zlib, ocaml, findlib, ncurses}:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
version = "1.3";
|
||||
version = "1.5";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "cryptokit-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://forge.ocamlcore.org/frs/download.php/326/" +
|
||||
url = "http://forge.ocamlcore.org/frs/download.php/639/" +
|
||||
"cryptokit-${version}.tar.gz";
|
||||
sha256 = "0kqrlxkpzrj2qpniy6mhn7gx3n29s86vk4q0im2hqpxi9knkkwwy";
|
||||
sha256 = "1r5kbsbsicrbpdrdim7h8xg2b1a8qg8sxig9q6cywzm57r33lj72";
|
||||
};
|
||||
|
||||
buildInputs = [zlib ocaml];
|
||||
buildInputs = [zlib ocaml findlib ncurses];
|
||||
|
||||
patches = [ ./makefile.patch ];
|
||||
buildFlags = "setup.data build";
|
||||
|
||||
configurePhase = ''
|
||||
export INSTALLDIR="$out/lib/ocaml/${ocaml_version}/site-lib/cryptokit"
|
||||
substituteInPlace Makefile \
|
||||
--subst-var-by ZLIB_LIBDIR "${zlib}/lib" \
|
||||
--subst-var-by ZLIB_INCLUDE "${zlib}/include" \
|
||||
--subst-var INSTALLDIR
|
||||
'';
|
||||
|
||||
buildFlags = "all allopt";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkTarget = "test";
|
||||
|
||||
preInstall = "ensureDir $INSTALLDIR";
|
||||
|
||||
postInstall = "cp -a ${./META} $INSTALLDIR/META";
|
||||
preBuild = "ensureDir $out/lib/ocaml/${ocaml_version}/site-lib/cryptokit";
|
||||
|
||||
meta = {
|
||||
homepage = "http://pauillac.inria.fr/~xleroy/software.html";
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
diff -Nuar cryptokit-1.3/Makefile cryptokit-1.3.nixos/Makefile
|
||||
--- cryptokit-1.3/Makefile 2005-04-20 15:19:54.000000000 +0200
|
||||
+++ cryptokit-1.3.nixos/Makefile 2010-08-17 15:22:07.000000000 +0200
|
||||
@@ -9,14 +9,13 @@
|
||||
|
||||
# The directory containing the Zlib library (libz.a or libz.so)
|
||||
# Leave blank if you don't have Zlib.
|
||||
-ZLIB_LIBDIR=/usr/lib
|
||||
-#ZLIB_LIBDIR=/usr/lib64 # for x86-64 Linux
|
||||
+ZLIB_LIBDIR=@ZLIB_LIBDIR@
|
||||
|
||||
# The directory containing the Zlib header file (zlib.h)
|
||||
-ZLIB_INCLUDE=/usr/include
|
||||
+ZLIB_INCLUDE=@ZLIB_INCLUDE@
|
||||
|
||||
# Where to install the library. By default: OCaml's standard library directory.
|
||||
-INSTALLDIR=`$(OCAMLC) -where`
|
||||
+INSTALLDIR=@INSTALLDIR@
|
||||
|
||||
# Flags for the C compiler.
|
||||
CFLAGS=-O -I$(ZLIB_INCLUDE) $(ZLIB)
|
||||
40
pkgs/development/ocaml-modules/ocamlgraph/default.nix
Normal file
40
pkgs/development/ocaml-modules/ocamlgraph/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{stdenv, fetchurl, ocaml, findlib }:
|
||||
|
||||
let
|
||||
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
||||
version = "1.8.1";
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "ocamlgraph-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://ocamlgraph.lri.fr/download/ocamlgraph-${version}.tar.gz";
|
||||
sha256 = "0hrba69wvw9b42irkvjf6q7zzw12v5nyyc33yaq3jlf1qbzqhqxs";
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib ];
|
||||
|
||||
patches = ./destdir.patch;
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's@$(DESTDIR)$(OCAMLLIB)/ocamlgraph@$(DESTDIR)/lib/ocaml/${ocaml_version}/site-lib/ocamlgraph@' Makefile.in
|
||||
'';
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
buildPhase = ''
|
||||
make all
|
||||
make install-findlib
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://ocamlgraph.lri.fr/;
|
||||
description = "ocamlgraph is a graph library for Objective Caml.";
|
||||
license = "GNU Library General Public License version 2, with the special exception on linking described in file LICENSE";
|
||||
platforms = ocaml.meta.platforms;
|
||||
maintainers = [
|
||||
stdenv.lib.maintainers.kkallio
|
||||
];
|
||||
};
|
||||
}
|
||||
13
pkgs/development/ocaml-modules/ocamlgraph/destdir.patch
Normal file
13
pkgs/development/ocaml-modules/ocamlgraph/destdir.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff -Naur -x '*~' ocamlgraph-1.8.1/Makefile.in ocamlgraph-1.8.1-new//Makefile.in
|
||||
--- ocamlgraph-1.8.1/Makefile.in 2011-10-17 09:57:03.000000000 -0430
|
||||
+++ ocamlgraph-1.8.1-new//Makefile.in 2011-11-24 13:01:22.626004819 -0430
|
||||
@@ -16,8 +16,8 @@
|
||||
##########################################################################
|
||||
|
||||
# Where to install the binaries
|
||||
-DESTDIR =
|
||||
prefix =@prefix@
|
||||
+DESTDIR=$(prefix)
|
||||
exec_prefix=@exec_prefix@
|
||||
datarootdir=@datarootdir@
|
||||
BINDIR =$(DESTDIR)@bindir@
|
||||
@@ -15,6 +15,8 @@ stdenv.mkDerivation {
|
||||
sha256 = "0fjlkwps14adfgxdrbb4yg65fhyimplvjjs1xqj5np197cig67x0";
|
||||
};
|
||||
|
||||
createFindlibDestdir = true;
|
||||
|
||||
buildInputs = [ocaml findlib];
|
||||
|
||||
buildFlags = "all all.opt";
|
||||
|
||||
Reference in New Issue
Block a user