aardappel / treesheets

TreeSheets : Free Form Data Organizer (see strlen.com/treesheets)
zlib License
2.62k stars 192 forks source link

"make install" installs things in quite unusual locations #133

Closed probonopd closed 5 years ago

probonopd commented 5 years ago

make install installs things in quite unusual locations.

When using

      cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
      make -j$(nproc)
      make DESTDIR=appdir -j$(nproc) install ; find appdir/

I would expect to get something like

appdir/usr/bin/treeshets
appdir/usr/share/treeshets/docs/...
appdir/usr/share/treeshets/examples/...
appdir/usr/share/applications/treeshets.desktop
appdir/usr/share/icons/hicolor/scalable/apps/treesheets.svg
...

but this is what actually happens:

appdir/
appdir/usr
appdir/usr/docs
appdir/usr/docs/file_format_spec.txt
appdir/usr/docs/history.txt
appdir/usr/docs/tutorial.html
appdir/usr/docs/script_reference.html
appdir/usr/docs/donations.html
appdir/usr/docs/screenshots.html
appdir/usr/docs/images
appdir/usr/docs/images/screenshots
appdir/usr/docs/images/screenshots/screenshot_tutorial.png
appdir/usr/docs/images/screenshots/screenshot_personel.png
appdir/usr/docs/images/screenshots/screenshot_todo_linux.png
appdir/usr/docs/images/screenshots/screenshot_todo.png
appdir/usr/docs/images/screenshots/screenshot_todo_half.png
appdir/usr/docs/images/screenshots/screenshot_tutorial2.png
appdir/usr/docs/images/screenshots/screenshot_sales.png
appdir/usr/docs/images/screenshots/screenshot_todo_mac.png
appdir/usr/docs/images/screenshots/screenshot_unicode.png
appdir/usr/docs/images/excl.png
appdir/usr/docs/images/check.png
appdir/usr/docs/images/treesheets_logo.png
appdir/usr/docs/images/stop.png
appdir/usr/docs/images/documentation
appdir/usr/docs/images/documentation/textsize.png
appdir/usr/docs/images/documentation/edit.png
appdir/usr/docs/images/documentation/gridsel1.png
appdir/usr/docs/images/documentation/pregrid.png
appdir/usr/docs/images/documentation/zoomed.png
appdir/usr/docs/images/documentation/gridsel2.png
appdir/usr/docs/images/documentation/new.png
appdir/usr/docs/images/documentation/gridline.png
appdir/usr/docs/images/documentation/gridline2.png
appdir/usr/docs/images/documentation/long2.png
appdir/usr/docs/images/documentation/postgrid.png
appdir/usr/docs/images/documentation/long3.png
appdir/usr/docs/images/documentation/gridsel3.png
appdir/usr/docs/images/documentation/deleted.png
appdir/usr/docs/images/documentation/insert.png
appdir/usr/docs/images/documentation/grid.png
appdir/usr/docs/images/documentation/long1.png
appdir/usr/examples
appdir/usr/examples/tutorial.cts
appdir/usr/examples/complex_eval.cts
appdir/usr/examples/tutorial-fr.cts
appdir/usr/examples/tutorial-de.cts
appdir/usr/examples/contrib
appdir/usr/examples/contrib/help
appdir/usr/examples/contrib/help/treesheet key quick reference (by WiM) 3 posted.cts
appdir/usr/examples/contrib/help/treesheet menu including images landscape final.cts
appdir/usr/examples/contrib/what-i-like-about-treesheets.cts
appdir/usr/examples/contrib/yearly-calendar.cts
appdir/usr/examples/contrib/weekly+calendar.cts
appdir/usr/examples/contrib/Procrastination.cts
appdir/usr/examples/contrib/structogram-quicksort.cts
appdir/usr/examples/todo_calendar.cts
appdir/usr/examples/imported_from_xml_examples
appdir/usr/examples/imported_from_xml_examples/menu.cts
appdir/usr/examples/imported_from_xml_examples/cd_catalog.cts
appdir/usr/examples/imported_from_xml_examples/plant_catalog.cts
appdir/usr/examples/imported_from_xml_examples/books.cts
appdir/usr/examples/simple_graph.cts
appdir/usr/examples/personel_file.cts
appdir/usr/examples/unicode_test.cts
appdir/usr/examples/sales.cts
appdir/usr/readme.html
appdir/usr/treesheets.desktop
appdir/usr/translations
appdir/usr/translations/zh_CN
appdir/usr/translations/zh_CN/ts.po
appdir/usr/translations/zh_CN/ts.mo
appdir/usr/translations/zh_CN/compile.bat
appdir/usr/translations/de
appdir/usr/translations/de/ts.po
appdir/usr/translations/de/ts.mo
appdir/usr/translations/de/compile.bat
appdir/usr/translations/it
appdir/usr/translations/it/ts.po
appdir/usr/translations/it/ts.mo
appdir/usr/translations/it/compile.bat
appdir/usr/translations/ts.pot
appdir/usr/translations/readme_translations.txt
appdir/usr/treesheets
appdir/usr/scripts
appdir/usr/scripts/Export JSON.lobster
appdir/usr/scripts/modules
appdir/usr/scripts/modules/color.lobster
appdir/usr/scripts/modules/stdtype.lobster
appdir/usr/scripts/modules/std.lobster
appdir/usr/scripts/modules/vec.lobster
appdir/usr/images
appdir/usr/images/treesheets.svg
appdir/usr/images/icon32.png
appdir/usr/images/render
appdir/usr/images/render/line_ne.png
appdir/usr/images/render/line_sw.png
appdir/usr/images/render/line_se.png
appdir/usr/images/render/line_nw.png
appdir/usr/images/icon16.png
appdir/usr/images/webalys
appdir/usr/images/webalys/readme.txt
appdir/usr/images/webalys/toolbar
appdir/usr/images/webalys/toolbar/filesaveas.png
appdir/usr/images/webalys/toolbar/filesave.png
appdir/usr/images/webalys/toolbar/zoomin.png
appdir/usr/images/webalys/toolbar/editpaste.png
appdir/usr/images/webalys/toolbar/editcopy.png
appdir/usr/images/webalys/toolbar/fileopen.png
appdir/usr/images/webalys/toolbar/zoomout.png
appdir/usr/images/webalys/toolbar/image.png
appdir/usr/images/webalys/toolbar/undo.png
appdir/usr/images/webalys/toolbar/newgrid.png
appdir/usr/images/webalys/toolbar/filenew.png
appdir/usr/images/webalys/toolbar/run.png
appdir/usr/images/nuvola
appdir/usr/images/nuvola/dropdown
appdir/usr/images/nuvola/dropdown/apply.png
appdir/usr/images/nuvola/dropdown/ledyellow.png
appdir/usr/images/nuvola/dropdown/back.png
appdir/usr/images/nuvola/dropdown/ledorange.png
appdir/usr/images/nuvola/dropdown/edit_add.png
appdir/usr/images/nuvola/dropdown/kcmprocessor.png
appdir/usr/images/nuvola/dropdown/misc.png
appdir/usr/images/nuvola/dropdown/cache.png
appdir/usr/images/nuvola/dropdown/email.png
appdir/usr/images/nuvola/dropdown/ledblue.png
appdir/usr/images/nuvola/dropdown/gohome.png
appdir/usr/images/nuvola/dropdown/kweather.png
appdir/usr/images/nuvola/dropdown/color_line.png
appdir/usr/images/nuvola/dropdown/history.png
appdir/usr/images/nuvola/dropdown/cancel.png
appdir/usr/images/nuvola/dropdown/kgpg.png
appdir/usr/images/nuvola/dropdown/ksysv.png
appdir/usr/images/nuvola/dropdown/configure.png
appdir/usr/images/nuvola/dropdown/player_play.png
appdir/usr/images/nuvola/dropdown/ledlightgreen.png
appdir/usr/images/nuvola/dropdown/ledpurple.png
appdir/usr/images/nuvola/dropdown/messagebox_info.png
appdir/usr/images/nuvola/dropdown/ledlightblue.png
appdir/usr/images/nuvola/dropdown/bookcase.png
appdir/usr/images/nuvola/dropdown/package_network.png
appdir/usr/images/nuvola/dropdown/ledred.png
appdir/usr/images/nuvola/dropdown/kgpg_key3.png
appdir/usr/images/nuvola/dropdown/kalarm.png
appdir/usr/images/nuvola/dropdown/noatunloopsong.png
appdir/usr/images/nuvola/dropdown/maybe.png
appdir/usr/images/nuvola/dropdown/messagebox_warning.png
appdir/usr/images/nuvola/dropdown/mozilla.png
appdir/usr/images/nuvola/dropdown/player_pause.png
appdir/usr/images/nuvola/dropdown/package_games_arcade.png
appdir/usr/images/nuvola/dropdown/clanbomber.png
appdir/usr/images/nuvola/dropdown/bookmark.png
appdir/usr/images/nuvola/dropdown/kuser.png
appdir/usr/images/nuvola/dropdown/down.png
appdir/usr/images/nuvola/dropdown/ledgreen.png
appdir/usr/images/nuvola/dropdown/kfm_home.png
appdir/usr/images/nuvola/dropdown/edit_remove.png
appdir/usr/images/nuvola/dropdown/package_toys.png
appdir/usr/images/nuvola/dropdown/player_stop.png
appdir/usr/images/nuvola/dropdown/kcoloredit.png
appdir/usr/images/nuvola/dropdown/up.png
appdir/usr/images/nuvola/dropdown/forward.png
appdir/usr/images/nuvola/dropdown/bug.png
appdir/usr/images/nuvola/dropdown/no.png
appdir/usr/images/nuvola/license.txt
appdir/usr/images/nuvola/readme.txt
appdir/usr/images/nuvola/thanks.to
appdir/usr/images/nuvola/fold.png
appdir/usr/images/nuvola/toolbar
appdir/usr/images/nuvola/toolbar/filesaveas.png
appdir/usr/images/nuvola/toolbar/filesave.png
appdir/usr/images/nuvola/toolbar/zoomin.png
appdir/usr/images/nuvola/toolbar/editpaste.png
appdir/usr/images/nuvola/toolbar/editcopy.png
appdir/usr/images/nuvola/toolbar/fileopen.png
appdir/usr/images/nuvola/toolbar/zoomout.png
appdir/usr/images/nuvola/toolbar/image.png
appdir/usr/images/nuvola/toolbar/undo.png
appdir/usr/images/nuvola/toolbar/newgrid.png
appdir/usr/images/nuvola/toolbar/filenew.png
appdir/usr/images/nuvola/toolbar/run.png
appdir/usr/images/nuvola/author

