* [Buildroot] Package with dependency with another git
@ 2018-08-23 15:32 lpdev at cordier.org
2018-08-23 16:35 ` Baruch Siach
2018-08-23 16:36 ` Yann E. MORIN
0 siblings, 2 replies; 3+ messages in thread
From: lpdev at cordier.org @ 2018-08-23 15:32 UTC (permalink / raw)
To: buildroot
Hi,
Currently adding a new package to buildroot, I have a package "A" that fetch its sources on git, and is a cmake-package. This package A also require another git repo "B" to be fetched, and a CMake a path in _CONF_OPTS that points to repo "B" must be added.
My solution was to create a new package "B" on which package "A" depends on, and use generic-package with no build rules. Buildroot is taking care of fetching the sources automatically then.
However I did not find any way to point on build directory of package B from packagea.mk. Package build are named with the following: package_name-version. I am currently pointing to the path manually in my script like this:
PACKAGEA_CONF_OPTS +=? -DREPOB_DIR=$(BUILD_DIR)/packageb-$(PACKAGEB_VERSION)/
My questions are:
- Is it a good practice to do this?
- Is it a good practice to create a package that only fetch sources?
- Is there any variable to point to the build dir of a specific package?
- Would it be better to add a pre-configure in packagea.mk hook that calls git and fetch the repo B?
Thank you for you help.
BR,
Louis-Paul CORDIER
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180823/70e6c207/attachment.html>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] Package with dependency with another git
2018-08-23 15:32 [Buildroot] Package with dependency with another git lpdev at cordier.org
@ 2018-08-23 16:35 ` Baruch Siach
2018-08-23 16:36 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2018-08-23 16:35 UTC (permalink / raw)
To: buildroot
Hi Louis-Paul,
lpdev at cordier.org writes:
> Currently adding a new package to buildroot, I have a package "A" that
> fetch its sources on git, and is a cmake-package. This package A also
> require another git repo "B" to be fetched, and a CMake a path in
> _CONF_OPTS that points to repo "B" must be added.
>
> My solution was to create a new package "B" on which package "A"
> depends on, and use generic-package with no build rules. Buildroot is
> taking care of fetching the sources automatically then.
>
> However I did not find any way to point on build directory of package
> B from packagea.mk. Package build are named with the following:
> package_name-version. I am currently pointing to the path manually in
> my script like this:
>
> PACKAGEA_CONF_OPTS += -DREPOB_DIR=$(BUILD_DIR)/packageb-$(PACKAGEB_VERSION)/
You can use $(PACKAGEB_DIR) instead.
> My questions are:
>
> - Is it a good practice to do this?
> - Is it a good practice to create a package that only fetch sources?
Sometimes you have no other choice.
> - Is there any variable to point to the build dir of a specific
> package?
See above.
> - Would it be better to add a pre-configure in packagea.mk hook that
> calls git and fetch the repo B?
Don't do that. It would circumvent the Buildroot package download
infrastructure.
> Thank you for you help.
You can see the example of the boot/mv-ddr-marvell package that is a
source dependency of a certain version of arm-trusted-firmware. See
boot/mv-ddr-marvell/mv-ddr-marvell.mk and
boot/arm-trusted-firmware/arm-trusted-firmware.mk.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] Package with dependency with another git
2018-08-23 15:32 [Buildroot] Package with dependency with another git lpdev at cordier.org
2018-08-23 16:35 ` Baruch Siach
@ 2018-08-23 16:36 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2018-08-23 16:36 UTC (permalink / raw)
To: buildroot
Louis-Paul, All,
On 2018-08-23 17:32 +0200, lpdev at cordier.org spake thusly:
> Currently adding a new package to buildroot, I have a package "A" that fetch its sources on git, and is a cmake-package. This
> package A also require another git repo "B" to be fetched, and a CMake a path in _CONF_OPTS that points to repo "B" must be added.
Meh... Not nice...
> My solution was to create a new package "B" on which package "A" depends on, and use generic-package with no build rules. Buildroot
> is taking care of fetching the sources automatically then.
>
> However I did not find any way to point on build directory of package B from packagea.mk. Package build are named with the
> following: package_name-version. I am currently pointing to the path manually in my script like this:
>
> PACKAGEA_CONF_OPTS +=? -DREPOB_DIR=$(BUILD_DIR)/packageb-$(PACKAGEB_VERSION)/
>
> My questions are:
>
> - Is it a good practice to do this?
Well, you basically have no other choice, unless you are also in charge
of said packages, in which case maybe having B as a git-submodule of A
could make things a bit easier...
Does B provide a library?
Can B be installed on its own?
Can A be told to use a pre-install B?
> - Is it a good practice to create a package that only fetch sources?
Good practice, not really. But not bad either. We have a few such
packages, which are then used to provide extensions to the linux kernel.
See for example package/aufs/aufs.mk
> - Is there any variable to point to the build dir of a specific package?
$($(PKGNAME)_SRCDIR)
... where you'd replace $(PKGNA<ME) with the name of package B in your
case.
> - Would it be better to add a pre-configure in packagea.mk hook that calls git and fetch the repo B?
Nope, otherwise you'd side-track Buildroot download infra, which alows
doing off-line builds:
$ make source
[get coffee and wait]
[unplug network]
$ make
[should succeed]
Regards,
Yann E. MORIN.
> Thank you for you help.
>
> BR,
> Louis-Paul CORDIER
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-23 16:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23 15:32 [Buildroot] Package with dependency with another git lpdev at cordier.org
2018-08-23 16:35 ` Baruch Siach
2018-08-23 16:36 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox