From 669187accc6a0200bd428e716ea3e829d6fc2fe7 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 13 Sep 2022 23:00:28 +0200 Subject: gnu: hedgewars: Improve package style. * gnu/packages/games.scm (hedgewars)[arguments]: Use G-expressions. Remove trailing #T. Remove FIX-SORCES phase. Run tests according to #:tests? keyword. [inputs]: Remove labels. --- gnu/packages/games.scm | 81 ++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 42 deletions(-) (limited to 'gnu/packages/games.scm') diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 23d51b1aa9..a50e083c16 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -9321,49 +9321,46 @@ (define-public hedgewars "04pjpkjhpy720n803gv35iygmjdvsrmw13mih4ympjnqbgjfa7r0")))) (build-system cmake-build-system) (arguments - ;; XXX: Engine is built as Pascal source code, requiring Free Pascal - ;; Compiler, which we haven't packaged yet. With the flag below, we use - ;; a Pascal to C translator and Clang instead. - `(#:configure-flags (list "-DBUILD_ENGINE_C=ON" - "-Dhaskell_flags=-dynamic;-fPIC") - #:phases - (modify-phases %standard-phases - (add-before 'configure 'fix-sources - (lambda _ - ;; Fix a missing 'include'. - (substitute* "QTfrontend/ui/page/pagegamestats.cpp" - (("#include ") - "#include \n#include ")))) - (replace 'check - (lambda _ (invoke "ctest"))) - (add-after 'install 'install-icon - (lambda _ - ;; Install icon for the desktop file. - (let* ((out (assoc-ref %outputs "out")) - (icons (string-append out "/share/icons/hicolor/512x512/apps"))) - (with-directory-excursion (string-append "../hedgewars-src-" ,version) - (install-file "misc/hedgewars.png" icons))) - #t))))) + (list + ;; XXX: Engine is built as Pascal source code, requiring Free Pascal + ;; Compiler, which we haven't packaged yet. With the flag below, we use + ;; a Pascal to C translator and Clang instead. + #:configure-flags #~(list "-DBUILD_ENGINE_C=ON" + "-Dhaskell_flags=-dynamic;-fPIC") + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "ctest")))) + (add-after 'install 'install-icon + (lambda _ + ;; Install icon for the desktop file. + (let ((icons (string-append #$output + "/share/icons/hicolor/512x512/apps"))) + (with-directory-excursion + (string-append "../hedgewars-src-" #$version) + (install-file "misc/hedgewars.png" icons)))))))) (inputs - `(("ffmpeg" ,ffmpeg) - ("freeglut" ,freeglut) - ("ghc-entropy" ,ghc-entropy) - ("ghc-hslogger" ,ghc-hslogger) - ("ghc-network" ,ghc-network) - ("ghc-random" ,ghc-random) - ("ghc-regex-tdfa" ,ghc-regex-tdfa) - ("ghc-sandi" ,ghc-sandi) - ("ghc-sha" ,ghc-sha) - ("ghc-utf8-string" ,ghc-utf8-string) - ("ghc-vector" ,ghc-vector) - ("ghc-zlib" ,ghc-zlib) - ("glew" ,glew) - ("libpng" ,libpng) - ("lua" ,lua-5.1) - ("physfs" ,physfs) - ("qtbase" ,qtbase-5) - ("sdl" ,(sdl-union - (list sdl2 sdl2-mixer sdl2-net sdl2-ttf sdl2-image))))) + (list ffmpeg + freeglut + ghc-entropy + ghc-hslogger + ghc-network + ghc-random + ghc-regex-tdfa + ghc-sandi + ghc-sha + ghc-utf8-string + ghc-vector + ghc-zlib + glew + libpng + lua-5.1 + physfs + qtbase-5 + (sdl-union + (list sdl2 sdl2-mixer sdl2-net sdl2-ttf sdl2-image)))) (native-inputs (list clang-9 ghc pkg-config qttools-5)) (home-page "https://hedgewars.org/") -- cgit v1.2.3