Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

add nix dependencies to stack.yaml#69

Open
chris-martin wants to merge1 commit intodeech:master
base:master
Choose a base branch
Loading
fromchris-martin:nix

Conversation

chris-martin
Copy link

I needed this to compile on NixOS.

@deech
Copy link
Owner

Nice, thanks! Does it still work if you enable theOpenGL flag?

@chris-martin
Copy link
Author

Nope!

Preprocessing library fltkhs-0.5.4.3...In file included from ./c-src/Fl_C.h:5:0,                 from .stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/build/Graphics/UI/FLTK/LowLevel/Gl.chs.h:2:/home/chris/haskell/fltkhs/c-src/Fl_Types.h:192:23: fatal error: GL/gl.h: No such file or directory #    include <GL/gl.h>                       ^compilation terminated.c2hs: Error during preprocessing custom header file--  While building custom Setup.hs for package fltkhs-0.5.4.3 using:      /home/chris/haskell/fltkhs/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 build lib:fltkhs exe:fltkhs-buttons exe:fltkhs-fluidtohs --ghc-options " -ddump-hi -ddump-to-file"    Process exited with code: ExitFailure 1

OpenGL is a problematic thing, I think. To my understanding (and I may be totally wrong there) you need to use the package that's specific to your GPU, so I don't know how this should be handled.

And if I addmesa andmesa_glu to the Nix package list, then I get this result:

Preprocessing library fltkhs-0.5.4.3...<no location info>: error:    module ‘Graphics.UI.FLTK.LowLevel.Gl’ is a package module--  While building custom Setup.hs for package fltkhs-0.5.4.3 using:      /home/chris/haskell/fltkhs/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 build lib:fltkhs exe:fltkhs-buttons exe:fltkhs-fluidtohs --ghc-options " -ddump-hi -ddump-to-file"    Process exited with code: ExitFailure 1

@deech
Copy link
Owner

Cool! That last error is possibly a good sign. Try removing the local.stack-work directory, doing astack clean and thenstack build. I would also check that thefltk package from Nix is compiled with--enable-gl.

If that doesn't work try starting over but removing thefltk Nix dependency and doingstack build --flag fltkhs:bundled --flag fltkhs:opengl. This builds and links the bundled FLTK .

@sboosali
Copy link
Contributor

sboosali commentedJan 15, 2018 via email

On Jan 15, 2018 11:03 AM, "deech" ***@***.***> wrote: Cool! That last error is possibly a good sign. Try removing the local .stack-work directory, doing a stack clean and then stack build. I would also check that the fltk package from Nix is compiled with --enable-gl. If that doesn't work try starting over but removing the fltk Nix dependency and doing stack build --flag fltkhs:bundled --flag fltkhs:opengl. This builds and links the bundled FLTK . — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#69 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACNoMX_mBJLFwdXxPxUeRkPlVP4whDl2ks5tK6DhgaJpZM4Rd9Rp> .

@chris-martin
Copy link
Author

I had to get more aggressive than.stack-work andstack clean by runninggit clean -dxf, but you're right, it does now seem to build with the opengl flag.

Copy link
Contributor

@sboosalisboosali left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

since as far as I know stack doesn't have conditionals, I'd have two stack files: this, calledstack-opengl.yaml, and astack.yaml with only the default flags' deps:

nix:  packages: - autoconf - c2hs  # still needs this, right? - fltk - libjpeg

@sboosali
Copy link
Contributor

(by "this" I mean the file in the PR)

also, ismesa_glu necessary?cabal2nix seems to choose onlyfreeglut from theGLU dep, and it builds.

@chris-martin
Copy link
Author

(I have no idea, I'm at an "adding stuff until it seems to work" knowledge level here)

@sboosali
Copy link
Contributor

(same lol)

also, we want the flag:

flags:  fltkhs:    opengl: true

but idk if stack flags work with the local/current project (they should).

@sboosali
Copy link
Contributor

sboosali commentedJan 17, 2018
edited
Loading

i.e. can you test this?

# stack-opengl.yamlresolver: lts-8.13packages:- '.'flags:  fltkhs:    opengl: truenix:  packages:    # setup    - autoconf    - c2hs     # build    - fltk    - libjpeg    # opengl    - mesa    - freeglut

@chris-martin
Copy link
Author

error: undefined variable ‘c2hs’ at (string):1:52

@sboosali
Copy link
Contributor

oh, should be qualified:

haskellPackages.c2hs

@chris-martin
Copy link
Author

Yep, seems to work.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sboosalisboosalisboosali left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@chris-martin@deech@sboosali

[8]ページ先頭

©2009-2025 Movatter.jp