From 658728398196a54710384ab68ca98b287c6b3be3 Mon Sep 17 00:00:00 2001 From: gnezdo Date: Sat, 10 Apr 2021 15:26:47 +0000 Subject: [PATCH] Add cabal-module(5) man page OK kn --- share/man/man5/Makefile | 6 +- share/man/man5/cabal-module.5 | 140 ++++++++++++++++++++++++++++++++++ share/man/man5/port-modules.5 | 7 +- 3 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 share/man/man5/cabal-module.5 diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 60183d795d3..a62844dfb0a 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.59 2021/02/25 09:13:18 espie Exp $ +# $OpenBSD: Makefile,v 1.60 2021/04/10 15:26:47 gnezdo Exp $ # $NetBSD: Makefile,v 1.14 1995/05/11 23:13:15 cgd Exp $ MAN= acct.5 ar.5 bsd.port.mk.5 bsd.port.arch.mk.5 bsd.regress.mk.5 \ @@ -7,12 +7,12 @@ MAN= acct.5 ar.5 bsd.port.mk.5 bsd.port.arch.mk.5 bsd.regress.mk.5 \ fs.5 fstab.5 genassym.cf.5 group.5 hostname.if.5 hosts.5 installurl.5 \ intro.5 login.conf.5 mandoc.db.5 mixerctl.conf.5 \ mk.conf.5 moduli.5 motd.5 mygate.5 myname.5 netgroup.5 passwd.5 \ - pf.conf.5 pf.os.5 port-modules.5 \ + pf.conf.5 pf.os.5 port-modules.5 cabal-module.5 \ cargo-module.5 gnome-module.5 go-module.5 python-module.5 qmake-module.5 \ ruby-module.5 \ printcap.5 protocols.5 \ ranlib.5 remote.5 resolv.conf.5 rpc.5 \ services.5 shells.5 \ spamd.conf.5 sysctl.conf.5 utmp.5 wsconsctl.conf.5 - + .include diff --git a/share/man/man5/cabal-module.5 b/share/man/man5/cabal-module.5 new file mode 100644 index 00000000000..2a123313af8 --- /dev/null +++ b/share/man/man5/cabal-module.5 @@ -0,0 +1,140 @@ +.\" $OpenBSD: cabal-module.5,v 1.1 2021/04/10 15:26:47 gnezdo Exp $ +.\" +.\" Copyright (c) 2021 Greg Steuck +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd $Mdocdate: April 10 2021 $ +.Dt CABAL-MODULE 5 +.Os +.Sh NAME +.Nm cabal-module +.Nd devel/cabal port module for building Haskell programs +.Sh DESCRIPTION +This manual page documents the behavior of setting +.Li MODULE=devel/cabal +in the +.Xr ports 7 +tree. +.Pp +Uses +.Xr cabal 1 +to automate packaging Haskell binary projects. +During +.Cm fetch , +the dependent packages enumerated in +.Ev MODCABAL_MANIFEST +are downloaded into the +.Pa hackage +subdirectory of +.Ev DIST_SUBDIR . +During +.Cm post-extract , +the dependency sources are unpacked into +.Ev WORKDIR . +Special care is taken to replace .cabal files if they are updated +post-release on hackage. +A custom +.Pa cabal.project.local +file gets created to direct +.Xr cabal 1 +to the extracted packages and prevent any network interaction. +In rare cases a custom +.Pa cabal.project +is required. +This module automatically copies such files from port's +.Pa files +into +.Ev WRKSRC . +During +.Cm build , +.Xr cabal 1 +is invoked to build the executables listed in +.Ev MODCABAL_EXECUTABLES . +.Pp +.Pa lang/ghc +and +.Pa devel/cabal-install +are added to +.Ev BUILD_DEPENDS . +This module uses +.Ev MASTER_SITES9 +to download the sources from hackage. +.Pp +This module parameters: +.Bl -tag -width MODCABAL_EXECUTABLES +.It MODCABAL_STEM +Name of the package on hackage (required). +.It MODCABAL_VERSION +Version of the package (required). +.It MODCABAL_MANIFEST +Hackage dependencies required by this package, see below. +.It MODCABAL_DATA_DIR +data-dir from .cabal file (if executable needs this) +.It MODCABAL_REVISION +Numeric revision of .cabal file on hackage if one is +needed on top of .cabal file contained in the .tar.gz file. +.It MODCABAL_BUILD_ARGS +passed to cabal v2-build +.It MODCABAL_FLAGS +custom feature +.Fl -flags +for +.Xr cabal 1 . +.It MODCABAL_EXECUTABLES +Executable target in .cabal file, defaults to hackage package name in +.Ev MODCABAL_STEM . +.El +.Pp +This module adds currently adds no +.Xr make 1 +targets. +.Sh DEPENDENCY MANIFEST +Hackage dependencies are listed in +.Ev MODCABAL_MANIFEST +as space separate triples of +.Em package +.Em version +.Em revision . +They correspond to the main package values of +.Ev MODCABAL_STEM +.Ev MODCABAL_VERSION +.Ev MODCABAL_REVISION . +.Pp +The contents of +.Ev MODCABAL_MANIFEST +is normally generated by +.Pa devel/cabal-bundler +which creates a working build plan from hackage dependency information. +.Sh EXAMPLES +To create a new Haskell binary port one would install cabal-bundler +port, look up the chosen package version number on hackage. +E.g. +.Pp +$ +.Cm cabal-bundler +.Fl -openbsd +.Ar cpphs-1.20 +.Sh SEE ALSO +.Xr cabal 1 , +.Xr port-modules 5 diff --git a/share/man/man5/port-modules.5 b/share/man/man5/port-modules.5 index 446f80fd3c7..6e1a96742e3 100644 --- a/share/man/man5/port-modules.5 +++ b/share/man/man5/port-modules.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: port-modules.5,v 1.255 2021/03/09 19:05:28 tracey Exp $ +.\" $OpenBSD: port-modules.5,v 1.256 2021/04/10 15:26:47 gnezdo Exp $ .\" .\" Copyright (c) 2008 Marc Espie .\" @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 9 2021 $ +.Dd $Mdocdate: April 10 2021 $ .Dt PORT-MODULES 5 .Os .Sh NAME @@ -587,6 +587,9 @@ Also, .Sq nojunk is added to DPB_PROPERTIES because CMake's include files parser cheats too much. +.It devel/cabal +See +.Xr cabal-module 5 for porting Haskell applications . .It devel/cargo See .Xr cargo-module 5 . -- 2.20.1