public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Maciej Barć" <xgqt@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: dotnet@gentoo.org, "Maciej Barć" <xgqt@gentoo.org>
Subject: [gentoo-dev] [PATCH 5/7] eclass/dotnet-pkg.eclass: add dotnet-pkg_force-compat
Date: Sat,  3 Feb 2024 17:24:16 +0100	[thread overview]
Message-ID: <20240203162422.91906-5-xgqt@gentoo.org> (raw)
In-Reply-To: <20240203162422.91906-1-xgqt@gentoo.org>

Signed-off-by: Maciej Barć <xgqt@gentoo.org>
---
 eclass/dotnet-pkg.eclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/eclass/dotnet-pkg.eclass b/eclass/dotnet-pkg.eclass
index 94f5c5a28..3647eb399 100644
--- a/eclass/dotnet-pkg.eclass
+++ b/eclass/dotnet-pkg.eclass
@@ -156,6 +156,29 @@ DOTNET_PKG_BUILD_EXTRA_ARGS=()
 # For more info see the "DOTNET_PROJECT" variable and "dotnet-pkg_src_test".
 DOTNET_PKG_TEST_EXTRA_ARGS=()
 
+# @FUNCTION: dotnet-pkg_force-compat
+# @DESCRIPTION:
+# This function appends special options to all "DOTNET_PKG_*_EXTRA_ARGS"
+# variables in an attempt to force compatibility to the picked
+# "DOTNET_PKG_COMPAT" .NET SDK version.
+#
+# Call this function post-inherit.
+dotnet-pkg_force-compat() {
+	if [[ -z "${DOTNET_PKG_COMPAT}" ]] ; then
+		die "DOTNET_PKG_COMPAT is not set"
+	fi
+
+	local -a force_extra_args=(
+		-p:RollForward=Major
+		-p:TargetFramework="net${DOTNET_PKG_COMPAT}"
+		-p:TargetFrameworks="net${DOTNET_PKG_COMPAT}"
+	)
+
+	DOTNET_PKG_RESTORE_EXTRA_ARGS+=( "${force_extra_args[@]}" )
+	DOTNET_PKG_BUILD_EXTRA_ARGS+=( "${force_extra_args[@]}" )
+	DOTNET_PKG_TEST_EXTRA_ARGS+=( "${force_extra_args[@]}" )
+}
+
 # @FUNCTION: dotnet-pkg_pkg_setup
 # @DESCRIPTION:
 # Default "pkg_setup" for the "dotnet-pkg" eclass.
-- 
2.43.0



  parent reply	other threads:[~2024-02-03 16:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 16:24 [gentoo-dev] [PATCH 1/7] eclass/dotnet-pkg-base.eclass: quotes and style tweaks for edge cases Maciej Barć
2024-02-03 16:24 ` [gentoo-dev] [PATCH 2/7] eclass/dotnet-pkg-base.eclass: deprecate wring-style names Maciej Barć
2024-02-03 16:53   ` Ulrich Mueller
2024-02-03 17:09     ` Maciej Barć
2024-02-03 16:24 ` [gentoo-dev] [PATCH 3/7] eclass/dotnet-pkg-base.eclass: dotnet-pkg-base_test - remove directory magic Maciej Barć
2024-02-03 16:24 ` [gentoo-dev] [PATCH 4/7] eclass/dotnet-pkg*: add dotnet-pkg_remove-bad Maciej Barć
2024-02-03 16:24 ` Maciej Barć [this message]
2024-02-03 16:55   ` [gentoo-dev] [PATCH 5/7] eclass/dotnet-pkg.eclass: add dotnet-pkg_force-compat Ulrich Mueller
2024-02-03 16:24 ` [gentoo-dev] [PATCH 6/7] eclass/dotnet-pkg-base.eclass: set DOTNET_ROOT Maciej Barć
2024-02-03 16:24 ` [gentoo-dev] [PATCH 7/7] eclass/dotnet-pkg.eclass: prepare for safely using Nuget Maciej Barć
2024-02-03 16:57   ` Ulrich Mueller
2024-02-03 17:07     ` Maciej Barć
2024-02-03 16:51 ` [gentoo-dev] [PATCH 1/7] eclass/dotnet-pkg-base.eclass: quotes and style tweaks for edge cases Ulrich Mueller
2024-02-08  7:02 ` Sam James
2024-02-08  8:36   ` Maciej Barć

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240203162422.91906-5-xgqt@gentoo.org \
    --to=xgqt@gentoo.org \
    --cc=dotnet@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox