threadscope 0.2.11.1 → 0.2.12
raw patch · 7 files changed
+41/−72 lines, 7 filesdep −gtk-mac-integrationdep ~basedep ~binarydep ~ghc-events
Dependencies removed: gtk-mac-integration
Dependency ranges changed: base, binary, ghc-events, gtk, template-haskell
Files
- GUI/App.hs +0/−27
- GUI/DataFiles.hs +10/−2
- GUI/Dialogs.hs +1/−1
- GUI/MainWindow.hs +1/−6
- README.md +19/−9
- threadscope.cabal +10/−12
- threadscope.ui +0/−15
GUI/App.hs view
@@ -1,6 +1,3 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE TemplateHaskell #-}- ------------------------------------------------------------------------------- -- | Module : GUI.App --@@ -9,33 +6,9 @@ module GUI.App (initApp) where --- Mac OS X-specific GTK imports-#if defined(darwin_HOST_OS)-import qualified Graphics.UI.Gtk as Gtk-import qualified Graphics.UI.Gtk.OSX as OSX-import GUI.DataFiles (loadLogo)-#endif- ------------------------------------------------------------------------------- -#if defined(darwin_HOST_OS)- -- | Initialize application--- Perform Mac OS X-specific application initialization-initApp :: IO ()-initApp = do- app <- OSX.applicationNew- menuBar <- Gtk.menuBarNew- OSX.applicationSetMenuBar app menuBar- logo <- $loadLogo- OSX.applicationSetDockIconPixbuf app (Just logo)- OSX.applicationReady app--#else---- | Initialize application -- Perform application initialization for non-Mac OS X platforms initApp :: IO () initApp = return ()--#endif
GUI/DataFiles.hs view
@@ -1,13 +1,16 @@+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module GUI.DataFiles ( ui , loadLogo ) where+import Control.Exception (IOException, Handler(..), catches) import System.IO import Data.FileEmbed import Graphics.UI.Gtk (Pixbuf, pixbufNewFromFile) import Language.Haskell.TH+import System.Glib (GError) import System.IO.Temp import qualified Data.ByteString as B import qualified Data.Text.Encoding as TE@@ -22,12 +25,17 @@ ui :: Q Exp ui = [| TE.decodeUtf8 $(makeRelativeToProject uiFile >>= embedFile) |] -renderLogo :: B.ByteString -> IO Pixbuf+renderLogo :: B.ByteString -> IO (Maybe Pixbuf) renderLogo bytes = withSystemTempFile logoFile $ \path h -> do B.hPut h bytes hClose h- pixbufNewFromFile path+ Just <$> pixbufNewFromFile path+ `catches`+ -- in case of a failure in the file IO or pixbufNewFromFile, return Nothing+ [ Handler $ \(_ :: IOException) -> return Nothing+ , Handler $ \(_ :: GError) -> return Nothing+ ] -- | Load the logo file as a 'Pixbuf'. loadLogo :: Q Exp
GUI/Dialogs.hs view
@@ -28,7 +28,7 @@ "Mikolaj Konarski <mikolaj@well-typed.com>", "Nicolas Wu <nick@well-typed.com>", "Eric Kow <eric@well-typed.com>"],- aboutDialogLogo := Just logo,+ aboutDialogLogo := logo, aboutDialogWebsite := "http://www.haskell.org/haskellwiki/ThreadScope", windowTransientFor := toWindow parent ]
GUI/MainWindow.hs view
@@ -134,19 +134,14 @@ zoomOutButton <- getWidget castToToolButton "cpus_zoomout" zoomFitButton <- getWidget castToToolButton "cpus_zoomfit" - --TODO: this is currently not used, but it'be nice if it were!- eventsTextEntry <- getWidget castToEntry "events_entry"- ------------------------------------------------------------------------ -- Show everything widgetShowAll mainWindow - widgetHide eventsTextEntry -- for now we hide it, see above.- ------------------------------------------------------------------------ logo <- $loadLogo- set mainWindow [ windowIcon := Just logo ]+ set mainWindow [ windowIcon := logo ] ------------------------------------------------------------------------ -- Status bar functionality
README.md view
@@ -1,4 +1,5 @@ # ThreadScope+ [](https://hackage.haskell.org/package/threadscope) [](http://packdeps.haskellers.com/feed?needle=threadscope) [](https://travis-ci.org/haskell/ThreadScope)@@ -9,20 +10,23 @@ Currently [pre-built binaries](https://github.com/haskell/ThreadScope/releases) for the following platforms are provided: * Ubuntu Trusty (64-bit)-* OS X+* macOS (XCode 11) * Windows (x64) GTK+2 needs to be installed for those binaries to work. -On OS X, `gtk-mac-integration` also needs to be installed.-```+On OS X, [`gtk-mac-integration`](https://github.com/jralls/gtk-mac-integration) also needs to be installed:++```sh brew install gtk+ gtk-mac-integration ``` On Windows, the [MSYS2](http://www.msys2.org) is the recommended way to install GTK+2. In MSYS2 MINGW64 shell:-```++```sh pacman -S $MINGW_PACKAGE_PREFIX-gtk2 ```+ then you can run the threadscope binary from the shell. ## Building from source@@ -38,11 +42,13 @@ ``` Then you can build threadscope using cabal:+ ```sh-cabal new-build+cabal v2-build ``` Or using stack:+ ```sh stack setup stack install@@ -50,18 +56,20 @@ ### OS X -GTK+ and gtk-mac-integration are required.+GTK+, gtk-mac-integration and GCC 9 are required: ```sh-brew install gtk+ gtk-mac-integration+brew install gtk+ gtk-mac-integration gcc@9 ``` Then you can build threadscope using cabal:+ ```sh-cabal new-build --constraint="gtk +have-quartz-gtk"+cabal v2-build --project-file=cabal.project.osx ``` Or using stack:+ ```sh stack setup stack install --flag gtk:have-quartz-gtk@@ -81,7 +89,7 @@ then you can build threadscope using cabal: ```sh-cabal new-build+cabal v2-build ``` Or you can use stack instead.@@ -89,6 +97,7 @@ CAVEAT: gtk2 needs to be installed twice: one for stack's MSYS2 environment and another for local MSYS2 environment. In command prompt:+ ```sh stack setup stack exec -- pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel@@ -99,6 +108,7 @@ ``` Then in MSYS2 MINGW64 shell:+ ```sh pacman -S $MINGW_PACKAGE_PREFIX-gtk2 echo 'export PATH=$APPDATA/local/bin:$PATH' >> .profile
threadscope.cabal view
@@ -1,5 +1,5 @@ Name: threadscope-Version: 0.2.11.1+Version: 0.2.12 Category: Development, Profiling, Trace Synopsis: A graphical tool for profiling parallel Haskell programs. Description: ThreadScope is a graphical viewer for thread profile@@ -35,10 +35,10 @@ Data-files: threadscope.ui, threadscope.png Extra-source-files: include/windows_cconv.h README.md-Tested-with: GHC == 7.10.2- GHC == 8.0.2- GHC == 8.2.2- GHC == 8.4.2+Tested-with: GHC == 8.2.2+ GHC == 8.4.4+ GHC == 8.6.5+ GHC == 8.8.2 source-repository head type: git@@ -46,26 +46,24 @@ Executable threadscope Main-is: Main.hs- Build-Depends: base >= 4.6 && < 5,- gtk >= 0.12 && < 0.15,+ Build-Depends: base >= 4.10 && < 5,+ gtk >= 0.12 && < 0.16, cairo < 0.14, glib < 0.14, pango < 0.14,- binary < 0.10,+ binary < 0.11, array < 0.6, mtl < 2.3, filepath < 1.5,- ghc-events >= 0.5 && < 0.9,+ ghc-events >= 0.5 && < 0.13, containers >= 0.2 && < 0.7, deepseq >= 1.1, text < 1.3, time >= 1.1 && < 1.10, bytestring < 0.11, file-embed < 0.1,- template-haskell < 2.14,+ template-haskell < 2.16, temporary >= 1.1 && < 1.4- if os(osx)- build-depends: gtk-mac-integration < 0.4 include-dirs: include Extensions: RecordWildCards, NamedFieldPuns, BangPatterns, PatternGuards
threadscope.ui view
@@ -1693,21 +1693,6 @@ <object class="GtkVBox" id="eventsbox_old"> <property name="visible">True</property> <child>- <object class="GtkEntry" id="events_entry">- <property name="visible">True</property>- <property name="can_focus">True</property>- <property name="invisible_char">●</property>- <property name="width_chars">20</property>- <property name="secondary_icon_stock">gtk-find</property>- <property name="secondary_icon_tooltip_text">Search for event</property>- </object>- <packing>- <property name="expand">False</property>- <property name="fill">True</property>- <property name="position">1</property>- </packing>- </child>- <child> <object class="GtkHBox" id="eventsHBox"> <property name="height_request">120</property> <property name="visible">True</property>