envision-unwrapped: 0-unstable-2024-10-20 -> 1.1.1 (#360652)
[NixPkgs.git] / pkgs / by-name / pa / pan-bindings / package.nix
blob04c240ccc9bc526ebc395290f49b3a8993e3ab0d
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , buildGoModule
5 , cmake
6 , ncurses
7 , asio
8 }:
10 let
11   version = "unstable-2024-03-03";
12   src = fetchFromGitHub {
13     owner = "lschulz";
14     repo = "pan-bindings";
15     rev = "4361d30f1c5145a70651c259f2d56369725b0d15";
16     hash = "sha256-0WxrgXTCM+BwGcjjWBBKiZawje2yxB5RRac6Sk5t3qc=";
17   };
18   goDeps = (buildGoModule {
19     name = "pan-bindings-goDeps";
20     inherit src version;
21     modRoot = "go";
22     vendorHash = "sha256-7EitdEJTRtiM29qmVnZUM6w68vCBI8mxZhCA7SnAxLA=";
23   });
26 stdenv.mkDerivation {
27   name = "pan-bindings";
29   inherit src version;
31   cmakeFlags = [
32     "-DBUILD_SHARED_LIBS=1"
33     "-DBUILD_EXAMPLES=0"
34   ];
36   patchPhase = ''
37     runHook prePatch
38     export HOME=$TMP
39     cp -r --reflink=auto ${goDeps.goModules} go/vendor
40     runHook postPatch
41   '';
43   buildInputs = [
44     ncurses
45     asio
46   ];
48   nativeBuildInputs = [
49     cmake
50     goDeps.go
51   ];
53   meta = with lib; {
54     description = "SCION PAN Bindings for C, C++, and Python";
55     homepage = "https://github.com/lschulz/pan-bindings";
56     license = licenses.asl20;
57     maintainers = with maintainers; [ matthewcroughan ];
58     mainProgram = "pan-bindings";
59     platforms = platforms.all;
60   };