OpenWrt Forum Archive

Topic: Tracking dependencies to package source with buildroot-ng?

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!

I was wondering if anybody has any suggestions how to set up buildroot-ng to do openwrt-specific development, e.g. I want to add a package to openwrt that is not a port of some existing software but rather a project from my own svn repository that is only (or almost only) meant to be an openwrt package.

I'm familiar with how the package/ system is set up (and I love it), but I'm a little uncertain how to bend it to build software that is not really a port. One way would ofcourse be to make a tarball from my repository source and use that for an openwrt package, but I'm a little woried about the "turnaround" build time for that (e.g. change my package source in my repository, build distribution tarball, touch openwrt package makefile, build openwrt) and loosing automatic dependency management.

A solution where dependencies are tracked by make all the way from my project source files to the openwrt .ipkg (or flash image) would be fantastic!

Any suggestions?

Thanx in advance!

Well, one you've Kamikaze build you don't have to do a full build again.

Add your package to packages/<category>/<pkg_name>/Makefile, select it in menuconfig and only build your new package with 'make package/pkg_name-{clean,compile} V=99'.

That's it.

forum2006 wrote:

Well, one you've Kamikaze build you don't have to do a full build again.

Add your package to packages/<category>/<pkg_name>/Makefile, select it in menuconfig and only build your new package with 'make package/pkg_name-{clean,compile} V=99'.

That's it.

Yes, that's a solution, but the "make clean ; make"-approach sort of goes against my understanding of the concept of make... It's a symtom of a rather serious buildsystem illness; dependencies are not modeled correctly.

Is there really no way to make a package depend on individual source files? If it's absolutely necessary I'm willing to take the route via a tarball that lives in the local filesystem; if the tarball has been updated (built by a separate build rule) then package xyz is out of date and needs to be rebuilt.

Anybody who can point me in the right direction?

Maybe nbd (the hardcore buildroot developer and the designer of it) can give you a better answer to your question...

(Last edited by forum2006 on 8 Jan 2007, 13:29)

We don't really expect the source tarball to change at all. It is downloaded from an upstream site and patched if necessary. If we modify the sources, we do it in the form of patches...
If you just want to try out changes to individual source files, you can change those in the temporary build directory and simply run make again (it'll detect the change and rebuild the package without an explicit clean). But don't expect those changes to last across a make clean or even package/<name>/Makefile changes.

nbd wrote:

We don't really expect the source tarball to change at all. It is downloaded from an upstream site and patched if necessary. If we modify the sources, we do it in the form of patches...
If you just want to try out changes to individual source files, you can change those in the temporary build directory and simply run make again (it'll detect the change and rebuild the package without an explicit clean). But don't expect those changes to last across a make clean or even package/<name>/Makefile changes.

Ok, thanx!

I guess I have to bend it a little to suit my needs then... A simple approach might be to change include/package.mk along these lines:

From

ifneq ($(strip $(PKG_SOURCE_URL)),)
    download: $(DL_DIR)/$(PKG_SOURCE)

    $(DL_DIR)/$(PKG_SOURCE):
                mkdir -p $(DL_DIR)
                $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)

    $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
  endif

To (pseudo)

download: $(DL_DIR)/$(PKG_SOURCE)

  ifneq ($(strip $(PKG_SOURCE_URL)),)
    $(DL_DIR)/$(PKG_SOURCE):
                mkdir -p $(DL_DIR)
                $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)

  elifneq ($strip $(PKG_SOURCE_DIR)),)
    $(DL_DIR)/$(PKG_SOURCE): $(PKG_SOURCE_DIR)/$(PKG_SOURCE)
                mkdir -p $(DL_DIR)
                cp $(PKG_SOURCE_DIR)/$(PKG_SOURCE) $(DL_DIR)/$(PKG_SOURCE)
  endif

  $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)

At least then an external build step can build a new distribution file for my code and openwrt will recognize this and do the necessary rebuilding. Does it sound like a reasonable approach?

The discussion might have continued from here.