Direkt zum Hauptinhalt

Client (alle Plattformen) - Anleitung zum selber kompilieren

Unter Windows

Für die Kompilierung des FabAccess Clients Borepin benötigen wir verschiedene Komponenten:

Installation von Mono GTKSharp

Mono wird nicht mehr weiterentwickelt. Wir nutzen das letzte Release 2.12.45 vom 14.11.2022

Installation von Cap'n Proto

Variante 1

Downloads: https://capnproto.org

Nach dem Entpacken muss das Verzeichnis mit den Executables per in Umgebungsvariable %PATH% eingebunden werden, zum Beispiel C:\Program Files (x86)\capnproto-c++-win32-1.1.0\capnproto-tools-win32-1.1.0:

grafik.png

Variante 2

Installation mit Chocolatey

choco install capnproto

Installation von Microsoft Visual Studio 2022 Community Edition

Das Setup wurde zuletzt mit Version 17.12.3 getestet.

  • Download des Installers (ältere Versionen benötigen eine aktive Subscription - das ist nicht empfehlenswert)
  • Folgende Pakete werden außerdem benötigt. Die folgende Konfigurationsdatei .vsconfig kann im Setup VisualStudioSetup.exe geladen werden:
{
  "version": "1.0",
  "components": [
    "Microsoft.VisualStudio.Component.CoreEditor",
    "Microsoft.VisualStudio.Workload.CoreEditor",
    "Microsoft.Net.Component.4.8.SDK",
    "Microsoft.Net.Component.4.7.2.TargetingPack",
    "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
    "Microsoft.VisualStudio.Component.TypeScript.TSServer",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
    "Microsoft.VisualStudio.Component.JavaScript.TypeScript",
    "Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
    "Microsoft.VisualStudio.Component.Roslyn.Compiler",
    "Microsoft.Component.MSBuild",
    "Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
    "Microsoft.VisualStudio.Component.TextTemplating",
    "Microsoft.VisualStudio.Component.NuGet",
    "Microsoft.VisualStudio.Component.SQL.CLR",
    "Microsoft.Component.ClickOnce",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Core",
    "Microsoft.NetCore.Component.Runtime.9.0",
    "Microsoft.NetCore.Component.Runtime.8.0",
    "Microsoft.NetCore.Component.SDK",
    "Microsoft.VisualStudio.Component.FSharp",
    "Microsoft.ComponentGroup.ClickOnce.Publish",
    "Microsoft.NetCore.Component.DevelopmentTools",
    "Microsoft.VisualStudio.Component.AppInsights.Tools",
    "Microsoft.Net.Component.4.8.TargetingPack",
    "Microsoft.Net.ComponentGroup.4.8.DeveloperTools",
    "Microsoft.VisualStudio.Component.DiagnosticTools",
    "Microsoft.VisualStudio.Component.EntityFramework",
    "Microsoft.VisualStudio.Component.Debugger.JustInTime",
    "Component.Microsoft.VisualStudio.LiveShare.2022",
    "Microsoft.VisualStudio.Component.IntelliCode",
    "Component.VisualStudio.GitHub.Copilot",
    "Microsoft.NetCore.Component.Runtime.6.0",
    "microsoft.net.runtime.mono.tooling",
    "microsoft.net.runtime.mono.tooling.net8",
    "Microsoft.VisualStudio.Component.Windows11SDK.22621",
    "maui.core",
    "maui.blazor",
    "microsoft.net.runtime.android.net8",
    "microsoft.net.runtime.android.aot.net8",
    "microsoft.net.runtime.android",
    "microsoft.net.runtime.android.aot",
    "android",
    "Component.OpenJDK",
    "Microsoft.VisualStudio.Component.MonoDebugger",
    "Microsoft.VisualStudio.Component.Merq",
    "Microsoft.VisualStudio.ComponentGroup.Maui.Android",
    "runtimes.ios",
    "microsoft.net.runtime.ios",
    "runtimes.ios.net8",
    "microsoft.net.runtime.ios.net8",
    "ios",
    "Component.Xamarin.RemotedSimulator",
    "Microsoft.VisualStudio.ComponentGroup.Maui.iOS",
    "runtimes.maccatalyst",
    "microsoft.net.runtime.maccatalyst",
    "runtimes.maccatalyst.net8",
    "microsoft.net.runtime.maccatalyst.net8",
    "maccatalyst",
    "Microsoft.VisualStudio.ComponentGroup.Maui.MacCatalyst",
    "maui.windows",
    "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
    "Microsoft.VisualStudio.ComponentGroup.Maui.Windows",
    "Microsoft.VisualStudio.ComponentGroup.Maui.Blazor",
    "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine",
    "Microsoft.VisualStudio.ComponentGroup.Maui.Shared",
    "Microsoft.VisualStudio.ComponentGroup.Maui.All",
    "Component.Android.SDK.MAUI",
    "Component.Xamarin",
    "Microsoft.VisualStudio.Workload.NetCrossPlat",
    "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
    "Microsoft.VisualStudio.Component.DotNetModelBuilder",
    "Microsoft.VisualStudio.ComponentGroup.WindowsAppSDK.Cs",
    "Microsoft.ComponentGroup.Blend",
    "Microsoft.VisualStudio.Workload.ManagedDesktop",
    "Microsoft.VisualStudio.Component.Windows10SDK.19041",
    "Microsoft.Component.NetFX.Native",
    "Microsoft.VisualStudio.Component.Graphics",
    "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin",
    "Microsoft.VisualStudio.ComponentGroup.UWP.Support",
    "Microsoft.VisualStudio.Component.WindowsAppSdkSupport.CSharp",
    "Microsoft.VisualStudio.ComponentGroup.WindowsAppDevelopment.Prerequisites",
    "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard",
    "Microsoft.VisualStudio.Workload.Universal",
    "Microsoft.NetCore.Component.Runtime.3.1",
    "Microsoft.NetCore.Component.Runtime.7.0"
  ],
  "extensions": []
}

