Skip to content

Commit

Permalink
I just learned about MIN_VERSION_ macros. This is MUCH simpler.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrnewton committed Oct 11, 2011
1 parent d6782e3 commit a7a16c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
24 changes: 2 additions & 22 deletions HSH.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,50 +23,30 @@ flag buildtests
description: Build the executable to run unit tests
default: False

flag newerprocess
description: Build using the process-1.1 as opposed to 1.0 API.
default: False


library
Exposed-Modules: HSH, HSH.Command, HSH.ShellEquivs, HSH.Channel
Extensions: ExistentialQuantification, OverlappingInstances,
UndecidableInstances, FlexibleContexts, CPP
Build-Depends: base >= 4 && < 5, mtl, regex-compat, MissingH>=1.0.0,
Build-Depends: base >= 4 && < 5, mtl, process, regex-compat, MissingH>=1.0.0,
hslogger, filepath, regex-base, regex-posix, directory,
bytestring
if !os(windows)
Build-Depends: unix
if flag(newerprocess)
Build-Depends: process >= 1.1.0.0
else
Build-Depends: process < 1.1.0.0
GHC-Options: -O2 -threaded -Wall

if flag(newerprocess)
GHC-options: -DPROCESS_LIB_1_1


Executable runtests
if flag(buildtests)
Buildable: True
Build-Depends: base >= 4 && < 5, mtl, regex-compat,
Build-Depends: base >= 4 && < 5, mtl, process, regex-compat,
MissingH>=1.0.0,
hslogger, filepath, regex-base, regex-posix, directory,
bytestring, HUnit, testpack
if !os(windows)
Build-Depends: unix
if flag(newerprocess)
Build-Depends: process >= 1.1.0.0
else
Build-Depends: process < 1.1.0.0
else
Buildable: False
Main-Is: runtests.hs
HS-Source-Dirs: testsrc, .
Extensions: ExistentialQuantification, OverlappingInstances,
UndecidableInstances, FlexibleContexts, CPP
GHC-Options: -O2 -threaded

if flag(newerprocess)
GHC-options: -DPROCESS_LIB_1_1
4 changes: 2 additions & 2 deletions HSH/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ genericCommand c environ (ChanHandle ih) =
std_out = CreatePipe,
std_err = Inherit,
close_fds = True
#ifdef PROCESS_LIB_1_1
#if MIN_VERSION_process(1,1,0)
-- Or use GHC version as a proxy: __GLASGOW_HASKELL__ >= 720
-- Added field in process 1.1.0.0:
, create_group = False
Expand All @@ -310,7 +310,7 @@ genericCommand cspec environ ichan =
std_out = CreatePipe,
std_err = Inherit,
close_fds = True
#ifdef PROCESS_LIB_1_1
#if MIN_VERSION_process(1,1,0)
-- Added field in process 1.1.0.0:
, create_group = False
#endif
Expand Down

0 comments on commit a7a16c2

Please sign in to comment.