gnu: tigervnc-server: Use new style inputs, gexps.
* gnu/packages/vnc.scm (%tigervnc-client-source): New variable.
(tigervnc-server): Move input fields after arguments.
[native-inputs]: Use new style and 'modify-inputs'.  Do not add
tigervnc-client regular inputs.
[configure-flags]: Use gexps, cons* instead of append.
[phases]: Use gexps.
{check}: Replace smiley with an explanatory comment.
{copy-tvnc-xserver}: Adjust default Makefile variables, which simplifies
needed bindings in other phases.
{build-tigervnc, build, install-tigervnc-aux, install}: Remove let*-bound
variables.
{build-tigervnc, build}: Honor PARALLEL-BUILD?.
			
			
This commit is contained in:
		
							parent
							
								
									31708431c5
								
							
						
					
					
						commit
						c93b249dc0
					
				
					 1 changed files with 76 additions and 86 deletions
				
			
		| 
						 | 
					@ -25,6 +25,7 @@
 | 
				
			||||||
(define-module (gnu packages vnc)
 | 
					(define-module (gnu packages vnc)
 | 
				
			||||||
  #:use-module (guix build-system cmake)
 | 
					  #:use-module (guix build-system cmake)
 | 
				
			||||||
  #:use-module (guix download)
 | 
					  #:use-module (guix download)
 | 
				
			||||||
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
  #:use-module (guix git-download)
 | 
					  #:use-module (guix git-download)
 | 
				
			||||||
  #:use-module ((guix licenses) #:prefix license:)
 | 
					  #:use-module ((guix licenses) #:prefix license:)
 | 
				
			||||||
  #:use-module (guix gexp)
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
| 
						 | 
					@ -207,6 +208,8 @@ and TLS encryption.  This package installs only the VNC client, the
 | 
				
			||||||
application which is needed to connect to VNC servers.")
 | 
					application which is needed to connect to VNC servers.")
 | 
				
			||||||
      (license license:gpl2))))
 | 
					      (license license:gpl2))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(define %tigervnc-client-source (package-source tigervnc-client))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; A VNC server is, in fact, an X server so it seems like a good idea
 | 
					;; A VNC server is, in fact, an X server so it seems like a good idea
 | 
				
			||||||
;; to build on the work already done for xorg-server package.  This is
 | 
					;; to build on the work already done for xorg-server package.  This is
 | 
				
			||||||
;; not entirely compatible with the recommendation in BUILDING.txt
 | 
					;; not entirely compatible with the recommendation in BUILDING.txt
 | 
				
			||||||
