From nobody Tue Jan 9 12:13:07 2024 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 4T8VFH6yvGz57J9w; Tue, 9 Jan 2024 12:13:07 +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 4T8VFH4qW0z4npM; Tue, 9 Jan 2024 12:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704802387; 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=30WemPUJDbi3z4MBGv0gYbxVFevYrCr8h8b/gTwGC5g=; b=eR9RjpoMUTYamE9X/p5SYk23GQc33xMuxLh3GRbBu+oDzC50/0LI4EcfnRvKuG+0X1hHSx L5Phbl+ELZHI6491Vs7zMD1HOrzEVfeFKIwPbHoA5U8npJH+UVkrJ0cicWcabExbsDji0x /zFcWE73REOapkl1DKsgiEZudLjHgyx02kJocTLHAlGir1ESawIA8cFdFV+pm1GBlmlMYy PDtaOBcQoMOsL7nPy41oDzjbHDh8LQ4zezdfZThnwR4OD7R7PmhLBMwGo3PtgxBPJ1CDSw vE5WPJxGQL1+iq4Qonlxe5ACOKgjRPQC1xyz486mzYh+bvPJSjq6qBr1gOq36g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704802387; 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=30WemPUJDbi3z4MBGv0gYbxVFevYrCr8h8b/gTwGC5g=; b=rJpFVvhIMgsjxP+lzBKHCSkjVDCSYbocHagBcquwTr8IuI/Lai4u9TLSqtfMb930UObyW1 NcRD47QCIA5IZu9upgilwkbZ5+bZF3L1KAJMVIEoro/RMui7EQ0AVmT8QhMBkMPdat/XLx PptA1IbGr6Kjuu9YunPppLkHkudYRT/J91lElUcVPU4JaDveY1o5PkPj9N1ercp5F0YzLm HQEP3xvT7YSNEKf9iCts50D0YFs24HhLACzY4lskYDehId6T+j55GU0aiGQB1orgvlltfd E1Zx1gkhpTiwZkqFkl75auBj2fo6rjrqdKxXmrnlw/4mJjrFVQ8byGddNs8L2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704802387; a=rsa-sha256; cv=none; b=WuQsHof0thwcaYrmod7i9cSdHqvl8VmGVvpNs3CYm54qnVWZUFoR8IH1hPo1FAU5xIseG7 jdZYH617Fn7nplDFsi1fz5A051qYI47ZDlQPaTebbemeH5cYYwbSmIx2QlCTxK1mHfJnB7 IVS0IcOue0jABuOJ9Msfbp2WrXhX6pQBvnRvVd4CcXyyFgWmFaFXMWGUciI9Cw6VUyGrKs 5Zf2OL+AVUQATsFfqb/wsNdXMIzqam5LIFGufjR+m0gdsDQmNLmjVTDYB8fbu3k2NmejGD i5iVKHxMNREQsQgyT9mSRYZNIM1+KHACQZGWxomeo8MM0rCbbe3rILtTIFd2rg== 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 4T8VFH3ts8zqlB; Tue, 9 Jan 2024 12:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409CD7ll007524; Tue, 9 Jan 2024 12:13:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409CD7Nm007521; Tue, 9 Jan 2024 12:13:07 GMT (envelope-from git) Date: Tue, 9 Jan 2024 12:13:07 GMT Message-Id: <202401091213.409CD7Nm007521@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Fechner Subject: git: 606b37bbf06d - main - Mk/Uses: make it possible to compile gems that need rust to build 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: mfechner X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 606b37bbf06dcdfb54480aae8fb69135c06fb11a Auto-Submitted: auto-generated The branch main has been updated by mfechner: URL: https://cgit.FreeBSD.org/ports/commit/?id=606b37bbf06dcdfb54480aae8fb69135c06fb11a commit 606b37bbf06dcdfb54480aae8fb69135c06fb11a Author: Matthias Fechner AuthorDate: 2024-01-09 12:04:24 +0000 Commit: Matthias Fechner CommitDate: 2024-01-09 12:12:47 +0000 Mk/Uses: make it possible to compile gems that need rust to build This commits defines same variables in a way that they can be overwritten by a port. Refactored the extract target to work together with cargo.mk. The gem.mk file will require more work to be easily usable for gems that required rust. Most of the work is now outsourced to the port. I added comments to parts that needs more love. To test these modification, the following commands can be used: (make sure you adjust the path to match your environment) rm /usr/local/poudriere/ports/gitlab/distfiles/rubygem/gapic-common-*.gem rm /usr/local/poudriere/ports/gitlab/distfiles/rubygem/prome*.gem rm /usr/local/poudriere/ports/gitlab/distfiles/rust/crates/ahash-*crate /usr/local/poudriere/ports/gitlab/distfiles/*.gem cd /usr/local/poudriere/ports/gitlab/devel/rubygem-prometheus-client-mmap make makesum cd /usr/local/poudriere/ports/gitlab/devel/rubygem-gapic-common make makesum poudriere testport -p gitlab -j 132amd64 devel/rubygem-gapic-common && poudriere testport -p gitlab -j 132amd64 devel/rubygem-prometheus-client-mmap --- Mk/Uses/gem.mk | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Mk/Uses/gem.mk b/Mk/Uses/gem.mk index a1e77273932a..8c4539a274ca 100644 --- a/Mk/Uses/gem.mk +++ b/Mk/Uses/gem.mk @@ -24,8 +24,8 @@ IGNORE= Incorrect 'USES+= gem:${gem_ARGS}' usage: argument [${arg}] is not recog PKGNAMEPREFIX?= rubygem- EXTRACT_SUFX= .gem -EXTRACT_ONLY= -DIST_SUBDIR= rubygem +# disabled to be able that extract other archives into the gem folder like cargo archives which are required to compile gems that require rust +#EXTRACT_ONLY?= BUILD_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems EXTRACT_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems @@ -67,10 +67,20 @@ PLIST_SUB+= PORTVERSION="${PORTVERSION}" \ RUBYGEMBIN= ${LOCALBASE}/bin/gem +. if defined(GEMS_SKIP_SUBDIR) +# do not define a DIST_SUBDIR, currently required to have cargo archives available in the gem source directory to be able to compile it +#DIST_SUBDIR= +. else +DIST_SUBDIR= rubygem +. endif + . if defined(DISTFILES) -GEMFILES= ${DISTFILES:C/:[^:]+$//} +# this should maybe be reworked, as if a gem port is used together with cargo archives, the DISTFILES also includes the cargo archives +# this is currently overwritten in the port that requires this +# the cargo archives should be filtered out here or better we should only have here gem archives included +GEMFILES?= ${DISTFILES:C/:[^:]+$//} . else -GEMFILES= ${DISTNAME}${EXTRACT_SUFX} +GEMFILES?= ${DISTNAME}${EXTRACT_SUFX} . endif RUBYGEM_ARGS=-l --no-update-sources --install-dir ${STAGEDIR}${PREFIX}/lib/ruby/gems/${RUBY_VER} --ignore-dependencies --bindir=${STAGEDIR}${PREFIX}/bin @@ -81,8 +91,8 @@ RUBYGEM_ARGS+= --document rdoc,ri RUBYGEM_ARGS+= --no-document . endif -. if !target(do-extract) -do-extract: +_USES_extract+= 590:gem-extract +gem-extract: @${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} @(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \ if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \ @@ -91,7 +101,6 @@ do-extract: fi; \ ${FALSE}; \ fi) -. endif . if !target(do-build) do-build: