depot/third_party/nixpkgs/pkgs/development/libraries/librclone/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

33 lines
765 B
Nix

{ lib
, stdenv
, buildGoModule
, rclone
}:
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in buildGoModule rec {
pname = "librclone";
inherit (rclone) version src patches vendorSha256;
buildPhase = ''
runHook preBuild
cd librclone
go build --buildmode=c-shared -o librclone${ext} github.com/rclone/rclone/librclone
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dt $out/lib librclone${ext}
install -Dt $out/include librclone.h
runHook postInstall
'';
meta = {
description = "Rclone as a C library";
homepage = "https://github.com/rclone/rclone/tree/master/librclone";
maintainers = with lib.maintainers; [ dotlambda ];
inherit (rclone.meta) license platforms;
};
}