unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add openttd
@ 2016-04-11 22:41 Albin
  2016-04-12  1:09 ` Leo Famulari
  0 siblings, 1 reply; 14+ messages in thread
From: Albin @ 2016-04-11 22:41 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 245 bytes --]

Hi!

This is my first package for the Guix project.  I've done my best to
follow all the guidelines.

As you can see, I had to make use of quite few tricks to make it work.

To the people in #guix: thanks a lot for your help!


Albin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-gnu-Add-openttd.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-openttd.patch", Size: 4473 bytes --]

From 061be49f0b39370541320984fc9eb53c2f2076c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albin=20S=C3=B6derqvist?= <albin@fripost.org>
Date: Tue, 12 Apr 2016 00:13:08 +0200
Subject: [PATCH] gnu: Add openttd.

---
 gnu/packages/games.scm | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 653e0c7..8ae59c7 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 Rodger Fox <thylakoid@openmailbox.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
+;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages haskell)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages python)
@@ -1859,6 +1861,73 @@ and a game metadata scraper.")
     (home-page "http://www.emulationstation.org")
     (license license:expat)))
 
+(define-public openttd
+  (package
+    (name "openttd")
+    (version "1.6.0")
+    (source
+     (origin (method url-fetch)
+             ;; The official download URL is
+             ;; http://binaries.openttd.org/releases/1.6.0/openttd-1.6.0-source.tar.xz
+             ;; but it doesn't work with `guix download`.  However, it
+             ;; redirects to the one below (and the SHA sums match).
+             (uri (string-append "http://ftp.snt.utwente.nl/pub/games"
+                                 "/openttd/binaries/releases/" version
+                                 "/openttd-" version "-source.tar.xz"))
+             (sha256
+              (base32
+               "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"))
+             (modules '((guix build utils)))
+             (snippet
+              '(begin
+                 ;; The DOS port contains proprietary software, thus:
+                 (delete-file-recursively "os/dos")
+                 ;; GNU's not Unix so let's modify the exit dialog.
+                 (substitute* (find-files "src/lang/" "\\.txt")
+                   ((":Unix") ":GNU"))))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;; no "check" target.
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; The build scripts don't understand the option
+             ;; `--enable-fast-install'.
+             (let ((out (assoc-ref outputs "out")))
+               (zero?
+                (system* "./configure"
+                         ;; At the moment, `lzo' must be disabled
+                         ;; because the `config.lib' script cannot
+                         ;; find it.  It is only necessary for loading
+                         ;; saved games generated by early versions of
+                         ;; OpenTTD.
+                         (string-append "--prefix=" out)
+                         "--without-liblzo2"
+                         ;; Put the binary in `bin' instead of `games'
+                         "--binary-dir=bin"))))))))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("allegro" ,allegro-4)
+       ("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("icu4c" ,icu4c)
+       ("libpng" ,libpng)
+       ;; ("lzo" ,lzo) disabled for the time being (see above).
+       ("sdl" ,sdl)
+       ("xz" ,xz)
+       ("zlib" ,zlib)))
+    (synopsis "Transportation economics simulator")
+    (description "OpenTTD is a game in which you transport goods and
+passengers by land, water and air.  It is a free implementation of
+Transport Tycoon Deluxe but with many enhancements including
+multiplayer mode, internationalization support, conditional orders and
+the ability to clone, autoreplace and autoupdate vehicles.")
+    (home-page "http://openttd.org/")
+    ;; The software contains an in-game downloader from which the user
+    ;; may find non-functional data licensed under different terms.
+    (license license:gpl2)))
+
 (define-public pinball
   (package
     (name "pinball")
-- 
2.6.3


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-04-15  8:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 22:41 [PATCH] gnu: Add openttd Albin
2016-04-12  1:09 ` Leo Famulari
2016-04-12  8:30   ` Alex Kost
2016-04-12 13:09     ` Albin
2016-04-12 14:55   ` Albin
2016-04-12 17:26     ` Alex Kost
2016-04-12 18:24       ` Leo Famulari
2016-04-13  2:09         ` [PATCH] gnu: Add openttd-engine Albin
2016-04-13  2:14           ` Albin
2016-04-14  8:27             ` Alex Kost
2016-04-14  9:04           ` Alex Kost
2016-04-14  9:51             ` Albin
2016-04-15  8:36               ` Alex Kost
2016-04-12 18:23     ` [PATCH] gnu: Add openttd Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).