mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-30 22:36:50 +01:00
gnu: tigervnc-server: Move source production into origin snippet.
This will make it possible to patch command references in source files, and also makes it more transparent as to what sources get used. * gnu/packages/vnc.scm (tigervnc-server): Re-flow comment. [source]: Inherit from xorg-server. Add a snippet. Use a patch to apply the xserver patch. Fix file name. [phases]{copy-tvnc-xserver, patch-xserver}: Delete phases. {build-tigervnc, install-tigervnc-aux}: Adjust accordingly.
This commit is contained in:
parent
c93b249dc0
commit
0debec9f2d
1 changed files with 42 additions and 28 deletions
|
@ -210,20 +210,49 @@ (define-public tigervnc-client
|
||||||
|
|
||||||
(define %tigervnc-client-source (package-source tigervnc-client))
|
(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
|
||||||
;; to build on the work already done for xorg-server package. This is
|
;; on the work already done for xorg-server package. This is not entirely
|
||||||
;; not entirely compatible with the recommendation in BUILDING.txt
|
;; compatible with the recommendation in BUILDING.txt where the client is
|
||||||
;; where the client is built first, then the source code of the X
|
;; built first, then the source code of the X server is copied into a subdir
|
||||||
;; server is copied into a subdir of the build directory, patched with
|
;; of the build directory, patched with VNC additions and then build and
|
||||||
;; VNC additions and then build and installed as Xvnc. The procedure
|
;; installed as Xvnc. The procedure was turned around, where TigerVNC code is
|
||||||
;; was turned around, where TigerVNC code is downloaded and built
|
;; downloaded and built inside the Guix X server build dir. Also, the VNC
|
||||||
;; inside the Guix X server build dir. Also, the VNC patching process
|
;; patching process for the X server is automated in a straightforward manner.
|
||||||
;; for the X server is automated in a straightforward manner.
|
|
||||||
(define-public tigervnc-server
|
(define-public tigervnc-server
|
||||||
(package
|
(package
|
||||||
(inherit xorg-server)
|
(inherit xorg-server)
|
||||||
(name "tigervnc-server")
|
(name "tigervnc-server")
|
||||||
(version (package-version tigervnc-client))
|
(version (package-version tigervnc-client))
|
||||||
|
(source
|
||||||
|
(origin
|
||||||
|
(inherit (package-source xorg-server))
|
||||||
|
(modules '((guix build utils)))
|
||||||
|
(snippet
|
||||||
|
#~(begin
|
||||||
|
;; Copy the VNC extension into the xorg-server sources.
|
||||||
|
(copy-recursively #$(file-append %tigervnc-client-source
|
||||||
|
"/unix/xserver")
|
||||||
|
".")
|
||||||
|
;; Include a full copy of tigervnc-client sources, so that the
|
||||||
|
;; complete sources involved are available and can be edited during
|
||||||
|
;; the build.
|
||||||
|
(copy-recursively #$%tigervnc-client-source "tigervnc-client")
|
||||||
|
;; Adjust the VNC extension build system files so that it refers
|
||||||
|
;; to it.
|
||||||
|
(substitute* "hw/vnc/Makefile.am"
|
||||||
|
(("(TIGERVNC_SRCDIR=).*" _ head)
|
||||||
|
(string-append head "$(CURDIR)/../../tigervnc-client\n"))
|
||||||
|
(("(TIGERVNC_BUILDDIR=).*" _ head)
|
||||||
|
(string-append head
|
||||||
|
"$(CURDIR)/../../tigervnc-client/build\n")))
|
||||||
|
;; Ensure the Autotools build system gets re-bootstrapped.
|
||||||
|
(delete-file "configure")))
|
||||||
|
;; Patch the xorg-server build system so that it builds the VNC
|
||||||
|
;; extension.
|
||||||
|
(patches (cons (file-append %tigervnc-client-source
|
||||||
|
"/unix/xserver21.1.1.patch")
|
||||||
|
(origin-patches (package-source xorg-server))))
|
||||||
|
(file-name (string-append name "-" version ".tar.xz"))))
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments
|
(substitute-keyword-arguments
|
||||||
(package-arguments xorg-server)
|
(package-arguments xorg-server)
|
||||||
|
@ -254,28 +283,13 @@ (define-public tigervnc-server
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
#~(modify-phases #$phases
|
#~(modify-phases #$phases
|
||||||
(delete 'check) ;no test suite
|
(delete 'check) ;no test suite
|
||||||
(add-after 'unpack 'copy-tvnc-xserver
|
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
|
||||||
(copy-recursively (search-input-directory inputs "unix/xserver")
|
|
||||||
".")
|
|
||||||
;; Adjust Makefile variables default values to simplify usage.
|
|
||||||
(substitute* "hw/vnc/Makefile.am"
|
|
||||||
(("(TIGERVNC_SRCDIR=).*" _ head)
|
|
||||||
(string-append head #$%tigervnc-client-source "\n"))
|
|
||||||
(("(TIGERVNC_BUILDDIR=).*" _ head)
|
|
||||||
(string-append head (getcwd) "/tigervnc-build\n")))))
|
|
||||||
(add-after 'copy-tvnc-xserver 'patch-xserver
|
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
|
||||||
(invoke "patch" "-p1" "-i"
|
|
||||||
(search-input-file inputs "unix/xserver21.1.1.patch"))
|
|
||||||
(invoke "autoreconf" "-fiv")))
|
|
||||||
(add-before 'build 'build-tigervnc
|
(add-before 'build 'build-tigervnc
|
||||||
(lambda* (#:key parallel-build? #:allow-other-keys)
|
(lambda* (#:key parallel-build? #:allow-other-keys)
|
||||||
(mkdir-p "tigervnc-build")
|
(mkdir-p "tigervnc-client/build")
|
||||||
(with-directory-excursion "tigervnc-build"
|
(with-directory-excursion "tigervnc-client/build"
|
||||||
(invoke "cmake" "-G" "Unix Makefiles"
|
(invoke "cmake" "-G" "Unix Makefiles"
|
||||||
(string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
|
(string-append "-DCMAKE_INSTALL_PREFIX=" #$output)
|
||||||
#$%tigervnc-client-source)
|
"..")
|
||||||
(invoke "make" "-j" (number->string (if parallel-build?
|
(invoke "make" "-j" (number->string (if parallel-build?
|
||||||
(parallel-job-count)
|
(parallel-job-count)
|
||||||
1))))))
|
1))))))
|
||||||
|
@ -286,7 +300,7 @@ (define-public tigervnc-server
|
||||||
1)))))
|
1)))))
|
||||||
(add-before 'install 'install-tigervnc-aux
|
(add-before 'install 'install-tigervnc-aux
|
||||||
(lambda _
|
(lambda _
|
||||||
(invoke "make" "-C" "tigervnc-build/unix" "install")))
|
(invoke "make" "-C" "tigervnc-client/build/unix" "install")))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda _
|
(lambda _
|
||||||
(invoke "make" "install")))))))
|
(invoke "make" "install")))))))
|
||||||
|
|
Loading…
Reference in a new issue