summaryrefslogtreecommitdiff
path: root/games-action/chickens
diff options
context:
space:
mode:
Diffstat (limited to 'games-action/chickens')
-rw-r--r--games-action/chickens/Manifest6
-rw-r--r--games-action/chickens/chickens-0.2.4-r1.ebuild77
-rw-r--r--games-action/chickens/files/chickens-0.2.4-bitmap.patch33
-rw-r--r--games-action/chickens/files/chickens-0.2.4-settings.patch33
-rw-r--r--games-action/chickens/metadata.xml2
5 files changed, 116 insertions, 35 deletions
diff --git a/games-action/chickens/Manifest b/games-action/chickens/Manifest
index 4ff238821592..e2fe12e6ba1e 100644
--- a/games-action/chickens/Manifest
+++ b/games-action/chickens/Manifest
@@ -1,3 +1,5 @@
+AUX chickens-0.2.4-bitmap.patch 458 BLAKE2B 1ffe37c5fc7ada743018e349966f86d6604d96c8c9d669561fad99edb69931fbd990283c47339b6fc45cb35e5775cb0f86d3cfb13e2afb4a024b200cf91cda7d SHA512 b20eebc218ee08d31b52d11f26dac485285ca1fcfd1574759f154adb0749a7e7af71f920e142bbd0d56959327d3fbca4fe3dbb15c0b8099bfa238c8067a6c6c4
+AUX chickens-0.2.4-settings.patch 800 BLAKE2B d3f1a62e5f5c46687b86ab4655c339ece4d11b3eaafd4e8345c3ec1e216e5955fb4f6cbfda2405339afcf80541fb36af2f237abb2938744d71a79f9f656d2dc2 SHA512 39158ef956d5da5eea33eb7c9c71f71692d5d0d68a43f2ad0034eca1ab3633b37ca5f83fc47b310762194d5d9174baa70f831c39aa7e3516d2f73ff5882239ae
DIST ChickensForLinux-Linux-0.2.4.tar.gz 1455207 BLAKE2B a1388d49ee6291df0cb7f015928fbb2db4e86d611f1beb5513e9152b431991aeb9f0198a371c8391e1b69e2333916809f44000be7d132588f1af265fffd91186 SHA512 d94a70818a766fde443e86184418990d789246c239da01c6c1a2c9e7d8c1d6bb52ed28efbb4ecdb6b079c585e1ba18bc8efcd4f1cbf718ff39757831265c7a78
-EBUILD chickens-0.2.4-r1.ebuild 1444 BLAKE2B 2c9872796180b35a7179bdce21b7081b67c4006f7151d852467b1758183d7845d0f66e08dc9416e9ee0ea7a6f093451ec870bced8a4998766b5bc414b6726150 SHA512 5bd52987949ee9f9400b31cd5c5726002d804555b9abbf868e38c0a810365fb89da94605ca04663c3432841813ec2ee0b57f9c5594d91de3f556623f72e60a00
-MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118
+EBUILD chickens-0.2.4-r1.ebuild 1705 BLAKE2B cb8a300b297eecc45bf1cde13771dcb8fcf96623784b76dd73d04d8fba3e871b2773f6bf89364781df46cbadb0f2523693a1a6564e3d3fc13ff6374a70adc8e2 SHA512 cf0f46bfe494d5273bb4b3ad0afc71813d968f97f456b511addf8280311e4ac56c1720bf52989dbb512225d40e8aab484095fd1caa04b7445c9d56a130d361a9
+MISC metadata.xml 250 BLAKE2B 8d44bd4c6e7d6491273e2015e36ddac74af7b94a124fd240ff030e16430f5c85e53ab812f0e3e94bb2e6d138f39b512bbe01ff98b0081cacc21a02d648ec7643 SHA512 80ac07a3cac10ad2e72e9989a130b7d2073934fe92914a9db2af4d0e769d4bf537770f8faba0654bbd64a7e85ee38cf1f9d03b4b9cd322864b1b2bb35087d610
diff --git a/games-action/chickens/chickens-0.2.4-r1.ebuild b/games-action/chickens/chickens-0.2.4-r1.ebuild
index 4aa9dc2a0d8c..9d9aa34a2387 100644
--- a/games-action/chickens/chickens-0.2.4-r1.ebuild
+++ b/games-action/chickens/chickens-0.2.4-r1.ebuild
@@ -1,62 +1,75 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=8
-inherit desktop
+inherit desktop flag-o-matic toolchain-funcs
MY_P="ChickensForLinux-Linux-${PV}"
+
DESCRIPTION="Target chickens with rockets and shotguns. Funny"
HOMEPAGE="http://www.chickensforlinux.com/"
SRC_URI="http://www.chickensforlinux.com/${MY_P}.tar.gz"
+S="${WORKDIR}/${PN}"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE=""
-RESTRICT="mirror bindist"
+RESTRICT="bindist mirror"
-DEPEND="acct-group/gamestat
- <media-libs/allegro-5"
-RDEPEND="${DEPEND}"
+RDEPEND="
+ acct-group/gamestat
+ media-libs/allegro:0[X]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
-S=${WORKDIR}/${PN}
+PATCHES=(
+ "${FILESDIR}"/${P}-bitmap.patch
+ "${FILESDIR}"/${P}-settings.patch
+)
src_prepare() {
default
- sed -i \
- -e "s:HighScores:/var/games//${PN}/HighScores:" \
- -e "s:....\(.\)\(_\)\(.*.4x0\)\(.\):M\4\2\x42\x6Fn\1s\2:" \
- highscore.cpp HighScores || die
- sed -i \
- -e "s:options.cfg:/etc/${PN}/options.cfg:" \
- -e "s:\"sound/:\"/usr/share/${PN}/sound/:" \
- -e "s:\"dat/:\"/usr/share/${PN}/dat/:" \
- main.cpp README || die
- sed -i \
- -e '/^CPPFLAGS/d' \
- -e 's:g++:\\$(CXX) \\$(CXXFLAGS) \\$(LDFLAGS):' \
- configure || die
+ # sed kept for historical reasons
+ sed -i 's|....\(.\)\(_\)\(.*.4x0\)\(.\)|M\4\2\x42\x6Fn\1s\2|' HighScores || die
+
+ sed -i "s|HighScores|${EPREFIX}/var/games/${PN}.hs|" highscore.cpp || die
+
+ sed -e "s|options.cfg|${EPREFIX}/etc/${PN}/&|" \
+ -e "s|sound/|${EPREFIX}/usr/share/${PN}/&|" \
+ -e "s|dat/|${EPREFIX}/usr/share/${PN}/&|" \
+ -i main.cpp README || die
}
src_configure() {
- # econf (sometimes) fails, see https://bugs.gentoo.org/588544
- bash ./configure || die
+ : # this configure file does no good
+}
+
+src_compile() {
+ local obj=([!m]*.cpp)
+ tc-export CXX
+ append-cppflags $($(tc-getPKG_CONFIG) --cflags allegro || die)
+ append-libs $($(tc-getPKG_CONFIG) --libs allegro || die)
+ emake -E "main: ${obj[*]/.cpp/.o}" LDLIBS="${LIBS}"
}
src_install() {
- dobin ${PN}
+ newbin main ${PN}
+ dodoc AUTHOR README
+
insinto /usr/share/${PN}
doins -r dat sound
- dodoc AUTHOR README
- insinto /var/games/${PN}
- doins HighScores
+
insinto /etc/${PN}
doins options.cfg
- make_desktop_entry ${PN} Chickens
- fowners root:gamestat /usr/bin/${PN} /var/games/${PN}/HighScores
- fperms 2755 /usr/bin/${PN}
- fperms 660 /var/games/${PN}/HighScores
+ insinto /var/games
+ newins HighScores ${PN}.hs
+
+ fowners :gamestat /usr/bin/${PN} /var/games/${PN}.hs
+ fperms g+s /usr/bin/${PN}
+ fperms 660 /var/games/${PN}.hs
+
+ make_desktop_entry ${PN} ${PN^} applications-games
}
diff --git a/games-action/chickens/files/chickens-0.2.4-bitmap.patch b/games-action/chickens/files/chickens-0.2.4-bitmap.patch
new file mode 100644
index 000000000000..3156ebc7d2ef
--- /dev/null
+++ b/games-action/chickens/files/chickens-0.2.4-bitmap.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/638246
+--- a/gem.h
++++ b/gem.h
+@@ -22,3 +22,2 @@
+
+- BITMAP image;
+ void draw();
+@@ -33,2 +32,3 @@
+ bool active;
++ BITMAP image;
+ };
+--- a/smoke.cpp
++++ b/smoke.cpp
+@@ -40,3 +40,3 @@
+
+-int SMOKE::release() {
++void SMOKE::release() {
+
+@@ -62,3 +62,3 @@
+
+-int SMOKE::draw() {
++void SMOKE::draw() {
+
+--- a/smoke.h
++++ b/smoke.h
+@@ -32,5 +32,5 @@
+
+- int draw();
++ void draw();
+ int run();
+- int release();
++ void release();
+
diff --git a/games-action/chickens/files/chickens-0.2.4-settings.patch b/games-action/chickens/files/chickens-0.2.4-settings.patch
new file mode 100644
index 000000000000..393e6ef5a874
--- /dev/null
+++ b/games-action/chickens/files/chickens-0.2.4-settings.patch
@@ -0,0 +1,33 @@
+Use ifstream so it can read the system's config, and default to windowed
+mode (may crash depending on display, and is harder to exit from).
+--- a/options.cfg
++++ b/options.cfg
+@@ -36,7 +36,7 @@
+ VOLUME 255 # 255 is full volume
+
+ # --- video ---
+-FULLSCREEN 1 # run in fullscreen (1) or windowed mode (0)
++FULLSCREEN 0 # run in fullscreen (1) or windowed mode (0)
+
+ # --- smoke ---
+ TRANSLUCENT_SMOKE 1 # set to 0 if speed is an issue
+--- a/settings.cpp
++++ b/settings.cpp
+@@ -4,7 +4,7 @@
+
+ int load_config(char* path) {
+
+- fstream file(path);
++ ifstream file(path);
+
+ string key;
+ char comment[255];
+@@ -82,7 +82,7 @@
+ CHANCE_OF_GEM = 25;
+ CHICKEN_SPEED = 5;
+ CHUNKS_PER_CHICKEN = 20;
+- FULLSCREEN = 1;
++ FULLSCREEN = 0;
+ GAME_SPEED_OFFSET = 0;
+ GRAVITY = 0.7;
+ MAX_CHICKENS = 80;
diff --git a/games-action/chickens/metadata.xml b/games-action/chickens/metadata.xml
index 78274e0fa550..1c3ba213c494 100644
--- a/games-action/chickens/metadata.xml
+++ b/games-action/chickens/metadata.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>games@gentoo.org</email>