Build an OpenWrt single package

Hola Everyone

I am new to building packages in openwrt ...

I would like to port neofetch to openwrt and compile it for openwrt devices..

Here is my repository:

Now I only have a makefile but how can I compile it for openwrt devices and publish it on OpenWRT's package repository?

I will use Ubuntu for building them

Thanks in advance !!

Please give more explanation I need detailed help

trial and error ?

ask questions when/where you stumble and fall ?

Where shall I put the makefile and how to build it

check the package policy guide link on top of that page....

I think this will take long

I followed this guide but getting some errors :slightly_frowning_face:


H

I followed this guide but getting some errors :slightly_frowning_face:

I followed this guide btw :,

Some of these are unusual (bash ?), some are expected:

General advice is to make sure feeds are updated.

I did but what's next ?

I need a lot of help in this

Assuming you created the hello world package (and tested it ok)…

Can you please share the diffconfig and Makefile?

Sure

Key issue is the absence of bash (as you already noticed), just take it out of the Makefile, as - according to your github - you're planning to install it separately anyhow.
Also, your make syntax in the Makefile seems problematic:

make[2]: Entering directory '/home/sdc/source/mypackages/examples/neofetch'
touch /home/sdc/source/build_dir/target-mips_24kc_musl/neofetch-v1.0/.prepared_cf2d887f9092e80383c7c1bb7b82486e_6664517399ebbbc92a37c5bb081b5c53_check
if [ -n `ls /home/sdc/source/build_dir/target-mips_24kc_musl/neofetch-v1.0/shadowtunnel-v1.0/v1.0/neofetch` ]
bash: -c: line 1: syntax error: unexpected end of file

As this is only an installation only of a ready-made script, it's just about the Makefile actually copying stuff... should be quite feasible.

This is old makefile from a deleted repository on github trying to remake it will be helpful if you can pr

Here you go:

diff /tmp/package/Makefile  mypackages/examples/neofetch/Makefile
15d14
<       DEPENDS:=+bash
27,38c26,27
<       if [ -n `ls $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch` ]
<       then
<               cd $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch/
<               git pull
<               rm -f !(neofetch)
<               chmod +x neofetch
<       else
<               git clone https://github.com/dylanaraps/neofetch.git $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch
<               cd $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch/
<               rm -f !(neofetch)
<               chmod +x neofetch
<       fi
---
>       git clone https://github.com/dylanaraps/neofetch.git $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch
>       chmod +x $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch/neofetch
49c38
<       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ $(1)/usr/bin/
---
>       $(INSTALL_BIN) $(PKG_BUILD_DIR)/shadowtunnel-$(PKG_VERSION)/$(PKG_VERSION)/neofetch/neofetch $(1)/usr/bin/

Stripped the 'fancy' stuff for you and actually set some arguments correctly.

Should result in :

ls -la /home/sdc/source/bin/packages/mips_24kc/mypackages
total 116
drwxr-xr-x 1 sdc users   210 Oct 29 16:16 .
drwxr-xr-x 1 sdc users    28 Sep 18 10:36 ..
-rw-r--r-- 1 sdc users 97016 Oct 29 16:16 neofetch_v1.0_mips_24kc.ipk
-rw-r--r-- 1 sdc users   294 Sep 26 15:36 Packages
-rw-r--r-- 1 sdc users   235 Sep 26 15:36 Packages.gz
-rw-r--r-- 1 sdc users   384 Sep 26 15:36 Packages.manifest
-rw-r--r-- 1 sdc users   151 Sep 26 15:36 Packages.sig
2 Likes

Brother if you don't mind can you send me the commands how you built this package ?

make package/neofetch/compile V=s

1 Like