feat(build): add nix-shell support

Add a metadata file and build rules to build and test from a development
shell provided by the Nix package manager.
reviewable/pr5946/r1
Emery Hemingway 2019-12-16 06:50:07 +00:00
parent f252816f55
commit faeb699fd0
3 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@ qtox
build-*-Release
build-*-Profile
build-*-Debug
.qtox-wrapped
# Folders
_[Bb]uild*/

View File

@ -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()

2
shell.nix Normal file
View File

@ -0,0 +1,2 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell { inputsFrom = with pkgs; [ qtox ]; }