Build log: https://travis-ci.com/probonopd/treesheets/jobs/230979045

aardappel commented 5 years ago

The default way to build is now CMake.. the old Makefile still remains, because, well, it works and someone might prefer it. But I don't intend to maintain it beyond trivial changes. So, feel free to change how it installs with a PR.

aardappel commented 5 years ago

Oh, if this is for the AppImage, then it would be best if that was generated thru a CMake build.

probonopd commented 5 years ago

I am using CMake...

aardappel commented 5 years ago

Ah sorry did not spot that. I'm going to remove the old Makefile to end the confusion.

probonopd commented 5 years ago

Please reopen. make install should install things in a FHS structure, not in random places. Trying to work around this has already cost me over an hour now.

aardappel commented 5 years ago

Sorry, I am not familiar with what is required to make CMake work with this FHS structure, and like I said, the code expects files it needs relative to the exe. That's how TreeSheets has worked for the past 10 years on Linux. I am open to changing it if that is better for Linux, though the current structure is what is required for the other OSes (Windows & OSX) which also keep exe and data files in one place.

probonopd commented 5 years ago

D'oh, make install does not even strip and set executable the binary. Anyway, I now have worked around everything and the AppImage should become available soon for testing.

I am open to changing it if that is better for Linux, though the current structure is what is required for the other OSes (Windows & OSX) which also keep exe and data files in one place.

