From owner-svn-ports-all@freebsd.org Tue Nov 19 21:08:11 2019 Return-Path: Delivered-To: svn-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 805AF1BE036; Tue, 19 Nov 2019 21:08:11 +0000 (UTC) (envelope-from tobik@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47HdhW2qgZz3wbR; Tue, 19 Nov 2019 21:08:11 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FF69184FA; Tue, 19 Nov 2019 21:08:11 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAJL8Bqk090731; Tue, 19 Nov 2019 21:08:11 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAJL8B1d090730; Tue, 19 Nov 2019 21:08:11 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201911192108.xAJL8B1d090730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Tue, 19 Nov 2019 21:08:11 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r517982 - head/Mk/Uses X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: head/Mk/Uses X-SVN-Commit-Revision: 517982 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Nov 2019 21:08:11 -0000 Author: tobik Date: Tue Nov 19 21:08:10 2019 New Revision: 517982 URL: https://svnweb.freebsd.org/changeset/ports/517982 Log: Mk/Uses/cargo.mk: Add CARGO_GIT_SUBDIR hook to provide hints for CARGO_USE_GIT* This is a workaround to add some manual "support" for Cargo projects that use workspaces where the current method of patching is not good enough as it causes the various Cargo.toml to point to the wrong directory. With CARGO_GIT_SUBDIR maintainers can control the patching process a little and point things to the correct subdirectories. CARGO_GIT_SUBDIR= :: This is needed for alacritty 0.4.0-rc2 where the glutin sources are under ${WRKSRC_glutin}/glutin and not just ${WRKSRC_glutin}. This causes the following issue: error: failed to load source for a dependency on `glutin` Caused by: Unable to update .../x11/alacritty/work/glutin-7e479d Caused by: found a virtual manifest at `.../x11/alacritty/work/glutin-7e479d/Cargo.toml` instead of a package manifest For glutin we would set CARGO_GIT_SUBDIR=glutin:glutin:glutin to work around this problem and point the build to .../x11/alacritty/work/glutin-7e479d/glutin instead. Modified: head/Mk/Uses/cargo.mk Modified: head/Mk/Uses/cargo.mk ============================================================================== --- head/Mk/Uses/cargo.mk Tue Nov 19 20:58:02 2019 (r517981) +++ head/Mk/Uses/cargo.mk Tue Nov 19 21:08:10 2019 (r517982) @@ -212,14 +212,28 @@ cargo-extract: _CARGO_GIT_PATCH_CARGOTOML= .if ${CARGO_USE_GITHUB:tl} == "yes" . for _group in ${GH_TUPLE:C@^[^:]*:[^:]*:[^:]*:(([^:/]*)?)((/.*)?)@\2@} +. if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ - -e 's@git = "(https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?"@path = "${WRKSRC_${_group}}"@' + -e "s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@" +. else +. for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} +_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ + -e "/^${_crate} =/ s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@" +. endfor +. endif . endfor .endif .if ${CARGO_USE_GITLAB:tl} == "yes" . for _group in ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\8@:S/^://} +. if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ - -e 's@git = "${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?"@path = "${WRKSRC_${_group}}"@' + -e "s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@" +. else +. for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} +_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ + -e "/^${_crate} = / s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@" +. endfor +. endif . endfor .endif