about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/gemini/gmnisrv/default.nix
blob: c13d4dda5056cbde30e4bb04e8e2b0742e4c7b8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, lib, fetchFromSourcehut, pkg-config, openssl, mailcap, scdoc }:

stdenv.mkDerivation rec {
  pname = "gmnisrv";
  version = "1.0";

  src = fetchFromSourcehut {
    owner = "~sircmpwn";
    repo = "gmnisrv";
    rev = version;
    sha256 = "sha256-V9HXXYQIo3zeqZjJEn+dhemNg6AU+ee3FRmBmXgLuYQ=";
  };

  env.NIX_CFLAGS_COMPILE = toString [
    "-Wno-error=deprecated-declarations"
  ];

  postPatch = ''
    substituteInPlace config.sh \
      --replace "pkg-config" "${stdenv.cc.targetPrefix}pkg-config"
  '';

  MIMEDB = "${mailcap}/etc/mime.types";
  nativeBuildInputs = [ pkg-config scdoc ];
  buildInputs = [ openssl mailcap ];

  meta = with lib; {
    description = "A simple Gemini protocol server";
    homepage = "https://git.sr.ht/~sircmpwn/gmnisrv";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ bsima jb55 ];
    platforms = platforms.linux;
  };
}