Yes, I am not the biggest fan of how "Linux" is doing things (FHS) either, hence AppImage exists - everything neatly inside one file :-)

aardappel commented 5 years ago

Well, hurray for AppImages then. So if AppImages keep things neatly together, why is make install even needed then? All the files it needs are already in place in TS before make install.

probonopd commented 5 years ago

Most (almost all) applications written for Linux have make install that puts things into the "usual" locations. There are tools that take the ingredients from there and put them into a single-file AppImage almost automatically. For this to be automagic, we need to pick things up from "the usual locations".

Anyhow, if no other Linux users have requested make install to work as "usual", then I think this can be closed again here, since we seem to have a working workaround as far as AppImage is concerned.

Vaelatern commented 5 years ago

This is how voidlinux installs treesheets:

do_install() {
        sed \
                -e "s|%PKGNAME%|${pkgname}|" \
                -e "s|%EXENAME%|${pkgname}|" \
                ${FILESDIR}/treesheets.sh.in > ${wrksrc}/treesheets.sh
        vbin ${wrksrc}/treesheets.sh treesheets
        vlicense ${wrksrc}/ZLIB_LICENSE.txt
        vmkdir usr/lib/${pkgname} 755
        vcopy ${wrksrc}/TS/docs usr/lib/${pkgname}
        vinstall ${wrksrc}/TS/readme.html 644 usr/lib/${pkgname}
        vcopy ${wrksrc}/TS/examples usr/lib/${pkgname}
        vcopy ${wrksrc}/TS/images usr/lib/${pkgname}
        vinstall ${wrksrc}/src/treesheets 755 usr/lib/${pkgname}
        vinstall ${wrksrc}/TS/treesheets.desktop 644 usr/share/applications
        vinstall ${wrksrc}/TS/images/icon32.png 644 usr/share/pixmaps treesheets.png
        vinstall ${wrksrc}/TS/images/icon16.png 644 usr/share/pixmaps treesheets-16x16.png
        vinstall ${wrksrc}/TS/images/treesheets.svg 644 usr/share/pixmaps treesheets.svg
        sed -i "s|Icon=images/treesheets.svg|Icon=treesheets.png|" ${DESTDIR}/usr/share/applications/treesheets.desktop
        vdoc ${wrksrc}/TODO.txt
}

For whatever reason, make install didn't work for me, and I just built this way instead.