]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
nix: support compiler override
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 22 Jul 2017 11:54:54 +0000 (21:54 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 22 Jul 2017 11:54:54 +0000 (21:54 +1000)
default.nix

index 9e8c87e4a963d3f010235cd1ec401d92381eab30..e0303cdfe9786b27a216ae673793338d8eae4992 100644 (file)
@@ -1,11 +1,14 @@
 # nix-shell -A xonotic
 # nix-shell -A xonotic
+# --argstr cc clang
 {
     nixpkgs ? <nixpkgs>,
 {
     nixpkgs ? <nixpkgs>,
-    pkgs ? (import nixpkgs) {}
+    pkgs ? (import nixpkgs) {},
+    cc ? null,
 }:
 with pkgs;
 let
     VERSION = "0.8.2";
 }:
 with pkgs;
 let
     VERSION = "0.8.2";
+    stdenv = if (cc != null) then overrideCC pkgs.stdenv pkgs."${cc}" else pkgs.stdenv;
     targets = rec {
         xonotic = stdenv.mkDerivation rec {
             name = "xonotic-${version}";
     targets = rec {
         xonotic = stdenv.mkDerivation rec {
             name = "xonotic-${version}";