summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README.md23
-rw-r--r--flake.nix25
-rwxr-xr-xget_wl.sh16
4 files changed, 45 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index efc68e0..d3803e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
build/
out/
+wl/
result*
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5405eff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,23 @@
+# c3term
+
+eventually a terminal emulator, currently a port of [this example](https://github.com/ColleagueRiley/RSGL/blob/main/examples/basics/basic.c)
+
+## with nix
+
+`nix run` to run
+
+`nix develop` for a development shell, then follow the manual build instructions
+
+## manual build
+
+required by `get_wl.sh`:
+- pkg-config
+- wayland-protocols
+- wayland-scanner
+
+see `project.json` for library requirements
+
+```bash
+./get_wl.sh
+c3c build c3term-linux-x64
+```
diff --git a/flake.nix b/flake.nix
index a849cea..e8be043 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,6 +8,7 @@
};
};
outputs = {
+ self,
nixpkgs,
c3c,
...
@@ -24,30 +25,16 @@
buildInputs = [
pkgs.c3c
pkgs.wayland-scanner
+ pkgs.pkg-config
+ pkgs.wayland-protocols
];
nativeBuildInputs = [
pkgs.libxkbcommon
pkgs.wayland
pkgs.libGL
];
- configurePhase = ''
- mkdir -p wl/
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml wl/xdg-shell.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/staging/pointer-warp/pointer-warp-v1.xml wl/pointer-warp-v1.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml wl/xdg-toplevel-icon-v1.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wl/xdg-decoration-unstable-v1.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml wl/relative-pointer-unstable-v1.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml wl/pointer-constraints-unstable-v1.h
- wayland-scanner client-header ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/xdg-output/xdg-output-unstable-v1.xml wl/xdg-output-unstable-v1.h
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml wl/xdg-shell.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/staging/pointer-warp/pointer-warp-v1.xml wl/pointer-warp-v1.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml wl/xdg-toplevel-icon-v1.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wl/xdg-decoration-unstable-v1.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml wl/relative-pointer-unstable-v1.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml wl/pointer-constraints-unstable-v1.c
- wayland-scanner private-code ${pkgs.wayland-protocols}/share/wayland-protocols/unstable/xdg-output/xdg-output-unstable-v1.xml wl/xdg-output-unstable-v1.c
- '';
buildPhase = ''
+ ./get_wl.sh
c3c build c3term-linux-x64
'';
installPhase = ''
@@ -61,9 +48,7 @@
};
};
devShells.x86_64-linux.default = pkgs.mkShell {
- buildInputs = [
- pkgs.c3c
- ];
+ inputsFrom = [self.packages.x86_64-linux.default];
};
};
}
diff --git a/get_wl.sh b/get_wl.sh
new file mode 100755
index 0000000..6136480
--- /dev/null
+++ b/get_wl.sh
@@ -0,0 +1,16 @@
+mkdir -p wl/
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/stable/xdg-shell/xdg-shell.xml wl/xdg-shell.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/staging/pointer-warp/pointer-warp-v1.xml wl/pointer-warp-v1.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml wl/xdg-toplevel-icon-v1.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wl/xdg-decoration-unstable-v1.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml wl/relative-pointer-unstable-v1.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml wl/pointer-constraints-unstable-v1.h
+wayland-scanner client-header $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/xdg-output/xdg-output-unstable-v1.xml wl/xdg-output-unstable-v1.h
+
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/stable/xdg-shell/xdg-shell.xml wl/xdg-shell.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/staging/pointer-warp/pointer-warp-v1.xml wl/pointer-warp-v1.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml wl/xdg-toplevel-icon-v1.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml wl/xdg-decoration-unstable-v1.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml wl/relative-pointer-unstable-v1.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml wl/pointer-constraints-unstable-v1.c
+wayland-scanner private-code $(pkg-config --variable datarootdir wayland-protocols)/wayland-protocols/unstable/xdg-output/xdg-output-unstable-v1.xml wl/xdg-output-unstable-v1.c