diff --git a/community/borgbackup/APKBUILD b/community/borgbackup/APKBUILD
index b2ffc235fa00e20d58ab7c116c1e520ac91bfd53..e559a7b464e1a974c2a43fbfd29bb63251794a70 100644
--- a/community/borgbackup/APKBUILD
+++ b/community/borgbackup/APKBUILD
@@ -3,8 +3,8 @@
 # Maintainer: Jakub Jirutka <jakub@jirutka.cz>
 pkgname=borgbackup
 _pkgname=borg
-pkgver=1.2.8
-pkgrel=1
+pkgver=1.4.0
+pkgrel=0
 pkgdesc="Deduplicating backup program"
 url="https://www.borgbackup.org/"
 arch="all"
@@ -58,6 +58,7 @@ export BORG_LIBLZ4_PREFIX="/usr/include"
 export BORG_LIBXXHASH_PREFIX="/usr/include"
 export BORG_LIBZSTD_PREFIX="/usr/include"
 export BORG_OPENSSL_PREFIX="/usr/include/openssl"
+export BORG_LIBACL_PREFIX="/usr/include"
 
 prepare() {
 	default_prepare
@@ -137,6 +138,6 @@ _delete_testsuite() {
 }
 
 sha512sums="
-9a62e5eec894ebffe928a08c9a0cceebde084f16524d363a3c3be01d908a7eceaea8fa11eac422acc0fdb2534d79d1ee5ec5d9167e1086f334af6a28887616d5  borgbackup-1.2.8.tar.gz
-d5aea79b8ff663ca87b845680a31ba75235f734f95a5cfa444e49813916e530754b98269bfbccfda800fbf102652ee4ed47bdb71f6cda831e76f0fae3b5433d8  test-fusermount3.patch
+f5866ece2d153d1e43127a04fd288a09403a9ea2ae4c981cb9ff855bd303b53c133c006f0b1a77541edc4f64940431e9c4d49ec45a3646784a29fe3b8828237a  borgbackup-1.4.0.tar.gz
+b79f3ab4332f0606ef4fb3b1e76c2ffd88a839dfd6d42ca21ab08904c35a6b086ad4fc52daf6e5cecc4a7103d77154fcc878f26fb97d9054651af2591f9a441b  test-fusermount3.patch
 "
diff --git a/community/borgbackup/test-fusermount3.patch b/community/borgbackup/test-fusermount3.patch
index e1e744ec7560e26a92280725e9e9102d34775097..c57f7ead3257ac1b8433c7496ad9d42f2684b259 100644
--- a/community/borgbackup/test-fusermount3.patch
+++ b/community/borgbackup/test-fusermount3.patch
@@ -3,12 +3,12 @@ which provides command fusermount3, not fusermount.
 
 --- a/src/borg/helpers/fs.py
 +++ b/src/borg/helpers/fs.py
-@@ -335,7 +335,7 @@
- def umount(mountpoint):
+@@ -351,7 +351,7 @@
+ 
      env = prepare_subprocess_env(system=True)
      try:
--        return subprocess.call(['fusermount', '-u', mountpoint], env=env)
-+        return subprocess.call(['fusermount3', '-u', mountpoint], env=env)
+-        rc = subprocess.call(['fusermount', '-u', mountpoint], env=env)
++        rc = subprocess.call(['fusermount3', '-u', mountpoint], env=env)
      except FileNotFoundError:
-         return subprocess.call(['umount', mountpoint], env=env)
- 
+         rc = subprocess.call(['umount', mountpoint], env=env)
+     set_ec(rc)