textutils.scm 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  3. ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
  5. ;;; Copyright © 2015 Roel Janssen <roel@gnu.org>
  6. ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
  7. ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
  8. ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
  10. ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
  11. ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
  12. ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
  13. ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
  14. ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
  15. ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
  16. ;;;
  17. ;;; This file is part of GNU Guix.
  18. ;;;
  19. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  20. ;;; under the terms of the GNU General Public License as published by
  21. ;;; the Free Software Foundation; either version 3 of the License, or (at
  22. ;;; your option) any later version.
  23. ;;;
  24. ;;; GNU Guix is distributed in the hope that it will be useful, but
  25. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  26. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. ;;; GNU General Public License for more details.
  28. ;;;
  29. ;;; You should have received a copy of the GNU General Public License
  30. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  31. (define-module (gnu packages textutils)
  32. #:use-module ((guix licenses) #:prefix license:)
  33. #:use-module (guix packages)
  34. #:use-module (guix download)
  35. #:use-module (guix git-download)
  36. #:use-module (guix build-system ant)
  37. #:use-module (guix build-system gnu)
  38. #:use-module (guix build-system cmake)
  39. #:use-module (guix build-system trivial)
  40. #:use-module (gnu packages)
  41. #:use-module (gnu packages autotools)
  42. #:use-module (gnu packages compression)
  43. #:use-module (gnu packages gettext)
  44. #:use-module (gnu packages java)
  45. #:use-module (gnu packages ncurses)
  46. #:use-module (gnu packages perl)
  47. #:use-module (gnu packages pkg-config)
  48. #:use-module (gnu packages python)
  49. #:use-module (gnu packages readline)
  50. #:use-module (gnu packages slang))
  51. (define-public dos2unix
  52. (package
  53. (name "dos2unix")
  54. (version "7.3.4")
  55. (source
  56. (origin
  57. (method url-fetch)
  58. (uri (string-append "https://waterlan.home.xs4all.nl/" name "/"
  59. name "-" version ".tar.gz"))
  60. (sha256
  61. (base32 "1i9hbxn0br7xa18z4bjpkdv7mrzmbfxhm44mzpd07yd2qnxsgkcc"))))
  62. (build-system gnu-build-system)
  63. (arguments
  64. '(#:make-flags (list "CC=gcc"
  65. (string-append "prefix=" (assoc-ref %outputs "out")))
  66. #:phases
  67. (modify-phases %standard-phases
  68. (delete 'configure)))) ; no configure script
  69. (native-inputs
  70. `(("gettext" ,gettext-minimal)
  71. ("perl" ,perl)))
  72. (home-page "https://waterlan.home.xs4all.nl/dos2unix.html")
  73. (synopsis "DOS/Mac to Unix and vice versa text file format converter")
  74. (description
  75. "dos2unix is a tool to convert line breaks in a text file from Unix format
  76. to DOS format and vice versa.")
  77. (license license:bsd-2)))
  78. (define-public recode
  79. (package
  80. (name "recode")
  81. ;; Last beta release (3.7-beta2) is from 2008; last commit from Feb 2014.
  82. ;; So we use that commit instead.
  83. (version "3.7.0.201402")
  84. (source
  85. (origin
  86. (method git-fetch)
  87. (uri (git-reference
  88. (url "https://github.com/pinard/Recode.git")
  89. (commit "2d7092a9999194fc0e9449717a8048c8d8e26c18")))
  90. (sha256
  91. (base32 "1wssv8z6g3ryrw33sksz4rjhlnhgvvdqszw1ggl4rcwks34n86zm"))
  92. (file-name (string-append name "-" version "-checkout"))))
  93. (build-system gnu-build-system)
  94. (native-inputs `(("python" ,python-2)))
  95. (arguments
  96. '(#:phases
  97. (alist-cons-before
  98. 'check 'pre-check
  99. (lambda _
  100. (substitute* "tests/setup.py"
  101. (("([[:space:]]*)include_dirs=.*" all space)
  102. (string-append all space "library_dirs=['../src/.libs'],\n")))
  103. ;; The test extension 'Recode.so' lacks RUNPATH for 'librecode.so'.
  104. (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/src/.libs")))
  105. %standard-phases)))
  106. (home-page "https://github.com/pinard/Recode")
  107. (synopsis "Text encoding converter")
  108. (description "The Recode library converts files between character sets and
  109. usages. It recognises or produces over 200 different character sets (or about
  110. 300 if combined with an iconv library) and transliterates files between almost
  111. any pair. When exact transliteration are not possible, it gets rid of
  112. offending characters or falls back on approximations. The recode program is a
  113. handy front-end to the library.")
  114. (license license:gpl2+)))
  115. (define-public enca
  116. (package
  117. (name "enca")
  118. (version "1.16")
  119. (source
  120. (origin
  121. (method url-fetch)
  122. (uri (string-append
  123. "https://github.com/nijel/enca/archive/" version ".tar.gz"))
  124. (sha256
  125. (base32 "1xik00x0yvhswsw2isnclabhv536xk1s42cf5z54gfbpbhc7ni8l"))
  126. (file-name (string-append name "-" version ".tar.gz"))))
  127. (build-system gnu-build-system)
  128. (inputs `(("recode" ,recode)))
  129. ;; Both 'test-convert-64.sh' and 'test-convert-filter.sh' manipulate a
  130. ;; 'test.tmp' file, so they have to run in sequence.
  131. (arguments '(#:parallel-tests? #f))
  132. (home-page "https://github.com/nijel/enca")
  133. (synopsis "Text encoding detection tool")
  134. (description "Enca (Extremely Naive Charset Analyser) consists of libenca,
  135. an encoding detection library, and enca, a command line frontend, integrating
  136. libenca and several charset conversion libraries and tools.")
  137. (license license:gpl2)))
  138. (define-public utf8proc
  139. (package
  140. (name "utf8proc")
  141. (version "2.1.0")
  142. (source
  143. (origin
  144. (method url-fetch)
  145. (uri (string-append
  146. "https://github.com/JuliaLang/utf8proc/archive/v"
  147. version ".tar.gz"))
  148. (file-name (string-append name "-" version ".tar.gz"))
  149. (sha256
  150. (base32 "0q1jhdkk4f9b0zb8s2ql3sba3br5nvjsmbsaybmgj064k9hwbk15"))))
  151. (build-system gnu-build-system)
  152. (inputs ;test data that is otherwise downloaded with curl
  153. `(("NormalizationTest.txt"
  154. ,(origin
  155. (method url-fetch)
  156. (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
  157. "NormalizationTest.txt"))
  158. (sha256
  159. (base32 "1fxrz0bilsbwl685336aqi88k62i6nqhm62rvy4zhg3bcm4dhj1d"))))
  160. ("GraphemeBreakTest.txt"
  161. ,(origin
  162. (method url-fetch)
  163. (uri (string-append "http://www.unicode.org/Public/9.0.0/ucd/"
  164. "auxiliary/GraphemeBreakTest.txt"))
  165. (sha256
  166. (base32 "0qbhyhmf0778lc2hcwlpizrvmdxwpk959v2q2wb8abv09ba7wvn7"))))))
  167. (arguments
  168. '(#:make-flags (list "CC=gcc"
  169. (string-append "prefix=" (assoc-ref %outputs "out")))
  170. #:phases
  171. (modify-phases %standard-phases
  172. (delete 'configure)
  173. (add-before 'check 'check-data
  174. (lambda* (#:key inputs #:allow-other-keys)
  175. (for-each (lambda (i)
  176. (copy-file (assoc-ref inputs i)
  177. (string-append "data/" i)))
  178. '("NormalizationTest.txt" "GraphemeBreakTest.txt"))
  179. (substitute* "data/GraphemeBreakTest.txt"
  180. (("÷") "/")
  181. (("×") "+")))))))
  182. (home-page "http://julialang.org/utf8proc/")
  183. (synopsis "C library for processing UTF-8 Unicode data")
  184. (description "utf8proc is a small C library that provides Unicode
  185. normalization, case-folding, and other operations for data in the UTF-8
  186. encoding, supporting Unicode version 9.0.0.")
  187. (license license:expat)))
  188. (define-public libgtextutils
  189. (package
  190. (name "libgtextutils")
  191. (version "0.7")
  192. (source
  193. (origin
  194. (method url-fetch)
  195. (uri (string-append
  196. "https://github.com/agordon/libgtextutils/releases/download/"
  197. version "/libgtextutils-" version ".tar.gz"))
  198. (sha256
  199. (base32 "0jiybkb2z58wa2msvllnphr4js2hvjvh988pavb3mzkgr6ihwbkr"))))
  200. (build-system gnu-build-system)
  201. (arguments
  202. '(#:phases
  203. (alist-cons-after
  204. 'unpack 'autoreconf
  205. (lambda _ (zero? (system* "autoreconf" "-vif")))
  206. %standard-phases)))
  207. (native-inputs
  208. `(("autoconf" ,autoconf)
  209. ("automake" ,automake)
  210. ("libtool" ,libtool)))
  211. (home-page "https://github.com/agordon/libgtextutils")
  212. (synopsis "Gordon's text utils library")
  213. (description
  214. "libgtextutils is a text utilities library used by the fastx toolkit from
  215. the Hannon Lab.")
  216. (license license:agpl3+)))
  217. (define-public cityhash
  218. (let ((commit "8af9b8c"))
  219. (package
  220. (name "cityhash")
  221. (version (string-append "1.1-2." commit))
  222. (source (origin
  223. (method git-fetch)
  224. (uri (git-reference
  225. (url "https://github.com/google/cityhash.git")
  226. (commit commit)))
  227. (file-name (string-append name "-" version ".tar.gz"))
  228. (sha256
  229. (base32
  230. "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
  231. (build-system gnu-build-system)
  232. (arguments
  233. '(#:make-flags (list "CXXFLAGS=-g -O3")
  234. #:phases
  235. (modify-phases %standard-phases
  236. ;; citycrc is not installed by default but is used by some
  237. ;; programs.
  238. (add-after 'install 'install-citycrc
  239. (lambda* (#:key outputs #:allow-other-keys)
  240. (let* ((out (assoc-ref outputs "out"))
  241. (include (string-append out "/include")))
  242. (install-file "src/citycrc.h" include))
  243. #t)))))
  244. (home-page "https://github.com/google/cityhash")
  245. (synopsis "C++ hash functions for strings")
  246. (description
  247. "CityHash provides hash functions for strings. The functions mix the
  248. input bits thoroughly but are not suitable for cryptography.")
  249. (license license:expat))))
  250. (define-public ustr
  251. (package
  252. (name "ustr")
  253. (version "1.0.4")
  254. (source (origin
  255. (method url-fetch)
  256. (uri (string-append "http://www.and.org/ustr/" version
  257. "/ustr-" version ".tar.bz2"))
  258. (sha256
  259. (base32
  260. "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"))
  261. (patches (search-patches "ustr-fix-build-with-gcc-5.patch"))))
  262. (build-system gnu-build-system)
  263. (arguments
  264. `(#:make-flags
  265. (list "CC=gcc"
  266. "HIDE="
  267. ;; Override "/sbin/ldconfig" with "echo" because we don't need
  268. ;; "ldconfig".
  269. "LDCONFIG=echo"
  270. (string-append "prefix=" (assoc-ref %outputs "out"))
  271. "all-shared")
  272. #:phases
  273. (modify-phases %standard-phases
  274. (add-after 'unpack 'disable-check-for-stdint
  275. (lambda _
  276. ;; Of course we have stdint.h, just not in /usr/include
  277. (substitute* '("Makefile"
  278. "ustr-import.in")
  279. (("-f \"/usr/include/stdint.h\"") "-z \"\""))
  280. #t))
  281. ;; No configure script
  282. (delete 'configure))))
  283. (home-page "http://www.and.org/ustr/")
  284. (synopsis "String library with very low memory overhead")
  285. (description
  286. "Ustr is a string library for C with very low memory overhead.")
  287. ;; Quoted from the home page: "The License for the code is MIT, new-BSD,
  288. ;; LGPL, etc. ... if you need another license to help compatibility, just
  289. ;; ask for it. It's basically public domain, without all the legal
  290. ;; problems for everyone that trying to make something public domain
  291. ;; entails."
  292. (license license:public-domain)))
  293. (define-public libconfig
  294. (package
  295. (name "libconfig")
  296. (version "1.5")
  297. (source (origin
  298. (method url-fetch)
  299. (uri (string-append "http://www.hyperrealm.com/libconfig/"
  300. "libconfig-" version ".tar.gz"))
  301. (sha256
  302. (base32
  303. "1xh3hzk63v4y8815lc5209m3s6ms2cpgw4h5hg462i4f1lwsl7g3"))))
  304. (build-system gnu-build-system)
  305. (home-page "http://www.hyperrealm.com/libconfig/")
  306. (synopsis "C/C++ configuration file library")
  307. (description
  308. "Libconfig is a simple library for manipulating structured configuration
  309. files. This file format is more compact and more readable than XML. And
  310. unlike XML, it is type-aware, so it is not necessary to do string parsing in
  311. application code.")
  312. (license license:lgpl2.1+)))
  313. (define-public pfff
  314. (package
  315. (name "pfff")
  316. (version "1.0")
  317. (source (origin
  318. (method url-fetch)
  319. (uri (string-append "https://github.com/pfff/pfff/archive/v"
  320. version ".tar.gz"))
  321. (file-name (string-append name "-" version ".tar.gz"))
  322. (sha256
  323. (base32
  324. "00m553aa277iarxj6dalmklyb64r7ias49bfwzbacsfg8h3kar8m"))))
  325. (build-system cmake-build-system)
  326. (home-page "http://biit.cs.ut.ee/pfff/")
  327. (synopsis "Probabilistic fast file fingerprinting tool")
  328. (description
  329. "pfff is a tool for calculating a compact digital fingerprint of a file
  330. by sampling randomly from the file instead of reading it in full.
  331. Consequently, the computation has a flat performance characteristic,
  332. correlated with data variation rather than file size. pfff can be as reliable
  333. as existing hashing techniques, with provably negligible risk of collisions.")
  334. (license license:bsd-3)))
  335. (define-public oniguruma
  336. (package
  337. (name "oniguruma")
  338. (version "5.9.6")
  339. (source (origin
  340. (method url-fetch)
  341. (uri (string-append "https://github.com/kkos/"
  342. "oniguruma/releases/download/v" version
  343. "/onig-" version ".tar.gz"))
  344. (sha256
  345. (base32
  346. "19s79vsclqn170mw0ajwv7j37qsbn4f1yjz3yavnhvva6c820r6m"))))
  347. (build-system gnu-build-system)
  348. (home-page "https://github.com/kkos/oniguruma")
  349. (synopsis "Regular expression library")
  350. (description "Oniguruma is a regular expressions library. The special
  351. characteristic of this library is that different character encoding for every
  352. regular expression object can be specified.")
  353. (license license:bsd-2)))
  354. (define-public antiword
  355. (package
  356. (name "antiword")
  357. (version "0.37")
  358. (source (origin
  359. (method url-fetch)
  360. (uri (string-append "http://www.winfield.demon.nl/linux"
  361. "/antiword-" version ".tar.gz"))
  362. (sha256
  363. (base32
  364. "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f"))
  365. (patches (search-patches "antiword-CVE-2014-8123.patch"))))
  366. (build-system gnu-build-system)
  367. (arguments
  368. `(#:tests? #f ; There are no tests
  369. #:make-flags
  370. (list "-f" "Makefile.Linux"
  371. (string-append "GLOBAL_INSTALL_DIR="
  372. (assoc-ref %outputs "out") "/bin")
  373. (string-append "GLOBAL_RESOURCES_DIR="
  374. (assoc-ref %outputs "out") "/share/antiword"))
  375. #:phases
  376. (modify-phases %standard-phases
  377. (delete 'configure)
  378. (replace 'install
  379. (lambda* (#:key make-flags #:allow-other-keys)
  380. (zero? (apply system* "make" `("global_install" ,@make-flags))))))))
  381. (home-page "http://www.winfield.demon.nl/")
  382. (synopsis "Microsoft Word document reader")
  383. (description "Antiword is an application for displaying Microsoft Word
  384. documents. It can also convert the document to PostScript or XML. Only
  385. documents made by MS Word version 2 and version 6 or later are supported. The
  386. name comes from: \"The antidote against people who send Microsoft Word files
  387. to everybody, because they believe that everybody runs Windows and therefore
  388. runs Word\".")
  389. (license license:gpl2+)))
  390. (define-public catdoc
  391. (package
  392. (name "catdoc")
  393. (version "0.95")
  394. (source (origin
  395. (method url-fetch)
  396. (uri (string-append "http://ftp.wagner.pp.ru/pub/catdoc/"
  397. "catdoc-" version ".tar.gz"))
  398. (patches (search-patches "catdoc-CVE-2017-11110.patch"))
  399. (sha256
  400. (base32
  401. "15h7v3bmwfk4z8r78xs5ih6vd0pskn0rj90xghvbzdjj0cc88jji"))))
  402. (build-system gnu-build-system)
  403. ;; TODO: Also build `wordview` which requires `tk` – make a separate
  404. ;; package for this.
  405. (arguments
  406. '(#:tests? #f ; There are no tests
  407. #:configure-flags '("--disable-wordview")
  408. #:phases
  409. (modify-phases %standard-phases
  410. (add-before 'install 'fix-install
  411. (lambda* (#:key outputs #:allow-other-keys)
  412. (let ((out (assoc-ref outputs "out")))
  413. (mkdir-p (string-append out "/share/man/man1"))))))))
  414. (home-page "http://www.wagner.pp.ru/~vitus/software/catdoc/")
  415. (synopsis "MS-Word to TeX or plain text converter")
  416. (description "@command{catdoc} extracts text from MS-Word files, trying to
  417. preserve as many special printable characters as possible. It supports
  418. everything up to Word-97. Also supported are MS Write documents and RTF files.
  419. @command{catdoc} does not preserve complex word formatting, but it can
  420. translate some non-ASCII characters into TeX escape codes. It's goal is to
  421. extract plain text and allow you to read it and, probably, reformat with TeX,
  422. according to TeXnical rules.
  423. This package also provides @command{xls2csv}, which extracts data from Excel
  424. spreadsheets and outputs it in comma-separated-value format, and
  425. @command{catppt}, which extracts data from PowerPoint presentations.")
  426. (license license:gpl2+)))
  427. (define-public utfcpp
  428. (package
  429. (name "utfcpp")
  430. (version "2.3.4")
  431. (source (origin
  432. (method url-fetch)
  433. (uri
  434. (string-append
  435. "mirror://sourceforge/utfcpp/utf8cpp_2x/Release%20"
  436. version "/utf8_v"
  437. (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
  438. ".zip"))
  439. (file-name (string-append name "-" version ".zip"))
  440. (sha256
  441. (base32
  442. "1vqhs0aipcvvdrwcs7h3jsryg6mgbmc4s34n5cm6d36q4nxwwwrk"))))
  443. (build-system trivial-build-system)
  444. (arguments
  445. `(#:modules ((guix build utils))
  446. #:builder
  447. (begin
  448. (use-modules (guix build utils))
  449. (let ((source (assoc-ref %build-inputs "source"))
  450. (out (assoc-ref %outputs "out"))
  451. (unzip (string-append (assoc-ref %build-inputs "unzip")
  452. "/bin/unzip")))
  453. (mkdir-p out)
  454. (with-directory-excursion out
  455. (system* unzip source)
  456. (mkdir-p "share/doc")
  457. (rename-file "doc" "share/doc/utfcpp")
  458. (rename-file "source" "include"))))))
  459. (native-inputs `(("unzip" ,unzip)))
  460. (home-page "https://github.com/nemtrif/utfcpp")
  461. (synopsis "Portable C++ library for handling UTF-8")
  462. (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text
  463. in a portable way.")
  464. (license license:boost1.0)))
  465. (define-public dbacl
  466. (package
  467. (name "dbacl")
  468. (version "1.14")
  469. (source
  470. (origin
  471. (method url-fetch)
  472. (uri (string-append "http://www.lbreyer.com/gpl/"
  473. name "-" version ".tar.gz"))
  474. (sha256
  475. (base32
  476. "0224g6x71hyvy7jikfxmgcwww1r5lvk0jx36cva319cb9nmrbrq7"))))
  477. (build-system gnu-build-system)
  478. (arguments
  479. `(#:make-flags
  480. (list
  481. (string-append "-I" (assoc-ref %build-inputs "slang")
  482. "/include/slang")
  483. (string-append "-I" (assoc-ref %build-inputs "ncurses")
  484. "/include/ncurses"))
  485. #:phases
  486. (modify-phases %standard-phases
  487. (add-after 'unpack 'delete-sample6-and-japanese
  488. (lambda _
  489. (substitute* "doc/Makefile.am"
  490. (("sample6.txt") "")
  491. (("japanese.txt") ""))
  492. (delete-file "doc/sample6.txt")
  493. (delete-file "doc/japanese.txt")
  494. (substitute* (list "src/tests/Makefile.am"
  495. "src/tests/Makefile.in")
  496. (("dbacl-jap.shin") "")
  497. (("dbacl-jap.sh") ""))
  498. #t))
  499. (add-after 'unpack 'delete-test
  500. ;; See comments about the license.
  501. (lambda _
  502. (delete-file "src/tests/dbacl-jap.shin")))
  503. (add-after 'delete-sample6-and-japanese 'autoreconf
  504. (lambda _
  505. (zero? (system* "autoreconf" "-vif"))))
  506. (add-after 'unpack 'fix-test-files
  507. (lambda* (#:key inputs outputs #:allow-other-keys)
  508. (let* ((out (assoc-ref outputs "out"))
  509. (bin (string-append out "/bin")))
  510. (substitute* (find-files "src/tests/" "\\.shin$")
  511. (("PATH=/bin:/usr/bin")
  512. "#PATH=/bin:/usr/bin")
  513. (("diff") (string-append (which "diff")))
  514. (("tr") (string-append (which "tr"))))
  515. #t))))))
  516. (inputs
  517. `(("ncurses" ,ncurses)
  518. ("perl" ,perl)
  519. ("readline" ,readline)
  520. ("slang" ,slang)))
  521. (native-inputs
  522. `(("libtool" ,libtool)
  523. ("autoconf" ,autoconf)
  524. ("automake" ,automake)
  525. ("pkg-config" ,pkg-config)))
  526. (home-page "http://www.lbreyer.com/dbacl.html")
  527. (synopsis "Bayesian text and email classifier")
  528. (description
  529. "dbacl is a fast Bayesian text and email classifier. It builds a variety
  530. of language models using maximum entropy (minimum divergence) principles, and
  531. these can then be used to categorize input data automatically among multiple
  532. categories.")
  533. ;; The software is licensed as GPLv3 or later, but
  534. ;; includes various sample texts in the doc dir:
  535. ;; - sample1.txt, sample3 and sampe5.txt are in the public domain,
  536. ;; by Mark Twain.
  537. ;; - sample2.txt, sample4.txt are in the public domain, by Aristotle.
  538. ;; - sample6.txt is a forwarded email, copyright unknown.
  539. ;; Guix does exclude sample6.txt.
  540. ;; - japanese.txt is a Japanese unoffical translation of the
  541. ;; GNU General Public License, (c) by the Free Software Foundation.
  542. ;; Guix excludes this file.
  543. (license (list license:gpl3+ license:public-domain))))
  544. (define-public dotconf
  545. (package
  546. (name "dotconf")
  547. (version "1.3")
  548. (source (origin
  549. (method url-fetch)
  550. (uri (string-append
  551. "https://github.com/williamh/dotconf/archive/v"
  552. version ".tar.gz"))
  553. (file-name (string-append name "-" version ".tar.gz"))
  554. (sha256
  555. (base32
  556. "0lsnh0yaw44psmx59hq94cj1932gscp5h8d3cnh05l0svr0cy7kz"))))
  557. (build-system gnu-build-system)
  558. (arguments
  559. `(#:tests? #f ; FIXME maketest.sh does not work.
  560. #:phases
  561. (modify-phases %standard-phases
  562. (add-after 'unpack 'autoreconf
  563. (lambda _
  564. (zero? (system* "autoreconf" "-vif")))))))
  565. (native-inputs
  566. `(("autoconf" ,autoconf)
  567. ("automake" ,automake)
  568. ("libtool" ,libtool)))
  569. (home-page "https://github.com/williamh/dotconf")
  570. (synopsis "Configuration file parser library")
  571. (description
  572. "C library for creating and parsing configuration files.")
  573. (license (list license:lgpl2.1 ; Main distribution.
  574. license:asl1.1)))) ; src/readdir.{c,h}
  575. (define-public java-rsyntaxtextarea
  576. (package
  577. (name "java-rsyntaxtextarea")
  578. (version "2.6.1")
  579. (source (origin
  580. (method url-fetch)
  581. (uri (string-append "https://github.com/bobbylight/"
  582. "RSyntaxTextArea/archive/"
  583. version ".tar.gz"))
  584. (file-name (string-append name "-" version ".tar.gz"))
  585. (sha256
  586. (base32
  587. "0c5mqg2klj5rvf8fhycrli8rf6s37l9p7a8knw9gpp65r1c120q2"))))
  588. (build-system ant-build-system)
  589. (arguments
  590. `(;; FIXME: some tests fail because locale resources cannot be found.
  591. ;; Even when I add them to the class path,
  592. ;; RSyntaxTextAreaEditorKitDumbCompleteWordActionTest fails.
  593. #:tests? #f
  594. #:jar-name "rsyntaxtextarea.jar"))
  595. (native-inputs
  596. `(("java-junit" ,java-junit)
  597. ("java-hamcrest-core" ,java-hamcrest-core)))
  598. (home-page "https://bobbylight.github.io/RSyntaxTextArea/")
  599. (synopsis "Syntax highlighting text component for Java Swing")
  600. (description "RSyntaxTextArea is a syntax highlighting, code folding text
  601. component for Java Swing. It extends @code{JTextComponent} so it integrates
  602. completely with the standard @code{javax.swing.text} package. It is fast and
  603. efficient, and can be used in any application that needs to edit or view
  604. source code.")
  605. (license license:bsd-3)))