mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 02:04:28 +00:00
40 lines
960 B
Nix
40 lines
960 B
Nix
{ stdenv, pkgs, target-os }:
|
|
|
|
with pkgs;
|
|
with stdenv;
|
|
|
|
let
|
|
targetLinux = {
|
|
"linux" = true;
|
|
"" = isLinux;
|
|
}.${target-os} or false;
|
|
targetDarwin = {
|
|
"macos" = true;
|
|
"" = isDarwin;
|
|
}.${target-os} or false;
|
|
targetWindows = {
|
|
"windows" = true;
|
|
"" = isLinux;
|
|
}.${target-os} or false;
|
|
linuxPlatform = callPackage ./linux { };
|
|
darwinPlatform = callPackage ./macos { };
|
|
windowsPlatform = callPackage ./windows { };
|
|
|
|
in
|
|
{
|
|
buildInputs = [
|
|
cmake
|
|
extra-cmake-modules
|
|
file
|
|
] ++ lib.optional targetLinux linuxPlatform.buildInputs
|
|
++ lib.optional targetDarwin darwinPlatform.buildInputs
|
|
++ lib.optional (! targetWindows) qt5.full
|
|
++ lib.optional targetWindows windowsPlatform.buildInputs;
|
|
shellHook = (if target-os == "windows" then ''
|
|
unset QT_PATH
|
|
'' else ''
|
|
export QT_PATH="${qt5.full}"
|
|
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
|
|
'');
|
|
}
|