2019-03-05 17:36:40 +00:00
|
|
|
{ stdenv, pkgs, target-os }:
|
2019-02-15 08:04:03 +00:00
|
|
|
|
|
|
|
with pkgs;
|
2019-03-21 16:56:22 +00:00
|
|
|
with stdenv;
|
2019-02-15 08:04:03 +00:00
|
|
|
|
|
|
|
let
|
2019-03-05 17:36:40 +00:00
|
|
|
targetLinux = {
|
|
|
|
"linux" = true;
|
2019-04-03 11:06:42 +00:00
|
|
|
"all" = isLinux;
|
2019-03-05 17:36:40 +00:00
|
|
|
}.${target-os} or false;
|
2019-03-21 16:56:22 +00:00
|
|
|
targetDarwin = {
|
|
|
|
"macos" = true;
|
2019-04-12 08:36:30 +00:00
|
|
|
"darwin" = true;
|
2019-04-03 11:06:42 +00:00
|
|
|
"all" = isDarwin;
|
2019-03-21 16:56:22 +00:00
|
|
|
}.${target-os} or false;
|
2019-03-05 17:36:40 +00:00
|
|
|
targetWindows = {
|
|
|
|
"windows" = true;
|
2019-04-03 11:06:42 +00:00
|
|
|
"all" = isLinux;
|
2019-03-05 17:36:40 +00:00
|
|
|
}.${target-os} or false;
|
2019-03-21 16:56:22 +00:00
|
|
|
linuxPlatform = callPackage ./linux { };
|
|
|
|
darwinPlatform = callPackage ./macos { };
|
2019-02-15 08:04:03 +00:00
|
|
|
windowsPlatform = callPackage ./windows { };
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
buildInputs = [
|
|
|
|
cmake
|
|
|
|
extra-cmake-modules
|
|
|
|
file
|
2019-04-03 11:06:42 +00:00
|
|
|
] ++ lib.optionals targetLinux linuxPlatform.buildInputs
|
|
|
|
++ lib.optionals targetDarwin darwinPlatform.buildInputs
|
|
|
|
++ lib.optionals targetWindows windowsPlatform.buildInputs
|
|
|
|
++ lib.optional (! targetWindows) qt5.full;
|
2019-03-21 16:56:22 +00:00
|
|
|
shellHook = (if target-os == "windows" then ''
|
|
|
|
unset QT_PATH
|
|
|
|
'' else ''
|
2019-02-15 08:04:03 +00:00
|
|
|
export QT_PATH="${qt5.full}"
|
2019-04-03 22:05:59 +00:00
|
|
|
export QT_BASEBIN_PATH="${qt5.qtbase.bin}"
|
2019-02-15 08:04:03 +00:00
|
|
|
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
|
2019-04-03 22:05:59 +00:00
|
|
|
'') +
|
|
|
|
lib.optionalString targetLinux linuxPlatform.shellHook +
|
|
|
|
lib.optionalString targetDarwin darwinPlatform.shellHook +
|
|
|
|
lib.optionalString targetWindows windowsPlatform.shellHook;
|
2019-02-15 08:04:03 +00:00
|
|
|
}
|