From 4d5336316caedbb8033646b3a69811f3f4c0fc29 Mon Sep 17 00:00:00 2001 From: wyvie Date: Thu, 18 Sep 2014 11:09:43 +0400 Subject: [PATCH] New package: lua-zip-1.2.3 Closes #4138 --- pkgs/development/interpreters/lua-5/zip.nix | 28 +++++++++++++++++++ pkgs/development/interpreters/lua-5/zip.patch | 23 +++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 52 insertions(+) create mode 100644 pkgs/development/interpreters/lua-5/zip.nix create mode 100644 pkgs/development/interpreters/lua-5/zip.patch diff --git a/pkgs/development/interpreters/lua-5/zip.nix b/pkgs/development/interpreters/lua-5/zip.nix new file mode 100644 index 000000000000..f6460be16625 --- /dev/null +++ b/pkgs/development/interpreters/lua-5/zip.nix @@ -0,0 +1,28 @@ +{ pkgs, stdenv, fetchurl, lua5_1, zziplib }: + +stdenv.mkDerivation rec { + version = "1.2.3"; + name = "lua-zip-${version}"; + isLibrary = true; + src = fetchurl { + url = "https://github.com/luaforge/luazip/archive/0b8f5c958e170b1b49f05bc267bc0351ad4dfc44.zip"; + sha256 = "beb9260d606fdd5304aa958d95f0d3c20be7ca0a2cff44e7b75281c138a76a50"; + }; + + buildInputs = [ pkgs.unzip lua5_1 zziplib ]; + + preBuild = '' + makeFlagsArray=( + PREFIX=$out + LUA_LIBDIR="$out/lib/lua/${lua5_1.luaversion}" + LUA_INC="-I${lua5_1}/include"); + ''; + + patches = [ ./zip.patch ]; + + meta = { + homepage = "https://github.com/luaforge/luazip"; + hydraPlatforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.mit; + }; +} diff --git a/pkgs/development/interpreters/lua-5/zip.patch b/pkgs/development/interpreters/lua-5/zip.patch new file mode 100644 index 000000000000..c3f88f451e8d --- /dev/null +++ b/pkgs/development/interpreters/lua-5/zip.patch @@ -0,0 +1,23 @@ +--- a/Makefile 2007-10-30 01:59:10.000000000 +0300 ++++ b/Makefile 2014-09-18 11:04:53.176320021 +0400 +@@ -6,10 +6,6 @@ + + include $(CONFIG) + +-ifeq "$(LUA_VERSION_NUM)" "500" +-COMPAT_O= $(COMPAT_DIR)/compat-5.1.o +-endif +- + SRCS= src/lua$T.c + OBJS= src/lua$T.o $(COMPAT_O) + +@@ -19,9 +15,6 @@ + src/$(LIBNAME): $(OBJS) + export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) -lzzip + +-$(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c +- $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c +- + install: src/$(LIBNAME) + mkdir -p $(LUA_LIBDIR) + cp src/$(LIBNAME) $(LUA_LIBDIR) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 95268262ca03..dc567d13238c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3721,6 +3721,7 @@ let lua5_expat = callPackage ../development/interpreters/lua-5/expat.nix {}; lua5_filesystem = callPackage ../development/interpreters/lua-5/filesystem.nix {}; lua51_filesystem = lua5_filesystem.override { lua5=lua5_1; }; + lua51_zip = callPackage ../development/interpreters/lua-5/zip.nix { }; lua5_sec = callPackage ../development/interpreters/lua-5/sec.nix { }; luarocks = callPackage ../development/tools/misc/luarocks {