DOTNET-PKG-BASE.ECLASS

Section: eclass-manpages (5)
Updated: May 2024
Index Return to Main Contents

NAME

dotnet-pkg-base.eclass - common functions and variables for builds using .NET SDK

DESCRIPTION

This eclass is designed to provide required ebuild definitions for .NET packages. Beware that in addition to Gentoo-specific concepts also terms that should be known to people familiar with the .NET ecosystem are used through this one and similar eclasses.

In ebuilds for software that only utilizes the .NET SDK, without special cases, the "dotnet-pkg.eclass" is probably better suited.

This eclass does not export any phase functions, for that see the "dotnet-pkg" eclass.

SUPPORTED EAPIS

8

TRANSITIVELY PROVIDED ECLASSES

nuget

FUNCTIONS

dotnet-pkg-base_get-configuration
Return .NET configuration type of the current package.

It is advised to refer to the "DOTNET_PKG_CONFIGURATION" variable instead of calling this function if necessary.

Used by "dotnet-pkg-base_setup".

dotnet-pkg-base_get-output <name>
Return a specially constructed name of a directory for output of "dotnet build" artifacts ("--output" flag, see "dotnet-pkg-base_build").

It is very rare that a maintainer would use this function in an ebuild.

This function is used inside "dotnet-pkg-base_setup".

dotnet-pkg-base_get-runtime
Return the .NET runtime used for the current package.

Used by "dotnet-pkg-base_setup".

dotnet-pkg-base_setup
Sets up "DOTNET_PKG_EXECUTABLE" variable for later use in "edotnet". Also sets up "DOTNET_PKG_CONFIGURATION" and "DOTNET_PKG_OUTPUT" for "dotnet-pkg_src_configure" and "dotnet-pkg_src_compile".

This functions should be called by "pkg_setup".

Used by "dotnet-pkg_pkg_setup" from the "dotnet-pkg" eclass.

dotnet-pkg-base_remove-global-json [directory]
Remove the "global.json" if it exists. The file in question might lock target package to a specified .NET version, which might be unnecessary (as it is in most cases).

Optional "directory" argument defaults to the current directory path.

Used by "dotnet-pkg_src_prepare" from the "dotnet-pkg" eclass.

edotnet <command> [args...]
Call dotnet, passing the supplied arguments.
dotnet-pkg-base_info
Show information about current .NET SDK that is being used.

Depends upon the "gentoo-dotnet-info" program installed by the "dev-dotnet/csharp-gentoodotnetinfo" package.

Used by "dotnet-pkg_src_configure" from the "dotnet-pkg" eclass.

dotnet-pkg-base_sln-remove <solution> <project>
Remove a project from a given solution file.

Used by "dotnet-pkg_remove-bad" from the "dotnet-pkg" eclass.

dotnet-pkg-base_foreach-solution <directory> <args> ...
Execute a function for each solution file (.sln) in a specified directory. This function may yield no real results because solutions are discovered automatically.

Used by "dotnet-pkg_src_configure" and "dotnet-pkg_src_test" from the "dotnet-pkg" eclass.

dotnet-pkg-base_restore [args] ...
Restore the package using "dotnet restore". Restore is performed in current directory unless a different directory is passed via "args".

Additionally any number of "args" maybe be given, they are appended to the "dotnet" command invocation.

Used by "dotnet-pkg_src_configure" from the "dotnet-pkg" eclass.

dotnet-pkg-base_restore-tools [config-file] [args] ...
Restore dotnet tools for a project in the current directory.

Optional "config-file" argument is used to specify a file for the "--configfile" option which records what tools should be restored.

Additionally any number of "args" maybe be given, they are appended to the "dotnet" command invocation.

dotnet-pkg-base_restore_tools [config-file] [args] ...
DEPRECATED, use "dotnet-pkg-base_restore-tools" instead.
dotnet-pkg-base_build [args] ...
Build the package using "dotnet build" in a specified directory. Build is performed in current directory unless a different directory is passed via "args".

Any number of "args" maybe be given, they are appended to the "dotnet" command invocation.

Used by "dotnet-pkg_src_compile" from the "dotnet-pkg" eclass.

dotnet-pkg-base_test [args] ...
Test the package using "dotnet test" in a specified directory. Test is performed in current directory unless a different directory is passed via "args".

Any number of "args" maybe be given, they are appended to the "dotnet" command invocation.

Used by "dotnet-pkg_src_test" from the "dotnet-pkg" eclass.

