me
/
guix
Archived
1
0
Fork 0

gnu: red-eclipse: Add store "data" package path as default.

* gnu/packages/games.scm (red-eclipse): Remove extra spaces. Make version
respect documentation.
[arguments]: Add "prefix" to make-flags. Add
"add-store-data-package-path-as-default" phase. Improve "copy-data" phase.

Signed-off-by: Kei Kebreau <kkebreau@posteo.net>
master
Adonay Felipe Nogueira 2017-08-20 15:28:20 -03:00 committed by Kei Kebreau
parent d30f920c04
commit 42abb842f6
No known key found for this signature in database
GPG Key ID: E6A5EE3C19467A0D
1 changed files with 68 additions and 42 deletions

View File

@ -24,7 +24,7 @@
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com> ;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org> ;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 nee <nee-git@hidamari.blue> ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
@ -133,6 +133,7 @@
#:use-module (gnu packages gnuzilla) #:use-module (gnu packages gnuzilla)
#:use-module (gnu packages icu4c) #:use-module (gnu packages icu4c)
#:use-module (gnu packages networking) #:use-module (gnu packages networking)
#:use-module (guix build utils)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
#:use-module (guix build-system haskell) #:use-module (guix build-system haskell)
#:use-module (guix build-system python) #:use-module (guix build-system python)
@ -2796,7 +2797,9 @@ http://lavachat.symlynx.com/unix/")
(license license:gpl2+))) (license license:gpl2+)))
(define-public red-eclipse (define-public red-eclipse
(let ((data-sources (let ((release "1.5.8")
(revision 2)
(data-sources
'(("acerspyro" "0zmg78scrfdv33h7vszqvzylcqjwg7d5b0j2riav3rjfh326j8xx") '(("acerspyro" "0zmg78scrfdv33h7vszqvzylcqjwg7d5b0j2riav3rjfh326j8xx")
("actors" "0l00rsvppqzdpsikm5qpj38jiygirszxlzay2nxp4g4n2qjq0m4a") ("actors" "0l00rsvppqzdpsikm5qpj38jiygirszxlzay2nxp4g4n2qjq0m4a")
("appleflap" "0jhfr7f13hk3nswwxqc4jajriipr6zz6j63v955nv4sgxs7lzbjd") ("appleflap" "0jhfr7f13hk3nswwxqc4jajriipr6zz6j63v955nv4sgxs7lzbjd")
@ -2835,21 +2838,26 @@ http://lavachat.symlynx.com/unix/")
("wicked" "0jjgwzdibr5my369gwvmvbklpjlwq939zgf643rv0168xc087xb2")))) ("wicked" "0jjgwzdibr5my369gwvmvbklpjlwq939zgf643rv0168xc087xb2"))))
(package (package
(name "red-eclipse") (name "red-eclipse")
(version "1.5.8") (version (if (zero? revision)
release
(string-append release "-"
(number->string revision))))
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/red-eclipse/base" (uri (string-append "https://github.com/red-eclipse/base"
"/archive/v" version ".tar.gz")) "/archive/v" release ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1ah92axwcai0fhgm7pvfb2dxvfdiwwyh8iqyiffndh6782hxz3bc")))) "0r66rsqxvd7hxrhb0fahqqmf3r0cw2drhv5vndbswcq90l1bxfmf"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:tests? #f ; no check target `(#:tests? #f ; no check target
#:make-flags (list "CC=gcc" "-Csrc" #:make-flags (list "CC=gcc" "-Csrc"
(string-append "INSTDIR=" (string-append "INSTDIR="
(assoc-ref %outputs "out") "/bin")) (assoc-ref %outputs "out") "/bin")
(string-append "prefix="
(assoc-ref %outputs "out")))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'unpack-data (add-after 'unpack 'unpack-data
@ -2862,10 +2870,25 @@ http://lavachat.symlynx.com/unix/")
"-Cdata" "-Cdata"
"--transform" "--transform"
(string-append "s/" (string-append "s/"
name "-" ,version "/" name "-" ,release "/"
name "/"))) name "/")))
(list ,@(map car data-sources))) (list ,@(map car data-sources)))
#t)) #t))
(add-after 'unpack-data 'add-store-data-package-path-as-default
(lambda* (#:key outputs #:allow-other-keys)
(substitute* "src/engine/server.cpp"
(("(else[[:space:]]*)((addpackagedir\\()\"data\"(\\);))" _ else_part addpackagedir_original addpackagedir_open addpackagedir_close)
(string-append else_part
"{ "
addpackagedir_open
"\""
(assoc-ref outputs "out")
"/share/redeclipse/data\""
addpackagedir_close
" "
addpackagedir_original
" }")))
#t))
(delete 'configure) ; no configure script (delete 'configure) ; no configure script
(add-after 'set-paths 'set-sdl-paths (add-after 'set-paths 'set-sdl-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
@ -2881,7 +2904,10 @@ http://lavachat.symlynx.com/unix/")
(copy-file "doc/examples/servinit.cfg" (copy-file "doc/examples/servinit.cfg"
(string-append out "/config/servinit.cfg")) (string-append out "/config/servinit.cfg"))
(copy-recursively "data" (copy-recursively "data"
(string-append out "/data"))) (string-append out "/share/redeclipse/data"))
(mkdir-p (string-append out "/lib/redeclipse"))
(symlink (string-append out "/share/redeclipse/data")
(string-append out "/lib/redeclipse/data")))
#t)) #t))
(add-after 'copy-data 'wrap-program (add-after 'copy-data 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
@ -2928,7 +2954,7 @@ exec -a \"$0\" ~a/.redeclipse_server_linux-real~%"
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"https://github.com/red-eclipse/" "https://github.com/red-eclipse/"
name "/archive/v" version ".tar.gz")) name "/archive/v" release ".tar.gz"))
(sha256 (base32 hash)) (sha256 (base32 hash))
(file-name (string-append name "-" version (file-name (string-append name "-" version
".tar.gz")))))) ".tar.gz"))))))