diff mbox series

[bug#67257,v2,2/2] gnu: Add x2goclient.

Message ID 89c8896f76e5c5e3f68dfd7f36cac23ad3a79330.1708638616.git.steve@futurile.net
State New
Headers show
Series re: add x2goclient and nx-libs | expand

Commit Message

Steve George Feb. 22, 2024, 10:08 p.m. UTC
From: nicodebo <nicolas.debonnaire@gmail.com>

* gnu/packages/nx.scm (x2goclient): New variable.

Reviewed-by: Steve George <steve@futurile.net>

Change-Id: Ib0ff6328ede3fb4a0b48462ac1a003438c53c862
---
 gnu/packages/nx.scm | 79 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

Comments

Ludovic Courtès Feb. 27, 2024, 10:02 a.m. UTC | #1
Steve George <steve@futurile.net> skribis:

> From: nicodebo <nicolas.debonnaire@gmail.com>
>
> * gnu/packages/nx.scm (x2goclient): New variable.
>
> Reviewed-by: Steve George <steve@futurile.net>
>
> Change-Id: Ib0ff6328ede3fb4a0b48462ac1a003438c53c862

[...]

> +                        (substitute* "src/onmainwindow.cpp"
> +                          (("/usr/sbin/sshd")
> +                           (which "sshd"))))))

Rather use ‘search-input-file’ here, as mentioned in my other message.

> +    (native-inputs (list pkg-config
> +                         qttools-5
> +                         qtbase-5
> +                         qtx11extras
> +                         qtsvg-5
> +                         libssh
> +                         cups
> +                         libxpm
> +                         openldap
> +                         gcc-toolchain))

You can omit ‘gcc-toolchain’.  Most likely, everything but ‘pkg-config’
and ‘qttools-5’ shold be in ‘inputs’ rather than ‘native-inputs’.

> +    (propagated-inputs (list nx-libs
> +                             openssh))

Don’t propagate OpenSSH: it should be up to the user to install it if
they want it, to avoid being too intrusive.

‘nx-libs’ probably doesn’t need to be propagated either and can be in
‘inputs’, no?

Could you send updated patches?

Thanks!

Ludo’.
Maxim Cournoyer March 10, 2024, 12:45 a.m. UTC | #2
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

> Steve George <steve@futurile.net> skribis:
>
>> From: nicodebo <nicolas.debonnaire@gmail.com>
>>
>> * gnu/packages/nx.scm (x2goclient): New variable.
>>
>> Reviewed-by: Steve George <steve@futurile.net>
>>
>> Change-Id: Ib0ff6328ede3fb4a0b48462ac1a003438c53c862
>
> [...]
>
>> +                        (substitute* "src/onmainwindow.cpp"
>> +                          (("/usr/sbin/sshd")
>> +                           (which "sshd"))))))
>
> Rather use ‘search-input-file’ here, as mentioned in my other message.

Done.

>> +    (native-inputs (list pkg-config
>> +                         qttools-5
>> +                         qtbase-5
>> +                         qtx11extras
>> +                         qtsvg-5
>> +                         libssh
>> +                         cups
>> +                         libxpm
>> +                         openldap
>> +                         gcc-toolchain))
>
> You can omit ‘gcc-toolchain’.  Most likely, everything but ‘pkg-config’
> and ‘qttools-5’ shold be in ‘inputs’ rather than ‘native-inputs’.

Done.

>> +    (propagated-inputs (list nx-libs
>> +                             openssh))
>
> Don’t propagate OpenSSH: it should be up to the user to install it if
> they want it, to avoid being too intrusive.

I've moved it to inputs; its sshd command is substituted in a phase.

> ‘nx-libs’ probably doesn’t need to be propagated either and can be in
> ‘inputs’, no?

Agreed.

