knot-resolver: remove older lua path workarounds

Part of this is approximate revert of commit f0d2da43a7a449b5888.
This commit is contained in:
Vladimír Čunát 2020-01-27 15:14:42 +01:00
parent e980e7a3ab
commit 93ad21dedd
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -11,16 +11,9 @@ let # un-indented, over the whole file
result = if extraFeatures then wrapped-full else unwrapped; result = if extraFeatures then wrapped-full else unwrapped;
inherit (stdenv.lib) optional optionals concatStringsSep; inherit (stdenv.lib) optional optionals;
lua = luajitPackages; lua = luajitPackages;
# FIXME: remove these usages once resolving
# https://github.com/NixOS/nixpkgs/pull/63108#issuecomment-508670438
exportLuaPathsFor = luaPkgs: ''
export LUA_PATH='${ concatStringsSep ";" (map lua.getLuaPath luaPkgs)}'
export LUA_CPATH='${concatStringsSep ";" (map lua.getLuaCPath luaPkgs)}'
'';
unwrapped = stdenv.mkDerivation rec { unwrapped = stdenv.mkDerivation rec {
pname = "knot-resolver"; pname = "knot-resolver";
version = "4.3.0"; version = "4.3.0";
@ -34,8 +27,7 @@ unwrapped = stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
patchShebangs scripts/ patchShebangs scripts/
'' '';
+ stdenv.lib.optionalString doInstallCheck (exportLuaPathsFor [ lua.cqueues lua.basexx ]);
nativeBuildInputs = [ pkgconfig meson ninja ]; nativeBuildInputs = [ pkgconfig meson ninja ];
@ -61,7 +53,7 @@ unwrapped = stdenv.mkDerivation rec {
''; '';
doInstallCheck = with stdenv; hostPlatform == buildPlatform; doInstallCheck = with stdenv; hostPlatform == buildPlatform;
installCheckInputs = [ cmocka which cacert ]; installCheckInputs = [ cmocka which cacert lua.cqueues lua.basexx ];
installCheckPhase = '' installCheckPhase = ''
meson test --print-errorlogs meson test --print-errorlogs
''; '';
@ -75,26 +67,18 @@ unwrapped = stdenv.mkDerivation rec {
}; };
}; };
# FIXME: revert this back after resolving wrapped-full = runCommand unwrapped.name
# https://github.com/NixOS/nixpkgs/pull/63108#issuecomment-508670438 {
wrapped-full = nativeBuildInputs = [ makeWrapper ];
with stdenv.lib; buildInputs = with luajitPackages; [
with luajitPackages;
let
luaPkgs = [
luasec luasocket # trust anchor bootstrap, prefill module luasec luasocket # trust anchor bootstrap, prefill module
luafilesystem # prefill module luafilesystem # prefill module
http # for http module; brings lots of deps; some are useful elsewhere http # for http module; brings lots of deps; some are useful elsewhere
cqueues fifo lpeg lpeg_patterns luaossl compat53 basexx binaryheap
]; ];
in runCommand unwrapped.name
{
nativeBuildInputs = [ makeWrapper ];
preferLocalBuild = true; preferLocalBuild = true;
allowSubstitutes = false; allowSubstitutes = false;
} }
(exportLuaPathsFor luaPkgs ''
+ ''
mkdir -p "$out"/{bin,share} mkdir -p "$out"/{bin,share}
makeWrapper '${unwrapped}/bin/kresd' "$out"/bin/kresd \ makeWrapper '${unwrapped}/bin/kresd' "$out"/bin/kresd \
--set LUA_PATH "$LUA_PATH" \ --set LUA_PATH "$LUA_PATH" \
@ -106,6 +90,6 @@ wrapped-full =
echo "Checking that 'http' module loads, i.e. lua search paths work:" echo "Checking that 'http' module loads, i.e. lua search paths work:"
echo "modules.load('http')" > test-http.lua echo "modules.load('http')" > test-http.lua
echo -e 'quit()' | env -i "$out"/bin/kresd -a 127.0.0.1#53535 -c test-http.lua echo -e 'quit()' | env -i "$out"/bin/kresd -a 127.0.0.1#53535 -c test-http.lua
''); '';
in result in result