Building new package lnav

Hello
I try to build lnav (https://lnav.org/) using the ImageBuilder.
It runs on a Ubuntu 20.04.2 LTS and works fine to build an OpenWRT image including my selected packages.
For lnav I created .../package/feeds/packages/lnav/Makefile

#
# Copyright (C) 2007-2016 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:=lnav
PKG_VERSION:=0.9.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/tstack/lnav/releases/download/v${PKG_VERSION}
PKG_HASH:=03e15449a87fa511cd19c6bb5e95de4fffe17612520ff7683f2528d3b2a7238f

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/lnav
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=An advanced log file viewer for the small-scale
  URL:=https://lnav.org/
  DEPENDS:=+libncurses +libpcre +libreadline +libbz2 +libcurl +libarchive +libsqlite3 +zlib
endef

define Package/lnav/description
  An advanced log file viewer for the small-scale
  Watch and analyze your log files from a terminal.
  No server. No setup. Still featureful.
endef

define Package/lnav/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef

$(eval $(call BuildPackage,lnav))

I select lnav in 'make menuconfig' and run 'make'.
This gives me the following error:

...
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of off_t... (cached) 8
checking size of size_t... (cached) 4
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for library containing openpty... none required
checking for library containing gzseek... no
configure: error: libz required to build
make[3]: *** [Makefile:54: /home/mbu/src/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/lnav-0.9.0/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1
make[3]: Leaving directory '/home/mbu/src/openwrt/feeds/packages/utils/lnav'
time: package/feeds/packages/lnav/compile#2.84#1.35#3.90
    ERROR: package/feeds/packages/lnav failed to build.
make[2]: *** [package/Makefile:116: package/feeds/packages/lnav/compile] Error 1
make[2]: Leaving directory '/home/mbu/src/openwrt'
make[1]: *** [package/Makefile:110: /home/mbu/src/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/mbu/src/openwrt'
make: *** [/home/mbu/src/openwrt/include/toplevel.mk:230: world] Error 2

What's wrong?
Markus

sure it's the same lib ?

1 Like

I tried +zlib, +libz as well as only +z. Always the same error.

There's also libzlib...

No success. And +liblibz also does not work.
I guess I have to tell the build system somehow to tell the configure script where it will find the library. But how?

shot in the dark here, but have a look to see if the zlib-dev package is being built. I have a feeling it could be the one that providers zlib at build time.

make -j1 packages/lnav/{clean,compile} V=99

You'll be in verbose mode and may get more advice from the error...

I gave up.
After looking through the configure.log I found to problem and 'fixed' it with a manual call to configure.sh.
But later in the process another library, libgpm was missing. Unfortunately that library is not part of OpenWRT!