brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
277 stars 26 forks source link

official debian package #42

Closed alexmyczko closed 2 years ago

alexmyczko commented 2 years ago

Hello

I guess users would profit (Debian, Ubuntu, Raspbian, Devuan) if they could install this with just apt install vimix.

I'm working on a package, but the included ext/ stuff is mostly all packaged and should be linked against the already existing packages, and not included (duplicate copies) and built against. Could you help with that?

I already have working packages: http://sid.ethz.ch/debian/vimix

Best,

brunoherbelin commented 2 years ago

Hi ! This is awesome! Thanks a lot :) !! I tried and it worked like a charm :+1:

Two questions then come to mind:

  1. Could I link to your repository from vimix homepage? Or is there a PPA for ubuntu?
  2. Is this automatically updated from git? Frorm git Releases ?

In any case, thanks for the effort !

Then, to answer to your question about the ext/ libraries, the reasons I chose to include as git sub-modules are:

Now, to be more constructive, the following could indeed be considered as external dependencies (linked from installed binary packages):

  1. libtinyxml2 (ubuntu package libtinyxml2-dev)
  2. liboscpack1 (ubuntu package liboscpack-dev)
  3. libstb0 (ubuntu package libstb-dev)

Others: imgui itself is not provided as binaries (installing libimgui-dev ends up the same). glad is generated from https://glad.dav1d.de/ The rest seems to be only on github

I am myself not very good with packaging and system setup, so if you want to contribute to the compilation and distribution, this would be very much appreciated !

alexmyczko commented 2 years ago

Hi ! This is awesome! Thanks a lot :) !! I tried and it worked like a charm 👍

Glad, it also worked during my tests (which certainly were more minimal, just start it, and close it :)

Two questions then come to mind:

  1. Could I link to your repository from vimix homepage? Or is there a PPA for ubuntu?

You could, but it doesn't make much sense, better wait, and let's try to get it into Debian officially, then Ubuntu have it sync, and be available officially with 22.04 LTS... This is just the host where I build debian packages.

  1. Is this automatically updated from git? Frorm git Releases ?

No, just a manual checkout to create a package.

In any case, thanks for the effort !

Then, to answer to your question about the ext/ libraries, the reasons I chose to include as git sub-modules are:

  • not all can be found as packaged libraries

Aware of that. But for those that are, it'd be great if I can just add them to debian/control, Build-Depends:

  • these are stable and almost never changing code
  • this facilitates cross-platform compilation (under OSX it makes things way easier)

That's perfectly fine, keep it as it is, I just have to have a CMakeFile that tries to use the system libraries, if found, and fall back to the included copies.

  • overall they are so small that I didn't bother looking further :)

Debian will not accept duplicate sources, especially not if there's official packages of the libraries packaged.

Now, to be more constructive, the following could indeed be considered as external dependencies (linked from installed binary packages):

  1. libtinyxml2 (ubuntu package libtinyxml2-dev)
  2. liboscpack1 (ubuntu package liboscpack-dev)
  3. libstb0 (ubuntu package libstb-dev)

That is very good, if you could help me make the build use those instead of the included copies, I'll get forward much faster.

There's also libglm-dev, but I'm not sure if it's the same glm as your copy.

Others: imgui itself is not provided as binaries (installing libimgui-dev ends up the same).

I guess we should file a bug against the package and ask for the binaries be provided then...

glad is generated from https://glad.dav1d.de/ The rest seems to be only on github

not sure on that, need to check.

I am myself not very good with packaging and system setup, so if you want to contribute to the compilation and distribution, this would be very much appreciated !

I'll be glad to help. PS: are you on IRC?

brunoherbelin commented 2 years ago

That's perfectly fine, keep it as it is, I just have to have a CMakeFile that tries to use the system libraries, if found, and fall back to the included copies.

yes exactly, would be ideal

That is very good, if you could help me make the build use those instead of the included copies, I'll get forward much faster.

What do you mean? change the vimi CMakeList to do FindPackage and link with packaged lib ? I can do that

PS: are you on IRC?

Nope, but I created a discord: https://discord.gg/ZCMxU6ts

alexmyczko commented 2 years ago

That's perfectly fine, keep it as it is, I just have to have a CMakeFile that tries to use the system libraries, if found, and fall back to the included copies.

yes exactly, would be ideal

+1

That is very good, if you could help me make the build use those instead of the included copies, I'll get forward much faster.

What do you mean? change the vimi CMakeList to do FindPackage and link with packaged lib ? I can do that

that'd be very helpful, please do so! many thanks for that.

PS: are you on IRC?

Nope, but I created a discord: https://discord.gg/ZCMxU6ts

sorry been busy with local debian.ch meeting, but will try to join...

alexmyczko commented 2 years ago

