Hi Greg, On Thu, Mar 04, 2021 at 09:09:03PM -0800, Greg Steuck wrote: > The attached three patches should complete the cleanup. Let me know if I > missed anything. We can then move on to ghc 8.10 upgrade. > > I rebuilt lang/ghc with the patches applied on amd64. I expect the > change to be a no-op in terms of generated package and so didn't bump > the revision. Maybe I still should?
Looks fine. If everything still works for you, go ahead. CIao, Kili > >From 888e694a7e8d07299c61945c516bfa7fa8e95fbd Mon Sep 17 00:00:00 2001 > From: Greg Steuck <g...@nest.cx> > Date: Sat, 3 Oct 2020 20:45:05 -0700 > Subject: [PATCH 1/3] Remove ghc.port.mk (copy the relevant parts into > ghc/Makefile) > > --- > lang/ghc/Makefile | 21 +++---- > lang/ghc/ghc.port.mk | 145 ------------------------------------------- > 2 files changed, 10 insertions(+), 156 deletions(-) > delete mode 100644 lang/ghc/ghc.port.mk > > diff --git a/lang/ghc/Makefile b/lang/ghc/Makefile > index 6be97a658fc..38081709957 100644 > --- a/lang/ghc/Makefile > +++ b/lang/ghc/Makefile > @@ -10,8 +10,8 @@ COMMENT = compiler for the functional language > Haskell > > # ghc hardcodes ${WRKDIR}/bin/gcc when the package is compiled with ccache > NO_CCACHE = Yes > - > -DISTNAME = ghc-${MODGHC_VER} > +GHC_VERSION = 8.6.4 > +DISTNAME = ghc-${GHC_VERSION} > REVISION = 9 > CATEGORIES = lang devel > HOMEPAGE = https://www.haskell.org/ghc/ > @@ -19,9 +19,8 @@ HOMEPAGE = https://www.haskell.org/ghc/ > # Version of the precompiled binaries > BIN_VER = 8.6.4.20200921 > > -# Pull in lang/ghc to get MODGHC_VER and ONLY_FOR_ARCHS, which is maintained > -# in ghc.port.mk. lang/python needed for regression tests. > -MODULES = lang/ghc lang/python > +# lang/python needed for regression tests. > +MODULES = lang/python > > MODPY_BUILDDEP = No > MODPY_RUNDEP = No > @@ -47,7 +46,7 @@ RUN_DEPENDS = > # loadObj_() instead. > USE_WXNEEDED = special > > -MASTER_SITES = ${HOMEPAGE}dist/${MODGHC_VER}/ \ > +MASTER_SITES = ${HOMEPAGE}dist/${GHC_VERSION}/ \ > ${HOMEPAGE}dist/stable/dist/ > MASTER_SITES0 = https://openbsd.dead-parrot.de/distfiles/ > > @@ -55,8 +54,8 @@ DIST_SUBDIR = ghc > > BINDISTFILE = ${BINDISTFILE-${MACHINE_ARCH}} > > -DISTFILES = ghc-${MODGHC_VER}-src.tar.xz \ > - ghc-${MODGHC_VER}-testsuite.tar.xz \ > +DISTFILES = ghc-${GHC_VERSION}-src.tar.xz \ > + ghc-${GHC_VERSION}-testsuite.tar.xz \ > ${BINDISTFILE} > > .for m in amd64 i386 > @@ -229,11 +228,11 @@ _bootstrap_prepare: > echo ${BOOTSTRAP_DATE} > ${WRKSRC}/VERSION_DATE > > _bootstrap_finish: > - mkdir -p ${WRKBUILD}/ghc-${MODGHC_VER}.${BOOTSTRAP_DATE}-shlibs-$$(arch > -s) > + mkdir -p > ${WRKBUILD}/ghc-${GHC_VERSION}.${BOOTSTRAP_DATE}-shlibs-$$(arch -s) > ldd ${WRKBUILD}/ghc/stage2/build/tmp/ghc-stage2 | \ > awk '$$NF ~ /^\/usr\/(local\/)?lib\// { print $$NF }' | \ > - xargs -J % cp -p % > ${WRKBUILD}/ghc-${MODGHC_VER}.${BOOTSTRAP_DATE}-shlibs-$$(arch -s) > + xargs -J % cp -p % > ${WRKBUILD}/ghc-${GHC_VERSION}.${BOOTSTRAP_DATE}-shlibs-$$(arch -s) > cd ${WRKBUILD} && \ > - pax -wzf ghc-${MODGHC_VER}.${BOOTSTRAP_DATE}-shlibs-$$(arch > -s){.tar.gz,} > + pax -wzf ghc-${GHC_VERSION}.${BOOTSTRAP_DATE}-shlibs-$$(arch > -s){.tar.gz,} > > .include <bsd.port.mk> > diff --git a/lang/ghc/ghc.port.mk b/lang/ghc/ghc.port.mk > deleted file mode 100644 > index 5bcc973f593..00000000000 > --- a/lang/ghc/ghc.port.mk > +++ /dev/null > @@ -1,145 +0,0 @@ > -# $OpenBSD: ghc.port.mk,v 1.45 2019/12/02 23:32:29 kili Exp $ > -# Module for Glasgow Haskell Compiler > - > -# Not yet ported to other architectures > -ONLY_FOR_ARCHS = i386 amd64 > - > -# Dependency of meta/haskell-platform. > -# Please do *not* update without thinking. > -MODGHC_VER = 8.6.4 > -SUBST_VARS += MODGHC_VER > - > -MODGHC_BIN = ${LOCALBASE}/bin/ghc > - > -# The following is for depending ports only. GHC itself just needs > -# MODGHC_VER and ONLY_FOR_ARCHS. This is a little bit ugly, but > -# depending ports using CABAL tend to install into locations as > -# lib/Foo-${FooVersion}/ghc-${MODGHC_VER}, so they need the exact > -# version of ghc. Depending ports thus need full depends specs, > -# i.e. RUN_DEPENDS = lang/ghc=${MODGHC_VER}, and not > -# just lang/ghc. > -.if ${PKGPATH} != "lang/ghc" > -BUILD_DEPENDS += lang/ghc > - > -# There seems to be a race condition in ghc-pkg (for ghc-8.6) which > -# is triggered when a port build runs ghc-pkg recache while dpb(1) > -# recycles unused hs-packages. > -DPB_PROPERTIES += nojunk > - > -# Set to "cabal" to get the typical Cabal targets defined. Add "haddock" > -# to generate API documentation using Haddock. Add "register" to create > -# and include a package registration file in > -# ${PREFIX}/lib/ghc/package.conf.d (you'll still have to add the > -# necessary @tag ghc-pkg-recache to your PLIST by hand). > -# Add "nort" if the port doesn't depend on the GHC runtime. This will > -# also turn off the default "hs-" prefix for PKGNAME. > -# If "nort" is not added, MODGHC_PACKAGE_KEY may be set to the 'package > -# key' of the library built and will be added to SUBST_VARS. > -# Finally, set it to or add "hackage" if the distfiles are available on > -# hackage.haskell.org. > - > -MODGHC_BUILD ?= > - > -. if !${MODGHC_BUILD:L:Mnort} > -PKGNAME ?= hs-${DISTNAME} > -RUN_DEPENDS += lang/ghc=${MODGHC_VER} > -CATEGORIES += lang/ghc > -MODGHC_PACKAGE_KEY ?= > -. if ${MODGHC_PACKAGE_KEY} != "" > -SUBST_VARS += MODGHC_PACKAGE_KEY > -. endif > -. endif > - > -. if ${MODGHC_BUILD:L:Mhackage} > -MODGHC_HACKAGE_NAME = ${DISTNAME:C,-[0-9.]*$,,} > -MODGHC_HACKAGE_VERSION = ${DISTNAME:C,.*-([0-9.]*)$,\1,} > -HOMEPAGE ?= > https://hackage.haskell.org/package/${MODGHC_HACKAGE_NAME} > -MASTER_SITES = > https://hackage.haskell.org/package/${DISTNAME}/ > -SUBST_VARS += DISTNAME MODGHC_HACKAGE_VERSION > -DIST_SUBDIR ?= ghc > -. endif > - > -. if ${MODGHC_BUILD:L:Mcabal} > -MODGHC_SETUP_SCRIPT ?= Setup.lhs Setup.hs > -MODGHC_SETUP_PROG ?= ${WRKSRC}/Setup > -MODGHC_SETUP_CONF_ARGS += --with-gcc="${CC}" > -MODGHC_SETUP_CONF_ENV ?= > - > -. if !${MODGHC_BUILD:L:Mnort} > -MODGHC_SETUP_CONF_ARGS += --datasubdir=hs-\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --docdir=\$$datadir/doc/hs-\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --libsubdir=ghc/\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --enable-library-profiling > -. else > -# Override Cabal defaults, which are $arch-$os-$compiler/$pkgid for > -# datasubdir and libsubdir, $datadir/doc/$arch-$os-$compiler/$pkgid > -# for docdir and ${PREFIX}/lib/$arch-$os-$compiler/$pkgid for dynlibdir. > -MODGHC_SETUP_CONF_ARGS += --datasubdir=\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --libsubdir=\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid > -MODGHC_SETUP_CONF_ARGS += --docdir=\$$datadir/doc/\$$pkgid > -. endif > - > -# Little hack to let ports still add CONFIGURE_STYLE = autoconf and go > -# without a do-configure: target (some Haskell ports are built with > -# Cabal but use autohell for the documentation): > -MODCABAL_configure = \ > - cd ${WRKSRC} && \ > - for s in ${MODGHC_SETUP_SCRIPT}; do \ > - test -f "$$s" && \ > - ${MODGHC_BIN} --make \ > - -o ${MODGHC_SETUP_PROG} "$$s" && \ > - break; \ > - done && \ > - cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} ${MODGHC_SETUP_CONF_ENV} \ > - ${MODGHC_SETUP_PROG} \ > - configure -v -g -O --prefix=${PREFIX} \ > - ${MODGHC_SETUP_CONF_ARGS} > - > -CONFIGURE_STYLE += CABAL > - > -MODGHC_BUILD_TARGET = \ > - cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ > - ${MODGHC_SETUP_PROG} build -v > -. if ${MODGHC_BUILD:L:Mhaddock} > -MODGHC_BUILD_TARGET += \ > - ;cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ > - ${MODGHC_SETUP_PROG} haddock > -. endif > -. if ${MODGHC_BUILD:L:Mregister} > -MODGHC_BUILD_TARGET += \ > - ;cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ > - ${MODGHC_SETUP_PROG} register --gen-pkg-config > -. endif > - > -MODGHC_INSTALL_TARGET = \ > - cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} \ > - ${MODGHC_SETUP_PROG} copy --destdir=${DESTDIR} > -. if ${MODGHC_BUILD:L:Mregister} > -MODGHC_INSTALL_TARGET += \ > - ;${INSTALL_DATA_DIR} ${PREFIX}/lib/ghc/package.conf.d && \ > - ${INSTALL_DATA} ${WRKBUILD}/${DISTNAME}.conf \ > - ${PREFIX}/lib/ghc/package.conf.d/ > -. endif > - > -MODGHC_TEST_TARGET = \ > - cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} \ > - ${MODGHC_SETUP_PROG} test > - > -. if !target(do-build) > -do-build: > - @${MODGHC_BUILD_TARGET} > -. endif > - > -. if !target(do-install) > -do-install: > - @${MODGHC_INSTALL_TARGET} > -. endif > - > -. if !target(do-test) > -do-test: > - @${MODGHC_TEST_TARGET} > -. endif > -. endif > -.endif > -- > 2.30.1 > > >From 0f917a7293f54108315d63f2f943028ef131be8f Mon Sep 17 00:00:00 2001 > From: Greg Steuck <g...@nest.cx> > Date: Fri, 30 Oct 2020 23:57:38 -0700 > Subject: [PATCH 2/3] Remove GhcConf packing element as ghc-pkg-recache is no > more > > These were previously used to automatically add tags to PLIST for > Haskell library ports. Since library ports no longer exist, such > tagging only ever triggers for ghc package where it is now harmful. > --- > infrastructure/bin/update-plist | 8 -------- > infrastructure/lib/OpenBSD/FS2.pm | 14 -------------- > 2 files changed, 22 deletions(-) > > diff --git a/infrastructure/bin/update-plist b/infrastructure/bin/update-plist > index 721f5d3f75b..fc78f402a08 100755 > --- a/infrastructure/bin/update-plist > +++ b/infrastructure/bin/update-plist > @@ -946,14 +946,6 @@ sub check_specific > $h->{should}{'update-mime-database'} = 1; > } > > -package OpenBSD::PackingElement::GhcConf; > -our @ISA=qw(OpenBSD::PackingElement::File); > -sub check_specific > -{ > - my ($self, $h) = @_; > - $h->{should}{'ghc-pkg-recache'} = 1; > -} > - > package OpenBSD::PackingElement::Sampledir; > > # this is not really smart, but good enough for starters > diff --git a/infrastructure/lib/OpenBSD/FS2.pm > b/infrastructure/lib/OpenBSD/FS2.pm > index dfaede67ff5..fda94dadec0 100644 > --- a/infrastructure/lib/OpenBSD/FS2.pm > +++ b/infrastructure/lib/OpenBSD/FS2.pm > @@ -67,7 +67,6 @@ sub classes > OpenBSD::FS::File::Glib2Schema > OpenBSD::FS::File::PkgConfig > OpenBSD::FS::File::MimeInfo > - OpenBSD::FS::File::GhcConf > OpenBSD::FS::File::Icon > OpenBSD::FS::File::IconTheme > OpenBSD::FS::File::Subinfo OpenBSD::FS::File::Info > @@ -234,19 +233,6 @@ sub element_class > 'OpenBSD::PackingElement::MimeInfo'; > } > > -package OpenBSD::FS::File::GhcConf; > -our @ISA = qw(OpenBSD::FS::File); > -sub recognize > -{ > - my ($class, $filename, $fs) = @_; > - return $filename =~ m,lib/ghc/package\.conf\.d/.*\.conf$,; > -} > - > -sub element_class > -{ > - 'OpenBSD::PackingElement::GhcConf'; > -} > - > package OpenBSD::FS::File::IconThemeDirectory; > our @ISA = qw(OpenBSD::FS::File::Directory); > > -- > 2.30.1 > > >From 971c018c5101c08fa3a4092a2d37ff5e6d4c118a Mon Sep 17 00:00:00 2001 > From: Greg Steuck <g...@lenny.nest.cx> > Date: Wed, 3 Mar 2021 21:43:19 -0800 > Subject: [PATCH 3/3] Remove obsolete ghc-specific quirks > > ghc 8.2.2 is such a distant past only CVS can remember it. > --- > devel/quirks/files/Quirks.pm | 9 --------- > devel/quirks/files/Quirks/ghc.pm | 33 -------------------------------- > 2 files changed, 42 deletions(-) > delete mode 100644 devel/quirks/files/Quirks/ghc.pm > > diff --git a/devel/quirks/files/Quirks.pm b/devel/quirks/files/Quirks.pm > index ca7d18ff742..f655a93983f 100644 > --- a/devel/quirks/files/Quirks.pm > +++ b/devel/quirks/files/Quirks.pm > @@ -2344,15 +2344,6 @@ sub is_base_system > my $pkgname = $handle->pkgname; > my $stem = OpenBSD::PackageName::splitstem($pkgname); > > - if ($stem eq 'ghc') { > - require OpenBSD::PkgSpec; > - my $spec = OpenBSD::PkgSpec->new('ghc-<8.2.2p5'); > - if ($spec->match_ref([$pkgname])) { > - require OpenBSD::Quirks::ghc; > - OpenBSD::Quirks::ghc::unfuck($handle, $state); > - } > - } > - > my $test = $base_exceptions->{$stem}; > if (defined $test) { > require File::Glob; > diff --git a/devel/quirks/files/Quirks/ghc.pm > b/devel/quirks/files/Quirks/ghc.pm > deleted file mode 100644 > index 1da8a6e8e93..00000000000 > --- a/devel/quirks/files/Quirks/ghc.pm > +++ /dev/null > @@ -1,33 +0,0 @@ > -package OpenBSD::PackingElement; > -sub ghc_alter > -{ > -} > - > -package OpenBSD::PackingElement::Unexec; > -sub ghc_alter > -{ > - my ($self, $rchanged) = @_; > - $$rchanged = 1; > - bless $self, "OpenBSD::PackingElement::Comment"; > - > -} > - > -package OpenBSD::Quirks::ghc; > - > -sub unfuck > -{ > - my ($handle, $state) = @_; > - my $pkgname = $handle->pkgname; > - my $plist = OpenBSD::PackingList->from_installation($pkgname); > - my $changed = 0; > - $plist->ghc_alter(\$changed); > - if ($changed) { > - OpenBSD::PackingElement::File->add($plist, > - 'lib/ghc/package.conf.d/Cabal-2.0.1.0.conf'); > - OpenBSD::PackingElement::File->add($plist, > - 'lib/ghc/package.conf.d/array-0.5.2.0.conf'); > - $plist->to_installation; > - } > -} > - > -1; > -- > 2.30.1 >