diff --git a/packages/compress/libarchive/package.mk b/packages/compress/libarchive/package.mk
new file mode 100644
index 0000000000..b493f8cc3f
--- /dev/null
+++ b/packages/compress/libarchive/package.mk
@@ -0,0 +1,35 @@
+################################################################################
+# This file is part of LibreELEC - https://libreelec.tv
+# Copyright (C) 2017-present Team LibreELEC
+#
+# LibreELEC is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# LibreELEC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LibreELEC. If not, see .
+################################################################################
+
+PKG_NAME="libarchive"
+PKG_VERSION="3.3.2"
+PKG_SHA256="ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce"
+PKG_ARCH="any"
+PKG_LICENSE="GPL"
+PKG_SITE="https://www.libarchive.org"
+PKG_URL="https://www.libarchive.org/downloads/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_DEPENDS_HOST="toolchain"
+PKG_DEPENDS_TARGET="toolchain"
+PKG_SECTION="compress"
+PKG_SHORTDESC="libarchive data compressor/decompressor"
+
+PKG_CMAKE_OPTS_TARGET="-DENABLE_SHARED=0 -DENABLE_STATIC=1 -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DENABLE_EXPAT=0 -DENABLE_ICONV=0 -DENABLE_LIBXML2=0 -DENABLE_LZO=1 -DENABLE_TEST=0 -DENABLE_COVERAGE=0"
+
+post_makeinstall_target() {
+ rm -rf $INSTALL
+}
diff --git a/packages/compress/libarchive/patches/libarchive-01-die-Werror.patch b/packages/compress/libarchive/patches/libarchive-01-die-Werror.patch
new file mode 100644
index 0000000000..9a831f2a2e
--- /dev/null
+++ b/packages/compress/libarchive/patches/libarchive-01-die-Werror.patch
@@ -0,0 +1,37 @@
+From f3c2f0ca7916288c72da07a2c3352b85b8f96e55 Mon Sep 17 00:00:00 2001
+From: Arne Morten Kvarving
+Date: Sat, 11 Nov 2017 23:42:40 +0100
+Subject: [PATCH] die Werror
+
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 73bf07b..08e8f49 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -96,7 +96,7 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$")
+ #################################################################
+ # Set compile flags for debug build.
+ # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
+- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
++ #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow")
+@@ -112,7 +112,7 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^Clang$")
+ # Set compile flags for debug build.
+ # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
+- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
++ #SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wextra")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wunused")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow")
+@@ -133,7 +133,7 @@
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qflag=w:w")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use")
+ ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$")
+-IF (MSVC)
++IF (0)
+ #################################################################
+ # Set compile flags for debug build.
+ # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
diff --git a/packages/compress/libarchive/patches/libarchive-02-static-please.patch b/packages/compress/libarchive/patches/libarchive-02-static-please.patch
new file mode 100644
index 0000000000..fb2bbc275a
--- /dev/null
+++ b/packages/compress/libarchive/patches/libarchive-02-static-please.patch
@@ -0,0 +1,14 @@
+--- libarchive/libarchive/CMakeLists.txt
++++ libarchive/libarchive/CMakeLists.txt
+@@ -224,9 +224,9 @@
+ ENDIF()
+
+ # Libarchive is a shared library
+-ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
++ADD_LIBRARY(archive STATIC ${libarchive_SOURCES} ${include_HEADERS})
+ TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
+-SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
++SET_TARGET_PROPERTIES(archive PROPERTIES COMPILE_DEFINITIONS LIBARCHIVE_STATIC)
+
+ # archive_static is a static library
+ ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
diff --git a/packages/compress/lz4/package.mk b/packages/compress/lz4/package.mk
new file mode 100644
index 0000000000..359797af93
--- /dev/null
+++ b/packages/compress/lz4/package.mk
@@ -0,0 +1,37 @@
+################################################################################
+# This file is part of LibreELEC - https://libreelec.tv
+# Copyright (C) 2017-present Team LibreELEC
+#
+# LibreELEC is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# LibreELEC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LibreELEC. If not, see .
+################################################################################
+
+PKG_NAME="lz4"
+PKG_VERSION="1.8.0"
+PKG_SHA256="2ca482ea7a9bb103603108b5a7510b7592b90158c151ff50a28f1ca8389fccf6"
+PKG_ARCH="any"
+PKG_LICENSE="GPL"
+PKG_SITE="https://github.com/lz4/lz4"
+PKG_URL="https://github.com/lz4/lz4/archive/v$PKG_VERSION.tar.gz"
+PKG_DEPENDS_HOST="toolchain"
+PKG_DEPENDS_TARGET="toolchain"
+PKG_SECTION="compress"
+PKG_SHORTDESC="lz4 data compressor/decompressor"
+
+PKG_CMAKE_SCRIPT="$PKG_BUILD/contrib/cmake_unofficial/CMakeLists.txt"
+
+PKG_CMAKE_OPTS_TARGET="-DBUILD_SHARED_LIBS=0 -DCMAKE_POSITION_INDEPENDENT_CODE=0"
+
+post_makeinstall_target() {
+ rm -rf $INSTALL
+}
diff --git a/packages/compress/xz/package.mk b/packages/compress/xz/package.mk
index 225b7b61bd..fbc70f8b4f 100644
--- a/packages/compress/xz/package.mk
+++ b/packages/compress/xz/package.mk
@@ -36,3 +36,9 @@ PKG_CONFIGURE_OPTS_HOST="--disable-shared --enable-static \
--enable-lzma-links \
--disable-scripts \
--disable-nls"
+
+PKG_CONFIGURE_OPTS_TARGET="--disable-shared --enable-static"
+
+post_makeinstall_target() {
+ rm -rf $INSTALL
+}
diff --git a/packages/compress/xz/patches/xz-01-init-uninitialized-variables.patch b/packages/compress/xz/patches/xz-01-init-uninitialized-variables.patch
new file mode 100644
index 0000000000..0d88880702
--- /dev/null
+++ b/packages/compress/xz/patches/xz-01-init-uninitialized-variables.patch
@@ -0,0 +1,27 @@
+From 5cd389f1fe1fe095cdf555194df875ee3ab445cf Mon Sep 17 00:00:00 2001
+From: MilhouseVH
+Date: Sun, 26 Nov 2017 22:21:15 +0000
+Subject: [PATCH] uninitialized variables build error
+
+---
+ src/liblzma/lzma/lzma_encoder.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/liblzma/lzma/lzma_encoder.c b/src/liblzma/lzma/lzma_encoder.c
+index ba9ce69..08e8c87 100644
+--- a/src/liblzma/lzma/lzma_encoder.c
++++ b/src/liblzma/lzma/lzma_encoder.c
+@@ -359,8 +359,8 @@ lzma_lzma_encode(lzma_lzma1_encoder *restrict coder, lzma_mf *restrict mf,
+ // - UINT32_MAX: not a match but a literal
+ // Value ranges for len:
+ // - [MATCH_LEN_MIN, MATCH_LEN_MAX]
+- uint32_t len;
+- uint32_t back;
++ uint32_t len = 0;
++ uint32_t back = 0;
+
+ if (coder->fast_mode)
+ lzma_lzma_optimum_fast(coder, mf, &back, &len);
+--
+2.14.1
+
diff --git a/packages/mediacenter/kodi-binary-addons/vfs.libarchive/package.mk b/packages/mediacenter/kodi-binary-addons/vfs.libarchive/package.mk
new file mode 100644
index 0000000000..c6a1f59e69
--- /dev/null
+++ b/packages/mediacenter/kodi-binary-addons/vfs.libarchive/package.mk
@@ -0,0 +1,33 @@
+################################################################################
+# This file is part of LibreELEC - https://libreelec.tv
+# Copyright (C) 2017-present Team LibreELEC
+#
+# LibreELEC is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# LibreELEC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with LibreELEC. If not, see .
+################################################################################
+
+PKG_NAME="vfs.libarchive"
+PKG_VERSION="374f0b1"
+PKG_SHA256="088b05f203c09fac324d96ab2fd1e3b3e2e88393bd60481e1a49115dac5351f0"
+PKG_REV="1"
+PKG_ARCH="any"
+PKG_LICENSE="GPL"
+PKG_SITE="http://www.kodi.tv"
+PKG_URL="https://github.com/notspiff/vfs.libarchive/archive/$PKG_VERSION.tar.gz"
+PKG_DEPENDS_TARGET="toolchain kodi-platform bzip2 libarchive lz4 lzo xz zlib"
+PKG_SECTION=""
+PKG_SHORTDESC="vfs.libarchive"
+PKG_LONGDESC="vfs.libarchive"
+
+PKG_IS_ADDON="yes"
+PKG_ADDON_TYPE="kodi.vfs"