From owner-freebsd-haskell@freebsd.org Fri May 10 11:54:45 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 B394E15A0886 for ; Fri, 10 May 2019 11:54:45 +0000 (UTC) (envelope-from 6yearold@gmail.com) 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 D97126D1A3 for ; Fri, 10 May 2019 11:54:44 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 9A36915A0883; Fri, 10 May 2019 11:54:44 +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 7615A15A0882 for ; Fri, 10 May 2019 11:54:44 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D48816D1A1; Fri, 10 May 2019 11:54:43 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-pg1-f172.google.com with SMTP id z3so2920286pgp.8; Fri, 10 May 2019 04:54:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Klee4IvJrFMc1OblXsOK+bDaWFc/+W5LuoFKTxf1I0=; b=HmeFoAgsHqPYF36QYaVc0wvp9cKcBW5mOtav8bOkkyOHihWfSzd+oiPLdpi+JWVIu/ 5L56LhEHk27ANzPZ03HhyOjhBCYgzwhN46d5QYeSFHy7cq7XLm3hMUHfinTbBDEnqiME p/DGOSXL66V6Kfp09VvMKu/FwDpE4LiT0FLDmG/C24C5266hnxN30QZCdLOumgb42nkc 95zlpYuhgkiGsL9534t8FcyZzZMnm0QE8pbq9VHg1QqcOr8Zgd4Nzqvi9/mhXK490zVp sKenFuGl8K48AGLX9jrGVLl4yiPA0HnFDR1gVZ/6ONxi19MkFcXaw3iTGUpDH2XKMpkx qxTQ== X-Gm-Message-State: APjAAAVyMaezxIg148nnyVZRXvfXcbMgpoktLoH5pNFc5z1xq5XrkNn2 eDH6j1P5m70FfuMH/ib1dFuDg+pn8Bc= X-Google-Smtp-Source: APXvYqyqzCGWWVQUqRBQ8Kn3UBT8WDYUYO82D3FyJw1umXA3ej62wBDpmEaHgXHGXmchnnv+zU+SKg== X-Received: by 2002:a62:6c43:: with SMTP id h64mr13222864pfc.5.1557489276498; Fri, 10 May 2019 04:54:36 -0700 (PDT) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com. [209.85.214.180]) by smtp.gmail.com with ESMTPSA id s85sm8372692pfa.23.2019.05.10.04.54.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 04:54:36 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id a5so2729477pls.12; Fri, 10 May 2019 04:54:36 -0700 (PDT) X-Received: by 2002:a17:902:4101:: with SMTP id e1mr12550690pld.25.1557489275941; Fri, 10 May 2019 04:54:35 -0700 (PDT) MIME-Version: 1.0 References: <8839F753-5287-47DA-B61D-4C88DAE68D1B@FreeBSD.org> <62B2EE72-1B64-460B-BE18-E7E8DE51B7A4@FreeBSD.org> In-Reply-To: <62B2EE72-1B64-460B-BE18-E7E8DE51B7A4@FreeBSD.org> From: Gleb Popov Date: Fri, 10 May 2019 15:54:08 +0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Haskell in FreeBSD ports To: Palle Girgensohn Cc: "haskell@freebsd.org" X-Rspamd-Queue-Id: D48816D1A1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.965,0] Content-Type: text/plain; charset="UTF-8" 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:54:46 -0000 On Fri, May 10, 2019 at 2:50 PM Palle Girgensohn wrote: > > > 10 maj 2019 kl. 10:29 skrev Gleb Popov : > > > > On Fri, May 10, 2019 at 11:49 AM Palle Girgensohn > wrote: > >> Hi! >> >> 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. >> >> 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 > >