From 3aba3abbcd6a3e32ec9a0bd95529f9e19399c662 Mon Sep 17 00:00:00 2001
From: Isaac Freund <mail@isaacfreund.com>
Date: Mon, 1 Jan 2024 22:48:38 -0600
Subject: [PATCH] build: require at least wlroots 0.17.1

There are enough bugs fixed in 0.17.1 which are relevant to river that I
think it's worthwhile to refuse to compile against 0.17.1.
---
 .builds/alpine.yml    | 2 +-
 .builds/archlinux.yml | 2 +-
 .builds/freebsd.yml   | 2 +-
 README.md             | 2 +-
 river/main.zig        | 6 ++++++
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/.builds/alpine.yml b/.builds/alpine.yml
index a33be10f..3ab38c44 100644
--- a/.builds/alpine.yml
+++ b/.builds/alpine.yml
@@ -34,7 +34,7 @@ tasks:
       cd ..
 
       cd wlroots
-      git checkout 0.17.0
+      git checkout 0.17.1
       meson setup build --auto-features=enabled -Drenderers=gles2 -Dexamples=false \
             -Dwerror=false -Db_ndebug=false -Dxcb-errors=disabled --prefix /usr
       sudo ninja -C build/ install
diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml
index f4dc6889..7b89bd5f 100644
--- a/.builds/archlinux.yml
+++ b/.builds/archlinux.yml
@@ -32,7 +32,7 @@ tasks:
       cd ..
 
       cd wlroots
-      git checkout 0.17.0
+      git checkout 0.17.1
       meson setup build --auto-features=enabled -Drenderers=gles2 -Dexamples=false \
             -Dwerror=false -Db_ndebug=false --prefix /usr
       sudo ninja -C build/ install
diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml
index 367f5c0d..e1b3e815 100644
--- a/.builds/freebsd.yml
+++ b/.builds/freebsd.yml
@@ -36,7 +36,7 @@ tasks:
       cd ..
 
       cd wlroots
-      git checkout 0.17.0
+      git checkout 0.17.1
       meson setup build --auto-features=enabled -Drenderers=gles2 -Dexamples=false \
             -Dwerror=false -Db_ndebug=false --prefix /usr
       sudo ninja -C build/ install
diff --git a/README.md b/README.md
index e36f8add..81c6bd77 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ distribution.
 - [zig](https://ziglang.org/download/) 0.11
 - wayland
 - wayland-protocols
-- [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) 0.17
+- [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) 0.17.1
 - xkbcommon
 - libevdev
 - pixman
diff --git a/river/main.zig b/river/main.zig
index 54e5e778..81b558c8 100644
--- a/river/main.zig
+++ b/river/main.zig
@@ -29,6 +29,12 @@ const util = @import("util.zig");
 
 const Server = @import("Server.zig");
 
+comptime {
+    if (wlr.version.major != 0 or wlr.version.minor != 17 or wlr.version.micro < 1) {
+        @compileError("river requires at least wlroots version 0.17.1 due to bugs in wlroots 0.17.0");
+    }
+}
+
 const usage: []const u8 =
     \\usage: river [options]
     \\