From nobody Sun Mar 12 16:11:16 2023 X-Original-To: dev-commits-ports-main@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 4PZPsw6g2xz3xJFZ; Sun, 12 Mar 2023 16:11:16 +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 4PZPsw5mKsz3r0l; Sun, 12 Mar 2023 16:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678637476; 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=CuJ/sAabeg3qaoLlMIemRryP67gBycuZeRLO3oKxCqU=; b=GsAF/eTOS6yAJ4+wVSvIHPW+6gumRHyaqhKkxh2thKY82K5O28VfBhQhiqgzVvPzCL0HGq FPZLBV5nuQuZ8ljMSi6aZaUt+onx9zJoRNOLVYJpaqFoeX2WzGlQE7RgdzCAN29jW5AmOT nVX45ycIZCwYVAvapM6IqKeEB5rBipDph1+pErq5f4vyWwj43ogHnSU7NC2sOe+3nNIey2 xmd2MCdWlxeGBAG5KXvlHiwWhghW/5FMi8yyTQuZtFW4YvEnpi2ml7wpHIDiQYAq2s2fXN /JNprxfdXZqPnVUxDn+fczatNjSd9GU9FGJmySBGDqA2UICihJa/rmAeca4yNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678637476; 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=CuJ/sAabeg3qaoLlMIemRryP67gBycuZeRLO3oKxCqU=; b=oOwapdZi4X8/sZMMCfcDKb7S0ZD5gdrnyMx3q7AduFLZ0LyELYTjsTyB70PR+J3o+zUeit oZhRskm6bkMGfwwUHhhUmqloDDIozrs1doNmirFS5kUslEm+6xjzdR3jJ6X+kdTjTYStnu tP/UYmlvYzGCPU1jDL3A2LSSHkhfyixE4EMfVkuIkPjOmglHcL6T7nCnKokxdu0KQl5toU oeqLQFuM9Noz4a72W2erlzGBU42shVrgnIBNXtdqF4wPkSf6Rogakp8W+GGUihqeyUehEY OkShUCSK6cJz1IQddG7GfkZ5Bk7w/ZJS1HUqu0h55KgTB6SeJuo+eBOtrESqQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678637476; a=rsa-sha256; cv=none; b=vaU48/fmXPlAqWe6y1Hofd9pmrcMzibo4kSIyEIjvjtyQYMEHnlxicnfvwzhLyW9JpApze f0yIuAekgdazkoi8khmXGkVXPi/VfA3nDjEYAIl05W5GdT64WzxrqYg1Hu0BKMvdQ2XdDB dL0EL3ajv+7h2ZGyWBNZX6CEdVTUSmbMw8RZrmrlivn3F5ktfMd3rtgzzkSSRW3y/W7MsR diRjVp2TMc24QR1YdTt8Uw/I/EQjaKC+LyANdeJ4WQ2jhVRuvy6FDLp8KzZNk6aQSJXPqS LdVYSwRhtTAtVxG8DLKuij1v/RDYpeGTvjDxCgbTORe3d6wdZWVSMmpeixvT3w== 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 4PZPsw4s99zHnR; Sun, 12 Mar 2023 16:11:16 +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 32CGBGFu005208; Sun, 12 Mar 2023 16:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32CGBGLE005207; Sun, 12 Mar 2023 16:11:16 GMT (envelope-from git) Date: Sun, 12 Mar 2023 16:11:16 GMT Message-Id: <202303121611.32CGBGLE005207@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: c622cccddb53 - main - Mk/Uses: Introduce HACKAGE_DISTNAME knob. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: c622cccddb5324ace97f4342e1e907ff8f66f9ad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=c622cccddb5324ace97f4342e1e907ff8f66f9ad commit c622cccddb5324ace97f4342e1e907ff8f66f9ad Author: Gleb Popov AuthorDate: 2023-03-12 13:48:24 +0000 Commit: Gleb Popov CommitDate: 2023-03-12 16:10:33 +0000 Mk/Uses: Introduce HACKAGE_DISTNAME knob. --- Mk/Uses/cabal.mk | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index 0221eb36a78a..29046ef8ecda 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -31,6 +31,10 @@ # out possible values for this variable. # default: ${PORTNAME} # +# HACKAGE_DISTNAME Use this knob if PORTNAME or PORTVERSION doesn't match +# with package name and version on Hackage. +# default: ${PORTNAME}-${PORTVERSION} +# # opt_USE_CABAL Variant of USE_CABAL to be used with options framework. # opt_CABAL_FLAGS Variant of CABAL_FLAGS to be used with options framework. # Note that it works a bit differently from CABAL_FLAGS: @@ -124,13 +128,20 @@ _hackage_is_default= yes _hackage_is_default= no . endif -MASTER_SITES+= https://hackage.haskell.org/package/${_hackage_group} \ - http://hackage.haskell.org/package/${_hackage_group} +. if defined(HACKAGE_DISTNAME) && ${_hackage_is_default} == no +IGNORE= HACKAGE_DISTNAME is set, but it makes no sense if the default MASTER_SITES isn't HACKAGE +. endif + +MASTER_SITES+= HACKAGE/${_hackage_group} +. if defined(HACKAGE_DISTNAME) +WRKSRC?= ${WRKDIR}/${HACKAGE_DISTNAME} +. endif +HACKAGE_DISTNAME?= ${PORTNAME}-${PORTVERSION} . if ${_hackage_is_default} == yes -DISTFILES+= ${PORTNAME}-${PORTVERSION}/${PORTNAME}-${PORTVERSION}${CABAL_EXTRACT_SUFX} +DISTFILES+= ${HACKAGE_DISTNAME}/${HACKAGE_DISTNAME}${CABAL_EXTRACT_SUFX} . ifdef CABAL_REVISION -DISTFILES+= ${PORTNAME}-${PORTVERSION}/revision/${CABAL_REVISION}.cabal +DISTFILES+= ${HACKAGE_DISTNAME}/revision/${CABAL_REVISION}.cabal . endif . else _hackage_group= :cabal_mk_hackage @@ -194,7 +205,7 @@ cabal-extract: check-cabal ${SETENV} ${CABAL_HOME_ENV} ${CABAL_CMD} update . if ${_hackage_is_default} == yes cd ${WRKDIR} && \ - ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} get ${PORTNAME}-${PORTVERSION} + ${SETENV} ${MAKE_ENV} ${CABAL_HOME_ENV} ${CABAL_CMD} get ${HACKAGE_DISTNAME} . else . if ${cabal_ARGS:Mhpack} @${ECHO_MSG} "===> Running ${HPACK_CMD} to generate .cabal file" @@ -258,7 +269,7 @@ cabal-post-extract: . endif # Copy revised .cabal file if present . if defined(CABAL_REVISION) && ${_hackage_is_default} == yes - ${CP} ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${PORTVERSION}/revision/${CABAL_REVISION}.cabal `find ${WRKSRC} -name '*.cabal' -depth 1` + ${CP} ${DISTDIR}/${DIST_SUBDIR}/${HACKAGE_DISTNAME}/revision/${CABAL_REVISION}.cabal `find ${WRKSRC} -name '*.cabal' -depth 1` . endif # Move extracted dependencies into ${CABAL_DEPSDIR} directory