diff --git a/.gitignore b/.gitignore index 6c788a27c6..849e886afe 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ qtox build-*-Release build-*-Profile build-*-Debug +.qtox-wrapped # Folders _[Bb]uild*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f6d9da221d..ef2e859bcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -714,3 +714,12 @@ target_link_libraries(${PROJECT_NAME} include(Testing) include(Installation) + +if (DEFINED ENV{IN_NIX_SHELL}) + # the qtox binary must be "wrapped" to find the Qt platform plugin + # and other dependencies at runtime + add_custom_command( + TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND nix-shell --run "wrapQtApp ${PROJECT_NAME}") +endif() diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000..e923640936 --- /dev/null +++ b/shell.nix @@ -0,0 +1,2 @@ +{ pkgs ? import { } }: +pkgs.mkShell { inputsFrom = with pkgs; [ qtox ]; }