47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{
|
|
description = "flake for github:xms0g/nesrx";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nesrx = {
|
|
url = "github:xms0g/nesrx";
|
|
flake = false;
|
|
};
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
};
|
|
|
|
outputs =
|
|
inputs:
|
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
|
imports = [ ];
|
|
|
|
systems = builtins.attrNames inputs.nixpkgs.legacyPackages;
|
|
|
|
perSystem =
|
|
{
|
|
config,
|
|
system,
|
|
pkgs,
|
|
self',
|
|
...
|
|
}:
|
|
{
|
|
packages.default = pkgs.stdenv.mkDerivation {
|
|
name = "nesrx";
|
|
src = "${inputs.nesrx}";
|
|
nativeBuildInputs = with pkgs; [ cmake ];
|
|
cmakeBuildType = "RelWithDebInfo";
|
|
postPatch = ''
|
|
sed -i '1s|^|#include <cstring>\n|' src/main.cpp
|
|
substituteInPlace src/rom.hpp \
|
|
--replace 'm_romfile.open(filename,' 'm_romfile.open(std::string(filename),' \
|
|
--replace 'std::ofstream ofile{m_outfile,' 'std::ofstream ofile{std::string(m_outfile),'
|
|
'';
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -Dm755 nesrx $out/bin/nesrx
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|