diff --git a/pkgs/by-name/te/temporal_capi/package.nix b/pkgs/by-name/te/temporal_capi/package.nix new file mode 100644 index 000000000000..2ef74966e4b7 --- /dev/null +++ b/pkgs/by-name/te/temporal_capi/package.nix @@ -0,0 +1,102 @@ +{ + lib, + stdenv, + rustPlatform, + fetchFromGitHub, + nix-update-script, + testers, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "temporal_capi"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "boa-dev"; + repo = "temporal"; + tag = "v${finalAttrs.version}"; + hash = "sha256-JmNYoskoQZewmWAU/SUBdjKdN+pnpMdLZUVv+jysS5A="; + }; + + cargoHash = "sha256-jIPbroAtS7D/l4QJtGCgXNa7QaQLdsF4Gh9O4NaRBCw="; + + postPatch = '' + # Force crate-type to include staticlib + echo ' + [lib] + crate-type = ["${if stdenv.hostPlatform.isStatic then "staticlib" else "cdylib"}"] + ' >> temporal_capi/Cargo.toml + ''; + + cargoBuildFlags = [ + "--package" + "temporal_capi" + "--features" + "zoneinfo64,compiled_data" + ]; + + installPhase = '' + runHook preInstall + + install -Dm644 target/*/release/libtemporal_capi.* -t $out/lib + + install -Dm644 -t $out/include/temporal_rs \ + temporal_capi/bindings/cpp/temporal_rs/*.hpp + install -Dm644 -t $out/include \ + temporal_capi/bindings/c/*.h + + runHook postInstall + ''; + postInstall = '' + mkdir $out/lib/pkgconfig + cat -> $out/lib/pkgconfig/temporal_capi.pc <