nixpkgs/pkgs/by-name/sv/svix-server/package.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

56 lines
1.6 KiB
Nix

{ lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, protobuf, stdenv
, darwin }:
rustPlatform.buildRustPackage rec {
pname = "svix-server";
version = "1.30.0";
src = fetchFromGitHub {
owner = "svix";
repo = "svix-webhooks";
rev = "v${version}";
hash = "sha256-W5oLN0rMG2c8h05sIEOf4h95SQrFrs/7vLpsHH91sIA=";
};
sourceRoot = "${src.name}/server";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"hyper-0.14.28" = "sha256-4HGGpM9Ce3l3EJnu5XsGfqhrD9EykpR+ihEJlSZc03Q=";
"omniqueue-0.2.1" = "sha256-ql3KJRs0SfLdo75vF2HlZT2zRDamDrORsWmK+Oj7m1Q=";
};
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
protobuf
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
# needed for internal protobuf c wrapper library
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
OPENSSL_NO_VENDOR = 1;
# disable tests because they require postgres and redis to be running
doCheck = false;
meta = with lib; {
mainProgram = "svix-server";
description = "Enterprise-ready webhooks service";
homepage = "https://github.com/svix/svix-webhooks";
changelog =
"https://github.com/svix/svix-webhooks/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ techknowlogick ];
broken = stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin; # aws-lc-sys currently broken on darwin x86_64
};
}