Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk 0.14.10 doesn't build with ghc 8.4.3 on mac #249

Open
GeorgeCo opened this issue Jun 11, 2018 · 4 comments
Open

gtk 0.14.10 doesn't build with ghc 8.4.3 on mac #249

GeorgeCo opened this issue Jun 11, 2018 · 4 comments

Comments

@GeorgeCo
Copy link

ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.3
cabal install -j5 gtk
...
[162 of 209] Compiling Graphics.UI.Gtk.Embedding.Socket ( dist/build/Graphics/UI/Gtk/Embedding/Socket.hs, dist/build/Graphics/UI/Gtk/Embedding/Socket.o )

Graphics/UI/Gtk/Embedding/Socket.chs:175:6: error:
• Couldn't match expected type ‘Ptr ()’
with actual type ‘Maybe DrawWindow’
• In the second argument of ‘\ (Socket arg1) arg2
-> withForeignPtr arg1
$ \ argPtr1 -> gtk_socket_add_id argPtr1 arg2’, namely
‘(fromNativeWindowId windowId)’
In the expression:
(\ (Socket arg1) arg2
-> withForeignPtr arg1
$ \ argPtr1 -> gtk_socket_add_id argPtr1 arg2)
(toSocket self) (fromNativeWindowId windowId)
In an equation for ‘socketAddId’:
socketAddId self windowId
= (\ (Socket arg1) arg2
-> withForeignPtr arg1
$ \ argPtr1 -> gtk_socket_add_id argPtr1 arg2)
(toSocket self) (fromNativeWindowId windowId)
|
175 | (fromNativeWindowId windowId)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Graphics/UI/Gtk/Embedding/Socket.chs:187:3: error:
• Couldn't match type ‘Ptr ()’ with ‘Maybe DrawWindow’
Expected type: IO (Maybe DrawWindow)
Actual type: IO (Ptr ())
• In the second argument of ‘($)’, namely
‘(\ (Socket arg1)
-> withForeignPtr arg1 $ \ argPtr1 -> gtk_socket_get_id argPtr1)
(toSocket self)’
In the expression:
liftM toNativeWindowId
$ (\ (Socket arg1)
-> withForeignPtr arg1 $ \ argPtr1 -> gtk_socket_get_id argPtr1)
(toSocket self)
In an equation for ‘socketGetId’:
socketGetId self
= liftM toNativeWindowId
$ (\ (Socket arg1)
-> withForeignPtr arg1 $ \ argPtr1 -> gtk_socket_get_id argPtr1)
(toSocket self)
|
187 | {# call unsafe socket_get_id #}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
cabal: Leaving directory '/var/folders/9b/rh4y2gy92hgdb6ktv4df1jv00000gn/T/cabal-tmp-73334/gtk-0.14.10'
cabal: Error: some packages failed to install:
gtk-0.14.10-IREoa0zChZaE2a3ulq7OE failed during the building phase. The
exception was:
ExitFailure 1

@hamishmack
Copy link
Contributor

Try cabal install gtk -fhave-quartz-gtk. I think this is a duplicate of #112 (where we cannot easily tell if the gtk we are building against is quartz or x11).

@JustusAdam
Copy link

Thanks. I've had this problem when installing threadscope and turning have-quartz-gtk on fixed it.

@bsdshell
Copy link

bsdshell commented Oct 9, 2019

can we just add "gtk -fhave-quartz-gtk" as dependency to .yaml or .cabal in Stack instead of
"cabal install gtk -fhave-quartz-gtk" globally?

@hamishmack
Copy link
Contributor

can we just add "gtk -fhave-quartz-gtk" as dependency to .yaml or .cabal in Stack instead of
"cabal install gtk -fhave-quartz-gtk" globally?

Yes, you can set cabal flags a number of different ways. If the project uses cabal new-build and a cabal.project file add (you can add it to cabal.project or cabal.project.local):

package gtk
  flags: +have-quartz-gtk

If it uses stack and a stack.yaml file add:

flags:
  gtk:
    have-quartz-gtk: true

Keep in mind though that people with the X11 version of Gtk+ 2 on macOS will not be able to build if this flag is set.

simonchatts added a commit to simonchatts/nixpkgs that referenced this issue Feb 20, 2020
This includes two layered changes so the gtk2hs packages build on Darwin:

 - For `glib`, `gio`, `gtk`, `gtk3`, and `pango`: the fix for version 0.13.8.0
   from gtk2hs/gtk2hs#293 . I expect at some point the
   referenced fix (or one like it) will be released and and brought into
   nixpkgs, at which point the override and patch files here can (in fact must)
   be removed.

 - For `gtk` and `gtk3`: also apply the required cabal flag cited in
   gtk2hs/gtk2hs#249 to specify the Quartz rather than
   X11 backend (Quartz is the one that both nixpkgs and macOS support
   out-the-box). This override is likely to be wanted indefinitely.

Both modifications are required for a successful build of `gtk` or `gtk3` on
Darwin right now.
peti pushed a commit to NixOS/nixpkgs that referenced this issue Feb 21, 2020
This includes two layered changes so the gtk2hs packages build on Darwin:

 - For `glib`, `gio`, `gtk`, `gtk3`, and `pango`: the fix for version 0.13.8.0
   from gtk2hs/gtk2hs#293 . I expect at some point the
   referenced fix (or one like it) will be released and and brought into
   nixpkgs, at which point the override and patch files here can (in fact must)
   be removed.

 - For `gtk` and `gtk3`: also apply the required cabal flag cited in
   gtk2hs/gtk2hs#249 to specify the Quartz rather than
   X11 backend (Quartz is the one that both nixpkgs and macOS support
   out-the-box). This override is likely to be wanted indefinitely.

Both modifications are required for a successful build of `gtk` or `gtk3` on
Darwin right now.
peti pushed a commit to NixOS/nixpkgs that referenced this issue Feb 28, 2020
This includes two layered changes so the gtk2hs packages build on Darwin:

 - For `glib`, `gio`, `gtk`, `gtk3`, and `pango`: the fix for version 0.13.8.0
   from gtk2hs/gtk2hs#293 . I expect at some point the
   referenced fix (or one like it) will be released and and brought into
   nixpkgs, at which point the override and patch files here can (in fact must)
   be removed.

 - For `gtk` and `gtk3`: also apply the required cabal flag cited in
   gtk2hs/gtk2hs#249 to specify the Quartz rather than
   X11 backend (Quartz is the one that both nixpkgs and macOS support
   out-the-box). This override is likely to be wanted indefinitely.

Both modifications are required for a successful build of `gtk` or `gtk3` on
Darwin right now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants