diff options
| author | andromeda <andromeda@lenovo> | 2026-04-26 10:39:46 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-04-26 10:39:46 +0200 |
| commit | 5029ef79ae53980584e5bd022fdb1430d9664f76 (patch) | |
| tree | 50073d056fcc3c5f81597936967fcab4196e2a1b | |
| parent | 70dd03297c941335cc19915f1140a69d2a10e150 (diff) | |
add readme, dev shell, build script
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 23 | ||||
| -rw-r--r-- | flake.nix | 25 | ||||
| -rwxr-xr-x | get_wl.sh | 16 |
4 files changed, 45 insertions, 20 deletions
@@ -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 +``` @@ -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 |
