Files
nunuhara_xsystem4/flake.nix
T
Nunuhara Cabbage baae8f5237 Document Windows FFmpeg build, etc.
Statically link FFmpeg on Windows. This requires building a slimmed-down
version of FFmpeg from source. The build process is documented in the
README.

Also add ffmpeg dependency to the nix flake.
2023-04-02 19:34:45 -07:00

76 lines
2.2 KiB
Nix

{
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-22.11";
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
readline81
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
readline81
chibi
flex
bison
ffmpeg
];
};
}
);
};
}