jez / pandoc-sidenote

Convert Pandoc Markdown-style footnotes into sidenotes
MIT License
136 stars 17 forks source link

Compilation error with Cabal in OpenBSD #12

Open antanst opened 4 years ago

antanst commented 4 years ago

Compilation error with Cabal in the following OpenBSD system:

$ uname -a
OpenBSD hp.antanst.com 6.6 GENERIC.MP#4 amd64
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.4
$ cabal --version
cabal-install version 2.4.0.0
compiled using version 2.4.0.1 of the Cabal library 
$ pandoc --version
pandoc 2.9.1.1
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.3
Default user data directory: /home/blog/.local/share/pandoc or /home/blog/.pandoc

When trying to install via Cabal, the following error occurs:

$ cabal install pandoc-sidenote        
Warning: The install command is a part of the legacy v1 style of cabal usage.                                                                 

Please switch to using either the new project style and the new-install 
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.        

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...                                                                                                                     
Starting     pandoc-sidenote-0.19.0.0                                                                                                         
Building     pandoc-sidenote-0.19.0.0                                                                                                         
Failed to install pandoc-sidenote-0.19.0.0                                                                                                    
Build log ( /home/blog/.cabal/logs/ghc-8.6.4/pandoc-sidenote-0.19.0.0-Kj7R7hpnKZuLTAdosGiyw3.log ):                                           
cabal: Entering directory '/tmp/cabal-tmp-36604/pandoc-sidenote-0.19.0.0'                                                                     
Configuring pandoc-sidenote-0.19.0.0...                     
Preprocessing library for pandoc-sidenote-0.19.0.0..          
Building library for pandoc-sidenote-0.19.0.0..       
[1 of 1] Compiling Text.Pandoc.SideNote ( src/Text/Pandoc/SideNote.hs, dist/build/Text/Pandoc/SideNote.o )                                    

src/Text/Pandoc/SideNote.hs:14:30: error:         
    * Couldn't match type `text-1.2.3.1:Data.Text.Internal.Text'                                                                              
                     with `[Char]'                                     
      Expected type: Maybe String                                                                                                             
        Actual type: Maybe text-1.2.3.1:Data.Text.Internal.Text
    * In the expression: Just text                                     
      In an equation for `getFirstStr':                      
          getFirstStr (Str text : _) = Just text             
   |                                                                   
14 | getFirstStr (Str text : _) = Just text           
   |                              ^^^^^^^^^                                                                                                   

src/Text/Pandoc/SideNote.hs:36:31: error:                                                                                                     
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'                                                                     
                  with actual type `[Char]'                                                                                                   
    * In the first argument of `Str', namely `""'                                                                                             
      In the expression: Str ""       
      In an equation for `deNote': deNote (Note _) = Str ""                                                                                   
   |                                                                                                                                          
36 |         deNote (Note _) = Str ""      
   |                               ^^

src/Text/Pandoc/SideNote.hs:54:33: error:                                                                                                     
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'
                  with actual type `[Char]'                    
    * In the first argument of `Format', namely `"html"'    
      In the first argument of `RawInline', namely `(Format "html")'
      In the expression: RawInline (Format "html") labelHTML
   |
54 |   let label = RawInline (Format "html") labelHTML
   |                                 ^^^^^^

src/Text/Pandoc/SideNote.hs:54:41: error:
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'
                  with actual type `[Char]'
    * In the second argument of `RawInline', namely `labelHTML'
      In the expression: RawInline (Format "html") labelHTML
      In an equation for `label':
          label = RawInline (Format "html") labelHTML
   |
54 |   let label = RawInline (Format "html") labelHTML
   |                                         ^^^^^^^^^

src/Text/Pandoc/SideNote.hs:57:33: error:
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'
                  with actual type `[Char]'
    * In the first argument of `Format', namely `"html"'               
      In the first argument of `RawInline', namely `(Format "html")'                                                                          
      In the expression: RawInline (Format "html") inputHTML           
   |
57 |   let input = RawInline (Format "html") inputHTML
   |                                 ^^^^^^

src/Text/Pandoc/SideNote.hs:57:41: error:
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'
                  with actual type `[Char]'
    * In the second argument of `RawInline', namely `inputHTML'
      In the expression: RawInline (Format "html") inputHTML
      In an equation for `input':
          input = RawInline (Format "html") inputHTML
   |
57 |   let input = RawInline (Format "html") inputHTML
   |                                         ^^^^^^^^^

src/Text/Pandoc/SideNote.hs:61:28: error:
    * Couldn't match expected type `text-1.2.3.1:Data.Text.Internal.Text'
                  with actual type `[Char]'
    * In the expression: noteTypeCls
      In the expression: [noteTypeCls]
      In the first argument of `Span', namely
        `(ident, [noteTypeCls], attrs)'
   |
61 |   let note = Span (ident, [noteTypeCls], attrs) content'
   |                            ^^^^^^^^^^^
cabal: Leaving directory '/tmp/cabal-tmp-36604/pandoc-sidenote-0.19.0.0'
cabal: Error: some packages failed to install:
pandoc-sidenote-0.19.0.0-Kj7R7hpnKZuLTAdosGiyw3 failed during the building
phase. The exception was:
ExitFailure 1                         
patrickt commented 4 years ago

This appears to be fixed in 0.20. Until a release lands, you can work around this by specifying a git version to use in your cabal.project.