gnu: hop: Fix RPATHs.
* gnu/packages/scheme.scm (inputs): Move patchelf input to... (native-inputs): ...here. New field. (arguments)[phases]: Use augment-rpath for patch-rpath phase.
This commit is contained in:
		
							parent
							
								
									6f428fda0a
								
							
						
					
					
						commit
						8a629613d1
					
				
					 1 changed files with 17 additions and 31 deletions
				
			
		|  | @ -238,7 +238,7 @@ Scheme and C programs and between Scheme and Java programs.") | ||||||
|              (patches (list (search-patch "hop-bigloo-4.0b.patch"))))) |              (patches (list (search-patch "hop-bigloo-4.0b.patch"))))) | ||||||
|     (build-system gnu-build-system) |     (build-system gnu-build-system) | ||||||
|     (arguments |     (arguments | ||||||
|      '(#:phases |      `(#:phases | ||||||
|        (alist-replace |        (alist-replace | ||||||
|         'configure |         'configure | ||||||
|         (lambda* (#:key inputs outputs #:allow-other-keys) |         (lambda* (#:key inputs outputs #:allow-other-keys) | ||||||
|  | @ -249,41 +249,27 @@ Scheme and C programs and between Scheme and Java programs.") | ||||||
|         (alist-cons-after |         (alist-cons-after | ||||||
|          'strip 'patch-rpath |          'strip 'patch-rpath | ||||||
|          (lambda* (#:key outputs #:allow-other-keys) |          (lambda* (#:key outputs #:allow-other-keys) | ||||||
|            ;; Patch the RPATH of every installed library to point to $out/lib |            ;; Add $out/lib to the RPATH of every installed library and | ||||||
|            ;; instead of $TMPDIR.  Note that "patchelf --set-rpath" produces |            ;; executable.  Note that "patchelf --set-rpath" produces invalid | ||||||
|            ;; invalid binaries when used before stripping. |            ;; binaries when used before stripping. | ||||||
|            (let ((out    (assoc-ref outputs "out")) |            (let* ((out (assoc-ref outputs "out")) | ||||||
|                  (tmpdir (getcwd))) |                   (lib (string-append out "/lib"))) | ||||||
|              (every (lambda (lib) |              (with-directory-excursion out | ||||||
|                       (let* ((in    (open-pipe* OPEN_READ "patchelf" |                (every (cut augment-rpath <> lib) | ||||||
|                                                 "--print-rpath" lib)) |                       (append (find-files "bin" ".*") | ||||||
|                              (rpath (read-line in))) |                               (find-files "lib" "\\.so$")))))) | ||||||
|                         (and (zero? (close-pipe in)) |  | ||||||
|                              (let ((rpath* (regexp-substitute/global |  | ||||||
|                                             #f (regexp-quote tmpdir) rpath |  | ||||||
|                                             'pre out 'post))) |  | ||||||
|                                (or (equal? rpath rpath*) |  | ||||||
|                                    (begin |  | ||||||
|                                      (format #t "~a: changing RPATH from `~a' to `~a'~%" |  | ||||||
|                                              lib rpath rpath*) |  | ||||||
|                                      (zero? |  | ||||||
|                                       (system* "patchelf" "--set-rpath" |  | ||||||
|                                                rpath* lib)))))))) |  | ||||||
|                     (append (find-files (string-append out "/bin") |  | ||||||
|                                         ".*") |  | ||||||
|                             (find-files (string-append out "/lib") |  | ||||||
|                                         "\\.so$"))))) |  | ||||||
|          %standard-phases)) |          %standard-phases)) | ||||||
|        #:tests? #f                                ; no test suite |        #:tests? #f                                ; no test suite | ||||||
|        #:modules ((guix build gnu-build-system) |        #:modules ((guix build gnu-build-system) | ||||||
|                   (guix build utils) |                   (guix build utils) | ||||||
|                   (ice-9 popen) |                   (guix build rpath) | ||||||
|                   (ice-9 regex) |                   (srfi srfi-26) | ||||||
|                   (ice-9 rdelim) |                   (srfi srfi-1)) | ||||||
|                   (srfi srfi-1)))) |        #:imported-modules (,@%gnu-build-system-modules | ||||||
|  |                            (guix build rpath)))) | ||||||
|  |     (native-inputs `(("patchelf" ,patchelf))) | ||||||
|     (inputs `(("bigloo" ,bigloo) |     (inputs `(("bigloo" ,bigloo) | ||||||
|               ("which" ,which) |               ("which" ,which))) | ||||||
|               ("patchelf" ,patchelf))) |  | ||||||
|     (home-page "http://hop.inria.fr/") |     (home-page "http://hop.inria.fr/") | ||||||
|     (synopsis "Multi-tier programming language for the Web 2.0") |     (synopsis "Multi-tier programming language for the Web 2.0") | ||||||
|     (description |     (description | ||||||
|  |  | ||||||
		Reference in a new issue