mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
meritous: reenable stack protection and apply the proposed patch
Instead of applying `sed` locally let's apply the patch pending upstream inclusion.
This commit is contained in:
parent
4a21427ac9
commit
1472953abb
1 changed files with 15 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
lib,
|
||||
stdenv,
|
||||
fetchFromGitLab,
|
||||
fetchpatch,
|
||||
SDL,
|
||||
SDL_image,
|
||||
SDL_mixer,
|
||||
|
@ -19,13 +20,20 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
hash = "sha256-6KK2anjX+fPsYf4HSOHQ0EQBINqZiVbxo1RmBR6pslg=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix stack overflow on too long files:
|
||||
# https://gitlab.com/meritous/meritous/-/merge_requests/5
|
||||
(fetchpatch {
|
||||
name = "fix-overflow.patch";
|
||||
url = "https://gitlab.com/meritous/meritous/-/commit/68029f02ccaea86fb96d6dd01edb269ac3e6eff0.patch";
|
||||
hash = "sha256-YRV0cEcn6nEJUdHF/cheezNbsgZmjy0rSUw0tuhUYf0=";
|
||||
})
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "prefix=/usr/local" "prefix=$out" \
|
||||
--replace sdl-config ${lib.getDev SDL}/bin/sdl-config
|
||||
|
||||
substituteInPlace src/audio.c \
|
||||
--replace "filename[64]" "filename[256]"
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
|
@ -36,15 +44,14 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -m 555 -D meritous $out/bin/meritous
|
||||
mkdir -p $out/share/meritous
|
||||
cp -r dat/* $out/share/meritous/
|
||||
'';
|
||||
|
||||
hardeningDisable = [
|
||||
"stackprotector"
|
||||
"fortify"
|
||||
];
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Action-adventure dungeon crawl game";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue