summaryrefslogtreecommitdiff
path: root/flatpak/org.freedesktop.Bustle.json
blob: 5edf78c0614895b286a1768f06f0d7bd0a042e2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
{
    "app-id": "org.freedesktop.Bustle",
    "runtime": "org.gnome.Platform",
    "runtime-version": "3.24",
    "sdk": "org.gnome.Sdk",
    /* Use writable-sdk to install Haskell Platform to usr rather than app:
     * it's only needed to build Bustle, not to run it. All Haskell libraries
     * and the runtime system are statically linked into the bustle binary.
     * The only shared library it needs which is not part of the GNOME SDK
     * is libpcap, which is installed to app.
     */
    "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
    },
    "cleanup": [
        "*.a", "*.h",
        "/share/man/man?/pcap*",
        "/bin/pcap-config"
    ],
    "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": "git",
                    "url": "https://github.com/the-tcpdump-group/libpcap.git",
                    /* master as of 2017-07-24, new enough for dbus message size changes */
                    "commit": "c955dc6facab1cca6b5b82c9274f295a58065ba0"
                }
            ]
        },
        {
            "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": [
                "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 DESTDIR=/",
                "cabal install --prefix=/app --flags=-hgettext"
            ]
        }
    ]
}