diff --git a/.gitignore b/.gitignore
index 9d78e88..56991fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1 @@
-/waffle-1.2.3.tar.xz
-/waffle-1.3.0.tar.xz
-/waffle-1.4.0.tar.xz
-/waffle-1.4.2.tar.xz
-/waffle-1.5.0.tar.xz
-/waffle-1.5.2.tar.xz
+/waffle-*.tar.xz
diff --git a/.packit.yaml b/.packit.yaml
new file mode 100644
index 0000000..8c4a334
--- /dev/null
+++ b/.packit.yaml
@@ -0,0 +1,19 @@
+# See the documentation for more information:
+# https://packit.dev/docs/configuration/
+
+specfile_path: waffle.spec
+
+copy_upstream_release_description: false
+
+jobs:
+ - job: pull_from_upstream
+ trigger: release
+ dist_git_branches:
+ - fedora-rawhide
+
+ - job: koji_build
+ trigger: commit
+ allowed_committers: ['packit','all_admins']
+ dist_git_branches:
+ - fedora-rawhide
+
diff --git a/0001-wayland-fix-build-against-version-1.20.patch b/0001-wayland-fix-build-against-version-1.20.patch
new file mode 100644
index 0000000..01eba0d
--- /dev/null
+++ b/0001-wayland-fix-build-against-version-1.20.patch
@@ -0,0 +1,56 @@
+From 2c33597245bb74f19104f0a858cd40e80b26991d Mon Sep 17 00:00:00 2001
+From: Philipp Zabel
+Date: Fri, 17 Dec 2021 13:46:40 +0100
+Subject: [PATCH] wayland: fix build against version 1.20
+
+Wayland 1.20 introduces two new symbols wl_proxy_marshal_flags and
+wl_proxy_marshal_array_flags, which need to be wrapped as well.
+
+Closes: https://gitlab.freedesktop.org/mesa/waffle/-/issues/76
+Signed-off-by: Philipp Zabel
+---
+ src/waffle/wayland/wayland_sym.h | 18 ++++++++++++++++++
+ src/waffle/wayland/wayland_wrapper.h | 2 ++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/src/waffle/wayland/wayland_sym.h b/src/waffle/wayland/wayland_sym.h
+index 3d48625..4c6ac8d 100644
+--- a/src/waffle/wayland/wayland_sym.h
++++ b/src/waffle/wayland/wayland_sym.h
+@@ -26,3 +26,21 @@ WAFFLE_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor,
+ WAFFLE_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_constructor_versioned,
+ (struct wl_proxy *proxy, uint32_t opcode,
+ const struct wl_interface *interface, uint32_t version, ...))
++
++WAFFLE_WAYLAND_SYM(struct wl_proxy *,
++ wl_proxy_marshal_flags,
++ (struct wl_proxy * p,
++ uint32_t opcode,
++ const struct wl_interface *interface,
++ uint32_t version,
++ uint32_t flags,
++ ...))
++
++WAFFLE_WAYLAND_SYM(struct wl_proxy *,
++ wl_proxy_marshal_array_flags,
++ (struct wl_proxy * p,
++ uint32_t opcode,
++ const struct wl_interface *interface,
++ uint32_t version,
++ uint32_t flags,
++ union wl_argument *args))
+diff --git a/src/waffle/wayland/wayland_wrapper.h b/src/waffle/wayland/wayland_wrapper.h
+index 4af2f64..6addf4f 100644
+--- a/src/waffle/wayland/wayland_wrapper.h
++++ b/src/waffle/wayland/wayland_wrapper.h
+@@ -65,5 +65,7 @@ struct wl_display;
+ #define wl_proxy_marshal (*wfl_wl_proxy_marshal)
+ #define wl_proxy_marshal_constructor (*wfl_wl_proxy_marshal_constructor)
+ #define wl_proxy_marshal_constructor_versioned (*wfl_wl_proxy_marshal_constructor_versioned)
++#define wl_proxy_marshal_flags (*wfl_wl_proxy_marshal_flags)
++#define wl_proxy_marshal_array_flags (*wfl_wl_proxy_marshal_array_flags)
+
+ #include
+--
+2.39.1
+
diff --git a/fix-bash.patch b/fix-bash.patch
new file mode 100644
index 0000000..7c47b6b
--- /dev/null
+++ b/fix-bash.patch
@@ -0,0 +1,12 @@
+diff -up waffle-v1.7.0-905c6c10f2483adf0cbfa024e2d3c2ed541fb300/CMakeLists.txt.dma waffle-v1.7.0-905c6c10f2483adf0cbfa024e2d3c2ed541fb300/CMakeLists.txt
+--- waffle-v1.7.0-905c6c10f2483adf0cbfa024e2d3c2ed541fb300/CMakeLists.txt.dma 2023-02-02 11:51:13.882733065 +1000
++++ waffle-v1.7.0-905c6c10f2483adf0cbfa024e2d3c2ed541fb300/CMakeLists.txt 2023-02-02 11:51:17.724792923 +1000
+@@ -195,7 +195,7 @@ endif()
+
+ install(
+ FILES "shell-completion/bash/wflinfo"
+- DESTINATION "${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}"
++ DESTINATION "${BASH_COMPLETION_COMPLETIONSDIR}"
+ COMPONENT shell-completion
+ )
+
diff --git a/sources b/sources
index 728941e..bf7ea39 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c669c91bf2f7e13a5d781c3dbb30fd8c waffle-1.5.2.tar.xz
+SHA512 (waffle-1.8.3.tar.xz) = 6c320e3bab223075da8c4b1a32a24ad857143481f58ab1a39c4e6ace869c5e802cd768cd6186b28abe47c273994188be2b943e5c9fa156941dc5695316859d05
diff --git a/waffle.spec b/waffle.spec
index 29872c3..0201ab9 100644
--- a/waffle.spec
+++ b/waffle.spec
@@ -1,31 +1,27 @@
-%if 0%{?fedora} >= 20 && 0%{?rhel} > 7
-%bcond_with wayland
-%else
-%bcond_without wayland
-%endif
-
Name: waffle
-Version: 1.5.2
-Release: 9%{?dist}
+Version: 1.8.3
+Release: %autorelease
Summary: Platform independent GL API layer
-Group: Development/Libraries
License: MIT
URL: http://www.waffle-gl.org/releases.html
-Source0: http://www.waffle-gl.org/files/release/%{name}-%{version}/%{name}-%{version}.tar.xz
+Source0: https://gitlab.freedesktop.org/mesa/waffle/-/archive/v%{version}/waffle-%{version}.tar.xz
-BuildRequires: cmake libxslt docbook-style-xsl libxcb-devel gcc
-BuildRequires: libX11-devel mesa-libGL-devel mesa-libGLU-devel
-BuildRequires: chrpath
-BuildRequires: mesa-libEGL-devel
-%if 0%{?rhel} > 6 || 0%{?fedora} > 0
-BuildRequires: mesa-libGLES-devel
-BuildRequires: systemd-devel
-%endif
-BuildRequires: mesa-libgbm-devel
-%if %{with wayland}
-BuildRequires: wayland-devel libwayland-client-devel mesa-libwayland-egl-devel
-%endif
+BuildRequires: cmake
+BuildRequires: docbook-style-xsl
+BuildRequires: gcc
+BuildRequires: gcc-c++
+BuildRequires: libX11-devel
+BuildRequires: libxcb-devel
+BuildRequires: libxslt
+BuildRequires: mesa-libEGL-devel
+BuildRequires: mesa-libGL-devel
+BuildRequires: mesa-libGLES-devel
+BuildRequires: mesa-libgbm-devel
+BuildRequires: meson
+BuildRequires: ninja-build
+BuildRequires: wayland-devel
+BuildRequires: wayland-protocols-devel
%description
Waffle is a cross-platform C library that allows one to defer
@@ -34,7 +30,6 @@ selection of GL API and of window system until runtime.
%package devel
Summary: Development headers and libraries for %{name}
-Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
@@ -43,17 +38,15 @@ Contains the header files, and libraries required for development of
%package doc
Summary: Documentation for %{name}
-Group: Documentation
Requires: %{name}%{?_isa} = %{version}-%{release}
%description doc
Contains HTML version of the developer documentation for development of
-%{name}-related software (manpages are in the -devel package).
+%{name}-related software (man pages are in the -devel package).
%package examples
Summary: Example programs using %{name}
-Group: Development/Tools
Requires: %{name}%{?_isa} = %{version}-%{release}
%description examples
@@ -61,52 +54,46 @@ Example programs using %{name}.
%prep
-%setup -q
+%autosetup -p1
+ln -sf waffle-1.5.0.txt doc/release-notes/waffle-1.5.0-rc2.txt
%build
-%cmake \
- -DCMAKE_INSTALL_DOCDIR:PATH=%{_defaultdocdir}/%{name}-%{version} \
- -DCMAKE_BUILD_STRIP=FALSE \
- -Dwaffle_has_glx=1 -Dwaffle_has_gbm=1 \
-%if %{with wayland}
- -Dwaffle_has_wayland=1 \
-%endif
- -Dwaffle_build_manpages=1 -Dwaffle_build_htmldocs=1 .
+%meson -Dbuild-manpages=true
+%meson_build
-make VERBOSE=1 %{?_smp_mflags}
-
-# We don’t want to install binary files in %%docdir
-rm -rf examples/CMakeFiles
%install
-make install DESTDIR=%{buildroot}
-# Fedora now uses unversioned doc dirs, make install shouldn’t try to
+%meson_install
+# Fedora now uses unversioned doc dirs, make install shouldn't try to
# install there anyway.
rm -rf %{buildroot}%{_docdir}/%{name}*
-%postun -p /sbin/ldconfig
-
-%post -p /sbin/ldconfig
+%check
+%meson_test
%files
-%doc README.txt LICENSE.txt
-%{_libdir}/lib%{name}*.so.*
+%license LICENSE.txt
+%doc README.md
%{_bindir}/wflinfo
+%{_libdir}/lib%{name}-1.so.0*
+%{_datadir}/bash-completion/completions/wflinfo
+%{_datadir}/zsh/site-functions/_wflinfo
+%{_mandir}/man1/wflinfo.1*
%files doc
%doc doc/html/
%files devel
%doc doc/release-notes/
-%{_includedir}/waffle*
-%{_libdir}/lib%{name}*.so
-%{_libdir}/pkgconfig/%{name}*
-%{_datadir}/cmake/Modules/FindWaffle.cmake
-%{_libdir}/cmake/Waffle/*
-%{_mandir}/man*/*
+%{_includedir}/waffle-1/
+%{_libdir}/lib%{name}-1.so
+%{_libdir}/pkgconfig/%{name}-1.pc
+%{_libdir}/cmake/Waffle/
+%{_mandir}/man3/waffle*.3*
+%{_mandir}/man7/waffle*.7*
%files examples
@@ -114,84 +101,4 @@ rm -rf %{buildroot}%{_docdir}/%{name}*
%changelog
-* Sat Jul 14 2018 Fedora Release Engineering - 1.5.2-9
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
-
-* Tue Feb 20 2018 Matěj Cepl - 1.5.2-8
-- Add BuildRequires gcc per new PG.
-
-* Fri Feb 09 2018 Fedora Release Engineering - 1.5.2-7
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
-
-* Thu Aug 03 2017 Fedora Release Engineering - 1.5.2-6
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
-
-* Thu Jul 27 2017 Fedora Release Engineering - 1.5.2-5
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
-
-* Sat Feb 11 2017 Fedora Release Engineering - 1.5.2-4
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
-
-* Mon Feb 29 2016 Peter Robinson 1.5.2-3
-- Fix Wayland conditionals so it's enabled in Fedora
-
-* Fri Feb 05 2016 Fedora Release Engineering - 1.5.2-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
-
-* Wed Sep 09 2015 Dave Airlie 1.5.2-1
-- 1.5.2 release
-
-* Fri Jun 19 2015 Fedora Release Engineering - 1.5.0-4
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
-
-* Mon Jan 5 2015 Matěj Cepl - 1.5.0-3
-- Make package building on RHEL-6.
-
-* Mon Jan 05 2015 Matej Cepl - 1.5.0-2
-- Package examples again.
-
-* Tue Dec 16 2014 Dave Airlie 1.5.0-1
-- 1.5.0 release
-
-* Thu Dec 04 2014 Matej Cepl - 1.4.2-2
-- Merge with master.
-- Patch out commit 92116dae to make building possible on cmake < 2.8.12.
-
-* Thu Dec 04 2014 Matej Cepl - 1.4.2-1
-- Upstream release (#1161826)
-
-* Tue Sep 23 2014 Matěj Cepl - 1.4.0-1
-- Upgreade to the latest upstream release (RHBZ# 1145481)
-
-* Tue Sep 23 2014 Matej Cepl - 1.3.0-5
-- Apply patch to make GBM work on f21 as well.
-
-* Tue Sep 23 2014 Matěj Cepl - 1.3.0-4
-- Enable GBM and Wayland options as well.
-
-* Mon Aug 18 2014 Fedora Release Engineering - 1.3.0-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
-
-* Sun Jun 08 2014 Fedora Release Engineering - 1.3.0-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
-
-* Tue Oct 01 2013 Matěj Cepl - 1.3.0-1
-- Upstream release.
-
-* Fri Sep 27 2013 Matěj Cepl - 1.2.3-4
-- And even more fixes (switch on man and HTML doc generation).
-
-* Thu Sep 26 2013 Matěj Cepl - 1.2.3-3
-- Fix even more errors indicated by the package review.
-
-* Mon Aug 26 2013 Matěj Cepl - 1.2.3-2
-- Fix errors indicated by the package review.
-
-* Sat Aug 24 2013 Matěj Cepl - 1.2.3-1
-- New upstream release.
-
-* Thu Nov 15 2012 Matěj Cepl - 1.2.0-1
-- Upstream upgrade.
-
-* Fri Oct 19 2012 Matěj Cepl - 1.1.1-1
-- First experimental build.
+%autochangelog