• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gtk2hs/gtk2hs: GUI library for Haskell based on GTK+

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

gtk2hs/gtk2hs

开源软件地址(OpenSource Url):

https://github.com/gtk2hs/gtk2hs

开源编程语言(OpenSource Language):

Haskell 93.3%

开源软件介绍(OpenSource Introduction):

Gtk2Hs

Build Status

Gtk2Hs is a GUI library for Haskell based on GTK+. GTK+ is an extensive and mature multi-platform toolkit for creating graphical user interfaces.

For all new application development you should consider using haskell-gi as it has much more complete bindings. Cairo and WebKitGTK JavaScriptCore do not have GObject introspection data so you will still need to use the Gtk2Hs packages for those (even when using haskell-gi for everything else).

Installing C libraries

The following commands will install most of the C libraries used by the Gtk2Hs and haskell-gi.

Fedora

sudo dnf install gobject-introspection-devel webkitgtk3-devel webkitgtk4-devel gtksourceview3-devel

Ubuntu/Debian

sudo apt-get install libgirepository1.0-dev libwebkitgtk-3.0-dev libwebkit2gtk-4.0-dev libgtksourceview-3.0-dev

Arch Linux

sudo pacman -S gobject-introspection gobject-introspection-runtime gtksourceview3 webkitgtk webkit2gtk

OS X MacPorts

sudo port install gobject-introspection webkit-gtk3 webkit2-gtk gtksourceview3 gtk-osx-application-gtk3 adwaita-icon-theme

You will also need to build a MacPorts compatible of GHC. First install GHC some other way then unpack the source for the GHC version you want to use and run:

sudo port install libxslt gmp ncurses libiconv llvm-3.5 libffi
./configure --prefix=$HOME/ghc-8.0.1 --with-iconv-includes=/opt/local/include --with-iconv-libraries=/opt/local/lib --with-gmp-includes=/opt/local/include --with-gmp-libraries=/opt/local/lib --with-system-libffi --with-ffi-includes=/opt/local/lib/libffi-3.2.1/include --with-ffi-libraries=/opt/local/lib --with-nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm-classic
make
make install

Then make sure the $HOME/ghc-8.0.1/bin is in your $PATH.

OS X Homebrew

Unlike MacPorts you will not need a custom build of GHC for homebrew since it uses the system libiconv. However some packaged (such as WebKitGTK) seem to be less well supported on Homebrew.

brew install gtk+3

And if you got an error about that pkg-config can not find libffi when installing haskell-gi or something like that, you need to find out where your brew installed libffi, and add the pkg_config(e.g. /usr/local/Cellar/libffi/3.0.13/lib/pkgconfig) directory to $PKG_CONFIG_PATH.

TIPS: If you installed GTK with homebrew, you do not need to install X11 on macOS. The one installed by brew was linked with GTK+'s Quartz backend, and you can use macOS's native display manager, keyboard, and pointing device.

Windows MSYS2

Install MSYS2 and Chocolatey. Then in a shell with administrator privileges:

choco install ghc
pacman -S mingw64/mingw-w64-x86_64-pkg-config mingw64/mingw-w64-x86_64-gobject-introspection mingw64/mingw-w64-x86_64-gtksourceview3 mingw64/mingw-w64-x86_64-webkitgtk3

Install Extra Tools

cabal update
cabal install alex happy
cabal install haskell-gi

(make sure ~/.cabal/bin is in PATH)

Building with stack

While you currently cannot have the tools automatically installed with stack you should be able to install them in the local stack. For instance here are the build instructions for building Leksah using stack:

git clone --recursive https://github.com/leksah/leksah.git
cd leksah
stack install alex happy
stack install haskell-gi
stack install gtk2hs-buildtools
stack install



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap