+(define-public texlive-hyphen-churchslavonic
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-churchslavonic" "cu"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-cu.tex")
+ (base32
+ "0xkqlz3ixyl4fxsnzrbxqrb82p0n67rhgpddbiyv3qwfnbr2b5a4")))
+ (synopsis "Hyphenation patterns for Church Slavonic")
+ (description "The package provides hyphenation patterns for Church
+Slavonic in UTF-8 encoding.")
+ (license license:expat)))
+
+(define-public texlive-hyphen-coptic
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-coptic" "cop"
+ (list "/tex/generic/hyph-utf8/patterns/tex-8bit/copthyph.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-cop.tex")
+ (base32
+ "07i03jpdfy4ip7zbg4gnk4hk8zwj8rlni9dgrb1p8mfw2w19d80c")))
+ (synopsis "Hyphenation patterns for Coptic")
+ (description "The package provides hyphenation patterns for Coptic in
+UTF-8 encoding as well as in ASCII-based encoding for 8-bit engines.")
+ ;; No explicit license declaration, so we use the project license.
+ (license license:lppl)))
+
+(define-public texlive-hyphen-croatian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-croatian" "hr"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-hr.tex")
+ (base32
+ "129nz2nqilyq2477n2clx20xfbxh1qxm69zg4n2f6c4d4a8711nc")))
+ (synopsis "Hyphenation patterns for Croatian")
+ (description "The package provides hyphenation patterns for Croatian in
+T1/EC and UTF-8 encodings.")
+ (license license:lppl1.0+)))
+
+(define-public texlive-hyphen-czech
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-czech" "cs"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-cs.tex")
+ (base32
+ "1k5516gbfp1d5p97j247byag9sdgds5zwc11bwxfk58i6zq1v0m6")))
+ (synopsis "Hyphenation patterns for Czech")
+ (description "The package provides hyphenation patterns for Czech in T1/EC
+and UTF-8 encodings.")
+ (license license:gpl2+)))
+
+(define-public texlive-hyphen-danish
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-danish" "da"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-da.tex")
+ (base32
+ "0zxzs1b1723mav76i0wiyq4w82x8715cykvwa2bc60ldc2amv0vs")))
+ (synopsis "Hyphenation patterns for Danish")
+ (description "The package provides hyphenation patterns for Danish in
+T1/EC and UTF-8 encodings.")
+ ;; Either LPPL 1.3 or later, or Expat
+ (license (list license:lppl1.3+ license:expat))))
+
+(define-public texlive-hyphen-dutch
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-dutch" "nl"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-nl.tex")
+ (base32
+ "0cq46cmgjc4y2x0xs9b0a5zca3jmszv4rkzmrhgjb5z2nm3xkrpi")))
+ (synopsis "Hyphenation patterns for Dutch")
+ (description "The package provides hyphenation patterns for Dutch in T1/EC
+and UTF-8 encodings.")
+ (license license:lppl1.0+)))
+
+(define-public texlive-hyphen-english
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-english" '("en-gb" "en-us")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-en-gb.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-en-us.tex")
+ (base32
+ "08hyih8hn2w2q12gc4zygz0ckbz00mkzzn9898z2bicky02zg3kc")))
+ (synopsis "Hyphenation patterns for American and British English")
+ (description "The package provides additional hyphenation patterns for
+American and British English in ASCII encoding.")
+ (license (license:non-copyleft
+ "file:///tex/generic/hyph-utf8/patterns/tex/hyph-en-us.tex"
+ "FSF all permissive license"))))
+
+(define-public texlive-hyphen-esperanto
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-esperanto" "eo"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-eo.tex")
+ (base32
+ "03xbjbzasznsyf4wd45bya6f4snfmzpdzg5zpvqj5q6gjykdg54k")))
+ (synopsis "Hyphenation patterns for Esperanto")
+ (description "The package provides hyphenation patterns for Esperanto ISO
+Latin 3 and UTF-8 encodings.")
+ (license license:lppl1.0+)))
+
+(define-public texlive-hyphen-estonian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-estonian" "et"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-et.tex")
+ (base32
+ "0idl6xajkkgxqngjn19jcfd29is5rhfn59v0z8h4sv8yjv6k934m")))
+ (synopsis "Hyphenation patterns for Estonian")
+ (description "The package provides hyphenation patterns for Estonian in
+T1/EC and UTF-8 encodings.")
+ ;; Dual licensed under either license.
+ (license (list license:lppl1.3+ license:expat))))
+
+(define-public texlive-hyphen-ethiopic
+ (let ((template (texlive-hyphen-package
+ "texlive-hyphen-ethiopic" "mul-ethi"
+ (list "/source/generic/hyph-utf8/languages/mul-ethi/generate_patterns_mul-ethi.lua")
+ (base32
+ "1dp5qn1mhv62kj27lqc7s0ca65z9bziyavkvif9ds5ivk7aq9drw"))))
+ (package
+ (inherit template)
+ (arguments
+ (substitute-keyword-arguments (package-arguments template)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'build 'build-patterns
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((tex (string-append (getcwd)
+ "/tex/generic/hyph-utf8/patterns/tex/")))
+ (mkdir-p tex)
+ (with-directory-excursion "source/generic/hyph-utf8/languages/mul-ethi/"
+ (substitute* "generate_patterns_mul-ethi.lua"
+ (("\"UnicodeData.txt\"")
+ (string-append "\""
+ (assoc-ref inputs "UnicodeData.txt")
+ "\"")))
+ (invoke "texlua" "generate_patterns_mul-ethi.lua")
+ (rename-file "hyph-mul-ethi.tex"
+ (string-append tex "/hyph-mul-ethi.tex"))
+ #t))))
+ (add-after 'install 'install-hyph-mul-ethi.tex
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (target (string-append out "/share/texmf-dist/tex")))
+ (copy-recursively "tex" target)
+ #t)))))))
+ (native-inputs
+ `(,@(package-native-inputs template)
+ ("texlive-bin" ,texlive-bin)
+ ("UnicodeData.txt"
+ ,(origin
+ (method url-fetch)
+ (uri (string-append "http://www.unicode.org/Public/10.0.0/ucd/"
+ "UnicodeData.txt"))
+ (sha256
+ (base32
+ "1cfak1j753zcrbgixwgppyxhm4w8vda8vxhqymi7n5ljfi6kwhjj"))))))
+ (synopsis "Hyphenation patterns for Ethiopic scripts")
+ (description "The package provides hyphenation patterns for languages
+written using the Ethiopic script for Unicode engines. They are not supposed
+to be linguistically relevant in all cases and should, for proper typography,
+be replaced by files tailored to individual languages.")
+ (license license:lppl))))
+
+(define-public texlive-hyphen-finnish
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-finnish" "fi"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-fi.tex")
+ (base32
+ "03n6s8dwwa5vfk9bbyhcdf7p0bc0d1rrr312hpgbz8jfc9fbgd7n")))
+ (synopsis "Hyphenation patterns for Finnish")
+ (description "The package provides hyphenation patterns for Finnish in
+T1/EC and UTF-8 encodings.")
+ (license license:public-domain)))
+
+(define-public texlive-hyphen-french
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-french" "fr"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-fr.tex")
+ (base32
+ "1q82mmwvy7fdkm42958ajb53w89qkcdwybswxlwcvqngvhpy3zf0")))
+ (synopsis "Hyphenation patterns for French")
+ (description "The package provides hyphenation patterns for French in
+T1/EC and UTF-8 encodings.")
+ (license license:expat)))
+
+(define-public texlive-hyphen-friulan
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-friulan" "fur"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-fur.tex")
+ (base32
+ "07m975p0ghzs9sjqqgxy7qdkqmgvg4rx4xp08zwm1parqsdlwd5d")))
+ (synopsis "Hyphenation patterns for Friulan")
+ (description "The package provides hyphenation patterns for Friulan in
+ASCII encodings.")
+ (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-galician
+ (let ((template (texlive-hyphen-package
+ "texlive-hyphen-galician" "gl"
+ (list "/source/generic/hyph-utf8/languages/gl/README"
+ "/source/generic/hyph-utf8/languages/gl/glhybiox.tex"
+ "/source/generic/hyph-utf8/languages/gl/glhyextr.tex"
+ "/source/generic/hyph-utf8/languages/gl/glhymed.tex"
+ "/source/generic/hyph-utf8/languages/gl/glhyquim.tex"
+ "/source/generic/hyph-utf8/languages/gl/glhytec.tex"
+ "/source/generic/hyph-utf8/languages/gl/glhyxeog.tex"
+ "/source/generic/hyph-utf8/languages/gl/glpatter-utf8.tex")
+ (base32
+ "1yj1gxhkqqlyaand5gd6ij6xwffskryzlbcigdam3871a9p8x18w"))))
+ (package
+ (inherit template)
+ (arguments
+ (substitute-keyword-arguments (package-arguments template)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'build 'build-patterns
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((tex (string-append (getcwd)
+ "/tex/generic/hyph-utf8/patterns/tex/")))
+ (mkdir-p tex)
+ (with-directory-excursion "source/generic/hyph-utf8/languages/gl/"
+ (setenv "TEXINPUTS"
+ (string-append (getcwd) "//:"
+ (assoc-ref inputs "texlive-mkpattern") "//"))
+ (invoke "tex" "-ini" "-8bit" "glpatter-utf8.tex")
+ (rename-file "hyph-gl.tex"
+ (string-append tex "/hyph-gl.tex"))
+ #t))))
+ (add-after 'install 'install-hyph-gl.tex
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (target (string-append out "/share/texmf-dist/tex")))
+ (copy-recursively "tex" target)
+ #t)))))))
+ (native-inputs
+ `(,@(package-native-inputs template)
+ ("texlive-bin" ,texlive-bin)
+ ("texlive-mkpattern" ,texlive-mkpattern)))
+ (synopsis "Hyphenation patterns for Galician")
+ (description "The package provides hyphenation patterns for Galician in
+T1/EC and UTF-8 encodings.")
+ ;; glhyextr.tex is the only file in the public domain.
+ (license (list license:lppl1.3 license:public-domain)))))
+
+(define-public texlive-hyphen-georgian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-georgian" "ka"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-ka.tex")
+ (base32
+ "01zhn6mflpiqw4lyi8dx8syiz5mky9jrxm87cgw31hanis5cml4l")))
+ (synopsis "Hyphenation patterns for Georgian")
+ (description "The package provides hyphenation patterns for Georgian in
+T8M, T8K, and UTF-8 encodings.")
+ (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-german
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-german" '("de-1901" "de-1996" "de-ch-1901")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-de-1901.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-de-1996.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-de-ch-1901.tex"
+ "/tex/generic/hyphen/dehyphn.tex"
+ "/tex/generic/hyphen/dehypht.tex"
+ "/tex/generic/hyphen/dehyphtex.tex"
+ "/tex/generic/hyphen/ghyphen.README")
+ (base32
+ "1g0vhpvl2l69rn2lx7lkw0inrjbcxkj2sjgwd2fq7hdi4yb2ms76")))
+ (synopsis "Hyphenation patterns for German")
+ (description "This package provides hyphenation patterns for German in
+T1/EC and UTF-8 encodings, for traditional and reformed spelling, including
+Swiss German.")
+ ;; The patterns are released under the Expat license; the dehyph* files
+ ;; are released under the LPPL version 1 or later.
+ (license (list license:expat license:lppl1.0+))))
+
+(define-public texlive-hyphen-greek
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-greek" '("el-monoton" "el-polyton")
+ (list "/doc/generic/elhyphen/"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-el-monoton.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-el-polyton.tex"
+ "/tex/generic/hyphen/grmhyph5.tex"
+ "/tex/generic/hyphen/grphyph5.tex")
+ (base32
+ "04626jhlrv2flgdygm7sfv6xpqhfwiavi16gy2ac04iliyk4rypg")))
+ (synopsis "Hyphenation patterns for Greek")
+ (description "This package provides hyphenation patterns for Modern Greek
+in monotonic and polytonic spelling in LGR and UTF-8 encodings.")
+ (license license:lppl)))
+
+(define-public texlive-hyphen-hungarian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-hungarian" "hu"
+ (list "/doc/generic/huhyphen/"
+ "/doc/generic/hyph-utf8/hu/"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-hu.tex")
+ (base32
+ "0c81w2569cqsi4j56azwz0lfx16541zhiqgmn3m4iwh7mpx3rji8")))
+ (synopsis "Hyphenation patterns for Hungarian")
+ (description "This package provides hyphenation patterns for Hungarian in
+T1/EC and UTF-8 encodings.")
+ ;; Any of these licenses
+ (license (list license:gpl2 license:lgpl2.1+ license:mpl1.1))))
+
+(define-public texlive-hyphen-icelandic
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-icelandic" "is"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-is.tex")
+ (base32
+ "1ah1f82lgfhqgid4ngsfiypybx10v8gwxnb12396vfsj3bq6j0ba")))
+ (synopsis "Hyphenation patterns for Icelandic")
+ (description "This package provides hyphenation patterns for Icelandic in
+T1/EC and UTF-8 encodings.")
+ (license license:lppl1.2+)))
+
+(define-public texlive-hyphen-indic
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-indic"
+ '("as" "bn" "gu" "hi" "kn" "ml" "mr" "or" "pa" "ta" "te")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-as.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-bn.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-gu.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-hi.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-kn.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-ml.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-mr.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-or.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-pa.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-ta.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-te.tex")
+ (base32
+ "1v8zc3wdbkhzjrflndmz4gdj11syz8vrcg0vwvm5bwhkx23g91lv")))
+ (synopsis "Indic hyphenation patterns")
+ (description "This package provides hyphenation patterns for Assamese,
+Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Oriya, Panjabi, Tamil
+and Telugu for Unicode engines.")
+ (license license:expat)))
+
+(define-public texlive-hyphen-indonesian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-indonesian" "id"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-id.tex")
+ (base32
+ "0mf0hr9c952kb2hmzid7fqg5whshwpribbyndb3ba092wh02abh5")))
+ (synopsis "Indonesian hyphenation patterns")
+ (description "This package provides hyphenation patterns for
+Indonesian (Bahasa Indonesia) in ASCII encoding. They are probably also
+usable for Malay (Bahasa Melayu).")
+ (license license:gpl2)))
+
+(define-public texlive-hyphen-interlingua
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-interlingua" "ia"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-ia.tex")
+ (base32
+ "1aihgma3rix4jkc1z5k1lh6hlfrncn66yj0givd3j6xjqflafr2g")))
+ (synopsis "Interlingua hyphenation patterns")
+ (description "This package provides hyphenation patterns for Interlingua
+in ASCII encoding.")
+ (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-irish
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-irish" "ga"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-ga.tex")
+ (base32
+ "02k1fykgj3xamczjq16i9fsjjsh78pp5ypmh93p64izk2vymfwk0")))
+ (synopsis "Irish hyphenation patterns")
+ (description "This package provides hyphenation patterns for
+Irish (Gaeilge) in T1/EC and UTF-8 encodings.")
+ ;; Either of these licenses
+ (license (list license:gpl2+ license:expat))))
+
+(define-public texlive-hyphen-italian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-italian" "it"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-it.tex")
+ (base32
+ "1a65q3hjn2p212cgv6p7wa0wcn34qnxcz2pl3v3ip0xmb16qqsk5")))
+ (synopsis "Italian hyphenation patterns")
+ (description "This package provides hyphenation patterns for Italian in
+ASCII encoding. Compliant with the Recommendation UNI 6461 on hyphenation
+issued by the Italian Standards Institution (Ente Nazionale di Unificazione
+UNI).")
+ (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-kurmanji
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-kurmanji" "kmr"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-kmr.tex")
+ (base32
+ "1145ykfd0b0hgklindlxdgkqmsnj3cai3cwgllz411yqmrhjc6y9")))
+ (synopsis "Kurmanji hyphenation patterns")
+ (description "This package provides hyphenation patterns for
+Kurmanji (Northern Kurdish) as spoken in Turkey and by the Kurdish diaspora in
+Europe, in T1/EC and UTF-8 encodings.")
+ (license license:lppl1.3)))
+
+(define-public texlive-hyphen-latin
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-latin" '("la-x-classic" "la-x-liturgic" "la")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-la-x-classic.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-la-x-liturgic.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-la.tex")
+ (base32
+ "1d8d6b47r4r000gqgzyl0sy9is0y0dg41jp8fw4gqq8qmcgdxgsg")))
+ (synopsis "Liturgical Latin hyphenation patterns")
+ (description "This package provides hyphenation patterns for Latin in
+T1/EC and UTF-8 encodings, mainly in modern spelling (u when u is needed and v
+when v is needed), medieval spelling with the ligatures @code{\\ae} and
+@code{\\oe} and the (uncial) lowercase 'v' written as a 'u' is also supported.
+Apparently there is no conflict between the patterns of modern Latin and those
+of medieval Latin. It also includes hyphenation patterns for the Classical
+Latin in T1/EC and UTF-8 encodings. Classical Latin hyphenation patterns are
+different from those of 'plain' Latin, the latter being more adapted to modern
+Latin. It also provides hyphenation patterns for the Liturgical Latin in
+T1/EC and UTF-8 encodings.")
+ ;; Either of these licenses
+ (license (list license:lppl1.0+ license:expat))))
+
+(define-public texlive-hyphen-latvian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-latvian" "lv"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-lv.tex")
+ (base32
+ "1xbh5s6nwfjbv7g4kmcpjkm02a6s767p7jn9qjcnz5ip0ndl5g66")))
+ (synopsis "Latvian hyphenation patterns")
+ (description "This package provides hyphenation patterns for Latvian in
+L7X and UTF-8 encodings.")
+ ;; Either of these licenses.
+ (license (list license:gpl2 license:lgpl2.1))))
+
+(define-public texlive-hyphen-lithuanian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-lithuanian" "lt"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-lt.tex")
+ (base32
+ "0v9spw0qkygkihj5app2immzqqr98w81pz460bcgvj1ah35jdfsl")))
+ (synopsis "Lithuanian hyphenation patterns")
+ (description "This package provides hyphenation patterns for Lithuanian in
+L7X and UTF-8 encodings.")
+ ;; "Do ... whatever ... as long as you respect the copyright"; as part of
+ ;; the hyph-utf8 package we choose the LPPL license.
+ (license license:lppl)))
+
+(define-public texlive-hyphen-mongolian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-mongolian" '("mn-cyrl-x-lmc" "mn-cyrl")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-mn-cyrl-x-lmc.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-mn-cyrl.tex")
+ (base32
+ "0lqq3jgwgnclb1cn3x99xmk90xra9q51b00ypwy5crssmy023hqc")))
+ (synopsis "Mongolian hyphenation patterns in Cyrillic script")
+ (description "This package provides hyphenation patterns for Mongolian in
+T2A, LMC and UTF-8 encodings.")
+ ;; Either of these licenses
+ (license (list license:lppl1.3+ license:expat))))
+
+(define-public texlive-hyphen-norwegian
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-norwegian" '("nb" "nn" "no")
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-nb.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-nn.tex"
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-no.tex")
+ (base32
+ "1fxnf671yz0p3lmdkspna7fjh96br1jy6yf7v17yh4fxwry3s4yz")))
+ (synopsis "Norwegian Bokmal and Nynorsk hyphenation patterns")
+ (description "This package provides hyphenation patterns for Norwegian
+Bokmal and Nynorsk in T1/EC and UTF-8 encodings.")
+ (license (license:non-copyleft
+ "/tex/generic/hyph-utf8/patterns/tex/hyph-no.tex"
+ "FSF All permissive license"))))
+
+(define-public texlive-hyphen-occitan
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-occitan" "oc"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-oc.tex")
+ (base32
+ "1y6j6ac9ncn79p7hnp6mdwdsw9ij14zyjby5iwdhpvzzn7yyc7p8")))
+ (synopsis "Occitan hyphenation patterns")
+ (description "This package provides hyphenation patterns for Occitan in
+T1/EC and UTF-8 encodings. They are supposed to be valid for all the Occitan
+variants spoken and written in the wide area called 'Occitanie' by the French.
+It ranges from the Val d'Aran within Catalunya, to the South Western Italian
+Alps encompassing the southern half of the French pentagon.")
+ (license license:lppl1.0+)))
+
+(define-public texlive-hyphen-piedmontese
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-piedmontese" "pms"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pms.tex")
+ (base32
+ "00fqzymkg374r3dzf1y82k6b18bqrf688vnjv0vkvw5a45srlb5r")))
+ (synopsis "Piedmontese hyphenation patterns")
+ (description "This package provides hyphenation patterns for Piedmontese
+in ASCII encoding. Compliant with 'Gramatica dla lengua piemonteisa' by
+Camillo Brero.")
+ (license license:lppl1.3+)))
+
+(define-public texlive-hyphen-polish
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-polish" "pl"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pl.tex")
+ (base32
+ "0dzq8ca96q7m5bslh51x8d30pdb86glh2gn3mmvq5ip813ckwh3s")))
+ (synopsis "Polish hyphenation patterns")
+ (description "This package provides hyphenation patterns for Polish in QX
+and UTF-8 encodings.")
+ ;; No differing license declared, so we choose the project license.
+ (license license:lppl)))
+
+(define-public texlive-hyphen-portuguese
+ (package
+ (inherit (texlive-hyphen-package
+ "texlive-hyphen-portuguese" "pt"
+ (list "/tex/generic/hyph-utf8/patterns/tex/hyph-pt.tex")
+ (base32
+ "1waxrmm33fd2qfc4kiaiblg8kwzasrvgq4j3l14z733d0hlg4rfz")))
+ (synopsis "Portuguese hyphenation patterns")
+ (description "This package provides hyphenation patterns for Portuguese in
+T1/EC and UTF-8 encodings.")
+ (license license:bsd-3)))
+
+(define-public texlive-hyph-utf8
+ (package
+ (inherit (simple-texlive-package
+ "texlive-hyph-utf8"
+ (list "/source/generic/hyph-utf8/"
+ "/source/luatex/hyph-utf8/"
+ "/doc/luatex/hyph-utf8/"
+ "/tex/luatex/hyph-utf8/etex.src"
+ ;; Used to extract luatex-hyphen.lua
+ "/tex/latex/base/docstrip.tex"
+
+ ;; Documentation; we can't use the whole directory because
+ ;; it includes files from other packages.
+ "/doc/generic/hyph-utf8/CHANGES"
+ "/doc/generic/hyph-utf8/HISTORY"
+ "/doc/generic/hyph-utf8/hyph-utf8.pdf"
+ "/doc/generic/hyph-utf8/hyph-utf8.tex"
+ "/doc/generic/hyph-utf8/hyphenation-distribution.pdf"
+ "/doc/generic/hyph-utf8/hyphenation-distribution.tex"
+ "/doc/generic/hyph-utf8/img/miktex-languages.png"
+ "/doc/generic/hyph-utf8/img/texlive-collection.png")
+ (base32
+ "10y8svgk68sivmgzrv8gv137r7kv49cs256cq2wja9ms437pxvbj")))
+ (outputs '("out" "doc"))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; there are none
+ #:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:make-flags
+ (list "-C" "source/luatex/hyph-utf8/"
+ (string-append "DO_TEX = tex --interaction=nonstopmode '&tex' $<")
+ (string-append "RUNDIR =" (assoc-ref %outputs "out") "/share/texmf-dist/tex/luatex/hyph-utf8/")
+ (string-append "DOCDIR =" (assoc-ref %outputs "doc") "/share/texmf-dist/doc/luatex/hyph-utf8/")
+ ;; hyphen.cfg is neither included nor generated, so let's only build the lua file.
+ (string-append "UNPACKED = $(NAME).lua"))
+ #:phases
+ (modify-phases %standard-phases
+ ;; TeX isn't usable at this point, so we first need to generate the
+ ;; tex.fmt.
+ (replace 'configure
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Target directories must exist.
+ (mkdir-p (string-append (assoc-ref %outputs "out")
+ "/share/texmf-dist/tex/luatex/hyph-utf8/"))
+ (mkdir-p (string-append (assoc-ref %outputs "doc")
+ "/share/texmf-dist/doc/luatex/hyph-utf8/"))
+
+ ;; We cannot build the documentation because that requires a
+ ;; fully functional pdflatex, which depends on this package.
+ (substitute* "source/luatex/hyph-utf8/Makefile"
+ (("all: .*") "all: $(RUNFILES)\n"))
+
+ ;; Find required fonts for building tex.fmt
+ (setenv "TFMFONTS"
+ (string-append (assoc-ref inputs "texlive-fonts-cm")
+ "/share/texmf-dist/fonts/tfm/public/cm:"
+ (assoc-ref inputs "texlive-fonts-knuth-lib")
+ "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
+ ;; ...and find all tex files in this environment.
+ (setenv "TEXINPUTS"
+ (string-append
+ (getcwd) ":"
+ (string-join
+ (map (match-lambda ((_ . dir) dir)) inputs)
+ "//:")))
+
+ ;; Generate tex.fmt.
+ (let ((where "source/luatex/hyph-utf8"))
+ (mkdir-p where)
+ (with-directory-excursion where
+ (invoke "tex" "-ini"
+ (string-append (assoc-ref inputs "texlive-tex-plain")
+ "/share/texmf-dist/tex/plain/config/tex.ini"))))))
+ (add-before 'build 'build-loaders-and-converters
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((root (string-append (assoc-ref outputs "out")
+ "/share/texmf-dist"))
+ (conv
+ (string-append root
+ "/tex/generic/hyph-utf8/conversions")))
+
+ ;; Build converters
+ (mkdir-p conv)
+ (with-directory-excursion "source/generic/hyph-utf8"
+ (substitute* "generate-converters.rb"
+ (("\\$path_root=File.*")
+ (string-append "$path_root=\"" root "\"\n"))
+ ;; Avoid error with newer Ruby.
+ (("#1\\{%") "#1{%%"))
+ (invoke "ruby" "generate-converters.rb"))
+ #t)))
+ (replace 'install
+ (lambda* (#:key source outputs #:allow-other-keys)
+ (let ((doc (assoc-ref outputs "doc"))
+ (out (assoc-ref outputs "out")))
+ (mkdir-p doc)
+ (copy-recursively
+ (string-append source "/doc")
+ (string-append doc "/doc"))
+ (install-file
+ (string-append source "/tex/luatex/hyph-utf8/etex.src")
+ (string-append out "/share/texmf-dist/tex/luatex/hyph-utf8/")))
+ #t)))))
+ (native-inputs
+ `(("ruby" ,ruby)
+ ("texlive-bin" ,texlive-bin)
+ ;; The following packages are needed for build "tex.fmt", which we need
+ ;; for a working "tex".
+ ("texlive-tex-plain" ,texlive-tex-plain)
+ ("texlive-fonts-cm" ,texlive-fonts-cm)
+ ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)
+ ("texlive-hyphen-base" ,texlive-hyphen-base)))
+ (home-page "https://ctan.org/pkg/hyph-utf8")
+ (synopsis "Hyphenation patterns expressed in UTF-8")
+ (description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
+hyphenation patterns in UTF-8 format, whereas older systems require
+hyphenation patterns in the 8-bit encoding of the font in use (such encodings
+are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
+etc). The present package offers a collection of conversions of existing
+patterns to UTF-8 format, together with converters for use with 8-bit fonts in
+older systems. Since hyphenation patterns for Knuthian-style TeX systems are
+only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
+converters, will completely supplant the older patterns.")
+ ;; Individual files each have their own license. Most of these files are
+ ;; independent hyphenation patterns.
+ (license (list license:lppl1.0+
+ license:lppl1.2+
+ license:lppl1.3
+ license:lppl1.3+
+ license:lppl1.3a+
+ license:lgpl2.1
+ license:lgpl2.1+
+ license:lgpl3+
+ license:gpl2+
+ license:gpl3+
+ license:mpl1.1
+ license:asl2.0
+ license:expat
+ license:bsd-3
+ license:cc0
+ license:public-domain
+ license:wtfpl2))))
+
+(define-public texlive-generic-hyph-utf8
+ (deprecated-package "texlive-generic-hyph-utf8" texlive-hyph-utf8))
+
+(define-public texlive-dehyph-exptl
+ (package
+ (inherit (simple-texlive-package
+ "texlive-dehyph-exptl"
+ (list "/tex/generic/dehyph-exptl/"
+ "/doc/generic/dehyph-exptl/")
+ (base32
+ "1w2danvvy2f52hcb4acvjks53kcanwxr9s990fap6mj279hpgmh2")
+ #:trivial? #t))
+ (propagated-inputs
+ `(("texlive-hyphen-base" ,texlive-hyphen-base)
+ ("texlive-hyph-utf8" ,texlive-hyph-utf8)))
+ (home-page "http://projekte.dante.de/Trennmuster/WebHome")
+ (synopsis "Hyphenation patterns for German")
+ (description "The package provides experimental hyphenation patterns for
+the German language, covering both traditional and reformed orthography. The
+patterns can be used with packages Babel and hyphsubst from the Oberdiek
+bundle.")
+ ;; Hyphenation patterns are under the Expat license; documentation is
+ ;; under LPPL.
+ (license (list license:expat license:lppl))))
+
+(define-public texlive-generic-dehyph-exptl
+ (deprecated-package "texlive-generic-dehyph-exptl" texlive-dehyph-exptl))
+
+(define-public texlive-latex-base
+ (let ((texlive-dir
+ (lambda (dir hash)
+ (origin
+ (method svn-fetch)
+ (uri (svn-reference
+ (url (string-append "svn://www.tug.org/texlive/tags/"
+ %texlive-tag "/Master/texmf-dist/"
+ dir))
+ (revision %texlive-revision)))
+ (file-name (string-append "texlive-generic-"
+ (last (string-split
+ (string-drop-right dir 1) #\/))
+ "-" (number->string %texlive-revision)
+ "-checkout"))
+ (sha256 (base32 hash))))))
+ (package
+ (name "texlive-latex-base")
+ (version (number->string %texlive-revision))
+ (source (origin
+ (method svn-fetch)
+ (uri (texlive-ref "latex" "base"))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "17bqrzzjz16k52sc7ydl4vw7ddy2z3g0p1xsk2c35h1ynq9h3wwm"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 match)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ #:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Find required fonts
+ (setenv "TFMFONTS"
+ (string-append (assoc-ref inputs "texlive-fonts-cm")
+ "/share/texmf-dist/fonts/tfm/public/cm:"
+ (assoc-ref inputs "texlive-fonts-latex")
+ "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
+ (assoc-ref inputs "texlive-fonts-knuth-lib")
+ "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
+ (setenv "TEXINPUTS"
+ (string-append
+ (getcwd) ":"
+ (getcwd) "/build:"
+ (string-join
+ (map (match-lambda ((_ . dir) dir)) inputs)
+ "//:")))
+
+ ;; Create an empty texsys.cfg, because latex.ltx wants to include
+ ;; it. This file must exist and it's fine if it's empty.
+ (with-output-to-file "texsys.cfg"
+ (lambda _ (format #t "%")))
+
+ (mkdir "build")
+ (mkdir "web2c")
+ (invoke "luatex" "-ini" "-interaction=batchmode"
+ "-output-directory=build" "unpack.ins")
+ (invoke "tex" "-ini" "-interaction=batchmode"
+ "-output-directory=web2c" "tex.ini")
+ ;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which
+ ;; is enabled only in extended mode (activated with a
+ ;; leading asterisk). We should not use luatex here,
+ ;; because that would make the generated format files
+ ;; incompatible with any other TeX engine.
+ (for-each (lambda (format)
+ (invoke "latex" "-ini" "-interaction=batchmode"
+ "-output-directory=web2c"
+ "-translate-file=cp227.tcx"
+ (string-append "*" format ".ini")))
+ '("latex"
+ "pdflatex"
+ "pdfetex"))
+ (for-each (lambda (format)
+ (invoke format "-ini" "-interaction=batchmode"
+ "-output-directory=web2c"
+ (string-append "*" format ".ini")))
+ '("xetex"
+ "xelatex"))
+ (for-each (lambda (format)
+ (invoke "luatex" "-ini" "-interaction=batchmode"
+ "-output-directory=web2c"
+ (string-append format ".ini")))
+ '("dviluatex" "dvilualatex" "luatex" "lualatex"))
+ #t))
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (target (string-append
+ out "/share/texmf-dist/tex/latex/base"))
+ (web2c (string-append
+ out "/share/texmf-dist/web2c"))
+ (support-files (assoc-ref inputs "texlive-latex-base-support-files")))
+ (mkdir-p target)
+ (mkdir-p web2c)
+ (for-each delete-file (find-files "." "\\.(log|aux)$"))
+ (for-each (cut install-file <> target)
+ (find-files "build" ".*"))
+ (for-each (cut install-file <> web2c)
+ (find-files "web2c" ".*"))
+ ;; pdftex is really just the same as pdfetex, but since it
+ ;; doesn't have its own format file, we need to copy it.
+ (copy-file "web2c/pdfetex.fmt"
+ (string-append web2c "/pdftex.fmt"))
+ ;; "source" is missing the support files as per doc/latex/base/manifest.txt.
+ ;; FIXME: We are probably not packaging this right.
+ (for-each (lambda (file)
+ (install-file
+ (string-append support-files "/" file)
+ target))
+ '("ltxguide.cls" "ltnews.cls" "minimal.cls" "idx.tex"
+ "lablst.tex" "testpage.tex" "ltxcheck.tex"))
+ ;; Install configurations
+ (copy-recursively
+ (assoc-ref inputs "texlive-latex-latexconfig")
+ (string-append out "/share/texmf-dist/tex/latex/latexconfig"))
+ (copy-recursively
+ (assoc-ref inputs "texlive-generic-config")
+ (string-append out "/share/texmf-dist/tex/generic/config"))
+ (copy-recursively
+ (assoc-ref inputs "texlive-generic-hyphen")
+ (string-append out "/share/texmf-dist/tex/generic/hyphen"))
+ (copy-recursively
+ (assoc-ref inputs "texlive-generic-ruhyphen")
+ (string-append out "/share/texmf-dist/tex/generic/ruhyphen"))
+ (copy-recursively
+ (assoc-ref inputs "texlive-generic-ukrhyph")
+ (string-append out "/share/texmf-dist/tex/generic/ukrhyph"))