Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DEB to cPack generator #146

Merged
merged 2 commits into from
Dec 13, 2021
Merged

Added DEB to cPack generator #146

merged 2 commits into from
Dec 13, 2021

Conversation

HakunMatat4
Copy link

DEB was added to cmake. That should generate a working DEB package to be installed in any DEB system like Debian, Mint, Ubuntu, etc.

@mwestphal
Copy link
Contributor

I think a bunch of cpack var must be set:

  • CPACK_DEBIAN_PACKAGE_ARCHITECTURE
  • CPACK_DEBIAN_PACKAGE_DEPENDS (should be minimal, but still)
  • CPACK_PACKAGE_CONTACT

More info here: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators

@Meakk : There is a .rpm packager as well, should we try it ?

@Meakk : This could go into release I think, worth it to improve F3D reach.

@Meakk
Copy link
Member

Meakk commented Dec 13, 2021

@whiiiskyy there is an error:

CMake Error at /usr/share/cmake-3.22/Modules/Internal/CPack/CPackDeb.cmake:517 (message):
CPack: Create package using DEB
  CPackDeb: Debian package requires a maintainer for a package, set
CPack: Install projects
  CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER

You can set the variables just before the line you modified:

set(CPACK_PACKAGE_CONTACT "Your name <your@email.com>")

I think it should be enough, CPACK_DEBIAN_PACKAGE_ARCHITECTURE default value is fine and CPACK_DEBIAN_PACKAGE_DEPENDS should be empty I guess. We'll see what the resulting .deb file will look like.

@mwestphal
Sure we should consider RPM later if someone is interested to implement and testing it.

@Meakk Meakk changed the base branch from master to release December 13, 2021 07:15
@Meakk Meakk changed the base branch from release to master December 13, 2021 07:15
@mwestphal
Copy link
Contributor

@Meakk : CPACK_DEBIAN_PACKAGE_DEPENDS empty ? I think we do need to add some low level package like libc and such, unless they are considered always available. maybe @mzf-guest has inputs here.

@mwestphal
Copy link
Contributor

Sure we should consider RPM later if someone is interested to implement and testing it.

Sounds good to me !

1 similar comment
@mwestphal
Copy link
Contributor

Sure we should consider RPM later if someone is interested to implement and testing it.

Sounds good to me !

@HakunMatat4
Copy link
Author

@Meakk I have made the change as requested.
Weirdly, the error I saw was regarding a problem to compress the directory.
Let's see how this go. I will pay more attention to it.

@mwestphal CPACK_DEBIAN_PACKAGE_DEPENDS has no dependencies, only a library under /lib
I am not sure if it is already counting on something installed in the system.

As far as CPack documentation goes, we should be good without it.

Sets the Debian dependencies of this package.

    Mandatory : NO
    Default :

@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #146 (b9896f1) into master (e12c983) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
+ Coverage   86.65%   86.72%   +0.06%     
==========================================
  Files          62       62              
  Lines        3574     3600      +26     
