From 0ed50d577b39cb7eee4e0935e088fa515ce8aff5 Mon Sep 17 00:00:00 2001 From: andromeda Date: Sat, 24 Jan 2026 17:07:38 +0100 Subject: [PATCH] init --- .gitignore | 2 + .gitmodules | 3 ++ flake.lock | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 59 +++++++++++++++++++++++++++ generate.sh | 8 ++++ rgfw | 1 + 6 files changed, 186 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 flake.lock create mode 100644 flake.nix create mode 100755 generate.sh create mode 160000 rgfw diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ce0bff --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +lib +result* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..73e3225 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "rgfw"] + path = rgfw + url = https://github.com/ColleagueRiley/RGFW diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c21ad65 --- /dev/null +++ b/flake.lock @@ -0,0 +1,113 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "hs-bindgen": { + "inputs": { + "flake-parts": "flake-parts", + "libclang-bindings-src": "libclang-bindings-src", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1765888948, + "narHash": "sha256-rgGAUQVfJ0sKXm9bzh7XIJUHh/JkEsz/LX6k8aCKeD4=", + "owner": "well-typed", + "repo": "hs-bindgen", + "rev": "fd74e8fa4216eccd67069ec9d8637b57000ffc83", + "type": "github" + }, + "original": { + "owner": "well-typed", + "repo": "hs-bindgen", + "rev": "fd74e8fa4216eccd67069ec9d8637b57000ffc83", + "type": "github" + } + }, + "libclang-bindings-src": { + "flake": false, + "locked": { + "lastModified": 1765293798, + "narHash": "sha256-fZvyZo5emD1W5LwrIg2zTUYE9StRh3xF8TcuXjzKIAk=", + "owner": "well-typed", + "repo": "libclang", + "rev": "b8305bd9c3e8e8f63d6f415553388be7f233ef45", + "type": "github" + }, + "original": { + "owner": "well-typed", + "repo": "libclang", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1764947035, + "narHash": "sha256-EYHSjVM4Ox4lvCXUMiKKs2vETUSL5mx+J2FfutM7T9w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a672be65651c80d3f592a89b3945466584a22069", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1765772535, + "narHash": "sha256-aq+dQoaPONOSjtFIBnAXseDm9TUhIbe215TPmkfMYww=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "09b8fda8959d761445f12b55f380d90375a1d6bb", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "hs-bindgen": "hs-bindgen", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..45af066 --- /dev/null +++ b/flake.nix @@ -0,0 +1,59 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + hs-bindgen.url = "github:well-typed/hs-bindgen/fd74e8fa4216eccd67069ec9d8637b57000ffc83"; + self.submodules = true; + }; + outputs = { + nixpkgs, + hs-bindgen, + self, + ... + }: let + version = "0.1.0"; + package = { + mkDerivation, + lib, + base, + }: + mkDerivation { + pname = "hs-rgfw"; + inherit version; + src = ./.; + libraryHaskellDepends = [ + base + ]; + libraryPkgconfigDepends = [ + ]; + homepage = "https://git.mtgmonkey.net/Andromeda/hs-rgfw"; + license = lib.licenses.bsd3; + platforms = ["x86_64-linux"]; + }; + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [ + hs-bindgen.overlays.libclangBindings + hs-bindgen.overlays.hsBindgen + ]; + }; + in { + devShells.${system} = { + default = pkgs.mkShell { + stdenv = pkgs.clangStdenv; + packages = [ + pkgs.clang + pkgs.cabal-install + pkgs.hs-bindgen-cli + pkgs.hsBindgenHook + ]; + inputsFrom = [ + self.packages.${system}.default + ]; + }; + }; + packages.${system} = { + default = pkgs.haskellPackages.callPackage package {}; + }; + }; +} diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..276df77 --- /dev/null +++ b/generate.sh @@ -0,0 +1,8 @@ +hs-bindgen-cli preprocess \ + -Irgfw \ + --create-output-dirs \ + --overwrite-files \ + --hs-output-dir lib \ + --module RGFW.Generated \ + --clang-option=-DRGFW_OPENGL \ + RGFW.h diff --git a/rgfw b/rgfw new file mode 160000 index 0000000..83d945a --- /dev/null +++ b/rgfw @@ -0,0 +1 @@ +Subproject commit 83d945ae8911b520de399f6f6d80e62e55965079