From 73a82dcc44800dfbd205031b61ff8bbb3720e421 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 6 Mar 2019 11:53:25 +0100 Subject: [PATCH] luarocks: switch to a less intrusive update-walker metadata style --- .../tools/misc/luarocks/default.nix | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index ad50e7e8e6df..3bbee6ee5e40 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -8,26 +8,17 @@ }: let - s = # Generated upstream information - rec { - baseName="luarocks"; - version="2.4.4"; - name="${baseName}-${version}"; - hash="0d7rl60dwh52qh5pfsphgx5ypp7k190h9ri6qpr2yx9kvqrxyf1r"; - url="http://luarocks.org/releases/luarocks-2.4.4.tar.gz"; - sha256="0d7rl60dwh52qh5pfsphgx5ypp7k190h9ri6qpr2yx9kvqrxyf1r"; - }; - buildInputs = [ - lua curl makeWrapper which unzip - ]; in -stdenv.mkDerivation { - inherit (s) name version; - inherit buildInputs; +stdenv.mkDerivation rec { + pname="luarocks"; + version="2.4.4"; + src = fetchurl { - inherit (s) url sha256; + url="http://luarocks.org/releases/luarocks-${version}.tar.gz"; + sha256="0d7rl60dwh52qh5pfsphgx5ypp7k190h9ri6qpr2yx9kvqrxyf1r"; }; + patches = [ ./darwin.patch ]; preConfigure = '' lua -e "" || { @@ -41,6 +32,11 @@ stdenv.mkDerivation { configureFlags="$configureFlags --with-lua-include=$lua_inc" fi ''; + + buildInputs = [ + lua curl makeWrapper which + ]; + postInstall = '' sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/* for i in "$out"/bin/*; do @@ -73,5 +69,7 @@ stdenv.mkDerivation { license = licenses.mit ; maintainers = with maintainers; [raskin teto]; platforms = platforms.linux ++ platforms.darwin; + downloadPage = "http://luarocks.org/releases/"; + updateWalker = true; }; }