Skip to content

Commit

Permalink
Switch to Gtk2Hs 0.13 and leksah-server 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Jun 29, 2014
1 parent beb90bb commit 4fbed47
Show file tree
Hide file tree
Showing 29 changed files with 255 additions and 199 deletions.
2 changes: 1 addition & 1 deletion data/prefs.lkshp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Default pane path:
Paths under which haskell sources for packages may be found:
[]
Unpack source for cabal packages to:
Just "~/.leksah-0.13/packageSources"
Just "~/.leksah-0.14/packageSources"
URL from which to download prebuilt metadata:
"http://www.leksah.org"
Strategy for downloading prebuilt metadata:
Expand Down
2 changes: 1 addition & 1 deletion data/prefscoll.lkshp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Paths under which haskell sources for packages may be found:
[]
Unpack source for cabal packages to:
Just "~/.leksah-0.13/packageSources"
Just "~/.leksah-0.14/packageSources"
URL from which to download prebuilt metadata:
"http://www.leksah.org"
Strategy for downloading prebuilt metadata:
Expand Down
36 changes: 18 additions & 18 deletions leksah.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: leksah
version: 0.13.4.3
version: 0.14.0.0
cabal-version: >=1.10
build-type: Simple
license: GPL
Expand Down Expand Up @@ -207,9 +207,9 @@ library

if os(osx)
if flag(gtk3)
build-depends: gtk3-mac-integration >= 0.2.0.0 && <0.3
build-depends: gtk3-mac-integration >= 0.3.0.0 && <0.4
else
build-depends: gtk-mac-integration >= 0.2.0.0 && <0.3
build-depends: gtk-mac-integration >= 0.3.0.0 && <0.4

if flag(yi)
build-depends: yi >=0.8.1 && <0.9
Expand All @@ -223,10 +223,10 @@ library
ghc-options: -threaded

if flag(gtk3)
build-depends: gtk3 >=0.12.4 && <0.13, gtksourceview3 >=0.10.0 && <0.13
build-depends: gtk3 >=0.13.0.0 && <0.14, gtksourceview3 >=0.13.0.0 && <0.14
cpp-options: -DMIN_VERSION_gtk=MIN_VERSION_gtk3
else
build-depends: gtk >=0.12.4 && <0.13, gtksourceview2 >=0.10.0 && <0.13
build-depends: gtk >=0.13.0.0 && <0.14, gtksourceview2 >=0.13.0.0 && <0.14

if flag(webkit)
if flag(gtk3)
Expand All @@ -246,17 +246,17 @@ library

build-depends: Cabal >=1.10.2.0 && <1.22, base >=4.0.0.0 && <4.8, binary >=0.5.0.0 && <0.8,
bytestring >=0.9.0.1 && <0.11, containers >=0.2.0.0 && <0.6, directory >=1.0.0.2 && <3.1,
filepath >=1.1.0.1 && <1.4, glib >=0.10 && <0.13,
mtl >=1.1.0.2 && <2.2, old-time >=1.0.0.1 && <1.2,
filepath >=1.1.0.1 && <1.4, glib >=0.13.0.0 && <0.14,
mtl >=1.1.0.2 && <2.3, old-time >=1.0.0.1 && <1.2,
parsec >=2.1.0.1 && <3.2, pretty >=1.0.1.0 && <1.2,
regex-tdfa >=1.1 && <1.3, regex-base ==0.93.*, utf8-string >=0.3.1.1 && <0.4, array >=0.2.0.0 && <0.6,
time >=0.1 && <1.5, ltk >= 0.13.2.0 && <0.14, binary-shared >= 0.8 && <0.9, deepseq >= 1.1.0.0 && <1.4,
hslogger >= 1.0.7 && <1.3, leksah-server >=0.13.1.0 && <0.14, network >= 2.2 && <3.0,
time >=0.1 && <1.5, ltk >= 0.14.0.0 && <0.15, binary-shared >= 0.8 && <0.9, deepseq >= 1.1.0.0 && <1.4,
hslogger >= 1.0.7 && <1.3, leksah-server >=0.14.0.0 && <0.15, network >= 2.2 && <3.0,
ghc >=6.10.1 && <7.9, strict >= 0.3.2 && <0.4, conduit >= 1.0.8 && <1.1, text >= 0.11.1.5 && < 1.2,
gio >=0.12.2 && <0.13, transformers >=0.2.2.0 && <0.4,
gio >=0.13.0.0 && <0.14, transformers >=0.2.2.0 && <0.5,
executable-path >=0.0.3 && <0.1,
vcsgui >=0.0.4 && < 0.1, vcswrapper >=0.0.4 && < 0.1,
QuickCheck >=2.4.2 && <2.7, haskell-src-exts >=1.13.5 && <1.15,
QuickCheck >=2.4.2 && <2.8, haskell-src-exts >=1.13.5 && <1.16,
hlint >=1.8.59 && <1.9, vado >=0.0.1 && <0.1, shakespeare >=2.0.0.1 && <2.1
exposed-modules: IDE.Leksah IDE.Completion IDE.ImportTool IDE.Find
IDE.Sandbox IDE.Session IDE.Command IDE.Keymap IDE.Utils.GUIUtils
Expand Down Expand Up @@ -303,7 +303,7 @@ Executable leksah
ghc-options: -threaded

