Date: Fri, 10 May 2019 15:54:08 +0400 From: Gleb Popov <arrowd@freebsd.org> To: Palle Girgensohn <girgen@freebsd.org> Cc: "haskell@freebsd.org" <haskell@freebsd.org> Subject: Re: Haskell in FreeBSD ports Message-ID: <CALH631k8saixHQOTfqmfBS0yqg=yRRzwNJUYXqDW3j2xnbL09A@mail.gmail.com> In-Reply-To: <62B2EE72-1B64-460B-BE18-E7E8DE51B7A4@FreeBSD.org> References: <8839F753-5287-47DA-B61D-4C88DAE68D1B@FreeBSD.org> <CALH631kH2DwwMywDy_1G_S2LNeSoVOPZQuRaATP69mYW9PSsqQ@mail.gmail.com> <62B2EE72-1B64-460B-BE18-E7E8DE51B7A4@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 10, 2019 at 2:50 PM Palle Girgensohn <girgen@freebsd.org> wrote: > > > 10 maj 2019 kl. 10:29 skrev Gleb Popov <arrowd@freebsd.org>: > > > > On Fri, May 10, 2019 at 11:49 AM Palle Girgensohn <girgen@freebsd.org> > wrote: > >> Hi! >> >> A while ago, I started porting a haskell based project called pgbackrest [ >> 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 repository and > didn't find any Haskell sources. > > > Haha, sorry, I was confused. 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 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 features. > Palle > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALH631k8saixHQOTfqmfBS0yqg=yRRzwNJUYXqDW3j2xnbL09A>