Passing a cabal flag to stack

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? Looking at https://github.com/commercialhaskell/stack/issues/191 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

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

On Sat, Jul 16, 2016 at 9:48 AM, Simon Jakobi
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?

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
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…
participants (2)
-
Rustom Mody
-
Simon Jakobi