How to change dependencies of a package

How to change dependencies of a package?

In package redsocks dependencies are written like this

TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server

I want to add iptables-nft and iptables-mod-nat-extra as dependencies in redsocks just like libevent2-core
How can I do that ?

You just add them to the depends line in Makefile and then recompile the package.


i have added dependencies like this. is this format correct ?
+iptables-mod-nat-extra \

Getting this error everytime ERROR: package/kernel/gpio-button-hotplug failed to build

hasan@debain:~/openwrt$ make package/redsocks/compile -j5 V=s
make[2]: Entering directory '/home/hasan/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/hasan/openwrt/scripts/config'
make[1]: Entering directory '/home/hasan/openwrt'
make[2]: Entering directory '/home/hasan/openwrt/package/libs/toolchain'
make[2]: Entering directory '/home/hasan/openwrt/package/kernel/gpio-button-hotplug'
make[2]: *** No rule to make target '/home/hasan/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.15.127/.config', needed by '/home/hasan/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/gpio-button-hotplug/.built'. Stop.
make[2]: Leaving directory '/home/hasan/openwrt/package/kernel/gpio-button-hotplug'
time: package/kernel/gpio-button-hotplug/compile#0.16#0.07#0.21
ERROR: package/kernel/gpio-button-hotplug failed to build.
make[1]: *** [package/Makefile:120: package/kernel/gpio-button-hotplug/compile] Error 1
make[1]: *** Waiting for unfinished jobs....
echo "libc" >> /home/hasan/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
echo "libgcc" >> /home/hasan/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
echo "libpthread" >> /home/hasan/openwrt/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/toolchain.default.install
make[2]: Leaving directory '/home/hasan/openwrt/package/libs/toolchain'
time: package/libs/toolchain/compile#0.25#0.06#0.28
make[1]: Leaving directory '/home/hasan/openwrt'
make: *** [/home/hasan/openwrt/include/ package/redsocks/compile] Error 2

Your message is not formatted as code block , so there might be line wrapping etc. by forum software. Making it harder to know what is your original line split.

In any case, the dependencies should be in the same line. (Each line is a new command/item)
And backslash \ means that the same line continues at the next line.
You apparently copied that from somewhere. Why?

Regarding button-hotplug error. That might be unrelated. That button-hotplug pops up related to some kernel packages, if you have not prepared/unpacked kernel sources in the build process. You might need to at least prepare kernel sources first, or alternatively compile the full firmware (and kernel) first.

1 Like

this is the edited redsocks dependencies code

define Package/redsocks
     +libevent2-core \
     +iptables-nft \
  TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server

Yeah, that has backslashes at every line except the last. That is right.
(That is then one long line split with backslashes)

Your own Makefile above had missing backslashes on other lines and an erroneous one on the last.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.