misc-utils.scm 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
  2. ;; This program is free software: you can redistribute it and/or modify
  3. ;; it under the terms of the GNU General Public License as published by
  4. ;; the Free Software Foundation, either version 3 of the License, or
  5. ;; (at your option) any later version.
  6. ;; This program is distributed in the hope that it will be useful,
  7. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. ;; GNU General Public License for more details.
  10. ;; You should have received a copy of the GNU General Public License
  11. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. (define-module (misc-utils)
  13. #:use-module (guix packages)
  14. #:use-module (gnu packages)
  15. #:use-module ((guix licenses) #:prefix license:)
  16. #:use-module (guix download)
  17. #:use-module (guix git-download)
  18. #:use-module (guix utils)
  19. #:use-module (guix build-system gnu)
  20. #:use-module (guix build-system waf)
  21. #:use-module (gnu packages gettext)
  22. #:use-module (gnu packages gl)
  23. #:use-module (gnu packages glib)
  24. #:use-module (gnu packages gnome)
  25. #:use-module (gnu packages gtk)
  26. #:use-module (gnu packages image)
  27. #:use-module (gnu packages linux)
  28. #:use-module (gnu packages messaging)
  29. #:use-module (gnu packages pkg-config)
  30. #:use-module (gnu packages python)
  31. #:use-module (gnu packages xml)
  32. #:use-module (gnu packages xorg))
  33. (define-public rox-filer
  34. (package
  35. (name "rox-filer")
  36. (version "2.11")
  37. (source (origin
  38. (method url-fetch)
  39. (uri (string-append "https://sourceforge.net/projects/rox/files/"
  40. "rox/" version "/"
  41. name "-" version ".tar.bz2"))
  42. (sha256
  43. (base32
  44. "1a0v21y3srmz0ikg62df6hpc94j5axs1b5wbshp7mvqqxqrbsad9"))))
  45. (build-system gnu-build-system)
  46. (arguments
  47. `(#:tests? #f
  48. #:phases
  49. (modify-phases %standard-phases
  50. (replace 'configure
  51. (lambda* (#:key outputs #:allow-other-keys)
  52. ;; Replace /bin/sh with the appropriate location of sh.
  53. (substitute* '("ROX-Filer/src/main.c"
  54. "ROX-Filer/src/type.c")
  55. (("/bin/sh") (which "sh")))
  56. ;; Make sure that rox-filer looks for its private files in its
  57. ;; share directory.
  58. (substitute* "ROX-Filer/src/main.c"
  59. (("g_strdup\\(getenv\\(\"APP_DIR\"\\)\\)")
  60. (string-append "\"" (assoc-ref outputs "out") "/share/rox\"")))
  61. #t))
  62. (replace 'build
  63. (lambda _
  64. (setenv "CONFIG_SHELL" (which "sh"))
  65. (setenv "LIBS" "-ldl -lm")
  66. (invoke "ROX-Filer/AppRun" "--compile")))
  67. ;; Installation steps are taken from Linux From Scratch.
  68. (replace 'install
  69. (lambda* (#:key outputs #:allow-other-keys)
  70. (let* ((out (assoc-ref outputs "out"))
  71. (share (string-append out "/share/rox"))
  72. (bin (string-append out "/bin"))
  73. (man1 (string-append out "/share/man/man1")))
  74. (mkdir-p man1)
  75. (install-file "rox.1" man1)
  76. (chdir "ROX-Filer")
  77. (mkdir-p share)
  78. (for-each (lambda (file)
  79. (copy-recursively file
  80. (string-append share "/" file)))
  81. '("Help" "Messages" "Options.xml" "ROX" "images"
  82. "style.css" ".DirIcon"))
  83. (mkdir-p bin)
  84. (copy-file "ROX-Filer" (string-append bin "/rox"))
  85. (chdir (string-append share "/ROX/MIME"))
  86. ;; Duplicate some common mime types, without which rox-filer
  87. ;; would display the "unknown binary blob" icon.
  88. (symlink "text-x-diff.png" "text-x-patch.png")
  89. (symlink "application-x-font-afm.png"
  90. "application-x-font-type1.png")
  91. (symlink "application-xml.png" "application-xml-dtd.png")
  92. (symlink "application-xml.png"
  93. "application-xml-external-parsed-entity.png")
  94. (symlink "application-xml.png" "application-rdf+xml.png")
  95. (symlink "application-xml.png" "application-x-xbel.png")
  96. (symlink "application-x-shellscript.png"
  97. "application-javascript.png")
  98. (symlink "application-x-bzip-compressed-tar.png"
  99. "application-x-xz-compressed-tar.png")
  100. (symlink "application-x-bzip-compressed-tar.png"
  101. "application-x-lzma-compressed-tar.png")
  102. (symlink "application-x-bzip-compressed-tar.png"
  103. "application-x-lzo.png")
  104. (symlink "application-x-bzip.png" "application-x-xz.png")
  105. (symlink "application-x-gzip.png" "application-x-lzma.png")
  106. (symlink "application-msword.png" "application-rtf.png")))))))
  107. (native-inputs
  108. `(("pkg-config" ,pkg-config)))
  109. (inputs
  110. `(("gtk+-2" ,gtk+-2)
  111. ("libsm" ,libsm)
  112. ("libxml2" ,libxml2)))
  113. (home-page "https://launchpad.net/sakura")
  114. (synopsis "A RISC OS-like filer for Xorg")
  115. (description "ROX-Filer is a simple and easy to use graphical file manager
  116. for X11 based on the GTK2 library. It uses a uniform drag-and-drop approach for
  117. every operation.")
  118. (license license:gpl2+)))