Linux HOWTOs

About | Home | Search


HOWTO: gtk-sharp
Description: .NET binding for GTK+
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# Gtk# (gtk-sharp)
# ====
# Contrary to what the Gtk# web site says, the current 1.x release is 1.0.10
# and the latest 2.x release is 2.8.3  They should co-exist because 2.x uses
# *-2.x for directory and pkgconfig file names, -2 for libraries, 2 for
# binaries.

# The three applications that I know of that I (sometimes) use that use
# GTK# are:
# gfax (0.7.3 built fine with GTK# 1.0.4)
# muine (0.8.2 requires GTK# >= 1.9.1)
# D-Bus (for it's Mono bindings)

# If you ever want to uninstall Gtk#, or clean up files from an old version
# before installing a new one, skip down to the bottom for instructions.

# Prerequisites (for both versions):
# pkg-config
# libxml
# gnome-db's libgda >= 1.0.0 and libgnomedb >= 1.0.0
# librsvg-2.0 >= 2.0.1
# vte >= 0.11.10


# GTK# 1.0.10
# ===========
# Prerequisites (beyond those listed above):
# Mono >= 0.96
# libart-2.0 >= 2.2.0
# Glib-2.0 >= 2.2.0
# pango
# GTK+-2.0 >= 2.2.0
# libgnomecanvas-2.0 >= 2.2.0
# libgnomeui-2.0 >= 2.2.0
# libgnomeprintui-2.2 >= 2.2.0
# libglade-2.0 >= 2.0.0
# libgtkhtml 3.0 >= 3.0.10, 3.1 >= 3.2.0, or 3.6 >= 3.6.0
#  (newer ones like 3.12.x won't work)

# If you don't have Gnome installed, it will not include gnome-sharp.dll:,
# gda-sharp.dll, gnomedb-sharp.dll, gtkhtml-sharp.dll, etc.

cd
test -f installed/gtk-sharp-1.0.10.tar.gz &&
 mv installed/gtk-sharp-1.0.10.tar.gz .
test ! -f gtk-sharp-1.0.10.tar.gz &&
 wget http://go-mono.com/sources/gtk-sharp/gtk-sharp-1.0.10.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gtk-sharp-1.0.*" -exec rm -r {} \;
tar xzvf ~/gtk-sharp-1.0.10.tar.gz
cd gtk-sharp-1.0.10
test $UID = 0 && chown -R root:root .
chmod -R u+w .

# The prefix you use to install it (--prefix=/whatever) should be the same
# that was used to install mono.

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
make

# Become root to install it
su

( cd /usr/local/lib ; rm -f libglibsharpglue.* libpangosharpglue.* \
  libgdksharpglue.* libgtksharpglue.* libgladesharpglue.* \
  libgnomesharpglue.* )
make install
ldconfig
chown -R $USER .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/gtk-sharp-1.0.*.tar.*
mv gtk-sharp-1.0.10.tar.gz installed/


# GTK# 2.8.3
# ==========
# Prerequisites (beyond those listed above):
# Mono >= 1.0
# Glib-2.0 >= 2.8.0
# GTK+-2.0 >= 2.8.0
# libart-2.0 >= 2.3.16
# gnome-vfs-2.0 >= 2.10.0
# libgnomecanvas-2.0 >= 2.10.0
# libgnomeui-2.0 >= 2.10.0
# libgnomeprintui-2.2 >= 2.10.0
# libpanelapplet-2.0 >= 2.10.0
# libglade-2.0 >= 2.3.6
# libgtkhtml 3.0 >= 3.0.10, 3.1 >= 3.2.0, or 3.6 >= 3.6.0
#  (newer ones like 3.12.x won't work)

cd
test -f installed/gtk-sharp-2.8.3.tar.gz &&
 mv installed/gtk-sharp-2.8.3.tar.gz .
test ! -f gtk-sharp-2.8.3.tar.gz &&
 wget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.8.3.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gtk-sharp-1.9.*" -o -name "gtk-sharp-2.*" \
 -exec rm -r {} \;
tar xzvf ~/gtk-sharp-2.8.3.tar.gz
cd gtk-sharp-2.8.3
test $UID = 0 && chown -R root:root .

# The prefix you use to install it (--prefix=/whatever) should be the same
# that was used to install mono.

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib
make

# Become root to install it
su

( cd /usr/local/lib ; rm -f libglibsharpglue-2.* libpangosharpglue-2.* \
  libgdksharpglue-2.* libgtksharpglue-2.* libgladesharpglue-2.* \
  libgnomesharpglue-2.* )
make install
ldconfig

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/gtk-sharp-1.9.*.tar.* installed/gtk-sharp-2.*.tar.*
mv gtk-sharp-2.8.3.tar.gz installed/


# If you ever want to uninstall GTK# 1.0.x, this should do it:
cd
su
test -d src/gtk-sharp-1.0.* && ( cd src/gtk-sharp-1.0.* ; make uninstall )
cd /usr/lib/mono/gac
for dir in art-sharp atk-sharp gconf-sharp gconf-sharp-peditors gda-sharp \
 gdk-sharp glade-sharp glib-sharp gnome-sharp gnome-vfs-sharp gnomedb-sharp \
 gtk-sharp gtkhtml-sharp pango-sharp rsvg-sharp vte-sharp ; do \
 test -d $dir && rm -r $dir ; done
test -d /usr/lib/mono/gtk-sharp && rm -r /usr/lib/mono/gtk-sharp
test -d /usr/share/gapi && rm -r /usr/share/gapi
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "gtk-sharp-1.0.*" -exec rm -r {} \;
rm -f ~/installed/gtk-sharp-1.0.*.tar.*

# If you ever want to uninstall GTK# 2.x, this should do it:
cd
su
test -d src/gtk-sharp-1.9.* && ( cd src/gtk-sharp-1.9.* ; make uninstall )
test -d src/gtk-sharp-2.* && ( cd src/gtk-sharp-2.* ; make uninstall )
test -d /usr/lib/gtk-sharp-2.0 && rm -r /usr/lib/gtk-sharp-2.0
cd /usr/lib/mono/gac
for dir in art-sharp atk-sharp gconf-sharp gconf-sharp-peditors gda-sharp \
 gdk-sharp glade-sharp glib-sharp gnome-sharp gnome-vfs-sharp gnomedb-sharp \
 gtk-sharp gtkhtml-sharp pango-sharp rsvg-sharp vte-sharp ; do \
 test -d $dir && rm -r $dir ; done
test -d /usr/lib/mono/gtk-sharp-2.0 && rm -r /usr/lib/mono/gtk-sharp-2.0
test -d /usr/share/gapi-2.0 && rm -r /usr/share/gapi-2.0
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "gtk-sharp-1.9.*" -exec rm -r {} \;
find ~/src -maxdepth 1 -type d -name "gtk-sharp-2.*" -exec rm -r {} \;
rm -f ~/installed/gtk-sharp-1.9.*.tar.* ~/installed/gtk-sharp-2.*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>