dotnet-pkg-base_install [directory]
Install the contents of "DOTNET_PKG_OUTPUT" into a directory, defaults to "/usr/share/${P}".

Installation directory is relative to "ED".

dotnet-pkg-base_launcherinto <directory>
Changes the path .NET launchers are installed into via subsequent "dotnet-pkg-base_dolauncher" calls.

For more info see the "_DOTNET_PKG_LAUNCHERDEST" variable.

dotnet-pkg-base_append-launchervar <variable-setting>
Appends a given variable setting to the "_DOTNET_PKG_LAUNCHERVARS".

WARNING: This functions modifies a global variable permanently! This means that all launchers created in subsequent "dotnet-pkg-base_dolauncher" calls of a given package will have the given variable set.

Example:

dotnet-pkg-base_append_launchervar "DOTNET_EnableAlternateStackCheck=1"

For more info see the "_DOTNET_PKG_LAUNCHERVARS" variable.

dotnet-pkg-base_append_launchervar <variable-setting>
DEPRECATED, use "dotnet-pkg-base_append-launchervar" instead.
dotnet-pkg-base_dolauncher <executable-path> [filename]
Make a wrapper script to launch an executable built from a .NET package.

If no file name is given, the `basename` of the executable is used.

Parameters: ${1} - path of the executable to launch, ${2} - filename of launcher to create (optional).

Example:

dotnet-pkg-base_install
dotnet-pkg-base_dolauncher /usr/share/${P}/${PN^}

The path is prepended by "EPREFIX".

dotnet-pkg-base_dolauncher-portable <dll-path> <filename>
Make a wrapper script to launch a .NET DLL file built from a .NET package.

Parameters: ${1} - path of the DLL to launch, ${2} - filename of launcher to create.

Example:

dotnet-pkg-base_dolauncher-portable \
    /usr/share/${P}/GentooDotnetInfo.dll gentoo-dotnet-info

The path is prepended by "EPREFIX".

dotnet-pkg-base_dolauncher_portable <dll-path> <filename>
DEPRECATED, use "dotnet-pkg-base_dolauncher-portable" instead.

ECLASS VARIABLES

DOTNET_PKG_COMPAT (REQUIRED) (SET BEFORE INHERIT)
Allows to choose a slot for dotnet.

Most .NET packages will lock onto one supported .NET major version. DOTNET_PKG_COMPAT should specify which version was chosen by package upstream. In case multiple .NET versions are specified in the project, then the highest should be picked by the maintainer.

DOTNET_PKG_RDEPS = "" (GENERATED BY ECLASS)
Populated with important dependencies on .NET ecosystem packages for running .NET packages.

"DOTNET_PKG_RDEPS" should appear (or conditionally appear) in "RDEPEND".

DOTNET_PKG_BDEPS = "" (GENERATED BY ECLASS)
Populated with important dependencies on .NET ecosystem packages for building .NET packages.

"DOTNET_PKG_BDEPS" should appear (or conditionally appear) in "BDEPEND".

DOTNET_PKG_RUNTIME (GENERATED BY ECLASS)
Sets the runtime used to build a package.

This variable is set automatically by the "dotnet-pkg-base_setup" function.

DOTNET_PKG_EXECUTABLE (GENERATED BY ECLASS)
Sets path of a "dotnet" executable.

This variable is set automatically by the "dotnet-pkg-base_setup" function.

DOTNET_PKG_CONFIGURATION (GENERATED BY ECLASS)
Configuration value passed to "dotnet" in the compile phase. Is either Debug or Release, depending on the "debug" USE flag.

This variable is set automatically by the "dotnet-pkg-base_setup" function.

DOTNET_PKG_OUTPUT (GENERATED BY ECLASS)
Path of the output directory, where the package artifacts are placed during the building of packages with "dotnet-pkg-base_build" function.

This variable is set automatically by the "dotnet-pkg-base_setup" function.

AUTHORS

Anna Figueiredo Gomes <navi@vlhl.dev>
Maciej Barć <xgqt@gentoo.org>

MAINTAINERS

Gentoo Dotnet project <dotnet@gentoo.org>

REPORTING BUGS

Please report bugs via https://bugs.gentoo.org/

FILES

dotnet-pkg-base.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/dotnet-pkg-base.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
TRANSITIVELY PROVIDED ECLASSES
FUNCTIONS
ECLASS VARIABLES
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, May 08, 2024