forked from AhmedAmrNabil/arena-rush
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
109 lines (94 loc) · 2.42 KB
/
Copy pathflake.nix
File metadata and controls
109 lines (94 loc) · 2.42 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
description = "Arena Rush - A simple OpenGL game built with C++ and CMake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
self.submodules = true;
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
packageName = "ArenaRush";
pkgs = import nixpkgs { inherit system; };
buildInputs = with pkgs; [
# libraries
libGL
libffi
# Audio
pipewire
# extra precompiled libs
openal-soft
bullet
glfw
assimp
zlib
# Wayland
wayland
wayland-protocols
libxkbcommon
egl-wayland
libdecor
wayland-scanner
extra-cmake-modules # for wayland
# X11
libx11
libxcursor
libxrandr
libxi
libxinerama
];
nativeBuildInputs = with pkgs; [
cmake
ninja
pkg-config
makeWrapper
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
in
{
devShells.default = pkgs.mkShell {
inherit buildInputs nativeBuildInputs LD_LIBRARY_PATH;
USE_SYSTEM_LIBS = "ON";
packages = with pkgs; [
# helper
just
powershell
glslang
just-lsp
ccache
clang-tools
gdb
# provides update-desktop-database for testing application.desktop file
desktop-file-utils
];
};
packages = {
default = self.packages.${system}.opengl_app;
opengl_app = pkgs.stdenv.mkDerivation {
pname = packageName;
version = "0.1.0";
src = self;
inherit buildInputs nativeBuildInputs;
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DGLFW_BUILD_WAYLAND=1"
"-DGLFW_BUILD_X11=1"
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
"-DUSE_SYSTEM_LIBS=ON"
];
installPhase = ''
cmake --install . --prefix $out
wrapProgram $out/bin/ArenaRush \
--suffix LD_LIBRARY_PATH : ${LD_LIBRARY_PATH}
'';
};
};
}
);
}