From owner-dev-commits-ports-all@freebsd.org Tue Jul 13 13:39:49 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB7F565DCD3; Tue, 13 Jul 2021 13:39:48 +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 4GPMFJ50RYz4snQ; Tue, 13 Jul 2021 13:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 86AE823705; Tue, 13 Jul 2021 13:39:48 +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 16DDdmi4063944; Tue, 13 Jul 2021 13:39:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16DDdmmR063943; Tue, 13 Jul 2021 13:39:48 GMT (envelope-from git) Date: Tue, 13 Jul 2021 13:39:48 GMT Message-Id: <202107131339.16DDdmmR063943@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 41a3548060aa - main - Mk/Uses: Add angr.mk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41a3548060aa366986f36945c5a3303e4daa0009 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2021 13:39:49 -0000 The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/ports/commit/?id=41a3548060aa366986f36945c5a3303e4daa0009 commit 41a3548060aa366986f36945c5a3303e4daa0009 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-07-13 13:24:01 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-07-13 13:39:43 +0000 Mk/Uses: Add angr.mk angr.mk will be used to simplify the ports related to security/py-angr. --- Mk/Uses/angr.mk | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Mk/Uses/angr.mk b/Mk/Uses/angr.mk new file mode 100644 index 000000000000..7d2489854e6c --- /dev/null +++ b/Mk/Uses/angr.mk @@ -0,0 +1,65 @@ +# Shared namespace for angr-related ports. +# +# Feature: angr +# Usage: USES=angr[:ARGS] +# Valid ARGS: binaries, nose +# +# binaries The port requires the special angr binaries to be present for +# testing. +# nose The port is using nosetests for the test target. +# +# Variables, which can be set by the port: +# +# ANGR_VERSION - The version of the angr project programs. +# ANGR_BINARIES_TAGNAME - The tagname of the angr binaries. +# ANGR_NOSETESTS - The path to the nosetests program. +# +# Other information: +# - USES=angr:nose implies USES=python:test unless USES=python has already +# been specified yet. +# +# MAINTAINER: ports@FreeBSD.org + +.if !defined(_INCLUDE_USES_ANGR_MK) +_INCLUDE_USES_ANGR_MK= yes + +# Arguments validation. +_valid_ARGS= binaries nose +.for _arg in ${angr_ARGS} +. if !${_valid_ARGS:M${_arg}} +IGNORE= USES=angr: invalid argument: ${_arg} +. endif +.endfor + +# Set the default angr version for all angr-related ports. +ANGR_VERSION?= 9.0.5405 +ANGR_BINARIES_TAGNAME?= v${ANGR_VERSION} + +.if "${angr_ARGS:Mbinaries}" != "" +USE_GITHUB?= yes +GH_TUPLE+= angr:binaries:${ANGR_BINARIES_TAGNAME}:binaries + +# Provide the binaries directory where it is expected by the test scripts. +pre-test: angr-provide-test-binaries +angr-provide-test-binaries: + @${LN} -Fs ${WRKSRC_binaries} ${WRKDIR}/binaries +.endif # "${angr_ARGS:Mbinaries}" != "" + +.if "${angr_ARGS:Mnose}" != "" +# Ensure that python.mk variables are available. +. if !${USES:Mpython*} +python_ARGS= test +_USES_POST+= python:test +.include "${USESDIR}/python.mk" +. endif # !${USES:Mpython*} + +TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}nose>0:devel/py-nose@${PY_FLAVOR} +TEST_WRKSRC?= ${WRKSRC}/tests + +ANGR_NOSETESTS?= nosetests-${PYTHON_VER} + +do-test: + @(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${ANGR_NOSETESTS}) +.endif # "${angr_ARGS:Mnose}" != "" + +.endif