aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/servers/fileshare/default.nix
blob: 90bf2c3a57f650fb2029582cf98a094933044844 (plain)
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
35
{ stdenv, lib, fetchgit, pkgconfig, git, libmicrohttpd_0_9_70 }:

stdenv.mkDerivation rec {
  pname = "fileshare";
  version = "0.2.4";

  src = fetchgit {
    url = "https://git.tkolb.de/Public/fileshare.git";
    rev = "v${version}";
    sha256 = "03jrhk4vj6bc2w3lsrfjpfflb4laihysgs5i4cv097nr5cz32hyk";
  };

  postPatch = ''
    sed -i 's,$(shell git rev-parse --short HEAD),/${version},g' Makefile
  '';

  nativeBuildInputs = [ pkgconfig git ];
  buildInputs = [ libmicrohttpd_0_9_70 ];

  makeFlags = [ "BUILD=release" ];

  installPhase = ''
    mkdir -p $out/bin
    cp bin/release/fileshare $out/bin
  '';

  meta = with stdenv.lib; {
    description = "A small HTTP Server for quickly sharing files over the network";
    longDescription = "Fileshare is a simple tool for sharing the contents of a directory via a webserver and optionally allowing uploads.";
    homepage = "https://git.tkolb.de/Public/fileshare";
    license = licenses.mit;
    maintainers = [ maintainers.esclear ];
    platforms = platforms.linux;
  };
}