fix build with X11-1.6.1 which now provides getAtomName

patch from upstream
This commit is contained in:
Jens Petersen 2013-03-19 13:53:15 +09:00
parent 8c2430edd0
commit bab015079d
2 changed files with 38 additions and 1 deletions

View File

@ -18,7 +18,7 @@ your own extensions.
Name: ghc-%{pkg_name}
Version: 0.11
Release: 2%{?dist}
Release: 3%{?dist}
Summary: %{common_summary}
License: BSD
@ -28,6 +28,7 @@ Patch0: xmonad-contrib-use_xft-flag.patch
Patch1: xmonad-contrib-0.10-xft-fonts.patch
Patch2: xmonad-contrib-0.10-ewmh-set-NET_WM_STATE.patch
Patch4: xmonad-contrib-0.10-PositionStore-dont-rescale-with-screen.patch
Patch5: xmonad-contrib-0.11-DebugEvents-getAtomName.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
@ -57,6 +58,9 @@ BuildRequires: ghc-xmonad-devel
%patch1 -p1 -b .orig-misc-fixed
%patch2 -p1 -b .orig-NET_WM_STATE
%patch4 -p1 -b .orig-rescale
%patch5 -p1 -b .orig-getAtomName
cabal-tweak-dep-ver X11 "=1.6" "=1.6.1"
%build
@ -80,6 +84,9 @@ BuildRequires: ghc-xmonad-devel
%changelog
* Tue Mar 19 2013 Jens Petersen <petersen@redhat.com> - 0.11-3
- fix build with X11-1.6.1
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

View File

@ -0,0 +1,30 @@
--- xmonad-contrib-0.11/XMonad/Hooks/DebugEvents.hs~ 2013-01-01 10:32:44.000000000 +0900
+++ xmonad-contrib-0.11/XMonad/Hooks/DebugEvents.hs 2013-03-19 13:48:30.678663498 +0900
@@ -42,27 +42,12 @@
import Data.Maybe (fromMaybe)
import Data.Monoid
import Foreign
-import Foreign.C.String
import Foreign.C.Types
import Numeric (showHex)
import System.Exit
import System.IO
import System.Process
--- this should move into X11
-foreign import ccall unsafe "XGetAtomName"
- xGetAtomName :: Display -> Atom -> IO CString
-
-getAtomName :: Display -> Atom -> IO (Maybe String)
-getAtomName d a = do
- n <- xGetAtomName d a
- if n == nullPtr
- then return Nothing
- else do
- n' <- peekCString n
- xFree n
- return $ Just n'
-
-- | Event hook to dump all received events. You should probably not use this
-- unconditionally; it will produce massive amounts of output.
debugEventsHook :: Event -> X All