about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/element
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.de>2021-08-04 11:09:56 +0200
committerGitHub <noreply@github.com>2021-08-04 11:09:56 +0200
commit15af01b456cafbe9ce8cb4098f850daf02fc7b7e (patch)
treec63a922f8105cd6f8182b7bd387e9337a25fe4d7 /pkgs/applications/networking/instant-messengers/element
parentf09a770d9c938fe2986fead7d96af5743eefe516 (diff)
element-desktop: fix darwin build (#132635)
Add Frameworks to native dependencies

Signed-off-by: Finn Behrens <me@kloenk.dev>
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/element')
-rw-r--r--pkgs/applications/networking/instant-messengers/element/element-desktop.nix7
-rw-r--r--pkgs/applications/networking/instant-messengers/element/keytar/default.nix13
-rw-r--r--pkgs/applications/networking/instant-messengers/element/seshat/default.nix8
3 files changed, 19 insertions, 9 deletions
diff --git a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
index 60c6f33284771..a873af6d2ef60 100644
--- a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
+++ b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix
@@ -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
diff --git a/pkgs/applications/networking/instant-messengers/element/keytar/default.nix b/pkgs/applications/networking/instant-messengers/element/keytar/default.nix
index 87ef174271dc3..f848601874a43 100644
--- a/pkgs/applications/networking/instant-messengers/element/keytar/default.nix
+++ b/pkgs/applications/networking/instant-messengers/element/keytar/default.nix
@@ -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
diff --git a/pkgs/applications/networking/instant-messengers/element/seshat/default.nix b/pkgs/applications/networking/instant-messengers/element/seshat/default.nix
index 6dbd15efe7243..ae9dd96228b5c 100644
--- a/pkgs/applications/networking/instant-messengers/element/seshat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/element/seshat/default.nix
@@ -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
   '';