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 my-python-android-stringslib
26
  (package
27
    (inherit python-android-stringslib)
28
    (source (origin
29
              (method git-fetch)
30
              (uri (git-reference
31
                     (url "https://framagit.org/tyreunom/python-android-strings-lib")
32
                     (commit "bea536ba7878ac1b569af45bffa2e4396bf134dc")))
33
              (file-name (git-file-name "python-android-stringslib" "1.2"))
34
              (sha256
35
               (base32
36
                "01adzm17cs5980f7d2222lpgdar5n99chyap7541aa4wc6gm9wqs"))))))
37
38
(define-public offlate
39
  (package
40
    (name "offlate")
41
    (version "0.5")
42
    (source (git-checkout (url (dirname (current-filename)))))
43
    (build-system python-build-system)
44
    (arguments
45
     `(#:modules ((guix build python-build-system)
46
                  (guix build qt-utils)
47
                  (guix build utils))
48
       #:imported-modules (,@%python-build-system-modules
49
                            (guix build qt-utils))
50
       ;; No tests
51
       #:tests? #f
52
       #:phases
53
       (modify-phases %standard-phases
54
         (add-before 'build 'generate-fonts
55
           (lambda _
56
             (invoke "make" "fonts")))
57
         (add-before 'build 'generate-translations
58
           (lambda _
59
             (invoke "make" "update-langs")))
60
         (add-after 'install 'wrap-qt
61
           (lambda* (#:key inputs outputs #:allow-other-keys)
62
             (let ((out (assoc-ref outputs "out")))
63
               (wrap-qt-program "offlate" #:output out #:inputs inputs))))
64
         (add-after 'install 'wrap-offlate
65
            (lambda* (#:key outputs #:allow-other-keys)
66
              (wrap-program
67
                  (string-append (assoc-ref outputs "out") "/bin/offlate")
68
                `("PYTHONPATH" ":" prefix
69
                  (,(string-append (getenv "PYTHONPATH") ":"
70
                   (assoc-ref outputs "out") "/lib/python"
71
                   ,(version-major+minor (package-version python-wrapper))
72
                   "/site-packages")))))))))
73
    (inputs
74
      `(("python-android-stringslib" ,my-python-android-stringslib)
75
        ("python-dateutil" ,python-dateutil)
76
        ("python-gitlab" ,python-gitlab)
77
        ("python-lxml" ,python-lxml)
78
        ("python-polib" ,python-polib)
79
        ("python-pycountry" ,python-pycountry)
80
        ("python-pyenchant" ,python-pyenchant)
81
        ("python-pygit2" ,python-pygit2)
82
        ("python-pygithub" ,python-pygithub)
83
        ("python-pyqt" ,python-pyqt)
84
        ("python-requests" ,python-requests)
85
        ("python-ruamel.yaml" ,python-ruamel.yaml)
86
        ("python-translate-toolkit" ,python-translate-toolkit)
87
        ("python-translation-finder" ,python-translation-finder)
88
        ("python-watchdog" ,python-watchdog)))
89
    (native-inputs
90
     `(("fontforge" ,fontforge)
91
       ("qttools" ,qttools)
92
       ("python-sphinx" ,python-sphinx)))
93
    (home-page "https://framagit.org/tyreunom/offlate")
94
    (synopsis "Offline translation interface for online translation tools")
95
    (description "Offlate offers a unified interface for different translation
96
file formats, as well as many different online translation platforms.  You can
97
use it to get work from online platforms, specialized such as the Translation
98
Project, or not such a gitlab instance when your upstream doesn't use any
99
dedicated platform.  The tool proposes a unified interface for any format and
100
an upload option to send your work back to the platform.")
101
    (license license:gpl3+)))
102
103
offlate
104