about summary refs log tree commit diff
path: root/pkgs/servers/wsdd/default.nix
blob: a0a8421a7c2b47f95c9c3a237c38eac3a99ae08d (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
35
36
37
38
39
40
{ lib, stdenv, fetchFromGitHub, makeWrapper, nixosTests, python3 }:

stdenv.mkDerivation rec {
  pname = "wsdd";
  version = "0.7.0";

  src = fetchFromGitHub {
    owner = "christgau";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-9cwzkF2mg6yOIsurLMXTLoEIOsKbPIWMicpWBQ0XVhE=";
  };

  nativeBuildInputs = [ makeWrapper ];

  buildInputs = [ python3 ];

  patches = [
    # Increase timeout to socket urlopen
    # See https://github.com/christgau/wsdd/issues/80#issuecomment-76848906
    ./increase_timeout.patch
  ];

  installPhase = ''
    install -Dm0755 src/wsdd.py $out/bin/wsdd
    wrapProgram $out/bin/wsdd --prefix PYTHONPATH : "$PYTHONPATH"
  '';

  passthru = {
    tests.samba-wsdd = nixosTests.samba-wsdd;
  };

  meta = with lib; {
    homepage = "https://github.com/christgau/wsdd";
    description = "A Web Service Discovery (WSD) host daemon for SMB/Samba";
    maintainers = with maintainers; [ izorkin ];
    license = licenses.mit;
    platforms = platforms.all;
  };
}