Browse Source

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 5 years ago
parent
commit
faeb699fd0
  1. 1
      .gitignore
  2. 9
      CMakeLists.txt
  3. 2
      shell.nix

1
.gitignore vendored

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

9
CMakeLists.txt

@ -714,3 +714,12 @@ target_link_libraries(${PROJECT_NAME} @@ -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

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