So, this Makefile [ below ] compiles, but I did not test it on a target yet.
I had to get in front of a computer to test it.
A few bits that were missing from your initial Makefile (that were not so obvious to me initially)
you need to add either PKG_HASH or PKG_MD5SUM
PKG_SOURCE_URL did not seem correct ; i.e. the tarball is not part of the URL ; I added the short-hand version of the SF link
+libstdcpp needs to be a dependency
And the part that was obvious to me from the start was $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/7za $(1)/usr/bin/
Well, to be more accurate, it was clear that your initial path was not correct (i.e. $(INSTALL_BIN) $(PKG_BUILD_DIR)/zip $(1)/usr/bin/) because the build error in your image says No such file or directory
Personally, when I write OpenWrt/LEDE makefiles [for packages], I don't look much at the package's install rules or Makefile ; it usually ends up confusing me, more than helping.
I just look for the binary that the build produces.
In this case I looked for what the build produced in <lede>/build_dir/target-mips_24kc_musl/p7zip_16.02/
That's also to say, I'm not completely sure that this works ; but likely it might.
#
# Copyright (C) 2009-2011 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:=p7zip
PKG_VERSION:=16.02
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_src_all.tar.bz2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_HASH:=5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f
include $(INCLUDE_DIR)/package.mk
define Package/p7zip
SECTION:=utils
CATEGORY:=Utilities
TITLE:=p7zip archiver
URL:=http://http://www.7-zip.org
DEPENDS:=+libstdcpp
endef
define Package/p7zip/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/7za $(1)/usr/bin/
endef
$(eval $(call BuildPackage,p7zip))
I'm new to writing Makefile and I'm not a programmer either, how did you know it was missing dependency libstdcpp which file did you take a look at? I'm running OpenWrt CC and in my case it was also missing libpthread. After adding that one it compiled just fine and it also works just fine. Thank you for helping me out. Here's the Makefile I used to compile p7zip to openwrt CC:
#
# Copyright (C) 2009-2011 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:=p7zip
PKG_VERSION:=16.02
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_src_all.tar.bz2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_HASH:=5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f
include $(INCLUDE_DIR)/package.mk
define Package/p7zip
SECTION:=utils
CATEGORY:=Utilities
TITLE:=p7zip archiver
URL:=http://http://www.7-zip.org
DEPENDS:=+libstdcpp +libpthread
endef
define Package/p7zip/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/7za $(1)/usr/bin/
endef
$(eval $(call BuildPackage,p7zip))
I'm new to writing Makefile and I'm not a programmer either, how did you know it was missing dependency libstdcpp which file did you take a look at?
No worries ; you have time to learn.
I tested on LEDE, so I got the err from the build that libstdc++ is missing.
Not sure how much OpenWrt CC differs from LEDE trunk [where I test usually]
Regarding bsdtar, I don't know.
I wonder if installing opkg install bsdtar works ?
From the Makefile, it should be installed in /usr/bin
But, it looks like for OpenWrt CC, bsdtar is not packaged/built:
So, you could backport the change, or try a newer version of LEDE/OpenWrt.
Using the master trunk [of packages] with OpenWrt CC can be tricky ; and is usually unsupported.
You need bsdtar (which isn't built for OpenWRT) and you should really switch to LEDE in general (release or master/head/trunk). Pretty much nothing gets tested against uclibc nowdays so your milage may wary.
Is LEDE 17.01.2 pretty stable right now? I can't switch to lede yet since there are packages that aren't in the lede repository, I'll probably try to submit new packages and see if they accept them, then I'll switch to lede. I'm running OpenWrt on orange pi zero right now and the installation process is a bit of a pain in the neck since this board isn't officially supported by openwrt yet.
Umm.
I'd say that LEDE 17.01.2 is pretty stable.
I mean, just as stable OpenWrt is.
But, you could create your own packages [git] repository, put all the packages that you need there, and reference what you need from the official feeds.
And then, move stuff from your repo to the official feed as it gets accepted.
I'm not a programmer and I'm not familiar with submitting patches, if you want to add those packages to the official repo, I can give you all the Makefile of those packages.