hs-source-dirs: main
build-depends: leksah == 0.13.4.3, base >= 4.0.0.0 && <=4.8, gtk3 -any
build-depends: leksah == 0.14.0.0, base >= 4.0.0.0 && <=4.8, gtk3 -any
if os(linux) && flag(loc)
cpp-options: -DLOCALIZATION
build-depends: hgettext, setlocale
Expand All @@ -322,14 +322,14 @@ executable bewleksah
if !flag(webkit)
buildable: False
else
build-depends: leksah ==0.13.4.3, base >=4.0.0.0 && <=4.8,
build-depends: leksah ==0.14.0.0, base >=4.0.0.0 && <=4.8,
jsaddle -any, ghcjs-dom -any
if flag(gtk3)
build-depends: gtk3 >=0.12.4 && <0.13, gtksourceview3 >=0.10.0 && <0.13,
build-depends: gtk3 >=0.13.0.0 && <0.14, gtksourceview3 >=0.13.0.0 && <0.14,
webkitgtk3 -any, webkitgtk3-javascriptcore -any
cpp-options: -DMIN_VERSION_gtk=MIN_VERSION_gtk3
else
build-depends: gtk >=0.12.4 && <0.13, gtksourceview2 >=0.10.0 && <0.13,
build-depends: gtk >=0.13.0.0 && <0.14, gtksourceview2 >=0.13.0.0 && <0.14,
webkit -any, webkit-javascriptcore -any

main-is: Main.hs
Expand All @@ -339,14 +339,14 @@ executable bewleksah

test-suite tests
build-depends: base >=4.0.0.0 && <4.8, Cabal >=1.10.2.0 && <1.22,
QuickCheck >=2.4.2 && <2.7, leksah ==0.13.4.3,
QuickCheck >=2.4.2 && <2.8, leksah ==0.14.0.0,
containers, ltk, leksah-server, hslogger,
transformers, glib, monad-loops
if flag(gtk3)
build-depends: gtk3 >=0.12.4 && <0.13, gtksourceview3 >=0.10.0 && <0.13, webkitgtk3 -any
build-depends: gtk3 >=0.13.0.0 && <0.14, gtksourceview3 >=0.13.0.0 && <0.14, webkitgtk3 -any
cpp-options: -DMIN_VERSION_gtk=MIN_VERSION_gtk3
else
build-depends: gtk >=0.12.4 && <0.13, gtksourceview2 >=0.10.0 && <0.13, webkit -any
build-depends: gtk >=0.13.0.0 && <0.14, gtksourceview2 >=0.13.0.0 && <0.14, webkit -any
if flag(yi)
build-depends: yi >=0.6.6.1 && <0.7
type: exitcode-stdio-1.0
Expand Down
6 changes: 3 additions & 3 deletions osx/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Leksah</string>
<key>CFBundleGetInfoString</key>
<string>0.13.0.0</string>
<string>0.14.0.0</string>
<key>CFBundleIconFile</key>
<string>leksah.icns</string>
<key>CFBundleIdentifier</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.13.0.0</string>
<string>0.14.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.13.0.0</string>
<string>0.14.0.0</string>
<key>NSHumanReadableCopyright</key>
<string>2007-2011 Jürgen Nicklisch-Franken, GNU General Public License.</string>
<key>LSMinimumSystemVersion</key>
Expand Down
17 changes: 10 additions & 7 deletions osx/leksah.bundle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
either define your own or just hardcode the path here.
-->
<prefix name="default">${env:JHBUILD_PREFIX}</prefix>
<prefix name="leksah-bin">${env:LEKSAH_BIN_DIR}</prefix>
<prefix name="leksah">${env:LEKSAH_PREFIX}</prefix>
<prefix name="leksah-server-bin">${env:LEKSAH_SERVER_BIN_DIR}</prefix>
<prefix name="leksah-server">${env:LEKSAH_SERVER_PREFIX}</prefix>
<prefix name="vcsgui-bin">${env:VCSGUI_BIN_DIR}</prefix>
<prefix name="vcsgui">${env:VCSGUI_PREFIX}</prefix>
<prefix name="hlint">${env:HLINT_PREFIX}</prefix>

