kpeeters / cadabra2

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

Failing 'rm' commands during installation #80

Closed yurivict closed 5 years ago

yurivict commented 6 years ago
-- Installing: /usr/ports/math/cadabra2/work/stage/usr/local/share/icons/hicolor/64x64/apps
-- Installing: /usr/ports/math/cadabra2/work/stage/usr/local/share/icons/hicolor/256x256/apps
-- Installing: /usr/ports/math/cadabra2/work/stage/usr/local/share/icons/hicolor/scalable/apps
rm: /usr/local/share/applications/cadabra2-gtk.desktop: Permission denied
rm: /usr/local/share/icons/hicolor/64x64/apps/cadabra2-gtk.png: Permission denied
rm: /usr/local/share/icons/hicolor/128x128/apps/cadabra2-gtk.png: Permission denied
rm: /usr/local/share/icons/hicolor/256x256/apps/cadabra2-gtk.png: Permission denied
rm: /usr/local/share/icons/hicolor/scalable/apps/cadabra2-gtk.svg: Permission denied
-- Installing: /usr/ports/math/cadabra2/work/stage/usr/local/bin/cadabra2-gtk
-- Set runtime path of "/usr/ports/math/cadabra2/work/stage/usr/local/bin/cadabra2-gtk" to "/usr/local/lib"
-- Installing: /usr/ports/math/cadabra2/work/stage/usr/local/share/cadabra2/images/cadabra2-gtk.png

Build can't touch anything under ${PREFIX}, only under ${DESTDIR}${PREFIX}.

kpeeters commented 6 years ago

Again a compromise between doing things right and making things actually work. These 'rm' commands are there to clean up old installs which did the wrong thing. It's easier for me to be slightly sloppy than to reply to loads of confused newbies.

I have wrapped this in a if(NOT PACKAGING_MODE) now to at least be nice when building binary packages.

yurivict commented 6 years ago

But you 'rm' in wrong directories. It doesn't install into /usr/local. It installs into /usr/ports/math/cadabra2/work/stage/usr/local.

So there are 2 problems:

kpeeters commented 6 years ago

At some point in the past (don't ask me when) it installed in /usr/local because of an incorrect cmake script. These lines are trying their best to repair that. There's something similar happening in core/CMakeLists.txt where I rm the cadabra2.so module from the python site path (we used to install there, but it leads to endless trouble, so we now just set the PYTHONPATH, but we still need to remove any leftovers from a previous install). I'll add '-f' though.

kpeeters commented 6 years ago

Actually, '-f' is already there.

yurivict commented 6 years ago

Direct writes into /usr/local are considered to be a violation and builds fail because of this in the FreeBSD package builder. This one probably won't trigger it, because it removes nonexistent files.