{"id":20526497,"url":"https://github.com/gbdev/rgbenv","last_synced_at":"2025-07-10T22:45:11.458Z","repository":{"id":101809508,"uuid":"565471053","full_name":"gbdev/rgbenv","owner":"gbdev","description":"RGBDS version manager","archived":false,"fork":false,"pushed_at":"2024-06-25T05:49:00.000Z","size":43,"stargazers_count":10,"open_issues_count":9,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T14:04:57.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/gbdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-13T14:17:30.000Z","updated_at":"2025-01-10T23:50:14.000Z","dependencies_parsed_at":"2023-11-10T15:01:42.903Z","dependency_job_id":"7a64d08f-7297-42e8-84ec-dba553511a09","html_url":"https://github.com/gbdev/rgbenv","commit_stats":{"total_commits":44,"total_committers":3,"mean_commits":"14.666666666666666","dds":0.4545454545454546,"last_synced_commit":"251577417781a4e8b70da719cf1808e5ecbf6d89"},"previous_names":["gbdev/rgbenv"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbdev%2Frgbenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbdev%2Frgbenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbdev%2Frgbenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbdev%2Frgbenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbdev","download_url":"https://codeload.github.com/gbdev/rgbenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248521399,"owners_count":21118065,"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":[],"created_at":"2024-11-15T23:14:23.827Z","updated_at":"2025-04-14T04:20:20.936Z","avatar_url":"https://github.com/gbdev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rgbenv\n\nThis is a version manager for [RGBDS](https://github.com/gbdev/rgbds). It is a pure shell script.* Inspired by [pyenv](https://github.com/pyenv/pyenv) and [rbenv](https://github.com/rbenv/rbenv), it lets you easily switch between multiple versions of the RGBDS suite to suit different projects.\n\n\\* Bash script, at the moment. Compatibility with other shells is not guaranteed.\n\n## Quickstart (Debian)\n\n### 1. Get rgbenv\n```sh\nsudo apt install -y libpng-dev pkg-config build-essential bison git curl\nsudo curl -Lo /usr/local/bin/rgbenv https://github.com/gbdev/rgbenv/raw/v0.1.3/rgbenv\nsudo chmod +x /usr/local/bin/rgbenv\n```\n\n### 2. Install a version and set it as the default\n```sh\nrgbenv install 0.7.0\nrgbenv use 0.7.0\n```\n\n### 3. Use the default version\n```sh\nrgbenv exec rgbasm -V\n```\n(replace `rgbasm -V` with your desired command)\n\nTo use it without `rgbenv exec`…\n```sh\necho 'export PATH=\"$HOME/.local/share/rgbenv/default/bin:$PATH\"' \u003e\u003e .bashrc\nsource .bashrc\nrgbasm -V\n```\n\n### 4. Execute with another version\n```sh\nrgbenv install 0.6.1\nrgbenv exec -v 0.6.1 rgbasm -V\n```\n(replace `rgbasm -V` with your desired command)\n\n\n## What does it do?\n\n* Installs or uninstalls a specific version of the RGBDS suite.\n* Lets you configure the default version to use.\n* Lets you specify a version to be used with a specific project.\n\n## How does it do that?\n\n`PATH` is the variable used by the system to determine where to find some program. It contains a list of directories, separated by a colon each:\n```\n/usr/local/bin:/usr/bin:/bin:/usr/local/sbin\n```\nLeft-most directories take priority. If a program isn't found there, it will search the directory next to it.\n\nAs an example, if you installed RGBDS 0.6.0 through your package manager, it would place the suite programs in `/usr/bin`. If you compiled, say, version 0.4.1 of RGBDS manually and placed it in `/usr/local/bin`, then *that* version would take precedence over 0.6.0.\n\nWhat rgbenv does is override this variable so that its managed folder takes precedence over that of the system. In Unix-like systems, you can check which directory a program is to be run from (for example, `rgbasm`) using this command:\n```sh\n$ which rgbasm\n```\n\n## What do I need?\n\n* A Unix-like environment\n    * Linux or BSD preferable\n    * On Windows, you may use either:\n      * [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) with a distro of choice\n      * [MSYS2](https://www.msys2.org/)\n      * [Cygwin](https://cygwin.com/)\n* git\n* curl\n* [RGBDS build dependencies](https://rgbds.gbdev.io/install/source/#2-build)\n\nYou can use these commands to get them:\n\u003cul\u003e\n\u003cli\u003eDebian: \u003cpre\u003e\u003ccode\u003e# apt update\n# apt install libpng-dev pkg-config build-essential bison git curl\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eAlpine Linux: \u003cpre\u003e\u003ccode\u003e# apk add git curl make libpng-dev bison gcc g++ libc-dev\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eOpenBSD: \u003cpre\u003e\u003ccode\u003e# pkg_add png git bash curl bison\n\u003c/code\u003e\u003c/pre\u003eIn case something goes wrong, try using GCC as the compiler:\u003cpre\u003e\u003ccode\u003e# pkg_add g++ gcc\n$ CC=egcc CXX=eg++ rgbenv install $YOUR_DESIRED_VERSION\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eWindows MSYS2 (MinGW64): \u003cpre\u003e\u003ccode\u003e$ pacman -S git make bison pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-libpng\n\u003c/code\u003e\u003c/pre\u003eIf you're using another environment with MSYS2, replace \u003ccode\u003emingw-w64-x86_64\u003c/code\u003e with the corresponding name. You may need to do \u003ccode\u003emkdir -p /usr/local/bin\u003c/code\u003e first.\u003c/li\u003e\n\u003cli\u003eWindows Cygwin: From the setup program, select the latest versions of these packages:\u003cul\u003e\n\u003cli\u003egit\u003c/li\u003e\n\u003cli\u003egcc-g++\u003c/li\u003e\n\u003cli\u003elibpng-devel\u003c/li\u003e\n\u003cli\u003epkgconf\u003c/li\u003e\n\u003cli\u003ebison\u003c/li\u003e\n\u003cli\u003emake\u003c/li\u003e\n\u003c/ul\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n## How do I set it up?\n\n\u003col\u003e\n\u003cli\u003eInstall whatever dependencies it needs, through the above section.\u003c/li\u003e\n\u003cli\u003eDownload the rgbenv script, and place it in \u003ccode\u003e/usr/local/bin/\u003c/code\u003e (or any directory listed when you run \u003ccode\u003eecho $PATH\u003c/code\u003e) The fastest way is through: \u003cpre\u003e\u003ccode\u003e# curl -Lo /usr/local/bin/rgbenv https://github.com/gbdev/rgbenv/raw/v0.1.3/rgbenv\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eEnsure the script is executable: \u003cpre\u003e\u003ccode\u003e# chmod +x /usr/local/bin/rgbenv\n\u003c/code\u003e\u003c/pre\u003e(replace \u003ccode\u003e/usr/local/bin/rgbenv\u003c/code\u003e with where you put the rgbenv script)\u003c/li\u003e\n\u003cli\u003eInstall the version you want, say 0.6.0:\u003cpre\u003e\u003ccode\u003e$ rgbenv install 0.6.0\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eWhen prompted to add \u003ccode\u003eexport PATH=...\u003c/code\u003e to \u003ccode\u003e.bash_profile\u003c/code\u003e, do so, then run: \u003cpre\u003e\u003ccode\u003e$ source ~/.bash_profile\n\u003c/code\u003e\u003c/pre\u003e\u003cstrong\u003eNote: in some shells, you may need to specify \u003ccode\u003e.profile\u003c/code\u003e instead of \u003ccode\u003e.bash_profile\u003c/code\u003e.\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003eSet your version as the default: \u003cpre\u003e\u003ccode\u003e$ rgbenv use 0.6.0\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003cli\u003eVerify that RGBDS really is the version you picked: \u003cpre\u003e\u003ccode\u003e$ rgbasm -V\n\u003c/code\u003e\u003c/pre\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\n## How to set a project-specified version\n\nOn the current working directory, make a file named `.rgbds-version`. This shall be a text file containing only the version number to be used. For example:\n```\n$ cat .rgbds-version\n0.6.0\n```\n\n## Quick commands\n\n* `rgbenv use 0.5.1` - set default RGBDS version to 0.5.1\n* `rgbenv no-use` - clear the defaults and use the system-provided RGBDS, if any\n* `rgbenv exec -v 0.4.2 make` - run `make` using RGBDS 0.4.2\n* `rgbenv exec make` - run `make` with the project-specified RGBDS version.\n\n## Development\n\nAt the moment, rgbenv is hosted on GitHub.\n\nTo run the unit tests on your own machine, clone the rgbenv repo (instead of just downloading the script as above), and then run `make test`:\n\n```\n$ git clone https://github.com/gbdev/rgbenv\n$ cd rgbenv\n$ make test\n```\n\nAs the unit tests use [Bats](https://github.com/bats-core/bats-core), the Bats repo will be cloned automatically inside the rgbenv directory if it is not present, and then Bats will be run from there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbdev%2Frgbenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbdev%2Frgbenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbdev%2Frgbenv/lists"}