Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
description = "Basic flake for Codename Engine, primarily useful for development";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-compat = {
url = "github:NixOS/flake-compat";
flake = false;
};
};

outputs =
{ nixpkgs, ... }:
let
forEachSystem =
function:
nixpkgs.lib.genAttrs [ "aarch-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ] (
system:
function (
nixpkgs.legacyPackages.${system}.extend (
final: prev: {
# We need to configure mbedtls_2 for Haxe manually, forcing a rebuild with different
# parameters.
mbedtls_2 = prev.mbedtls_2.overrideAttrs {
# ...and that includes removing all known vulnerabilities. As of writing, the only
# assigned vulnerability is that mbedtls_2 is no longer developed. Nix will refuse
# to build packages if they have this value filled in.
meta.knownVulnerabilities = [ ];
# Without this, Nix will attempt to build the package and test it. The tests
# themselves unfortunately fail at the moment, so we need to skip them to use
# mbedtls_2 successfully.
doCheck = false;
};
}
)
)
);
in
{
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell rec {
name = "cne";
buildInputs = with pkgs; [
kdePackages.qttools
openal
libpulseaudio
libvlc
libGL
libx11
libxext
libxinerama
libxi
libxrandr
SDL2
];
nativeBuildInputs = with pkgs; [
haxe
neko
];
shellHook = ''
./building/setup-unix.sh
'';
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
};
});
};
}
54 changes: 12 additions & 42 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
{ }:
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c407032be28ca2236f45c49cfb2b8b3885294f7f.tar.gz";
}) { };

libs =
with pkgs;
[
SDL2
pkg-config
openal
alsa-lib
libvlc
libpulseaudio
libGL
]
++ (with xorg; [
libX11
libXext
libXinerama
libXi
libXrandr
]);
in
pkgs.mkShell {
name = "CodenameEngine";

packages = with pkgs; [
haxe
neko
libsForQt5.qttools
];

buildInputs = libs;

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;

shellHook = ''
source update.sh
'';
}
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url =
lock.nodes.${nodeName}.locked.url
or "https://github.com/NixOS/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
) { src = ./.; }).shellNix