rclone: stop using LD_LIBRARY_PATH for fuse library and match version… (#337474)

This commit is contained in:
Sandro 2024-08-28 18:07:59 +02:00 committed by GitHub
commit 3aa37d9998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 = {