Skip to content

Commit

Permalink
xorcurses: init at 0.2.2 and 0.2.2-unstable-2023-01-31
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhys-T committed Oct 29, 2024
1 parent 0ff0cef commit f99716a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ in {
asciiportal = callPackage ./pkgs/asciiportal {};
asciiportal-git = callPackage ./pkgs/asciiportal/git.nix {};

xorcurses = callPackage ./pkgs/xorcurses {};
xorcurses-git = callPackage ./pkgs/xorcurses/git.nix {};

powder = callPackage ./pkgs/powder {};

icbm3d = pkgs.icbm3d.overrideAttrs (old: {
Expand Down
14 changes: 14 additions & 0 deletions pkgs/xorcurses/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{stdenv, lib, fetchurl, fetchpatch, ncurses, maintainers}: import ./generic.nix rec {
inherit stdenv lib ncurses maintainers;
version = "0.2.2";
src = fetchurl {
url = "https://web.archive.org/web/20200807032528/http://jwm-art.net/art/archive/XorCurses-${version}.tar.bz2";
hash = "sha256-Us4oxOtNEP1RZo0I4X6eKlTVIPHYZLsrZZ28+OAYeWk=";
};
patches = [(fetchpatch {
name = "0001-fix-multi-defs-error.patch";
url = "https://github.com/jwm-art-net/XorCurses/commit/e6b81ad0b2a211533919f568618bad9720d80dc0.patch";
hash = "sha256-EmIBV9WMyOUc3ZlRp1NI0TGL0qikAjql3t3nesMM5Js=";
})];
homepage = "https://web.archive.org/web/20200924115723/http://jwm-art.net/?p=XorCurses";
}
26 changes: 26 additions & 0 deletions pkgs/xorcurses/generic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{stdenv, lib, version, src, patches ? [], ncurses, homepage, maintainers}: stdenv.mkDerivation rec {
pname = "xorcurses";
inherit version src patches;
postPatch = ''
substituteInPlace Makefile --replace-fail 'CC:=' '#CC:='
for file in *.c; do
sed -E -i 's/mvwprintw\(([^,]+, [^,]+, [^,]+), ([^"][^,)]+)\)/mvwprintw(\1, "%s", \2)/g' "$file"
done
'';
makeFlags = ["PREFIX=$(out)/" "LIBS=-lncurses"];
buildInputs = [ncurses];
preInstall = "mkdir -p \"$out\"/bin";
meta = {
description = "Puzzle game set inside a series of mazes";
longDescription = ''
Based on the game XOR by Astral Software (C) 1987
Xor is a puzzle game set inside a series of mazes.
XorCurses is a console/terminal ASCII character
game written for Linux in C and uses the ncurses
library.
'';
inherit homepage;
license = lib.licenses.gpl3Only;
maintainers = [maintainers.Rhys-T];
};
}
11 changes: 11 additions & 0 deletions pkgs/xorcurses/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{stdenv, lib, fetchFromGitHub, ncurses, maintainers}: import ./generic.nix rec {
inherit stdenv lib ncurses maintainers;
version = "0.2.2-unstable-2023-01-31";
src = fetchFromGitHub {
owner = "jwm-art-net";
repo = "XorCurses";
rev = "fb2372a7a1f639a4129f5a6ccca5a8da3b5eb4c7";
hash = "sha256-Nh3p2VdmRlcOblH4aPm/WoYuFTxLUno1sLoZ6xf315Y=";
};
homepage = "https://github.com/jwm-art-net/XorCurses";
}

0 comments on commit f99716a

Please sign in to comment.