guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4] gnu: Add bullet.


From: David Thompson
Subject: Re: [PATCH v4] gnu: Add bullet.
Date: Sat, 13 Dec 2014 10:58:44 -0500
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu)

Tomáš Čech <address@hidden> writes:

> * gnu/packages/game-development.scm: New file
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/patches/bullet-add-fPIC-into-flags.patch: New file
> * gnu-system.am (dist_patch_DATA): Add it.
> ---
>  gnu-system.am                                      |  2 +
>  gnu/packages/game-development.scm                  | 44 
> ++++++++++++++++++++++
>  .../patches/bullet-add-fPIC-into-flags.patch       | 13 +++++++
>  3 files changed, 59 insertions(+)
>  create mode 100644 gnu/packages/game-development.scm
>  create mode 100644 gnu/packages/patches/bullet-add-fPIC-into-flags.patch
>
> diff --git a/gnu-system.am b/gnu-system.am
> index e828c01..d4c806e 100644
> --- a/gnu-system.am
> +++ b/gnu-system.am
> @@ -96,6 +96,7 @@ GNU_SYSTEM_MODULES =                                \
>    gnu/packages/freeipmi.scm                  \
>    gnu/packages/ftp.scm                               \
>    gnu/packages/fribidi.scm                   \
> +  gnu/packages/game-development.scm          \
>    gnu/packages/games.scm                     \
>    gnu/packages/gawk.scm                              \
>    gnu/packages/gcal.scm                              \
> @@ -334,6 +335,7 @@ dist_patch_DATA =                                         
> \
>    gnu/packages/patches/bigloo-gc-shebangs.patch                      \
>    gnu/packages/patches/binutils-ld-new-dtags.patch           \
>    gnu/packages/patches/binutils-loongson-workaround.patch    \
> +  gnu/packages/patches/bullet-add-fPIC-into-flags.patch              \
>    gnu/packages/patches/cdparanoia-fpic.patch                 \
>    gnu/packages/patches/clucene-pkgconfig.patch                       \
>    gnu/packages/patches/cmake-fix-tests.patch                 \
> diff --git a/gnu/packages/game-development.scm 
> b/gnu/packages/game-development.scm
> new file mode 100644
> index 0000000..96a87e1
> --- /dev/null
> +++ b/gnu/packages/game-development.scm
> @@ -0,0 +1,44 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2014 Tomáš Čech <address@hidden>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu packages game-development)
> +  #:use-module (guix licenses)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix build-system cmake)
> +  #:use-module (gnu packages))
> +
> +(define-public bullet
> +  (package
> +    (name "bullet")
> +    (version "2.82-r2704")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append 
> "https://bullet.googlecode.com/files/bullet-";
> +                                  version ".tgz"))
> +              (sha256
> +               (base32 
> "1lnfksxa9b1slyfcxys313ymsllvbsnxh9np06azkbgpfvmwkr37"))
> +              (patches (list (search-patch 
> "bullet-add-fPIC-into-flags.patch")))))
> +    (build-system cmake-build-system)
> +    (arguments '(#:tests? #f)) ; no 'test' target
> +    (home-page "http://bulletphysics.org/";)
> +    (synopsis "3D physics engine library")
> +    (description
> +     "Bullet is a physics engine library usable for collision detection.  It 
> +is used in some video games and movies.")
> +    (license zlib)))
> diff --git a/gnu/packages/patches/bullet-add-fPIC-into-flags.patch 
> b/gnu/packages/patches/bullet-add-fPIC-into-flags.patch
> new file mode 100644
> index 0000000..6e27660
> --- /dev/null
> +++ b/gnu/packages/patches/bullet-add-fPIC-into-flags.patch
> @@ -0,0 +1,13 @@
> +diff -up bullet-2.82-r2704/CMakeLists.txt.orig 
> bullet-2.82-r2704/CMakeLists.txt
> +--- bullet-2.82-r2704/CMakeLists.txt.orig    2014-12-13 00:09:49.648710180 
> +0100
> ++++ bullet-2.82-r2704/CMakeLists.txt 2014-12-13 00:10:44.205708986 +0100
> +@@ -17,6 +17,9 @@ IF (NOT CMAKE_BUILD_TYPE)
> +  SET(CMAKE_BUILD_TYPE "Release")
> + ENDIF (NOT CMAKE_BUILD_TYPE) 
> + 
> ++SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fPIC")
> ++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
> ++

Is the second 'SET' redundant?

Rather than using this patch file, you should instead add a new build
phase to the bullet package.  Add something like this to the arguments
field, after '#:tests? #f':

  #:phases (alist-cons-before
            'configure 'set-env-vars
            (lambda _
              (setenv "CMAKE_CXX_FLAGS"
                      (string-append (getenv "CMAKE_C_FLAGS")
            "-fPIC"))))

I don't know enough about cmake to know if this will work, but hopefully
it will give you an idea.
  
> + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
> + #MESSAGE("CMAKE_CXX_FLAGS_DEBUG="+${CMAKE_CXX_FLAGS_DEBUG})
> + 
> -- 
> 2.0.4
>
>

Things are looking good. :)

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate



reply via email to

[Prev in Thread] Current Thread [Next in Thread]