-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
90 lines (79 loc) · 2.44 KB
/
Copy pathflake.nix
File metadata and controls
90 lines (79 loc) · 2.44 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
{
description = "A Game Boy emulator written in C.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
};
outputs =
inputs@{
self,
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
perSystem =
{
self',
pkgs,
system,
...
}:
let
inherit (pkgs) lib;
in
{
packages =
let
mkGemu =
{ frontend }:
pkgs.stdenv.mkDerivation {
pname = "gemu";
version = "main";
src = lib.cleanSource ./.;
nativeBuildInputs = with pkgs; [
meson
ninja
pkg-config
unity-test
cjson
ruby
];
buildInputs =
with pkgs;
(lib.optionals (frontend == "sdl3") [ sdl3 ])
++ (lib.optionals (frontend == "raylib") [ raylib ])
++ (lib.optionals (frontend == "opengl") [
libGL
libGLU
libglut
])
++ (lib.optionals (frontend == "sfml") [ csfml ]);
mesonFlags = [
"-Dfrontend=${frontend}"
];
doCheck = true;
meta = with lib; {
description = "A Game Boy emulator written in C.";
homepage = "https://codeberg.org/Grazen0/gemu";
license = licenses.gpl3;
};
};
in
{
gemu = self'.packages.gemu-sdl3;
gemu-sdl3 = mkGemu { frontend = "sdl3"; };
gemu-raylib = mkGemu { frontend = "raylib"; };
gemu-opengl = mkGemu { frontend = "opengl"; };
gemu-sfml = mkGemu { frontend = "sfml"; };
default = self'.packages.gemu;
};
devShells.default = pkgs.mkShell {
inputsFrom = lib.attrValues self'.packages;
packages = with pkgs; [ clang-tools ];
hardeningDisable = [ "fortify" ];
};
};
};
}