Here's the diff I've now applied:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/nx.scm
@@ -35,6 +35,7 @@ (define-module (gnu packages nx)
   #:use-module (gnu packages patchutils)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages ssh)
@@ -172,61 +173,72 @@ (define-public x2goclient
         (base32 "0g6aba8kpsixq4486a8mga945lp31y0mzwa2krs5qqiiip3v72xb"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; there aren't any tests
-       #:phases (modify-phases %standard-phases
-                  (delete 'configure)
-                  (add-before 'build 'fix-makefile
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (etc (string-append out "/etc")))
-                        (mkdir-p etc)
-                        (substitute* "Makefile"
-                          (("= 4")
-                           "= 5") ;use qt5 instead of qt4
-                          (("-o root -g root") ;from archlinux
-                           "")
-                          (("/usr/local")
-                           out)
-                          (("/etc/x2go")
-                           etc)
-                          ;; Workaround to turn off invoking lrelease because
-                          ;; it fails with a warning about qmake spec
-                          (("lrelease")
-                           "true")
-                          (("qmake")
-                           (which "qmake")))
-                        (substitute* "src/onmainwindow.cpp"
-                          (("/usr/sbin/sshd")
-                           (which "sshd"))))))
-                  ;; Avoid man2html by calling build_client then install_man
-                  (replace 'build
-                    (lambda _
-                      (invoke "make" "build_client")))
-                  (add-after 'build 'build-man
-                    (lambda _
-                      (invoke "make" "install_man")))
-                  ;; Due to lrelease workaround above: run lrelease on each
-                  ;; individual .ts file
-                  (add-after 'build 'compile-ts-files
-                    (lambda _
-                      (for-each (lambda (file)
-                                  (invoke "lrelease" file))
-                                (find-files "./" "\\.ts$")))))))
-    (native-inputs (list pkg-config
-                         qttools-5
-                         qtbase-5
-                         qtx11extras
-                         qtsvg-5
-                         libssh
-                         cups
-                         libxpm
-                         openldap
-                         gcc-toolchain))
-    (propagated-inputs (list nx-libs
-                             openssh))
+     (list
+      #:tests? #f                       ;no test suite
+      #:make-flags
+      #~(list (string-append "SHELL="
+                             (search-input-file %build-inputs "bin/bash"))
+              "QT_VERSION=5"
+              "INSTALL_DIR=install -d -m 755"
+              "INSTALL_FILE=install -m 644"
+              "INSTALL_PROGRAM=install -m 755"
+              (string-append "PREFIX=" #$output)
+              (string-append "ETCDIR=" #$output "/etc"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (add-before 'build 'patch-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "src/onmainwindow.cpp"
+                (("/usr/sbin/sshd")
+                 (search-input-file inputs "sbin/sshd"))))))))
+    (native-inputs
+     (list man2html
+           pkg-config
+           qtbase-5
+           qttools-5))
+    (inputs
+     (list cups
+           libssh
+           libxpm
+           nx-libs
+           openldap
+           openssh
+           pulseaudio
+           qtbase-5
+           qtx11extras
+           qtsvg-5))
     (synopsis "Remote desktop and application solution")
     (description
-     "X2goclient allows you to connect to a remote graphical desktop over the
-network through SSH.")
-    (home-page "http://x2go.org/")
+     "X2Go enables you to access a graphical desktop of a computer via
+SSH (Secure Shell).  This package provides the X2Go Client, which can connect
+to the X2Go Server.  Basic features of X2Go include:
+@itemize
+@item
+Graphical remote desktop that works well over both low bandwidth and high
+bandwidth connections
+@item
+The ability to disconnect and reconnect to a session, even from another
+client
+@item
+Support for sound
+@item
+Support for as many simultaneous users as the computer's resources will
+allow
+@item
+Traffic is securely tunneled over SSH
+@item
+File sharing from client to server
+@item
+Printer sharing from client to server
+@item
+Easily select from multiple desktop environments (e.g., MATE, GNOME, KDE)
+@item
+Remote support possible via desktop sharing
+@item
+The ability to access single applications by specifying the name of the
+desired executable in the client configuration or selecting one of the
+pre-defined common applications.
+@end itemize")
+    (home-page "https://wiki.x2go.org/doku.php")
     (license license:gpl2)))
--8<---------------cut here---------------end--------------->8---

Some changes:

1. Use gexps.
2. Use https home-page.
3. Expand description.
4. Add pulseaudio
5. Use make flags instead of modifying the build system
6. Add pulseaudio to inputs
7. Remove workarounds for lrelease; the qttools package is now fixed to
avoid this problem

I think that's it!

Now all that's left is to add x2goserver and an accompanying system
service :-).
diff mbox series

Patch

diff --git a/gnu/packages/nx.scm b/gnu/packages/nx.scm
index 92542c02a7b..be00e466fec 100644
--- a/gnu/packages/nx.scm
+++ b/gnu/packages/nx.scm
@@ -16,19 +16,25 @@ 
 (define-module (gnu packages nx)
   #:use-module (guix build utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages commencement)
+  #:use-module (gnu packages cups)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages man)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages openldap)
   #:use-module (gnu packages patchutils)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages ssh)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
@@ -139,3 +145,76 @@  (define-public nx-libs
 developers and TheQVD.")
     (home-page "https://github.com/ArcticaProject/nx-libs")
     (license license:gpl2)))
+
+(define-public x2goclient
+  (package
+    (name "x2goclient")
+    (version "4.1.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://code.x2go.org/releases/source/x2goclient/x2goclient-"
+             version ".tar.gz"))
+       (sha256
+        (base32 "0g6aba8kpsixq4486a8mga945lp31y0mzwa2krs5qqiiip3v72xb"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; there aren't any tests
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-before 'build 'fix-makefile
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (etc (string-append out "/etc")))
+                        (mkdir-p etc)
+                        (substitute* "Makefile"
+                          (("= 4")
+                           "= 5") ;use qt5 instead of qt4
+                          (("-o root -g root") ;from archlinux
+                           "")
+                          (("/usr/local")
+                           out)
+                          (("/etc/x2go")
+                           etc)
+                          ;; Workaround to turn off invoking lrelease because
+                          ;; it fails with a warning about qmake spec
+                          (("lrelease")
+                           "true")
+                          (("qmake")
+                           (which "qmake")))
+                        (substitute* "src/onmainwindow.cpp"
+                          (("/usr/sbin/sshd")
+                           (which "sshd"))))))
+                  ;; Avoid man2html by calling build_client then install_man
+                  (replace 'build
+                    (lambda _
+                      (invoke "make" "build_client")))
+                  (add-after 'build 'build-man
+                    (lambda _
+                      (invoke "make" "install_man")))
+                  ;; Due to lrelease workaround above: run lrelease on each
+                  ;; individual .ts file
+                  (add-after 'build 'compile-ts-files
+                    (lambda _
+                      (for-each (lambda (file)
+                                  (invoke "lrelease" file))
+                                (find-files "./" "\\.ts$")))))))
+    (native-inputs (list pkg-config
+                         qttools-5
+                         qtbase-5
+                         qtx11extras
+                         qtsvg-5
+                         libssh
+                         cups
+                         libxpm
+                         openldap
+                         gcc-toolchain))
+    (propagated-inputs (list nx-libs
+                             openssh))
+    (synopsis "Remote desktop and application solution")
+    (description
+     "X2goclient allows you to connect to a remote graphical desktop over the
+network through SSH.")
+    (home-page "http://x2go.org/")
+    (license license:gpl2)))