element-desktop: fix darwin build (#132635)

Add Frameworks to native dependencies

Signed-off-by: Finn Behrens <me@kloenk.dev>
This commit is contained in:
Finn Behrens 2021-08-04 11:09:56 +02:00 committed by GitHub
parent f09a770d9c
commit 15af01b456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 10 deletions

View File

@ -2,6 +2,9 @@
, makeWrapper, makeDesktopItem, mkYarnPackage
, electron, element-web
, callPackage
, Security
, AppKit
, CoreServices
}:
# Notes for maintainers:
# * versions of `element-web` and `element-desktop` should be kept in sync.
@ -25,8 +28,8 @@ in mkYarnPackage rec {
nativeBuildInputs = [ makeWrapper ];
seshat = callPackage ./seshat {};
keytar = callPackage ./keytar {};
seshat = callPackage ./seshat { inherit CoreServices; };
keytar = callPackage ./keytar { inherit Security AppKit; };
buildPhase = ''
runHook preBuild

View File

@ -1,4 +1,5 @@
{ stdenv, fetchFromGitHub, nodejs-14_x, python3, callPackage, fixup_yarn_lock, yarn, pkg-config, libsecret }:
{ lib, stdenv, fetchFromGitHub, nodejs-14_x, python3, callPackage
, fixup_yarn_lock, yarn, pkg-config, libsecret, xcbuild, Security, AppKit }:
stdenv.mkDerivation rec {
pname = "keytar";
@ -11,8 +12,10 @@ stdenv.mkDerivation rec {
sha256 = "0ajvr4kjbyw2shb1y14c0dsghdlnq30f19hk2sbzj6n9y3xa3pmi";
};
nativeBuildInputs = [ nodejs-14_x python3 yarn pkg-config];
buildInputs = [ libsecret ];
nativeBuildInputs = [ nodejs-14_x python3 yarn pkg-config ]
++ lib.optional stdenv.isDarwin xcbuild;
buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
++ lib.optionals stdenv.isDarwin [ Security AppKit ];
npm_config_nodedir = nodejs-14_x;
@ -21,7 +24,8 @@ stdenv.mkDerivation rec {
buildPhase = ''
cp ${./yarn.lock} ./yarn.lock
chmod u+w . ./yarn.lock
export HOME=/tmp
export HOME=$PWD/tmp
mkdir -p $HOME
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
@ -34,6 +38,7 @@ stdenv.mkDerivation rec {
installPhase = ''
shopt -s extglob
rm -rf node_modules
rm -rf $HOME
mkdir -p $out
cp -r ./!(build) $out
install -D -t $out/build/Release build/Release/keytar.node

View File

@ -1,4 +1,4 @@
{ rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs-14_x, python3, yarn, fixup_yarn_lock }:
{ lib, stdenv, rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs-14_x, python3, yarn, fixup_yarn_lock, CoreServices }:
rustPlatform.buildRustPackage rec {
pname = "seshat-node";
@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
sourceRoot = "source/seshat-node/native";
nativeBuildInputs = [ nodejs-14_x python3 yarn ];
buildInputs = [ sqlcipher ];
buildInputs = [ sqlcipher ] ++ lib.optional stdenv.isDarwin CoreServices;
npm_config_nodedir = nodejs-14_x;
@ -23,7 +23,8 @@ rustPlatform.buildRustPackage rec {
buildPhase = ''
cd ..
chmod u+w . ./yarn.lock
export HOME=/tmp
export HOME=$PWD/tmp
mkdir -p $HOME
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
${fixup_yarn_lock}/bin/fixup_yarn_lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
@ -37,6 +38,7 @@ rustPlatform.buildRustPackage rec {
shopt -s extglob
rm -rf native/!(index.node)
rm -rf node_modules
rm -rf $HOME
cp -r . $out
'';

View File

@ -2632,7 +2632,9 @@ in
element = callPackage ../applications/science/chemistry/element { };
element-desktop = callPackage ../applications/networking/instant-messengers/element/element-desktop.nix { };
element-desktop = callPackage ../applications/networking/instant-messengers/element/element-desktop.nix {
inherit (darwin.apple_sdk.frameworks) Security AppKit CoreServices;
};
element-web = callPackage ../applications/networking/instant-messengers/element/element-web.nix {
conf = config.element-web.conf or {};