offlate/guix.scm

guix.scm

1
(use-modules
2
  ((guix licenses) #:prefix license:)
3
  (guix build-system python)
4
  (guix download)
5
  (guix git-download)
6
  (guix git)
7
  (guix packages)
8
  (guix utils)
9
  (gnu packages aspell)
10
  (gnu packages check)
11
  (gnu packages enchant)
12
  (gnu packages fontutils)
13
  (gnu packages freedesktop)
14
  (gnu packages libreoffice)
15
  (gnu packages python)
16
  (gnu packages python-web)
17
  (gnu packages python-xyz)
18
  (gnu packages qt)
19
  (gnu packages serialization)
20
  (gnu packages sphinx)
21
  (gnu packages time)
22
  (gnu packages version-control)
23
  (gnu packages xml))
24
25
(define-public offlate
26
  (package
27
    (name "offlate")
28
    (version "0.5")
29
    (source (git-checkout (url (dirname (current-filename)))))
30
    (build-system python-build-system)
31
    (arguments
32
     `(#:modules ((guix build python-build-system)
33
                  (guix build qt-utils)
34
                  (guix build utils))
35
       #:imported-modules (,@%python-build-system-modules
36
                            (guix build qt-utils))
37
       ;; No tests
38
       #:tests? #f
39
       #:phases
40
       (modify-phases %standard-phases
41
         (add-before 'build 'generate-fonts
42
           (lambda _
43
             (invoke "make" "fonts")))
44
         (add-before 'build 'generate-translations
45
           (lambda _
46
             (invoke "make" "update-langs")))
47
         (add-after 'install 'wrap-qt
48
           (lambda* (#:key inputs outputs #:allow-other-keys)
49
             (let ((out (assoc-ref outputs "out")))
50
               (wrap-qt-program "offlate" #:output out #:inputs inputs))))
51
         (add-after 'install 'wrap-offlate
52
            (lambda* (#:key outputs #:allow-other-keys)
53
              (wrap-program
54
                  (string-append (assoc-ref outputs "out") "/bin/offlate")
55
                `("PYTHONPATH" ":" prefix
56
                  (,(string-append (getenv "PYTHONPATH") ":"
57
                   (assoc-ref outputs "out") "/lib/python"
58
                   ,(version-major+minor (package-version python-wrapper))
59
                   "/site-packages")))))))))
60
    (inputs
61
      `(("python-android-stringslib" ,python-android-stringslib)
62
        ("python-dateutil" ,python-dateutil)
63
        ("python-gitlab" ,python-gitlab)
64
        ("python-lxml" ,python-lxml)
65
        ("python-polib" ,python-polib)
66
        ("python-pycountry" ,python-pycountry)
67
        ("python-pyenchant" ,python-pyenchant)
68
        ("python-pygit2" ,python-pygit2)
69
        ("python-pygithub" ,python-pygithub)
70
        ("python-pyqt" ,python-pyqt)
71
        ("python-requests" ,python-requests)
72
        ("python-ruamel.yaml" ,python-ruamel.yaml)
73
        ("python-translate-toolkit" ,python-translate-toolkit)
74
        ("python-translation-finder" ,python-translation-finder)
75
        ("python-watchdog" ,python-watchdog)))
76
    (native-inputs
77
     `(("fontforge" ,fontforge)
78
       ("qttools" ,qttools)
79
       ("python-sphinx" ,python-sphinx)))
80
    (home-page "https://framagit.org/tyreunom/offlate")
81
    (synopsis "Offline translation interface for online translation tools")
82
    (description "Offlate offers a unified interface for different translation
83
file formats, as well as many different online translation platforms.  You can
84
use it to get work from online platforms, specialized such as the Translation
85
Project, or not such a gitlab instance when your upstream doesn't use any
86
dedicated platform.  The tool proposes a unified interface for any format and
87
an upload option to send your work back to the platform.")
88
    (license license:gpl3+)))
89
90
offlate
91