==========================================
+ Hits         3097     3122      +25     
- Misses        477      478       +1     
Impacted Files Coverage Δ
src/vtkF3DAssimpImporter.h 77.77% <0.00%> (-22.23%) ⬇️
src/readers/F3DOBJReader.h 84.61% <0.00%> (-0.39%) ⬇️
src/vtkF3DAssimpImporter.cxx 55.62% <0.00%> (-0.11%) ⬇️
src/F3DLog.cxx 100.00% <0.00%> (ø)
src/F3DLoader.cxx 94.21% <0.00%> (+0.03%) ⬆️
src/vtkF3DGenericImporter.cxx 91.70% <0.00%> (+0.04%) ⬆️
src/vtkF3DOpenGLGridMapper.cxx 91.57% <0.00%> (+0.08%) ⬆️
src/F3DAnimationManager.cxx 93.68% <0.00%> (+0.13%) ⬆️
src/vtkF3DPolyDataMapper.cxx 85.71% <0.00%> (+0.18%) ⬆️
src/vtkF3DOCCTReader.h 90.47% <0.00%> (+3.80%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e12c983...b9896f1. Read the comment docs.

@Meakk
Copy link
Member

Meakk commented Dec 13, 2021

@whiiiskyy the workflow succeeded, and you can download the .deb files here: https://github.com/f3d-app/f3d/actions/runs/1572064138
You probably want f3d-ubuntu-latest-568b279cd2 archive.

Regarding the problem to compress the directory error, it's probably related to permission access. After the build, try to install F3D in a directory accessible for the user (set the CMAKE_INSTALL_PREFIX variable to something different from /usr).

For CPACK_DEBIAN_PACKAGE_DEPENDS, maybe we need OpenGL, X11, GLIBC... I'm not sure here.

@HakunMatat4
Copy link
Author

@Meakk It is working like a charm:

  • no errors during the installation via the package manager
  • F3D appears under the applications menu as expected
  • thumbnails are working as expected. I deleted .cache to make sure it would load the thumbnails and it did
  • f3d opens as expected
  • double click on a STL opens f3d as expected
  • I can call f3d via terminal and it opens as expected
  • uninstall works as expected
  • installing it via terminal dpkg -i works as expected

Is there anything else you would like me to check?

Thanks

@HakunMatat4
Copy link
Author

HakunMatat4 commented Dec 13, 2021

@Meakk Regarding After the build, try to install F3D in a directory accessible for the user (set the CMAKE_INSTALL_PREFIX variable to something different from /usr)., you guys already cover this with .tar.gz and .tag.xz which allows me to run f3d from ~/Downloads which doesn't require root access

It is worth it to mention tho, installing f3d as non-root will be as raw as it can get. You cannot get it 100% running as a system application like be able to search for it under the applications menu and those sort of things.

As far as I tested before contacting you guys, the thumbnails didn't work either. Only after I moved the folders to the right place under /usr as root and deleted the .cache folder.

When installing as root, you have the return below.
You cannot reach the same result running/installing it as a non-root user.
Linux users know of this "rule".
Luckily, f3m works well without root access while many others will crash or require AppImage.

dpkg -i f3d-1.2.0-Linux.deb                                  ░▒▓ ✔ │ root@OptiPlex-7040 
Selecting previously unselected package f3d.
(Reading database ... 498177 files and directories currently installed.)
Preparing to unpack f3d-1.2.0-Linux.deb ...
Unpacking f3d (1.2.0) ...
Setting up f3d (1.2.0) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for shared-mime-info (1.15-1) ...


@mwestphal
Copy link
Contributor

You cannot get it 100% running as a system application like be able to search for it under the applications menu and those sort of things.

You can, just read the updated doc about DesktopIntegration : https://github.com/f3d-app/f3d#linux

Of course, installing .deb package requires root, which is expected. so all good on my side.

@mwestphal
Copy link
Contributor

 > Is there anything else you would like me to check?

Drag and drop ? In any case, if it does not work, it is not related to the deb package but most likely to your file manager.

@mwestphal
Copy link
Contributor

mwestphal commented Dec 13, 2021

@Meakk @whiiiskyy : fine to merge as is imo.

@HakunMatat4
Copy link
Author

Drag and drop ? In any case, if it does not work, it is not related to the deb package but most likely to your file manager.

It works with files and with a folder using left/right to navigate.
Thanks for letting me know regarding the .desktop

Thank you and @Meakk so much for all the help and patience :)

@Meakk
Copy link
Member

Meakk commented Dec 13, 2021

This is good news! Thanks for your contribution @whiiiskyy.
If you have time and motivation to try to implement and test the same thing for RPM packages, it would be great :)

@Meakk Meakk changed the base branch from master to release December 13, 2021 10:34
@Meakk Meakk changed the base branch from release to master December 13, 2021 10:34
@Meakk Meakk merged commit e3c6576 into f3d-app:master Dec 13, 2021
@mwestphal mwestphal added this to the 1.2.1 milestone Dec 13, 2021
@HakunMatat4
Copy link
Author

HakunMatat4 commented Dec 13, 2021

Sure thing @Meakk

That will require a little more time to understand CentOS as a desktop instead of as a server.
That should cover the most common RPM desktop distro like CentOS, SUSE, Fedora and Mandriva.

I'll let you know.

mwestphalnew pushed a commit to mwestphalnew/f3d that referenced this pull request Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants