mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
07f09fcbbb
Also go back to the `GOBIN` hack in libwg. I don't know why it was
working before and not now, but 🤷
38 lines
959 B
Nix
38 lines
959 B
Nix
{ lib
|
|
, buildGoModule
|
|
, mullvad
|
|
}:
|
|
buildGoModule {
|
|
pname = "libwg";
|
|
|
|
inherit (mullvad)
|
|
version
|
|
src
|
|
;
|
|
|
|
modRoot = "wireguard-go-rs/libwg";
|
|
proxyVendor = true;
|
|
vendorHash = "sha256-uyAzY1hoCtS7da3wtjxTGx5wBb9c9m749TzihVr94rc=";
|
|
|
|
# XXX: hack to make the ar archive go to the correct place
|
|
# This is necessary because passing `-o ...` to `ldflags` does not work
|
|
# (this doesn't get communicated everywhere in the chain, apparently, so
|
|
# `go` complains that it can't find an `a.out` file).
|
|
GOBIN = "${placeholder "out"}/lib";
|
|
|
|
subPackages = [ "." ];
|
|
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
|
|
tags = [ "daita" ];
|
|
|
|
postInstall = ''
|
|
mv $out/lib/libwg{,.a}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Tiny wrapper around wireguard-go";
|
|
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/main/wireguard-go-rs/libwg";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ cole-h ];
|
|
};
|
|
}
|