git.iko.soy/typeable/nixpkgs
on master help sign in
luaPackages: refactor common platform strings
commita35373f5842389cf2b6dc51d4e8166bd44beface authorVladimír Čunát <vcunat@gmail.com> dateFri 27 Jan 2017, 11:49 (10 years ago) parent70909be
1 file changed+12−10
pkgs/top-level/lua-packages.nix+12−10
pkgs/top-level/lua-packages.nix+12−10
@@ -14,6 +14,14 @@
1414let
1515 isLua51 = lua.luaversion == "5.1";
1616 isLua52 = lua.luaversion == "5.2";
17+
18+ platformString =
19+ if stdenv.isDarwin then "macosx"
20+ else if stdenv.isFreeBSD then "freebsd"
21+ else if stdenv.isLinux then "linux"
22+ else if stdenv.isSunOS then "solaris"
23+ else throw "unsupported platform";
24+
1725 self = _self;
1826 _self = with self; {
1927 inherit lua;
@@ -167,9 +175,7 @@ let
167175
168176 preBuild = ''
169177 makeFlagsArray=(
170− ${if stdenv.isLinux then "linux"
171− else if stdenv.isDarwin then "macosx"
172− else "bsd"}
178+ ${platformString}
173179 LUAPATH="$out/lib/lua/${lua.luaversion}"
174180 LUACPATH="$out/lib/lua/${lua.luaversion}"
175181 INC_PATH="-I${lua}/include"
@@ -199,11 +205,7 @@ let
199205 preBuild = ''
200206 makeFlagsArray=(
201207 LUAV=${lua.luaversion}
202− PLAT=${if stdenv.isDarwin then "macosx"
203− else if stdenv.isFreeBSD then "freebsd"
204− else if stdenv.isLinux then "linux"
205− else if stdenv.isSunOS then "solaris"
206− else throw "unsupported platform"}
208+ PLAT=${platformString}
207209 prefix=$out
208210 );
209211 '';
@@ -246,7 +248,7 @@ let
246248
247249 preBuild = ''
248250 makeFlagsArray=(
249− linux
251+ ${platformString}
250252 LUAPATH="$out/share/lua/${lua.luaversion}"
251253 LUACPATH="$out/lib/lua/${lua.luaversion}"
252254 INCDIR="-I${lua}/include"
@@ -346,7 +348,7 @@ let
346348 makeFlagsArray=(CC=$CC);
347349 '';
348350
349− buildFlags = if stdenv.isDarwin then "macosx" else "";
351+ buildFlags = platformString;
350352
351353 installPhase = ''
352354 mkdir -p $out/lib/lua/${lua.luaversion}