
Qpm: A package manager for Qt - plumeria
http://www.qpm.io/
======
voltagex_
Has anyone got a checklist for package managers? There are so many it'd be
nice to be able to predict what problems they're going to face in the future
(and hopefully prompt better design in the process)

~~~
zdw
Rules:

1\. Use the system package manager.

2\. See rule #1.

In all seriousness, there needs to be a good way to [spray your
stuff]([http://dilbert.com/strip/2013-06-09](http://dilbert.com/strip/2013-06-09))
all over a system with the rest of the system knowing about it. FPM does a
decent job of this.

There is some research out there on common things that this kind of code gets
wrong:
[https://www.cs.arizona.edu/stork/packagemanagersecurity/](https://www.cs.arizona.edu/stork/packagemanagersecurity/)

~~~
michaelmrose
So you are developing a package in language and you package it with insert
language specific package manager you are now done. If you package it for
insert system package manager to achieve a similar level of coverage you must
not only figure out how to create packages for 17 different systems you have
to either figure out the standards and procedures required to get your package
included on each platform or figure out how to host your own repo and instruct
users on how to set it up this may include variations in setup and
instructions that differ between multiple versions of the os that may be in
use concurrently.

This could be 1000 x as much work for not much gain.

~~~
NoGravitas
Ideally, your language package manager should know how to build (candidate)
packages for common system package managers (eg '''setup.py bdist_rpm''' or
'''setup.py bdist_debian'''). That way, the technical end user can install the
package in a way their package manager knows about. If your package becomes
widely used, it also simplifies (but does not remove) the job of the
distribution's packager to build an official package.

This doesn't work so well for micro-dependencies, though. The TeTeX distrib.
in Fedora is bad enough, I'd hate to see the same done with node packages.

~~~
emidln
This isn't really usable if you develop with the latest packages for
dependencies. While I could generate an rpm for my python module, Fedora and
CentOS/RHEL are going to have incompatible dependencies. I could package up my
dependencies too, but then I'll break system software (a lot of fedora's
tooling is written in Python).

A much better solution would involve making languages like Python accept the
Python version as a dependency while making building the PYTHONPATH more
flexible with common tooling. Making PYTHONPATH building better would enable
installation with namespace+version, such that we could have:

    
    
        /usr/lib/pymodules/requests/1.0.0/...
        /usr/lib/pymodules/requests/1.2.1/...
        /usr/lib/pymodules/python/2.7.10/...
        /usr/lib/pymodules/python/3.5.0/...
    

Python in particular is still a bit challenging in that the compiler assumes
it can spit out byte-compiled code all over the place (.pyc), but if someone
was going through the tooling effort, they'd presumably find a way (or get
something merged if it doesn't exist), to add a shadow directory of .pyc files
that could be keyed by version and cached somewhere user-writeable
(~/.pymodules for example).

~~~
talideon
The purpose of PEP 3147 is to fix some of those problems:
[https://www.python.org/dev/peps/pep-3147/](https://www.python.org/dev/peps/pep-3147/)

Addendum: I'd might as well mention that PEP 3147 is implemented from Python
3.2 onwards, so for Python 3, some of the problem is solved.

You still have the issue of being able to install different version of the
same library.

~~~
emidln
That only really works in a world where all of the users on the machine that
can run Python also can write to shared library directories. That seems kinda
awkward from a security perspective unless you're already using
containerization (in which case you don't care about any of this).

This is certainly better than it was (.pyc files just didn't co-exist sanely
across python versions), but it doesn't provide a method for running multiple
versions of libraries between different apps.

~~~
talideon
> That only really works in a world where all of the users on the machine that
> can run Python also can write to shared library directories.

Far from it. It's up to the system package manager to generate the .pyc files
for the globally installed version of the libraries. __pycache__ directories
allow this to be done cleanly for any installed interpreter that supports
them. It has all the information it needs, and users need not get involved.

Unless the user is running a copy of Python that wasn't installed by the
package manager, there should be no need for them to cause the .pyc files to
be generated. Besides, .pyc files are an optimisation so that parsing and
bytecode compilation doesn't have to repeatedly happen, and aren't even
strictly required: the result is slower startup, but it couldn't prevent the
code from being run.

> it doesn't provide a method for running multiple versions of libraries
> between different apps

Indeed, and I pointed that out in my comment in the addendum. Virtual
environments are still pretty much the state of the art in that regard,
unfortunately. It's possible that some PYTHONPATH magic might help with that
to some degree, but that would be messy.

------
Ace17
Next step: each library gets its own package manager ... and we're back to
square one.

~~~
petepete
But if there was a package manager package manager...

~~~
talideon
Remember that package manager Windows was getting a while back? That's
effectively what it is!

------
embik
I'm irritated by the loading screen and the enormous list of JavaScript pulled
in. That's a simple static page using a few css animations. Is adding bloat
considered "modern webdesign"?

~~~
timlyo
How else would we pad our strings?

~~~
egeozcan
The example you are giving is actually a result of trying to _prevent_ bloat.

~~~
timlyo
By adding a dependency to do a one line task?

~~~
egeozcan
Well, you can add bloat by inlining it too, if it's repeated many times. I
thought bloat was for unused code loaded as a side effect to code that one
actually depends on, for example, as a part of a big library. That makes a
huge difference if you are targeting the client side.

I mean, you could also have it as a helper function in your project but that
decreases the re-usability to copy-pasting across projects.

In the end, effective or not, I can see it as an attempt on reducing bloat. I
see that many don't agree, but I'm afraid they don't take into account the
constraints imposed by sending code to the clients rather than a binary.

------
fit2rule
I'm personally getting so sick of all the package managers I have to use, I'm
more and more inclined to not use a technology if it comes with a package
management system.

Seriously, what is going on with the OS vendors? Its like .. the Web came
along and now nobody wants to build better operating systems .. shouldn't
package management be a function of the OS? Its really just filesystem/tree
management, and this really, really _should_ be something we can use the OS
for.

However, its just not happening. Language vendors have to solve this problem
because the OS vendors are asleep at the wheel. I think its apathy - the
browser has replaced the OS, and very poorly. Nobody wants to fix this
problem, I guess ..

~~~
kluck
In case of Linux: the kernel alone does not make an OS, so if you consider the
various distributions of Linux OS'es, like Debian for example: Each (well the
large ones) distribution comes with their own package management tools.

So currently the "state of the art" is: Create a package for each OS (which
means multiple OS'es of flavour "Linux").

I really wish their was a generic tool that would input a source tree and
output packages for the most common package management systems.

Anyone?

~~~
maximaximal
You could have a look at CPack:
[https://cmake.org/Wiki/CMake:Packaging_With_CPack](https://cmake.org/Wiki/CMake:Packaging_With_CPack)
It was created to be used with the C++ build system CMake, but can be used
without it too. I use it to automatically build debian packages from Jenkins,
but it also supports tarballs, RPMs, NSIS (Windows), PackageMaker (OS X), and
cygwin packages. Hope this helps a bit!

------
bpchaps
Ah, that probably explains it... The resources spent on making this might just
explain why qt has been so difficult to install! ;)

~~~
distances
Yes I know you're joking, but seems it's done by Cutehacks [1], so probably no
involvement from the Qt project itself.

[1] [http://www.cutehacks.com](http://www.cutehacks.com)

------
educar
So, a Qt package manager written in Go :-) Why not C++ ?

~~~
pritambaral
Qt isn't really C++-only anymore, at least with QML. Notwithstanding the use
of JS for QML itself, there exist some bindings to QML in non-JS, non-C++
languages. So I guess there is demand for Qt (or at least some parts of it) in
non-C++-worlds.

~~~
coldtea
> _Qt isn 't really C++-only anymore, at least with QML. Notwithstanding the
> use of JS for QML itself, there exist some bindings to QML in non-JS,
> non-C++ languages. So I guess there is demand for Qt (or at least some parts
> of it) in non-C++-worlds._

All of these worlds would be loading a ton of C++ QT base libs in any case.

------
distances
How does this compare to Incqlude
([https://inqlude.org](https://inqlude.org)), which names itself "The Qt
library archive"?

------
cjensen
Is there a list of packages anywhere? Seems strange to download a package
manager and just hope there are any packages.

~~~
mappu
You can find the list via `qpm list`.

Here's the current output at the time of writing:
[http://paste.debian.net/plain/432079](http://paste.debian.net/plain/432079)

------
schluchti
As someone mentioned including node.js to QML projects: Does anyone know if
there exists a QML port of fabric.js (or a similar canvas library?). I would
need a library to create all kind of geometric shapes (rectangles, circles,..)
and the ability to move them around, snap them to other objects, resize
them...

I am currently trying to implement that myself with the QML canvas, but it is
not that easy to get a smooth working library.

------
metachris
Is there a list of packages where I can see what could be installed?

Edit: There is not. But here is a list of current packages:
[https://github.com/Cutehacks/qpm/issues/28#issuecomment-2082...](https://github.com/Cutehacks/qpm/issues/28#issuecomment-208233790)

------
akerro
Next time before upvoting I must check if it's available on most major
platforms...

~~~
jrbarron
There should be binaries for Mac, Windows and Linux and the source should
compile on FreeBSD and others. What's missing?

~~~
akerro
I don't want to install Go to compile your tool to compile other tools to
compile my tool. Pretty much that.

~~~
jrbarron
Understandable :) Can I ask what platform you are on?

~~~
akerro
FreeBSD 32bit and ArchLinux 64

------
Ericson2314
Well, at the very least I hope they aren't trying to package C++ with this...

~~~
jrbarron
C++ works with qpm, but it doesn't package anything in binary form. It just
pulls down the source code from Github and generates some boilerplate to wire
it up to the application project.

------
dharma1
is there a list of current packages on qpm somewhere so far?

Also - any reason why couldn't just use npm with Qt?

~~~
omegote
Any reason why you would want to use npm with Qt? What does npm have to do
with Qt? Do we have to embed npm into EVERYTHING? Goddamn.

------
jflowers45
but is there a leftpad package available?

~~~
noobermin
[http://doc.qt.io/qt-4.8/qstring.html#rightJustified](http://doc.qt.io/qt-4.8/qstring.html#rightJustified)

:)

~~~
discreteevent
It's a method on a QString object? No, no, no! Look at all the other methods
on QString, what a mess! What happened to do one thing and do it well? This
needs to be in a separate downloadable package. That package could be so
simple and minimal.

My guess is that these Qt people probably use an IDE and want to be able to
immediately see what methods are available in the context of a QString. Then
they want code completion as they supply parameters to it. That's so OO. (Ok
the method is immutable and composable but its still blatant 90s object
orientation)

