From owner-freebsd-haskell@freebsd.org Fri May 10 11:56:43 2019 Return-Path: Delivered-To: freebsd-haskell@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A7215A0940 for ; Fri, 10 May 2019 11:56:43 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 232F46D1DC for ; Fri, 10 May 2019 11:56:43 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id DB55915A093E; Fri, 10 May 2019 11:56:42 +0000 (UTC) Delivered-To: haskell@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6EC915A093D for ; Fri, 10 May 2019 11:56:42 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from mail.pingpong.net (mail.pingpong.net [109.228.164.3]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1616D1DA; Fri, 10 May 2019 11:56:42 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from girgbook.pingpong.net (citron2.pingpong.net [195.178.173.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.pingpong.net (Postfix) with ESMTPSA id 82AFD45356; Fri, 10 May 2019 13:56:39 +0200 (CEST) From: Palle Girgensohn Message-Id: <71996436-9812-4299-996D-E00A53898CAA@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: Haskell in FreeBSD ports Date: Fri, 10 May 2019 13:56:39 +0200 In-Reply-To: Cc: "haskell@freebsd.org" To: Gleb Popov References: <8839F753-5287-47DA-B61D-4C88DAE68D1B@FreeBSD.org> <62B2EE72-1B64-460B-BE18-E7E8DE51B7A4@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 3C1616D1DA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-haskell@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD-specific Haskell issues and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 11:56:43 -0000 > 10 maj 2019 kl. 13:54 skrev Gleb Popov : >=20 >=20 >=20 > On Fri, May 10, 2019 at 2:50 PM Palle Girgensohn > wrote: >=20 >=20 >> 10 maj 2019 kl. 10:29 skrev Gleb Popov >: >>=20 >>=20 >>=20 >> On Fri, May 10, 2019 at 11:49 AM Palle Girgensohn > wrote: >> Hi! >>=20 >> A while ago, I started porting a haskell based project called = pgbackrest [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. >>=20 >> Thanks >> Palle >>=20 >> I skimmed through https://github.com/pgbackrest/pgbackrest = repository and didn't find = any Haskell sources. >=20 > Haha, sorry, I was confused. postgrest = [https://github.com/PostgREST/postgrest = ] is the name of the project. = :-) >=20 >> 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. >=20 > 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? >=20 > 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 =20 >=20 > In short, if a package is present on Hackage, you do following things: >=20 > 0. Install devel/hs-cabal-install > 1. Create a Makefile with bare minimum code required. Basically, = PORTNAME, PORTVERSION and USES=3D 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=3D 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`. >=20 > 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. >=20 > Take a look at devel/hs-git-annex for example - it is a complex port = using various cabal.mk features. >=20 Excellent, thanks! Palle