sorry i'm too bad to join discord (having problems creating account). but i saw you created a new release, updated the package. now waiting for your FindPackage changes :)

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
-----------------------------------------------------------------------------
   * GTK - GTK cross-platform widget toolkit
   * GLib - GTK general-purpose utility library
   * GObject - GTK object-oriented framework
   * PNG - Portable Network Graphics
   * GStreamer - Open Source Multiplatform Multimedia Framework
   * GStreamerPluginsBase - GStreamer app library
   * GStreamerPluginsBase - GStreamer audio library
   * GStreamerPluginsBase - GStreamer video library
   * GStreamerPluginsBase - GStreamer pbutils library
   * GStreamerPluginsBase - GStreamer opengl library
   * ICU - International Components for Unicode
   * glfw3 - Open Source multi-platform library for OpenGL

-----------------------------------------------------------------------------
-- Congratulations! All external packages have been found.
-----------------------------------------------------------------------------

CMake Error at CMakeLists.txt:137 (add_subdirectory):
  add_subdirectory given source
  "/var/www/debian/vimix/vimix-0.6.3+git20220105/ext/glm" which is not an
  existing directory.

-- Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- /var/www/debian/vimix/vimix
CMake Error at CMakeLists.txt:144 (include):
  include could not find requested file:

    /var/www/debian/vimix/vimix-0.6.3+git20220105/ext/link/AbletonLinkConfig.cmake

I think these two already exist?

ii  libglm-dev                                                  0.9.9.8+ds-2                           all          C++ library for OpenGL GLSL type-based mathematics
ii  ableton-link-dev                                            3.0.3+dfsg-6                           all          synchronizes musical applications on multiple devices - development

also these

libstb-dev - single-file image and audio processing libraries for C/C++ - development headers
libtinyxml2-dev - TinyXML2 library - header and static library
liboscpack-dev - C++ library for packing and unpacking OSC packets - dev files
brunoherbelin commented 2 years ago

Good! Will need to find time for this (busy at work...) Thanks for your patience !

And thanks for offering your help on this packaging !

alexmyczko commented 2 years ago

is there chances to get this done by mid February?

brunoherbelin commented 2 years ago

Hello ! sorry for the delay. With new release 0.7.0 comes an updated CMakelist that tests for the presence of installed packages before trying to compile the lib with locally cloned git. This applies to stb, tinyxml2, ableton-link, and glm. For oscpack and imgui, the compilation requires options that are not standard and would need more time to check.

Hope this helps for compiling debian package!

alexmyczko commented 2 years ago

@brunoherbelin it looks very good and promising: http://sid.ethz.ch/debian/vimix/

not sure if they are valid but you might want to check:


I [spelling-error-in-binary](https://lintian.debian.org/tags/spelling-error-in-binary.html)

    usr/bin/vimix DispatH Dispatch
    usr/bin/vimix IiF If
    usr/bin/vimix Mirro Mirror
    usr/bin/vimix Openning Opening
    usr/bin/vimix Ouput Output
    usr/bin/vimix betwen between
    usr/bin/vimix dictionnary dictionary
    usr/bin/vimix emmitted emitted
    usr/bin/vimix occured occurred
    usr/bin/vimix openned opened
    usr/bin/vimix overriden overridden
    usr/bin/vimix ressource resource
    usr/bin/vimix substract subtract

a lot better, looking at:

https://mentors.debian.net/package/vimix/

so once i fix debian/copyright it can get right into debian...
brunoherbelin commented 2 years ago

Excellent ! I see there are several sanity checks that help improve packaging ! I'll happily do the typos corrections and let you know when its committed.

How do you suggest to add a man page?

brunoherbelin commented 2 years ago

Just committed all typos and spelling mistakes I could find in vimix code (the remaining I cannot fix are in external files). Also fixed too long lines, and updated the description text (docs/index.md)

I could not install the .deb package though, probably because i'm not under the right distrib / version (I run Ubuntu 21.10).

@alexmyczko I'm very grateful that you are helping with this, and understand there might be more technical things to fix: let me know and we can exchange emails if it helps.

NB: Maybe the official URL could be https://brunoherbelin.github.io/vimix/ (instead of git page).

alexmyczko commented 2 years ago

Since debian discourages (and enforces) duplicating code (that includes fonts):

./ext/imgui/misc/fonts/Cousine-Regular.ttf
fonts-croscore: /usr/share/fonts/truetype/croscore/Cousine-Regular.ttf

./ext/imgui/misc/fonts/DroidSans.ttf

./ext/imgui/misc/fonts/Karla-Regular.ttf
fonts-karla: /usr/share/fonts/truetype/karla/Karla-Regular.otf

./ext/imgui/misc/fonts/ProggyClean.ttf

./ext/imgui/misc/fonts/ProggyTiny.ttf
fonts-proggy: /usr/share/fonts/truetype/proggy/ProggyTiny.ttf

./ext/imgui/misc/fonts/Roboto-Medium.ttf
fonts-roboto-unhinted: /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Medium.ttf

./rsc/fonts/Hack-Regular.ttf
fonts-hack: /usr/share/fonts/truetype/hack/Hack-Regular.ttf

./rsc/fonts/JetBrainsMono-Regular.ttf
fonts-jetbrains-mono: /usr/share/fonts/truetype/jetbrains-mono/JetBrainsMono-Regular.ttf

./rsc/fonts/Roboto-Bold.ttf
fonts-roboto-unhinted: /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Bold.ttf

./rsc/fonts/Roboto-Italic.ttf
fonts-roboto-unhinted: /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Italic.ttf

./rsc/fonts/Roboto-Regular.ttf
fonts-roboto-unhinted: /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Regular.ttf

font awesome
./rsc/fonts/fa-regular-400.ttf
./rsc/fonts/fa-solid-900.ttf

I'm required to repack the orig.tar ball with symlinks and dependencies to the fonts. However I'm unable to find the font awesome ones. One of Proggy and the Droid one with that name. So my question would be are all fonts really used? Can they be reduced? This is also part of debian/copyright.

The debian binary package is for Debian GNU/Linux "unstable" (aka sid) on x86_64. So if you want it on Pink Debian 21.10 (why not go for 22.04? I already run that on 8 machines, make sure to have proposed active though, until release).

To build your own binary package for your OS/release, take the debian source package and build it, here's how:

dget http://sid.ethz.ch/debian/vimix/vimix_0.7%2Bds-1.dsc
dpkg-source -x *.dsc
cd vimix*/
debuild
brunoherbelin commented 2 years ago

The issue with Fonts is more challenging. The whole principle of vimix compilation is to use CMakeRC to integrate resources (textures, text files and fonts) in the binary. The TTF files are not found at runtime. Here is the updated status (associated to a recent commit):

1) I removed one unused font from the git 2) I added a CMake features that looks for the needed TTF files in the system (recursively from /usr/share/fonts/) and copies the file in the rsc directory of the source before compiling. This way, the sourcetree of vimix for deb package could exclude those files, as they are copied at compilation time. This works for 'fonts-roboto' and 'fonts-hack' packages. 3) Many fonts you mention are in imgui source : I checked and tested again, but no, I cannot compile with the imgui-dev package because the provided binary library is not compiled with the appropriate tags (IMGUI_IMPL_OPENGL_LOADER_GLAD and IMGUI_USE_STB_SPRINTF) 4) FontAwesome : the package fonts-font-awesome does not provide the same TTF files I need, but that's a good news as it means I'm not duplucating any package!

