gnu: python-django: Add a native search path for TZDIR.
* gnu/packages/django.scm (python-django-4.0)[native-search-paths]: Add TZDIR specification. (django-3.2)[native-search-paths]: Don't inherit. (python-django-rest-framework): Don't set TZDIR directly.
This commit is contained in:
		
							parent
							
								
									f001f30bdf
								
							
						
					
					
						commit
						3e10dcabc0
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
					@ -118,6 +118,13 @@
 | 
				
			||||||
           ;; This input is not strictly required, but in practice many Django
 | 
					           ;; This input is not strictly required, but in practice many Django
 | 
				
			||||||
           ;; libraries need it for test suites and similar.
 | 
					           ;; libraries need it for test suites and similar.
 | 
				
			||||||
           python-jinja2))
 | 
					           python-jinja2))
 | 
				
			||||||
 | 
					    (native-search-paths
 | 
				
			||||||
 | 
					     ;; Set TZDIR when 'tzdata' is available so that timezone functionality
 | 
				
			||||||
 | 
					     ;; works (mostly) out of the box in containerized environments.
 | 
				
			||||||
 | 
					     ;; Note: This search path actually belongs to 'glibc'.
 | 
				
			||||||
 | 
					     (list (search-path-specification
 | 
				
			||||||
 | 
					            (variable "TZDIR")
 | 
				
			||||||
 | 
					            (files '("share/zoneinfo")))))
 | 
				
			||||||
    (home-page "https://www.djangoproject.com/")
 | 
					    (home-page "https://www.djangoproject.com/")
 | 
				
			||||||
    (synopsis "High-level Python Web framework")
 | 
					    (synopsis "High-level Python Web framework")
 | 
				
			||||||
    (description
 | 
					    (description
 | 
				
			||||||
| 
						 | 
					@ -138,6 +145,7 @@ to the @dfn{don't repeat yourself} (DRY) principle.")
 | 
				
			||||||
              (sha256
 | 
					              (sha256
 | 
				
			||||||
               (base32
 | 
					               (base32
 | 
				
			||||||
                "0xbyl9fh9lk5hiwpw46s6hz98gs0fixrpq3myj5hh6vbbnz4mjb9"))))
 | 
					                "0xbyl9fh9lk5hiwpw46s6hz98gs0fixrpq3myj5hh6vbbnz4mjb9"))))
 | 
				
			||||||
 | 
					    (native-search-paths '())           ;no need for TZDIR
 | 
				
			||||||
    (propagated-inputs
 | 
					    (propagated-inputs
 | 
				
			||||||
     (modify-inputs (package-propagated-inputs python-django-4.0)
 | 
					     (modify-inputs (package-propagated-inputs python-django-4.0)
 | 
				
			||||||
       ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
 | 
					       ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
 | 
				
			||||||
| 
						 | 
					@ -1033,9 +1041,7 @@ Django projects, which allows association of a number of tags with any
 | 
				
			||||||
         (replace 'check
 | 
					         (replace 'check
 | 
				
			||||||
           (lambda* (#:key tests? inputs #:allow-other-keys)
 | 
					           (lambda* (#:key tests? inputs #:allow-other-keys)
 | 
				
			||||||
             (if tests?
 | 
					             (if tests?
 | 
				
			||||||
                 (begin
 | 
					                 (invoke "python" "runtests.py")
 | 
				
			||||||
                   (setenv "TZDIR" (search-input-directory inputs "share/zoneinfo"))
 | 
					 | 
				
			||||||
                   (invoke "python" "runtests.py"))
 | 
					 | 
				
			||||||
                 (format #t "test suite not run~%")))))))
 | 
					                 (format #t "test suite not run~%")))))))
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     (list python-pytest python-pytest-django tzdata-for-tests))
 | 
					     (list python-pytest python-pytest-django tzdata-for-tests))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue