Last active
December 29, 2015 22:49
-
-
Save cjolowicz/7739085 to your computer and use it in GitHub Desktop.
Installing gtk2hs on Mac OS X 10.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install XQuartz | |
wget http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.5.dmg | |
mkdir /Volumes/XQuartz-2.7.5 | |
hdiutil attach -mountpoint /Volumes/XQuartz-2.7.5 XQuartz-2.7.5.dmg | |
sudo installer -pkg /Volumes/XQuartz-2.7.5/*.pkg -target / | |
hdiutil detach -mountpoint /Volumes/XQuartz-2.7.5 XQuartz-2.7.5.dmg | |
rmdir /Volumes/XQuartz-2.7.5 | |
rm XQuartz-2.7.5.dmg | |
# Install GTK. | |
brew install gtk | |
# Install gtk2hs. | |
cabal install gtk2hs-buildtools | |
libpath=$(echo /usr/local/opt/*/lib|xargs -n1 printf '%s:') | |
includepath=$(echo /usr/local/opt/*/include|xargs -n1 printf '%s:') | |
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig \ | |
cabal install \ | |
--extra-lib-dirs=$libpath \ | |
--extra-include-dirs=$includepath gtk | |
# Error: | |
# Preprocessing library glib-0.12.5.0... | |
# gtk2hsC2hs: Error in C header file. | |
# | |
# /usr/include/dirent.h:140: (column 66) [FATAL] | |
# >>> Syntax error! | |
# The symbol `=' does not fit here. | |
# | |
# Failed to install glib-0.12.5.0 | |
# Error when PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ is omitted: | |
# Configuring cairo-0.12.5.0... | |
# setup: Package xcb-shm was not found in the pkg-config search path. | |
# Perhaps you should add the directory containing `xcb-shm.pc' | |
# to the PKG_CONFIG_PATH environment variable | |
# Package 'xcb-shm', required by 'cairo', not found | |
# Failed to install cairo-0.12.5.0 | |
# Error when --extra-*-dirs options are omitted: | |
# Configuring glib-0.12.5.0... | |
# setup: Missing dependency on a foreign library: | |
# * Missing C library: intl |
Same here.
and here
aaaand here
XCode 5.1, OS X Mavericks
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library
# ...
Configuring glib-0.12.5.3...
/var/folders/qh/fcry_js52mzdx2l7zsjbvcz80000gn/T/69063.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building glib-0.12.5.3...
Preprocessing library glib-0.12.5.3...
gtk2hsC2hs: Error in C header file.
/usr/include/dirent.h:140: (column 66) [FATAL]
>>> Syntax error!
The symbol `=' does not fit here.
Failed to install glib-0.12.5.3
cabal: Error: some packages failed to install:
cairo-0.12.5.3 failed during the configure step. The exception was:
ExitFailure 1
gio-0.12.5.3 depends on glib-0.12.5.3 which failed to install.
glib-0.12.5.3 failed during the building phase. The exception was:
ExitFailure 1
gtk-0.12.5.6 depends on glib-0.12.5.3 which failed to install.
gtksourceview2-0.12.5.0 depends on glib-0.12.5.3 which failed to install.
leksah-0.8.0.4 depends on glib-0.12.5.3 which failed to install.
leksah-server-0.8.0.5 depends on glib-0.12.5.3 which failed to install.
ltk-0.8.0.6 depends on glib-0.12.5.3 which failed to install.
pango-0.12.5.3 depends on glib-0.12.5.3 which failed to install.
here too
You need gcc 4.8. This worked for me: http://www.haskell.org/haskellwiki/Gtk2Hs/Mac
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the same error:
any workaround?