summaryrefslogtreecommitdiff
path: root/community/haskell-dbus
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/haskell-dbus
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/haskell-dbus')
-rw-r--r--community/haskell-dbus/PKGBUILD43
-rw-r--r--community/haskell-dbus/dbus-0.4.patch60
-rw-r--r--community/haskell-dbus/haskell-dbus.install18
3 files changed, 121 insertions, 0 deletions
diff --git a/community/haskell-dbus/PKGBUILD b/community/haskell-dbus/PKGBUILD
new file mode 100644
index 000000000..722024016
--- /dev/null
+++ b/community/haskell-dbus/PKGBUILD
@@ -0,0 +1,43 @@
+# Contributor: Arch Haskell Team <arch-haskell@haskell.org>
+# Package generated by cabal2arch 0.7
+# Maintainer: Jelle van der Waa <jelle vdwaa nl>
+#
+_hkgname=DBus
+pkgname=haskell-dbus
+pkgver=0.4
+pkgrel=3.1
+pkgdesc="DBus bindings"
+url="http://hackage.haskell.org/package/DBus"
+license=('custom:BSD3')
+arch=('i686' 'x86_64')
+depends=('ghc=7.0.2' 'sh')
+options=('strip')
+source=(http://hackage.haskell.org/packages/archive/DBus/0.4/DBus-0.4.tar.gz
+ dbus-0.4.patch)
+install=haskell-dbus.install
+md5sums=('5658e4b2acfca27151222e8dc8adeed0'
+ '964d3a42b4ffcfa741fc75be99d485b7')
+build() {
+ cd ${srcdir}/DBus-$pkgver
+ patch -p1 -i ${srcdir}/dbus-0.4.patch
+ runhaskell Setup configure -O -p \
+ --prefix=/usr --docdir=/usr/share/doc/${pkgname} \
+ --libsubdir=\$compiler/site-local/\$pkgid \
+ --enable-split-objs --enable-shared
+ runhaskell Setup build
+ runhaskell Setup haddock
+ runhaskell Setup register --gen-script
+ runhaskell Setup unregister --gen-script
+ sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+package() {
+ cd ${srcdir}/${_hkgname}-${pkgver}
+ install -D -m744 register.sh ${pkgdir}/usr/share/haskell/$pkgname/register.sh
+ install -m744 unregister.sh ${pkgdir}/usr/share/haskell/$pkgname/unregister.sh
+ install -d -m755 $pkgdir/usr/share/doc/ghc/html/libraries
+ ln -s /usr/share/doc/${pkgname}/html ${pkgdir}/usr/share/doc/ghc/html/libraries/DBus
+ runhaskell Setup copy --destdir=${pkgdir}
+ install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
+ rm -f ${pkgdir}/usr/share/doc/${pkgname}/LICENSE
+}
diff --git a/community/haskell-dbus/dbus-0.4.patch b/community/haskell-dbus/dbus-0.4.patch
new file mode 100644
index 000000000..b983801cf
--- /dev/null
+++ b/community/haskell-dbus/dbus-0.4.patch
@@ -0,0 +1,60 @@
+diff -aru DBus-0.4/DBus/Internal.hsc DBus-0.4.new/DBus/Internal.hsc
+--- DBus-0.4/DBus/Internal.hsc 2008-09-08 01:28:20.000000000 +0200
++++ DBus-0.4.new/DBus/Internal.hsc 2011-02-15 08:07:45.222787595 +0100
+@@ -9,7 +9,7 @@
+
+ module DBus.Internal where
+
+-import Control.Exception (throwDyn)
++import Control.Exception (throwIO)
+ import Control.Monad (when)
+ import DBus (Error(..))
+ import Foreign
+@@ -57,6 +57,6 @@
+ else do name <- #{peek DBusError, name} err >>= peekCString
+ msg <- #{peek DBusError, message} err >>= peekCString
+ error_free err
+- throwDyn $ Error name msg
++ throwIO $ Error name msg
+
+ -- vim: set ts=2 sw=2 tw=72 et ft=haskell :
+diff -aru DBus-0.4/DBus.cabal DBus-0.4.new/DBus.cabal
+--- DBus-0.4/DBus.cabal 2008-09-08 01:28:20.000000000 +0200
++++ DBus-0.4.new/DBus.cabal 2011-02-15 08:09:19.376168928 +0100
+@@ -11,7 +11,8 @@
+ description: Bindings for the D-Bus API.
+ For details on D-Bus, see the D-Bus wiki at:
+ <http://www.freedesktop.org/wiki/Software/dbus>
+-build-depends: base, bytestring
++build-depends: base >= 4, bytestring
++pkgconfig-depends: dbus-1
+ build-type: Configure
+ extensions: ForeignFunctionInterface, OverlappingInstances,
+ ExistentialQuantification
+diff -aru DBus-0.4/DBus.hsc DBus-0.4.new/DBus.hsc
+--- DBus-0.4/DBus.hsc 2008-09-08 01:28:20.000000000 +0200
++++ DBus-0.4.new/DBus.hsc 2011-02-15 08:08:49.974771904 +0100
+@@ -2,7 +2,7 @@
+ -- Copyright (C) 2006 Evan Martin <martine@danga.com>
+
+ #define DBUS_API_SUBJECT_TO_CHANGE
+-#include "dbus/dbus.h"
++#include <dbus/dbus.h>
+
+ module DBus (
+ module DBus.Shared,
+@@ -24,6 +24,7 @@
+
+ import DBus.Shared
+ import Data.Typeable (Typeable(..), mkTyConApp, mkTyCon)
++import Control.Exception
+
+ -- |'Error's carry a name (like \"org.freedesktop.dbus.Foo\") and a
+ -- message (like \"connection failed\").
+@@ -32,5 +33,6 @@
+ typeOf _ = mkTyConApp (mkTyCon "DBus.Error") []
+ instance Show Error where
+ show (Error name message) = "D-Bus Error (" ++ name ++ "): " ++ message
++instance Exception Error
+
+ -- vim: set ts=2 sw=2 tw=72 et ft=haskell :
diff --git a/community/haskell-dbus/haskell-dbus.install b/community/haskell-dbus/haskell-dbus.install
new file mode 100644
index 000000000..284164971
--- /dev/null
+++ b/community/haskell-dbus/haskell-dbus.install
@@ -0,0 +1,18 @@
+HS_DIR=usr/share/haskell/haskell-dbus
+post_install() {
+ ${HS_DIR}/register.sh
+ (cd usr/share/doc/ghc/html/libraries; ./gen_contents_index)
+}
+pre_upgrade() {
+ ${HS_DIR}/unregister.sh
+}
+post_upgrade() {
+ ${HS_DIR}/register.sh
+ (cd usr/share/doc/ghc/html/libraries; ./gen_contents_index)
+}
+pre_remove() {
+ ${HS_DIR}/unregister.sh
+}
+post_remove() {
+ (cd usr/share/doc/ghc/html/libraries; ./gen_contents_index)
+}