83405b6dd2
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
33 lines
758 B
Nix
33 lines
758 B
Nix
{ lib
|
|
, stdenv
|
|
, buildGoModule
|
|
, rclone
|
|
}:
|
|
|
|
let
|
|
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
in buildGoModule rec {
|
|
pname = "librclone";
|
|
inherit (rclone) version src vendorSha256;
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
cd librclone
|
|
go build --buildmode=c-shared -o librclone${ext} github.com/rclone/rclone/librclone
|
|
runHook postBuildd
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|