From 32e99ed06972e4295cec7ae57b2c55eb63566461 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Mon, 28 Nov 2022 17:32:11 -0800 Subject: [PATCH] tools/lzop: add `lzop` binaries Depends: `tools/liblzo` `lzop` is the standard executable for LZO compression the initramfs generator offers the LZO option but there was no executable to support it actually working Signed-off-by: Tony Butler --- tools/Makefile | 5 +++ tools/lzop/Makefile | 33 +++++++++++++++++++ ...1-add-cmake-ENABLE_DOCS-configurable.patch | 24 ++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tools/lzop/Makefile create mode 100644 tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch diff --git a/tools/Makefile b/tools/Makefile index 67b09f3a803..a8044dcf1fe 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,6 +23,9 @@ endif ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),) BUILD_LZ4_TOOLS = y endif +ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),) + BUILD_LZO_TOOLS = y +endif tools-y += autoconf tools-y += autoconf-archive @@ -66,6 +69,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS),y) += liblzo tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_B43_TOOLS),y) += b43-tools tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_ISL),y) += isl tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZ4_TOOLS),y) += lz4 +tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs @@ -99,6 +103,7 @@ $(curdir)/liblzo/compile := $(curdir)/cmake/compile $(curdir)/libressl/compile := $(curdir)/pkgconf/compile $(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/missing-macros/compile $(curdir)/lzma-old/compile := $(curdir)/zlib/compile +$(curdir)/lzop/compile := $(curdir)/cmake/compile $(curdir)/liblzo/compile $(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile $(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile $(curdir)/meson/compile := $(curdir)/ninja/compile diff --git a/tools/lzop/Makefile b/tools/lzop/Makefile new file mode 100644 index 00000000000..65bd7fe67c1 --- /dev/null +++ b/tools/lzop/Makefile @@ -0,0 +1,33 @@ +# +# Copyright (C) 2022 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lzop +PKG_VERSION:=1.04 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.lzop.org/download/ +PKG_HASH:=7e72b62a8a60aff5200a047eea0773a8fb205caf7acbe1774d95147f305a2f41 + +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=COPYING + +CMAKE_BINARY_SUBDIR:=openwrt-build + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk + +CMAKE_HOST_OPTIONS += \ + -DENABLE_DOCS=ON \ + -DBUILD_TESTING=OFF + +define Host/Uninstall + rm -f $(STAGING_DIR_HOST)/bin/lzop +endef + +$(eval $(call HostBuild)) diff --git a/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch b/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch new file mode 100644 index 00000000000..01ebd33a399 --- /dev/null +++ b/tools/lzop/patches/001-add-cmake-ENABLE_DOCS-configurable.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt 2017-08-10 04:19:45.000000000 -0700 ++++ b/CMakeLists.txt 2022-11-28 17:21:03.453548350 -0800 +@@ -50,6 +50,9 @@ + + project(lzop VERSION 1.04 LANGUAGES C) + ++# configuration options ++option(ENABLE_DOCS "Install documentation." ON) ++ + # install directories + if(NOT CMAKE_INSTALL_PREFIX) + message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined.") +@@ -186,9 +189,11 @@ + + install(TARGETS lzop DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}") + ++if(ENABLE_DOCS) + set(f AUTHORS COPYING NEWS README THANKS doc/lzop.html doc/lzop.man doc/lzop.pod doc/lzop.ps doc/lzop.tex doc/lzop.txt) + install(FILES ${f} DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}") + install(FILES doc/lzop.1 DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man1") ++endif() # ENABLE_DOCS + + endif() # CMAKE_INSTALL_FULL_LIBDIR +