{"id":21698739,"url":"https://github.com/trungnt2910/hyclone","last_synced_at":"2025-04-12T12:41:55.198Z","repository":{"id":47219160,"uuid":"515400288","full_name":"trungnt2910/hyclone","owner":"trungnt2910","description":"A runtime environment for Haiku applications.","archived":false,"fork":false,"pushed_at":"2024-06-12T03:34:08.000Z","size":1577,"stargazers_count":57,"open_issues_count":8,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T07:22:09.787Z","etag":null,"topics":["compatibility-layer","hacktoberfest","haiku-os","hpkg"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":".github/FUNDING.yml","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},"funding":{"github":"trungnt2910","patreon":null,"open_collective":null,"ko_fi":"trungnt2910","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-07-19T01:56:15.000Z","updated_at":"2025-03-19T04:35:41.000Z","dependencies_parsed_at":"2023-12-17T04:53:46.581Z","dependency_job_id":"82c8703d-3245-4819-ba68-2a69c4e80caf","html_url":"https://github.com/trungnt2910/hyclone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fhyclone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fhyclone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fhyclone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trungnt2910%2Fhyclone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trungnt2910","download_url":"https://codeload.github.com/trungnt2910/hyclone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248568745,"owners_count":21126093,"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":["compatibility-layer","hacktoberfest","haiku-os","hpkg"],"created_at":"2024-11-25T19:36:29.771Z","updated_at":"2025-04-12T12:41:55.178Z","avatar_url":"https://github.com/trungnt2910.png","language":"C++","funding_links":["https://github.com/sponsors/trungnt2910","https://ko-fi.com/trungnt2910"],"categories":[],"sub_categories":[],"readme":"# HyClone\n\n[![Discord Invite](https://dcbadge.vercel.app/api/server/ThUzHbEqn9?style=flat)](https://discord.gg/ThUzHbEqn9)\u0026nbsp;\n[![Build](https://github.com/trungnt2910/hyclone/actions/workflows/build.yml/badge.svg)](https://github.com/trungnt2910/hyclone/actions/workflows/build.yml)\n\nHyClone is a runtime environment for [Haiku](https://github.com/haiku/haiku) applications.\n\nHyClone currently targets and supports Linux, but should be, with some modifications, portable to any ELF-based SysV OSes (including Haiku itself).\n\nCurrently, HyClone only supports x86_64.\n\n## Build instructions\n\n### Building Haiku objects\n\nHyClone uses precompiled objects from a Haiku build. Therefore, the first step is to fetch a copy of Haiku sources and build it.\n\nOn an Ubuntu machine:\n\n```\nsudo apt install -y git nasm bc autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libzstd-dev xorriso libtool python3\n\ncd hyclone\n./copy_objects.sh\n```\n\n`copy_objects.sh` fetches a copy of the Haiku official source code, builds the neccessary targets, and copies the required precompiled object files to the HyClone source tree.\n\nBy default, `copy_objects.sh` stores the cloned source code (`haiku` for the OS, `buildtools` for the Haiku cross-compilers) at HyClone's parent directory, for example:\n```\nCodingProjects\n|\n|--- hyclone\n    |\n    |--- copy_objects.sh\n|--- haiku\n|--- buildtools\n```\n\nIf you want to change the Haiku source and Build tools source locations, or if you are a Haiku developer wishing to use your existing Haiku work environment, you can set these\nenvironment variables to change where `copy_objects.sh` looks for objects:\n\n- `HAIKU_ARCH`: The Haiku build architecture. Only the default value, `x86_64` is currently supported.\n- `HAIKU_BUILD_ENVIRONMENT_ROOT`: The root folder of the Haiku build environment. By default, it is the parent directory of the HyClone source.\n- `HAIKU_BUILD_SOURCE_DIRECTORY`: The folder where Haiku's source code should be stored. Defaults to `$HAIKU_BUILD_ENVIRONMENT_ROOT/haiku`.\n- `HAIKU_BUILD_TOOLS_DIRECTORY`: The folder where the source code for Haiku's build tools should be stored. Defaults to `$HAIKU_BUILD_ENVIRONMENT_ROOT/buildtools`.\n- `HAIKU_BUILD_OUTPUT_ROOT`: The folder where Haiku's build output should be stored. Defaults to `$HAIKU_BUILD_SOURCE_DIRECTORY/generated.$HAIKU_ARCH`.\n\n### Building HyClone\n\nBuilding HyClone requires a modern C++ compiler that supports C++20 library features. For GCC, the minimum version required is **GCC 11**.\n\nIf you're building on older Linux distros, you might have to update your compiler. For Ubuntu 20.04, follow these steps:\n\n```\nsudo add-apt-repository -y ppa:ubuntu-toolchain-r/test\nsudo apt install -y gcc-11 g++-11\n# Overrides the default compiler version\nsudo update-alternatives \\\n    --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \\\n    --slave /usr/bin/g++ g++ /usr/bin/g++-11\n```\n\nHyClone also requires a modern version of CMake (CMake 3.24). On older Linux distros, you'll have to install the latest CMake from Kitware\nby following [this guide](https://apt.kitware.com/).\n\nOnce a compatible compiler and CMake is set up, you can build HyClone using these commands:\n\n```\ncd hyclone\nsudo apt install -y cmake libgmp-dev libmpfr-dev zlib1g-dev libzstd-dev\nmkdir build; cd build\ncmake ..\n# For test builds, do this to install everything to the build directory:\n# cmake .. -DCMAKE_INSTALL_PREFIX=.\nsudo make install\ncd ..\n```\n\nThe HyClone source directory must be placed in the same directory as Haiku, so that it could detect and copy the required object files.\n\n### Running HyClone\n\nIn order to get Haiku apps running (`bash`, `gcc`,...), we need a Haiku installation with basic system directories, libraries, and configuration files.\n\nTo build this environment, HyClone comes with a `build_hprefix.sh` script.\nThe script assumes that a copy of Haiku source code is available at `$HAIKU_BUILD_SOURCE_DIRECTORY`\n\n```\n# Set this to the path where you want to store your Haiku root.\nexport HPREFIX=~/.hprefix\n# If you have altered the CMAKE_INSTALL_PREFIX option in the configure step, do this.\n# If you set -DCMAKE_INSTALL_PREFIX=., HyClone should be installed in the build directory.\n# export HYCLONE_INSTALL_PREFIX=build\n# Assuming you're at the root of the HyClone source tree\n./build_hprefix.sh\n```\n\n`build_hprefix.sh` installs just enough packages to start a `bash` shell. To install other packages, use the `-A` option, or the `-S` option if\nthe packages belong to the system repository.\n\n```\n# Strings are comma-separated.\n./build_hprefix.sh \\\n    -A=\"gcc,binutils,gmp,mpc,mpfr,zlib\" \\\n    -S=\"haiku_devel\"\n```\n\nNow, assuming that you're at `$CMAKE_INSTALL_PREFIX`, run:\n\n```\ncd bin\n\n# This will be appended to $PATH by haiku_loader\nexport HPATH=/boot/system/bin:/boot/system/non-packaged/bin\n./haiku_loader bash --login\n```\n\n### Installing applications\n\nHyClone supports Haiku's default package manager, `pkgman`.\n\nFirst, you'll have to configure Haiku default sources:\n\n```\npkgman add-repo https://eu.hpkg.haiku-os.org/haiku/master/x86_64/current\npkgman add-repo https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current\n```\n\nThen, to install additional packages to a HyClone prefix, simply do what you would do on Haiku:\n\n```\npkgman install -y \u003cpackage name\u003e\n```\n\nYou can also update your HyClone environment using `pkgman`:\n\n```\npkgman full-sync\n```\n\n### Running GUI apps\n\nHyClone can run Haiku's `app_server`. If for any reason `app_server` is not launched by default, you can launch it by running the following command from a HyClone shell:\n\n```\n/boot/system/servers/app_server \u0026\n```\n\nThen, you can open a remote desktop session by following this [guide](https://discuss.haiku-os.org/t/instruction-of-using-haiku-remote-desktop/9442) as if you were working on a real Haiku machine.\n\n### Demo\n\nA screenshot of HyClone on WSL1:\n\n![wsl1_hyclone](docs/bashonhaikuonubuntuonwindows.png)\n\nHyClone remote desktop:\n\n![desktop_hyclone](docs/abouthyclonesystem.png)\n\n### Notes\n\n- Many apps might not work on HyClone as this project is still in its early stages. You might run into errors or missing syscalls (\"stubs\"). If you encounter any of these, please let me know by opening an issue.\n- The host's root is mounted on HyClone as `/SystemRoot`. When translating calls from Haiku to the host system, HyClone maps the Haiku root to `$HPREFIX`, and when translating the results, HyClone appends `/SystemRoot` to the host's root.\n\n## Community\n\nThis repo is a part of [Project Reality](https://discord.gg/ThUzHbEqn9).\n\nNeed help using this project? Join me on [Discord](https://discord.gg/ThUzHbEqn9), and let's find a solution together.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrungnt2910%2Fhyclone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrungnt2910%2Fhyclone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrungnt2910%2Fhyclone/lists"}