-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathflake.nix
More file actions
75 lines (67 loc) · 2.15 KB
/
Copy pathflake.nix
File metadata and controls
75 lines (67 loc) · 2.15 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
{
description = "Open source implementation of AliceSoft's System 4 game engine for unix-like operating systems";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
outputs = { self, nixpkgs }:
let
# System types to support.
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
# Set up xsystem4 development environment:
# nix develop # create shell environment with dependencies available
devShell = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in with pkgs; pkgs.mkShell {
nativeBuildInputs = [ meson ninja pkg-config ];
buildInputs = [
cglm
SDL2
freetype
libffi
libjpeg
libwebp
libsndfile
glew
readline
chibi
flex
bison
ffmpeg
];
}
);
# Build xsystem4:
# nix build .?submodules=1 # build xsystem4 (outputs to ./result/)
# nix shell .?submodules=1 # create shell environment with xsystem4 available
# Install xsystem4 to user profile:
# nix profile install .?submodules=1
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system}; in {
default = with pkgs; stdenv.mkDerivation rec {
name = "xsystem4";
src = ./.;
mesonAutoFeatures = "auto";
nativeBuildInputs = [ meson ninja pkg-config ];
buildInputs = [
cglm
SDL2
freetype
libffi
libjpeg
libwebp
libsndfile
glew
readline
chibi
flex
bison
ffmpeg
];
};
}
);
};
}