Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to distribute custom plugins in cross platform environments
Forum Updated to NodeBB v4.3 + New Features

How to distribute custom plugins in cross platform environments

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 827 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • dporobicD Offline
    dporobicD Offline
    dporobic
    wrote on last edited by
    #1

    I have written a plugin as a an option extension for my application, now I'm looking for a way to distribute it. Is there a standard way? How do other people do it? For windows I think it's not a big issue, just distribute a zip package with the plugin and the user can unpack it in the plugins dir of my application. For Linux it's a bit more complicate, the application is installed in the /usr/local/bin, the plugin is a shared library so it gets installed in usr/local/lib64, is that the correct approach?

    Would be nice if someone could share some experience on this topic.

    https://github.com/ksnip/ksnip

    raven-worxR 1 Reply Last reply
    0
    • dporobicD dporobic

      I have written a plugin as a an option extension for my application, now I'm looking for a way to distribute it. Is there a standard way? How do other people do it? For windows I think it's not a big issue, just distribute a zip package with the plugin and the user can unpack it in the plugins dir of my application. For Linux it's a bit more complicate, the application is installed in the /usr/local/bin, the plugin is a shared library so it gets installed in usr/local/lib64, is that the correct approach?

      Would be nice if someone could share some experience on this topic.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @dporobic
      what kind of plugin and what Linux distro?
      Basically i would say create a deb/rpm package (at least) and set the dependency packages.

      If its a plugin extending Qt i would say install it directly to the Qt installation folder - otherwise the user has to worry about adding the plugin import path himself.
      For example

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • dporobicD Offline
        dporobicD Offline
        dporobic
        wrote on last edited by
        #3

        @raven-worx it's extending my own application, ksnip. Currently it's being installed here /usr/lib/x86_64-linux-gnu/libksnip-plugin-ocr.so but looking at the provided link, I should probably try to change it to something like /usr/lib/x86_64-linux-gnu/ksnip/plugins/libksnip-plugin-ocr.so

        Yes, finding the plugins after installation is an issue. I first thought about setting env vars when installing but that doesn't seem to work for Linux. How does Qt know where its plugins are located?

        https://github.com/ksnip/ksnip

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          They are in a known folder folder following a specific structure.

          It's explained in the plugins documentation.

          For your application, how are you currently doing ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • dporobicD Offline
            dporobicD Offline
            dporobic
            wrote on last edited by dporobic
            #5

            In my application you can currently choose a directory where for plugins should be searched (checking the directory and its child directories, one level). I had in mind defining a default search path, like for Windows QCoreApplication::applicationDirPath()/../plugins and additionally supporting an environment variable, like KSNIP_PLUGINS. First check env var, when empty, take default search path, when nothing found, well then the user has to input where he installed it.

            My ideas are currently failing for Linux as I cannot set the env var when installing the deb or rpm package and I cannot determine the default install path, could be /usr/local/lib, /usr/lib/x86_64-linux-gnu/ or something else.

            What's even worse, when you install the the package it doesn't say where it's installed so the user would need to look via find for it, which is not a solution for the average user.

            https://github.com/ksnip/ksnip

            jsulmJ 1 Reply Last reply
            0
            • dporobicD dporobic

              In my application you can currently choose a directory where for plugins should be searched (checking the directory and its child directories, one level). I had in mind defining a default search path, like for Windows QCoreApplication::applicationDirPath()/../plugins and additionally supporting an environment variable, like KSNIP_PLUGINS. First check env var, when empty, take default search path, when nothing found, well then the user has to input where he installed it.

              My ideas are currently failing for Linux as I cannot set the env var when installing the deb or rpm package and I cannot determine the default install path, could be /usr/local/lib, /usr/lib/x86_64-linux-gnu/ or something else.

              What's even worse, when you install the the package it doesn't say where it's installed so the user would need to look via find for it, which is not a solution for the average user.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @dporobic said in How to distribute custom plugins in cross platform environments:

              In my application you can currently choose a directory where for plugins should be searched

              And do you want to keep it like this?
              Why should user care about this location?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              dporobicD 1 Reply Last reply
              0
              • jsulmJ jsulm

                @dporobic said in How to distribute custom plugins in cross platform environments:

                In my application you can currently choose a directory where for plugins should be searched

                And do you want to keep it like this?
                Why should user care about this location?

                dporobicD Offline
                dporobicD Offline
                dporobic
                wrote on last edited by
                #7

                @jsulm said in How to distribute custom plugins in cross platform environments:

                And do you want to keep it like this?
                Why should user care about this location?

                I want to keep that functionality that the user needs to start the check for plugins instead of on startup always checking if plugins are there. It's an extensions (the plugin) that most of the users won't need, but if you need it, you can download the plugin, tell the application where it is and then use it. This check is a one time thing, the found locations are stored in settings and on startup loaded.

                I would prefer the user not to care about the location, to be able to automatically suggest to the user where to search (which I'm currently not able, see posts above). When the location cannot be found automatically (which is currently the case on Linux) then the users should be able to tell the application where it can be found.

                https://github.com/ksnip/ksnip

                jsulmJ 1 Reply Last reply
                0
                • dporobicD dporobic

                  @jsulm said in How to distribute custom plugins in cross platform environments:

                  And do you want to keep it like this?
                  Why should user care about this location?

                  I want to keep that functionality that the user needs to start the check for plugins instead of on startup always checking if plugins are there. It's an extensions (the plugin) that most of the users won't need, but if you need it, you can download the plugin, tell the application where it is and then use it. This check is a one time thing, the found locations are stored in settings and on startup loaded.

                  I would prefer the user not to care about the location, to be able to automatically suggest to the user where to search (which I'm currently not able, see posts above). When the location cannot be found automatically (which is currently the case on Linux) then the users should be able to tell the application where it can be found.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @dporobic said in How to distribute custom plugins in cross platform environments:

                  you can download the plugin, tell the application where it is and then use it

                  In this case I would not package these plug-ins as rpm/deb packages.
                  A zip archive would be enough and user can then decide where to put the plug-ins.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  dporobicD 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @dporobic said in How to distribute custom plugins in cross platform environments:

                    you can download the plugin, tell the application where it is and then use it

                    In this case I would not package these plug-ins as rpm/deb packages.
                    A zip archive would be enough and user can then decide where to put the plug-ins.

                    dporobicD Offline
                    dporobicD Offline
                    dporobic
                    wrote on last edited by
                    #9

                    @jsulm said in How to distribute custom plugins in cross platform environments:

                    In this case I would not package these plug-ins as rpm/deb packages.
                    A zip archive would be enough and user can then decide where to put the plug-ins.

                    Problem is that it has a dependency, it relays on Tessarect that is installed with it. For windows I will package it in a zip as you said but on Linux it should be installed so the dependency can be resolved. Or is there a way to package it together with the dependency, like AppImage for libs?

                    https://github.com/ksnip/ksnip

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved