Haskell in FreeBSD ports

Palle Girgensohn girgen at FreeBSD.org
Fri May 10 11:56:43 UTC 2019



> 10 maj 2019 kl. 13:54 skrev Gleb Popov <arrowd at freebsd.org>:
> 
> 
> 
> On Fri, May 10, 2019 at 2:50 PM Palle Girgensohn <girgen at freebsd.org <mailto:girgen at freebsd.org>> wrote:
> 
> 
>> 10 maj 2019 kl. 10:29 skrev Gleb Popov <arrowd at freebsd.org <mailto:arrowd at freebsd.org>>:
>> 
>> 
>> 
>> On Fri, May 10, 2019 at 11:49 AM Palle Girgensohn <girgen at freebsd.org <mailto:girgen at freebsd.org>> wrote:
>> Hi!
>> 
>> A while ago, I started porting a haskell based project called pgbackrest [https://pgbackrest.org <https://pgbackrest.org/> <https://pgbackrest.org/ <https://pgbackrest.org/>>]. I never really finished at the the time, so I let it ly around on a repo of mine. Yesterday I updated it and realized you're moving haskell stuff out of the ports tree. Do you have any pointers to how to relate to this work, and what I can do to get pgbackrest into the ports tree? I remember there where more than 20 new haskell ports I had to add to get it working.
>> 
>> Thanks
>> Palle
>> 
>> I skimmed through https://github.com/pgbackrest/pgbackrest <https://github.com/pgbackrest/pgbackrest> repository and didn't find any Haskell sources.
> 
> Haha, sorry, I was confused. postgrest [https://github.com/PostgREST/postgrest <https://github.com/PostgREST/postgrest>] is the name of the project. :-)
> 
>> We don't keep ports for Haskell libraries anymore. That means, that if pgbackrest is a Haskell library, you don't need to port it. Instead, port an application that uses it.
> 
> So I port it sort of like a go application, by referencing all the libraries in the application port? Where will the libs go? Any tips of application ports using haskell that I can use as reference?
> 
> Yes, pretty much like Go. All library dependencies get linked statically. I haven't yet documented the new way of creating ports, so see comments file:///usr/ports/Mk/Uses/cabal.mk <http://cabal.mk/> 
> 
> In short, if a package is present on Hackage, you do following things:
> 
> 0. Install devel/hs-cabal-install
> 1. Create a Makefile with bare minimum code required. Basically, PORTNAME, PORTVERSION and USES= cabal.
> 2. Invoke `make cabal-extract` for it.
> 3. Invoke `make cabal-extract-deps`. As side effect this will build the package.
> 4. Invoke `make use-cabal`. This will generate USE_CABAL= line with list of all ports dependencies. Put it into the port.
> 5. Set `EXECUTABLES` variable if needed.
> 6. You're set up. Try building the port usual way: `make makesum && make && make stage-qa`.
> 
> If that last step didn't work due to missing dependencies, you probably need to add revisions to some dependencies. Run `make check-revs`, lookup packages on Hackage and add "_x" to appropriate USE_CABAL item.
> 
> Take a look at devel/hs-git-annex for example - it is a complex port using various cabal.mk <http://cabal.mk/> features.
> 

Excellent, thanks!

Palle




More information about the freebsd-haskell mailing list