[PATCH 0/2] add x2goclient

  • Done
  • quality assurance status badge
Details
4 participants
  • Ludovic Courtès
  • Maxim Cournoyer
  • nicodebo
  • Steve George
Owner
Somebody
Submitted by
nicodebo
Severity
normal
N
N
nicodebo wrote on 17 Nov 2023 19:46
(address . guix-patches@gnu.org)(name . nicodebo)(address . n.debonnaire@gmail.com)
cover.1700243996.git.n.debonnaire@gmail.com
This series of patches add x2goclient and its dependency

nicodebo (2):
Add nx-libs
Add x2goclient

gnu/packages/nx.scm | 229 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 229 insertions(+)
create mode 100644 gnu/packages/nx.scm


base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94
--
2.41.0
N
N
nicodebo wrote on 18 Nov 2023 08:59
[PATCH 1/2] Add nx-libs
(address . 67257@debbugs.gnu.org)(name . nicodebo)(address . nicolas.debonnaire@gmail.com)
0f4bcaac061c602c21179b8f9c6a6c324d450094.1700243996.git.n.debonnaire@gmail.com
From: nicodebo <nicolas.debonnaire@gmail.com>

Change-Id: I13e088521d5e5577fed5d6a4b10867ca10f4293f
---
gnu/packages/nx.scm | 140 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 140 insertions(+)
create mode 100644 gnu/packages/nx.scm

