IT'S ALIVE
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
result
|
||||
dist-newstyle
|
||||
cabal.project.local
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "rgfw"]
|
||||
path = include/RGFW
|
||||
url = https://github.com/ColleagueRiley/RGFW
|
||||
29
LICENSE
Normal file
29
LICENSE
Normal file
@@ -0,0 +1,29 @@
|
||||
Copyright (c) 2025, andromeda
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
cabal.project
Normal file
13
cabal.project
Normal file
@@ -0,0 +1,13 @@
|
||||
packages:
|
||||
./
|
||||
|
||||
source-repository-package
|
||||
type: git
|
||||
location: https://github.com/well-typed/hs-bindgen.git
|
||||
tag: 933d11d771ff13b6a3b851cb0ec9bc3632626f2f
|
||||
subdir: hs-bindgen-runtime
|
||||
source-repository-package
|
||||
type: git
|
||||
location: https://github.com/well-typed/hs-bindgen.git
|
||||
tag: 933d11d771ff13b6a3b851cb0ec9bc3632626f2f
|
||||
subdir: c-expr-runtime
|
||||
8
flake.lock
generated
8
flake.lock
generated
@@ -25,17 +25,17 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765785261,
|
||||
"narHash": "sha256-VIoBzgKQCgxJLQQMQ5r3cYpkxlKOTJIexeCCBu+TO4Q=",
|
||||
"lastModified": 1765888948,
|
||||
"narHash": "sha256-rgGAUQVfJ0sKXm9bzh7XIJUHh/JkEsz/LX6k8aCKeD4=",
|
||||
"owner": "well-typed",
|
||||
"repo": "hs-bindgen",
|
||||
"rev": "e2af56a0e9f7aebed6104bb1181aa465f2050d29",
|
||||
"rev": "fd74e8fa4216eccd67069ec9d8637b57000ffc83",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "well-typed",
|
||||
"ref": "dom/1415/bug-report",
|
||||
"repo": "hs-bindgen",
|
||||
"rev": "fd74e8fa4216eccd67069ec9d8637b57000ffc83",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
||||
84
flake.nix
84
flake.nix
@@ -1,8 +1,8 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
||||
# hs-bindgen.url = "github:well-typed/hs-bindgen";
|
||||
hs-bindgen.url = "github:well-typed/hs-bindgen/dom/1415/bug-report";
|
||||
hs-bindgen.url = "github:well-typed/hs-bindgen/fd74e8fa4216eccd67069ec9d8637b57000ffc83";
|
||||
self.submodules = true;
|
||||
};
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
@@ -10,40 +10,68 @@
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
version = "0.3.0";
|
||||
package = {
|
||||
mkDerivation,
|
||||
base,
|
||||
bindings-DSL,
|
||||
c-expr-runtime,
|
||||
gl,
|
||||
hs-bindgen-runtime,
|
||||
lib,
|
||||
libGL,
|
||||
libX11,
|
||||
xcursor,
|
||||
xi,
|
||||
xrandr,
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "hs-rgfw";
|
||||
inherit version;
|
||||
src = ./.;
|
||||
libraryHaskellDepends = [
|
||||
base
|
||||
bindings-DSL
|
||||
c-expr-runtime
|
||||
hs-bindgen-runtime
|
||||
];
|
||||
libraryPkgconfigDepends = [
|
||||
gl
|
||||
libGL
|
||||
libX11
|
||||
xcursor
|
||||
xi
|
||||
xrandr
|
||||
];
|
||||
homepage = "https://git.mtgmonkey.net/Andromeda/hs-rgfw";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = ["x86_64-linux"];
|
||||
};
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
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.pkg-config
|
||||
pkgs.xorg.libX11
|
||||
pkgs.xorg.libXcursor
|
||||
pkgs.xorg.libXrandr
|
||||
pkgs.xorg.libXi
|
||||
pkgs.libGL
|
||||
pkgs.clang
|
||||
hs-bindgen.packages.${system}.default
|
||||
pkgs.cabal-install
|
||||
];
|
||||
shellHook = ''
|
||||
# template
|
||||
# export BINDGEN_EXTRA_CLANG_ARGS="$BINDGEN_EXTRA_CLANG_ARGS "
|
||||
|
||||
# c flags from Nix
|
||||
export BINDGEN_EXTRA_CLANG_ARGS="$BINDGEN_EXTRA_CLANG_ARGS $(cat ${pkgs.clang}/nix-support/cc-cflags) $(cat ${pkgs.clang}/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
|
||||
|
||||
# pkg-config for libraries
|
||||
export BINDGEN_EXTRA_CLANG_ARGS="$BINDGEN_EXTRA_CLANG_ARGS $(pkg-config --cflags --libs x11 xrandr xcursor xi gl)"
|
||||
|
||||
# add local headers
|
||||
export BINDGEN_EXTRA_CLANG_ARGS="$BINDGEN_EXTRA_CLANG_ARGS -isystem $PWD/lib"
|
||||
|
||||
# no global include
|
||||
# export BINDGEN_BUILTIN_INCLUDE_DIR=disable
|
||||
|
||||
echo $BINDGEN_EXTRA_CLANG_ARGS
|
||||
'';
|
||||
inputsFrom = [
|
||||
self.packages.${system}.default
|
||||
];
|
||||
};
|
||||
};
|
||||
packages.${system} = {
|
||||
default = pkgs.haskellPackages.callPackage package {
|
||||
xcursor = pkgs.xorg.libXcursor;
|
||||
xi = pkgs.xorg.libXi;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
36
hs-rgfw.cabal
Normal file
36
hs-rgfw.cabal
Normal file
@@ -0,0 +1,36 @@
|
||||
cabal-version: 3.0
|
||||
name: hs-rgfw
|
||||
version: 0.3.0
|
||||
homepage: https://git.mtgmonkey.net/Andromeda/hs-rgfw
|
||||
license: BSD-3-Clause
|
||||
license-file: LICENSE
|
||||
author: andromeda
|
||||
maintainer: @andromeda:tchncs.de
|
||||
category: Development
|
||||
build-type: Simple
|
||||
common warnings
|
||||
ghc-options:
|
||||
-Wall
|
||||
common pkgconfig
|
||||
pkgconfig-depends:
|
||||
gl,
|
||||
x11,
|
||||
xcursor,
|
||||
xrandr,
|
||||
xi
|
||||
common default-language
|
||||
default-language: Haskell2010
|
||||
library
|
||||
import:
|
||||
warnings,
|
||||
pkgconfig,
|
||||
default-language
|
||||
exposed-modules:
|
||||
Generated
|
||||
build-depends:
|
||||
base >=4.18,
|
||||
bindings-DSL <1000,
|
||||
c-expr-runtime <1000,
|
||||
hs-bindgen-runtime <1000
|
||||
hs-source-dirs: lib
|
||||
include-dirs: include/RGFW
|
||||
1
include/RGFW
Submodule
1
include/RGFW
Submodule
Submodule include/RGFW added at e23298e46f
4564
lib/Generated.hs
Normal file
4564
lib/Generated.hs
Normal file
File diff suppressed because it is too large
Load Diff
4483
lib/Generated/FunPtr.hs
Normal file
4483
lib/Generated/FunPtr.hs
Normal file
File diff suppressed because it is too large
Load Diff
4741
lib/Generated/Safe.hs
Normal file
4741
lib/Generated/Safe.hs
Normal file
File diff suppressed because it is too large
Load Diff
4741
lib/Generated/Unsafe.hs
Normal file
4741
lib/Generated/Unsafe.hs
Normal file
File diff suppressed because it is too large
Load Diff
14034
lib/RGFW.h
14034
lib/RGFW.h
File diff suppressed because it is too large
Load Diff
14042
lib/RGFW_HS.h
14042
lib/RGFW_HS.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user