Unverified Commit 3aa37d99 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

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

parents 74c9f065 4589e6d0
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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 = {