Skip to content

Commit

Permalink
games-kids/lletters: fix build and crash on startup
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/708540
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Alexey Sokolov <[email protected]>
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
DarthGandalf authored and thesamesam committed Oct 15, 2020
1 parent 1716826 commit cea071f
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
41 changes: 41 additions & 0 deletions games-kids/lletters/files/lletters-0.1.95-fno-common.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff -r edda3caf942c libqdwav/wav_lib.h
--- a/libqdwav/wav_lib.h Sat Oct 03 19:10:00 2020 +0000
+++ b/libqdwav/wav_lib.h Sat Oct 03 19:12:33 2020 +0000
@@ -29,11 +29,11 @@
char head[43];
} wav_sig;

-buffmem_desc binfo;
-count_info cinfo;
+extern buffmem_desc binfo;
+extern count_info cinfo;

-int dsp_fd;
-int *buffer;
+extern int dsp_fd;
+extern int *buffer;

short get_wav_format (wav_sig *info);
int open_wav (char *header, char file_name[]);
@@ -47,4 +47,4 @@
int init_parm (int argc, char *argv[], wav_sig *file_info);
int open_wav_rec (wav_sig *info);

-int bsize;
+extern int bsize;
diff -r edda3caf942c libqdwav/wav_read.c
--- a/libqdwav/wav_read.c Sat Oct 03 19:10:00 2020 +0000
+++ b/libqdwav/wav_read.c Sat Oct 03 19:12:33 2020 +0000
@@ -6,7 +6,11 @@
#include <sys/stat.h>
#include "wav_lib.h"

-
+buffmem_desc binfo;
+count_info cinfo;
+int dsp_fd;
+int *buffer;
+int bsize;

/* wav header is 44 bytes long */
int open_wav(char *header, char file_name[]){
14 changes: 14 additions & 0 deletions games-kids/lletters/files/lletters-0.1.95-nolang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Don't crash when LANG is not set

--- lletters-0.1.95/lln.c 2020-10-03 20:22:43.470743688 +0100
+++ lletters-0.1.95/lln.c 2020-10-03 20:31:03.322335396 +0100
@@ -138,7 +138,8 @@ main (int argc, char *argv[])
/* End change by Gopal Narayanan */

/* Change by Lalo Martins, Feb 27 1999: */
- lang = strtok(getenv ("LANG"), "_");
+ char* envlang = getenv("LANG");
+ lang = strtok(envlang ? envlang : "", "_");
// lang = strtok(lang, "_");

if (!lang)
55 changes: 55 additions & 0 deletions games-kids/lletters/lletters-0.1.95-r4.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop

PATCH_LEVEL=3

DESCRIPTION="Game that helps young kids learn their letters and numbers"
HOMEPAGE="http://lln.sourceforge.net"
SRC_URI="mirror://debian/pool/main/l/${PN}/${PN}_${PV}+gtk2.orig.tar.gz
mirror://debian/pool/main/l/${PN}/${PN}_${PV}+gtk2-${PATCH_LEVEL}.diff.gz
mirror://sourceforge/lln/${PN}-media-0.1.9a.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="nls"

RDEPEND="
x11-libs/gtk+:2
nls? ( virtual/libintl )
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
"

PATCHES=(
"${WORKDIR}"/${PN}_${PV}+gtk2-${PATCH_LEVEL}.diff
"${FILESDIR}"/${P}-build-2.patch
"${FILESDIR}"/${P}-underlink.patch
"${FILESDIR}"/${P}-make-382.patch
"${FILESDIR}/${P}-fno-common.patch"
"${FILESDIR}/${P}-nolang.patch"
)

src_prepare() {
default

cp -r "${WORKDIR}"/{images,sounds} . || die
}

src_configure() {
econf $(use_enable nls)
}

src_install() {
default
newdoc debian/changelog ChangeLog.debian
doicon debian/${PN}.xpm
make_desktop_entry ${PN} "Linux Letters and Numbers" ${PN}
}

0 comments on commit cea071f

Please sign in to comment.