diff options
author | Will Thompson <will@willthompson.co.uk> | 2017-07-20 17:24:56 +0100 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2017-07-20 17:24:56 +0100 |
commit | c686a6717299bb41b1eb263669f9f0c4ebf0ec40 (patch) | |
tree | 46bb5992a8699c3c9a93cc4c22a40aad2518a493 | |
parent | 320f0e9369fe485e0bcb1441040919e6f48fba90 (diff) | |
parent | b508c01ebecee7608b0f7713eecbb6e7ac822413 (diff) |
Merge branch 'flatpak'
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Bustle.hs | 2 | ||||
-rw-r--r-- | Bustle/Translation.hs | 11 | ||||
-rw-r--r-- | Bustle/UI/AboutDialog.hs | 4 | ||||
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | bustle.cabal | 19 | ||||
-rw-r--r-- | data/icons/16x16/org.freedesktop.Bustle.png (renamed from data/icons/16x16/bustle.png) | bin | 519 -> 519 bytes | |||
-rw-r--r-- | data/icons/22x22/org.freedesktop.Bustle.png (renamed from data/icons/22x22/bustle.png) | bin | 716 -> 716 bytes | |||
-rw-r--r-- | data/icons/256x256/org.freedesktop.Bustle.png (renamed from data/icons/256x256/bustle.png) | bin | 8774 -> 8774 bytes | |||
-rw-r--r-- | data/icons/32x32/org.freedesktop.Bustle.png (renamed from data/icons/32x32/bustle.png) | bin | 1049 -> 1049 bytes | |||
-rw-r--r-- | data/icons/48x48/org.freedesktop.Bustle.png (renamed from data/icons/48x48/bustle.png) | bin | 1669 -> 1669 bytes | |||
-rw-r--r-- | data/icons/scalable/org.freedesktop.Bustle-symbolic.svg (renamed from data/icons/scalable/bustle-symbolic.svg) | 0 | ||||
-rw-r--r-- | data/icons/scalable/org.freedesktop.Bustle.svg (renamed from data/icons/scalable/bustle.svg) | 0 | ||||
-rw-r--r-- | data/org.freedesktop.Bustle.appdata.xml.in (renamed from data/bustle.appdata.xml.in) | 3 | ||||
-rw-r--r-- | data/org.freedesktop.Bustle.desktop.in (renamed from data/bustle.desktop.in) | 2 | ||||
-rw-r--r-- | org.freedesktop.Bustle.json | 231 |
16 files changed, 276 insertions, 23 deletions
@@ -11,3 +11,8 @@ cabal-dev/ cabal.sandbox.config bustle.appdata.xml bustle.desktop + +/_build +/.stack-work +/.vscode +/.flatpak-builder @@ -24,6 +24,7 @@ import System.IO (hPutStrLn, stderr) import System.Environment (getArgs) import System.Exit (exitFailure) import Control.Monad (when) +import System.Glib.Utils (setApplicationName) import Bustle.Noninteractive import Bustle.Translation import Bustle.UI @@ -51,6 +52,7 @@ runOne _ _ = usage True main :: IO () main = do initTranslation + setApplicationName (__ "Bustle") args <- getArgs case args of diff --git a/Bustle/Translation.hs b/Bustle/Translation.hs index dadc6e6..3fecef7 100644 --- a/Bustle/Translation.hs +++ b/Bustle/Translation.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} module Bustle.Translation ( initTranslation @@ -5,13 +6,18 @@ module Bustle.Translation ) where +#ifdef USE_HGETTEXT import Text.I18N.GetText import System.Locale.SetLocale import System.IO.Unsafe import GetText_bustle +#endif initTranslation :: IO () +__ :: String -> String + +#ifdef USE_HGETTEXT initTranslation = do setLocale LC_ALL (Just "") domain <- getMessageCatalogDomain @@ -21,5 +27,8 @@ initTranslation = do return () -- FIXME: I do not like this unsafePerformIO one little bit. -__ :: String -> String __ = unsafePerformIO . getText +#else +initTranslation = return () +__ = id +#endif
\ No newline at end of file diff --git a/Bustle/UI/AboutDialog.hs b/Bustle/UI/AboutDialog.hs index 5e9c360..46f7eec 100644 --- a/Bustle/UI/AboutDialog.hs +++ b/Bustle/UI/AboutDialog.hs @@ -48,9 +48,9 @@ showAboutDialog window = do , aboutDialogComments := __ "Someone's favourite D-Bus profiler" , aboutDialogWebsite := "http://www.freedesktop.org/wiki/Software/Bustle/" , aboutDialogAuthors := authors - , aboutDialogCopyright := "© 2008–2015 Will Thompson, Collabora Ltd. and contributors" + , aboutDialogCopyright := "© 2008–2017 Will Thompson, Collabora Ltd. and contributors" , aboutDialogLicense := license - , aboutDialogLogoIconName := Just "bustle" + , aboutDialogLogoIconName := Just "org.freedesktop.Bustle" , windowModal := True , windowTransientFor := window ] @@ -13,13 +13,13 @@ BINARIES = \ $(NULL) MANPAGE = bustle-pcap.1 -DESKTOP_FILE = bustle.desktop -APPDATA_FILE = bustle.appdata.xml +DESKTOP_FILE = org.freedesktop.Bustle.desktop +APPDATA_FILE = org.freedesktop.Bustle.appdata.xml ICON_SIZES = 16x16 22x22 32x32 48x48 256x256 ICONS = \ - data/icons/scalable/bustle.svg \ - data/icons/scalable/bustle-symbolic.svg \ - $(foreach size,$(ICON_SIZES),data/icons/$(size)/bustle.png) \ + data/icons/scalable/org.freedesktop.Bustle.svg \ + data/icons/scalable/org.freedesktop.Bustle-symbolic.svg \ + $(foreach size,$(ICON_SIZES),data/icons/$(size)/org.freedesktop.Bustle.png) \ $(NULL) all: $(BINARIES) $(MANPAGE) $(DESKTOP_FILE) $(APPDATA_FILE) $(ICONS) @@ -31,10 +31,10 @@ BUSTLE_PCAP_HEADERS = c-sources/pcap-monitor.h $(BUSTLE_PCAP_GENERATED_HEADERS) bustle-pcap.1: dist/build/bustle-pcap help2man --output=$@ --no-info --name='Generate D-Bus logs for bustle' $< -bustle.desktop: data/bustle.desktop.in +org.freedesktop.Bustle.desktop: data/org.freedesktop.Bustle.desktop.in LC_ALL=C intltool-merge -d -u po $< $@ -bustle.appdata.xml: data/bustle.appdata.xml.in +org.freedesktop.Bustle.appdata.xml: data/org.freedesktop.Bustle.appdata.xml.in LC_ALL=C intltool-merge -x -u po $< $@ dist/build/bustle-pcap: $(BUSTLE_PCAP_SOURCES) $(BUSTLE_PCAP_HEADERS) @@ -61,9 +61,9 @@ install: all mkdir -p $(DATADIR)/appdata cp $(APPDATA_FILE) $(DATADIR)/appdata $(foreach size,$(ICON_SIZES),mkdir -p $(DATADIR)/icons/hicolor/$(size)/apps; ) - $(foreach size,$(ICON_SIZES),cp data/icons/$(size)/bustle.png $(DATADIR)/icons/hicolor/$(size)/apps; ) + $(foreach size,$(ICON_SIZES),cp data/icons/$(size)/org.freedesktop.Bustle.png $(DATADIR)/icons/hicolor/$(size)/apps; ) mkdir -p $(DATADIR)/icons/hicolor/scalable/apps - cp data/icons/scalable/bustle-symbolic.svg $(DATADIR)/icons/hicolor/scalable/apps + cp data/icons/scalable/org.freedesktop.Bustle-symbolic.svg $(DATADIR)/icons/hicolor/scalable/apps $(MAKE) update-icon-cache uninstall: @@ -71,8 +71,8 @@ uninstall: rm -f $(MAN1DIR)/$(MANPAGE) rm -f $(DATADIR)/applications/$(DESKTOP_FILE) rm -f $(DATADIR)/appdata/$(APPDATA_FILE) - $(foreach size,$(ICON_SIZES),rm -f $(DATADIR)/icons/hicolor/$(size)/apps/bustle.png) - rm -f $(DATADIR)/icons/hicolor/scalable/apps/bustle-symbolic.svg + $(foreach size,$(ICON_SIZES),rm -f $(DATADIR)/icons/hicolor/$(size)/apps/org.freedesktop.Bustle.png) + rm -f $(DATADIR)/icons/hicolor/scalable/apps/org.freedesktop.Bustle-symbolic.svg $(MAKE) update-icon-cache clean: diff --git a/bustle.cabal b/bustle.cabal index 5a7e944..e5bcd80 100644 --- a/bustle.cabal +++ b/bustle.cabal @@ -1,6 +1,6 @@ Name: bustle Category: Network, Desktop -Version: 0.5.4 +Version: 0.5.999 Cabal-Version: >= 1.24 Tested-With: GHC == 7.8.*, GHC == 7.10.* Synopsis: Draw sequence diagrams of D-Bus traffic @@ -64,6 +64,10 @@ Source-Repository head Type: git Location: git://anongit.freedesktop.org/bustle +Flag hgettext + Description: Enable translations. Since there are no translations this is currently rather pointless. + Default: True + Flag InteractiveTests Description: Build interactive test programs Default: False @@ -115,14 +119,16 @@ Executable bustle , glib , gio , gtk3 - , hgettext >= 0.1.5 , mtl >= 2.2.1 , pango , pcap , process - , setlocale , text , time + if flag(hgettext) + Build-Depends: hgettext >= 0.1.5 + , setlocale + cpp-options: -DUSE_HGETTEXT Executable test-monitor if flag(InteractiveTests) @@ -148,13 +154,12 @@ Executable test-monitor -- 0.13.6 doesn't compile with GCC 5: https://github.com/gtk2hs/gtk2hs/issues/104 , gtk3 >= 0.13.7 , glib - , hgettext , mtl , pango , pcap - , setlocale , text + Executable dump-messages if flag(InteractiveTests) buildable: True @@ -207,8 +212,6 @@ Test-suite test-renderer , mtl , text , pango - , hgettext - , setlocale , test-framework , test-framework-hunit - , HUnit + , HUnit
\ No newline at end of file diff --git a/data/icons/16x16/bustle.png b/data/icons/16x16/org.freedesktop.Bustle.png Binary files differindex a043a68..a043a68 100644 --- a/data/icons/16x16/bustle.png +++ b/data/icons/16x16/org.freedesktop.Bustle.png diff --git a/data/icons/22x22/bustle.png b/data/icons/22x22/org.freedesktop.Bustle.png Binary files differindex c9aab82..c9aab82 100644 --- a/data/icons/22x22/bustle.png +++ b/data/icons/22x22/org.freedesktop.Bustle.png diff --git a/data/icons/256x256/bustle.png b/data/icons/256x256/org.freedesktop.Bustle.png Binary files differindex 669635c..669635c 100644 --- a/data/icons/256x256/bustle.png +++ b/data/icons/256x256/org.freedesktop.Bustle.png diff --git a/data/icons/32x32/bustle.png b/data/icons/32x32/org.freedesktop.Bustle.png Binary files differindex 70610b7..70610b7 100644 --- a/data/icons/32x32/bustle.png +++ b/data/icons/32x32/org.freedesktop.Bustle.png diff --git a/data/icons/48x48/bustle.png b/data/icons/48x48/org.freedesktop.Bustle.png Binary files differindex 25ae4a5..25ae4a5 100644 --- a/data/icons/48x48/bustle.png +++ b/data/icons/48x48/org.freedesktop.Bustle.png diff --git a/data/icons/scalable/bustle-symbolic.svg b/data/icons/scalable/org.freedesktop.Bustle-symbolic.svg index b04e7c1..b04e7c1 100644 --- a/data/icons/scalable/bustle-symbolic.svg +++ b/data/icons/scalable/org.freedesktop.Bustle-symbolic.svg diff --git a/data/icons/scalable/bustle.svg b/data/icons/scalable/org.freedesktop.Bustle.svg index a2c9a8d..a2c9a8d 100644 --- a/data/icons/scalable/bustle.svg +++ b/data/icons/scalable/org.freedesktop.Bustle.svg diff --git a/data/bustle.appdata.xml.in b/data/org.freedesktop.Bustle.appdata.xml.in index 2bc38ff..034bfb1 100644 --- a/data/bustle.appdata.xml.in +++ b/data/org.freedesktop.Bustle.appdata.xml.in @@ -27,4 +27,7 @@ </screenshots> <url type="homepage">http://willthompson.co.uk/bustle/</url> <updatecontact>philip_at_tecnocode.co.uk</updatecontact> + <provides> + <id>bustle.desktop</id> + </provides> </application> diff --git a/data/bustle.desktop.in b/data/org.freedesktop.Bustle.desktop.in index 16a4389..a569923 100644 --- a/data/bustle.desktop.in +++ b/data/org.freedesktop.Bustle.desktop.in @@ -2,7 +2,7 @@ _Name=Bustle _Comment=Draw sequence diagrams of D-Bus activity Exec=bustle -Icon=bustle +Icon=org.freedesktop.Bustle Terminal=false Type=Application Categories=GTK;Development;Debugger;Profiling; diff --git a/org.freedesktop.Bustle.json b/org.freedesktop.Bustle.json new file mode 100644 index 0000000..af3ca20 --- /dev/null +++ b/org.freedesktop.Bustle.json @@ -0,0 +1,231 @@ +{ + "app-id": "org.freedesktop.Bustle", + "runtime": "org.gnome.Platform", + "runtime-version": "3.24", + "sdk": "org.gnome.Sdk", + "writable-sdk": true, + "command": "bustle", + "tags": ["nightly"], + "desktop-file-name-prefix": "(Nightly) ", + "finish-args": [ + "--socket=x11", + "--socket=wayland", + "--socket=system-bus", + "--socket=session-bus", + "--share=ipc", + /* No support for GtkFileChooserNative in gtk2hs, so the options are: + * 1. Use hidden GtkFileChooserButtons and fake clicks on them + * 2. Just expose the host FS + */ + "--filesystem=host" + ], + "build-options": { + "strip": false, + "no-debuginfo": true + }, + "modules": [ + /* Why not start your day with a 259MB tarball? */ + { + "name": "haskell-platform", + "sources": [ + { + "type": "archive", + "url": "https://www.haskell.org/platform/download/8.0.2/haskell-platform-8.0.2-unknown-posix--full-x86_64.tar.gz", + "sha256": "c68a6f278a192d5000e8feefb0e63cef1bd441d02b846029840b98a5fa3ee31a", + /* there are no leading compoments in this file; so the default of 1 makes tar silently extract no files! */ + "strip-components": 0 + }, + { + "type": "file", + "path": "activate-hs.patch" + } + ], + "buildsystem": "simple", + "build-commands": [ + /* Can't just run install-haskell-platform.sh because it calls + * activate-hs which, in its pristine form, explicitly checks + * for UID 0. We know better -- we have permission to write + * everywhere -- so patch out this check. + */ + "tar -C / -xf hp-usr-local.tar.gz", + "patch /usr/local/haskell/ghc-8.0.2-x86_64/bin/activate-hs activate-hs.patch", + "/usr/local/haskell/ghc-8.0.2-x86_64/bin/activate-hs --verbose --prefix /usr" + ] + }, + + /* pcap dependencies begin here */ + { + "name": "libpcap", + "sources":[ + { + "type": "archive", + "url": "http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz", + "sha256": "673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e" + } + ] + }, + { + "name": "pcap", + "sources":[ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/pcap-0.4.5.2/pcap-0.4.5.2.tar.gz", + "sha256": "e7e92e6ff4bffa22102335a38dabb97fd0771fdf3b75d45cd7c1708c85e1cd5f" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global --extra-lib-dirs=/app/lib --extra-include-dirs=/app/include" + ] + }, + + /* gtk2hs dependencies begin here */ + { + "name": "hashtables", + "sources": [ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/hashtables-1.2.1.1/hashtables-1.2.1.1.tar.gz", + "sha256": "227f554a93310645c654254659969b347de3d1bf3d98901dbb5c113ece72e951" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + { + "name": "utf8-string", + "sources": [ + /* latest release doesn't install on HP 8.0.2! + * Issue #21 on github glguy utf8-string. + * (If I include the bug URL here, flatpak-builder chokes on + * the forward slashes. Apparently comments are only supported + * by accident because json-glib uses GScanner which doesn't + * let you turn off comment support. + */ + { + "type": "git", + "url": "https://github.com/glguy/utf8-string.git", + "commit": "58f5636d419e942784996d117bc5ee00a2ecdabc" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + { + "name": "gtk2hs", + "sources": [ + { + /* Installing from Git saves us listing each subpackage separately. */ + "type": "git", + "url": "https://github.com/gtk2hs/gtk2hs", + /* No tags? Great! Just pick today's HEAD. */ + "commit": "21d3a12a82756d04066e5e4198b35097012ee65b" + } + ], + "buildsystem": "simple", + "build-commands": [ + "ghc-pkg list", + "cabal install --global ./tools", + "cabal install --global ./glib", + "cabal install --global ./gio", + "cabal install --global ./cairo", + "cabal install --global ./pango", + "cabal install --global ./gtk" /* this is the gtk3 version */ + ] + }, + + /* dbus dependencies begin here */ + { + "name": "xml-types", + "sources": [ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/xml-types-0.3.6/xml-types-0.3.6.tar.gz", + "sha256": "9937d440072552c03c6d8ad79f61e61467dc28dcd5adeaad81038b9b94eef8c9" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + { + "name": "libxml-sax", + "sources": [ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/libxml-sax-0.7.5/libxml-sax-0.7.5.tar.gz", + "sha256": "99141784cc0d6c5749f0df618b2d46922391eede09f4f9ccfc36fb58a9c16d51" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + { + "name": "cereal", + "sources": [ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/cereal-0.5.4.0/cereal-0.5.4.0.tar.gz", + "sha256": "daca6c5aeff21ca233bebe006c158b0e4421b239c722768b568fca9b32cafee7" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + { + "name": "dbus", + "sources": [ + { + "type": "archive", + "url": "https://hackage.haskell.org/package/dbus-0.10.13/dbus-0.10.13.tar.gz", + "sha256": "aa94aefba8a0be240faddec88442afd8db1fa4e994423d474b112ec1c67e7aca" + } + ], + "buildsystem": "simple", + "build-commands": [ + "cabal install --global" + ] + }, + + /* for the man page! */ + { + "name": "help2man", + "sources": [ + { + "type": "archive", + "url": "http://ftpmirror.gnu.org/help2man/help2man-1.47.4.tar.xz", + "sha256": "d4ecf697d13f14dd1a78c5995f06459bff706fd1ce593d1c02d81667c0207753" + } + ], + "build-options":{ + "prefix": "/usr" + } + }, + + /* fired up! ready to go! */ + { + "name": "bustle", + "sources": [ + { + "type": "git", + "url": "https://anongit.freedesktop.org/git/bustle.git", + "branch": "master" + } + ], + "buildsystem": "simple", + "build-commands": [ + "make install PREFIX=/app", + "cabal install --prefix=/app --flags=-hgettext" + ] + } + ] +}
\ No newline at end of file |