summaryrefslogtreecommitdiff
path: root/aurox/packages/django.scm
blob: ff141e2f0fbeb65f9dbf4b42770300de393fe376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(define-module (aurox packages django)
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system pyproject)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix packages))

(define-public python-django-modeltrans
  (package
    (name "python-django-modeltrans")
    (version "0.9.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/zostera/django-modeltrans/")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1ykd3b0c2qrbxv0w2lp5l7p8giy626gb7w21h65fikhbnvd0f22x"))))
    (build-system pyproject-build-system)
    (propagated-inputs
     (specifications->packages '("postgresql" "python-django" "python-psycopg")))
    (native-inputs
     (specifications->packages '("python-setuptools" "python-tzdata")))
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
		(let ((pgdata "/tmp/pgdata")
                      (host "/tmp")
                      (port "5432")
                      (username "modeltrans")
                      (password "modeltrans")
                      (database "modeltrans"))
                  (invoke "initdb"
			  "--locale-provider=icu" "--icu-locale=en_US" pgdata)
                  (invoke "pg_ctl"
			  "-D" pgdata "-o" (string-append "-k " host) "start")
                  (invoke "createdb" "-h" host database)
                  (invoke "createuser" "-h" host username)
                  (invoke "psql" "-h" host "-d" database "-c"
                          (string-append "ALTER ROLE " username
                                         " WITH SUPERUSER;"))
		  (invoke "python" "./manage.py" "test"))))))))
    (home-page "https://github.com/zostera/django-modeltrans/")
    (synopsis "Model translations in a jsonb field")
    (description "Model translations in a jsonb field.")
    (license license:bsd-3)))