Hi Omar,

On Sat, Jan 8, 2022 at 11:45 PM Omair Majid <omajid@redhat.com> wrote:
Hi Andrea,

Andrea Musuruane <musuruan@gmail.com> writes:

> I'm trying to package it but I really need some guidance because it's
> a new environment for me and I haven't found any resource for
> packaging .NET6 applications in the Fedora Wiki.

Unfortunately, Fedora don't have any guidance at this point. Not many
(any?) .NET packages exist in Fedora. I think if we manage to package
Pinta, we should take the lessons learned and use that to start drafting
the guidance/docs for other packagers.

Do you intend to package it as a copr project or are you looking to get
this into Fedora proper?

Pinta (currently v1.7.1, based on mono) is already in Fedora proper. My aim is to update it to Pinta 2 in Fedora proper for F36+.
 
> The first problem I have is that network access is required.

Ugh, this is a tough one. I am not sure how to work around this. If the
project needs network access to build, I am not sure how we can get it
to build offline.

The standard approach that other language ecosystems take is to package
all the dependencies (recursively) into Fedora until we can build the
package. That might be easy if there is just one dependency for Pinta,
or it may be extremely difficult if it depends (recursively) on 100
other packages.

These are the dependencies pinta shows in Help->About->Version Info (in bold the ones I think should be packaged):

Title,Version,Path
AtkSharp,3.24.24.34,/usr/lib64/pinta/AtkSharp.dll
CairoSharp,3.24.24.34,/usr/lib64/pinta/CairoSharp.dll
Clipper,6.4.2.0,/usr/lib64/pinta/Clipper.dll
GdkSharp,3.24.24.34,/usr/lib64/pinta/GdkSharp.dll
GioSharp,3.24.24.34,/usr/lib64/pinta/GioSharp.dll
GLibSharp,3.24.24.34,/usr/lib64/pinta/GLibSharp.dll
GtkSharp,3.24.24.34,/usr/lib64/pinta/GtkSharp.dll

netstandard,2.1.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/netstandard.dll
NGettext,0.6.1.0,/usr/lib64/pinta/NGettext.dll
PangoSharp,3.24.24.34,/usr/lib64/pinta/PangoSharp.dll
Pinta,2.0.1.0,/usr/lib64/pinta/Pinta.dll
Pinta.Core,2.0.1.0,/usr/lib64/pinta/Pinta.Core.dll
Pinta.Docking,2.0.1.0,/usr/lib64/pinta/Pinta.Docking.dll
Pinta.Effects,2.0.1.0,/usr/lib64/pinta/Pinta.Effects.dll
Pinta.Gui.Widgets,2.0.1.0,/usr/lib64/pinta/Pinta.Gui.Widgets.dll
Pinta.Resources,2.0.1.0,/usr/lib64/pinta/Pinta.Resources.dll
Pinta.Tools,2.0.1.0,/usr/lib64/pinta/Pinta.Tools.dll
System.Collections,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Collections.dll
System.Collections.Specialized,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Collections.Specialized.dll
System.ComponentModel,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.ComponentModel.dll
System.Console,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Console.dll
System.Diagnostics.DiagnosticSource,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Diagnostics.DiagnosticSource.dll
System.Diagnostics.Tracing,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Diagnostics.Tracing.dll
System.Linq,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Linq.dll
System.Memory,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Memory.dll
System.Net.Http,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Net.Http.dll
System.Net.Primitives,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Net.Primitives.dll
System.Net.Security,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Net.Security.dll
System.ObjectModel,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.ObjectModel.dll
System.Private.CoreLib,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Private.CoreLib.dll
System.Private.Uri,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Private.Uri.dll
System.Private.Xml,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Private.Xml.dll
System.Private.Xml.Linq,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Private.Xml.Linq.dll
System.Runtime,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Runtime.dll
System.Runtime.InteropServices,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Runtime.InteropServices.dll
System.Runtime.InteropServices.RuntimeInformation,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Runtime.InteropServices.RuntimeInformation.dll
System.Security.Cryptography.X509Certificates,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Security.Cryptography.X509Certificates.dll
System.Text.Encoding.Extensions,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Text.Encoding.Extensions.dll
System.Text.RegularExpressions,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Text.RegularExpressions.dll
System.Threading,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Threading.dll
System.Threading.Thread,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Threading.Thread.dll
System.Xml.XDocument,6.0.0.0,/usr/lib64/dotnet/shared/Microsoft.NETCore.App/6.0.0/System.Xml.XDocument.dll
 
> Otherwise I'll get the following error:
>
> /usr/lib64/dotnet/sdk/6.0.100/NuGet.targets(130,5): error : Unable to load the service index for source
> https://api.nuget.org/v3/index.json. [/builddir/build/BUILD/pinta-2.0/Pinta.sln]

If the issue is just that it can not ping api.nuget.org (because that's
the NuGet server location listed in a nuget.config file somewhere), what
happens if you remove all references to that? Or maybe remove that
and other network locations using a `<clear />`?

I'm not sure I follow you here.

I cannot find any nuget.config file or any file that has an occurrence of nuget in it :-/
 
> AFAIK the Fedora builders don't have internet access.

Yes, that's true. It's also a hard requirement for builds for "official"
(non-copr) Fedora projects.

> But even if I enable it, I will later get this error:
> MSBUILD : error MSB1009: Project file does not exist.

The command that's executed just before the error is:

/usr/bin/dotnet msbuild installer/linux/install.proj -target:Install -p:SourceDir=/root/rpmbuild/BUILD/pinta-2.0 -p:Pu
blishDir=/root/rpmbuild/BUILD/pinta-2.0/publish -p:InstallPrefix=/root/rpmbuild/BUILDROOT/pinta-2.0-1.fc35.x86_64/usr
-p:InstallBinDir=/root/rpmbuild/BUILDROOT/pinta-2.0-1.fc35.x86_64/usr/bin -p:InstallLibDir=/root/rpmbuild/BUILDROOT/pi
nta-2.0-1.fc35.x86_64/usr/lib64 -p:InstallDataRootDir=/root/rpmbuild/BUILDROOT/pinta-2.0-1.fc35.x86_64/usr/share -p:In
stallManDir=/root/rpmbuild/BUILDROOT/pinta-2.0-1.fc35.x86_64/usr/share/man -p:InstallLocaleDir=/root/rpmbuild/BUILDROO
T/pinta-2.0-1.fc35.x86_64/usr/share/local

The file installer/linux/install.proj is not included in the source tarball.
Looks like that's a bug that was just fixed in the 2.0.1 release
https://github.com/PintaProject/Pinta/releases/tag/2.0.1:

"Fixed a missing file (installer/linux/install.proj) from the release
tarball that caused the install build step to fail "

I noticed that too. Now I can build pinta (if internet access is enabled):
https://copr.fedorainfracloud.org/coprs/musuruan/pinta/build/3135987/

It seems that dotnet6 is not available in all Fedora supported architectures though.

Is there a way to identify these platforms?

In mono I used to have this in the SPEC file:
ExclusiveArch: %mono_arches

My updated SPEC file is:
https://copr-dist-git.fedorainfracloud.org/cgit/musuruan/pinta/pinta.git/tree/pinta.spec

I also had to add:
Requires:	dotnet-runtime-6.0
 
I am not sure that's the right way to handle the generic icons included
in this application, though. I haven't gone through the icon packaging
guidelines in ages.

I have no idea about that. Specs are not really clear:
https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

I have a new issue. I'm not sure if this is an upstream issue. Even though pinta is localised in different languages, only English is shown.

Thank you for your support.

BR,

Andrea