| 
						 | 
					@ -221,47 +224,27 @@ application which is needed to connect to VNC servers.")
 | 
				
			||||||
    (inherit xorg-server)
 | 
					    (inherit xorg-server)
 | 
				
			||||||
    (name "tigervnc-server")
 | 
					    (name "tigervnc-server")
 | 
				
			||||||
    (version (package-version tigervnc-client))
 | 
					    (version (package-version tigervnc-client))
 | 
				
			||||||
    (native-inputs
 | 
					 | 
				
			||||||
     `(("tigervnc-src" ,(package-source tigervnc-client))
 | 
					 | 
				
			||||||
       ("autoconf" ,autoconf)
 | 
					 | 
				
			||||||
       ("automake" ,automake)
 | 
					 | 
				
			||||||
       ("libtool" ,libtool)
 | 
					 | 
				
			||||||
       ("gettext-minimal" ,gettext-minimal)
 | 
					 | 
				
			||||||
       ("font-util" ,font-util)
 | 
					 | 
				
			||||||
       ("cmake" ,cmake)
 | 
					 | 
				
			||||||
       ("perl" ,perl)
 | 
					 | 
				
			||||||
       ,@(package-native-inputs tigervnc-client)
 | 
					 | 
				
			||||||
       ,@(package-inputs tigervnc-client)
 | 
					 | 
				
			||||||
       ,@(package-native-inputs xorg-server)))
 | 
					 | 
				
			||||||
    (inputs
 | 
					 | 
				
			||||||
     (modify-inputs (package-inputs xorg-server)
 | 
					 | 
				
			||||||
       (prepend perl coreutils xauth)))
 | 
					 | 
				
			||||||
    (propagated-inputs
 | 
					 | 
				
			||||||
     (modify-inputs (package-propagated-inputs xorg-server)
 | 
					 | 
				
			||||||
       (prepend xauth)))
 | 
					 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     (substitute-keyword-arguments
 | 
					     (substitute-keyword-arguments
 | 
				
			||||||
         (package-arguments xorg-server)
 | 
					         (package-arguments xorg-server)
 | 
				
			||||||
       ((#:configure-flags flags)
 | 
					       ((#:configure-flags flags)
 | 
				
			||||||
        `(append '("--with-pic"         ; Taken from BUILDING.txt
 | 
					        #~(cons* "--with-pic"           ; Taken from BUILDING.txt
 | 
				
			||||||
                   "--without-dtrace"
 | 
					                 "--without-dtrace"
 | 
				
			||||||
                   "--disable-static"
 | 
					                 "--disable-static"
 | 
				
			||||||
                   "--disable-dri2"
 | 
					                 "--disable-dri2"
 | 
				
			||||||
                   "--disable-xinerama"
 | 
					                 "--disable-xinerama"
 | 
				
			||||||
                   "--disable-xvfb"
 | 
					                 "--disable-xvfb"
 | 
				
			||||||
                   "--disable-xnest"
 | 
					                 "--disable-xnest"
 | 
				
			||||||
                   "--disable-xorg"
 | 
					                 "--disable-xorg"
 | 
				
			||||||
                   "--disable-dmx"
 | 
					                 "--disable-dmx"
 | 
				
			||||||
                   "--disable-xwin"
 | 
					                 "--disable-xwin"
 | 
				
			||||||
                   "--disable-xephyr"
 | 
					                 "--disable-xephyr"
 | 
				
			||||||
                   "--disable-kdrive"
 | 
					                 "--disable-kdrive"
 | 
				
			||||||
                   ;; "--disable-config-dbus" ; This was a warning.
 | 
					                 "--disable-config-hal"
 | 
				
			||||||
                   "--disable-config-hal"
 | 
					                 "--disable-config-udev"
 | 
				
			||||||
                   "--disable-config-udev"
 | 
					                 "--disable-dri2"
 | 
				
			||||||
                   "--disable-dri2"
 | 
					                 "--enable-glx"
 | 
				
			||||||
                   ;; "--enable-install-libxf86config" ; This, too, was a warning.
 | 
					                 (delete "--enable-xephyr" #$flags)))
 | 
				
			||||||
                   "--enable-glx")
 | 
					 | 
				
			||||||
                 (delete "--enable-xephyr" ,flags)))
 | 
					 | 
				
			||||||
       ((#:modules modules)
 | 
					       ((#:modules modules)
 | 
				
			||||||
        `(append '((ice-9 ftw)
 | 
					        `(append '((ice-9 ftw)
 | 
				
			||||||
                   (ice-9 match)
 | 
					                   (ice-9 match)
 | 
				
			||||||
| 
						 | 
					@ -269,55 +252,62 @@ application which is needed to connect to VNC servers.")
 | 
				
			||||||
                   (guix build gnu-build-system))
 | 
					                   (guix build gnu-build-system))
 | 
				
			||||||
                 modules))
 | 
					                 modules))
 | 
				
			||||||
       ((#:phases phases)
 | 
					       ((#:phases phases)
 | 
				
			||||||
        `(modify-phases ,phases
 | 
					        #~(modify-phases #$phases
 | 
				
			||||||
           (delete 'check)              ;)
 | 
					            (delete 'check)             ;no test suite
 | 
				
			||||||
           (add-after 'unpack 'copy-tvnc-xserver
 | 
					            (add-after 'unpack 'copy-tvnc-xserver
 | 
				
			||||||
             (lambda _
 | 
					              (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
               (let*
 | 
					                (copy-recursively (search-input-directory inputs "unix/xserver")
 | 
				
			||||||
                   ((tvnc-src (assoc-ref %build-inputs "tigervnc-src"))
 | 
					                                  ".")
 | 
				
			||||||
                    (tvnc-xserver (string-append tvnc-src "/unix/xserver")))
 | 
					                ;; Adjust Makefile variables default values to simplify usage.
 | 
				
			||||||
                 (copy-recursively tvnc-xserver "."))))
 | 
					                (substitute* "hw/vnc/Makefile.am"
 | 
				
			||||||
           (add-after 'copy-tvnc-xserver 'patch-xserver
 | 
					                  (("(TIGERVNC_SRCDIR=).*" _ head)
 | 
				
			||||||
             (lambda _
 | 
					                   (string-append head #$%tigervnc-client-source "\n"))
 | 
				
			||||||
               (invoke "patch" "-p1" "-i"
 | 
					                  (("(TIGERVNC_BUILDDIR=).*" _ head)
 | 
				
			||||||
                       (string-append (assoc-ref %build-inputs "tigervnc-src")
 | 
					                   (string-append head (getcwd) "/tigervnc-build\n")))))
 | 
				
			||||||
                                      "/unix/xserver21.1.1.patch"))
 | 
					            (add-after 'copy-tvnc-xserver 'patch-xserver
 | 
				
			||||||
               (invoke "autoreconf" "-fiv")))
 | 
					              (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
           (add-before 'build 'build-tigervnc
 | 
					                (invoke "patch" "-p1" "-i"
 | 
				
			||||||
             (lambda _
 | 
					                        (search-input-file inputs "unix/xserver21.1.1.patch"))
 | 
				
			||||||
               (let* ((out (assoc-ref %outputs "out"))
 | 
					                (invoke "autoreconf" "-fiv")))
 | 
				
			||||||
                      (tvnc-src (assoc-ref %build-inputs "tigervnc-src"))
 | 
					            (add-before 'build 'build-tigervnc
 | 
				
			||||||
                      (tvnc-build (string-append (getcwd) "/tigervnc-build")))
 | 
					              (lambda* (#:key parallel-build? #:allow-other-keys)
 | 
				
			||||||
                 (mkdir-p tvnc-build)
 | 
					                (mkdir-p "tigervnc-build")
 | 
				
			||||||
                 (with-directory-excursion tvnc-build
 | 
					                (with-directory-excursion "tigervnc-build"
 | 
				
			||||||
                   (invoke "cmake" "-G" "Unix Makefiles"
 | 
					                  (invoke "cmake" "-G" "Unix Makefiles"
 | 
				
			||||||
                           (string-append "-DCMAKE_INSTALL_PREFIX=" out)
 | 
					                          (string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
 | 
				
			||||||
                           tvnc-src)
 | 
					                          #$%tigervnc-client-source)
 | 
				
			||||||
                   (invoke "make" "-j" (number->string (parallel-job-count)))))))
 | 
					                  (invoke "make" "-j" (number->string (if parallel-build?
 | 
				
			||||||
           (replace 'build
 | 
					                                                          (parallel-job-count)
 | 
				
			||||||
             (lambda _
 | 
					                                                          1))))))
 | 
				
			||||||
               (let*  ((tvnc-src (assoc-ref %build-inputs "tigervnc-src"))
 | 
					            (replace 'build
 | 
				
			||||||
                       (tvnc-build (string-append (getcwd) "/tigervnc-build"))
 | 
					              (lambda* (#:key parallel-build? #:allow-other-keys)
 | 
				
			||||||
                       (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src))
 | 
					                (invoke "make" "-j" (number->string (if parallel-build?
 | 
				
			||||||
                       (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build)))
 | 
					                                                        (parallel-job-count)
 | 
				
			||||||
                 (invoke "make" srcarg buildarg "-j"
 | 
					                                                        1)))))
 | 
				
			||||||
                         (number->string (parallel-job-count))))))
 | 
					            (add-before 'install 'install-tigervnc-aux
 | 
				
			||||||
           (add-before 'install 'install-tigervnc-aux
 | 
					              (lambda _
 | 
				
			||||||
             (lambda _
 | 
					                (invoke "make" "-C" "tigervnc-build/unix" "install")))
 | 
				
			||||||
               (let*  ((out (assoc-ref %outputs 'out))
 | 
					            (replace 'install
 | 
				
			||||||
                       (tvnc-src (assoc-ref %build-inputs "tigervnc-src"))
 | 
					              (lambda _
 | 
				
			||||||
                       (tvnc-build (string-append (getcwd) "/tigervnc-build"))
 | 
					                (invoke "make" "install")))))))
 | 
				
			||||||
                       (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src))
 | 
					    (native-inputs
 | 
				
			||||||
                       (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build)))
 | 
					     (modify-inputs (append (package-native-inputs xorg-server)
 | 
				
			||||||
                 (with-directory-excursion (string-append tvnc-build "/unix")
 | 
					                            (package-native-inputs tigervnc-client))
 | 
				
			||||||
                   (invoke "make" srcarg buildarg "install")))))
 | 
					       (append %tigervnc-client-source
 | 
				
			||||||
           (replace 'install
 | 
					               autoconf
 | 
				
			||||||
             (lambda* _
 | 
					               automake
 | 
				
			||||||
               (let*  ((tvnc-src (assoc-ref %build-inputs "tigervnc-src"))
 | 
					               libtool
 | 
				
			||||||
                       (tvnc-build (string-append (getcwd) "/tigervnc-build"))
 | 
					               gettext-minimal
 | 
				
			||||||
                       (srcarg (string-append "TIGERVNC_SRCDIR=" tvnc-src))
 | 
					               font-util
 | 
				
			||||||
                       (buildarg (string-append "TIGERVNC_BUILDDIR=" tvnc-build)))
 | 
					               cmake
 | 
				
			||||||
                 (invoke "make" "install" srcarg buildarg))))))))
 | 
					               perl)))
 | 
				
			||||||
 | 
					    (inputs
 | 
				
			||||||
 | 
					     (modify-inputs (append (package-inputs xorg-server)
 | 
				
			||||||
 | 
					                            (package-inputs tigervnc-client))
 | 
				
			||||||
 | 
					       (prepend perl coreutils xauth)))
 | 
				
			||||||
 | 
					    (propagated-inputs
 | 
				
			||||||
 | 
					     (modify-inputs (package-propagated-inputs xorg-server)
 | 
				
			||||||
 | 
					       (prepend xauth)))
 | 
				
			||||||
    (description "TigerVNC is a client/server implementation of VNC (Virtual
 | 
					    (description "TigerVNC is a client/server implementation of VNC (Virtual
 | 
				
			||||||
Network Computing).  It provides enough performance to run even 3D and video
 | 
					Network Computing).  It provides enough performance to run even 3D and video
 | 
				
			||||||
applications.  It also provides extensions for advanced authentication methods
 | 
					applications.  It also provides extensions for advanced authentication methods
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue