Subject: [PATCH] gnu: freerdp: Enalbe server build
From: Andy Tai <[email-masked]>
To: [email-masked]
Cc: Andy Tai <[email-masked]>
Date: Tue, 27 Jun 2023 00:04:29 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/rdesktop.scm (freerdp): Enable server build
  [phases] (configure-flags): Enable server build flags
  [inputs]: add server build dependencies and additional protocols
  cairo, dbus, gsm, lame, libxdamage, opencl, openh264, openssl
---
 gnu/packages/rdesktop.scm | 102 ++++++++++++++++++++++----------------
 1 file changed, 58 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/rdesktop.scm b/gnu/packages/rdesktop.scm
index be4fe83cdc..0855e11a11 100644
--- a/gnu/packages/rdesktop.scm
+++ b/gnu/packages/rdesktop.scm
@@ -31,16 +31,20 @@ (define-module (gnu packages rdesktop)
   #:use-module (guix utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cups)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages mp3)
   #:use-module (gnu packages nettle)
+  #:use-module (gnu packages opencl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages tls)
@@ -83,56 +87,66 @@ (define-public freerdp
   (package
     (name "freerdp")
     (version "2.10.0")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/FreeRDP/FreeRDP")
-             (commit version)))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "0j5waq4h7l5f0vrh7wmrv6r27p537qwbg7ab8j0n0ia5p4nvgjp2"))))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/FreeRDP/FreeRDP")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0j5waq4h7l5f0vrh7wmrv6r27p537qwbg7ab8j0n0ia5p4nvgjp2"))))
     (build-system cmake-build-system)
-    (native-inputs
-     (list docbook-xml
-           docbook-xsl
-           glib
-           libxml2
-           libxslt
-           pkg-config
-           xmlto))
-    (inputs
-     (list alsa-lib
-           cups
-           ffmpeg-4
-           libjpeg-turbo
-           libusb
-           libx11
-           libxkbfile
-           libxcursor
-           libxext
-           libxi
-           libxv
-           libxrandr
-           libxrender
-           libxinerama
-           libxshmfence
-           pulseaudio
-           zlib))
+    (native-inputs (list docbook-xml
+                         docbook-xsl
+                         glib
+                         libxml2
+                         libxslt
+                         pkg-config
+                         xmlto))
+    (inputs (list alsa-lib
+                  cairo
+                  cups
+                  dbus
+                  ffmpeg-4
+                  gsm
+                  lame
+                  libjpeg-turbo
+                  libusb
+                  libx11
+                  libxcursor
+                  libxdamage
+                  libxext
+                  libxkbfile
+                  libxi
+                  libxv
+                  libxrandr
+                  libxrender
+                  libxinerama
+                  libxshmfence
+                  pulseaudio
+                  opencl-headers
+                  openh264
+                  opensles
+                  openssl
+                  zlib))
     (propagated-inputs (list libxkbcommon openssl wayland))
     (arguments
      (list #:build-type "RELEASE"
-           #:configure-flags
-           #~(list "-DWITH_JPEG=ON"
-                   #$@(if (target-x86-64?)
-                          #~("-DWITH_SSE2=ON")
-                          #~())
-                   "-DWITH_PULSE=ON"
-                   "-DWITH_CUPS=ON"
-                   "-DBUILD_TESTING=ON")))
+           #:configure-flags #~(list "-DWITH_JPEG=ON"
+                                     #$@(if (target-x86-64?)
+                                            #~("-DWITH_SSE2=ON")
+                                            #~())
+                                     "-DWITH_PULSE=ON"
+                                     "-DWITH_CUPS=ON"
+                                     "-DBUILD_TESTING=ON"
+                                     "-DWITH_SERVER=ON" ;build servers
+                                     "-DWITH_SHADOW=ON" ;build shadow server
+                                     "-DWITH_PROXY=ON"))) ;build proxy server
     (home-page "https://www.freerdp.com")
     (synopsis "Remote Desktop Protocol implementation")
-    (description "FreeRDP implements Microsoft's Remote Desktop Protocol.
+    (description
+     "FreeRDP implements Microsoft's Remote Desktop Protocol.
 It consists of the @code{xfreerdp} client, libraries for client and server
 functionality, and Windows Portable Runtime (WinPR), a portable implementation
 of parts of the Windows API.")

base-commit: ac86174e22fcd762893bd4515786b1376af9397b
-- 
2.40.1