kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
230 stars 37 forks source link

Please try to find the pre-installed MicroTex package before fetching it #300

Closed yurivict closed 5 months ago

yurivict commented 5 months ago

here

cmake's FectContent can never work in the package builder, because downloads aren't allowed during package building. Dependencies should be either external, or bundled as git submodules.

kpeeters commented 5 months ago

The problem with using git submodules is that it requires everyone to run git submodule update --init before building, while cmake's FetchContent 'just works'. Is there a middle road that I am not aware of and which works better in combination with FreeBSD?

yurivict commented 5 months ago

Is there a middle road that I am not aware of and which works better in combination with FreeBSD?

It's not only FreeBSD. It is any sane packaging system that rebuilds packages: Debian, RedHat, OpenBSD, etc. FetchContent is fundamentally not compatible with package builder because downloads aren't allowed during the package build process for security reasons.

One way around it is to patch the project to use pre-downloaded binaries or pre-downloaded source tarballs. Another way is to patch the project to use external dependencies.

In your case MicroTex should be an external dependency. I am going to create a port for it on FreeBSD. IMO it's best to enhance your cmake scripts to first check for the pre-installed package. This is what I suggested in my original message.

kpeeters commented 5 months ago

Ok, can you please try HEAD and let me know? You will need to git submodule update --init --recursive, after which the build process should pick up that submodule instead of trying to FetchContent it.

Please do not package MicroTeX from my repo: I am not the maintainer/author, I only provided a few patches and wanted a stable URL from which to pull it.

yurivict commented 5 months ago

Please do not package MicroTeX from my repo: I am not the maintainer/author, I only provided a few patches and wanted a stable URL from which to pull it.

I've packaged https://github.com/NanoMichael/MicroTeX: https://cgit.freebsd.org/ports/tree/print/microtex

Please consider upstreaming your patches so that the users of NanoMichael/MicroTeX can also benefit from them.

kpeeters commented 5 months ago

I won't be able to use that unless you package the openmath branch of that repo and include my patches to make it build static libraries. I would advise against doing that without consulting with NanoMichael about their plans.

yurivict commented 5 months ago

The latest HEAD revision builds and works fine.