gnu: ultrastar-deluxe: Improve package style.
* gnu/packages/games.scm (ultrastar-deluxe): Do not exceed column 80. [source]<snippet>: Use G-Expressions. [#:phases]: Fix indentation. <fix-configure>: Add ‘where’ helper and use it to shrink horizontal space.
This commit is contained in:
		
							parent
							
								
									4cecbc5dd2
								
							
						
					
					
						commit
						e58450be4a
					
				
					 1 changed files with 42 additions and 36 deletions
				
			
		| 
						 | 
					@ -11163,7 +11163,7 @@ and unsafe rides.  Which path will you take?")
 | 
				
			||||||
    (license license:gpl2)))
 | 
					    (license license:gpl2)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-public ultrastar-deluxe
 | 
					(define-public ultrastar-deluxe
 | 
				
			||||||
  ;; The last release is quite old and does not support recent versions of ffmpeg.
 | 
					  ;; The last release is quite old and does not support recent ffmpeg versions.
 | 
				
			||||||
  (let ((commit "43484b0a10ce6aae339e19d81ae2f7b37caf6baa")
 | 
					  (let ((commit "43484b0a10ce6aae339e19d81ae2f7b37caf6baa")
 | 
				
			||||||
        (revision "1"))
 | 
					        (revision "1"))
 | 
				
			||||||
    (package
 | 
					    (package
 | 
				
			||||||
| 
						 | 
					@ -11181,15 +11181,16 @@ and unsafe rides.  Which path will you take?")
 | 
				
			||||||
                (patches (search-patches "ultrastar-deluxe-no-freesans.patch"))
 | 
					                (patches (search-patches "ultrastar-deluxe-no-freesans.patch"))
 | 
				
			||||||
                (modules '((guix build utils)))
 | 
					                (modules '((guix build utils)))
 | 
				
			||||||
                (snippet
 | 
					                (snippet
 | 
				
			||||||
                 `(begin
 | 
					                 #~(begin
 | 
				
			||||||
                    ;; Remove Windows binaries.
 | 
					                     ;; Remove Windows binaries.
 | 
				
			||||||
                    (for-each delete-file (find-files "game" "\\.dll$"))
 | 
					                     (for-each delete-file (find-files "game" "\\.dll$"))
 | 
				
			||||||
                    ;; Remove font blobs.
 | 
					                     ;; Remove font blobs.
 | 
				
			||||||
                    (let ((font-directories (list "DejaVu" "FreeSans" "NotoSans"
 | 
					                     (let ((font-directories
 | 
				
			||||||
                                                  "wqy-microhei")))
 | 
					                            (list "DejaVu" "FreeSans" "NotoSans"
 | 
				
			||||||
                      (for-each
 | 
					                                  "wqy-microhei")))
 | 
				
			||||||
 | 
					                       (for-each
 | 
				
			||||||
                        (lambda (d) (delete-file-recursively
 | 
					                        (lambda (d) (delete-file-recursively
 | 
				
			||||||
                                      (string-append "game/fonts/" d)))
 | 
					                                (string-append "game/fonts/" d)))
 | 
				
			||||||
                        font-directories))))))
 | 
					                        font-directories))))))
 | 
				
			||||||
      (build-system gnu-build-system)
 | 
					      (build-system gnu-build-system)
 | 
				
			||||||
      (arguments
 | 
					      (arguments
 | 
				
			||||||
| 
						 | 
					@ -11197,33 +11198,38 @@ and unsafe rides.  Which path will you take?")
 | 
				
			||||||
         #:tests? #f ; No tests.
 | 
					         #:tests? #f ; No tests.
 | 
				
			||||||
         #:phases
 | 
					         #:phases
 | 
				
			||||||
         #~(modify-phases %standard-phases
 | 
					         #~(modify-phases %standard-phases
 | 
				
			||||||
           (add-after 'unpack 'fix-configure
 | 
					             (add-after 'unpack 'fix-configure
 | 
				
			||||||
             (lambda* (#:key inputs configure-flags outputs #:allow-other-keys)
 | 
					               (lambda* (#:key inputs configure-flags outputs #:allow-other-keys)
 | 
				
			||||||
               ;; The configure script looks for lua$version, but we provide lua-$version.
 | 
					                 (define (where inputs file)
 | 
				
			||||||
               (substitute* "configure.ac"
 | 
					                   (dirname (search-input-file inputs file)))
 | 
				
			||||||
                 (("lua\\$i") "lua-$i"))
 | 
					                 ;; The configure script looks for lua$version, but we
 | 
				
			||||||
               ;; fpc does not pass -lfoo to the linker, but uses its own linker script,
 | 
					                 ;; provide lua-$version.
 | 
				
			||||||
               ;; which references libs. Pass the libraries listed in that linker script,
 | 
					                 (substitute* "configure.ac"
 | 
				
			||||||
               ;; so our custom linker adds a correct rpath.
 | 
					                   (("lua\\$i") "lua-$i"))
 | 
				
			||||||
               (substitute* "src/Makefile.in"
 | 
					                 ;; fpc does not pass -lfoo to the linker, but uses its own
 | 
				
			||||||
                 (("linkflags\\s+:= ")
 | 
					                 ;; linker script, which references libs.  Pass the libraries
 | 
				
			||||||
                  (string-append "linkflags := -lpthread -lsqlite3 -lSDL2"
 | 
					                 ;; listed in that linker script, so our custom linker adds
 | 
				
			||||||
                                 " -lSDL2_image -ldl "
 | 
					                 ;; a correct rpath.
 | 
				
			||||||
                                 " -lz -lfreetype -lportaudio -lavcodec"
 | 
					                 (substitute* "src/Makefile.in"
 | 
				
			||||||
                                 " -lavformat -lavutil -lswresample"
 | 
					                   (("linkflags\\s+:= ")
 | 
				
			||||||
                                 " -lswscale -llua -ldl -lX11 -lportmidi"
 | 
					                    (string-append
 | 
				
			||||||
                                 " -L" (dirname (search-input-file inputs "lib/libz.so"))
 | 
					                     "linkflags := -lpthread -lsqlite3 -lSDL2"
 | 
				
			||||||
                                 " -L" (dirname (search-input-file inputs "lib/libX11.so"))
 | 
					                     " -lSDL2_image -ldl "
 | 
				
			||||||
                                 " -L" (dirname (search-input-file inputs "lib/libportmidi.so")))))))
 | 
					                     " -lz -lfreetype -lportaudio -lavcodec"
 | 
				
			||||||
           (add-after 'install 'font-paths
 | 
					                     " -lavformat -lavutil -lswresample"
 | 
				
			||||||
             (lambda* (#:key outputs #:allow-other-keys)
 | 
					                     " -lswscale -llua -ldl -lX11 -lportmidi"
 | 
				
			||||||
               (substitute* (string-append
 | 
					                     " -L" (where inputs "lib/libz.so")
 | 
				
			||||||
                              (assoc-ref outputs "out")
 | 
					                     " -L" (where inputs "lib/libX11.so")
 | 
				
			||||||
                              "/share/ultrastardx/fonts/fonts.ini")
 | 
					                     " -L" (where inputs "lib/libportmidi.so"))))))
 | 
				
			||||||
                 (("=NotoSans/") (string-append "=" #$font-google-noto
 | 
					             (add-after 'install 'font-paths
 | 
				
			||||||
                                                "/share/fonts/truetype/"))
 | 
					               (lambda* (#:key outputs #:allow-other-keys)
 | 
				
			||||||
                 (("=DejaVu/") (string-append "=" #$font-dejavu
 | 
					                 (substitute* (string-append
 | 
				
			||||||
                                              "/share/fonts/truetype/"))))))))
 | 
					                               (assoc-ref outputs "out")
 | 
				
			||||||
 | 
					                               "/share/ultrastardx/fonts/fonts.ini")
 | 
				
			||||||
 | 
					                   (("=NotoSans/") (string-append "=" #$font-google-noto
 | 
				
			||||||
 | 
					                                                  "/share/fonts/truetype/"))
 | 
				
			||||||
 | 
					                   (("=DejaVu/") (string-append "=" #$font-dejavu
 | 
				
			||||||
 | 
					                                                "/share/fonts/truetype/"))))))))
 | 
				
			||||||
      (inputs (list ffmpeg
 | 
					      (inputs (list ffmpeg
 | 
				
			||||||
                    font-dejavu
 | 
					                    font-dejavu
 | 
				
			||||||
                    font-google-noto
 | 
					                    font-google-noto
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue