docker build

This commit is contained in:
Cadey Ratio 2020-10-21 23:10:45 -04:00
parent a49c44a017
commit 188d91a9ec
4 changed files with 70 additions and 1 deletions

3
.gitignore vendored
View File

@ -77,3 +77,6 @@ vblank
input
*.m64
.env
# Nix
/result

44
default.nix Normal file
View File

@ -0,0 +1,44 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
stdenv.mkDerivation rec {
pname = "sm64pc";
version = "latest";
buildInputs = [
gnumake
python3
audiofile
pkg-config
SDL2
libusb1
glfw3
libgcc
xorg.libX11
xorg.libXrandr
libpulseaudio
alsaLib
glfw
libGL
unixtools.hexdump
clang_10
];
src = ./.;
buildPhase = ''
chmod +x ./extract_assets.py
make -j
'';
installPhase = ''
mkdir -p $out/bin
cp ./build/us_pc/sm64.us.f3dex2e $out/bin/sm64pc
'';
meta = with stdenv.lib; {
description = "Super Mario 64 PC port, requires rom :)";
license = licenses.unfree;
};
}

22
docker.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
site = callPackage ./default.nix { };
dockerImage = pkg:
pkgs.dockerTools.buildLayeredImage {
name = "ghcr.io/xe/sm64pc";
tag = "latest";
contents = [ pkg mesa mesa.drivers mesa_glu mesa_noglu libGL_driver ];
config = {
Cmd = [ "${strace}/bin/strace" "${pkg}/bin/sm64pc" ];
Env = [ "LD_LIBRARY_PATH=/lib" "LIBGL_DRIVERS_PATH=/lib/dri" ];
WorkingDir = "/";
};
};
in dockerImage site

View File

@ -9,7 +9,7 @@
static struct ControllerAPI *controller_implementations[] = {
&controller_recorded_tas,
&controller_gamebridge,
//&controller_gamebridge,
&controller_sdl,
&controller_keyboard,
//&controller_tas_recorder,