Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 35 lines 791 B view raw
1{ lib 2, stdenv 3, buildGoModule 4, rclone 5}: 6 7let 8 ext = stdenv.hostPlatform.extensions.sharedLibrary; 9in buildGoModule rec { 10 pname = "librclone"; 11 inherit (rclone) version src vendorHash; 12 13 patches = rclone.patches or [ ]; 14 15 buildPhase = '' 16 runHook preBuild 17 cd librclone 18 go build --buildmode=c-shared -o librclone${ext} github.com/rclone/rclone/librclone 19 runHook postBuild 20 ''; 21 22 installPhase = '' 23 runHook preInstall 24 install -Dt $out/lib librclone${ext} 25 install -Dt $out/include librclone.h 26 runHook postInstall 27 ''; 28 29 meta = { 30 description = "Rclone as a C library"; 31 homepage = "https://github.com/rclone/rclone/tree/master/librclone"; 32 maintainers = with lib.maintainers; [ dotlambda ]; 33 inherit (rclone.meta) license platforms; 34 }; 35}