about summary refs log tree commit diff
path: root/pkgs/by-name/ht
diff options
context:
space:
mode:
authorAnthony Roussel <anthony@roussel.dev>2024-03-30 17:13:30 +0100
committerAnthony Roussel <anthony@roussel.dev>2024-03-30 17:34:47 +0100
commit3de8f433e235e16ebc53f8198f381347efc2168b (patch)
treef63ed348e10ca6ad8d18cd707418526d6540a781 /pkgs/by-name/ht
parent4bc9e0221b2e942087a987f622f3ef3d1b4e649a (diff)
httpdirfs: move to pkgs/by-name
Diffstat (limited to 'pkgs/by-name/ht')
-rw-r--r--pkgs/by-name/ht/httpdirfs/package.nix70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/by-name/ht/httpdirfs/package.nix b/pkgs/by-name/ht/httpdirfs/package.nix
new file mode 100644
index 0000000000000..54d16dbfcbb57
--- /dev/null
+++ b/pkgs/by-name/ht/httpdirfs/package.nix
@@ -0,0 +1,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}";
+    sha256 = "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 = "A 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;
+  };
+})