It's been some time... Opam really needs an update.

On Fri, Dec 31, 2021 at 01:41:44PM -0500, Daniel Dickman wrote:
On Fri, Dec 31, 2021 at 2:36 AM Christopher Zimmermann
<chr...@openbsd.org> wrote:

Hi,

this update of opam changes to the build-utils shipped with opam and
drops dependencies on our ports utils. This makes ports dune version
independent of opam. OK?

Christopher

1) I get a bunch of failures like this when running "make test". we
probably have to neuter "-- strip-trailing-cr" usage?

var-option                    diff: unknown option -- strip-trailing-cr
usage: diff [-abdipTtw] [-c | -e | -f | -n | -q | -u] [-I pattern] [-L label]
           file1 file2
      diff [-abdipTtw] [-I pattern] [-L label] -C number file1 file2
      diff [-abditw] [-I pattern] -D string file1 file2
      diff [-abdipTtw] [-I pattern] [-L label] -U number file1 file2
      diff [-abdiNPprsTtw] [-c | -e | -f | -n | -q | -u] [-I pattern]
           [-L label] [-S name] [-X file] [-x pattern] dir1 dir2
[FAIL]

This is now dealt with by using gdiff for tests.

2) Running portcheck resulted in:

C++ libraries in WANTLIB with default COMPILER (most ports need
'COMPILER=base-clang ports-gcc' or 'COMPILER=base-clang ports-gcc
base-gcc')

I also made some tests more posix compliant, which helps them to succeed on OpenBSD. I will try to get those fixes upstream.

OK?

Christopher


... and here is the diff:


Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/opam/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- Makefile    24 Apr 2024 17:10:39 -0000      1.28
+++ Makefile    4 Jun 2024 19:01:12 -0000
@@ -2,10 +2,9 @@ COMMENT =              OCaml source-based package ma
CATEGORIES = sysutils devel -V = 2.0.10
+V =                    2.1.6
 PKGNAME =              opam-${V}
 DISTNAME =             opam-full-${V}
-REVISION =             1
SITES = https://github.com/ocaml/opam/releases/download/${V}/ @@ -16,14 +15,12 @@ MAINTAINER = Christopher Zimmermann <ch
 # LGPLv3
 PERMIT_PACKAGE =       Yes
-WANTLIB = ${COMPILER_LIBCXX} c m
+WANTLIB =              ${LIBCXX} c m
+
+COMPILER =             base-clang base-gcc
BUILD_DEPENDS = lang/ocaml \
-                       sysutils/findlib \
-                       devel/dune \
-                       devel/ocaml-cppo \
-                       archivers/bzip2 \
-                       net/curl
+                       archivers/bzip2
RUN_DEPENDS = archivers/unzip \
                        archivers/bzip2 \
@@ -32,11 +29,16 @@ RUN_DEPENDS =               archivers/unzip \
                        devel/gmake \
                        net/curl
+TEST_DEPENDS = textproc/gdiff \
+                       net/wget
+
 USE_GMAKE =            Yes
CONFIGURE_ENV += CFLAGS="${CFLAGS}" \
                        LDFLAGS="${LDFLAGS}"
-CONFIGURE_STYLE =      gnu
+CONFIGURE_STYLE =      gnu autoreconf no-autoheader
+AUTOCONF_VERSION =     2.69
+AUTOMAKE_VERSION =     1.16
ALL_TARGET = lib-ext all
 INSTALL_TARGET =       install
@@ -52,5 +54,8 @@ post-install:
                ${docdir}/
        ${INSTALL_DATA_DIR} ${docdir}/pages
        ${INSTALL_DATA} ${WRKSRC}/doc/pages/*.md ${docdir}/pages
+
+pre-test:
+       ln -fs ${LOCALBASE}/bin/gdiff ${WRKDIR}/bin/diff
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/opam/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo    16 Jan 2023 19:03:18 -0000      1.9
+++ distinfo    4 Jun 2024 19:01:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (opam-full-2.0.10.tar.gz) = O1dAuOHBvGXc+KohxOjNgc1qv+G/UuosxDZ8P4nVvkA=
-SIZE (opam-full-2.0.10.tar.gz) = 8173617
+SHA256 (opam-full-2.1.6.tar.gz) = 0q9e3IX1UuDPXsDdzJSdlPLcVQ3F31lRdKBqTq+K9ig=
+SIZE (opam-full-2.1.6.tar.gz) = 11704198
Index: patches/patch-Makefile_config_in
===================================================================
RCS file: patches/patch-Makefile_config_in
diff -N patches/patch-Makefile_config_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_config_in    4 Jun 2024 19:01:12 -0000
@@ -0,0 +1,13 @@
+don't use system wide installed ocaml packages
+
+Index: Makefile.config.in
+--- Makefile.config.in.orig
++++ Makefile.config.in
+@@ -17,7 +17,6 @@ OCAMLFIND = @OCAMLFIND@
+ OCAML = @OCAML@
+ OCAMLC = @OCAMLC@
+ OCAMLOPT = @OCAMLOPT@
+-DUNE = @DUNE@
+ DUNE_SECONDARY = @DUNE_SECONDARY@
+ LN_S = @LN_S@
+ Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac  4 Jun 2024 19:01:12 -0000
@@ -0,0 +1,14 @@
+don't use system wide installed ocaml packages
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -255,8 +255,6 @@ AS_IF([test "x${enable_certificate_check}" = "xno"], [
+ + AC_CHECK_PROGS(FETCH,[curl wget],no) + +-AC_CHECK_TOOL(DUNE,dune)
+-AC_CHECK_TOOL(CPPO,cppo)
+ AC_CHECK_TOOL(PATCH,patch)
+ AC_CHECK_TOOL(BUNZIP2,bunzip2)
+ Index: patches/patch-tests_reftests_legacy-git_test
===================================================================
RCS file: patches/patch-tests_reftests_legacy-git_test
diff -N patches/patch-tests_reftests_legacy-git_test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_reftests_legacy-git_test        4 Jun 2024 19:01:12 
-0000
@@ -0,0 +1,12 @@
+Index: tests/reftests/legacy-git.test
+--- tests/reftests/legacy-git.test.orig
++++ tests/reftests/legacy-git.test
+@@ -19,7 +19,7 @@ ARCHIVE=$1; shift
+ if [ ! -e "packages/${ARCHIVE}" ]; then ( cd packages && tar czf ${ARCHIVE} 
${ARCHIVE%.tar.gz}; ) fi
+ MD5=$(openssl md5 packages/${ARCHIVE} | cut -d' ' -f2)
+ echo 'src: "http://dev.null"; checksum: "'$MD5'"' > REPO/packages/${PKG}/url
+-CACHEDIR=REPO/cache/md5/$(echo $MD5 |head -c2)
++CACHEDIR=REPO/cache/md5/$(echo $MD5 |cut -b -2)
+ mkdir -p $CACHEDIR
+ cp "packages/$ARCHIVE" "$CACHEDIR/$MD5"
+ ### : INIT :
Index: patches/patch-tests_reftests_legacy-local_test
===================================================================
RCS file: patches/patch-tests_reftests_legacy-local_test
diff -N patches/patch-tests_reftests_legacy-local_test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_reftests_legacy-local_test      4 Jun 2024 19:01:12 
-0000
@@ -0,0 +1,12 @@
+Index: tests/reftests/legacy-local.test
+--- tests/reftests/legacy-local.test.orig
++++ tests/reftests/legacy-local.test
+@@ -7,7 +7,7 @@ ARCHIVE=$1; shift
+ if [ ! -e "packages/${ARCHIVE}" ]; then ( cd packages && tar czf ${ARCHIVE} 
${ARCHIVE%.tar.gz}; ) fi
+ MD5=$(openssl md5 packages/${ARCHIVE} | cut -d' ' -f2)
+ echo 'src: "http://dev.null"; checksum: "'$MD5'"' > REPO/packages/${PKG}/url
+-CACHEDIR=REPO/cache/md5/$(echo $MD5 |head -c2)
++CACHEDIR=REPO/cache/md5/$(echo $MD5 |cut -b -2)
+ mkdir -p $CACHEDIR
+ cp "packages/$ARCHIVE" "$CACHEDIR/$MD5"
+ ### : INIT :
Index: patches/patch-tests_reftests_local-cache_test
===================================================================
RCS file: patches/patch-tests_reftests_local-cache_test
diff -N patches/patch-tests_reftests_local-cache_test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_reftests_local-cache_test       4 Jun 2024 19:01:12 
-0000
@@ -0,0 +1,24 @@
+Index: tests/reftests/local-cache.test
+--- tests/reftests/local-cache.test.orig
++++ tests/reftests/local-cache.test
+@@ -73,16 +73,16 @@ hsh=$3
+ case "$hsh-$kind" in
+   md5-archive)
+     HSH=$ARCHIVE_MD5
+-    break;;
++    ;;
+   sha256-archive)
+     HSH=$ARCHIVE_SHA256
+-    break;;
++    ;;
+   md5-patch)
+     HSH=$PATCH_MD5
+-    break;;
++    ;;
+   sha256-patch)
+     HSH=$PATCH_SHA256
+-    break;;
++    ;;
+ esac
+ pkgpath="REPO/packages/${pkg%.*}/$pkg"
+ sed -i.bak "s/good-$hsh/$HSH/" "$pkgpath/opam"
Index: patches/patch-tests_reftests_pin_unix_test
===================================================================
RCS file: patches/patch-tests_reftests_pin_unix_test
diff -N patches/patch-tests_reftests_pin_unix_test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_reftests_pin_unix_test  4 Jun 2024 19:01:12 -0000
@@ -0,0 +1,21 @@
+Index: tests/reftests/pin.unix.test
+--- tests/reftests/pin.unix.test.orig
++++ tests/reftests/pin.unix.test
+@@ -14,7 +14,7 @@ echo "pin-depends: [ \"qux.dev\" \"file://$BASEDIR/qux
+ opam-version: "2.0"
+ depexts: [ "another-inexistant" ]
+ ### opam switch create pinning --empty
+-### opam pin ./bar | '(apt-get|brew|port)' -> 'syspkgmanager'
++### opam pin ./bar | '(apt-get|brew|port)' -> 'syspkgmanager' | 'pkg_add -i' 
-> 'syspkgmanager install'
+ Package bar does not exist, create as a NEW package? [Y/n] y
+ The following additional pinnings are required by bar.~dev:
+   - qux.dev at file://${BASEDIR}/qux
+@@ -45,7 +45,7 @@ Ok, qux is no longer pinned to file://${BASEDIR}/qux (
+ Ok, bar is no longer pinned to file://${BASEDIR}/bar (version ~dev)
+ ### opam option 'depext-bypass-=["another-inexistant" "inexistant"]'
+ No modification in switch pinning
+-### opam install ./bar | '(apt-get|brew|port)' -> 'syspkgmanager'
++### opam install ./bar | '(apt-get|brew|port)' -> 'syspkgmanager' | 'pkg_add -i' 
-> 'syspkgmanager install'
+ Package bar does not exist, create as a NEW package? [Y/n] y
+ The following additional pinnings are required by bar.~dev:
+   - qux.dev at file://${BASEDIR}/qux
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/opam/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST   11 Mar 2022 19:57:44 -0000      1.3
+++ pkg/PLIST   4 Jun 2024 19:01:12 -0000
@@ -24,6 +24,8 @@
 @man man/man1/opam-installer.1
 @man man/man1/opam-lint.1
 @man man/man1/opam-list.1
+@man man/man1/opam-lock.1
+@man man/man1/opam-option.1
 @man man/man1/opam-pin.1
 @man man/man1/opam-reinstall.1
 @man man/man1/opam-remote.1
@@ -46,6 +48,7 @@ share/doc/opam/depexts-plugins
 share/doc/opam/depopts-and-features
 share/doc/opam/pages/
 share/doc/opam/pages/About.md
+share/doc/opam/pages/Distribution.md
 share/doc/opam/pages/External_solvers.md
 share/doc/opam/pages/FAQ.md
 share/doc/opam/pages/Install.md

Reply via email to