Expand Down Expand Up @@ -54,12 +57,12 @@
-->
<plist>${project}/Info.plist</plist>

<main-binary>${prefix:leksah}/bin/leksah</main-binary>
<main-binary>${prefix:leksah-bin}/bin/leksah</main-binary>

<binary>${prefix:leksah-server}/bin/leksahecho</binary>
<binary>${prefix:leksah-server}/bin/leksah-server</binary>
<binary>${prefix:vcsgui}/bin/vcsgui</binary>
<binary>${prefix:vcsgui}/bin/vcsgui-askpass</binary>
<binary>${prefix:leksah-server-bin}/bin/leksahecho</binary>
<binary>${prefix:leksah-server-bin}/bin/leksah-server</binary>
<binary>${prefix:vcsgui-bin}/bin/vcsgui</binary>
<binary>${prefix:vcsgui-bin}/bin/vcsgui-askpass</binary>

<!-- Copy in the input methods. Dunno if they actually work with
OSX. Note the ${gtkdir} macro, which expands to the correct
Expand Down Expand Up @@ -132,11 +135,11 @@
</data>

<data dest="${bundle}/Contents/Resources/share/leksah">
${prefix:leksah}/share
${prefix:leksah}
</data>

<data dest="${bundle}/Contents/Resources/share/hlint">
${prefix:hlint}/share
${prefix:hlint}
</data>

