简体   繁体   English

分发使用wxWidgets的C ++ Linux应用程序的选项

[英]Options for distributing a C++ Linux application that uses wxWidgets

I'm working on a C++ Linux application that uses wxWidgets , and needs to be distributed as a compiled binary application. 我正在使用一个使用wxWidgets的C ++ Linux应用程序,需要将其作为已编译的二进制应用程序进行分发。 The project lead has specified that we are to include all dependencies for the application so that the end user does not need to install anything to run the application, provided they have standard system components installed already ( libc , etc). 项目负责人已指定我们要包括应用程序的所有依赖项,以便最终用户不需要安装任何东西来运行应用程序,只要它们已经安装了标准系统组件( libc等)。 I think this requirement is something that the end user asked for. 我认为这个要求是最终用户要求的。 I know that this is not what you might consider to be a "normal" distribution process for Linux applications. 我知道这不是您可能认为的Linux应用程序的“正常”分发过程。

For simple libraries that don't have many dependencies themselves, this is not an issue. 对于自身没有很多依赖项的简单库,这不是问题。 But for wxWidgets I'm running into issues with webkitgtk which is required for the WebView class (which is used in the application). 但对于wxWidgetswebkitgtk问题,这是WebView类(在应用程序中使用)所必需的。 webkitgtk has a number of dependencies itself, which may have their own dependencies, and so on. webkitgtk本身有许多依赖项,它们可能有自己的依赖项,依此类推。 Basically, it looks like I'd be opening a real can of worms by trying to include everything in the application, and the more senior developer on the project seems to agree. 基本上,通过尝试将所有内容都包含在应用程序中,看起来我正在打开真正的蠕虫病毒,而项目中更高级的开发人员似乎也同意这一点。

So I'm wondering, what are my options for distributing such an application? 所以我想知道,我有什么选择分发这样的应用程序? I've tried searching for information about this, and the prevailing opinion seems to be to have the end user install wxWidgets . 我已经尝试搜索有关这方面的信息,而流行的观点似乎是让最终用户安装wxWidgets These are the options that I've come across: 这些是我遇到的选项:

  • Compile all dependencies as shared libraries as the project lead wants. 根据项目负责人的需要,将所有依赖项编译为共享库。 The downside to this is that there are many libraries to worry about and this will lead to significant bloat. 这样做的缺点是有许多库需要担心,这将导致严重的膨胀。
  • Require that the end user install wxWidgets (on top of GTK and webkitgtk ). 要求最终用户安装wxWidgets (在GTKwebkitgtk )。 The downside here is that the user would have to install multiple dependencies, and if they aren't on a distribution with appropriate versions of the above in their package manager, this could be a real hassle for them. 这里的缺点是用户必须安装多个依赖项,如果它们不在包管理器中具有上述适当版本的发行版上,这对他们来说可能是一个真正的麻烦。 It also means we couldn't provide something that was specifically asked for. 这也意味着我们无法提供特别要求的东西。
  • Require that the end user have GTK and webkitgtk installed, but not wxWidgets . 要求最终用户安装GTKwebkitgtk ,但不要安装wxWidgets Same downsides as above, but with fewer dependencies. 与上面相同的缺点,但具有较少的依赖性。 An additional downside is that there may be version compatibility issues if different versions of the dependencies are installed than were used to build the packaged wxWidgets library. 另一个缺点是,如果安装了不同版本的依赖项,则可能存在版本兼容性问题,而不是用于构建打包的wxWidgets库。

Am I correct in my assessment of the pros and cons of these various options? 我对这些各种选择的利弊评估是否正确? Are there any options that I'm missing? 我有什么选择吗?

Thanks! 谢谢!

David, The best possible solution is probably to ask user to install X11, GTK+{2,3} and WebKit-GTK. 大卫,最好的解决方案可能是要求用户安装X11,GTK + {2,3}和WebKit-GTK。 wxWidgets can be statically linked with the application. wxWidgets可以与应用程序静态链接。

You can ask you user to have a WebKit-GTK to be at least version XYZ and that should satisfy the requirements. 您可以要求用户将WebKit-GTK设置为至少版本XYZ,并且应满足要求。 Integrating WebKit-GTK with all its dependencies, especially since there is a dependency on GTK+ itself will be very hard. 将WebKit-GTK与其所有依赖项集成,特别是因为依赖于GTK +本身将非常困难。 So if you go this route you will be screwed. 所以如果你走这条路,你就会被搞砸了。

As linux user i vote for manual dependencies installation via package manager. 作为linux用户,我通过包管理器投票支持手动依赖安装。 It's not that hard and could even be done automatically if you provide package (Not just binary). 它并不难,甚至可以自动完成,如果你提供包(不只是二进制)。 Carrying runtime may cause problems (Eg Steam on Debian). 携带运行时可能会导致问题(例如Debian上的Steam)。 Another option is to provide two flavors: all inclusive and dependency requiring. 另一种选择是提供两种口味:全包和依赖性要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM