Nethack 3.6.0 => 3.6.7 (#9917)

This commit is contained in:
Ed Reel
2024-06-06 21:46:21 -05:00
committed by GitHub
parent ce72f28f24
commit 85eeb6cdd5
4 changed files with 27 additions and 12 deletions

View File

@@ -0,0 +1,2 @@
/usr/local/bin/nethack
/usr/local/games/nethack

View File

@@ -0,0 +1,2 @@
/usr/local/bin/nethack
/usr/local/games/nethack

View File

@@ -0,0 +1,2 @@
/usr/local/bin/nethack
/usr/local/games/nethack

View File

@@ -3,26 +3,35 @@ require 'package'
class Nethack < Package
description 'Nethack is a classic roguelike. Descend through the dungeon and retrieve the Amulet of Yendor.'
homepage 'https://www.nethack.org/'
version '3.6.0'
version '3.6.7'
license 'nethack'
compatibility 'all'
source_url 'https://github.com/NetHack/NetHack/archive/NetHack-3.6.0_Release.tar.gz'
source_sha256 '5735e4d132d8aec0c49f0e2a72156c7cbe84ea7b5a3153531da61aa660c668a1'
source_url 'https://github.com/NetHack/NetHack.git'
git_hashtag "NetHack-#{version}_Released"
binary_compression 'tar.zst'
def self.patch
# Apply a patch to set a hints file that will work for the current build environment.
system "curl -L 'https://gist.githubusercontent.com/anonymous/77b05c6cd87628ab3cb944e75ecc45b7/raw/d5f327450aa6b4d50cafb5352fad06ed60f91b69/nethack_chromebrew.patch' | patch -p0"
end
binary_sha256({
aarch64: 'f37b6c0eb4c63f3cd51e97b910cbcb2b22b5b7b0bb99052080460d3173ccd16a',
armv7l: 'f37b6c0eb4c63f3cd51e97b910cbcb2b22b5b7b0bb99052080460d3173ccd16a',
i686: 'b19d1508b6a70d8ab2a4b0fcde4a8069b7bd3d3d26bbe2318babe5fce1bcf1eb',
x86_64: '03c389969a9c876c6edd529c51f8f2d128ee0a2965d10fc14f02c6f2e7db3aa1'
})
no_fhs
def self.build
system '/sys/unix/setup.sh', './sys/unix/hints/linux'
ENV['GAME'] = 'nethack'
system 'sys/unix/setup.sh sys/unix/hints/linux'
Dir['**/Makefile'].each do |mkfile|
system "sed -i 's,^HACKDIR=.*$,HACKDIR=#{CREW_PREFIX}/games/lib/nethackdir,g' #{mkfile}"
system "sed -i 's,^PREFIX=\$(wildcard ~)/nh/install,PREFIX=#{CREW_DEST_PREFIX},' #{mkfile}"
system "sed -i 's,\-I\.\./include,-I../include -I#{CREW_PREFIX}/include/ncursesw,' #{mkfile}"
end
system 'make'
end
def self.install
system 'make', "PREFIX=#{CREW_DEST_PREFIX}", 'install'
system 'mkdir', "#{CREW_DEST_PREFIX}/bin/"
system 'sed', '-i', "s|^HACKDIR=.*$|HACKDIR=#{CREW_PREFIX}/games/lib/nethackdir|g", "#{CREW_DEST_PREFIX}/games/nethack"
system 'cp', "#{CREW_DEST_PREFIX}/games/nethack", "#{CREW_DEST_PREFIX}/bin/nethack"
system 'make', 'install'
FileUtils.install "#{CREW_DEST_PREFIX}/games/nethack", "#{CREW_DEST_PREFIX}/bin/nethack", mode: 0o755
end
end