Unverified Commit d5448d82 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #312871 from eliandoran/darwin/security_sdk

treewide: fix builds on darwin due to missing `Security` framework
parents 9c4f6ca1 c4125456
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
, makeBinaryWrapper
, libiconv
, MacOSX-SDK
, Security
, which
}:

@@ -25,7 +26,10 @@ in stdenv.mkDerivation rec {
    makeBinaryWrapper which
  ];

  buildInputs = lib.optional stdenv.isDarwin libiconv;
  buildInputs = lib.optionals stdenv.isDarwin [
    libiconv
    Security
  ];

  LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config";

+5 −1
Original line number Diff line number Diff line
{ lib
, stdenv
, rustPlatform
, buildNpmPackage
, fetchFromGitHub
@@ -7,6 +8,7 @@
, sqlite
, testers
, moonfire-nvr
, darwin
}:

let
@@ -52,7 +54,9 @@ in rustPlatform.buildRustPackage {
  buildInputs = [
    ncurses
    sqlite
  ];
  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
    Security
  ]);

  postInstall = ''
    mkdir -p $out/lib/ui
+7 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pandoc
, Security
}:

rustPlatform.buildRustPackage rec {
@@ -18,6 +20,9 @@ rustPlatform.buildRustPackage rec {

  cargoHash = "sha256-iZuDNFy8c2UZUh3J11lEtfHlDFN+qPl4iZg+ps7AenE=";

  buildInputs = lib.optionals stdenv.isDarwin ([
    Security
  ]);
  nativeBuildInputs = [ pandoc installShellFiles ];

  postPatch = ''
@@ -53,5 +58,7 @@ rustPlatform.buildRustPackage rec {
    changelog = "https://github.com/pendulum-project/ntpd-rs/blob/v${version}/CHANGELOG.md";
    license = with licenses; [ mit /* or */ asl20 ];
    maintainers = with maintainers; [ fpletz ];
    # note: Undefined symbols for architecture x86_64: "_ntp_adjtime"
    broken = stdenv.isDarwin && stdenv.isx86_64;
  };
}
+6 −2
Original line number Diff line number Diff line
{ lib, rustPlatform, fetchFromGitHub, pkg-config, openssl }:
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, openssl, darwin }:

rustPlatform.buildRustPackage rec {
  version = "0.3.1";
@@ -16,7 +16,11 @@ rustPlatform.buildRustPackage rec {
  cargoSha256 = "sha256-QNMdqoxxY8ao2O44hJxZNgLrPwzu9+ieweTPc7pfFY4=";

  nativeBuildInputs = [pkg-config];
  buildInputs = [openssl];
  buildInputs = [openssl]
    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
      Security
      SystemConfiguration
    ]);

  OPENSSL_NO_VENDOR = 1;

+6 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
}:

rustPlatform.buildRustPackage rec{
@@ -14,6 +16,10 @@ rustPlatform.buildRustPackage rec{
    hash = "sha256-VoNr91vDqBlt9asT/dwCeYk13UNiDexNNiKwD5DSn8k=";
  };

  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
    Security
  ]);

  postPatch = ''
    ln -sf ${./Cargo.lock} Cargo.lock
  '';
Loading