about summary refs log tree commit diff
path: root/pkgs/by-name/ht/httpdirfs/package.nix
blob: 22dbceaf3799577a6b0e15adcbf47136cabdedb4 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  curl,
  expat,
  fetchFromGitHub,
  fuse,
  gumbo,
  help2man,
  lib,
  libuuid,
  nix-update-script,
  pkg-config,
  stdenv,
  testers,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "httpdirfs";
  version = "1.2.5";

  src = fetchFromGitHub {
    owner = "fangfufu";
    repo = "httpdirfs";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-PUYsT0VDEzerPqwrLJrET4kSsWsQhtnfmLepeaqtA+I=";
  };

  postPatch = lib.optional stdenv.isDarwin ''
    substituteInPlace Makefile --replace-fail '-fanalyzer' '-Xanalyzer'
  '';

  nativeBuildInputs = [
    help2man
    pkg-config
  ];

  buildInputs = [
    curl
    expat
    fuse
    gumbo
    libuuid
  ];

  makeFlags = [ "prefix=${placeholder "out"}" ];

  postBuild = ''
    make man
  '';

  passthru = {
    # Disabled for Darwin because requires macFUSE installed outside NixOS
    tests.version = lib.optionalAttrs stdenv.isLinux (
      testers.testVersion {
        command = "${lib.getExe finalAttrs.finalPackage} --version";
        package = finalAttrs.finalPackage;
      }
    );
    updateScript = nix-update-script { };
  };

  meta = {
    changelog = "https://github.com/fangfufu/httpdirfs/releases/tag/${finalAttrs.version}";
    description = "FUSE filesystem for HTTP directory listings";
    homepage = "https://github.com/fangfufu/httpdirfs";
    license = lib.licenses.gpl3Only;
    mainProgram = "httpdirfs";
    maintainers = with lib.maintainers; [ sbruder schnusch anthonyroussel ];
    platforms = lib.platforms.unix;
  };
})