diff mbox

[02/14] gnu: Add qtimageformats.

Message ID 20160610121025.6632-3-efraim@flashner.co.il
State New
Headers show

Commit Message

Efraim Flashner June 10, 2016, 12:10 p.m. UTC
* gnu/packages/qt.scm (qtimageformats): New variable.
---
 gnu/packages/qt.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Leo Famulari June 10, 2016, 4:30 p.m. UTC | #1
On Fri, Jun 10, 2016 at 03:10:13PM +0300, Efraim Flashner wrote:
> * gnu/packages/qt.scm (qtimageformats): New variable.

> +(define-public qtimageformats
> +  (package (inherit qtsvg)

These patches make me realize my understanding of package inheritance is
unclear.

If qtsvg is updated, but no other changes are made, will qtimageformats
(and all the other packages that inherit from qtsvg) need to be rebuilt
as well?

Looking at `guix refresh -l` and `guix gc --references` suggests the
answer is "no".

I know this is a contrived example; if qtsvg is updated, it's likely
that all the Qt packages will be updated as well.

> +    (name "qtimageformats")
> +    (version "5.6.1")
> +    (source (origin
> +             (method url-fetch)
> +             (uri (string-append "https://download.qt.io/official_releases/qt/"
> +                                 (version-major+minor version) "/" version
> +                                 "/submodules/" name "-opensource-src-"
> +                                 version ".tar.xz"))
> +             (sha256
> +              (base32
> +               "020v1148433zx4g87z2r8fgff32n0laajxqqsja1l3yzz7jbrwvl"))))))
> +
>  (define-public qjson
>    (package
>      (name "qjson")
> -- 
> 2.8.3
> 
>
Andreas Enge June 12, 2016, 2:12 p.m. UTC | #2
On Fri, Jun 10, 2016 at 12:30:45PM -0400, Leo Famulari wrote:
> On Fri, Jun 10, 2016 at 03:10:13PM +0300, Efraim Flashner wrote:
> > +(define-public qtimageformats
> > +  (package (inherit qtsvg)
> These patches make me realize my understanding of package inheritance is
> unclear.
> 
> If qtsvg is updated, but no other changes are made, will qtimageformats
> (and all the other packages that inherit from qtsvg) need to be rebuilt
> as well?
> 
> Looking at `guix refresh -l` and `guix gc --references` suggests the
> answer is "no".

My understanding is that not the package definition, but the derivation
counts. So for instance, if the version is increased in qtsvg, this new
version also appears in qtimageformats, but if it is set back there, not
even the package definition has changed.

So this should be safe; in a sense, the inheritance from qtsvg creates a
"qt build system"; since this is so far only used internally to build qt
itself, I think it is okay to not expose it to the exterior world.

However, another question: Are all the inputs for qtbase needed for all the
other modules, too, or could the list be trimmed?

Andreas
Efraim Flashner June 12, 2016, 8:20 p.m. UTC | #3
On Sun, Jun 12, 2016 at 04:12:21PM +0200, Andreas Enge wrote:
> On Fri, Jun 10, 2016 at 12:30:45PM -0400, Leo Famulari wrote:
> > On Fri, Jun 10, 2016 at 03:10:13PM +0300, Efraim Flashner wrote:
> > > +(define-public qtimageformats
> > > +  (package (inherit qtsvg)
> > These patches make me realize my understanding of package inheritance is
> > unclear.
> > 
> > If qtsvg is updated, but no other changes are made, will qtimageformats
> > (and all the other packages that inherit from qtsvg) need to be rebuilt
> > as well?
> > 
> > Looking at `guix refresh -l` and `guix gc --references` suggests the
> > answer is "no".
> 
> My understanding is that not the package definition, but the derivation
> counts. So for instance, if the version is increased in qtsvg, this new
> version also appears in qtimageformats, but if it is set back there, not
> even the package definition has changed.
> 
> So this should be safe; in a sense, the inheritance from qtsvg creates a
> "qt build system"; since this is so far only used internally to build qt
> itself, I think it is okay to not expose it to the exterior world.
> 
> However, another question: Are all the inputs for qtbase needed for all the
> other modules, too, or could the list be trimmed?
> 
> Andreas
> 

quite possibly the inputs could be shortened, but since they're all
using qmake for configure I don't really know how to check. The best I
have for cross-distro comparison is debian:
$ apt-cache depends libqt5svg5
libqt5svg5
PreDepends: dpkg
dpkg:i386
Depends: libc6
Depends: libqt5core5a
Depends: libqt5gui5
Depends: libqt5widgets5
Depends: libstdc++6
Depends: <qtbase-abi-5-5-1>
Depends: zlib1g

I don't think I've seen anything like <qtbase-abi-5-5-1> before, but I'm
assuming its the list of inputs/depends that qtbase-5.5.1 uses in
Debian. qtcore, qtgui and qtwidgets are all outputs of qtbase.
Andreas Enge June 14, 2016, 9:07 a.m. UTC | #4
On Sun, Jun 12, 2016 at 11:20:24PM +0300, Efraim Flashner wrote:
> quite possibly the inputs could be shortened, but since they're all
> using qmake for configure I don't really know how to check.

You could compile the packages and use "guix gc --references" to check
which of the inputs are used.

Two basic situations could occur:
- Essentially all inputs of qtbase are also needed for the other packages.
  Then in this special case, I think it does not matter too much to have
  added a few additional inputs, which in any case will have no effect on
  the build result or on installations.
- Only qtbase is used as an input, and the occasional additional one.
  Then I would add the inputs one by one by hand, until the package builds.
I think that the first case is more likely, and would be happy with you
pushing the packages then.

Andreas
Efraim Flashner June 14, 2016, 10:02 a.m. UTC | #5
On Tue, Jun 14, 2016 at 11:07:03AM +0200, Andreas Enge wrote:
> On Sun, Jun 12, 2016 at 11:20:24PM +0300, Efraim Flashner wrote:
> > quite possibly the inputs could be shortened, but since they're all
> > using qmake for configure I don't really know how to check.
> 
> You could compile the packages and use "guix gc --references" to check
> which of the inputs are used.
> 
> Two basic situations could occur:
> - Essentially all inputs of qtbase are also needed for the other packages.
>   Then in this special case, I think it does not matter too much to have
>   added a few additional inputs, which in any case will have no effect on
>   the build result or on installations.
> - Only qtbase is used as an input, and the occasional additional one.
>   Then I would add the inputs one by one by hand, until the package builds.
> I think that the first case is more likely, and would be happy with you
> pushing the packages then.
> 
> Andreas
> 

$ guix gc --references $(./pre-inst-env guix build qtsvg)

...

@ build-succeeded /gnu/store/1np6wm8mm9l8gljbr7qbknsbz8gz297j-qtsvg-5.6.1.drv -
   /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22
   /gnu/store/fikq4039zcbsa2wqlx33rq4kgp9gswk9-qtbase-5.6.1
   /gnu/store/hsxhfmjgh8m4c0pavq3gd3gcrn8zrgxj-zlib-1.2.8
   /gnu/store/lnrclizlj6kj5dag7f6fgc68nqybb941-mesa-11.0.9
   /gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib

$ guix gc --references $(./pre-inst-env guix build qtimageformats)

...

@ build-succeeded /gnu/store/7xsiyx1mampavj7c92by7ng8ml564grl-qtimageformats-5.6.1.drv -
     /gnu/store/39hhrf0sasq4qzmnz2nyji8xgzcwgj5h-libmng-2.0.3
     /gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22
     /gnu/store/fikq4039zcbsa2wqlx33rq4kgp9gswk9-qtbase-5.6.1
     /gnu/store/hsxhfmjgh8m4c0pavq3gd3gcrn8zrgxj-zlib-1.2.8
     /gnu/store/lnrclizlj6kj5dag7f6fgc68nqybb941-mesa-11.0.9
     /gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib

It looks like they don't need the full list of inputs, so I'll run
through them and see how much it can be cleaned up. The other thing I
notice is that qtbase and these two all have references to mesa, which
makes me think it may not need to be propagated in qtbase afterall. Then
again, removing it may cause some packages that count on qt/qtbase's
mesa as an input will come up a dependancy short.
diff mbox

Patch

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 9f0a0bb..6298a03 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -464,6 +464,20 @@  developers using C++ or QML, a CSS & JavaScript like language.")
                             (((string-append "INSTALL_ROOT)" qtbase))
                              (string-append "INSTALL_ROOT)" out)))))))))))
 
+(define-public qtimageformats
+  (package (inherit qtsvg)
+    (name "qtimageformats")
+    (version "5.6.1")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "https://download.qt.io/official_releases/qt/"
+                                 (version-major+minor version) "/" version
+                                 "/submodules/" name "-opensource-src-"
+                                 version ".tar.xz"))
+             (sha256
+              (base32
+               "020v1148433zx4g87z2r8fgff32n0laajxqqsja1l3yzz7jbrwvl"))))))
+
 (define-public qjson
   (package
     (name "qjson")