haikuports / haikuporter

The tool that builds HaikuPorts recipes.
MIT License
41 stars 44 forks source link

data packages in secondary arch builds are not declared as arch-independent #84

Closed fbrosson closed 6 years ago

fbrosson commented 8 years ago

Consider freedroidrpg-0.15.1.recipe in haikuports/games-rpg/freedroidrpg. It's an architecture-dependent port, but it has a data sub-package. Building it on any supported primary arch (x86 or x86_gcc4) produces the main arch-dependent package as well as the data package (freedroidrpg_data-0.15.1-2-any.hpkg) which is correctly declared as arch-independent.

Now, on x86_gcc2, freedroidrpg can only be built for x86 as secondary arch. The recipe has this bloc that describes the data "sub-package":

SUMMARY_data="Data files for the game FreedroidRPG"
ARCHITECTURES_data="any"

PROVIDES_data="
    freedroidrpg_data = $portVersion
    "
REQUIRES_data="
    haiku
    "

Well, instead of creating freedroidrpg_x86_data-0.15.1-2-any.hpkg is creates freedroidrpg_x86_data-0.15.1-2-x86_gcc2.hpkg.

There are several other packages which have both an arch-depedent main package and one (or more) arch-independent sub-packages, but the only one that has support for secondary architectures is freedroidrpg. To tell the truth I did not try to build this port because it is really big. Instead I have played with 2 tiny packages which I have modified on a local clone for testing purposes.

Adding this to daa2iso:

SUMMARY_doc="Doc for DAA2ISO"
ARCHITECTURES_doc="any"
PROVIDES_doc="
    daa2iso_doc = $portVersion
    "
REQUIRES_doc="
    haiku
    "

(as well as a packageEntries doc $documentationDir in INSTALL()) allows to create a real arch-independent daa2iso_doc sub-package.

Unfortunately, with uif2iso, adding a similar bloc:

SUMMARY_doc="Doc for UIF2ISO"
ARCHITECTURES_doc="any"
PROVIDES_doc="
    uif2iso_doc = $portVersion
    "
REQUIRES_doc="
    haiku
    "

(with the same packageEntries doc $documentationDir in INSTALL()) produces uif2iso_x86_doc-0.1.7c-2-x86_gcc2.hpkg instead of the expected uif2iso_x86_doc-0.1.7c-2-any.hpkg when building uif2iso_x86.

I've hit this problem while updating gnutls to 3.4.10 (https://github.com/haikuports/haikuports/pull/505) and found a workaround but it was not light enough to be merged.

I suppose this is either a bug or a known limitation. I also understand that freedroidrdp is currently the only package that would benefit from fixing this limitation. I have tried several variations (like also defining SECONDARY_ARCHITECTURES_doc="any") but none worked. BTW, I'm creating this issue because @korli asked me to do so in this message: https://github.com/haikuports/haikuports/pull/505#issuecomment-196179796 Kind regards,

pulkomandy commented 8 years ago

We should do this in a different way anyway. As an example, the openttd recipes shows how it could be done. There are separate recipes for the data packages (openttd_sfx, etc) and for the code. This way the data packages can be built on any arch separately from the code. And if possible (if the upstream has packaged their sources only, without the data), we can build the sources with a much smaller download.

fbrosson commented 8 years ago

OK

fbrosson commented 6 years ago

I'm closing this issue because a recipe should not even try to make data packages when haikuporter is building a recipe for a secondary arch. Data packages should only be created, if any, during primary arch builds.

(Sorry folks, I should have closed this issue a long time ago!)