Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 136778

Summary: new ebuild for xnecview
Product: Gentoo Linux Reporter: Dominique Michel <dominique.c.michel>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: RESOLVED FIXED    
Severity: enhancement CC: sci
Priority: High Keywords: EBUILD
Version: 2006.0   
Hardware: All   
OS: Linux   
URL: http://wwwhome.cs.utwente.nl/~ptdeboer/ham/xnecview/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ebuild for xnecview
patch for setlocale() bug
ebuild ofr xnecview-1.35
xnecview-1.36 ebuild
fixes xnecview with libpng-1.5

Description Dominique Michel 2006-06-14 06:40:04 UTC
Xnecview is a program for visualizing the input and output files of the NEC antenna simulation software. It runs on Linux/Unix systems with the X window system.

It take as input the input files for nec and the output files generated by nec. Xnecview will visualize in color the structure of the antenna, the radiation diagram of the antenna, Of course, the picture can also be rotated and zoomed. Furthermore, slices through the XY, XZ and YZ planes can be shown, and four different gain scales are available: linear in power, linear in voltage, ARRL-style, and logarithmic with -40 dB at the center.

If the NEC output file contains output data for several frequencies, an additional window is opened showing selected data as a function of frequency.

For the nec software: http://bugs.gentoo.org/show_bug.cgi?id=135550 

xnecview don't use nec at all, only nec's input and output files, so I don't have it as dependency.
Comment 1 Dominique Michel 2006-06-14 06:41:19 UTC
Created attachment 89152 [details]
ebuild for xnecview
Comment 2 Dominique Michel 2006-06-14 06:45:09 UTC
Created attachment 89155 [details, diff]
patch for setlocale() bug

Thanks for your bug report.
At first I almost concluded that this was an "impossible" problem, but
then figured out what may be happening: it turns out that the present
version of xnecview (unintentionally) respects the "locale" setting of
your system when reading files. I see you are in Switzerland, and I think
in Switzerland (like many non-English countries) the standard decimal
separator is a comma rather than a point: so probably your xnecview
expects decimal commas instead of points in the numbers in the NEC
input file.
Of course, this is silly, since the NEC input files should be the same
everywhere in the world.

Actually, the situation is a bit weirder. Normally, when one wants a C
program to respect the locale settings, one has to explicitly call the
setlocale() function in order to do that. Of course, I don't do that in
xnecview, since its files should be international. However, it turns
out that the gtk library which xnecview uses, calls this setlocale()
function anyway.

There are two ways to avoid this problem.
One is to change your locale setting to something that makes the separator
a point instead of a comma.
The other is to modify xnecview slightly, such that the decimal
separator setting is set correctly again. This is quite easy: open the
file 'xnecview.c'; then somewhere near the #include's, add the line:

  #include <locale.h>

Furthermore, around line 375, just below the line calling initX(), add
the line:

  setlocale(LC_NUMERIC,"C");

From the author of the program, Pieter-Tjerk de Boer.

It just work.
Comment 3 George Shapovalov (RETIRED) gentoo-dev 2006-06-26 12:23:02 UTC
Similar comments here:

Restrict
patch should be in src_unpack - oh, this is a proper situation to use patch this time :).
make -> emake?
what's left of src_compile should be removed?

George
Comment 4 Dominique Michel 2006-07-03 07:12:10 UTC
Created attachment 90774 [details]
ebuild ofr xnecview-1.35

Modified as suggested by George.
Added manpage instalation.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2010-06-30 17:46:46 UTC
No new releases since 2006
Comment 6 Dominique Michel 2013-01-25 00:17:09 UTC
Created attachment 336778 [details]
xnecview-1.36 ebuild

I fixed the depends and made repoman happy.

Some sed fixes for the Makefile too (CFLAGS, tc_getCC).
Comment 7 Dominique Michel 2013-01-25 00:18:50 UTC
Created attachment 336780 [details, diff]
fixes xnecview with libpng-1.5

The setlocale() patch is not needed anymore
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2013-01-25 08:17:59 UTC
(In reply to comment #7)
> Created attachment 336780 [details, diff] [details, diff]
> fixes xnecview with libpng-1.5
> 
> The setlocale() patch is not needed anymore

Do you like to add this to the sci overlay? fork the overlay on github and send a pull-request.
Comment 9 Larry the Git Cow gentoo-dev 2023-05-06 03:52:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b1e846ff1d0069ae6e028eab70777d08698c6ba

commit 3b1e846ff1d0069ae6e028eab70777d08698c6ba
Author:     Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
AuthorDate: 2022-09-01 17:03:45 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-06 03:48:42 +0000

    sci-electronics/xnecview: new package, add 1.37
    
    Closes: https://bugs.gentoo.org/136778
    Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
    Closes: https://github.com/gentoo/gentoo/pull/27107
    Signed-off-by: Sam James <sam@gentoo.org>

 sci-electronics/xnecview/Manifest                  |  1 +
 .../xnecview/files/xnecview-tc-variables.patch     | 29 +++++++++++++++++
 sci-electronics/xnecview/metadata.xml              | 17 ++++++++++
 sci-electronics/xnecview/xnecview-1.37.ebuild      | 37 ++++++++++++++++++++++
 4 files changed, 84 insertions(+)