Toggle diff (148 lines)
diff --git a/gnu/packages/nx.scm b/gnu/packages/nx.scm
new file mode 100644
index 0000000000..9a2ec68ee9
--- /dev/null
+++ b/gnu/packages/nx.scm
@@ -0,0 +1,140 @@
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages nx)
+ #:use-module (gnu packages autotools)
+ #:use-module (gnu packages commencement)
+ #:use-module (gnu packages glib)
+ #:use-module (gnu packages gtk)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages onc-rpc)
+ #: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 xdisorg)
+ #:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg)
+ #:use-module (guix build utils)
+ #:use-module (guix build-system gnu)
+ #:use-module (guix git-download)
+ #:use-module (guix licenses)
+ #:use-module (guix packages))
+
+(define-public nx-libs
+ (package
+ (name "nx-libs")
+ (version "3.5.99.27")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ArcticaProject/nx-libs")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ykbza39ksycpyydaiwwbp7hkmdk96v7b36pn989k39lhfwnn8kz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'replace-shebang-nxdialog
+ (lambda _
+ (substitute* "nxdialog/bin/nxdialog"
+ (("#!/usr/bin/env python")
+ (string-append "#!"
+ (which "python3"))))))
+ (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"
+ (("^gzip -f") "gzip -f -n") ;; reproducible build
+ (("/usr/local")
+ out)
+ (("/etc/nxagent")
+ etc)
+ (("./configure")
+ (string-append "CONFIG_SHELL="
+ (which "sh")
+ " SHELL="
+ (which "sh")
+ " "
+ (which "sh")
+ " ./configure")))
+ (substitute* '("nx-X11/config/cf/site.def")
+ (("#include <host.def>")
+ (string-append "#include <host.def>" "\n"
+ "#define BourneShell "
+ (which "sh")))
+ (("/usr/local")
+ out))
+ ;; Workaround the following error during the build
+ ;; process: invalid input: ("_" #<procedure which (program)>)
+ (substitute* '("nx-X11/Makefile")
+ (("which")
+ "echo"))
+ #t)))
+ (replace 'build
+ (lambda _
+ (invoke "make" "IMAKE_DEFINES=\"-DUseTIRPC=1\"") #t))
+ (add-before 'validate-runpath 'link-libraries
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib (string-append out "/lib"))
+ (lib-nx-x11 (string-append lib "/nx/X11")))
+ ;; TODO: Should I use symlink instead of install-file ?
+ (for-each (lambda (file)
+ (install-file file lib-nx-x11))
+ (list (string-append lib "/libXcomp.so.3")
+ (string-append lib
+ "/libXcompshad.so.3")
+ (string-append lib "/libNX_X11.so.6")))
+ #t))))))
+ (native-inputs (list autoconf
+ automake
+ libtool
+ pkg-config
+ libpng
+ libjpeg-turbo
+ xkbcomp
+ libxfont
+ libxdamage
+ libxrandr
+ libxtst
+ libxext
+ libxcomposite
+ libxinerama
+ libxpm
+ libxml2
+ font-util
+ pixman
+ gccmakedep
+ imake
+ quilt
+ libtirpc
+ gcc-toolchain))
+ ;; python-pygobject inputs: fix `import gi` error when executing nxdialog
+ ;; gtk+: also needed at runtime by the `gi` python librairy
+ (propagated-inputs (list perl python-3 python-2 python-pygobject gtk+))
+ (synopsis "NX remote desktop library")
+ (description
+ "NX technology also known as NX or NoMachine is a protocol that enables
+remote desktop access. It's maintained by the artica project, x2go
+developpers and TheQVD.")
+ (home-page "https://github.com/ArcticaProject/nx-libs")
+ (license gpl2)))
--
2.41.0
N
N
nicodebo wrote on 18 Nov 2023 08:59
[PATCH 2/2] Add x2goclient
(address . 67257@debbugs.gnu.org)(name . nicodebo)(address . nicolas.debonnaire@gmail.com)
c8d41cbd83fc493d63e55d9a77fa879598dac5dd.1700243996.git.n.debonnaire@gmail.com
From: nicodebo <nicolas.debonnaire@gmail.com>

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

Toggle diff (119 lines)
diff --git a/gnu/packages/nx.scm b/gnu/packages/nx.scm
index 9a2ec68ee9..dd336b309f 100644
--- a/gnu/packages/nx.scm
+++ b/gnu/packages/nx.scm
@@ -16,19 +16,25 @@
(define-module (gnu packages nx)
#: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)
#:use-module (guix build utils)
#:use-module (guix build-system gnu)
+ #:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix licenses)
#:use-module (guix packages))
@@ -138,3 +144,86 @@ (define-public nx-libs
developpers and TheQVD.")
(home-page "https://github.com/ArcticaProject/nx-libs")
(license gpl2)))
+
+(define-public x2goclient
+ (package
+ (name "x2goclient")
+ (version "4.1.2.3")
+ (source
+ (origin
+ (method url-fetch)
+ ;; the tar.gz was checked against x2goclient-4.1.2.3.tar.gz.md5
+ ;; provided by x2go team
+ (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
+ #: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)
+ ;; KLUDGE part1 (from guix package smplayer)
+ ;; A KLUDGE to turn off invoking lrelease on the
+ ;; project for now, because it fails consistently
+ ;; with "WARNING: Could not find qmake spec
+ ;; 'default'". See below.
+ (("lrelease")
+ "true")
+ (("qmake")
+ (which "qmake")))
+ (substitute* "src/onmainwindow.cpp"
+ (("/usr/sbin/sshd")
+ (which "sshd"))) ;x2goclient nix package does this substitution
+ #t)))
+ ;; I could not succeed in packaging the man2html program
+ ;; needed to build the html version of the documentation.
+ ;; That's why instead of running the bare make which needs
+ ;; man2html in one of its target, I run build_client then install_man.
+ (replace 'build
+ (lambda _
+ (invoke "make" "build_client") #t))
+ (add-after 'build 'build-man
+ (lambda _
+ (invoke "make" "install_man") #t))
+ ;; KLUDGE part2
+ ;; Due to the above, we must run lrelease separately on each .ts file
+ ;; (as opposed to running `lrelease-pro smplayer.pro` for the entire
+ ;; project, as the Makefile does normally without the above kludge).
+ (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 perl nx-libs openssh xauth))
+ (synopsis "Remote Desktop/Remote Application solution")
+ (description
+ "x2goclient allows you to connect to a remote graphical desktop over the
+network through ssh")
+ (home-page "http://x2go.org/")
+ (license gpl2)))
--
2.41.0
S
S
Steve George wrote on 21 Feb 19:58 +0100
owner bug#67257
(address . control@debbugs.gnu.org)
b43c1ab0-43e6-4860-89ae-0f81d6ef790b@futurile.net
owner 67257 steve@futurile.net
quit
S
S
Steve George wrote on 22 Feb 23:08 +0100
[PATCH v2 2/2] gnu: Add x2goclient.
(address . 67257@debbugs.gnu.org)
89c8896f76e5c5e3f68dfd7f36cac23ad3a79330.1708638616.git.steve@futurile.net
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(+)

Toggle diff (109 lines)
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)))
--
2.41.0
S
S
Steve George wrote on 22 Feb 23:08 +0100
[PATCH v2 0/2] re: add x2goclient and nx-libs
(address . 67257@debbugs.gnu.org)
cover.1708638616.git.steve@futurile.net
Review:
* removed propagated-inputs in nx-libs to avoid complex dependency tree:
previously it was perl, python, python-gobject and gtk+
* Nico: perhaps the package needs to be split to have a specific python
* cosmetic: re-ordered imports (alphabetical) to same as other Guix packages
* cosmetic: shortened comments
* added Reviewed-by commit trailer
* applied patches, test installed, linted
* Checked synopsis, description & commits
* Re-roll to trigger QA build

nicodebo (2):
gnu: Add nx-libs.
gnu: Add x2goclient.

gnu/packages/nx.scm | 220 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 220 insertions(+)
create mode 100644 gnu/packages/nx.scm


base-commit: ec9c8b0c1a0982e97375df0ae44af4fdc72c3757
--
2.41.0
S
S
Steve George wrote on 22 Feb 23:08 +0100
[PATCH v2 1/2] gnu: Add nx-libs.
(address . 67257@debbugs.gnu.org)
834a3cc5e7e16f94691c1bb726f1dd1cc5edb6d0.1708638616.git.steve@futurile.net
From: nicodebo <nicolas.debonnaire@gmail.com>

* gnu/packages/nx.scm: New file.
* gnu/packages/nx.scm (nx-libs): New variable.

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

Change-Id: I13e088521d5e5577fed5d6a4b10867ca10f4293f
---
gnu/packages/nx.scm | 141 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 141 insertions(+)
create mode 100644 gnu/packages/nx.scm

Toggle diff (149 lines)
diff --git a/gnu/packages/nx.scm b/gnu/packages/nx.scm
new file mode 100644
index 00000000000..92542c02a7b
--- /dev/null
+++ b/gnu/packages/nx.scm
@@ -0,0 +1,141 @@
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages nx)
+ #:use-module (guix build utils)
+ #:use-module (guix build-system gnu)
+ #: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 glib)
+ #:use-module (gnu packages gtk)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages onc-rpc)
+ #: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 xdisorg)
+ #:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg))
+
+(define-public nx-libs
+ (package
+ (name "nx-libs")
+ (version "3.5.99.27")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ArcticaProject/nx-libs")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0ykbza39ksycpyydaiwwbp7hkmdk96v7b36pn989k39lhfwnn8kz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ;; no tests in this project
+ #:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'replace-shebang-nxdialog
+ (lambda _
+ (substitute* "nxdialog/bin/nxdialog"
+ (("#!/usr/bin/env python")
+ (string-append "#!"
+ (which "python3"))))))
+ (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"
+ (("^gzip -f") "gzip -f -n") ;; reproducible build
+ (("/usr/local")
+ out)
+ (("/etc/nxagent")
+ etc)
+ (("./configure")
+ (string-append "CONFIG_SHELL="
+ (which "sh")
+ " SHELL="
+ (which "sh")
+ " "
+ (which "sh")
+ " ./configure")))
+ (substitute* '("nx-X11/config/cf/site.def")
+ (("#include <host.def>")
+ (string-append "#include <host.def>" "\n"
+ "#define BourneShell "
+ (which "sh")))
+ (("/usr/local")
+ out))
+ ;; Workaround the following error during the build
+ ;; process: invalid input: ("_" #<procedure which (program)>)
+ (substitute* '("nx-X11/Makefile")
+ (("which")
+ "echo"))
+ #t)))
+ (replace 'build
+ (lambda _
+ (invoke "make" "IMAKE_DEFINES=\"-DUseTIRPC=1\"") #t))
+ (add-before 'validate-runpath 'link-libraries
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib (string-append out "/lib"))
+ (lib-nx-x11 (string-append lib "/nx/X11")))
+ ;; TODO: Should I use symlink instead of install-file ?
+ (for-each (lambda (file)
+ (install-file file lib-nx-x11))
+ (list (string-append lib "/libXcomp.so.3")
+ (string-append lib
+ "/libXcompshad.so.3")
+ (string-append lib "/libNX_X11.so.6")))
+ #t))))))
+ (inputs (list perl
+ python
+ python-pygobject
+ gtk+))
+ (native-inputs (list autoconf
+ automake
+ libtool
+ pkg-config
+ libpng
+ libjpeg-turbo
+ xkbcomp
+ libxfont
+ libxdamage
+ libxrandr
+ libxtst
+ libxext
+ libxcomposite
+ libxinerama
+ libxpm
+ libxml2
+ font-util
+ pixman
+ gccmakedep
+ imake
+ quilt
+ libtirpc
+ gcc-toolchain))
+ (synopsis "NX remote desktop library")
+ (description
+ "NX technology also known as NX or NoMachine is a protocol that enables
+remote desktop access. It's maintained by the artica project, x2go
+developers and TheQVD.")
+ (home-page "https://github.com/ArcticaProject/nx-libs")
+ (license license:gpl2)))
--
2.41.0
L
L
Ludovic Courtès wrote on 27 Feb 10:59 +0100
(name . Steve George)(address . steve@futurile.net)
87sf1ei5xp.fsf@gnu.org
Hi!

Thank you Steve for shepherding this patch set! Here are some comments
on minor issues.

Steve George <steve@futurile.net> skribis:

Toggle quote (5 lines)
> From: nicodebo <nicolas.debonnaire@gmail.com>
>
> * gnu/packages/nx.scm: New file.
> * gnu/packages/nx.scm (nx-libs): New variable.

The second line is unnecessary.

Please make sure to add the file to ‘gnu/local.mk’.

Toggle quote (4 lines)
> +++ b/gnu/packages/nx.scm
> @@ -0,0 +1,141 @@
> +;;; This file is part of GNU Guix.

Looks like a couple of lines are missing from the usual header.

Toggle quote (7 lines)
> + (add-before 'build 'replace-shebang-nxdialog
> + (lambda _
> + (substitute* "nxdialog/bin/nxdialog"
> + (("#!/usr/bin/env python")
> + (string-append "#!"
> + (which "python3"))))))

‘which’ returns ‘python3’ as found in $PATH—i.e., the native python.

To do the right thing in a cross-compilation context (for example, pick
the AArch64 ‘python3’ binary if you’re cross-compiling to AArch64), it
should be written like this:

(lambda* (#:key inputs #:allow-other-keys)
(substitute* …
(… … (search-input-file inputs "/bin/python3"))))

Toggle quote (6 lines)
> + (synopsis "NX remote desktop library")
> + (description
> + "NX technology also known as NX or NoMachine is a protocol that enables
> +remote desktop access. It's maintained by the artica project, x2go
> +developers and TheQVD.")

Please describe that the package does; who maintains it is usually not
relevant here:


Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 27 Feb 11:02 +0100
Re: [bug#67257] [PATCH v2 2/2] gnu: Add x2goclient.
(name . Steve George)(address . steve@futurile.net)
87msrmi5ry.fsf@gnu.org
Steve George <steve@futurile.net> skribis:

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

[...]

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

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

Toggle quote (11 lines)
> + (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’.

Toggle quote (3 lines)
> + (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’.
M
M
Maxim Cournoyer wrote on 10 Mar 01:40 +0100
Re: [bug#67257] [PATCH v2 1/2] gnu: Add nx-libs.
(name . Steve George)(address . steve@futurile.net)
875xxuex79.fsf@gmail.com
Hi Steve and Ludovic,

I had started reviewing this work as a diff with the intent to merge it
before Ludovic tipped in; apologies for not signaling this earlier.

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

Toggle quote (16 lines)
> Hi!
>
> Thank you Steve for shepherding this patch set! Here are some comments
> on minor issues.
>
> Steve George <steve@futurile.net> skribis:
>
>> From: nicodebo <nicolas.debonnaire@gmail.com>
>>
>> * gnu/packages/nx.scm: New file.
>> * gnu/packages/nx.scm (nx-libs): New variable.
>
> The second line is unnecessary.
>
> Please make sure to add the file to ‘gnu/local.mk’.

Done.

Toggle quote (23 lines)
>> +++ b/gnu/packages/nx.scm
>> @@ -0,0 +1,141 @@
>> +;;; This file is part of GNU Guix.
>
> Looks like a couple of lines are missing from the usual header.
>
>> + (add-before 'build 'replace-shebang-nxdialog
>> + (lambda _
>> + (substitute* "nxdialog/bin/nxdialog"
>> + (("#!/usr/bin/env python")
>> + (string-append "#!"
>> + (which "python3"))))))
>
> ‘which’ returns ‘python3’ as found in $PATH—i.e., the native python.
>
> To do the right thing in a cross-compilation context (for example, pick
> the AArch64 ‘python3’ binary if you’re cross-compiling to AArch64), it
> should be written like this:
>
> (lambda* (#:key inputs #:allow-other-keys)
> (substitute* …
> (… … (search-input-file inputs "/bin/python3"))))

Done.

Toggle quote (11 lines)
>> + (synopsis "NX remote desktop library")
>> + (description
>> + "NX technology also known as NX or NoMachine is a protocol that enables
>> +remote desktop access. It's maintained by the artica project, x2go
>> +developers and TheQVD.")
>
> Please describe that the package does; who maintains it is usually not
> relevant here:
>
> https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html

Done.

Here's the full diff from my changes from v1:

Toggle snippet (228 lines)
modified gnu/local.mk
@@ -487,6 +487,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/ntp.scm \
%D%/packages/nutrition.scm \
%D%/packages/nvi.scm \
+ %D%/packages/nx.scm \
%D%/packages/ocaml.scm \
%D%/packages/ocr.scm \
%D%/packages/openkinect.scm \
modified gnu/packages/nx.scm
@@ -1,4 +1,6 @@
;;; This file is part of GNU Guix.
+;;; Copyright © 2024 Nicolas Debonnaire <nicolas.debonnaire@gmail.com>
+;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
@@ -14,13 +16,14 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages nx)
- #:use-module (guix build utils)
#:use-module (guix build-system gnu)
#:use-module (guix download)
+ #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages commencement)
#:use-module (gnu packages cups)
#:use-module (gnu packages glib)
@@ -54,95 +57,104 @@ (define-public nx-libs
(base32 "0ykbza39ksycpyydaiwwbp7hkmdk96v7b36pn989k39lhfwnn8kz"))))
(build-system gnu-build-system)
(arguments
- `(#:tests? #f ;; no tests in this project
- #:phases (modify-phases %standard-phases
- (delete 'configure)
- (add-before 'build 'replace-shebang-nxdialog
- (lambda _
- (substitute* "nxdialog/bin/nxdialog"
- (("#!/usr/bin/env python")
- (string-append "#!"
- (which "python3"))))))
- (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"
- (("^gzip -f") "gzip -f -n") ;; reproducible build
- (("/usr/local")
- out)
- (("/etc/nxagent")
- etc)
- (("./configure")
- (string-append "CONFIG_SHELL="
- (which "sh")
- " SHELL="
- (which "sh")
- " "
- (which "sh")
- " ./configure")))
- (substitute* '("nx-X11/config/cf/site.def")
- (("#include <host.def>")
- (string-append "#include <host.def>" "\n"
- "#define BourneShell "
- (which "sh")))
- (("/usr/local")
- out))
- ;; Workaround the following error during the build
- ;; process: invalid input: ("_" #<procedure which (program)>)
- (substitute* '("nx-X11/Makefile")
- (("which")
- "echo"))
- #t)))
- (replace 'build
- (lambda _
- (invoke "make" "IMAKE_DEFINES=\"-DUseTIRPC=1\"") #t))
- (add-before 'validate-runpath 'link-libraries
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (lib (string-append out "/lib"))
- (lib-nx-x11 (string-append lib "/nx/X11")))
- ;; TODO: Should I use symlink instead of install-file ?
- (for-each (lambda (file)
- (install-file file lib-nx-x11))
- (list (string-append lib "/libXcomp.so.3")
- (string-append lib
- "/libXcompshad.so.3")
- (string-append lib "/libNX_X11.so.6")))
- #t))))))
- (inputs (list perl
- python
- python-pygobject
- gtk+))
- (native-inputs (list autoconf
- automake
- libtool
- pkg-config
- libpng
- libjpeg-turbo
- xkbcomp
- libxfont
- libxdamage
- libxrandr
- libxtst
- libxext
- libxcomposite
- libxinerama
- libxpm
- libxml2
- font-util
- pixman
- gccmakedep
- imake
- quilt
- libtirpc
- gcc-toolchain))
- (synopsis "NX remote desktop library")
- (description
- "NX technology also known as NX or NoMachine is a protocol that enables
-remote desktop access. It's maintained by the artica project, x2go
-developers and TheQVD.")
+ (list
+ #:tests? #f ;no test suite
+ ;; The build randomly fails when run in parallel (see:
+ ;; https://github.com/ArcticaProject/nx-libs/issues/1072).
+ #:parallel-build? #f
+ #:make-flags #~(let ((sh (search-input-file %build-inputs "bin/sh")))
+ (list (string-append "PREFIX=" #$output)
+ (string-append "ETCDIR_NX=" #$output "/etc")
+ (string-append "LOCAL_LDFLAGS=-Wl,"
+ "-rpath=" #$output "/lib,"
+ "-rpath=" #$output "/lib/nx/X11")
+ (string-append "IMAKE_DEFINES=-DUseTIRPC=1"
+ " -DBourneShell=" sh
+ " -DProjectRoot=" #$output
+ " -DDefaultUserPath="
+ #$output "/bin")
+ (string-append "CONFIG_SHELL=" sh)
+ (string-append "SHELL=" sh)
+ ;; Autoreconf being run by Make, the generated
+ ;; configure script shebangs thus haven't been
+ ;; patched; workaround this by running explicitly
+ ;; via the shell.
+ (string-append "CONFIGURE=" sh " ./configure "
+ "--prefix=" #$output)
+ "VERBOSE=1"))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'adjust-Makefile
+ (lambda _
+ ;; It's best to source a script via its absolute path,
+ ;; otherwise it's looked from PATH and fails for POSIX
+ ;; shells, such as our Bash-provided 'sh' (see:
+ ;; https://github.com/ArcticaProject/nx-libs/issues/1071).
+ (substitute* "Makefile"
+ (("\\. replace.sh")
+ ". ./replace.sh"))))
+ (add-after 'install 'wrap-nxdialog
+ (lambda* (#:key inputs #:allow-other-keys)
+ (wrap-program (string-append #$output "/bin/nxdialog")
+ `("GUIX_PYTHONPATH" =
+ (,(getenv "GUIX_PYTHONPATH")))
+ ;; Ensure GObject Introspection typelibs are found.
+ `("GI_TYPELIB_PATH" ":" =
+ (,(getenv "GI_TYPELIB_PATH")))))))))
+ (native-inputs
+ (list autoconf
+ automake
+ font-util
+ gccmakedep
+ imake
+ libtool
+ perl
+ pkg-config
+ quilt
+ which))
+ (inputs
+ (list gtk+
+ libjpeg-turbo
+ libtirpc
+ libxcomposite
+ libxdamage
+ libxext
+ libxfont
+ libxinerama
+ libxml2
+ libxpm
+ libxrandr
+ libxtst
+ pixman
+ python-pygobject
+ python-wrapper
+ xkbcomp))
+ (propagated-inputs
+ (list libpng)) ;in Requires of nxcomp.pc
+ (synopsis "NX X11 protocol compression libraries")
+ (description "NX is a software suite which implements very efficient
+compression of the X11 protocol. This increases performance when using X
+applications over a network, especially a slow one. This package provides the
+following libraries:
+@table @code
+@item NX_X11
+NX's modified X Window System (X11) library
+@item Xcomp
+NX differential compression library for X11
+@item Xcompshad
+Session shadowing library
+@end table
+
+The following commands are also provided:
+
+@table @command
+@item nxagent
+Agent providing NX transport of X sessions
+@item nxproxy
+The NX proxy (client) binary
+@item nxdialog
+Helper script
+@end table")
(home-page "https://github.com/ArcticaProject/nx-libs")
(license license:gpl2)))

Changes summary:

1. Move most libraries to inputs.
2. Remove gcc-toolchain from native-inputs.
3. Use gexps / search-input-file instead of 'which'
4. Expound description
5. Wrap Python script with needed environment variables
6. Disable parallel build, which was randomly causing build failures
7. Use make flags instead of modifying the Makefile.

I think that's about it! I'll push shortly.

Thanks to Steve for the initial review, and for Ludo for providing
extra tips.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 10 Mar 01:45 +0100
Re: [bug#67257] [PATCH v2 2/2] gnu: Add x2goclient.
(name . Ludovic Courtès)(address . ludo@gnu.org)
871q8iewyg.fsf@gmail.com
Hi,

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

Toggle quote (18 lines)
> 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.

Toggle quote (14 lines)
>> + (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.

Toggle quote (6 lines)
>> + (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.

Toggle quote (3 lines)
> ‘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:

Toggle snippet (139 lines)
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)))

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 :-).

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 10 Mar 01:58 +0100
control message for bug #67257
(address . control@debbugs.gnu.org)
87zfv6dhsm.fsf@gmail.com
close 67257
quit
?