Sunday, January 1, 2012

Haskell Platform in OpenSUSE 12.1

OpenSUSE does not ship with any support for Haskell in it's main package repositories. You can however add them using the OpenSUSE Build Service or OBS.

The best I can tell there is an existing group working on Haskell packaging for OpenSUSE. Search for Haskell on the OBS site and you'll likely run across the repository devel:languages:haskell. The first thing I noticed about this project is that there aren't any builds for OpenSUSE 12.1. After some hunting I ran across the sub-projects and found the 2010.2 haskell-platform available for 12.1. Huzzzah!

A quick little recipe like the following allowed me to add this repository:

$ sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell:/platform-2010.2/openSUSE_12.1/devel\:languages\:haskell\:platform-2010.2.repo
$ sudo zypper refresh

Make sure you accept the key from the new repository so you can install signed packages and check their signatures correctly.

Now to install the 2010.2 haskell-platform for OpenSUSE 12.1 you just need to install all the packages from the new repository in zypper.

sudo zypper install --from devel_languages_haskell_platform-2010.2 '*'


By using --from in the zypper command line it will only select packages from the specified repository, but will use all configured repositories to do dependency lookup.

After requesting the install via zypper you should get a screen like the following:

The following NEW packages are going to be installed:
alex alex-doc build-compare cabal2spec cabal-install ghc ghc-cgi ghc-cgi-devel ghc-cgi-prof ghc-dataenc
ghc-dataenc-devel ghc-dataenc-prof ghc-deepseq ghc-deepseq-devel ghc-deepseq-prof ghc-doc ghc-fgl
ghc-fgl-devel ghc-fgl-prof ghc-GLUT ghc-GLUT-devel ghc-GLUT-prof ghc-haskell-src ghc-haskell-src-devel
ghc-haskell-src-prof ghc-hscolour ghc-hscolour-devel ghc-hscolour-prof ghc-hslogger ghc-hslogger-devel
ghc-hslogger-prof ghc-html ghc-html-devel ghc-html-prof ghc-HTTP ghc-HTTP-devel ghc-HTTP-prof ghc-libs
ghc-mtl ghc-mtl-devel ghc-mtl-prof ghc-network ghc-network-devel ghc-network-prof ghc-OpenGL
ghc-OpenGL-devel ghc-OpenGL-prof ghc-parallel ghc-parallel-devel ghc-parallel-prof ghc-parsec
ghc-parsec-devel ghc-parsec-prof ghc-prof ghc-QuickCheck ghc-QuickCheck-devel ghc-QuickCheck-prof
ghc-regex-base ghc-regex-base-devel ghc-regex-base-prof ghc-regex-compat ghc-regex-compat-devel
ghc-regex-compat-prof ghc-regex-posix ghc-regex-posix-devel ghc-regex-posix-prof ghc-rpm-macros ghc-stm
ghc-stm-devel ghc-stm-prof ghc-utf8-string ghc-utf8-string-devel ghc-utf8-string-prof ghc-xhtml
ghc-xhtml-devel ghc-xhtml-prof ghc-zlib ghc-zlib-devel ghc-zlib-prof glibc-devel gmp-devel happy happy-doc
hscolour libmp3 linux-glibc-devel zlib-devel

87 new packages to install.
Overall download size: 84.4 MiB. After the operation, additional 858.9 MiB will be used.


Answer yes to the prompt and, depending on your internet speed, you should have a haskell platform to kick around in a few minutes.

Hope this helps someone... The packaging for haskell in OpenSUSE is pretty bad. Debian based distros do it a little bit better by providing a haskell-platform virtual package that has all the componenets a dependencies. Since the packaging in OpenSUSE is done via the OBS and not in the main repositories this isn't likely to get better.

Also as of this writing there are no haskell-platform releases newer than 2010.2 available on the OBS. Due to the quick development of ghc, this can be limiting on the Haskell developer who needs access to features like Data Parallel Haskell or Safe Haskell systems. For users on OpenSUSE that want these features, I encourage you to install the above platform and immediately go build ghc from source code, use the instructions here.

Happy Haskelling!

No comments: