+ #t)))
+ ;; XXX: Commented due to cycle (see comment above.)
+ ;; (add-after 'install 'doc
+ ;; (lambda _
+ ;; (let ((share (string-append (assoc-ref %outputs "doc")
+ ;; "/share")))
+ ;; (mkdir-p share)
+ ;; (rename-file (string-append %output "/share/doc")
+ ;; (string-append share "/doc")))))
+ (add-after 'install 'gui-stuff
+ ;; Get the Qt horror dependencies out of the lib closure
+ (lambda _
+ (let ((outlib (string-append (assoc-ref %outputs "out") "/lib"))
+ (lib (string-append (assoc-ref %outputs "lib") "/lib")))
+ (mkdir-p outlib)
+ (rename-file (string-append lib "/cube-plugins")
+ (string-append outlib "/cube-plugins"))
+ (for-each (lambda (file)
+ (rename-file
+ file (string-append outlib "/" (basename file))))
+ (append (find-files lib "libgraphwidgetcommon-plugin\\..*")
+ (find-files lib "libcube4gui\\.so.*")))
+ #t)))
+ (add-after 'install 'move-include
+ ;; Most of the headers end up under %output for some reason,
+ ;; despite --includedir in configure.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((outinc (string-append (assoc-ref outputs "out")
+ "/include"))
+ (libinc (string-append (assoc-ref outputs "lib")
+ "/include")))
+ (for-each (lambda (file)
+ (let ((from (string-append outinc "/" file)))
+ (copy-recursively from libinc)
+ (delete-file-recursively from)))
+ '("cube" "cubew"))
+ #t)))
+
+ ;; XXX: This doesn't work because cube-config, which is needed for
+ ;; building stuff, sources cube-config-frontend. We don't want that
+ ;; in the lib output because it pulls in >1GB via QT.
+ ;;
+ ;; (add-after 'install 'cube-config
+ ;; (lambda _
+ ;; (let* ((lib (assoc-ref %outputs "lib"))
+ ;; (libbin (string-append lib "/bin")))
+ ;; (mkdir-p libbin)
+ ;; (system (string-append "mv " (assoc-ref %outputs "out")
+ ;; "/bin/cube-config* " libbin))
+ ;; (substitute* (list (string-append libbin "/cube-config"))
+ ;; (("^prefix=.*") (string-append "prefix=" lib))
+ ;; (("^exec_prefix=\"\\$\\{prefix\\}\"")
+ ;; (string-append "exec_prefix=" lib))))))
+ (add-after 'install 'cube-config
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((lib (assoc-ref outputs "lib"))
+ (libbin (string-append lib "/bin")))
+ (mkdir-p libbin)
+ (install-file (string-append %output "/bin/cube-config") libbin)
+ (install-file (string-append %output "/bin/cube-config-backend")
+ libbin)
+ (substitute* (list (string-append libbin "/cube-config"))
+ (("^source .*frontend.*$") "")
+ (((assoc-ref outputs "out")) lib))