From nobody Sun Nov 20 17:39:52 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NFd7r2332z4hk39; Sun, 20 Nov 2022 17:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NFd7r1YG3z4M6H; Sun, 20 Nov 2022 17:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668965992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P4bj20dZ7YY1+xcmq1A7zriNqr869eAF4EfwB/DteV0=; b=OuWQpzrPH5aCLrcgzClrBB12a7pgxsIU95lESyqpSeWKoRCrrSmi9FQxQRfsZPj4xRtW3/ FBGHijvYCz8vB/wUJtKrrbsbP3l+aSVe4gN40FJILMpgbWfQQ4j3VMKJ4tQtTS2eeSf+6l 1zolOJJXgSHmE1vUSxYJT3zQQJWNqYA964w+GXw7nyDjMzRloR9JJgzTP9YnnNDstSeUYU cjdsruNmot5eBeiaoCwRCRaGaBCOEpNCnqFb+1C4aqXPIt9NpFjF7ti9wLWSXJ1k0/MFrq E7LMviRxSAfG/VXNkjjof9A/bitLIcWgmCOGAzaWp9OqHuCF4qogdL02/rTOBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668965992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P4bj20dZ7YY1+xcmq1A7zriNqr869eAF4EfwB/DteV0=; b=cUgG/nL3Eun9NoWvIZ+BiDIBbKDCQBtZed6NYy0/gjk57SKh8YejZBBTuTaRASa1Kl4Xe4 PHiphERslyK6ar7uo7kWDtrMgj8CXBR/3dCOZQ63QZ3gqKuQMlT1VcP2MHMGZTVMIyrAqt S9t4cAdYzdDUcmof5De2Ty7HCOvY8KgtU/AIKbnJDu+EwktyRTRxY7UGMwCiWAE+JQHCc9 HLkgFq+/MtBe3Pwm+wQYbnOsB/fqj35T48xULfkHs2deliVVLaIF1aS5cSYaKfB7tUsBz5 TZ+isxeia+AqipQsas5jLnDd7QW6PQVBz064ZdFX2aV8PvvP7t+VmnOkHZRRiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668965992; a=rsa-sha256; cv=none; b=A4K+igewAO+EnrCl3meZjJ4UeHCq3ObWCacUgan0AB6OI6J1pgt7UvWlFm5wKNVvJUbJm6 pp6a4cBH8gz6P3dFah+l/qUk10GbqzRaVqP6oOKUG8/ph+qCkKmeqvaZvyY5ONJSvWr2si qqYBZgYDfkf536WYJT7+TjO/itRnz83CiPApSazLWDXhC/k4EAWjZcFvmO5iGuMzTjL+QJ pVezikceh7INzlpxsAYjlX4Vxp0+4xLKQiJLYpHRUaz28h7xV1cnP8fs52cJlnm9ar5AnA 8E380mAWYxNcnayfnzElOG3mp7GuoJGViOEME9C8xME9JBBKvjerr7sr5pRuWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NFd7r0dtHzY2B; Sun, 20 Nov 2022 17:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AKHdq5I053794; Sun, 20 Nov 2022 17:39:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AKHdqjc053793; Sun, 20 Nov 2022 17:39:52 GMT (envelope-from git) Date: Sun, 20 Nov 2022 17:39:52 GMT Message-Id: <202211201739.2AKHdqjc053793@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: e254bdde429a - main - Uses/cabal.mk: Change the way we act on cabal.project files. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e254bdde429a3d700beb9d421dc35f1da0b2077a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=e254bdde429a3d700beb9d421dc35f1da0b2077a commit e254bdde429a3d700beb9d421dc35f1da0b2077a Author: Gleb Popov AuthorDate: 2022-11-11 09:08:48 +0000 Commit: Gleb Popov CommitDate: 2022-11-20 17:39:27 +0000 Uses/cabal.mk: Change the way we act on cabal.project files. Instead of moving the original project file into a temporary location, employ cabal.project.local for Ports-related adjustments. This implements an idea that upstream cabal.project files shouldn't be touched by Ports framework. If needed they can be patched by the port maintainer directly. Adapt existing Haskell ports to this change. --- Mk/Uses/cabal.mk | 26 ++++++++-------------- devel/elm-format/Makefile | 3 +-- .../patch-cabal.project.haskell-language-server | 4 ++-- net-p2p/cardano-db-sync/Makefile | 6 ++--- net-p2p/cardano-node/Makefile | 6 ++--- net-p2p/ogmios/Makefile | 6 ++--- 6 files changed, 21 insertions(+), 30 deletions(-) diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index 02464c39acf7..ac2ca56fef53 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -218,17 +218,14 @@ check-cabal2tuple: cabal-post-extract: . if !defined(SKIP_CABAL_EXTRACT) -# Remove the project file as requested . if "${CABAL_PROJECT}" == "remove" +# Remove the project file if requested ${RM} ${WRKSRC}/cabal.project . endif -# Save the original project file so that users can patch them -. if "${CABAL_PROJECT}" == "append" - ${MV} ${WRKSRC}/cabal.project ${WRKSRC}/cabal.project.${PORTNAME} -. endif - +. ifndef(CABAL_PROJECT) @${TEST} ! -f ${WRKSRC}/cabal.project || \ (${ECHO_CMD} "cabal.project file is already present in WRKSRC! Set CABAL_PROJECT variable." && false) +. endif # Move extracted dependencies into ${CABAL_DEPSDIR} directory ${MKDIR} ${CABAL_DEPSDIR} @@ -250,18 +247,13 @@ cabal-post-patch: . if !defined(SKIP_CABAL_EXTRACT) @${TEST} ! -f ${CABAL_COOKIE} || \ (${ECHO_CMD} "===> Patching done, skipping cabal-post-patch" && false) -# Create our own cabal.project - ${ECHO_CMD} "packages:" > ${WRKSRC}/cabal.project -. if "${CABAL_PROJECT}" != "append" - ${ECHO_CMD} " ." >> ${WRKSRC}/cabal.project -. endif +# Append our stuff to possibly existing cabal.project.local + ${ECHO_CMD} "" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} "-- added by USES=cabal" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} "packages:" >> ${WRKSRC}/cabal.project.local . for package in ${_use_cabal} - ${ECHO_CMD} " ${CABAL_DEPS_SUBDIR}/${package:C/_[0-9]+//}" >> ${WRKSRC}/cabal.project + ${ECHO_CMD} " ${CABAL_DEPS_SUBDIR}/${package:C/_[0-9]+//}" >> ${WRKSRC}/cabal.project.local . endfor -# Append the (possibly patched) original cabal.project, if requested -. if "${CABAL_PROJECT}" == "append" - ${CAT} ${WRKSRC}/cabal.project.${PORTNAME} >> ${WRKSRC}/cabal.project -. endif . endif # SKIP_CABAL_EXTRACT && !CABAL_COOKIE cabal-pre-configure: @@ -273,7 +265,7 @@ cabal-pre-configure: . if !target(do-build) do-build: cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} new-build --offline --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} + ${SETENV} ${MAKE_ENV} HOME=${CABAL_HOME} ${CABAL_CMD} build --offline --disable-benchmarks --disable-tests ${CABAL_WITH_ARGS} --flags "${CABAL_FLAGS}" ${BUILD_ARGS} ${BUILD_TARGET} . endif . if !target(do-install) diff --git a/devel/elm-format/Makefile b/devel/elm-format/Makefile index 430e6b111767..9ab7c3d6a53b 100644 --- a/devel/elm-format/Makefile +++ b/devel/elm-format/Makefile @@ -62,7 +62,6 @@ post-extract: post-patch: @${REINPLACE_CMD} -e '/with-compiler: ghc-8.10.4/d' \ - ${WRKSRC}/cabal.project.${PORTNAME} || ${TRUE} - ${RM} ${WRKSRC}/cabal.config + ${WRKSRC}/cabal.project || ${TRUE} .include diff --git a/devel/hs-haskell-language-server/files/patch-cabal.project.haskell-language-server b/devel/hs-haskell-language-server/files/patch-cabal.project.haskell-language-server index b219ff162b34..ac3bf9580b99 100644 --- a/devel/hs-haskell-language-server/files/patch-cabal.project.haskell-language-server +++ b/devel/hs-haskell-language-server/files/patch-cabal.project.haskell-language-server @@ -1,5 +1,5 @@ ---- cabal.project.haskell-language-server.orig 2022-09-14 06:08:48 UTC -+++ cabal.project.haskell-language-server +--- cabal.project.orig 2022-09-14 06:08:48 UTC ++++ cabal.project @@ -62,20 +62,6 @@ constraints: ghc-lib-parser-ex -auto, stylish-haskell +ghc-lib diff --git a/net-p2p/cardano-db-sync/Makefile b/net-p2p/cardano-db-sync/Makefile index 27c09df523f9..c56d00e06477 100644 --- a/net-p2p/cardano-db-sync/Makefile +++ b/net-p2p/cardano-db-sync/Makefile @@ -409,9 +409,9 @@ post-patch: -e '/Cardano.Db.RevFromGit/d' \ ${WRKSRC}/cardano-db/src/Cardano/Db/Version.hs - ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.${PORTNAME} + ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.local pre-build: cd ${WRKSRC_sodium} && ./autogen.sh diff --git a/net-p2p/cardano-node/Makefile b/net-p2p/cardano-node/Makefile index f6ff9d3c3fc1..8236e90f222a 100644 --- a/net-p2p/cardano-node/Makefile +++ b/net-p2p/cardano-node/Makefile @@ -402,9 +402,9 @@ post-patch: -e '/Cardano.Git.RevFromGit/d' \ ${WRKSRC}/cardano-git-rev/src/Cardano/Git/Rev.hs - ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.${PORTNAME} + ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.local pre-build: cd ${WRKSRC_sodium} && ./autogen.sh diff --git a/net-p2p/ogmios/Makefile b/net-p2p/ogmios/Makefile index a788cadab76e..b08aa498d4f2 100644 --- a/net-p2p/ogmios/Makefile +++ b/net-p2p/ogmios/Makefile @@ -390,9 +390,9 @@ USE_CABAL= Glob-0.10.2_3 \ CABAL_PROJECT= append post-patch: - ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.${PORTNAME} - ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.${PORTNAME} + ${ECHO_CMD} "package *" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-include-dirs: ${LIBS_PREFIX}${PREFIX}/include" >> ${WRKSRC}/cabal.project.local + ${ECHO_CMD} " extra-lib-dirs: ${LIBS_PREFIX}${PREFIX}/lib" >> ${WRKSRC}/cabal.project.local pre-build: cd ${WRKSRC_sodium} && ./autogen.sh