eufon

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

netlink.nix (1453B)


      1 { lua, lib, fetchpatch, fetchFromGitHub, buildLuaPackage, libmnl }:
      2 let pname = "netlink";
      3 in buildLuaPackage {
      4   inherit pname;
      5   version = "0.1.1-1";
      6 
      7   buildInputs = [ libmnl ];
      8 
      9   src = fetchFromGitHub {
     10     repo = "lua-netlink";
     11     owner = "chris2511";
     12     rev = "v0.1.1";
     13     hash = "sha256:1833naskl4p7rz5kk0byfgngvw1mvf6cnz64sr3ny7i202wv7s52";
     14   };
     15   patches = [ (fetchpatch {
     16     url = "https://github.com/chris2511/lua-netlink/compare/master...telent:rtnetlink-types.patch";
     17     name = "rtnetlink-types.patch";
     18     hash = "sha256-lBCfP8pMyBIY+XEGWD/nPQ9l2dDOnXeitR1TaRUXCq8=";
     19   })];
     20 
     21   buildPhase = "$CC -shared -l mnl -o netlink.so src/*.c";
     22 
     23   installPhase = ''
     24     mkdir -p "$out/lib/lua/${lua.luaversion}"
     25     cp  netlink.so "$out/lib/lua/${lua.luaversion}/"
     26   '';
     27 
     28 }
     29 
     30 
     31 # , fetchFromGitHub }:
     32 # let
     33 
     34 #   simpleName = "netlink";
     35 
     36 # in
     37 # # TODO: add busted and checkPhase?
     38 # buildLuaPackage rec {
     39 #   version = "0.10.2";
     40 #   pname = simpleName; # nixpkgs unstable needs this
     41 #   name = "${pname}-${version}"; # nixpkgs 21.11 needs this
     42 
     43 #   src = fetchFromGitHub {
     44 #     owner = "stefano-m";
     45 #     repo = "lua-${simpleName}";
     46 #     rev = "v${version}";
     47 #     sha256 = "0kl8ff1g1kpmslzzf53cbzfl1bmb5cb91w431hbz0z0vdrramh6l";
     48 #   };
     49 
     50 #   propagatedBuildInputs = [ lgi ];
     51 
     52 #   buildPhase = ":";
     53 
     54 #   installPhase = ''
     55 #     mkdir -p "$out/share/lua/${lua.luaversion}"
     56 #     cp -r src/${pname} "$out/share/lua/${lua.luaversion}/"
     57 #   '';
     58 
     59 # }