Skip to content

Commit c7468c3

Browse files
author
Stephan
committed
Merge pull request #3 from leksah/master
Make it easer to package vcsgui binaries on OS X
2 parents fc18d19 + 8d6bbef commit c7468c3

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

vcsgui/src/VCSGui/Common/SetupConfig.hs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import Data.Maybe
2121
import Control.Monad
2222
import System.Directory
2323
import System.Directory(doesDirectoryExist)
24-
import Data.List.Utils(elemRIndex)
25-
import Data.List(isInfixOf)
24+
import Data.List(findIndex)
2625
import Paths_vcsgui(getDataFileName)
2726

2827
import VCSGui.Common.Error
@@ -241,15 +240,12 @@ initSetupRepoGui mbConfig gui = do
241240
H.set (entRepo gui) $ path
242241
availableVCS <- discoverVCS path
243242
H.set (comboBoxVCSType gui) $ map (\vcs -> show vcs) availableVCS
244-
if isInfixOf [vcsType] availableVCS
245-
then do
246-
--get position (hopefully always index in liststore = index in list)
247-
let index = elemRIndex vcsType availableVCS
248-
249-
--set active
250-
comboBoxSetActive (H.getItem (comboBoxVCSType gui)) $ fromMaybe (-1) index
251-
else do
252-
return ()
243+
--get position (hopefully always index in liststore = index in list)
244+
case findIndex (== vcsType) availableVCS of
245+
Just index ->
246+
--set active
247+
comboBoxSetActive (H.getItem (comboBoxVCSType gui)) index
248+
_ -> return ()
253249
case mbExec of
254250
Nothing -> do
255251
H.set (checkbtExec gui) False

vcsgui/vcsgui.cabal

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ flag gtk3
3434
default: True
3535

3636
library
37-
build-depends: MissingH >=1.1.0.3 && <1.3,
37+
build-depends:
3838
filepath >=1.2.0.0 && < 1.4,
3939
base >=4.0.0.0 && <4.8,
4040
directory >=1.1.0.0 && <1.3,
@@ -63,7 +63,7 @@ library
6363

6464
executable vcsgui
6565
main-is: Main.hs
66-
build-depends: MissingH >=1.1.0.3 && <1.3,
66+
build-depends:
6767
filepath >=1.2.0.0 && < 1.4,
6868
base >=4.0.0.0 && <4.8,
6969
directory >=1.1.0.0 && <1.3,
@@ -74,6 +74,8 @@ executable vcsgui
7474
build-depends: gtk3 >=0.12.4.1 && <0.13
7575
else
7676
build-depends: gtk >=0.12.4.1 && <0.13
77+
if os(osx)
78+
ghc-options: -optl-headerpad_max_install_names
7779
buildable: True
7880
hs-source-dirs: src
7981
other-modules: VCSGui.Svn.Helper VCSGui.Common.Process
@@ -89,7 +91,7 @@ executable vcsgui
8991

9092
executable vcsgui-askpass
9193
main-is: Main.hs
92-
build-depends: MissingH >=1.1.0.3 && <1.3,
94+
build-depends:
9395
filepath >=1.2.0.0 && < 1.4,
9496
base >=4.0.0.0 && <4.8,
9597
directory >=1.1.0.0 && <1.3,
@@ -100,6 +102,8 @@ executable vcsgui-askpass
100102
build-depends: gtk3 >=0.12.4.1 && <0.13
101103
else
102104
build-depends: gtk >=0.12.4.1 && <0.13
105+
if os(osx)
106+
ghc-options: -optl-headerpad_max_install_names
103107
buildable: True
104108
hs-source-dirs: src/exe/askpass src
105109
other-modules: VCSGui.Svn.Helper VCSGui.Common.Process

0 commit comments

Comments
 (0)