Merge pull request #18692 from Mic92/luasocket

luasocket: fix non-5.1 builds

authored by zimbatm.tngl.sh and committed by GitHub 5000f505 444c0420

+15 -8
+15 -8
pkgs/top-level/lua-packages.nix
··· 189 189 sha256 = "0j8jx8bjicvp9khs26xjya8c495wrpb7parxfnabdqa5nnsxjrwb"; 190 190 }; 191 191 192 - patchPhase = '' 193 - sed -e "s,^LUAPREFIX_linux.*,LUAPREFIX_linux=$out," \ 194 - -i src/makefile 195 - '' + stdenv.lib.optionalString stdenv.isDarwin '' 196 - export PLAT=macosx 197 - export LUAPREFIX_macosx=$out 198 - substituteInPlace src/Makefile --replace gcc cc \ 192 + patchPhase = stdenv.lib.optionalString stdenv.isDarwin '' 193 + substituteInPlace src/makefile --replace gcc cc \ 199 194 --replace 10.3 10.5 200 195 ''; 201 196 197 + preBuild = '' 198 + makeFlagsArray=( 199 + LUAV=${lua.luaversion} 200 + PLAT=${if stdenv.isDarwin then "macosx" 201 + else if stdenv.isFreeBSD then "freebsd" 202 + else if stdenv.isLinux then "linux" 203 + else if stdenv.isSunOS then "solaris" 204 + else throw "unsupported platform"} 205 + prefix=$out 206 + ); 207 + ''; 208 + 202 209 meta = { 203 210 homepage = "http://w3.impa.br/~diego/software/luasocket/"; 204 - hydraPlatforms = stdenv.lib.platforms.linux; 211 + hydraPlatforms = with platforms; [darwin linux freebsd illumos]; 205 212 maintainers = with maintainers; [ mornfall ]; 206 213 }; 207 214 };