Skip to content

Commit

Permalink
Add support for MAC OS X
Browse files Browse the repository at this point in the history
This closes #2.
  • Loading branch information
vrasneur committed Apr 1, 2016
1 parent 468b13b commit b979d03
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
22 changes: 15 additions & 7 deletions arbtt.cabal
Expand Up @@ -77,13 +77,21 @@ executable arbtt-capture
build-depends:
Win32
else
extra-libraries: Xss
other-modules:
Capture.X11
Graphics.X11.XScreenSaver
System.Locale.SetLocale
build-depends:
X11 > 1.4.4
if os(darwin)
cpp-options: -DDARWIN
frameworks: Foundation Carbon IOKit
other-modules:
Capture.OSX
Graphics.OSX.Window
System.Locale.SetLocale
else
extra-libraries: Xss
other-modules:
Capture.X11
Graphics.X11.XScreenSaver
System.Locale.SetLocale
build-depends:
X11 > 1.4.4
default-language: Haskell98

executable arbtt-stats
Expand Down
15 changes: 15 additions & 0 deletions arbtt.html
Expand Up @@ -176,6 +176,21 @@ <h3>Source installations</h3>
you'll probably need to put the full path to arbtt-capture
in the Exec line of the .desktop file.</p>
</li>

<li>
<b>Mac OS X support:</b>
<p>arbtt can run on Mac OS X systems. To compile it, you need to install the pkgconfig and pcre source packages
using <a href="http://brew.sh">Homebrew</a> or <a href="https://www.macports.org">MacPorts</a>. For Homebrew, you can execute:</p>
<code class="command">brew install pkgconfig</code><br>
<code class="command">brew install pcre</code><br>
<p>or for MacPorts:</p>
<code class="command">sudo port install pkgconfig</code><br>
<code class="command">sudo port install pcre</code><br>
<p>Then, you can compile arbtt using the usual cabal commands.</p>
<p>If you use MacPorts and have a linking error, it may be because of a conflict between the system libiconv and the MacPorts libiconv.
Execute the following cabal command to resolve the conflict:</p>
<code class="command">cabal configure --extra-lib-dir=/usr/lib</code><br>
<p>When the installation is done, your arbtt binaries will be located in <code>~/Library/Haskell/bin</code> or <code>~/.cabal/bin</code>.</p>
</li>
</ul>
</section>
Expand Down
8 changes: 6 additions & 2 deletions src/Capture.hs
@@ -1,15 +1,19 @@
{-# LANGUAGE CPP #-}

module Capture (
#ifdef WIN32
#if defined(WIN32)
module Capture.Win32
#elif defined(DARWIN)
module Capture.OSX
#else
module Capture.X11
#endif
) where

#ifdef WIN32
#if defined(WIN32)
import Capture.Win32
#elif defined(DARWIN)
import Capture.OSX
#else
import Capture.X11
#endif

0 comments on commit b979d03

Please sign in to comment.