lettier / movie-monad

:tv: A free and simple to use video player made with Haskell.
https://lettier.github.io/movie-monad
BSD 3-Clause "New" or "Revised" License
420 stars 24 forks source link

macOS installation error #9

Closed AntouanK closed 6 years ago

AntouanK commented 6 years ago

Getting an error about libffi. I followed the steps in the README to install it in a MBP laptop. After stack install, I get this error:

screen shot 2017-12-04 at 20 32 10

As you can see, brew says libffi is installed, but stack disagrees.

lettier commented 6 years ago

Hello @AntouanK.

I apologize for the error.

Try locating the file.

locate libffi.pc

The location should be something like the following.

/usr/local/Cellar/libffi/3.2.1/lib/pkgconfig/libffi.pc

Once you have found it.

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/libffi/3.2.1/lib/pkgconfig/
stack install

Let me know if that works. If it does, I'll go ahead and add it to the documentation.

:+1:

AntouanK commented 6 years ago

locate doesn't work because it says it needs to build a db or something. I tried to use finder to find it, and I can only find one libffi.pc file. This is the path /opt/vagrant/embedded/lib/pkgconfig so I guess it's installed with vagrant!? ( haven't used vagrant for almost 2 years now... )

So, I removed vagrant and did brew reinstall libffi. I can see libffi.pc in /usr/local/opt/libffi/lib/pkgconfig now.

Ran ❯ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig stack install and it works fine.

So maybe it was an issue caused by my vagrant installation? I don't know.

Thanks in any case.

At the end, I get this:

screen shot 2017-12-05 at 07 36 17

but I think those are the problems I had last time, so I'll go to the other issue and see how to fix them.

lettier commented 6 years ago

Hello @AntouanK

I am glad that fixed it. I'll put a note about PKG_CONFIG_PATH in the documentation.

Yes those errors are because of the GIR file data.

I did put in a PR and that has since been merge into the bindings. After @garetxe releases a new version to Hackage, I can go ahead and update the source.

In the meantime, here are the correct changes.

diff --git a/src/PlayPause.hs b/src/PlayPause.hs
index 5c164fd..af59384 100644
--- a/src/PlayPause.hs
+++ b/src/PlayPause.hs
@@ -58,10 +58,10 @@ setPlayPauseButton ::
   Bool ->
   IO ()
 setPlayPauseButton playPauseButton _ pauseImage True = do
-  GI.Gtk.buttonSetImage playPauseButton pauseImage
+  GI.Gtk.buttonSetImage playPauseButton (Just pauseImage)
   GI.Gtk.widgetSetTooltipText playPauseButton (Just "Click to pause")
 setPlayPauseButton playPauseButton playImage _ False = do
-  GI.Gtk.buttonSetImage playPauseButton playImage
+  GI.Gtk.buttonSetImage playPauseButton (Just playImage)
   GI.Gtk.widgetSetTooltipText playPauseButton (Just "Click to play")

:+1:

garetxe commented 6 years ago

After @garetxe releases a new version to Hackage, I can go ahead and update the source.

Thanks for the reminder, and sorry that it took a while! gi-gtk-3.0.18 is now in hackage, with your fix.

lettier commented 6 years ago

Oh no worries @garetxe. I wasn't sure if it was to be apart of a bigger release.

Thank you for the update and for haskell-gi. The bindings are excellent.

:+1:

lettier commented 6 years ago

Hello @AntouanK

I have updated the source to handle the buttonSetImage build error. The source should build now without the need to make any local source changes.

:+1:

AntouanK commented 6 years ago

I git pulled and it worked perfectly. Thank you.