aboutsummaryrefslogtreecommitdiff
path: root/academic/tilem2
diff options
context:
space:
mode:
authorJK Wood <joshuakwood@gmail.com>2013-01-13 15:38:56 +0100
committerdsomero <xgizzmo@slackbuilds.org>2013-01-20 09:03:04 -0500
commitf757ebccbd9750755be813c8a1646540ed929fb1 (patch)
treee5c3a0152b5508640e6fa6cf0ee49fca2a6c790e /academic/tilem2
parent23af0556d2e0b2e1484e638f2c03b28024b1962f (diff)
academic/tilem2: Added (TI-calculator emulator for linux).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'academic/tilem2')
-rw-r--r--academic/tilem2/README10
-rw-r--r--academic/tilem2/doinst.sh9
-rw-r--r--academic/tilem2/patches/add_-lm_to_libs_r661.patch76
-rw-r--r--academic/tilem2/patches/desktop_file_fix_r668.patch10
-rw-r--r--academic/tilem2/patches/tilem-2.0-64bit.patch12
-rw-r--r--academic/tilem2/slack-desc19
-rw-r--r--academic/tilem2/tilem2.SlackBuild114
-rw-r--r--academic/tilem2/tilem2.info12
8 files changed, 262 insertions, 0 deletions
diff --git a/academic/tilem2/README b/academic/tilem2/README
new file mode 100644
index 000000000000..4276a398db3e
--- /dev/null
+++ b/academic/tilem2/README
@@ -0,0 +1,10 @@
+An emulator for the Z80 series of Texas Instruments graphing
+calculators. It emulates all current Z80 calculator models
+including the TI-81, and features a debugger, external file
+loading, and full flash support, including flash app loading.
+
+TiLem2 is a major step forward from previous versions, and
+so can be installed alongside a 0.97x version. It will not
+touch or use your current ~/.TilEm directory.
+
+TiLem2 requires a ROM for your calculator.
diff --git a/academic/tilem2/doinst.sh b/academic/tilem2/doinst.sh
new file mode 100644
index 000000000000..3e5691a052b5
--- /dev/null
+++ b/academic/tilem2/doinst.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/academic/tilem2/patches/add_-lm_to_libs_r661.patch b/academic/tilem2/patches/add_-lm_to_libs_r661.patch
new file mode 100644
index 000000000000..771103558fde
--- /dev/null
+++ b/academic/tilem2/patches/add_-lm_to_libs_r661.patch
@@ -0,0 +1,76 @@
+diff --git a/configure b/configure
+index cc4e5ad..26af532 100755
+--- a/configure
++++ b/configure
+@@ -3456,6 +3456,48 @@ fi
+ # Checks for libraries
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
++$as_echo_n "checking for pow in -lm... " >&6; }
++if ${ac_cv_lib_m_pow+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lm $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char pow ();
++int
++main ()
++{
++return pow ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_m_pow=yes
++else
++ ac_cv_lib_m_pow=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
++$as_echo "$ac_cv_lib_m_pow" >&6; }
++if test "x$ac_cv_lib_m_pow" = xyes; then :
++ LIBS="-lm $LIBS"
++fi
++
++
++
+
+ # GLib and GTK+
+
+@@ -3728,8 +3770,7 @@ fi
+ save_libs="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+-
+-ac_fn_c_check_func "$LINENO" "gtk_init" "ac_cv_func_gtk_init"
++ ac_fn_c_check_func "$LINENO" "gtk_init" "ac_cv_func_gtk_init"
+ if test "x$ac_cv_func_gtk_init" = xyes; then :
+ have_gtk=yes
+ else
+diff --git a/configure.ac b/configure.ac
+index 88e2306..456e4c7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -37,6 +37,8 @@ AC_CHECK_PROG([UPDATE_MIME_DATABASE],
+
+ # Checks for libraries
+
++AC_CHECK_LIB(m, pow, [ LIBS="-lm $LIBS" ])
++
+ m4_define(with_flags, [
+ save_cflags="$CFLAGS"
+ save_libs="$LIBS"
diff --git a/academic/tilem2/patches/desktop_file_fix_r668.patch b/academic/tilem2/patches/desktop_file_fix_r668.patch
new file mode 100644
index 000000000000..77aaa3ff8579
--- /dev/null
+++ b/academic/tilem2/patches/desktop_file_fix_r668.patch
@@ -0,0 +1,10 @@
+diff --git a/data/desktop/tilem2.desktop b/data/desktop/tilem2.desktop
+index 8118c97..2432f5f 100644
+--- a/data/desktop/tilem2.desktop
++++ b/data/desktop/tilem2.desktop
+@@ -7,4 +7,4 @@ MimeType=application/x-tigroup;application/x-ti73-variables;application/x-ti73-p
+ StartupNotify=true
+ Terminal=false
+ Type=Application
+-Categories=Education;Science;Math;Emulator;
++Categories=Education;Science;Math;System;Emulator;
diff --git a/academic/tilem2/patches/tilem-2.0-64bit.patch b/academic/tilem2/patches/tilem-2.0-64bit.patch
new file mode 100644
index 000000000000..33d56b87bf37
--- /dev/null
+++ b/academic/tilem2/patches/tilem-2.0-64bit.patch
@@ -0,0 +1,12 @@
+diff -ur tilem-2.0/gui/macro.c tilem-2.0-64bit/gui/macro.c
+--- tilem-2.0/gui/macro.c 2011-11-26 21:47:07.000000000 +0100
++++ tilem-2.0-64bit/gui/macro.c 2012-07-23 22:48:24.000000000 +0200
+@@ -134,7 +134,7 @@
+ char * lengthchar = g_new0(char, 4);
+ int length = strlen(emu->macro->actions[i]->value);
+ fwrite("file=", 1, 5, fp);
+- sprintf(lengthchar, "%04d", strlen(emu->macro->actions[i]->value));
++ sprintf(lengthchar, "%04zd", strlen(emu->macro->actions[i]->value));
+ fwrite(lengthchar, 1, sizeof(int), fp);
+ fwrite("-", 1, 1, fp);
+ fwrite(emu->macro->actions[i]->value, 1, length, fp);
diff --git a/academic/tilem2/slack-desc b/academic/tilem2/slack-desc
new file mode 100644
index 000000000000..c4d13d281435
--- /dev/null
+++ b/academic/tilem2/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+tilem2: tilem2 (TI-calculator emulator for linux)
+tilem2:
+tilem2: tilem2 serves as an emulator for the Z-80 TI line
+tilem2: of calculators from Texas Instruments. This is the 2.0 version
+tilem2: and can live concurrently with TiLem 0.97x.
+tilem2:
+tilem2: Homepage: http://lpg.ticalc.org/prj_tilem/
+tilem2:
+tilem2:
+tilem2:
+tilem2:
diff --git a/academic/tilem2/tilem2.SlackBuild b/academic/tilem2/tilem2.SlackBuild
new file mode 100644
index 000000000000..5650d96dffc0
--- /dev/null
+++ b/academic/tilem2/tilem2.SlackBuild
@@ -0,0 +1,114 @@
+#!/bin/sh
+
+# Slackbuild for tilem2
+
+# Written by JK Wood <joshuakwood@gmail.com>
+
+# Slackbuild is released under the Dog-on-Fire License:
+# If use of this script causes your dog to catch on fire,
+# you agree to send me five dollars. Or a picture
+# of the dog on fire.
+# Otherwise, you're on your own. I've tested the script
+# on my own computer, and it hasn't broken anything.
+# So if it does it on your computer, that falls in
+# the realm of "Not my problem."
+#
+# Of course, if you'll send a bug report to the above
+# email address, I may be able to see what you did
+# wrong and prevent it from happening in the future.
+# In which case, I may just send YOU five dollars.
+
+# Oh, and feel free to copy it and modify it as you
+# see fit. Or as I see fit. Or as I fit. Although
+# that is unlikely, as I am rather tall.
+
+PRGNAM=tilem2
+SRCNAM=tilem
+VERSION=2.0
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e # Exit on most errors
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.bz2
+cd $SRCNAM-$VERSION
+chown -R root:root .
+find . \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# A few necessary patches
+# This adds -lm to the linker flags - comes from revision 661
+patch -p1 < $CWD/patches/add_-lm_to_libs_r661.patch
+
+# Fix a sprintf error on 64-bit - comes from
+# http://svn.calcforge.org/viewvc/repo-specfiles/fedora/tilem/tilem-2.0-64bit.patch
+patch -p1 < $CWD/patches/tilem-2.0-64bit.patch
+
+# Correct a non-fatal but annoying error in the .desktop file - comes from revision 668
+patch -p1 < $CWD/patches/desktop_file_fix_r668.patch
+
+# Don't force -O3
+sed -i 's|OPT_CFLAGS="-O3"|OPT_CFLAGS=""|' configure
+
+OPT_CFLAGS="" \
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --build=$ARCH-slackware-linux \
+
+make
+
+DESTDIR=$PKG make install
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGELOG COPYING INSTALL KEYS NEWS README THANKS TODO \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $CWD/user_manual.pdf $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+find $PKG/usr/doc -name "Makefile" -exec rm {} \;
+find $PKG/usr/doc -type f -exec chmod 644 {} \;
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/academic/tilem2/tilem2.info b/academic/tilem2/tilem2.info
new file mode 100644
index 000000000000..c7098cc9908f
--- /dev/null
+++ b/academic/tilem2/tilem2.info
@@ -0,0 +1,12 @@
+PRGNAM="tilem2"
+VERSION="2.0"
+HOMEPAGE="http://lpg.ticalc.org/prj_tilem/"
+DOWNLOAD="http://downloads.sourceforge.net/tilem/tilem-2.0.tar.bz2 \
+ http://lpg.ticalc.org/prj_tilem/doc/user_manual.pdf"
+MD5SUM="44c4c671bcdaf3d1e1c27c724a1e1857 \
+ 7323c328e9ebc495980d9f5035811059"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="libticalcs2"
+MAINTAINER="JK Wood"
+EMAIL="joshuakwood@gmail.com"