{"id":21698795,"url":"https://github.com/trungnt2910/dotnet-haiku","last_synced_at":"2025-04-12T12:42:00.763Z","repository":{"id":182754842,"uuid":"669039840","full_name":"trungnt2910/dotnet-haiku","owner":"trungnt2910","description":"Home of the unofficial custom `.net8.0-haiku` TFM","archived":false,"fork":false,"pushed_at":"2024-03-07T05:01:15.000Z","size":92,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T07:22:10.632Z","etag":null,"topics":["csharp","dotnet","dotnet-workload","gsoc-2023","haiku","haiku-os"],"latest_commit_sha":null,"homepage":"https://summerofcode.withgoogle.com/programs/2023/projects/oJkCpfnv","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trungnt2910.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-21T07:45:31.000Z","updated_at":"2024-08-22T14:30:41.000Z","dependencies_parsed_at":"2024-01-05T10:28:39.496Z","dependency_job_id":"bc6edbd5-0df3-4941-8c53-9bc97b96a919","html_url":"https://github.com/trungnt2910/dotnet-haiku","commit_stats":null,"previous_names":["trungnt2910/dotnet-haiku"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fdotnet-haiku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fdotnet-haiku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fdotnet-haiku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fdotnet-haiku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trungnt2910","download_url":"https://codeload.github.com/trungnt2910/dotnet-haiku/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248568791,"owners_count":21126100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnet-workload","gsoc-2023","haiku","haiku-os"],"created_at":"2024-11-25T19:36:48.823Z","updated_at":"2025-04-12T12:42:00.743Z","avatar_url":"https://github.com/trungnt2910.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET 8.0 workload for Haiku\n\nAn attempt to create a .NET SDK workload that provides the `net8.0-haiku` TFM.\n\n## Installation\n\nTo install, run the `install-manifest.sh` script:\n\n```sh\nbash -c \"$(curl -fsSL https://raw.githubusercontent.com/trungnt2910/dotnet-haiku/HEAD/install-manifest.sh)\"\n```\n\nThe script requires `dotnet`, `curl`, `jq`, and `unzip` to be installed and be available in `$PATH`.\nIt installs the latest version of the [advertising manifests](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install#advertising-manifests) for the Haiku workload.\n\nAfter that, the `haiku` workload will be available for install like any other workload:\n\n```sh\ndotnet workload install haiku\n```\n\nNote that you have to subscribe to **[@trungnt2910](https://github.com/trungnt2910)**'s GitHub Packages feed.\nIf .NET for Haiku from the [dotnet-builds](https://github.com/trungnt2910/dotnet-builds/tree/master#installation) repository has already been installed, you have already subscribed to this feed.\nOtherwise, run:\n\n```sh\ndotnet nuget add source --username your_github_username --password your_github_token --store-password-in-clear-text --name dotnet_haiku_nuget \"https://nuget.pkg.github.com/trungnt2910/index.json\"\n```\n\n`your_github_token` should be a [personal access token](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-to-github-packages) with at least the `read:packages` permission.\n\n## Building instructions\n\n### Clone this repository\n\nMake sure to do a recursive clone as this repository uses `git` submodules.\n\n```sh\ngit clone --recurse-submodules https://github.com/trungnt2910/dotnet-haiku\n```\n\n### Prerequisites\n\n- A platform that uses a Haiku-compatible Itanium ABI (tested on Linux only).\n- Git, CMake, and Ninja (used to build [CppSharp](https://github.com/mono/CppSharp/blob/main/docs/LLVM.md#compiling-using-the-build-script)). On Ubuntu:\n```sh\nsudo apt install -y git cmake ninja-build\n```\n- A `dotnet` installation.\n- On non-Haiku platforms, a Haiku cross-compilation rootfs:\n```sh\ngit clone --depth=1 https://github.com/dotnet/arcade\nexport ROOTFS_DIR=/path/to/rootfs/dir\narcade/eng/common/cross/build-rootfs.sh x64 haiku\n```\n\n### Build and install workload\n\nFrom the repository root directory:\n\n```sh\ndotnet tool restore\ndotnet cake build.cake --target=InstallWorkload --configuration=Release\n```\n\nThis should install the `haiku` workload to the default .NET SDK installation.\n\nThe first build will take a long time as it builds a portion of the LLVM project.\n\n## Usage\n\nSee the sample projects in the [`sample`](sample) folder for more examples.\n\n### `net8.0-haiku` TFM\n\nTo use the Haiku API bindings, the project must target `net8.0-haiku` (replace `8.0` with a later version when applicable).\nThis is similar to the usage of `net8.0-windows` or any other OS-specific TFMs.\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cOutputType\u003eExe\u003c/OutputType\u003e\n    \u003cTargetFramework\u003enet8.0-haiku\u003c/TargetFramework\u003e\n    \u003cImplicitUsings\u003eenable\u003c/ImplicitUsings\u003e\n    \u003cNullable\u003eenable\u003c/Nullable\u003e\n  \u003c/PropertyGroup\u003e\n\n\u003c/Project\u003e\n```\n\n### Kits and symbols\n\nEach kit is located in a separate namespace prefixed with `Haiku.`.\n\nNon-member constants/variables starting with `B_` or `be_` are located in a class called `Symbols` in their kits' namespaces. The name `Symbols` is not final and is subject to change.\n\nMembers of named `enum`s have the `B_` prefix removed. Their names are also converted to `PascalCase` to match C#'s convention.\n\nFor example, to create a custom [`BWindow`](https://www.haiku-os.org/docs/api/classBWindow.html):\n\n```csharp\nusing Haiku.App;\nusing Haiku.Interface;\nusing static Haiku.App.Symbols;\nusing static Haiku.Interface.Symbols;\n\nnamespace EmptyWindow;\n\npublic class MainWindow: BWindow\n{\n    public MainWindow()\n        : base(new BRect(), \"Main Window\", WindowType.TitledWindow, B_QUIT_ON_WINDOW_CLOSE)\n    {\n        MoveTo(100, 100);\n        ResizeTo(200, 200);\n    }\n\n    public override bool QuitRequested()\n    {\n        be_app.PostMessage(B_QUIT_REQUESTED);\n        return true;\n    }\n}\n```\n\n## Limitations\n\n### Compilation\n\nOnly building on Linux is supported. At the time of writing, the .NET SDK on Haiku has not been stable yet.\n\n### Packaging\n\nOnly `x86_64` is supported. Throughout the various build scripts `x64` and `x86_64` are hard coded. Some other parts of the scripts might also assume `x86_64`.\n\nReference assemblies are currently the same as the `x86_64` version.\n\nIt is still too early to add support for other platforms, since neither .NET on Haiku nor CppSharp is compatibile with anything other than `x86_64`.\n\n### Generation\n\n- Only a few basic kits are generated. Currently, Application, Interface, Kernel, Storage, and Support kits are included.\n- Macros are not generated.\n- Some classes, especially C++ template classes, might be missing.\n- Documentation is not included.\n- The generated API is considered experimental and may change any time as the generators improve.\n\n### Usage\n\nThe usage of this workload is only supported on [custom](https://github.com/trungnt2910/dotnet-builds) .NET builds for Haiku.\n\nAttempting to use this workload on mainstream .NET builds will result in an error:\n\n```\n/home/trung/sdk/.dotnet/sdk/8.0.100-preview.4.23260.5/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'haiku-x64' is not recognized. [/home/trung/DotnetHaiku/sample/EmptyWindow/EmptyWindow.csproj]\n```\n\nThe `haiku-x64` RID does not exist yet, at least before [this](https://github.com/dotnet/runtime/pull/86391) pull request gets merged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrungnt2910%2Fdotnet-haiku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrungnt2910%2Fdotnet-haiku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrungnt2910%2Fdotnet-haiku/lists"}