forked from BlazingRenderer/BRender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (44 loc) · 1.78 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
description = "BRender";
outputs = { self, nixpkgs, ... }: let
mkPackages = { system }: let
pkgs = import nixpkgs { inherit system; };
in rec {
brender-samples = pkgs.callPackage ./samples.nix {
version = self.lastModifiedDate;
};
brender-samples-clang = brender-samples.override { stdenv = pkgs.clangStdenv; };
brender = pkgs.callPackage ./default.nix {
version = self.lastModifiedDate;
};
default = brender;
};
mkCross = { crossSystem }: let
crossPackages = import nixpkgs {
inherit crossSystem;
system = "x86_64-linux";
};
in crossPackages.callPackage ./default.nix {
version = self.lastModifiedDate;
SDL2 = crossPackages.SDL2.override {
withStatic = crossPackages.hostPlatform.isWindows;
};
};
mkShells = packages: builtins.mapAttrs (k: v: v.overrideAttrs(old: {
hardeningDisable = [ "all" ];
nativeBuildInputs = old.nativeBuildInputs ++ v.devTools;
})) packages;
in {
packages.x86_64-linux = (mkPackages { system = "x86_64-linux"; }) // {
brender-samples-win32 = mkCross { crossSystem = nixpkgs.lib.systems.examples.mingw32; };
brender-samples-win64 = mkCross { crossSystem = nixpkgs.lib.systems.examples.mingwW64; };
};
packages.x86_64-darwin = mkPackages { system = "x86_64-darwin"; };
packages.aarch64-linux = mkPackages { system = "aarch64-linux"; };
packages.aarch64-darwin = mkPackages { system = "aarch64-darwin"; };
devShells.x86_64-linux = mkShells self.packages.x86_64-linux;
devShells.aarch64-linux = mkShells self.packages.aarch64-linux;
devShells.x86_64-darwin = mkShells self.packages.x86_64-darwin;
devShells.aarch64-darwin = mkShells self.packages.aarch64-darwin;
};
}