Comments (7)
I managed to solve the problem using a local (noindex) repository.
Interestingly, I had to include the package for hsc2hs in the repository (even if it was already installed in the system), to let it builds bindings-GLFW.
I haven't tested the bindings in my project, but I'm confident they will works.
Regarding the above suggestion, is it feasible?
If not, what is the rationale for not including that harmless (in my opinion) change?
Thank you and sorry for the noise, I should wait and think a little before reporting issues.
from bindings-glfw.
I think having different flavors of linux as part of the conditional for linux is fine. Feel free to submit a patch and I will review it.
from bindings-glfw.
The change highlighted above works only with the use of system glfw.
I'm now working on the proper OpenBSD support. Could you add me, in the meantime, to the contributors list, so when the patch will be ready, I'll be able to summit it? Thank you.
from bindings-glfw.
@Mjnd Hi, thanks for contributing. A cool way to collaborate is for you to clone this repo into your own account, and then make changes against that repo, which you of course have permissions over, and then submit a pull request back to here for the maintainers to review and possibly merge.
from bindings-glfw.
I managed to have the bundled glfw (v3.3.2) compile and work on OpenBSD.
OpenBSD doesn't support <sys/inotify.h>
so I had to disable the compiling of linux_joystick.c
(relying on inotify) and replace it with dummy functions, as it was done on previous versions of glfw (the code was hidden behind #if defined(__linux__)
and #endif
).
bindings-GLFW.cabal.diff
--- bindings-GLFW.cabal Fri Feb 21 07:36:07 2020
+++ bindings-GLFW.cabal Fri Jun 4 16:21:05 2021
@@ -133,11 +133,16 @@ library
glfw/deps/glad_gl.c
glfw/deps/glad_vulkan.c
- if os(linux) || os(freebsd)
+ if os(linux) || os(freebsd) || os(openbsd)
+ if os(openbsd)
+ c-sources:
+ glfw/src/openbsd_joystick.c
+ else
+ c-sources:
+ glfw/src/linux_joystick.c
c-sources:
glfw/src/glx_context.c
glfw/src/xkb_unicode.c
- glfw/src/linux_joystick.c
glfw/src/posix_time.c
glfw/src/posix_thread.c
if flag(X)
openbsd_joystick.c
#include "internal.h"
static void closeJoystick(_GLFWjoystick* js)
{
_glfwFreeJoystick(js);
_glfwInputJoystick(js, GLFW_DISCONNECTED);
}
GLFWbool _glfwInitJoysticksLinux(void)
{
return GLFW_FALSE;
}
void _glfwTerminateJoysticksLinux(void) {}
void _glfwDetectJoystickConnectionLinux(void) {}
int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
{
return GLFW_FALSE;
}
void _glfwPlatformUpdateGamepadGUID(char* guid) {}
If the patch is eligible, as I don't use git/github (except for bothering you), may I ask to relying on you to be committed? I don't want to lose time on a program which I'll use only once, and have to fight with its intricacies... I swear I won't bother you again for at least a year!
If the patch is wrong or not good enough, please tell me how it can be improved.
Thank you very much.
from bindings-glfw.
Actually you don't even need my openbsd_joystick.c
, just copy null_joystick.c
to openbsd_joystick.c
.
If you know of a better way to replace linux_joystick.c
with the content of null_joystick.c
when compiling under OpenBSD, directly from bindings-GLFW.cabal
, please go ahead.
from bindings-glfw.
Here I slightly better diff, which mimics what is done in CMakeLists.txt (not tested, I'm tired of this, but I'm sure it will work):
--- bindings-GLFW.cabal Fri Feb 21 07:36:07 2020
+++ bindings-GLFW.cabal Sun Jun 6 10:32:40 2021
@@ -133,11 +133,10 @@ library
glfw/deps/glad_gl.c
glfw/deps/glad_vulkan.c
- if os(linux) || os(freebsd)
+ if os(linux) || os(freebsd) || os(openbsd)
c-sources:
glfw/src/glx_context.c
glfw/src/xkb_unicode.c
- glfw/src/linux_joystick.c
glfw/src/posix_time.c
glfw/src/posix_thread.c
if flag(X)
@@ -146,12 +145,20 @@ library
glfw/src/x11_init.c
glfw/src/x11_monitor.c
glfw/src/x11_window.c
+ if os(linux) || os(freebsd)
+ c-sources: glfw/src/linux_joystick.c
+ else
+ c-sources: glfw/src/null_joystick.c
if flag(Wayland)
cc-options: -DBINDINGS_GLFW_USE_WAYLAND -D_GLFW_WAYLAND
c-sources:
glfw/src/wl_init.c
glfw/src/wl_monitor.c
glfw/src/wl_window.c
+ if os(linux) || os(freebsd)
+ c-sources: glfw/src/linux_joystick.c
+ else
+ c-sources: glfw/src/null_joystick.c
if flag(OSMesa)
cc-options: -DBINDINGS_GLFW_USE_OSMESA -D_GLFW_OSMESA
c-sources:
Since the modification is limited to bindings-GLFW.cabal
, couldn't the hackage revision system be used?
Update: tested and working.
from bindings-glfw.
Related Issues (20)
- Update glfw to 3.1.1 HOT 1
- Should the dependency to Xxf86vm be made optional? HOT 1
- Expose GLFW_USE_DWM_SWAP_INTERVAL as build flag.
- glfw3native.h bindings HOT 3
- Submit to Stackage HOT 2
- Package needs a new maintainer HOT 10
- HUnit 1.3 support HOT 2
- update glfw to 3.2.1 HOT 9
- License mismatch between Cabal and LICENSE file HOT 1
- Make the glfw source to a submodule? HOT 1
- unable to load package `bindings-GLFW-3.1.2.2' HOT 5
- Stack install failing HOT 11
- Duplicate link in README
- glfw_config.h on linux doesn't support multiple window managers.
- MoltenVK support HOT 3
- Upgrade to 3.3
- Doesn't build on Windows. Num directive not supported in cross compilation mode. HOT 8
- Upgrade to 3.3.4 or 3.3.6 HOT 1
- broken on M1 macs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bindings-glfw.