nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1101B)


      1 { lib, stdenv, fetchFromGitHub, pkg-config, makeWrapper
      2 , lua5_3, memstreamHook, zlib
      3 }:
      4 
      5 stdenv.mkDerivation rec {
      6   pname = "tom";
      7   version = "2021-10-21";
      8 
      9   src = fetchFromGitHub {
     10     owner = "omar-polo";
     11     repo = pname;
     12     rev = "5d89c1bb50200f79fac9eee5f88ed4e43ccd32a8";
     13     hash = "sha256-dpDNZYkOzcugtPi3ZeB9xHlYas2tdsTqfnhp7KqBMYg=";
     14   };
     15 
     16   postPatch = ''
     17     substituteInPlace runcgi.sh \
     18       --replace "lua53" "${lua5_3}/bin/lua" \
     19       --replace "tom.lua" "$out/share/lua/tom.lua"
     20   '';
     21 
     22   nativeBuildInputs = [ pkg-config makeWrapper ];
     23 
     24   buildInputs = [ lua5_3 zlib ] ++ lib.optional stdenv.isDarwin memstreamHook;
     25 
     26   installPhase = ''
     27     install -Dm644 *.so *.lua -t $out/share/lua
     28     install -Dm755 *.sh -t $out/bin
     29 
     30     wrapProgram $out/bin/runcgi.sh \
     31       --set LUA_PATH "$out/share/lua/?.lua" \
     32       --set LUA_CPATH "$out/share/lua/?.so"
     33   '';
     34 
     35   meta = with lib; {
     36     description = "Gemini frontend for git repositories";
     37     inherit (src.meta) homepage;
     38     license = licenses.isc;
     39     maintainers = [ maintainers.sikmir ];
     40     platforms = platforms.unix;
     41   };
     42 }