build-system/haskell: Do not rely on compiler name.
We’ve been relying on the compiler name matching its package subdir. Since we effectively only support GHC we can hard-code this and avoid issues with “ghc-next”. * guix/build/haskell-build-system.scm (make-ghc-package-database): Use GHC_PACKAGE_PATH. (register): Hard-code ghc prefix.
This commit is contained in:
		
							parent
							
								
									127828ddd7
								
							
						
					
					
						commit
						7cdb65dc9c
					
				
					 1 changed files with 4 additions and 10 deletions
				
			
		| 
						 | 
					@ -175,15 +175,8 @@ first match and return the content of the group."
 | 
				
			||||||
  "Generate the GHC package database."
 | 
					  "Generate the GHC package database."
 | 
				
			||||||
  (let* ((haskell  (assoc-ref inputs "haskell"))
 | 
					  (let* ((haskell  (assoc-ref inputs "haskell"))
 | 
				
			||||||
         (name-version (strip-store-file-name haskell))
 | 
					         (name-version (strip-store-file-name haskell))
 | 
				
			||||||
         (input-dirs (match inputs
 | 
					 | 
				
			||||||
                       (((_ . dir) ...)
 | 
					 | 
				
			||||||
                        dir)
 | 
					 | 
				
			||||||
                       (_ '())))
 | 
					 | 
				
			||||||
         ;; Silence 'find-files' (see 'evaluate-search-paths')
 | 
					         ;; Silence 'find-files' (see 'evaluate-search-paths')
 | 
				
			||||||
         (conf-dirs (with-null-error-port
 | 
					         (conf-dirs (search-path-as-string->list (getenv "GHC_PACKAGE_PATH")))
 | 
				
			||||||
                     (search-path-as-list
 | 
					 | 
				
			||||||
                      `(,(string-append "lib/" name-version))
 | 
					 | 
				
			||||||
                      input-dirs #:pattern ".*\\.conf.d$")))
 | 
					 | 
				
			||||||
         (conf-files (append-map (cut find-files <> "\\.conf$") conf-dirs)))
 | 
					         (conf-files (append-map (cut find-files <> "\\.conf$") conf-dirs)))
 | 
				
			||||||
    (mkdir-p %tmp-db-dir)
 | 
					    (mkdir-p %tmp-db-dir)
 | 
				
			||||||
    (for-each (lambda (file)
 | 
					    (for-each (lambda (file)
 | 
				
			||||||
| 
						 | 
					@ -243,10 +236,11 @@ given Haskell package."
 | 
				
			||||||
  (let* ((out (assoc-ref outputs "out"))
 | 
					  (let* ((out (assoc-ref outputs "out"))
 | 
				
			||||||
         (doc (assoc-ref outputs "doc"))
 | 
					         (doc (assoc-ref outputs "doc"))
 | 
				
			||||||
         (haskell  (assoc-ref inputs "haskell"))
 | 
					         (haskell  (assoc-ref inputs "haskell"))
 | 
				
			||||||
         (name-verion (strip-store-file-name haskell))
 | 
					         (name-version (strip-store-file-name haskell))
 | 
				
			||||||
 | 
					         (version (last (string-split name-version #\-)))
 | 
				
			||||||
         (lib (string-append (or (assoc-ref outputs "lib") out) "/lib"))
 | 
					         (lib (string-append (or (assoc-ref outputs "lib") out) "/lib"))
 | 
				
			||||||
         (config-dir (string-append lib
 | 
					         (config-dir (string-append lib
 | 
				
			||||||
                                    "/" name-verion
 | 
					                                    "/ghc-" version
 | 
				
			||||||
                                    "/" name ".conf.d"))
 | 
					                                    "/" name ".conf.d"))
 | 
				
			||||||
         (id-rx (make-regexp "^id: *(.*)$"))
 | 
					         (id-rx (make-regexp "^id: *(.*)$"))
 | 
				
			||||||
         (config-file (string-append out "/" name ".conf"))
 | 
					         (config-file (string-append out "/" name ".conf"))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue