unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fix for teeworlds
@ 2018-07-02 15:24 Tim Gesthuizen
  2018-07-02 16:48 ` Ricardo Wurmus
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Gesthuizen @ 2018-07-02 15:24 UTC (permalink / raw)
  To: guix-devel


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

Hi,

I am using GNU Guix now for a little while and since I started using it

teeworlds did not build.

So I invested some time and quickly found out that the package definition

is simply missing a dependency (pkg-config) to build.

You find a script which I used to create my working build as well

as a patch for guix which I have not verified to  be working attached.

It would be very nice if someone could investigate whether the patch

is ok and commit it.


Thanks,

Tim Gesthuizen


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: my-teeworlds.scm --]
[-- Type: text/x-scheme; name="my-teeworlds.scm", Size: 3538 bytes --]

(use-modules ((guix licenses) #:prefix license:)
	     (guix utils)
	     (guix packages)	      
	     (guix download)
	     (gnu packages)
	     (gnu packages gl)
	     (gnu packages sdl)
	     (gnu packages audio)
	     (gnu packages build-tools)
	     (gnu packages python)
	     (gnu packages fontutils)
	     (gnu packages compression)
	     (gnu packages pkg-config)
	     (guix build-system gnu))

(package
 (name "my-teeworlds")
 (version "0.6.4")
 (source (origin
          (method url-fetch)
          (uri (string-append "https://github.com/teeworlds/teeworlds/"
                              "archive/" version "-release.tar.gz"))
          (file-name (string-append name "-" version ".tar.gz"))
          (sha256
           (base32
            "1mqhp6xjl75l49050cid36wxyjn1qr0vjx1c709dfg1lkvmgs6l3"))
          (modules '((guix build utils)))
          (snippet
           '(begin
              (for-each delete-file-recursively
                        '("src/engine/external/wavpack/"
                          "src/engine/external/zlib/"))
              #t))
          (patches
           (search-patches "teeworlds-use-latest-wavpack.patch"))))
 (build-system gnu-build-system)
 (arguments
  `(#:tests? #f ; no tests included
    #:phases
    (modify-phases %standard-phases
		   (replace 'configure
			    (lambda* (#:key outputs #:allow-other-keys)
			      ;; Embed path to assets.
			      (substitute* "src/engine/shared/storage.cpp"
					   (("#define DATA_DIR.*")
					    (string-append "#define DATA_DIR \""
							   (assoc-ref outputs "out")
							   "/share/teeworlds/data"
							   "\"")))

			      ;; Bam expects all files to have a recent time stamp.
			      (for-each (lambda (file)
					  (utime file 1 1))
					(find-files "."))

			      ;; Do not use bundled libraries.
			      (substitute* "bam.lua"
					   (("if config.zlib.value == 1 then")
					    "if true then")
					   (("wavpack = .*")
					    "wavpack = {}
settings.link.libs:Add(\"wavpack\")\n"))
			      (substitute* "src/engine/client/sound.cpp"
					   (("#include <engine/external/wavpack/wavpack.h>")
					    "#include <wavpack/wavpack.h>"))
			      #t))
		   (replace 'build
			    (lambda _
			      (zero? (system* "bam" "-a" "-v" "release"))))
		   (replace 'install
			    (lambda* (#:key outputs #:allow-other-keys)
			      (let* ((out  (assoc-ref outputs "out"))
				     (bin  (string-append out "/bin"))
				     (data (string-append out "/share/teeworlds/data")))
				(mkdir-p bin)
				(mkdir-p data)
				(for-each (lambda (file)
					    (install-file file bin))
					  '("teeworlds" "teeworlds_srv"))
				(copy-recursively "data" data)
				#t))))))
 ;; FIXME: teeworlds bundles the sources of "pnglite", a two-file PNG
 ;; library without a build system.
 (inputs
  `(("freetype" ,freetype)
    ("glu" ,glu)
    ("mesa" ,mesa)
    ("sdl-union" ,(sdl-union (list sdl
                                   sdl-mixer
                                   sdl-image)))
    ("wavpack" ,wavpack)
    ("zlib" ,zlib)))
 (native-inputs
  `(("bam" ,bam)
    ("python" ,python-2)
    ("pkg-config" ,pkg-config)))
 (home-page "https://www.teeworlds.com")
 (synopsis "2D retro multiplayer shooter game")
 (description "Teeworlds is an online multiplayer game.  Battle with up to
16 players in a variety of game modes, including Team Deathmatch and Capture
The Flag.  You can even design your own maps!")
 (license license:bsd-3))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.3: 0001-Fixes-missing-pkg-config-dependency-for-teeworlds.patch --]
[-- Type: text/x-patch; name="0001-Fixes-missing-pkg-config-dependency-for-teeworlds.patch", Size: 1118 bytes --]

From ec193500a2644ddf7db17b2302ebae54342228f3 Mon Sep 17 00:00:00 2001
From: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
Date: Mon, 2 Jul 2018 17:10:50 +0200
Subject: [PATCH] Fixes missing pkg-config dependency for teeworlds

teeworlds uses bam as a build system which relies
on pkg-config for finding libraries like freetype.
Therefore pkg-config is needed to build this package.

Signed-off-by: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
---
 gnu/packages/games.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 0796e4800..ecca036be 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3880,7 +3880,8 @@ settings.link.libs:Add(\"wavpack\")\n"))
        ("zlib" ,zlib)))
     (native-inputs
      `(("bam" ,bam)
-       ("python" ,python-2)))
+       ("python" ,python-2)
+       ("pkg-config" ,pkg-config)))
     (home-page "https://www.teeworlds.com")
     (synopsis "2D retro multiplayer shooter game")
     (description "Teeworlds is an online multiplayer game.  Battle with up to
-- 
2.18.0


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

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

* Re: Fix for teeworlds
  2018-07-02 15:24 Fix for teeworlds Tim Gesthuizen
@ 2018-07-02 16:48 ` Ricardo Wurmus
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2018-07-02 16:48 UTC (permalink / raw)
  To: Tim Gesthuizen; +Cc: guix-devel


Hi Tim,

thank you for your patch!

I have added a copyright line for you and adjusted the commit message.
Thanks to you, teeworlds now builds since commit e402a66b0.

Thanks again!

-- 
Ricardo

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

end of thread, other threads:[~2018-07-02 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 15:24 Fix for teeworlds Tim Gesthuizen
2018-07-02 16:48 ` Ricardo Wurmus

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).