Regarding version of OS: yeah you're right, I should update ! And thanks for the instruction to build a package.

brunoherbelin commented 2 years ago

Comments for IMGUI embedding: I do not wish to duplicate the source of imgui lib, I just need to re-compile it. So two comments that might help the deb packaging:

alexmyczko commented 2 years ago

@brunoherbelin ah the information it's not necessary to keep the font files of imgui source, is the best! thanks for that.

brunoherbelin commented 2 years ago

FYI: I just committed a linux manpage for vimix!

alexmyczko commented 2 years ago

updated packages (uploaded, waiting for ftp master review) http://sid.ethz.ch/debian/vimix/n/

alexmyczko commented 2 years ago
this license:
 vimix-0.7.0+git20220321+ds/rsc/images/icons_LICENCE.txt
is not compatible with DFSG:
 "(...) you agree not to sell, redistribute, sublicense, share or otherwise transfer the Work to other people or entities (...)."

what would be the solution?

brunoherbelin commented 2 years ago

Thanks for checking this ! To answer to the issue, two elements of answer

1) The license states that "Licensee may use the Work in non-commercial and commercial projects, services or products without attribution", which is the case, and I am not redistributing or sublicensing the work : the files from iconmonstr are not redistributed.

In practice adding the License file is not even required. I don't think that the icons.dds file can be considered as a redistribution of the work from iconmonstr. Is there a lawyer in the room? :)

2) In practice, none of these iconmonstr original icons are used in vimix: every time I need an Icon, I make it and update the dds image file (which was indeed originally filled with bitmaps of iconmonstr icons, before I switch to vector with awesomefont).

If it was really necessary, I could just remove every icon that comes from iconmonstr (but it takes time to make sure I do not break anything)

alexmyczko commented 2 years ago

Sorry for the late answer, the easiest would be I get rid of the license, and you get rid of the data that are bound to the icons, which you're not using anyways, let's try that?

brunoherbelin commented 2 years ago

Ok ! Let me do that and cleanup the icons. I'll let you know when its committed.

brunoherbelin commented 2 years ago

Thanks again Alex for helping making vimix better and correct with licensing!

I have removed all "iconmonstr" icons and the associated license. Instead, I filled the icons.dds resource with icons I made / changed from FontAwesome (which is correctly licensed elsewhere).

vimix at git release 9447781 can be used for packaging.

alexmyczko commented 2 years ago

thanks for your patience and help, finally it entered debian sid...

brunoherbelin commented 2 years ago

Thanks a lot for your help. looking forward to the next step after testing :+1: