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

Be more honest about our Graphics.X11.XScreenSaver dependency #13

Closed
wants to merge 1 commit into from

Conversation

iblech
Copy link

@iblech iblech commented Jan 3, 2018

At the moment, there is a runtime check whether the X11 package (which provides Graphics.X11.XScreenSaver) was compiled with the libXScrnSaver system library. If not, the code emits a warning and tries to go on.

However, the code still references the getXIdleTime function of the Graphics.X11.XScreenSaver module. That module exports getXIdleTime only if it has been compiled with the libXScrnSaver library.

Thus at the moment, arbtt fails to compile if the X11 package was compiled without libXScrnSaver. (This is currently the default in NixOS, which is how I noticed this problem.)

This pull request simply removes the attempt to go on if libXScrnSaver is missing, since I deemed the idle time information to be too important. A perhaps better solution would be to upgrade src/Capture/X11.hs into an hsc file and only import getXIdleTime if the C preprocessor flag HAVE_X11_EXTENSIONS_SCRNSAVER_H is true, therefore feel exceptionally free to reject this pull request.

If we go with the approach of this pull request, then we should also record somewhere that we require that the X11 package was compiled with libXScrnSaver. Ideally we would specify this in the Cabal file, but I don't think we can. Else it should at least be mentioned in the README. Please direct me to the correct place. :-)

This pull request was joint work with @xaverdh.

@nomeata
Copy link
Owner

nomeata commented Jan 3, 2018

There is an alternative fix: Add a pull request to X11 that makes libXScrnSaver non-optional. It is actually against the customs of Haskell package to have an API that varies depending on the build system.

If they don't want that, then maybe the Graphics.X11.XScreenSaver should be moved out of X11 and into its own Haskell package.

@nomeata
Copy link
Owner

nomeata commented Apr 22, 2018

We now (bb179f3) depend on X11-1.9, which should always have that module installed.

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

Successfully merging this pull request may close these issues.

2 participants