Page 1 of 2

Gcalctool and Galculator

Posted: 4. Sep 2010, 11:31
by Andyun
Please, replace Galculator at Gcalctool (starting with version 5.28.0) http://live.gnome.org/Gcalctool. Galculator incorrectly count percents. Example: 50 - 50% = 50 (Galculator), 25 (Gcalctool).

Re: Gcalctool (starting with version 5.28.0)

Posted: 4. Sep 2010, 12:49
by gapan
If this is indeed a bug with galculator, please report it to the galculator developer(s).

Re: Gcalctool (starting with version 5.28.0)

Posted: 4. Sep 2010, 19:40
by pwatk
I haven't looked at the dependencies for gcalctool but Andyun might have a point here.

galculator hasn't been updated since 8th February 2009 and the CVS is "out of date" and none existent.

IMO I'd still try contacting the developer but a different application (gcalctool or another) might be a good idea for the next release if development on galculator doesn't get moving again.

Re: Gcalctool (starting with version 5.28.0)

Posted: 4. Sep 2010, 21:34
by Shador
I don't think that this is wrong. IMHO the correct way to get that result is: 50 - 50% * 50 = 25 or 50 * (100% - 50%) = 50 * 50% = 25
Actually I think the mathematically correct result would be: 50 - 50% = 50 - 50 * (1/100) = 50 - 0.5 = 49.5
So gcalculator is still wrong, but gcalctool is not exactly correct either.

Re: Gcalctool (starting with version 5.28.0)

Posted: 4. Sep 2010, 22:40
by damNageHack
You should be able to use the package from slacky.eu or the more current one from Zenwalk.

http://repository.slacky.eu/slackware-1 ... ol/5.26.3/
http://packages.zenwalk.org/?p=gcalctoo ... n=snapshot

I tried to build the most current (and unstable?) version of gcalctool with help from SlackBuild of slacky.eu, but there is an error from configure that does not find glib-compile-schemas. I do not know what to do, maybe some package is not installed?

Code: Select all

## SLKBUILD for gcalctool
## based on http://repository.slacky.eu/slackware-13.0/utilities/gcalctool/5.26.3/src
#Packager: Someone but not me <email@address.com>

pkgname=Gcalctool
pkgver=5.31.91
pkgrel=1xx
source=(http://ftp.acc.umu.se/pub/GNOME/sources/gcalctool/`echo ${pkgver%.*}`/gcalctool-$pkgver.tar.bz2)
docs=(AUTHORS COPYING ChangeLog*  INSTALL MAINTAINERS NEWS README TODO)
url=http://live.gnome.org/Gcalctool

doinst() {
  SCHEMA="gcalctool.schemas"
  GCONF_CONFIG_SOURCE="xml::etc/gconf/gconf.xml.defaults" \
  chroot . gconftool-2 --makefile-install-rule \
    /etc/gconf/schemas/$SCHEMA \
    1>/dev/null
    
	if [ -x usr/bin/update-desktop-database ]; then
	  chroot . /usr/bin/update-desktop-database /usr/share/applications \
	  1>/dev/null
	fi

	if [ -x usr/bin/gtk-update-icon-cache ]; then
	  chroot . /usr/bin/gtk-update-icon-cache -q -f -t /usr/share/icons/hicolor \
	  1>/dev/null
	fi  
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"Gcalctool (GNOME calculator application)"
"This is gcalctool, the calculator application that was previously in"
"the  OpenWindows  Deskset of  the  Solaris  8  operating system. Sun"
"Microsystems Inc. have kindly given permission to release it."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure 	--prefix=/usr \
			--sysconfdir=/etc \
			--localstatedir=/var \
			--libdir=/usr/lib${LIBDIRSUFFIX} \
			--mandir=/usr/man \
			--disable-static \
			--program-prefix= \
			--program-suffix= \
			--build=$ARCH-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg
} 

Re: Gcalctool (starting with version 5.28.0)

Posted: 5. Sep 2010, 12:18
by gapan
After actually trying the suggested expression, I can only agree with shador. The result should actually be 49.5. And if you really think about it, a percentage means nothing on its own. What does 50% mean? 50% of what? 50%*1 should be 0.5. Now, if I try "50-50%*1" in galculator, the result is correct: 49.5. Not so much in gcalctool, where is shows 25, which is definitely wrong.

Actually if you enter "50-50%" in galculator, the result is not 50 as Andyun said. There is no result, galculator still shows the number you entered previously and waits for you to enter something else. So galculator is actually right and gcalctool is wrong.

Anyway, I think when I have tried gcalctool a while back, it needed some gnome stuff that we didn't have, but it seems to compile fine without them now. Here's an SLKBUILD that works:

Code: Select all

#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=gcalctool
pkgver=5.30.2
pkgrel=1gv
source=(http://ftp.gnome.org/pub/gnome/sources/gcalctool/5.30/gcalctool-5.30.2.tar.bz2)
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://live.gnome.org/Gcalctool
options=('noautodotnew')

doinst() {
# Update the scrollkeeper database (Remove stale pieces)
if [ -x usr/bin/scrollkeeper-update ]; then
        usr/bin/scrollkeeper-update > /dev/null 2>&1
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gcalctool (a powerful graphcal calculator)"
"gcalctool is a powerful graphical calculator with financial, logical"
"and scientific modes. It uses a multiple precision package to do its"
"arithmetic to give a high degree of accuracy."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--build=$arch-slackware-linux \
		--disable-schemas-install \
		--with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \
		--disable-scrollkeeper
	make || return 1
	make install DESTDIR=$startdir/pkg

	# gconf stuff
	export GCONF_CONFIG_SOURCE="xml::$startdir/pkg/etc/gconf/gconf.xml.defaults"
	if [ -d $startdir/pkg/etc/gconf/schemas ]; then
	    install -v -d -m755 $startdir/pkg/etc/gconf/gconf.xml.defaults
	    SCHEMAS=$startdir/pkg/etc/gconf/schemas
	    for schema in $SCHEMAS/*.schemas; do
	        gconftool-2 --makefile-install-rule $schema
	    done
	    # Reset / Verify correct permissions
	    ( cd $startdir/pkg/etc/gconf ; find . -type d -exec chmod 755 {} \; )
	    ( cd $startdir/pkg/etc/gconf ; find . -type f -exec chmod 644 {} \; )
	fi
} 

Re: Gcalctool (starting with version 5.28.0)

Posted: 5. Sep 2010, 12:38
by damNageHack
gapan, have you noticed that I tried to build the most recent version, this is pkgver=5.31.91 :?:
You are using the older version 5.30.2 which is already available as a package from "somewhere else" (link is given above).

Re: Gcalctool (starting with version 5.28.0)

Posted: 5. Sep 2010, 12:40
by gapan
Odd numbered versions of gnome software are unstable. Stick with the even numbered ones.

Re: Gcalctool (starting with version 5.28.0)

Posted: 5. Sep 2010, 12:51
by damNageHack
gapan wrote:Odd numbered versions of gnome software are unstable. Stick with the even numbered ones.
Thanks for the hint. I edited my original post towards that.

Re: Gcalctool (starting with version 5.28.0)

Posted: 18. Sep 2010, 17:54
by Andyun
Thank you for SLKBUILD! For compiling of this package is necessary gnome-doc-utils.