Git Product home page Git Product logo

Comments (14)

schell avatar schell commented on July 18, 2024

Well the warning

Warning: 'include-dirs: glfw/include/os/unix-like' directory does not exist.

definitely seems worrisome.

from bindings-glfw.

schell avatar schell commented on July 18, 2024

@peti can you make sure that directory is included? It should be, I don't know how it couldn't but glfw_config.h lives in that dir so I'm sure that whatever caused the above warning is causing the error.

from bindings-glfw.

schell avatar schell commented on July 18, 2024

It looks like cabal sdist didn't pick up the glfw/include/os dir.

from bindings-glfw.

schell avatar schell commented on July 18, 2024

I don't know how but it looks like I had clobbered some includes in the cabal file. I've updated the repo and hackage. Please try building again :)

from bindings-glfw.

peti avatar peti commented on July 18, 2024

Now I've run into this error:
[1 of 1] Compiling Bindings.GLFW ( dist/build/Bindings/GLFW.hs, dist/build/Bindings/GLFW.o )

In file included from glfw/src/internal.h:74:0:
    0,
                     from glfw/src/context.c:28:

glfw/src/x11_platform.h:38:33:
     fatal error: X11/Xcursor/Xcursor.h: No such file or directory
     #include <X11/Xcursor/Xcursor.h>

It appears the package has an undeclared dependency in libXcursor?

from bindings-glfw.

peti avatar peti commented on July 18, 2024

The next error after that one is:

glfw/src/x11_platform.h:53:37:
     fatal error: X11/extensions/Xinerama.h: No such file or directory
     #include <X11/extensions/Xinerama.h>

from bindings-glfw.

schell avatar schell commented on July 18, 2024

This seems like it may be related to #14. I'm guessing we're missing some linked libs in the cabal file?

from bindings-glfw.

peti avatar peti commented on July 18, 2024

Yes, libXcursor and libXinerama at least.

from bindings-glfw.

schell avatar schell commented on July 18, 2024

I'm installing on an Ubuntu VM just fine, so I think this is a nix issue. @peti - can you add those libs to the cabal file and see if that gets you past these errors?

from bindings-glfw.

peti avatar peti commented on July 18, 2024

After 9411a50, I get the following error:

Configuring bindings-GLFW-3.1...
Building bindings-GLFW-3.1...
Preprocessing library bindings-GLFW-3.1...
<command line>: does not exist: glfw/src/x11_gamma.c

Apparently, the file is listed in the Cabal file but missing from the repository?

Also, I notice that cabal check complains:

$ cabal check
These warnings may cause trouble when distributing the package:
* 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit
and not just imposing longer compile times on your users.

The following errors will cause portability problems on other environments:
* Unknown architecture name 'powerpc'

Hackage would reject this package.

from bindings-glfw.

peti avatar peti commented on July 18, 2024

See #21.

from bindings-glfw.

peti avatar peti commented on July 18, 2024

Even with that pull request applied, there remains an issue linking the test suite, though:

Linking dist/build/main/main ...
/tmp/nix-build-haskell-bindings-GLFW-3.1.drv-0/bindings-GLFW/dist/build/libHSbindings-GLFW-3.1-ghc7.8.4.so: undefined reference to `_glfwSetCurrentContext'
/tmp/nix-build-haskell-bindings-GLFW-3.1.drv-0/bindings-GLFW/dist/build/libHSbindings-GLFW-3.1-ghc7.8.4.so: undefined reference to `_glfwTerminateTLS'
/tmp/nix-build-haskell-bindings-GLFW-3.1.drv-0/bindings-GLFW/dist/build/libHSbindings-GLFW-3.1-ghc7.8.4.so: undefined reference to `_glfwPlatformGetCurrentContext'
/tmp/nix-build-haskell-bindings-GLFW-3.1.drv-0/bindings-GLFW/dist/build/libHSbindings-GLFW-3.1-ghc7.8.4.so: undefined reference to `_glfwKeySym2Unicode'
/tmp/nix-build-haskell-bindings-GLFW-3.1.drv-0/bindings-GLFW/dist/build/libHSbindings-GLFW-3.1-ghc7.8.4.so: undefined reference to `_glfwInitTLS'
collect2: error: ld returned 1 exit status

I'm not sure what those symbols mean and who is supposed to provide them?

from bindings-glfw.

klao avatar klao commented on July 18, 2024

The linking issues are due to a couple of C files (from the glfw source) not mentioned in the cabal file.

Here's a patch that gets the library and the test to successfully build on linux (Ubuntu 14.04):

diff -ur bindings-GLFW-3.1.1/bindings-GLFW.cabal bindings-GLFW-3.1.1.fix/bindings-GLFW.cabal
--- bindings-GLFW-3.1.1/bindings-GLFW.cabal     2015-03-09 16:50:00.688138179 +0100
+++ bindings-GLFW-3.1.1.fix/bindings-GLFW.cabal 2015-03-09 16:36:42.456173831 +0100
@@ -105,15 +105,19 @@
       glfw/src/x11_init.c
       glfw/src/x11_monitor.c
       glfw/src/x11_window.c
+      glfw/src/xkb_unicode.c
       glfw/src/glx_context.c
       glfw/src/linux_joystick.c
       glfw/src/posix_time.c
+      glfw/src/posix_tls.c
     extra-libraries:
       GL
       X11
       Xi
       Xrandr
       Xxf86vm
+      Xcursor
+      Xinerama
       pthread

   if os(darwin)

Sorry, can't send a pull request, because the repo is out-of-date. :)

Also note, that this only gets the tests to build. Some tests are still failing afterwards.

from bindings-glfw.

schell avatar schell commented on July 18, 2024

Some of these changes were on my own fork as I had forgotten to git push upstream master. I've since set bsl/bindings-GLFW as origin so that won't happen again!

from bindings-glfw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.