grafik.png

Achtung: Die installierte Visual Studio Umgebung ist ca. 25-35 Gigabyte groß und die Installation dauert u.U. über eine Stunde!

Borepin Projekt mit Git klonen

An einem geeigneten Ort das Projekt auschecken. Wir arbeiten derzeit mit einem aktualisierten Fork: https://gitlab.com/thejonny/borepin.git

git clone --recurse-submodules https://gitlab.com/thejonny/borepin.git
git checkout main

Projekt kompilieren

Wir öffnen die Datei Borepin.sln im Hauptordner des Projektes. Beim ersten Start von Visual Studio werden u.U. verschiedene Dependencies nachgeladen. Das kann ein Weilchen dauern.

grafik.png

Bei etwaigen Kompilierproblemen wird ein Systemneustart empfohlen, falls die obigen Abhängigkeiten erstmalig installiert wurden.

Linux GTK

  • Auf Linux benötigen wir das große Paket für Mono. Mono ist eine alternative, quelloffene Implementierung von Microsofts .NET Framework. Sie ermöglicht die Entwicklung von plattformunabhängiger Software auf den Standards der Common Language Infrastructure und der Programmiersprache C#.
  • Ubuntu 24
  • Auf Ubuntu gehen wir wie folgt vor:
# Mono Repository hinzufügen
sudo apt install ca-certificates gnupg
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

# Mono und weitere Pakete installieren
sudo apt install mono-complete gtk-sharp2 libcanberra-gtk-module nuget capnproto git
nuget update -self
  • Projekt klonen
cd ~/
git clone https://gitlab.com/fabinfra/fabaccess/client.git --recurse-submodules
cd client/
  • In dem Repo herumstochern und Projekt kompilieren
cd ~/client/

#Entfernen, was wir nicht brauchen
rm -rf ~/client/Borepin/Borepin.Android/
rm -rf ~/client/Borepin/Borepin.UWP/
rm -rf ~/client/Borepin/Borepin.iOS/
rm -rf ~/client/Borepin/Borepin.macOS/
rm -rf ~/client/Borepin_Test/
rm -rf ~/client/FabAccessAPI_Test/

#diese Einträge entfernen wir außerdem in:
vim Borepin.sln

nuget restore

cd packages/
nuget install NLog
nuget install dryioc.dll -Version 4.7.7
#in den folgenden 3 Dateien tauschen wir die Version für DryIoc von 5.3.1 zu 4.7.7
vim ~/client/Borepin/Borepin.GTK/app.config
vim ~/client/Borepin/Borepin.GTK/Borepin.GTK.csproj
vim ~/client/Borepin/Borepin.GTK/packages.config
msbuild /restore
msbuild -t:Borepin_GTK

cp ~/client/packages/NLog.5.3.4/lib/net45/NLog.* ~/client/Borepin/Borepin.GTK/bin/Debug/
  • Borepin starten
  • Das konnte aktuell nicht erfolgreich durchgeführt werden
mono ~/client/Borepin/Borepin.GTK/bin/Debug/Borepin.GTK.exe
  • der StackTrace:
(Borepin.GTK:4704): Gtk-WARNING **: 01:31:17.439: Im Modulpfad »adwaita« konnte keine Themen-Engine gefunden werden,
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.GTK.Platform.GetRenderer (Xamarin.Forms.VisualElement element) [0x00000] in <db5c3415edd24a4aa8ae86f8bebc9a57>:0 
  at Xamarin.Forms.Platform.GTK.FormsWindow.OnConfigureEvent (Gdk.EventConfigure evnt) [0x00033] in <db5c3415edd24a4aa8ae86f8bebc9a57>:0 
  at Gtk.Widget.configureevent_cb (System.IntPtr widget, System.IntPtr evnt) [0x00014] in <7aab76e87bce48a4b45cf7fa613cb70c>:0 
  at GLib.ExceptionManager.RaiseUnhandledException (System.Exception e, System.Boolean is_terminal) [0x00000] in <ed39f21b9e9343dcbd442a17ad356a9f>:0 
  at Gtk.Widget.configureevent_cb (System.IntPtr widget, System.IntPtr evnt) [0x00000] in <7aab76e87bce48a4b45cf7fa613cb70c>:0 
  at Gtk.Application.gtk_main () [0x00000] in <7aab76e87bce48a4b45cf7fa613cb70c>:0 
  at Gtk.Application.Run () [0x00000] in <7aab76e87bce48a4b45cf7fa613cb70c>:0 
  at Borepin.GTK.MainClass.Main (System.String[] args) [0x00000] in <674198d89d1447e7b051f706516309ae>:0 
  • oder mit Wine
  • Das konnte aktuell nicht erfolgreich durchgeführt werden
sudo apt install wine
sudo apt-get install winetricks
winetricks dotnet45

#Borepin starten
wine ~/client/Borepin/Borepin.GTK/bin/Debug/Borepin.GTK.exe
  • ArchLinux
pacman -S mono mono-msbuild gtk-sharp-2 nuget capnproto
  • ... und so weiter
  • IDEs zum Entwickeln von Borepin
  • macOS / iOS
    1. Install Visual Studio for Mac

    2. Install capnproto If you install capnp with Homebrew you may have to symlink the capnp binary into ‘/usr/local/bin’, or bring it into your PATH another way.

    3. Clone Borepin

      $ git clone https://gitlab.com/fabinfra/fabaccess/client.git --recurse-submodules
      
    4. Open in Visual Studio

    5. Build