<!-- Copy in the themes data. You may want to trim this to save space
Expand Down
1 change: 1 addition & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ghc-pkg$GHCVERSION unregister --force webkitgtk3-javascriptcore || true
ghc-pkg$GHCVERSION unregister --force webkit || true
ghc-pkg$GHCVERSION unregister --force webkitgtk3 || true
ghc-pkg$GHCVERSION unregister --force gtk-mac-integration || true
ghc-pkg$GHCVERSION unregister --force gtk3-mac-integration || true
ghc-pkg$GHCVERSION unregister --force gtk || true
ghc-pkg$GHCVERSION unregister --force gtk3 || true
ghc-pkg$GHCVERSION unregister --force pango || true
Expand Down
20 changes: 9 additions & 11 deletions scripts/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,29 @@ export GTK_PREFIX=`pkg-config --libs-only-L gtk+-3.0 | sed 's|^-L||' | sed 's|/l

echo Staging Leksah in $GTK_PREFIX

# cabal sandbox init || true
# (cd vendor/yi/yi && cabal sandbox init --sandbox=../../../.cabal-sandbox) || true
# (cd vendor/ltk && cabal sandbox init --sandbox=../../.cabal-sandbox) || true
# (cd vendor/leksah-server && cabal sandbox init --sandbox=../../.cabal-sandbox) || true
# cabal sandbox add-source ./vendor/ltk ./vendor/leksah-server ./vendor/yi/yi || true

# These don't like all the extra options we pass (CPPFLAGS and --extra-lib-dirs)
# Gtk2Hs needs the latest Cabal to install properly
cabal install --with-ghc=ghc$GHCVERSION -j4 text parsec network uniplate Cabal --constraint='text>=0.11.3.1' --constraint='parsec>=3.1.3' || true
# cabal install --with-ghc=ghc$GHCVERSION -j4 text parsec network uniplate Cabal --constraint='text>=0.11.3.1' --constraint='parsec>=3.1.3' --constraint='ghc -any' || true

# Needed for installing curl package on windows
export CPPFLAGS=`pkg-config --cflags-only-I libcurl`

# Only used by OS X
# export DYLD_LIBRARY_PATH="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources:$GTK_PREFIX/lib:$DYLD_LIBRARY_PATH"

echo https://github.com/leksah/ltk > sources.txt
echo https://github.com/leksah/leksah-server >> sources.txt

# echo ./vendor/gtk2hs >> sources.txt
echo ./ >> sources.txt

if test "`uname`" = "Darwin"; then
cabal install gtk3 ghcjs-dom jsaddle --with-ghc=ghc$GHCVERSION -j4 -fhave-quartz-gtk -fwebkit --with-gcc=gcc-mp-4.8 || exit
cabal-meta install --with-ghc=ghc$GHCVERSION -j4 -flibcurl --with-gcc=gcc-mp-4.8 || exit
cabal install ./ ./vendor/ltk ./vendor/leksah-server ./vendor/yi/yi gtk3 ghcjs-dom jsaddle --with-ghc=ghc$GHCVERSION -j4 -fhave-quartz-gtk -fwebkit -flibcurl -fyi -fpango --with-gcc=gcc-mp-4.8 || exit
else
HPDIR=`which ghc` || exit
HPDIR=`dirname "$HPDIR"` || exit
HPDIR=`dirname "$HPDIR"` || exit
cabal install gtk3 ghcjs-dom jsaddle --with-ghc=ghc$GHCVERSION -j4 --extra-lib-dirs="$HPDIR"/mingw/lib --extra-lib-dirs=/c/MinGWRPM/lib -fwebkit --force-reinstalls || bash || exit
cabal-meta install --with-ghc=ghc$GHCVERSION -j4 --extra-lib-dirs="$HPDIR"/mingw/lib --extra-lib-dirs=/c/MinGWRPM/lib -flibcurl --force-reinstalls || bash || exit
cabal install install ./ ./vendor/ltk ./vendor/leksah-server ./vendor/yi/yi gtk3 ghcjs-dom jsaddle --with-ghc=ghc$GHCVERSION -j4 --extra-lib-dirs="$HPDIR"/mingw/lib --extra-lib-dirs=/c/MinGWRPM/lib -fwebkit -flibcurl --force-reinstalls || bash || exit
# if [ "$GHC_VER" != "7.0.3" ] && [ "$GHC_VER" != "7.0.4" ] && [ "$GHC_VER" != "7.6.1" ]; then
# echo https://github.com/yi-editor/yi.git >> sources.txt
# export LEKSAH_CONFIG_ARGS="$LEKSAH_CONFIG_ARGS -fyi -f-vty -f-dyre -fpango"
Expand Down
1 change: 1 addition & 0 deletions sources.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
https://github.com/leksah/ltk
https://github.com/leksah/leksah-server
https://github.com/leksah/yi
./
9 changes: 6 additions & 3 deletions src/IDE/Find.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
--
Expand Down Expand Up @@ -80,6 +81,7 @@ import Foreign.C.Types (CInt(..))
import Foreign.Ptr (Ptr(..))
import Foreign.ForeignPtr (withForeignPtr)
import Graphics.UI.GtkInternals (unToolbar)
import Data.Text (Text)

foreign import ccall safe "gtk_toolbar_set_icon_size"
gtk_toolbar_set_icon_size :: Ptr Toolbar -> CInt -> IO ()
Expand Down Expand Up @@ -270,8 +272,9 @@ constructFindReplace = reifyIDE $ \ ideR -> do
toolItemSetExpand entryTool True
toolbarInsert toolbar entryTool 0

let column0 = makeColumnIdString 0
store <- listStoreNew []
customStoreSetColumn store (makeColumnIdString 0) id
customStoreSetColumn store column0 id

completion <- entryCompletionNew
entrySetCompletion entry completion
Expand All @@ -283,7 +286,7 @@ constructFindReplace = reifyIDE $ \ ideR -> do
(\ cd -> [cellText := cd])
entryCompletionSetMatchFunc completion (matchFunc store)
on completion matchSelected $ \ model iter -> do
txt <- treeModelGetValue model iter (makeColumnIdString 0)
txt <- treeModelGetValue model iter column0
entrySetText entry txt
doSearch toolbar Forward ideR
return True
Expand Down Expand Up @@ -315,7 +318,7 @@ constructFindReplace = reifyIDE $ \ ideR -> do
containerAdd labelTool label
toolbarInsert toolbar labelTool 0

after entry insertText (\ t i -> do
after entry insertText (\ (t::Text) i -> do
doSearch toolbar Insert ideR
return i)
after entry deleteText (\ _ _ -> doSearch toolbar Delete ideR)
Expand Down
2 changes: 1 addition & 1 deletion src/IDE/ImportTool.hs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ addImport' nis filePath descr descrList continuation = do
impDecl{importSpecs = Just (ImportSpecList False (nub (newImportSpec : listIE)))}
Nothing ->
impDecl{importSpecs = Just (ImportSpecList False [newImportSpec])}
noLocation = Location 0 0 0 0
noLocation = Location "" 0 0 0 0

getRealId descr id = case descr of
Reexported rdescr -> getRealId (dsrDescr rdescr) id
Expand Down
20 changes: 11 additions & 9 deletions src/IDE/Leksah.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ import Control.Monad (when, unless, liftM)
import Control.Monad.IO.Class (MonadIO(..))
import Control.Applicative ((<$>))
import qualified Data.Text as T (unpack, stripPrefix)
import Data.Text (Text)
import Data.Monoid ((<>))

-- --------------------------------------------------------------------
-- Command line options
Expand Down Expand Up @@ -290,7 +292,7 @@ startMainWindow yiControl sessionFP mbWorkspaceFP sourceFPs startupPrefs isFirst
specialKeys <- buildSpecialKeys keyMap accelActions

win <- windowNew
widgetSetName win "Leksah Main Window"
widgetSetName win ("Leksah Main Window"::Text)
let fs = FrameState
{ windows = [win]
, uiManager = uiManager
Expand Down Expand Up @@ -341,7 +343,7 @@ startMainWindow yiControl sessionFP mbWorkspaceFP sourceFPs startupPrefs isFirst
reflectIDE (makeMenu uiManager accelActions menuDescription') ideR
nb <- reflectIDE (newNotebook []) ideR
after nb switchPage (\i -> reflectIDE (handleNotebookSwitch nb i) ideR)
widgetSetName nb $"root"
widgetSetName nb ("root"::Text)
on win deleteEvent . liftIO $ reflectIDE quit ideR >> return True
reflectIDE (instrumentWindow win startupPrefs (castToWidget nb)) ideR
reflectIDE (do
Expand Down Expand Up @@ -443,18 +445,18 @@ firstStart prefs = do
dialog <- dialogNew
setLeksahIcon dialog
set dialog [
windowTitle := "Welcome to Leksah, the Haskell IDE",
windowTitle := ("Welcome to Leksah, the Haskell IDE"::Text),
windowWindowPosition := WinPosCenter]
dialogAddButton dialog "gtk-ok" ResponseOk
dialogAddButton dialog "gtk-cancel" ResponseCancel
dialogAddButton dialog ("gtk-ok"::Text) ResponseOk
dialogAddButton dialog ("gtk-cancel"::Text) ResponseCancel
#ifdef MIN_VERSION_gtk3
vb <- dialogGetContentArea dialog
#else
vb <- dialogGetUpper dialog
#endif
label <- labelNew (Just (
"Before you start using Leksah it will collect and download metadata about your installed Haskell packages.\n" ++
"You can add folders under which you have sources for Haskell packages not available from Hackage."))
"Before you start using Leksah it will collect and download metadata about your installed Haskell packages.\n" <>
"You can add folders under which you have sources for Haskell packages not available from Hackage."::Text))
(widget, setInj, getExt,notifier) <- buildEditor (fDescription configDir) prefs
boxPackStart (castToBox vb) label PackNatural 7
sw <- scrolledWindowNew Nothing Nothing
Expand Down Expand Up @@ -502,7 +504,7 @@ firstBuild newPrefs = do
dialog <- dialogNew
setLeksahIcon dialog
set dialog [
windowTitle := "Leksah: Updating Metadata",
windowTitle := ("Leksah: Updating Metadata"::Text),
windowWindowPosition := WinPosCenter,
windowDeletable := False]
#ifdef MIN_VERSION_gtk3
Expand All @@ -511,7 +513,7 @@ firstBuild newPrefs = do
vb <- dialogGetUpper dialog
#endif
progressBar <- progressBarNew
progressBarSetText progressBar "Please wait while Leksah collects information about Haskell packages on your system"
progressBarSetText progressBar ("Please wait while Leksah collects information about Haskell packages on your system"::Text)
progressBarSetFraction progressBar 0.0
boxPackStart (castToBox vb) progressBar PackGrow 7
forkIO $ do
Expand Down
Loading

0 comments on commit 4fbed47

Please sign in to comment.