Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -28,7 +28,7 @@ is_debug_build = get_option('buildtype').startswith('d
 cc = meson.get_compiler('c')
 
 add_project_arguments(
-  ['-D_GNU_SOURCE=200809L'] +
+  ['-D_GNU_SOURCE=200809L', '-DHAVE_STRUCT_TIMESPEC'] +
   (is_debug_build ? ['-D_DEBUG'] : []) +
   (cc.has_function('memfd_create',
                    args: ['-D_GNU_SOURCE=200809L'],
@@ -76,7 +76,7 @@ harfbuzz1 = dependency('harfbuzz', required: get_optio
 harfbuzz2 = dependency('harfbuzz', required: get_option('run-shaping'))
 utf8proc = dependency('libutf8proc', required: get_option('run-shaping'))
 pixman = dependency('pixman-1')
-stdthreads = cc.find_library('stdthreads', required: false)
+stdthreads = dependency('stdthreads', required: false)
 system_nanosvg = cc.find_library('nanosvg', required: get_option('system-nanosvg'))
 system_nanosvgrast = cc.find_library('nanosvgrast', required: get_option('system-nanosvg'))
 
