Hi ports@,
I'm trying to write a port for git-annex, which is built using
Haskell's Cabal. I'm new to OpenBSD porting and don't completely
understand the lang/ghc module.
Basic question: do all of the Haskell dependencies (from git-annex.cabal) need
to already have their own ports (like devel/hs-async, devel/hs-network, etc)?
(Or will the missing ones be magically built like cabal-install normally does?)
If they do need to all be ported, how isn't there e.g. a devel/hs-containers
port --- doesn't basically every Haskell project depend on the containers
package?
git-annex has at least 50 dependencies I couldn't find in ports, so I
want to make sure I understand this before I start porting them one at
a time (or just give up)...
Also, I'm using devel/darcs/Makefile as my model but don't understand
the following comment. Should I also be listing git-annex's
dependencies in BUILD_DEPENDS instead of LIB_DEPENDS?
# Yes, build dependencies, because GHC libs are still static and we
# don't want to pull in all of ghc.
BUILD_DEPENDS = archivers/hs-zip-archive>=0.2.3,<0.4 \
archivers/hs-zlib>=0.6.1.2,<0.7.0.0 \
...
Another question: what is MODGHC_PACKAGE_KEY? ghc.port.mk describes it
as the "package key" of the library, but I don't know what that means.
Here is what I have so far. I only included the dependencies that are
already in ports. Currently make build fails with a compiler error
"Could not find module ‘System.FilePath.ByteString’", indicating that
it is indeed a problem that there's no filepath-bytestring port.
diff --git a/devel/git-annex/Makefile b/devel/git-annex/Makefile
new file mode 100644
index 00000000000..57ae7fe1079
--- /dev/null
+++ b/devel/git-annex/Makefile
@@ -0,0 +1,54 @@
+# $OpenBSD$
+#
+# TODO:
+# Use /usr/ports/infrastructure/bin/portcheck
+
+COMMENT = manage files with git without checking in file contents
+
+DISTNAME = git-annex-8.20210127
+CATEGORIES = devel
+HOMEPAGE = https://git-annex.branchable.com/
+
+MODULES = lang/ghc
+MODGHC_BUILD = cabal hackage nort
+
+# Many licenses listed in COPYRIGHT. All permit redistribution.
+PERMIT_PACKAGE = Yes
+
+# TODO
+# "make port-lib-depends-check" can help
+#WANTLIB = ???
+
+# TODO
+# Dependencies
+#BUILD_DEPENDS = ???
+RUN_DEPENDS = net/rsync devel/git-lfs
+LIB_DEPENDS = devel/hs-network-uri>=2.6 \
+ devel/hs-exceptions>=0.6 \
+ devel/hs-data-default \
+ devel/hs-random \
+ devel/hs-dlist \
+ devel/hs-unix-compat \
+ devel/hs-async \
+ devel/hs-hslogger \
+ devel/hs-utf8-string \
+ devel/hs-sandi \
+ devel/hs-monad-control \
+ devel/hs-edit-distance \
+ devel/hs-resourcet \
+ devel/hs-conduit \
+ devel/hs-old-locale \
+ devel/hs-unliftio-core \
+ devel/hs-vector \
+ devel/hs-unordered-containers \
+ devel/hs-regex-tdfa \
+ devel/hs-byteable \
+ security/hs-crypto-api \
+ devel/hs-split \
+ textproc/hs-attoparsec \
+ devel/hs-QuickCheck
+#version doesn't match
+#devel/hs-network>=3.0.0.0
+TEST_DEPENDS = net/rsync
+
+.include <bsd.port.mk>
diff --git a/devel/git-annex/distinfo b/devel/git-annex/distinfo
new file mode 100644
index 00000000000..9d9fa1c5788
--- /dev/null
+++ b/devel/git-annex/distinfo
@@ -0,0 +1,2 @@
+SHA256 (ghc/git-annex-8.20210127.tar.gz) =
Y29DlCDyipKoJQufi0IlZ+Q5MV8/LSPLC+o7Cg5XVcM=
+SIZE (ghc/git-annex-8.20210127.tar.gz) = 1361993