* Fix installation of camlzip

svn path=/nixpkgs/trunk/; revision=25071

+43 -27
+1 -2
pkgs/development/ocaml-modules/camlzip/META
··· 1 - name="camlzip" 2 - version="1.04" 1 + version="@VERSION@" 3 2 description="reading and writing ZIP, JAR and GZIP files" 4 3 requires="unix" 5 4 archive(byte)="camlzip.cma"
+6 -11
pkgs/development/ocaml-modules/camlzip/default.nix
··· 1 - {stdenv, fetchurl, zlib, ocaml}: 1 + {stdenv, fetchurl, zlib, ocaml, findlib}: 2 2 3 3 let 4 4 ocaml_version = (builtins.parseDrvName ocaml.name).version; ··· 14 14 sha256 = "1zpchmp199x7f4mzmapvfywgy7f6wy9yynd9nd8yh8l78s5gixbn"; 15 15 }; 16 16 17 - buildInputs = [zlib ocaml]; 17 + buildInputs = [zlib ocaml findlib]; 18 18 19 19 patches = [ ./makefile.patch ]; 20 20 21 - configurePhase = '' 22 - export INSTALLDIR="$out/lib/ocaml/${ocaml_version}/site-lib/zip" 21 + postPatch = '' 22 + substitute ${./META} META --subst-var-by VERSION "${version}" 23 23 substituteInPlace Makefile \ 24 24 --subst-var-by ZLIB_LIBDIR "${zlib}/lib" \ 25 - --subst-var-by ZLIB_INCLUDE "${zlib}/include" \ 26 - --subst-var INSTALLDIR 25 + --subst-var-by ZLIB_INCLUDE "${zlib}/include" 27 26 ''; 28 27 29 28 buildFlags = "all allopt"; 30 29 31 - installTargets = "install installopt"; 32 - 33 - postInstall = '' 34 - substitute ${./META} $INSTALLDIR/META --subst-var INSTALLDIR 35 - ''; 30 + installTargets = "install"; 36 31 37 32 meta = { 38 33 homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip";
+36 -14
pkgs/development/ocaml-modules/camlzip/makefile.patch
··· 1 - diff -Naur camlzip-1.04/Makefile camlzip-1.04.nixos/Makefile 1 + diff -Nuar camlzip-1.04/Makefile camlzip-1.04.nixpkgs/Makefile 2 2 --- camlzip-1.04/Makefile 2002-04-22 17:28:57.000000000 +0200 3 - +++ camlzip-1.04.nixos/Makefile 2010-08-17 14:40:07.000000000 +0200 4 - @@ -4,14 +4,14 @@ 3 + +++ camlzip-1.04.nixpkgs/Makefile 2010-12-12 18:30:49.000000000 +0100 4 + @@ -4,14 +4,10 @@ 5 5 ZLIB_LIB=-lz 6 6 7 7 # The directory containing the Zlib library (libz.a or libz.so) ··· 10 10 11 11 # The directory containing the Zlib header file (zlib.h) 12 12 -ZLIB_INCLUDE=/usr/local/include 13 + - 14 + -# Where to install the library. By default: sub-directory 'zip' of 15 + -# OCaml's standard library directory. 16 + -INSTALLDIR=`$(OCAMLC) -where`/zip 13 17 +ZLIB_INCLUDE=@ZLIB_INCLUDE@ 14 18 15 - # Where to install the library. By default: sub-directory 'zip' of 16 - # OCaml's standard library directory. 17 - -INSTALLDIR=`$(OCAMLC) -where`/zip 18 - +INSTALLDIR=@INSTALLDIR@ 19 + ### End of configuration section 19 20 20 - ### End of configuration section 21 + @@ -19,10 +15,13 @@ 22 + OCAMLOPT=ocamlopt 23 + OCAMLDEP=ocamldep 24 + OCAMLMKLIB=ocamlmklib 25 + +OCAMLFIND=ocamlfind 21 26 22 - @@ -59,10 +59,6 @@ 23 - cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) 24 - if test -f dllcamlzip.so; then \ 25 - cp dllcamlzip.so $(INSTALLDIR); \ 27 + OBJS=zlib.cmo zip.cmo gzip.cmo 28 + C_OBJS=zlibstubs.o 29 + 30 + +LIBINSTALL_FILES = $(wildcard *.mli *.cmi *.cma *.cmxa *.a *.so) 31 + + 32 + all: libcamlzip.a zip.cma 33 + 34 + allopt: libcamlzip.a zip.cmxa 35 + @@ -55,18 +54,7 @@ 36 + rm -f *.o *.a 37 + 38 + install: 39 + - mkdir -p $(INSTALLDIR) 40 + - cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) 41 + - if test -f dllcamlzip.so; then \ 42 + - cp dllcamlzip.so $(INSTALLDIR); \ 26 43 - ldconf=`$(OCAMLC) -where`/ld.conf; \ 27 44 - installdir=$(INSTALLDIR); \ 28 45 - if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \ 29 46 - then echo $$installdir >> $$ldconf; fi \ 30 - fi 47 + - fi 48 + - 49 + -installopt: 50 + - cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) 51 + + $(OCAMLFIND) install camlzip META $(LIBINSTALL_FILES) 31 52 32 - installopt: 53 + depend: 54 + gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend