* [bug#27421] [PATCH 3/5] gnu: Add grfcodec.
2017-06-18 17:45 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Kei Kebreau
@ 2017-06-18 17:45 ` Kei Kebreau
2017-06-18 18:04 ` Marius Bakke
2017-06-18 17:45 ` [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx Kei Kebreau
` (2 subsequent siblings)
3 siblings, 1 reply; 16+ messages in thread
From: Kei Kebreau @ 2017-06-18 17:45 UTC (permalink / raw)
To: 27421; +Cc: Kei Kebreau
* gnu/packages/game-development.scm (grfcodec): New variable.
---
gnu/packages/game-development.scm | 59 +++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 034713596..404061eff 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -35,6 +35,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (gnu packages)
+ #:use-module (gnu packages boost)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
#:use-module (gnu packages documentation)
@@ -147,6 +148,64 @@ conversions (for example, from PPM to Doom picture format). In addition,
DeuTex has functions such as merging wads, etc.")
(license license:gpl2+)))
+(define-public grfcodec
+ (package
+ (name "grfcodec")
+ (version "6.0.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://binaries.openttd.org/extra/"
+ name "/" version "/" name "-" version
+ "-source.tar.xz"))
+ (sha256
+ (base32
+ "08admgnpqcsifpicbm56apgv360fxapqpbbsp10qyk8i22w1ivsk"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ; no check target
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (replace 'install ; no install target
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (doc (string-append out "/share/doc"))
+ (man (string-append out "/share/man/man1")))
+ (for-each (lambda (file)
+ (install-file file bin))
+ '("grfcodec" "grfid" "grfstrip" "nforenum"))
+ (install-file "COPYING" doc)
+ (with-directory-excursion "docs"
+ (for-each (lambda (file)
+ (install-file (string-append file ".txt") doc))
+ '("auto_correct" "commands" "grf" "grfcodec" "grftut"
+ "readme" "readme.rpn"))
+ (for-each (lambda (file)
+ (install-file file man))
+ (find-files "." "\\.1"))))
+ #t)))))
+ (inputs
+ `(("boost" ,boost)
+ ("libpng" ,libpng)
+ ("zlib" ,zlib)))
+ (synopsis "GRF (Graphics Resource File) development tools")
+ (description
+ "The GRF development tools are a set of tools for developing (New)GRFs. It
+includes a number of smaller programs, each with a specific task:
+@enumerate
+@item @code{grfcodec} decodes and encodes GRF files for OpenTTD.
+@item @code{grfid} extracts the so-called \"GRF ID\" from a GRF.
+@item @code{grfstrip} strips all sprites from a GRF.
+@item @code{nforenum} checks NFO code for errors, making corrections when
+necessary.
+@end enumerate")
+ (home-page "http://dev.openttdcoop.org/projects/grfcodec")
+ ;; GRFCodec, GRFID, and GRFStrip are exclusively under the GPL2.
+ ;; NFORenum is under the GPL2+.
+ ;; The MD5 implementation contained in GRFID is under the zlib license.
+ (license (list license:gpl2 license:gpl2+ license:zlib))))
+
(define-public gzochi
(package
(name "gzochi")
--
2.13.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx.
2017-06-18 17:45 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Kei Kebreau
2017-06-18 17:45 ` [bug#27421] [PATCH 3/5] gnu: Add grfcodec Kei Kebreau
@ 2017-06-18 17:45 ` Kei Kebreau
2017-06-18 18:24 ` Marius Bakke
2017-06-18 17:45 ` [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase Kei Kebreau
2017-06-18 18:02 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Marius Bakke
3 siblings, 1 reply; 16+ messages in thread
From: Kei Kebreau @ 2017-06-18 17:45 UTC (permalink / raw)
To: 27421; +Cc: Kei Kebreau
* gnu/packages/games.scm (openttd-opengfx): New variable.
---
gnu/packages/games.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2c5294737..4214a2f75 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -73,6 +73,7 @@
#:use-module (gnu packages game-development)
#:use-module (gnu packages gettext)
#:use-module (gnu packages ghostscript)
+ #:use-module (gnu packages gimp)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
@@ -2299,6 +2300,55 @@ engine. When you start it you will be prompted to download a graphics set.")
;; 'openttd' a wrapper around them. The engine is playable by itself,
;; but it asks a user to download graphics if it's not found.
+(define openttd-opengfx
+ (package
+ (name "openttd-opengfx")
+ (version "0.5.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://binaries.openttd.org/extra/opengfx/"
+ version "/opengfx-" version "-source.tar.xz"))
+ (sha256
+ (base32
+ "0iz66q7p1mf00njfjbc4vibh3jaybki7armkl18iz7p6x4chp9zv"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:make-flags (list "CC=gcc"
+ (string-append "INSTALL_DIR="
+ (assoc-ref %outputs "out")
+ "/share/openttd/baseset"))
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda _
+ ;; Make sure HOME is writable for GIMP.
+ (setenv "HOME" (getcwd))
+
+ ;; Redirect stdout to /dev/null instead of stderr. This prevents
+ ;; dos2unix from receiving its version information as a flag.
+ (substitute* "Makefile"
+ (("\\$\\(UNIX2DOS\\) -q --version 2>/dev/null")
+ "$(UNIX2DOS) -q --version 1>/dev/null")))))
+ ;; The check phase for this package only checks the md5sums of the built
+ ;; GRF files against the md5sums of the release versions. Because we use
+ ;; different software versions than upstream does, some of the md5sums
+ ;; are different. However, the package is still reproducible, it's safe
+ ;; to disable this test.
+ #:tests? #f))
+ (native-inputs `(("dos2unix" ,dos2unix)
+ ("gimp" ,gimp)
+ ("grfcodec" ,grfcodec)
+ ("nml" ,nml)
+ ("python" ,python-2)))
+ (home-page "http://dev.openttdcoop.org/projects/opengfx")
+ (synopsis "Base graphics set for OpenTTD")
+ (description
+ "The OpenGFX project is a free replacement of the base graphics so that
+OpenTTD can be shipped finally fully functional without the need for additional
+downloads.")
+ (license license:gpl2)))
+
(define-public openttd
(package
(inherit openttd-engine)
--
2.13.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx.
2017-06-18 17:45 ` [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx Kei Kebreau
@ 2017-06-18 18:24 ` Marius Bakke
2017-06-18 18:51 ` Kei Kebreau
0 siblings, 1 reply; 16+ messages in thread
From: Marius Bakke @ 2017-06-18 18:24 UTC (permalink / raw)
To: Kei Kebreau, 27421
[-- Attachment #1: Type: text/plain, Size: 2101 bytes --]
Kei Kebreau <kei@openmailbox.org> writes:
> * gnu/packages/games.scm (openttd-opengfx): New variable.
[...]
> + ;; Redirect stdout to /dev/null instead of stderr. This prevents
> + ;; dos2unix from receiving its version information as a flag.
> + (substitute* "Makefile"
> + (("\\$\\(UNIX2DOS\\) -q --version 2>/dev/null")
> + "$(UNIX2DOS) -q --version 1>/dev/null")))))
I'm a bit confused as to why this is necessary. I guess it's a behavior
change in recent versions, that --version prints on stdout? LGTM anyway.
> + ;; The check phase for this package only checks the md5sums of the built
> + ;; GRF files against the md5sums of the release versions. Because we use
> + ;; different software versions than upstream does, some of the md5sums
> + ;; are different. However, the package is still reproducible, it's safe
> + ;; to disable this test.
> + #:tests? #f))
> + (native-inputs `(("dos2unix" ,dos2unix)
> + ("gimp" ,gimp)
> + ("grfcodec" ,grfcodec)
> + ("nml" ,nml)
> + ("python" ,python-2)))
> + (home-page "http://dev.openttdcoop.org/projects/opengfx")
> + (synopsis "Base graphics set for OpenTTD")
> + (description
> + "The OpenGFX project is a free replacement of the base graphics so that
> +OpenTTD can be shipped finally fully functional without the need for additional
> +downloads.")
Yay! I'm thinking we should mention this is one of many available
grahics sets for OpenTTD. Maybe something like..
"The OpenGFX projects is an implementation of the OpenTTD base grahics
set that aims to ensure the best possible out-of-the-box experience.
OpenGFX provides you with...
@enumerate
@item All graphics you need to enjoy OpenTTD.
@item Uniquely drawn rail vehicles for every climate.
@item Completely snow-aware rivers.
@item Different river and sea water.
@item Snow-aware buoys.
@end enumerate"
(Adapted from readme.ptxt)
> + (license license:gpl2)))
Indeed version 2 only.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx.
2017-06-18 18:24 ` Marius Bakke
@ 2017-06-18 18:51 ` Kei Kebreau
0 siblings, 0 replies; 16+ messages in thread
From: Kei Kebreau @ 2017-06-18 18:51 UTC (permalink / raw)
To: Marius Bakke; +Cc: 27421
[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]
Marius Bakke <mbakke@fastmail.com> writes:
> Kei Kebreau <kei@openmailbox.org> writes:
>
>> * gnu/packages/games.scm (openttd-opengfx): New variable.
>
> [...]
>
>> + ;; Redirect stdout to /dev/null instead of stderr. This prevents
>> + ;; dos2unix from receiving its version information as a flag.
>> + (substitute* "Makefile"
>> + (("\\$\\(UNIX2DOS\\) -q --version 2>/dev/null")
>> + "$(UNIX2DOS) -q --version 1>/dev/null")))))
>
> I'm a bit confused as to why this is necessary. I guess it's a behavior
> change in recent versions, that --version prints on stdout? LGTM anyway.
>
I haven't used old versions of dos2unix, so I wouldn't know better. I've
rephrased the comment to make it a bit clearer.
>> + ;; The check phase for this package only checks the md5sums of the
>> built
>> + ;; GRF files against the md5sums of the release versions. Because
>> we use
>> + ;; different software versions than upstream does, some of the md5sums
>> + ;; are different. However, the package is still reproducible, it's
>> safe
>> + ;; to disable this test.
>> + #:tests? #f))
>> + (native-inputs `(("dos2unix" ,dos2unix)
>> + ("gimp" ,gimp)
>> + ("grfcodec" ,grfcodec)
>> + ("nml" ,nml)
>> + ("python" ,python-2)))
>> + (home-page "http://dev.openttdcoop.org/projects/opengfx")
>> + (synopsis "Base graphics set for OpenTTD")
>> + (description
>> + "The OpenGFX project is a free replacement of the base graphics so that
>> +OpenTTD can be shipped finally fully functional without the need
>> for additional
>> +downloads.")
>
> Yay! I'm thinking we should mention this is one of many available
> grahics sets for OpenTTD. Maybe something like..
>
> "The OpenGFX projects is an implementation of the OpenTTD base grahics
> set that aims to ensure the best possible out-of-the-box experience.
>
> OpenGFX provides you with...
> @enumerate
> @item All graphics you need to enjoy OpenTTD.
> @item Uniquely drawn rail vehicles for every climate.
> @item Completely snow-aware rivers.
> @item Different river and sea water.
> @item Snow-aware buoys.
> @end enumerate"
>
> (Adapted from readme.ptxt)
Why didn't I do this???
I'm totally using this description.
>
>> + (license license:gpl2)))
>
> Indeed version 2 only.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase.
2017-06-18 17:45 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Kei Kebreau
2017-06-18 17:45 ` [bug#27421] [PATCH 3/5] gnu: Add grfcodec Kei Kebreau
2017-06-18 17:45 ` [bug#27421] [PATCH 4/5] gnu: Add openttd-opengfx Kei Kebreau
@ 2017-06-18 17:45 ` Kei Kebreau
2017-06-18 18:33 ` Marius Bakke
2017-06-18 18:02 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Marius Bakke
3 siblings, 1 reply; 16+ messages in thread
From: Kei Kebreau @ 2017-06-18 17:45 UTC (permalink / raw)
To: 27421; +Cc: Kei Kebreau
* gnu/packages/games.scm (openttd-engine): Rename package to openttd.
[arguments]: Add it.
[native-inputs]: Add openttd-opengfx.
---
gnu/packages/games.scm | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 4214a2f75..112e1c3db 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2236,9 +2236,9 @@ and a game metadata scraper.")
(home-page "http://www.emulationstation.org")
(license license:expat))))
-(define openttd-engine
+(define-public openttd
(package
- (name "openttd-engine")
+ (name "openttd")
(version "1.7.1")
(source
(origin (method url-fetch)
@@ -2269,8 +2269,20 @@ and a game metadata scraper.")
(string-append "--with-liblzo2="
lzo "/lib/liblzo2.a")
;; Put the binary in 'bin' instead of 'games'.
- "--binary-dir=bin"))))))))
- (native-inputs `(("pkg-config" ,pkg-config)))
+ "--binary-dir=bin")))))
+ (add-after 'install 'install-data
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let*
+ ((opengfx (assoc-ref inputs "opengfx"))
+ (out (assoc-ref outputs "out"))
+ (gfx-dir
+ (string-append out "/share/games/openttd/baseset/opengfx")))
+ (mkdir-p gfx-dir)
+ (copy-recursively opengfx gfx-dir))
+ #t)))))
+ (native-inputs
+ `(("opengfx" ,openttd-opengfx)
+ ("pkg-config" ,pkg-config)))
(inputs
`(("allegro" ,allegro-4)
("fontconfig" ,fontconfig)
@@ -2316,8 +2328,7 @@ engine. When you start it you will be prompted to download a graphics set.")
(arguments
'(#:make-flags (list "CC=gcc"
(string-append "INSTALL_DIR="
- (assoc-ref %outputs "out")
- "/share/openttd/baseset"))
+ (assoc-ref %outputs "out")))
#:phases
(modify-phases %standard-phases
(replace 'configure
@@ -2349,11 +2360,6 @@ OpenTTD can be shipped finally fully functional without the need for additional
downloads.")
(license license:gpl2)))
-(define-public openttd
- (package
- (inherit openttd-engine)
- (name "openttd")))
-
(define-public pinball
(package
(name "pinball")
--
2.13.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase.
2017-06-18 17:45 ` [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase Kei Kebreau
@ 2017-06-18 18:33 ` Marius Bakke
2017-06-18 21:03 ` Kei Kebreau
0 siblings, 1 reply; 16+ messages in thread
From: Marius Bakke @ 2017-06-18 18:33 UTC (permalink / raw)
To: Kei Kebreau, 27421
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
Kei Kebreau <kei@openmailbox.org> writes:
> * gnu/packages/games.scm (openttd-engine): Rename package to openttd.
> [arguments]: Add it.
> [native-inputs]: Add openttd-opengfx.
This should also mention that the (openttd) variable is now gone.
However, I would prefer keeping "openttd-engine" and only add these
changes to the inherited "openttd" package. What do you think?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase.
2017-06-18 18:33 ` Marius Bakke
@ 2017-06-18 21:03 ` Kei Kebreau
2017-06-20 19:28 ` Marius Bakke
0 siblings, 1 reply; 16+ messages in thread
From: Kei Kebreau @ 2017-06-18 21:03 UTC (permalink / raw)
To: Marius Bakke; +Cc: 27421
[-- Attachment #1.1: Type: text/plain, Size: 571 bytes --]
Marius Bakke <mbakke@fastmail.com> writes:
> Kei Kebreau <kei@openmailbox.org> writes:
>
>> * gnu/packages/games.scm (openttd-engine): Rename package to openttd.
>> [arguments]: Add it.
>> [native-inputs]: Add openttd-opengfx.
>
> This should also mention that the (openttd) variable is now gone.
> However, I would prefer keeping "openttd-engine" and only add these
> changes to the inherited "openttd" package. What do you think?
That would be a more logical progression given the comment about adding
openttd-opengfx. I've attached the change you're talking about.
[-- Attachment #1.2: 0001-gnu-openttd-Add-install-data-phase.patch --]
[-- Type: text/plain, Size: 1584 bytes --]
From d02c7d59d268199a04c2e57da0c9d2646052f980 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Sun, 18 Jun 2017 13:45:19 -0400
Subject: [PATCH] gnu: openttd: Add 'install-data' phase.
* gnu/packages/games.scm (openttd)[arguments]: Add it.
[native-inputs]: Add openttd-opengfx.
---
gnu/packages/games.scm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index df680d11d..b8ca8dc15 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2360,7 +2360,25 @@ OpenGFX provides you with...
(define-public openttd
(package
(inherit openttd-engine)
- (name "openttd")))
+ (name "openttd")
+ (arguments
+ (substitute-keyword-arguments (package-arguments openttd-engine)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'install 'install-data
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let*
+ ((opengfx (assoc-ref inputs "opengfx"))
+ (out (assoc-ref outputs "out"))
+ (gfx-dir
+ (string-append out
+ "/share/games/openttd/baseset/opengfx")))
+ (mkdir-p gfx-dir)
+ (copy-recursively opengfx gfx-dir))
+ #t))))))
+ (native-inputs
+ `(("opengfx" ,openttd-opengfx)
+ ,@(package-native-inputs openttd-engine)))))
(define-public pinball
(package
--
2.13.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [bug#27421] [PATCH 2/5] gnu: Add dos2unix.
2017-06-18 17:45 ` [bug#27421] [PATCH 2/5] gnu: Add dos2unix Kei Kebreau
` (2 preceding siblings ...)
2017-06-18 17:45 ` [bug#27421] [PATCH 5/5] gnu: openttd-engine: Add 'install-data' phase Kei Kebreau
@ 2017-06-18 18:02 ` Marius Bakke
3 siblings, 0 replies; 16+ messages in thread
From: Marius Bakke @ 2017-06-18 18:02 UTC (permalink / raw)
To: Kei Kebreau, 27421
[-- Attachment #1: Type: text/plain, Size: 107 bytes --]
Kei Kebreau <kei@openmailbox.org> writes:
> * gnu/packages/textutils.scm (dos2unix): New variable.
LGTM.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread