Created
July 7, 2016 22:47
-
-
Save daniel-j-h/9a899c1a9fbe5d867f289aba2fcc47e4 to your computer and use it in GitHub Desktop.
Nix C++ compiler, CMake, Boost skeleton --- stable ABI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nix skeleton for compiler, cmake, boost. | |
# Dependencies (boost and others you specify) are getting built with selectec compiler (for ABI compatibility). | |
# Examples: | |
# nix-shell --argstr compiler gcc5 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
# nix-shell --argstr compiler gcc6 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
# nix-shell --argstr compiler clang_38 --run 'mkdir build && cd build && cmake .. && cmake --build .' | |
{ nixpkgs ? import <nixpkgs> {}, compiler ? "gcc6" }: | |
let | |
stdenv = nixpkgs.overrideCC nixpkgs.stdenv nixpkgs.${compiler}; | |
pkgs = nixpkgs.overridePackages (self: super: { | |
boost = super.boost.override { stdenv = stdenv; }; | |
}); | |
in rec { | |
myProject = stdenv.mkDerivation { | |
name = "myProject"; | |
nativeBuildInputs = [ pkgs.cmake ]; | |
buildInputs = [ pkgs.boost ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment