<commit_before>﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>USE_DOTNET</title>
</head>
<body><a href="https://github.com/ArsenShnurkov/gentoo-mono-handbook"><img alt="Fork me on GitHub" id="forkme" src="images/forkme.png" align="right" width="100" /></a>

<table><tr><td valign="top">
<h1>USE_DOTNET</h1>
</td><td valign="top">
<a href="index.htm">Gentoo Mono Handbook</a>
<br />
&nbsp;
</td></tr></table>

Ebuild can declare which version it understands:
USE_DOTNET="net40"
<a href="https://github.com/gentoo/dotnet/blob/master/dev-dotnet/fake/fake-3.23.0.ebuild#L7">https://github.com/gentoo/dotnet/blob/master/dev-dotnet/fake/fake-3.23.0.ebuild#L7</a>
here are the sample vaules:
<a href="https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L40">https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L40</a>
<br />
<br />
The platforms, specified in USE_DOTNET are checked against IUSE variable (should be added to this variable if dotnet inherited):
<a href="https://github.com/gentoo/dotnet/blob/7b316f212e670192162257791d231c7a050ed489/eclass/dotnet.eclass#L32-L40">https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L28-L36</a>
<br />
<br />
FRAMEWORK variable is set in pkg_setup, so it should be available in src_prepare
<a href="https://devmanual.gentoo.org/ebuild-writing/functions/">https://devmanual.gentoo.org/ebuild-writing/functions/</a>
this allow to apply patches based on FRAMEWORK variable value
<br />
<br />
DOTNET_TARGETS variable?

<pre>
 * ERROR: app-editors/mypad-1.0.3_p201606130::shnurise failed (setup phase):
 *   USE Flag 'net45' not in IUSE for app-editors/mypad-1.0.3_p201606130
 </pre>
MSBUILD: error MSBUILD0004: Too many project files specified

</body>
</html><commit_msg>improve the description of USE_DOTNET and DOTNET_TARGETS, see https://github.com/gentoo/dotnet/issues/192<commit_after>﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>USE_DOTNET</title>
</head>
<body><a href="https://github.com/ArsenShnurkov/gentoo-mono-handbook"><img alt="Fork me on GitHub" id="forkme" src="images/forkme.png" align="right" width="100" /></a>

<table><tr><td valign="top">
<h1>USE_DOTNET and USE_MSBUILD</h1>
</td><td valign="top">
<a href="index.htm">Gentoo Mono Handbook</a>
<br />
&nbsp;
</td></tr></table>

<h2>USE_DOTNET</h2>
Actually, USE_DOTNET name is a bit confusing.
<br />
The better name should be "THIS_EBUILD_SUPPORT_AND_IS_INSTALLED_FOR_USE_WITH_THE_FOLLOWING_DOTNET_RUNTIMES"
<br />
<br />
Ebuild can declare which version it understands:
USE_DOTNET="net40 net20"
<br />
<a href="https://github.com/gentoo/dotnet/blob/17bedb24b457189974cfada68814c0313c66e5bd/dev-dotnet/fake/fake-3.23.0.ebuild#L6">https://github.com/gentoo/dotnet/blob/master/dev-dotnet/fake/fake-3.23.0.ebuild#L6</a>
<br />
here are the sample values:
<a href="https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L40">https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L40</a>
<br />
<br />
USE_DOTNET is concatenated to IUSE variable with "inherit dotnet" line
<br />
that's why it is not necessary to mention net45 in IUSE for the second time.
<br />
<br />
The implementation is here:
<br />
<a href="https://github.com/gentoo/dotnet/blob/7b316f212e670192162257791d231c7a050ed489/eclass/dotnet.eclass#L32-L40">https://github.com/gentoo/dotnet/blob/master/eclass/dotnet.eclass#L28-L36</a>
<br />
<br />
DOTNET_TARGETS variable (specified in /etc/portage/make.conf) just adds a "+" sign before some IUSE-flags.

<h2>DOTNET_TARGETS</h2>
<a href="https://github.com/gentoo/dotnet/blob/master/readme.md">https://github.com/gentoo/dotnet/blob/master/readme.md</a>
<br />
instructs the user to specify necessary platforms in /etc/portage/make.conf
<br />
«add the following USE flags if relevant.
<br />
add DOTNET_TARGETS="net45 net40" to make.conf»
<br />
<br />
<strong><em>The great mystery is why it was not possible to 
<br />
just use conventional USE-flags in /etc/portage/make.conf and IUSE in the text of ebuilds.</em></strong>

<h2>USE_EXPAND variables</h2>
Gentoo have a mechanism for creating additional kinds of USE-flags.
<br />
see <a href="https://devmanual.gentoo.org/general-concepts/use-flags/index.html#use_expand-and-arch-use-flags">USE_EXPAND and ARCH USE Flags</a>
<br />
<br />
The USE_EXPAND list is set in profiles/base/make.defaults
<br />
(or USE_EXPAND can be modified in /etc/portage/make.conf)
<br />
<br />
Each variable, mentioned in USE_EXPAND is displayed separately during USE-flags processing.
<br />
(example is needed here)

<!-- this is commented out, because it's not true as of 2020-10-26
<br />
<br />
If the user has DOTNET_TARGETS="net40 net20" in make.conf, for example,
<br />
then USE="dotnet_net40 dotnet_net20" will automatically be set by Portage. 
-->


<h2>USE_MSBUILD</h2>
There are at least 2 build systems - msbuild and xbuild.
<br />
They have their own USE-flags "msbuild" and "xbuild".
<br />
But msbuild have a slotted install, that's why one more variable (USE_MSBUILD) was added and used.
<br />
Some msbuild tasks can be used with each of build systems.

<br />
<br />

<br />
<br />
FRAMEWORK variable is set in pkg_setup, so it should be available in src_prepare
<a href="https://devmanual.gentoo.org/ebuild-writing/functions/">https://devmanual.gentoo.org/ebuild-writing/functions/</a>
this allow to apply patches based on FRAMEWORK variable value
<br />
<br />
DOTNET_TARGETS variable?

<pre>
 * ERROR: app-editors/mypad-1.0.3_p201606130::shnurise failed (setup phase):
 *   USE Flag 'net45' not in IUSE for app-editors/mypad-1.0.3_p201606130
 </pre>
MSBUILD: error MSBUILD0004: Too many project files specified

</body>
</html>
{'fraction_non_alphanumeric': 0.15407537248028044, 'fraction_numerical': 0.04294478527607362, 'mean_word_length': 4.846311475409836, 'pattern_counts': {'":': 0, '<': 136, '<?xml version=': 0, '>': 136, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5781851', 'n_tokens_mistral': 2281, 'n_tokens_neox': 2118, 'n_words': 505}