From 4589e6d02c349af3a3412ee0216776ef32253460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 26 Aug 2024 15:40:22 +0200 Subject: [PATCH] rclone: stop using LD_LIBRARY_PATH for fuse library and match version with buildInputs, misc cleanup --- .../applications/networking/sync/rclone/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/sync/rclone/default.nix b/pkgs/applications/networking/sync/rclone/default.nix index 11e24de45199..88c4066095b9 100644 --- a/pkgs/applications/networking/sync/rclone/default.nix +++ b/pkgs/applications/networking/sync/rclone/default.nix @@ -8,6 +8,8 @@ buildGoModule rec { pname = "rclone"; version = "1.67.0"; + outputs = [ "out" "man" ]; + src = fetchFromGitHub { owner = "rclone"; repo = "rclone"; @@ -19,15 +21,19 @@ buildGoModule rec { subPackages = [ "." ]; - outputs = [ "out" "man" ]; + nativeBuildInputs = [ installShellFiles makeWrapper ]; buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse); - nativeBuildInputs = [ installShellFiles makeWrapper ]; tags = lib.optionals enableCmount [ "cmount" ]; ldflags = [ "-s" "-w" "-X github.com/rclone/rclone/fs.Version=${version}" ]; + postConfigure = lib.optionalString (!stdenv.isDarwin) '' + substituteInPlace vendor/github.com/winfsp/cgofuse/fuse/host_cgo.go \ + --replace-fail '"libfuse.so.2"' '"${lib.getLib fuse}/lib/libfuse.so.2"' + ''; + postInstall = let rcloneBin = @@ -50,8 +56,7 @@ buildGoModule rec { # as the setuid wrapper is required as non-root on NixOS. '' wrapProgram $out/bin/rclone \ - --suffix PATH : "${lib.makeBinPath [ fuse3 ] }" \ - --prefix LD_LIBRARY_PATH : "${fuse3}/lib" + --suffix PATH : "${lib.makeBinPath [ fuse3 ] }" ''; passthru.tests = {