Passing a cabal flag to stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing a cabal flag to stack

Rustom Mody
I’ve been trying to compile hoodle following the instructions in the readme:
https://github.com/wavewave/hoodle

Went further than year or two earlier when attempt got mired in cabal-hell

This time stack build went through (after a couple of deb packages needing installation)

Now I get this error on trying to run

GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Asking on the hoodle mailing list I was told that one has to build poppler with option -fgtk3

Where/How to give that?
I tried the following:
1. Delete every file/directory under .stack-work that has the word poppler
2. stack build poppler --flag gtk:gtk3
3. stack build

Seems to have built
Ok I get the same warning that stack seems to be generally giving — dozens of them  — viz
============
No packages found in snapshot which provide a "gtk2hsC2hs" executable, which is a build-tool dependency of "glib"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595
=============


But thereafter stack exec hoodle
results in the same error.

So whats the official way of putting the -fgtk3 flag into stack?
Any other suggestions?

stack first tried from deb; then redone from stack website
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3

ubuntu 16.4 (if that matters)


Thanks

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Passing a cabal flag to stack

Haskell - Haskell-Cafe mailing list
Hi!

> So whats the official way of putting the -fgtk3 flag into stack?

To pass that flag to poppler, the syntax is

    --flag poppler:gtk3

> 1. Delete every file/directory under .stack-work that has the word poppler

That shouldn't be necessary.

> 2. stack build poppler --flag gtk:gtk3
> 3. stack build

It's best to be consistent about flag settings. It might be easiest to
put them in your stack.yaml:
http://docs.haskellstack.org/en/stable/yaml_configuration/#flags

Hope that helps!
Simon
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Passing a cabal flag to stack

Rustom Mody


On Sat, Jul 16, 2016 at 9:48 AM, Simon Jakobi <[hidden email]> wrote:
Hi!

> So whats the official way of putting the -fgtk3 flag into stack?

To pass that flag to poppler, the syntax is

    --flag poppler:gtk3

When I try stack build --flag poppler:gtk3
 I get
=================
--  Failure when adding dependencies:   
      hoodle-core: needed (>=0.15.0 && <0.16), couldn't resolve its dependencies
    needed for package hoodle-0.4.999

--  Failure when adding dependencies:   
      hoodle-publish: needed (>=0.2), couldn't resolve its dependencies
      hoodle-render: needed (>=0.5.0 && <0.6), couldn't resolve its dependencies
      poppler: needed (>=0.12.2.2), couldn't resolve its dependencies
    needed for package hoodle-core-0.15.999

--  Failure when adding dependencies:   
      hoodle-render: needed (>=0.5.0), couldn't resolve its dependencies
    needed for package hoodle-publish-0.2.0

--  Failure when adding dependencies:   
      poppler: needed (>=0.12.2.2), couldn't resolve its dependencies
    needed for package hoodle-render-0.5.999

--  Failure when adding dependencies:   
      gtk3: needed (>=0.13 && <0.14), 0.14.2 found (latest applicable is 0.13.9)
    needed for package poppler-0.13.1 with flags:
      gtk3: True
=============
Happens whether I try more focussed:
$ stack build poppler --flag poppler:gtk3
get
=============
While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:   
      gtk3: needed (>=0.13 && <0.14), 0.14.2 found (latest applicable is 0.13.9)
    needed for package poppler-0.13.1 with flags:
      gtk3: True
================


[In cut pasting Ive elided oodles of stuff like:

No packages found in snapshot which provide a "gtk2hsC2hs" executable, which is a build-tool dependency of "glib"
Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps.
This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595

]


 

> 1. Delete every file/directory under .stack-work that has the word poppler

That shouldn't be necessary.

> 2. stack build poppler --flag gtk:gtk3
> 3. stack build

It's best to be consistent about flag settings. It might be easiest to
put them in your stack.yaml:
http://docs.haskellstack.org/en/stable/yaml_configuration/#flags


This is the stack.yaml (without comments)

=======================
# This file was automatically generated by stack init
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-5.8

# Local packages, usually specified by relative directory name
packages:
- coroutine-object/
- hoodle/
- hoodle-builder/
- hoodle-core/
- hoodle-daemon/
- hoodle-extra/
- hoodle-manage/
- hoodle-parser/
- hoodle-publish/
- hoodle-render/
- hoodle-types/
- xournal-parser/
- xournal-types/
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps:
- TypeCompose-0.9.11
- aeson-0.11.1.1
- attoparsec-conduit-1.1.0
- gtk-0.13.9
- handa-gdata-0.7.0.3
- persistent-sqlite-2.2.1
- poppler-0.13.1
- svgcairo-0.13.0.4
- text-1.2.2.0
- transformers-free-1.0.1
- zlib-conduit-1.1.0

# Override default flag values for local packages and extra-deps
flags: {}

# Extra package databases containing global packages
extra-package-dbs: []
========================

What do you recommend to try to change?


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Passing a cabal flag to stack

Haskell - Haskell-Cafe mailing list
> What do you recommend to try to change?

Put that flag setting into your stack.yaml, delete the extra-deps
except poppler and run stack solver. I hope that works…
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Passing a cabal flag to stack

Rustom Mody
Ran -- thanks Simon!
I’ll put a short rundown as best as I can in a bit!
[Quite a blackart if you ask me]

On Sat, Jul 16, 2016 at 10:14 AM, Simon Jakobi <[hidden email]> wrote:
> What do you recommend to try to change?

Put that flag setting into your stack.yaml, delete the extra-deps
except poppler and run stack solver. I hope that works…



--

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Passing a cabal flag to stack

Haskell - Haskell-Cafe mailing list
> Ran -- thanks Simon!

Glad it worked!

> I’ll put a short rundown as best as I can in a bit!

Looking forward to it!

> [Quite a blackart if you ask me]

…says "the magus"! ;)
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.