Authentication-Results: name.execsw.org; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=UYeQ1kp1; dkim=pass (1024-bit key) header.d=netbsd.org header.i=@netbsd.org header.b=uSqA2odE Received: by mail.netbsd.org (Postfix, from userid 605) id 31E0684D6C; Sun, 28 Apr 2024 08:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1714293227; bh=kRHz9uA/Lqtyye1xdnvN3kHu7sS8ddIJlvVJ0yGOwNw=; h=Date:From:Subject:To:Reply-To:List-Id:List-Unsubscribe; b=UYeQ1kp1ACksC+maeRVD8Jq1vbsz+GmXe+wEX0ktf9TBSNp9s6IB6bV/ikBBOIVGq OeBcJ73tRwFofHozeMsI5MBLEPWJh68JsRzYI7sSPFZDLPdB6H8Jxhy7LB2bQ/QTZC GMYc5udloVW8pAFCYAm66jRHx3MyMjuFQdEchtG8= Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 24B3084D08 for ; Sun, 28 Apr 2024 08:33:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id mi1BCU7t6FS2 for ; Sun, 28 Apr 2024 08:33:45 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 1987C84CFE for ; Sun, 28 Apr 2024 08:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netbsd.org; s=20240131; t=1714293225; bh=kRHz9uA/Lqtyye1xdnvN3kHu7sS8ddIJlvVJ0yGOwNw=; h=Date:From:Subject:To:Reply-To; b=uSqA2odEMDl1ygtvtPQmyHRdrUGSxnNrWYq6m/4wgOy8XtcCwNK5+RfW/AWV42qaq lbpMHa1I3a+6CItxV9ZbSFDYibJu8wEYS7kjspz61o28pcy3EaDZq9+phDpT89K4cZ elHA/tfpIlObX+d2vK5RGxZPFP8bh8KC6i7z05Zo= Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0D40AFA2C; Sun, 28 Apr 2024 08:33:45 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1714293225159010" MIME-Version: 1.0 Date: Sun, 28 Apr 2024 08:33:45 +0000 From: "Masatake Daimon" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: pho@netbsd.org X-Mailer: log_accum Message-Id: <20240428083345.0D40AFA2C@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1714293225159010 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: pho Date: Sun Apr 28 08:33:44 UTC 2024 Modified Files: pkgsrc/mk: haskell.mk Log Message: mk/haskell.mk: Small optimization Make use of MAKEVARS to avoid invoking external commands repeatedly. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 pkgsrc/mk/haskell.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1714293225159010 Content-Disposition: inline Content-Length: 2710 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/haskell.mk diff -u pkgsrc/mk/haskell.mk:1.58 pkgsrc/mk/haskell.mk:1.59 --- pkgsrc/mk/haskell.mk:1.58 Wed Nov 1 17:55:08 2023 +++ pkgsrc/mk/haskell.mk Sun Apr 28 08:33:44 2024 @@ -1,4 +1,4 @@ -# $NetBSD: haskell.mk,v 1.58 2023/11/01 17:55:08 pho Exp $ +# $NetBSD: haskell.mk,v 1.59 2024/04/28 08:33:44 pho Exp $ # # This Makefile fragment handles Haskell Cabal packages. Package # configuration, building, installation, registration and unregistration @@ -108,12 +108,12 @@ _DEF_VARS.haskell= \ INSTALL_TEMPLATES \ DEINSTALL_TEMPLATES \ UNLIMIT_RESOURCES \ - _HASKELL_VERSION_CMD \ _HASKELL_BIN \ _HASKELL_PKG_BIN \ _HASKELL_PKG_DESCR_FILE_OR_DIR \ _HASKELL_PKG_ID_FILE \ - _HASKELL_VERSION + _HASKELL_VERSION \ + _HS_ORIG_LD_CMD _USE_VARS.haskell= \ DISTNAME \ PKG_VERBOSE \ @@ -158,11 +158,14 @@ HASKELL_UNRESTRICT_DEPENDENCIES?= # empt .include "../../mk/haskell/tools/happy.mk" # Tools -_HASKELL_BIN= ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc -_HASKELL_PKG_BIN= ${BUILDLINK_PREFIX.ghc:U${PREFIX}}/bin/ghc-pkg +_HASKELL_BIN= ${BUILDLINK_PREFIX.ghc:U${LOCALBASE}}/bin/ghc +_HASKELL_PKG_BIN= ${BUILDLINK_PREFIX.ghc:U${LOCALBASE}}/bin/ghc-pkg -_HASKELL_VERSION_CMD= ${_HASKELL_BIN} -V 2>/dev/null | ${CUT} -d ' ' -f 8 -_HASKELL_VERSION= ghc-${_HASKELL_VERSION_CMD:sh} +.if !defined(_HASKELL_VERSION) +_HASKELL_VERSION_CMD= ${_HASKELL_BIN:Q} --numeric-version +_HASKELL_VERSION:= ghc-${_HASKELL_VERSION_CMD:sh} +.endif +MAKEVARS+= _HASKELL_VERSION # By default GHC uses a per-user default environment file if one is # available. Cabal has to be visible in order to compile Setup.?hs, @@ -260,7 +263,7 @@ CONFIGURE_ARGS+= ${LDFLAGS:S/^/--ghc-opt # wrapper is going to inject the relro flags. In this case these flags # don't make sense so ld(1) emits warnings. Use the original, # non-wrapped ld(1) for merging objects as a dirty workaround. -_HS_ORIG_LD_CMD= ${SETENV} PATH=${_PATH_ORIG} which ld +_HS_ORIG_LD_CMD= ${SETENV} PATH=${_PATH_ORIG} which ${LD} CONFIGURE_ARGS+= --ghc-options=-pgmlm\ ${_HS_ORIG_LD_CMD:sh} CONFIGURE_ARGS+= --ghc-options=-optlm\ -r @@ -302,8 +305,11 @@ _HS_PLIST_STATUS= ok # executable-only there's no such file. As a workaround we read the # description of "base" (which always exists) and extract the platform # from it. +.if !defined(_HS_PLIST.platform) _HS_PLIST.platform.cmd= ${_HASKELL_PKG_BIN} --simple-output field base data-dir -_HS_PLIST.platform= ${_HS_PLIST.platform.cmd:sh:H:T} +_HS_PLIST.platform:= ${_HS_PLIST.platform.cmd:sh:H:T} +.endif +MAKEVARS+= _HS_PLIST.platform # Abbreviated compiler version. Used for shared libraries. _HS_PLIST.short-ver= ${_HASKELL_VERSION:S,-,,} --_----------=_1714293225159010--