init
This commit is contained in:
commit
85d45bf356
1 changed files with 126 additions and 0 deletions
47
flake.nix
Normal file
47
flake.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue