diff --git a/srcpkgs/libostree/patches/musl-fixes.patch b/srcpkgs/libostree/patches/musl-fixes.patch
index 4268530cf28..adc34185926 100644
--- a/srcpkgs/libostree/patches/musl-fixes.patch
+++ b/srcpkgs/libostree/patches/musl-fixes.patch
@@ -1,20 +1,16 @@
---- src/libostree/ostree-repo.c
-+++ src/libostree/ostree-repo.c
-@@ -42,6 +42,7 @@
-
- #include <locale.h>
- #include <glib/gstdio.h>
-+#include <sys/file.h>
-
- /**
-  * SECTION:ostree-repo
---- src/libostree/ostree-sysroot.c
-+++ src/libostree/ostree-sysroot.c
-@@ -21,6 +21,7 @@
- #include "config.h"
-
- #include "otutil.h"
-+#include <sys/file.h>
- #include <sys/mount.h>
- #include <sys/wait.h>
-
+--- config.h.in.orig
++++ config.h.in
+@@ -154,3 +154,13 @@
+ 
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
+ #undef _POSIX_SOURCE
++
++/* taken from glibc unistd.h and fixes musl */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++  (__extension__                                                              \
++    ({ long int __result;                                                     \
++       do __result = (long int) (expression);                                 \
++       while (__result == -1L && errno == EINTR);                             \
++       __result; }))
++#endif
diff --git a/srcpkgs/libostree/patches/musl-macros.patch b/srcpkgs/libostree/patches/musl-macros.patch
deleted file mode 100644
index 77055619f3c..00000000000
--- a/srcpkgs/libostree/patches/musl-macros.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- config.h.in.orig
-+++ config.h.in
-@@ -154,3 +154,12 @@
-
- /* Define to 1 if you need to in order for `stat' and other things to work. */
- #undef _POSIX_SOURCE
-+
-+#ifndef TEMP_FAILURE_RETRY
-+#define TEMP_FAILURE_RETRY(expression) \
-+  (__extension__                                                              \
-+    ({ long int __result;                                                     \
-+       do __result = (long int) (expression);                                 \
-+       while (__result == -1L && errno == EINTR);                             \
-+       __result; }))
-+#endif
diff --git a/srcpkgs/libostree/template b/srcpkgs/libostree/template
index 001a0d5b361..587b94706ab 100644
--- a/srcpkgs/libostree/template
+++ b/srcpkgs/libostree/template
@@ -1,6 +1,6 @@
 # Template file for 'libostree'
 pkgname=libostree
-version=2017.3
+version=2017.5
 revision=1
 build_style=gnu-configure
 configure_args="--with-builtin-grub2-mkconfig --with-openssl"
@@ -12,7 +12,7 @@ maintainer="Duncaen <duncaen@voidlinux.eu>"
 license="GPL-2"
 homepage="https://ostree.readthedocs.io/en/latest/"
 distfiles="https://github.com/ostreedev/ostree/releases/download/v${version}/libostree-${version}.tar.xz"
-checksum=15e8d2956449c860bd404a2defb1f43a18cf9c4a4e27827b28d467ecf3eaba44
+checksum=3fc89a5b6eff74bc55469175b6f6e42f1bf1d9814d285e86565635e8438d20e8
 
 libostree-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"