Why isn't C# .NET MAUI supported?

Can anybody help shed some light on why publishing cross-platform .NET is not supported?

I can publish an apk in a GitHub yaml file using Ubuntu with actions/setup-dotnet@v4, or from ubuntu/dotnet-runtime:latest, or Debian with these instructions: Install .NET on Debian - .NET | Microsoft Learn

I’m new here, but if the F-Droid image doesn’t have .NET, then can’t it be added like this?

wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0

See Also:

You’ve read Inclusion Policy | F-Droid - Free and Open Source Android App Repository see “Though we tried to build everything from source, we still need some prebuild binaries. Therefore we have some exceptions:…” ?

Some random Microsoft repo is not on that exception list…

What distro builds and packages it from FOSS code only?

Also related build Xamarin apps on buildserver (#1529) · Issues · F-Droid / Data · GitLab

Okay so you need to install .NET without using a package manager, so like this then? Install .NET on Linux without using a package manager - .NET | Microsoft Learn

DOTNET_FILE=dotnet-sdk-8.0.100-linux-x64.tar.gz
export DOTNET_ROOT=$(pwd)/.dotnet
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

build…we need it built in a FOSS way from FOSS code…

1 Like

.NET can be built from the source files by following these instructions:

git clone https://github.com/dotnet/dotnet dotnet-dotnet
cd dotnet-dotnet
./prep.sh
./build.sh --clean-while-building --online
mkdir -p $HOME/dotnet
tar zxf artifacts/[your-arch]/Release/dotnet-sdk-9.0.100-[your-RID].tar.gz -C $HOME/dotnet
ln -s $HOME/dotnet/dotnet /usr/bin/dotnet

.NET is not something like golang that you can bootstrap with GCC in few minutes. It’s impossible to bootstrap it from source. We can’t simply rebuild it on our buildserver. Fortunately Ubuntu packages it, though I guess it’s not bootstraped from source. That’s good enough. Then the problem is that we don’t use Ubuntu. Someone needs to figure out how to use the package on our buildserver.

so it’s not FOSS lol

1 Like

Debian doesn’t bootstrap everything from source, either. :person_shrugging: Only Guix does that. :slight_smile:

2 Likes

Then the problem is that we don’t use Ubuntu. Someone needs to figure out how to use the package on our buildserver.

Someone already has, but it looks like you’ve commented on that already.

Here’s an updated version of @nmatveev’s solution.

FROM debian:bookworm-slim
LABEL Name=dotnet-sdk-from-ubuntu-universe Version=0.0.2

# TODO: Update to .NET 8.0 when the next Ubuntu LTS is released (jammy = 22.04)
# See also: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#supported-distributions
ARG UBUNTU_VERSION="jammy"
ARG DOTNET_SDK_VERSION="6.0"

RUN <<EOF
    set -e
    apt-get -y update && apt-get install -y gnupg
    echo "deb https://archive.ubuntu.com/ubuntu ${UBUNTU_VERSION} main universe" >> /etc/apt/sources.list
    gpg --no-default-keyring --keyring "/etc/apt/trusted.gpg.d/dotnet-sdk.gpg" --keyserver "hkp://keyserver.ubuntu.com" --recv-keys "871920D1991BC93C"
    apt-get -y update && apt-get install -y dotnet-sdk-${DOTNET_SDK_VERSION}
    apt clean
EOF

CMD ["sh", "-c", "dotnet --version"]

Oh, it does!