summaryrefslogtreecommitdiff
path: root/pkgs/servers/http/apache-modules/mod_dnssd/default.nix
blob: 74778a1209f6e8a26fd29033e3ba2fe6597ad45c (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  pkg-config,
  apacheHttpd,
  apr,
  avahi,
}:

stdenv.mkDerivation rec {
  pname = "mod_dnssd";
  version = "0.6";

  src = fetchurl {
    url = "http://0pointer.de/lennart/projects/mod_dnssd/${pname}-${version}.tar.gz";
    sha256 = "2cd171d76eba398f03c1d5bcc468a1756f4801cd8ed5bd065086e4374997c5aa";
  };

  configureFlags = [
    "--disable-lynx"
    "--with-apxs=${lib.getDev apacheHttpd}/bin"
  ];

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [
    apacheHttpd
    avahi
    apr
  ];

  patches = [
    (fetchpatch {
      url = "https://sources.debian.org/data/main/m/mod-dnssd/0.6-5/debian/patches/port-for-apache2.4.patch";
      hash = "sha256-jWWzZDpZdveXlLpo7pN0tMQZkjYUbpz/DRjm6T6pCzY=";
    })
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/modules
    cp src/.libs/mod_dnssd.so $out/modules

    runHook postInstall
  '';

  preFixup = ''
    # TODO: Packages in non-standard directories not stripped.
    # https://github.com/NixOS/nixpkgs/issues/141554
    stripDebugList=modules
  '';

  meta = {
    homepage = "https://0pointer.de/lennart/projects/mod_dnssd";
    description = "Provide Zeroconf support via DNS-SD using Avahi";
    license = lib.licenses.asl20;
    platforms = lib.platforms.linux;
    maintainers = [ ];
  };
}