Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203787 - app-mobilephone/gnokii-0.6.22-r1 fails to build
Summary: app-mobilephone/gnokii-0.6.22-r1 fails to build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Mobile Phone Developers (INACTIVE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-30 17:52 UTC by giavoltor
Modified: 2008-01-01 16:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gnokii-0.6.22-locale.patch (gnokii-0.6.22-locale.patch,390 bytes, patch)
2007-12-30 18:55 UTC, Alin Năstac (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description giavoltor 2007-12-30 17:52:37 UTC
Build of gnokii-0.6.22-r1 fails every time.

Reproducible: Always

Steps to Reproduce:
1. emerge gnokii
[ebuild     U ] app-mobilephone/gnokii-0.6.22-r1 [0.6.19] USE="X bluetooth ical irda mysql nls sms usb -debug -postgres"
Actual Results:  
Here are the last 50 lines of the build log:
# cat build.log | tail -n 50
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c vcal.c  -fPIC -DPIC -o .libs/vcal.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c vcal.c -o vcal.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gnvcal.lo -c gnvcal.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gnvcal.c  -fPIC -DPIC -o .libs/gnvcal.o
vcal.lx: In function 'yylex':
vcal.lx:163: warning: statement with no effect
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gnvcal.c -o gnvcal.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o ldif.lo -c ldif.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c ldif.c  -fPIC -DPIC -o .libs/ldif.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c ldif.c -o ldif.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-networks.lo -c gsm-networks.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-networks.c  -fPIC -DPIC -o .libs/gsm-networks.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-networks.c -o gsm-networks.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-filetypes.lo -c gsm-filetypes.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-filetypes.c  -fPIC -DPIC -o .libs/gsm-filetypes.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-filetypes.c -o gsm-filetypes.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o readmidi.lo -c readmidi.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c readmidi.c  -fPIC -DPIC -o .libs/readmidi.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c readmidi.c -o readmidi.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-ringtones.lo -c gsm-ringtones.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-ringtones.c  -fPIC -DPIC -o .libs/gsm-ringtones.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-ringtones.c -o gsm-ringtones.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-bitmaps.lo -c gsm-bitmaps.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-bitmaps.c  -fPIC -DPIC -o .libs/gsm-bitmaps.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-bitmaps.c -o gsm-bitmaps.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-sms.lo -c gsm-sms.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-sms.c  -fPIC -DPIC -o .libs/gsm-sms.o
gsm-sms.c: In function 'gn_sms2mbox':
gsm-sms.c:1756: warning: implicit declaration of function 'setlocale'
gsm-sms.c:1756: error: 'LC_ALL' undeclared (first use in this function)
gsm-sms.c:1756: error: (Each undeclared identifier is reported only once
gsm-sms.c:1756: error: for each function it appears in.)
gsm-sms.c:1756: warning: assignment makes pointer from integer without a cast
gmake[1]: *** [gsm-sms.lo] Error 1
gmake[1]: Leaving directory `/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22/common'
make: *** [common] Error 2
 * 
 * ERROR: app-mobilephone/gnokii-0.6.22-r1 failed.
 * Call stack:
 *               ebuild.sh, line   46:  Called src_compile
 *             environment, line 3226:  Called die
 * The specific snippet of code:
 *       emake -j1 || diefunc "$FUNCNAME" "$LINENO" "$?" "make failed";
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/environment'.
 * 


Portage 2.1.4_rc11 (default-linux/amd64/2007.0/desktop, gcc-4.2.2, glibc-2.7-r1, 2.6.23-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.23-gentoo-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3600+
Timestamp of tree: Sun, 30 Dec 2007 13:16:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.3
dev-lang/python:     2.5.1-r4
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18.50.0.3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O0 -pipe -g -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O0 -pipe -g -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks installsources metadata-transfer nostrip parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirrors.ludost.net/gentoo"
LANG="bg_BG"
LC_ALL="bg_BG"
LINGUAS="en bg de ru"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acl acpi aiglx alsa amd64 amr apache2 asf avahi bash-completion bcmath berkdb bitmap-fonts bluetooth bzip2 cairo cddb cdparanoia cdr cgi cli cracklib crypt ctype cups curl dbus dga doc dri dts dv dvb dvd dvdr dvdread eds emboss encode esd evo examples exif expat fam ffmpeg firefox flac flatfile fortran ftp gd gdbm gif gmp gnome gpm graphviz gs gstreamer gtk gtkhtml hal iconv imagemagick imap imlib inifile iodbc ipod ipv6 irda isdnlog java javascript jbig jpeg kerberos lcms lirc lua mad memlimit mhash midi mikmod ming mmx mmxext mng motif mozdevelop mozilla mp3 mp4 mp4live mpeg mudflap musepack mysql ncurses netboot nfs nls nptl nptlonly nsplugin odbc offensive ogg openal opengl openmp oss pam pango pcmcia pcntl pcre pdf perl php png posix pppd python qt3support qt4 quicktime readline realmedia reflection samba scanner sdl session slang sndfile snmp soap sockets speex spell spl sqlite sse sse2 ssl startup-notification svg sysvipc tcl tcpd theora threads tidy tiff tk truetype truetype-fonts type1-fonts unicode urandom usb v4l v4l2 vim-syntax vorbis wifi wmf x264 xcomposite xine xinerama xinetd xml xmlrpc xorg xpm xsl xslt xv xvid xvmc zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en bg de ru" LIRC_DEVICES="devinput" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2007-12-30 18:55:14 UTC
Created attachment 139646 [details, diff]
gnokii-0.6.22-locale.patch

Try this patch and see if it fixes your problem.
Comment 2 giavoltor 2007-12-31 02:04:27 UTC
(In reply to comment #1)

> gnokii-0.6.22-locale.patch
> Try this patch and see if it fixes your problem.

Sorry, the patch doesn't seem to work, BUT the problem may be with me. Since I was not sure what to do with the patch, I followed the instructions from this guide: http://www.gentoo.org/doc/en/bugzilla-howto.xml.

I added PORTDIR_OVERLAY="/usr/local/portage" to my /etc/make.conf, created file gnokii-0.6.22-locale.patch in /usr/local/portage/app-mobilephone/gnokii/files/, copied and edited the gnokii-0.6.22-r1.ebuild from /usr/portage and ran ebuild digest on it. emerge gnokii told me it was applying the patch. If I did something wrong, please correct me and I will test again. However, looking at /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22/common/gsm-sms.c the patch seems applied. Here is the new output:

# emerge -av gnokii

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] app-mobilephone/gnokii-0.6.22-r1 [0.6.19] USE="X bluetooth ical irda mysql nls sms usb -debug -postgres" LINGUAS="de%* -cs% -et% -fi% -fr% -it% -nl% -pl% -pt% -sk% -sl% -sv% -zh_CN%" 0 kB [0=>1]

Total: 1 package (1 upgrade), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/local/portage


 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/2.6.23-gentoo-r5/build
 * Found sources for kernel version:
 *     2.6.23-gentoo-r5
 * Checking for suitable kernel configuration options...  [ ok ]
>>> Unpacking source...
>>> Unpacking gnokii-0.6.22.tar.bz2 to /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work
 * Applying gnokii-0.6.22-locale.patch ...  [ ok ]
 * Running autoconf ...  [ ok ]
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22 ...
 * econf: updating gnokii-0.6.22/config/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating gnokii-0.6.22/config/config.sub with /usr/share/gnuconfig/config.sub
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-nls --enable-libical --enable-libusb --enable-irda --enable-bluetooth --with-x --disable-debug --disable-xdebug --disable-rlpdebug --enable-security --disable-unix98test --libdir=/usr/lib64 --build=x86_64-pc-linux-gnu
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes

........

 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c readmidi.c  -fPIC -DPIC -o .libs/readmidi.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c readmidi.c -o readmidi.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-ringtones.lo -c gsm-ringtones.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-ringtones.c  -fPIC -DPIC -o .libs/gsm-ringtones.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-ringtones.c -o gsm-ringtones.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-bitmaps.lo -c gsm-bitmaps.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-bitmaps.c  -fPIC -DPIC -o .libs/gsm-bitmaps.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-bitmaps.c -o gsm-bitmaps.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden   -I../include   -o gsm-sms.lo -c gsm-sms.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I../include -c gsm-sms.c  -fPIC -DPIC -o .libs/gsm-sms.o
gsm-sms.c: In function 'gn_sms2mbox':
gsm-sms.c:1760: warning: implicit declaration of function 'setlocale'
gsm-sms.c:1760: error: 'LC_ALL' undeclared (first use in this function)
gsm-sms.c:1760: error: (Each undeclared identifier is reported only once
gsm-sms.c:1760: error: for each function it appears in.)
gsm-sms.c:1760: warning: assignment makes pointer from integer without a cast
gmake[1]: *** [gsm-sms.lo] Error 1
gmake[1]: Leaving directory `/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22/common'
make: *** [common] Error 2
 * 
 * ERROR: app-mobilephone/gnokii-0.6.22-r1 failed.
 * Call stack:
 *               ebuild.sh, line   46:  Called src_compile
 *             environment, line 3235:  Called die
 * The specific snippet of code:
 *       emake -j1 || diefunc "$FUNCNAME" "$LINENO" "$?" "make failed";
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/environment'.
 * This ebuild is from an overlay: '/usr/local/portage/'
 * 
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 07:31:11 UTC
No, you got it wrong. You must do the following:
  cd /usr/portage/app-mobilephone/gnokii
  ebuild gnokii-0.6.22-r1.ebuild clean unpack
  cd /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22
  patch -p1 < path_to_the_patch
  cd /usr/portage/app-mobilephone/gnokii
  ebuild gnokii-0.6.22-r1.ebuild compile
Comment 4 giavoltor 2007-12-31 11:43:01 UTC
(In reply to comment #3)

>   cd /usr/portage/app-mobilephone/gnokii
>   ebuild gnokii-0.6.22-r1.ebuild clean unpack
>   cd /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22
>   patch -p1 < path_to_the_patch
>   cd /usr/portage/app-mobilephone/gnokii
>   ebuild gnokii-0.6.22-r1.ebuild compile

Thank you for the detailed instructions. I removed the PORTDIR_OVERLAY variable from my /etc/make.conf and followed them exactly as written above, but I still have no luck. This is how the patched common/gsm-sms.c looks like:

  Library for parsing and creating Short Messages (SMS).

*/

#include <stdlib.h>
#include <string.h>
#include <time.h>

#ifdef ENABLE_NLS
#  include <locale.h>
#endif

#include "gnokii-internal.h"
#include "gnokii.h"

#include "sms-nokia.h"

#undef ERROR
#define ERROR() do { if (error != GN_ERR_NONE) return error; } while (0)

struct sms_udh_data {
        unsigned int length;
        char *header;
};

And this is the build log. There seems to be no change to the better.

 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/2.6.23-gentoo-r5/build
 * Found sources for kernel version:
 *     2.6.23-gentoo-r5
 * Checking for suitable kernel configuration options...  [ ok ]
>>> Unpacking source...
>>> Unpacking gnokii-0.6.22.tar.bz2 to /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work
 * Running autoconf ...  [ ok ]
>>> Source unpacked.
 * Checking for suitable kernel configuration options...  [ ok ]
>>> Checking gnokii-0.6.22.tar.bz2's mtime...
>>> WORKDIR is up-to-date, keeping...
>>> Compiling source in /var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22 ...
 * econf: updating gnokii-0.6.22/config/config.guess with /usr/share/gnuconfig/config.guess
 * econf: updating gnokii-0.6.22/config/config.sub with /usr/share/gnuconfig/config.sub
./configure --prefix=/usr --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sy
sconfdir=/etc --localstatedir=/var/lib --enable-nls --enable-libical --enable-libusb --enable-irda --enable-bluetooth --with-x -
-disable-debug --disable-xdebug --disable-rlpdebug --enable-security --disable-unix98test --libdir=/usr/lib64 --build=x86_64-pc-linux-gnu
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for C compiler default output file name... a.out

.........................

./include -c gsm-ringtones.c -o gsm-ringtones.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-poi
nter-sign -fvisibility=hidden   -I../include   -o gsm-bitmaps.lo -c gsm-bitmaps.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I.
./include -c gsm-bitmaps.c  -fPIC -DPIC -o .libs/gsm-bitmaps.o
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I.
./include -c gsm-bitmaps.c -o gsm-bitmaps.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-poi
nter-sign -fvisibility=hidden   -I../include   -o gsm-sms.lo -c gsm-sms.c
 x86_64-pc-linux-gnu-gcc -fno-strict-aliasing -march=athlon64 -O0 -pipe -g -ggdb -Wall -Wno-pointer-sign -fvisibility=hidden -I.
./include -c gsm-sms.c  -fPIC -DPIC -o .libs/gsm-sms.o
gsm-sms.c: In function 'gn_sms2mbox':
gsm-sms.c:1760: warning: implicit declaration of function 'setlocale'
gsm-sms.c:1760: error: 'LC_ALL' undeclared (first use in this function)
gsm-sms.c:1760: error: (Each undeclared identifier is reported only once
gsm-sms.c:1760: error: for each function it appears in.)
gsm-sms.c:1760: warning: assignment makes pointer from integer without a cast
gmake[1]: *** [gsm-sms.lo] Error 1
gmake[1]: Leaving directory `/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/work/gnokii-0.6.22/common'
make: *** [common] Error 2
 * 
 * ERROR: app-mobilephone/gnokii-0.6.22-r1 failed.
 * Call stack:
 *               ebuild.sh, line   46:  Called src_compile
 *             environment, line 3224:  Called die
 * The specific snippet of code:
 *       emake -j1 || diefunc "$FUNCNAME" "$LINENO" "$?" "make failed";
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-mobilephone/gnokii-0.6.22-r1/temp/environment'.
 * 
Comment 5 giavoltor 2007-12-31 12:10:15 UTC
gnokii built successfully, when I removed the following lines from the patched common/gsm-sms.c:

#ifdef ENABLE_NLS
#endif

and only 

#include <locale.h>

remained.

The use flags I compiled with are the same as all previous attempts (look above).

I hope this helps, best regards.
Comment 6 Alin Năstac (RETIRED) gentoo-dev 2007-12-31 12:51:21 UTC
setlocale() is used only ENABLE_NLS is defined (see the rest of gsm-sms.c)... and your nls USE flag is enabled.

Most probably ENABLE_NLS is defined gnokii-internal.h or gnokii.h. Try to move the lines added by patch below any #include.
Comment 7 giavoltor 2008-01-01 14:44:29 UTC
(In reply to comment #6)
> 
> Most probably ENABLE_NLS is defined gnokii-internal.h or gnokii.h. Try to move
> the lines added by patch below any #include.
> 
Yes, your suggestion works. I moved the four lines provided by the patch and gnokii built fine. Here is how the patched common/gsm-sms.c looks like now:

...

  Library for parsing and creating Short Messages (SMS).

*/

#include <stdlib.h>
#include <string.h>
#include <time.h>

#include "gnokii-internal.h"
#include "gnokii.h"

#ifdef ENABLE_NLS
#  include <locale.h>
#endif

#include "sms-nokia.h"

#undef ERROR
#define ERROR() do { if (error != GN_ERR_NONE) return error; } while (0)

struct sms_udh_data {

...

So, I guess a new patch is needed? Is it going to be included in the standard portage tree?
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2008-01-01 16:17:54 UTC
Fixed in cvs without revision bumping.