-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP embed resources * Dev Update: - MacOS support - Flake template - Documentation * fix heaps shell * dev build on linux * hl builds on Mac M1 * hl runs on Mac M1 * minor cleanup * Add mention to people who helped * Add github action check
- Loading branch information
Showing
15 changed files
with
472 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Check | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: checkout repository | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
name: install nix | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
name: use nix cache | ||
- uses: DeterminateSystems/flake-checker-action@v4 | ||
name: check flake lock | ||
- run: nix flake check | ||
name: run compilation checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,23 @@ | ||
# Haxix | ||
|
||
a flake to build and run games made with [heaps.io](https://heaps.io/) | ||
A flake to build and run games made with [heaps.io](https://heaps.io/) and possibly other haxe game engines in the future. | ||
|
||
# Usage | ||
## Usage | ||
|
||
Add this to your flake | ||
See the flake [template](template/flake.nix) for a example on how to use haxix in your own projects. | ||
|
||
```nix | ||
{ | ||
inputs = { | ||
haxix.url = "github:MadMcCrow/haxix"; | ||
# not mandatory but should work just fine : | ||
# haxix.inputs.nixpkgs.follows = "nixpkgs"; | ||
... | ||
}; | ||
## TODO | ||
|
||
outputs = {self, nixpkgs, haxix, ...} : { | ||
packages."x86_64-linux" = { | ||
default = haxix.lib."x86_64-linux".heaps.buildGame { | ||
name = "my-game"; | ||
src = self; # or the folder containing the src folder | ||
version = "0.0.1-alpha"; | ||
debug = false; # set to true to have debug symbols | ||
release = false; # set to true for compiled to C | ||
}; | ||
}; | ||
}; | ||
} | ||
See [TODO.md](docs/TODO.md). these are the most likely things to be added to the project. | ||
|
||
``` | ||
## Contribute | ||
|
||
# TODO | ||
Any [contribution](docs/CONTRIBUTING.md) welcome. You can contribute on features, documentation, or bug fixes. | ||
|
||
- [ ] support packaging resources | ||
- [ ] support other haxe game engines | ||
- [ ] cache build output | ||
- [ ] add flake checks | ||
- [ ] add flake templates | ||
## Licence | ||
|
||
# Contribute | ||
Licensed under [MIT](Licence.md) | ||
|
||
Any contribution welcome. | ||
## Authors | ||
|
||
# Licence | ||
Licensed under [MIT](Licence.md) | ||
See [AUTHORS](docs/AUTHORS.md) for the complete list of people who helped make haxix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Contributors: | ||
|
||
[Noé Perard-Gayot](https://github.com/MadMcCrow) - Original flake, maintainer | ||
[Beshoy Kamel](https://github.com/bwkam) - Latest Haxe, and hashlink implementation | ||
|
||
# Special Thanks to : | ||
- the nix community and its [unofficial discord](https://discord.gg/NJZ83pdM) | ||
- the haxe community and it's [discord](https://discord.gg/UqzaWntA) : | ||
- Zeta | ||
- logololol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Contributing | ||
|
||
## Request support, report a bug, or ask for a feature | ||
|
||
Please open an [Issue](https://github.com/MadMcCrow/haxix/issues). | ||
|
||
## Propose Changes, Add a feature or improvement | ||
|
||
Please open a [PR](https://github.com/MadMcCrow/haxix/pulls). | ||
PRs are the best way of contributing, as I can merge them easily. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# DONE : | ||
|
||
- build and run Heaps games on linux | ||
- build wih latest Haxe, Heaps, etc. | ||
- MacOS (darwin) support | ||
- M1 support (no native heaps game, because HL cannot be built in arm64) | ||
- package haxelibs | ||
|
||
# TODO : | ||
- [ ] Other Haxe game engines | ||
- [ ] Godot-Haxe | ||
- [ ] OpenFL | ||
- [ ] Auto-Update through Github Action | ||
- [ ] Clean, remove `_latest` from package names |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# darwin/hashlink.nix | ||
# Hashlink interpreter for haxe, on MacOS. | ||
# only intel Mac supported, uses rosetta to run on M1 | ||
pkgs : | ||
let | ||
# we need objective-C | ||
objc = with pkgs.darwin; [ apple_sdk_11_0.objc4 libobjc ]; | ||
# we support platform | ||
meta = pkgs.hashlink.meta // { platforms = pkgs.lib.platforms.darwin; }; | ||
# make Flags to detect objective C | ||
ObjCmakeFlags = let | ||
concatObjc = dir: | ||
builtins.concatStringsSep "," (map (x: "${x}/${dir}") objc); | ||
in [ "CPATH=${concatObjc "include"}" "LIBRARY_PATH=${concatObjc "lib"}" ]; | ||
|
||
# implementation : | ||
in (finalAttrs: previousAttrs:{ | ||
inherit meta; | ||
buildInputs = (previousAttrs.buildInputs or []) ++ objc; | ||
makeFlags = (previousAttrs.makeFlags or []) ++ ObjCmakeFlags; | ||
postFixup = (previousAttrs.postFixup or "") + | ||
'' | ||
install_name_tool -add_rpath $out/lib $out/bin/hl | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# default.nix | ||
# expose every function/derivations here | ||
# also detect linux/MacOS and give the correct version | ||
{ inputs, system }: | ||
with builtins; | ||
let | ||
inherit (inputs.nixpkgs.lib) platforms; | ||
|
||
systemSwitch = linux: darwin: | ||
if elem system platforms.darwin then darwin | ||
else if elem system platforms.linux then linux | ||
else throw "unsupported system"; | ||
|
||
# nixpkgs : support MacOS | ||
nixpkgs = systemSwitch inputs.nixpkgs inputs.nixpkgs-darwin; | ||
pkgs = import nixpkgs { system = systemSwitch "x86_64-linux" "x86_64-darwin"; }; | ||
|
||
# haxe language and compiler | ||
# does not build in aaarch64-darwin | ||
haxe = import ./haxe.nix { | ||
inherit pkgs; | ||
inherit (inputs) haxe; | ||
}; | ||
|
||
# a way to install haxelibs | ||
haxelib = import ./haxelib.nix { inherit pkgs; }; | ||
|
||
# format library | ||
format = import ./format.nix { | ||
inherit pkgs; | ||
inherit (inputs) haxe_format; | ||
}; | ||
|
||
# hashlink interpreter | ||
# does not build in aaarch64-darwin | ||
hashlink = import ./hashlink.nix { | ||
inherit pkgs; | ||
inherit haxelib; | ||
inherit (inputs) hashlink; | ||
}; | ||
|
||
# Heaps game engine | ||
# does not build in aaarch64-darwin because of hashlink | ||
heaps = import ./heaps.nix { | ||
inherit pkgs haxelib; | ||
inherit (inputs) heaps; | ||
inherit (haxe) haxe_latest; | ||
inherit (format) format_latest; | ||
inherit (hashlink) hashlink_latest; | ||
}; | ||
|
||
in { inherit haxe hashlink heaps format; } |
Oops, something went wrong.