liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (578B)


      1 { lua, stdenv }:
      2 
      3 let
      4   pname = "nellie";
      5 in
      6 lua.pkgs.buildLuaPackage {
      7   inherit pname;
      8   version = "0.1.1-1";
      9 
     10   src = ./.;
     11 
     12   buildPhase = "$CC -shared -l lua -o nellie.so nellie.c";
     13 
     14   # for the checks to work you need to
     15   # nix-build--option sandbox false
     16   # otherwise the sandbox doesn't see any uevent messages
     17 
     18   # doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
     19 
     20   checkPhase = ''
     21     export LUA_CPATH=./?.so
     22     lua test.lua
     23   '';
     24 
     25   installPhase = ''
     26     mkdir -p "$out/lib/lua/${lua.luaversion}"
     27     cp  nellie.so "$out/lib/lua/${lua.luaversion}/"
     28   '';
     29 
     30 }