gnu: fish: Update to 2.7.1.
[jackhill/guix/guix.git] / gnu / packages / synergy.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages synergy)
22 #:use-module (guix packages)
23 #:use-module ((guix licenses) #:select (gpl2))
24 #:use-module (guix download)
25 #:use-module (guix build-system cmake)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages curl)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages python)
30 #:use-module (gnu packages tls)
31 #:use-module (gnu packages xorg)
32 #:use-module (srfi srfi-26))
33
34 (define-public synergy
35 (package
36 (name "synergy")
37 (version "1.8.8")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "https://github.com/symless/synergy-core/archive/"
42 "v" version "-stable.tar.gz"))
43 (file-name (string-append name "-" version ".tar.gz"))
44 (sha256
45 (base32
46 "052z1yiwck9hlshf8in2dgz6p7jxmq9yfj32mfzjaygpz6mmmr4y"))
47 (modules '((guix build utils)))
48 (snippet
49 ;; Remove ~14MB of unnecessary bundled source and binaries
50 '(begin
51 (for-each delete-file-recursively
52 `("ext/bonjour"
53 "ext/LICENSE (OpenSSL)"
54 ,@(find-files "ext" "openssl-.*\\.tar\\.gz")
55 "ext/openssl-osx"
56 "ext/openssl-win32"
57 "ext/openssl-win64"))
58 #t))))
59 (build-system cmake-build-system)
60 (native-inputs `(("unzip" ,unzip)))
61 (inputs
62 `(("python" ,python-wrapper)
63 ("openssl" ,openssl)
64 ("curl" ,curl)
65 ("libxi" ,libxi)
66 ("libx11" ,libx11)
67 ("libxtst" ,libxtst)
68 ("xinput" ,xinput)))
69 (arguments
70 `(#:phases
71 (let ((srcdir (string-append "../synergy-core-" ,version "-stable")))
72 (modify-phases %standard-phases
73 (add-before 'configure 'unpack-aux-src
74 ;; TODO: package and use from system
75 (lambda* (#:key inputs #:allow-other-keys)
76 (let ((unzip (string-append
77 (assoc-ref inputs "unzip")
78 "/bin/unzip")))
79 (with-directory-excursion "ext"
80 (for-each
81 (lambda (f)
82 (system* unzip "-d" f (string-append f ".zip")))
83 '("gmock-1.6.0" "gtest-1.6.0"))))
84 #t))
85 (replace 'check
86 ;; Don't run "integtests" as it requires network and an X display.
87 (lambda _
88 (zero? (system* (string-append srcdir "/bin/unittests")))))
89 (replace 'install
90 ;; There currently is no installation process, see:
91 ;; http://synergy-project.org/spit/issues/details/3317/
92 (lambda* (#:key outputs #:allow-other-keys)
93 (let* ((out (assoc-ref outputs "out"))
94 (bin (string-append out "/bin"))
95 (ex (string-append out "/share/doc/synergy-"
96 ,version "/examples")))
97 (begin
98 (for-each
99 (lambda (f)
100 (install-file (string-append srcdir "/bin/" f) bin))
101 '("synergyc" "synergys" "synergyd"
102 "usynergy" "syntool"))
103 ;; Install example configuration files
104 (for-each
105 (lambda (e)
106 (install-file (string-append srcdir "/doc/" e) ex))
107 '("synergy.conf.example"
108 "synergy.conf.example-advanced"
109 "synergy.conf.example-basic"))))
110 #t))))))
111 (home-page "https://symless.com/synergy")
112 (synopsis "Mouse and keyboard sharing utility")
113 (description
114 "Synergy brings your computers together in one cohesive experience; it's
115 software for sharing one mouse and keyboard between multiple computers on your
116 desk.")
117 (license gpl2)))