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