Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
4.7 KiB

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