The two stanzas build-tools[0] and build-tool-depends[1] are not supported by
the cabal importer[2], which means that the generated build files for a package
such as language-c-quote[3] doesn't work.
For instance, the attached language-c-quote.scm was generated by amending the
result of running `guix cabal import -r language-c-quote`. Building it with
`guix build -f language-c-quote.scm` yields the following error:
```
Setup.hs: The program 'alex' version >=3 is required but it could not be
found.
command "runhaskell" "Setup.hs" "configure"
"--prefix=/gnu/store/javas0gpngal7lcmc77srpcc9z4891ni-ghc-language-c-quote-0.13"
"--libdir=/gnu/store/javas0gpngal7lcmc77srpcc9z4891ni-ghc-language-c-quote-0.13/lib"
"--docdir=/gnu/store/javas0gpngal7lcmc77srpcc9z4891ni-ghc-language-c-quote-0.13/share/doc/ghc-language-c-quote-0.13"
"--libsubdir=$compiler/$pkg-$version"
"--package-db=/tmp/guix-build-ghc-language-c-quote-0.13.drv-0/package.conf.d"
"--global" "--enable-tests" "--enable-shared" "--enable-executable-dynamic"
"--ghc-option=-fPIC"
"--ghc-option=-optl=-Wl,-rpath=/gnu/store/javas0gpngal7lcmc77srpcc9z4891ni-ghc-language-c-quote-0.13/lib/$compiler/$pkg-$version"
failed with status 1
builder for
`/gnu/store/4l01sv6w7a7y8sikka48pd14rvw1wvj6-ghc-language-c-quote-0.13.drv'
failed with exit code 1
build of
/gnu/store/4l01sv6w7a7y8sikka48pd14rvw1wvj6-ghc-language-c-quote-0.13.drv failed
View build log at
'/var/log/guix/drvs/4l/01sv6w7a7y8sikka48pd14rvw1wvj6-ghc-language-c-quote-0.13.drv.bz2'.
guix build: error: build of
`/gnu/store/4l01sv6w7a7y8sikka48pd14rvw1wvj6-ghc-language-c-quote-0.13.drv'
failed
```
The attached language-c-quote-fixed.scm adds the `ghc-happy` and `ghc-alex`
packages to native-inputs, as required by the build-tools stanzas in the
original cabal file.
However, build-tools has actually been deprecated in favor of
build-tool-depends, as noted in the documentation, so I guess we should
actually implement support for it in addition to build-tools.
0: https://cabal.readthedocs.io/en/3.4/cabal-package.html#pkg-field-build-tools
1:
https://cabal.readthedocs.io/en/3.4/cabal-package.html#pkg-field-build-tool-depends
2: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/import/cabal.scm
3: https://hackage.haskell.org/package/language-c-quote
(define-module (gnu packages futhark)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system haskell)
#:use-module (guix licenses)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages haskell)
#:use-module (gnu packages haskell-web)
#:use-module (gnu packages haskell-xyz)
#:use-module (gnu packages haskell-check)
#:use-module (gnu packages haskell-crypto))
(define-public ghc-srcloc
(package
(name "ghc-srcloc")
(version "0.6")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/srcloc/srcloc-"
version
".tar.gz"))
(sha256
(base32
"1vcp9vgfi5rscy09l4qaq0pp426b6qcdpzs6kpbzg0k5x81kcsbb"))))
(build-system haskell-build-system)
(home-page "https://github.com/mainland/srcloc")
(synopsis
"Data types for managing source code locations.")
(description
"Data types for tracking, combining, and printing source code locations.")
(license bsd-3)))
(define-public ghc-mainland-pretty
(package
(name "ghc-mainland-pretty")
(version "0.7.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/mainland-pretty/mainland-pretty-"
version
".tar.gz"))
(sha256
(base32
"19z2769rik6kwvsil2if2bfq2v59jmwv74jy3fy4q3q3zy4239p1"))))
(build-system haskell-build-system)
(inputs `(("ghc-srcloc" ,ghc-srcloc)))
(home-page
"https://github.com/mainland/mainland-pretty")
(synopsis
"Pretty printing designed for printing source code.")
(description
"Pretty printing designed for printing source code based on Wadler's paper /A Prettier Printer/. The main advantage of this library is its ability to automatically track the source locations associated with pretty printed values and output appropriate #line pragmas and its ability to produce output in the form of lazy text using a builder.")
(license bsd-3)))
(define-public ghc-exception-transformers
(package
(name "ghc-exception-transformers")
(version "0.4.0.9")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/exception-transformers/exception-transformers-"
version
".tar.gz"))
(sha256
(base32
"033z8mhczwf59lh59q3z546gkcsy0bzg98r1qhm3fiq7j11hgd95"))))
(build-system haskell-build-system)
(inputs
`(("ghc-transformers-compat"
,ghc-transformers-compat)))
(native-inputs
`(("ghc-hunit" ,ghc-hunit)
("ghc-test-framework" ,ghc-test-framework)
("ghc-test-framework-hunit"
,ghc-test-framework-hunit)))
(home-page
"http://hackage.haskell.org/package/exception-transformers")
(synopsis
"Type classes and monads for unchecked extensible exceptions.")
(description
"This package provides type classes, a monad and a monad transformer that support unchecked extensible exceptions as well as asynchronous exceptions. It is compatible with the transformers package.")
(license bsd-3)))
(define-public ghc-exception-mtl
(package
(name "ghc-exception-mtl")
(version "0.4.0.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/exception-mtl/exception-mtl-"
version
".tar.gz"))
(sha256
(base32
"0d51rsrcjy52d62f51hb6fdg0fj9b0qbv8hqf6523pndwsxbq4zc"))))
(build-system haskell-build-system)
(inputs
`(("ghc-exception-transformers"
,ghc-exception-transformers)))
(home-page
"http://hackage.haskell.org/package/exception-mtl")
(synopsis
"Exception monad transformer instances for mtl classes.")
(description
"This package provides exception monad transformer instances for the classes defined by mtl.")
(license bsd-3)))
(define-public ghc-language-c-quote
(package
(name "ghc-language-c-quote")
(version "0.13")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/language-c-quote/language-c-quote-"
version
".tar.gz"))
(sha256
(base32
"02axz6498sg2rf24qds39n9gysc4lm3v354h2qyhrhadlfq8sf6d"))))
(build-system haskell-build-system)
(inputs
`(("ghc-exception-mtl" ,ghc-exception-mtl)
("ghc-exception-transformers"
,ghc-exception-transformers)
("ghc-mainland-pretty" ,ghc-mainland-pretty)
("ghc-srcloc" ,ghc-srcloc)
("ghc-syb" ,ghc-syb)
("ghc-haskell-src-meta" ,ghc-haskell-src-meta)))
(native-inputs
`(("ghc-hunit" ,ghc-hunit)
("ghc-test-framework" ,ghc-test-framework)
("ghc-test-framework-hunit"
,ghc-test-framework-hunit)))
(home-page
"https://github.com/mainland/language-c-quote")
(synopsis
"C/CUDA/OpenCL/Objective-C quasiquoting library.")
(description
"This package provides a general parser for the C language, including most GCC extensions and some CUDA and OpenCL extensions as well as the entire Objective-C language.")
(license bsd-3)))
ghc-language-c-quote
(define-module (gnu packages futhark)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system haskell)
#:use-module (guix licenses)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages haskell)
#:use-module (gnu packages haskell-web)
#:use-module (gnu packages haskell-xyz)
#:use-module (gnu packages haskell-check)
#:use-module (gnu packages haskell-crypto))
(define-public ghc-srcloc
(package
(name "ghc-srcloc")
(version "0.6")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/srcloc/srcloc-"
version
".tar.gz"))
(sha256
(base32
"1vcp9vgfi5rscy09l4qaq0pp426b6qcdpzs6kpbzg0k5x81kcsbb"))))
(build-system haskell-build-system)
(home-page "https://github.com/mainland/srcloc")
(synopsis
"Data types for managing source code locations.")
(description
"Data types for tracking, combining, and printing source code locations.")
(license license:bsd-3)))
(define-public ghc-mainland-pretty
(package
(name "ghc-mainland-pretty")
(version "0.7.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/mainland-pretty/mainland-pretty-"
version
".tar.gz"))
(sha256
(base32
"19z2769rik6kwvsil2if2bfq2v59jmwv74jy3fy4q3q3zy4239p1"))))
(build-system haskell-build-system)
(inputs `(("ghc-srcloc" ,ghc-srcloc)))
(home-page
"https://github.com/mainland/mainland-pretty")
(synopsis
"Pretty printing designed for printing source code.")
(description
"Pretty printing designed for printing source code based on Wadler's paper /A Prettier Printer/. The main advantage of this library is its ability to automatically track the source locations associated with pretty printed values and output appropriate #line pragmas and its ability to produce output in the form of lazy text using a builder.")
(license license:bsd-3)))
(define-public ghc-exception-transformers
(package
(name "ghc-exception-transformers")
(version "0.4.0.9")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/exception-transformers/exception-transformers-"
version
".tar.gz"))
(sha256
(base32
"033z8mhczwf59lh59q3z546gkcsy0bzg98r1qhm3fiq7j11hgd95"))))
(build-system haskell-build-system)
(inputs
`(("ghc-transformers-compat"
,ghc-transformers-compat)))
(native-inputs
`(("ghc-hunit" ,ghc-hunit)
("ghc-test-framework" ,ghc-test-framework)
("ghc-test-framework-hunit"
,ghc-test-framework-hunit)))
(home-page
"http://hackage.haskell.org/package/exception-transformers")
(synopsis
"Type classes and monads for unchecked extensible exceptions.")
(description
"This package provides type classes, a monad and a monad transformer that support unchecked extensible exceptions as well as asynchronous exceptions. It is compatible with the transformers package.")
(license license:bsd-3)))
(define-public ghc-exception-mtl
(package
(name "ghc-exception-mtl")
(version "0.4.0.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/exception-mtl/exception-mtl-"
version
".tar.gz"))
(sha256
(base32
"0d51rsrcjy52d62f51hb6fdg0fj9b0qbv8hqf6523pndwsxbq4zc"))))
(build-system haskell-build-system)
(inputs
`(("ghc-exception-transformers"
,ghc-exception-transformers)))
(home-page
"http://hackage.haskell.org/package/exception-mtl")
(synopsis
"Exception monad transformer instances for mtl classes.")
(description
"This package provides exception monad transformer instances for the classes defined by mtl.")
(license license:bsd-3)))
(define-public ghc-language-c-quote
(package
(name "ghc-language-c-quote")
(version "0.13")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/language-c-quote/language-c-quote-"
version
".tar.gz"))
(sha256
(base32
"02axz6498sg2rf24qds39n9gysc4lm3v354h2qyhrhadlfq8sf6d"))))
(build-system haskell-build-system)
(inputs
`(("ghc-exception-mtl" ,ghc-exception-mtl)
("ghc-exception-transformers"
,ghc-exception-transformers)
("ghc-mainland-pretty" ,ghc-mainland-pretty)
("ghc-srcloc" ,ghc-srcloc)
("ghc-syb" ,ghc-syb)
("ghc-haskell-src-meta" ,ghc-haskell-src-meta)))
(native-inputs
`(("ghc-hunit" ,ghc-hunit)
("ghc-test-framework" ,ghc-test-framework)
("ghc-test-framework-hunit"
,ghc-test-framework-hunit)
("ghc-alex" ,ghc-alex)
("ghc-happy" ,ghc-happy)))
(home-page
"https://github.com/mainland/language-c-quote")
(synopsis
"C/CUDA/OpenCL/Objective-C quasiquoting library.")
(description
"This package provides a general parser for the C language, including most GCC extensions and some CUDA and OpenCL extensions as well as the entire Objective-C language.")
(license license:bsd-3)))
ghc-language-c-quote