unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
@ 2016-12-30 18:04 ng0
  2016-12-30 18:04 ` [PATCH 1/3] gnu: Add mozjs-38 ng0
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: ng0 @ 2016-12-30 18:04 UTC (permalink / raw)
  To: guix-devel


These 3 patches are also in the games/0ad branch here https://pagure.io/guix-dev

No matter what I try, mozjs-38 ends up without a version in some parts and I need this to continue (finish) the 0ad package.
Any help is welcome.


Linking mocks_real
ar -rcs ../../../binaries/system/libmocks_real.a obj/mocks_real_Release/mocks_real.o 
==== Building network (release) ====
Creating obj/network_Release
mkdir -p obj/network_Release
precompiled.h
cp ../../../source/pch/network/precompiled.h obj/network_Release
g++ -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -x c++-header -o "obj/network_Release/precompiled.h.gch" -c "../../../source/pch/network/precompiled.h"
NetStats.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/NetStats.d -MT "obj/network_Release/NetStats.o" -o "obj/network_Release/NetStats.o" -c "../../../source/network/NetStats.cpp"
fsm.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/fsm.d -MT "obj/network_Release/fsm.o" -o "obj/network_Release/fsm.o" -c "../../../source/network/fsm.cpp"
NetTurnManager.cpp
g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/NetTurnManager.d -MT "obj/network_Release/NetTurnManager.o" -o "obj/network_Release/NetTurnManager.o" -c "../../../source/network/NetTurnManager.cpp"
In file included from ../../../source/scriptinterface/ScriptInterface.h:26:0,
                 from ../../../source/simulation2/helpers/SimulationCommand.h:21,
                 from ../../../source/network/NetTurnManager.h:21,
                 from ../../../source/network/NetTurnManager.cpp:20:
../../../source/scriptinterface/ScriptTypes.h:74:25: error: operator '!=' has no left operand
 #if MOZJS_MAJOR_VERSION != 38
                         ^
../../../source/scriptinterface/ScriptTypes.h:82:25: error: operator '!=' has no left operand
 #if MOZJS_MINOR_VERSION != 3
                         ^
In file included from /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/signal.h:316:0,
                 from /gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/include/c++/csignal:42,
                 from ../../../source/lib/pch/pch_stdlib.h:37,
                 from ../../../source/lib/precompiled.h:103,
                 from ../../../source/pch/network/precompiled.h:19:
/gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74: warning: invalid access to non-static data member ‘js::PerThreadDataFriendFields::RuntimeDummy::mainThread’  of NULL object [-Winvalid-offsetof]
     static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);
                                                                          ^
/gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74: warning: (perhaps the ‘offsetof’ macro was used incorrectly) [-Winvalid-offsetof]
make[1]: *** [network.make:202: obj/network_Release/NetTurnManager.o] Error 1
make: *** [Makefile:21: network] Error 2
make: Leaving directory '/tmp/guix-build-0ad-0.0.21-alpha.drv-0/0ad-0.0.21-alpha/build/workspaces/gcc'
phase `build' failed after 8.8 seconds
builder for `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed with exit code 1
@ build-failed /gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv - 1 builder for `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed

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

* [PATCH 1/3] gnu: Add mozjs-38.
  2016-12-30 18:04 Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
@ 2016-12-30 18:04 ` ng0
  2016-12-30 18:04 ` [PATCH 2/3] gnu: Add 0ad-data ng0
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: ng0 @ 2016-12-30 18:04 UTC (permalink / raw)
  To: guix-devel; +Cc: ng0

From: ng0 <ng0@we.make.ritual.n0.is>

* gnu/packages/gnuzilla.scm (mozjs-38): New variable.
---
 gnu/packages/gnuzilla.scm | 123 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 07ed2af0b..4ad4218eb 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
+;;; Copyright © 2016 ng0 <ng0@libertad.pw>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages libevent)
@@ -149,6 +151,127 @@ in C/C++.")
      `(("libffi" ,libffi)
        ("zlib" ,zlib)))))
 
+(define-public mozjs-38
+  (package (inherit mozjs)
+    (name "mozjs")
+    (version "38.2.1.rc0")
+    (source (origin
+              (method url-fetch)
+              (uri (list
+                    ;; The upstream server at people.mozilla.org produces
+                    ;; a tls handshake error, the file at people.freebsd.org
+                    ;; is identical and produces no such error.
+                    (string-append
+                     "https://people.freebsd.org/~sunpoet/distfiles/"
+                     name "-" version ".tar.bz2")
+                    ;; XXX: The upstream server at people.mozilla.org
+                    ;; TODO: Use revision control system checkout?
+                    (string-append
+                     "https://people.mozilla.org/~sstangl/"
+                     name "-" version ".tar.bz2")))
+              ;; TODO: Unbundle icu ("intl" dir)
+              (sha256
+               (base32
+                "0p4bmbpgkfsj54xschcny0a118jdrdgg0q29rwxigg3lh5slr681"))))
+    (arguments
+     `(;; XXX: parallel build fails, lacking:
+       ;;   mkdir -p "system_wrapper_js/"
+       ;; #:parallel-build? #f
+       ;; Tests fail due to missing module 'xpt':
+       ;; ImportError: No module named xpt
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (chdir "js/src")
+               ;; configure fails if it is followed by SHELL and CONFIG_SHELL
+               (setenv "SHELL" (which "sh"))
+               (setenv "CONFIG_SHELL" (which "sh"))
+               (setenv "LIBXUL_DIST" (assoc-ref %outputs "out"))
+               ;; TODO: Use exact version, if we leave this empty it
+               ;; will be empty in the .pc file.
+               ;; (setenv "MOZILLA_VERSION" "38.2.1")
+               ;; (setenv "MOZJS_MAJOR_VERSION" "38")
+               ;; (setenv "MOZJS_MINOR_VERSION" "2")
+               ;; (setenv "MOZJS_PATCH_VERSION" "1")
+               ;;
+               ;; (substitute* "js.pc.in"
+               ;;   ;;(("@MOZILLA_VERSION@") "38.2.1"))
+               ;;   (("@MOZILLA_VERSION@") "38.0.0"))
+               (zero? (system* "./configure"
+                               (string-append "--prefix=" out)
+                               "--with-system-nspr"
+                               "--enable-system-ffi"
+                               "--enable-threadsafe"
+                               "--with-system-icu"
+                               "--with-system-zlib"
+                               "--enable-readline"
+
+                               ;; These are required by 0ad and they may
+                               ;; or may not be good defaults for other
+                               ;; uses.
+                               "--enable-gcgenerational"
+                               "--enable-shared-js")))))
+         (add-after 'install 'fix-header-symlinks
+           ;; The headers are symlinks to a directory that does not
+           ;; get put into the store location, so they end up broken.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (inc (string-append out "/include/mozjs-"))
+                    (incjs (string-append inc "/js"))
+                    (moz (string-append inc "/mozilla")))
+               ;; TODO: for-each
+               (chdir "../..") ; Change to root of build directory
+               (delete-file-recursively incjs)
+               (copy-recursively "js/public/" incjs)
+               ;; Remove stuff we don't need:
+               (delete-file-recursively moz)
+               (copy-recursively "mfbt" moz)
+               (delete-file (string-append inc "/jsalloc.h"))
+               (delete-file (string-append inc "/jsapi.h"))
+               (delete-file (string-append inc "/jsbytecode.h"))
+               (delete-file (string-append inc "/jsclist.h"))
+               (delete-file (string-append inc "/jscpucfg.h"))
+               (delete-file (string-append inc "/jsfriendapi.h"))
+               (delete-file (string-append inc "/js.msg"))
+               (delete-file (string-append inc "/jsperf.h"))
+               (delete-file (string-append inc "/jsprf.h"))
+               (delete-file (string-append inc "/jsprototypes.h"))
+               (delete-file (string-append inc "/jspubtd.h"))
+               (delete-file (string-append inc "/jstypes.h"))
+               (delete-file (string-append inc "/jsversion.h"))
+               (delete-file (string-append inc "/jswrapper.h"))
+               (install-file "js/src/jsalloc.h" inc)
+               (install-file "js/src/jsapi.h" inc)
+               (install-file "js/src/jsbytecode.h" inc)
+               (install-file "js/src/jsclist.h" inc)
+               (install-file "js/src/jscpucfg.h" inc)
+               (install-file "js/src/jsfriendapi.h" inc)
+               (install-file "js/src/js.msg" inc)
+               (install-file "js/src/perf/jsperf.h" inc)
+               (install-file "js/src/jsprf.h" inc)
+               (install-file "js/src/jsprototypes.h" inc)
+               (install-file "js/src/jspubtd.h" inc)
+               (install-file "js/src/jstypes.h" inc)
+               (install-file "js/src/jsversion.h" inc)
+               (install-file "js/src/jswrapper.h" inc)
+               (delete-file-recursively (string-append moz "/decimal"))
+               (delete-file-recursively (string-append moz "/tests"))
+               (delete-file-recursively (string-append moz "/double-conversion"))))))))
+    (native-inputs
+     `(("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("python-2" ,python-2)))
+    (propagated-inputs
+     `(("nspr" ,nspr))) ; in the Requires.private field of mozjs-24.pc
+    (inputs
+     `(("libffi" ,libffi)
+       ("readline" ,readline)
+       ("icu4c" ,icu4c)
+       ("zlib" ,zlib)))))
+
 (define-public nspr
   (package
     (name "nspr")
-- 
2.11.0

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

* [PATCH 2/3] gnu: Add 0ad-data.
  2016-12-30 18:04 Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
  2016-12-30 18:04 ` [PATCH 1/3] gnu: Add mozjs-38 ng0
@ 2016-12-30 18:04 ` ng0
  2016-12-30 18:04 ` [PATCH 3/3] gnu: Add 0ad ng0
  2017-01-06 14:45 ` Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
  3 siblings, 0 replies; 11+ messages in thread
From: ng0 @ 2016-12-30 18:04 UTC (permalink / raw)
  To: guix-devel; +Cc: ng0

From: ng0 <ng0@we.make.ritual.n0.is>

* gnu/packages/games.scm (0ad-data): New variable.
---
 gnu/packages/games.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index a3b9f04b9..69c72a55f 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -3068,3 +3068,49 @@ symbols, the game needs graphics to render the non-euclidean world.")
 for Un*x systems with X11.")
     (home-page "http://olofson.net/kobodl/")
     (license license:gpl2+)))
+
+(define 0ad-data
+  (package
+    (name "0ad-data")
+    (version "0.0.21-alpha")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://releases.wildfiregames.com/0ad-"
+             version "-unix-data.tar.xz"))
+       (file-name (string-append name "-" version ".tar.xz"))
+       (sha256
+        (base32
+         "15xadyrpvq27lm9p1ny7bcmmv56m16h3xadbkdx69gfkzxc3razk"))))
+    (build-system trivial-build-system)
+    (native-inputs
+     `(("source" ,source)
+       ("tar" ,tar)
+       ("xz" ,(@ (gnu packages compression) xz))))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let ((tar (string-append
+                     (assoc-ref %build-inputs "tar")
+                     "/bin/tar"))
+               (install-dir (string-append %output
+                                           "/share/0ad/data"))
+               (path (string-append (assoc-ref %build-inputs
+                                               "xz")
+                                    "/bin")))
+           (setenv "PATH" path)
+           (system* tar "xvf" (assoc-ref %build-inputs "source"))
+           (chdir (string-append "0ad-" ,version))
+           (mkdir-p install-dir)
+           (copy-recursively "." install-dir)))))
+    (synopsis "Data for the game 0ad")
+    (description
+     "Data files for 0ad.")
+    (home-page "http://play0ad.com")
+    (license (list license:gpl2
+                   ;; license:lppl1.3c  TODO: ADD.
+                   ;; license:bitstream-vera  TODO: ADD.
+                   license:cc-by-sa3.0))))
-- 
2.11.0

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

* [PATCH 3/3] gnu: Add 0ad.
  2016-12-30 18:04 Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
  2016-12-30 18:04 ` [PATCH 1/3] gnu: Add mozjs-38 ng0
  2016-12-30 18:04 ` [PATCH 2/3] gnu: Add 0ad-data ng0
@ 2016-12-30 18:04 ` ng0
  2017-01-06 14:45 ` Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
  3 siblings, 0 replies; 11+ messages in thread
From: ng0 @ 2016-12-30 18:04 UTC (permalink / raw)
  To: guix-devel; +Cc: ng0

From: ng0 <ng0@we.make.ritual.n0.is>

* gnu/packages/games.scm (0ad): New variable.
---
 gnu/packages/games.scm | 147 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 146 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 69c72a55f..dba021619 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -17,7 +17,7 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2016 Rodger Fox <thylakoid@openmailbox.org>
 ;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016, 2017 ng0 <ng0@libertad.pw>
 ;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org>
 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
@@ -57,6 +57,7 @@
   #:use-module (gnu packages audio)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages fltk)
   #:use-module (gnu packages fribidi)
   #:use-module (gnu packages game-development)
@@ -65,6 +66,7 @@
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
@@ -74,8 +76,10 @@
   #:use-module (gnu packages mp3)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages messaging)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
@@ -98,12 +102,15 @@
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages upnp)
+  #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages ruby)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix build-system python)
@@ -3114,3 +3121,141 @@ for Un*x systems with X11.")
                    ;; license:lppl1.3c  TODO: ADD.
                    ;; license:bitstream-vera  TODO: ADD.
                    license:cc-by-sa3.0))))
+
+(define-public 0ad
+  (package
+    (name "0ad")
+    (version "0.0.21-alpha")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://releases.wildfiregames.com/0ad-"
+             version "-unix-build.tar.xz"))
+       (file-name (string-append name "-" version ".tar.xz"))
+       (sha256
+        (base32
+         "1kw3hqnr737ipx4f03khz3hvsh3ha7r8iy9njppk2faa53j27gln"))))
+    (inputs
+     `(("0ad-data" ,0ad-data)
+       ("curl" ,curl)
+       ("enet" ,enet)
+       ("perl" ,perl)
+       ("icu4c" ,icu4c)
+       ("libxml2" ,libxml2)
+       ("nspr" ,nspr)
+       ("libpng" ,libpng)
+       ("sdl2" ,sdl2)
+       ("miniupnpc" ,miniupnpc)
+       ("zlib" ,zlib)
+       ("openjpeg" ,openjpeg)
+       ("mesa" ,mesa)
+       ("libx11" ,libx11)
+       ("libxcursor" ,libxcursor)
+       ("wxwidgets" ,wxwidgets)
+       ("gloox" ,gloox) ; lobby
+       ("mozjs-38" ,mozjs-38)
+       ;; TODO: ("nvidia-texture-tools" ,nvidia-texture-tools)
+       ("libvorbis" ,libvorbis)
+       ("openal" ,openal)))
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("pkg-config" ,pkg-config)
+       ("boost" ,boost)
+       ("mesa" ,mesa)
+       ("zip" ,zip)
+       ("python-2" ,python-2)
+       ("python" ,python)
+       ("ruby" ,ruby)
+       ("bash" ,bash)
+       ("libsm" ,libsm)))
+    (build-system gnu-build-system)
+    ;; NOTE:
+    ;; FIX MOZJS build:
+    ;; lrwxrwxrwx 2 root root 79 Jan  1  1970 /gnu/store/xzq971blmjazq7bc267wcgna3bjw15js-mozjs-38.2.1.rc0/include/mozjs-/js/RequiredDefines.h -> /tmp/guix-build-mozjs-38.2.1.rc0.drv-0/mozjs-38.0.0/js/public/RequiredDefines.h
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'create-/bin/sh-symlink
+           (lambda _
+             ;; The build system creates files during build which expect
+             ;; /bin/sh to exist (shebang).
+             (let ((bash (string-append (assoc-ref %build-inputs "bash")
+                                       "/bin/sh")))
+               ;;(symlink bash (string-append (assoc-ref %outputs "out")
+               ;;                             "/bin/sh"))
+               (substitute* "build/premake/premake4/src/actions/xcode/xcode_common.lua"
+                 (("/bin/sh") bash))
+               (substitute* "build/premake/premake4/src/host/scripts.c"
+                 (("/bin/sh") bash))
+               (substitute* "build/premake/premake4/tests/actions/xcode/test_xcode_project.lua"
+                 (("/bin/sh") bash)))))
+         ;; (add-after 'unpack 'add-mozjs-to-pkgpath
+         ;;   (lambda _
+         ;;     (setenv "PKG_CONFIG_PATH"
+         ;;             (string-append (getenv "PKG_CONFIG_PATH") ":"
+         ;;                            (assoc-ref %build-inputs "mozjs-38")
+         ;;                            "/lib/pkgconfig"))))
+         (add-after 'unpack 'use-mozjs
+           (lambda _
+             (substitute* "build/premake/extern_libs4.lua"
+               (("mozjs-38") "js"))))
+         (add-after 'unpack 'delete-bundles
+           (lambda _
+             (delete-file-recursively "libraries/source/spidermonkey")))
+         (add-after 'unpack 'reset-defaults
+           (lambda _
+             (substitute* "build/premake/premake4/build/gmake.unix/Premake4.make"
+               (("-Wall -Os") "-Wall")
+               (("CFLAGS    += $(CPPFLAGS) -Wall")
+                "CFLAGS    += $(CFLAGS) $(CPPFLAGS) -Wall")
+               (("CXXFLAGS  += $(CPPFLAGS) -Wall -g")
+                "CXXFLAGS  += $(CXXFLAGS) $(CPPFLAGS) -Wall"))))
+         ;; We need to use the included premake4.
+         (add-before 'configure 'build-premake4
+           (lambda _
+             (setenv "CC" "gcc")
+             (zero? (system* "make" "-C"
+                             "build/premake/premake4/build/gmake.unix"))))
+         (replace 'configure
+           (lambda* _
+             (with-directory-excursion "build/premake"
+               (zero? (system* "premake4/bin/release/premake4"
+                               "--file=premake4.lua"
+                               "--outpath=../workspaces/gcc/"
+                               "--platform=x64"
+                               "--os=linux"
+                               "--with-system-miniupnpc"
+                               "--with-system-mozjs38"
+                               "--minimal-flags"
+                               ;; TODO: "--without-nvtt"
+                               "--with-pch" "--with-tests" "--with-audio"
+                               ;;"--enable-atlas"
+                               "--atlas"
+                               "--with-lobby" "--enable-collada"
+                               ;; TODO: "--with-system-nvtt"
+                               "gmake")))))
+         ;; XXX: 0ad bundles spidermonkey, it requires exactly
+         ;; the bundled version with the applied patches or something
+         ;; similar, see README.
+         (add-before 'build 'build-bundled-fcollada
+           (lambda _
+             (zero? (system* "make" "-C" "libraries/source/fcollada/src"))))
+         (replace 'build
+           (lambda _
+             (zero? (system* "make" "-C" "build/workspaces/gcc" "verbose=1"))))
+         (replace 'check
+           (lambda* _
+             (with-directory-excursion "binaries/system"
+               (zero? (system* "./test" "-libdir" "binaries/system"))))))))
+    (home-page "http://play0ad.com")
+    (synopsis "Real-time strategy game with single- and multi-player modes")
+    (description
+     "0 A.D. is a real-time strategy game.  It is a historical war and
+economy game focusing on the years between 500 B.C. and 1 B.C. for the
+first part, and a planned second part for the years 1 A.D. to 500 A.D.")
+    (license (list license:expat
+                   license:cc-by-sa3.0
+                   license:zlib
+                   license:lgpl2.1
+                   license:gpl2))))
-- 
2.11.0

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2016-12-30 18:04 Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
                   ` (2 preceding siblings ...)
  2016-12-30 18:04 ` [PATCH 3/3] gnu: Add 0ad ng0
@ 2017-01-06 14:45 ` ng0
  2017-01-06 17:49   ` Maxim Cournoyer
  3 siblings, 1 reply; 11+ messages in thread
From: ng0 @ 2017-01-06 14:45 UTC (permalink / raw)
  To: guix-devel; +Cc: iyzsong

ng0 <ng0@libertad.pw> writes:

> These 3 patches are also in the "games/0ad" branch here https://pagure.io/guix-dev
>
> No matter what I try, mozjs-38 ends up without a version in some parts and I need this to continue (finish) the 0ad package.
> Any help is welcome.
>

Cc people which were involved in mozjs and/or icecat on Guix,
maybe you can help me. Otherwise I'd have to ask upstream for
help.

> Linking mocks_real
> ar -rcs ../../../binaries/system/libmocks_real.a obj/mocks_real_Release/mocks_real.o 
> ==== Building network (release) ====
> Creating obj/network_Release
> mkdir -p obj/network_Release
> precompiled.h
> cp ../../../source/pch/network/precompiled.h obj/network_Release
> g++ -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -x c++-header -o "obj/network_Release/precompiled.h.gch" -c "../../../source/pch/network/precompiled.h"
> NetStats.cpp
> g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/NetStats.d -MT "obj/network_Release/NetStats.o" -o "obj/network_Release/NetStats.o" -c "../../../source/network/NetStats.cpp"
> fsm.cpp
> g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/fsm.d -MT "obj/network_Release/fsm.o" -o "obj/network_Release/fsm.o" -c "../../../source/network/fsm.cpp"
> NetTurnManager.cpp
> g++ -Iobj/network_Release -include obj/network_Release/precompiled.h -MMD -MP -DNDEBUG -DCONFIG_FINAL=1 -DLIB_STATIC_LINK -DUSING_PCH -I../../../source/pch/network -I../../../source -I/usr/X11R6/include/X11 -I/usr/X11R6/include -I/usr/local/include/X11 -I/usr/local/include -I/usr/include/X11 -std=c++0x -fvisibility=hidden `pkg-config js --cflags` -MF obj/network_Release/NetTurnManager.d -MT "obj/network_Release/NetTurnManager.o" -o "obj/network_Release/NetTurnManager.o" -c "../../../source/network/NetTurnManager.cpp"
> In file included from ../../../source/scriptinterface/ScriptInterface.h:26:0,
>                  from ../../../source/simulation2/helpers/SimulationCommand.h:21,
>                  from ../../../source/network/NetTurnManager.h:21,
>                  from ../../../source/network/NetTurnManager.cpp:20:
> ../../../source/scriptinterface/ScriptTypes.h:74:25: error: operator '!=' has no left operand
>  #if MOZJS_MAJOR_VERSION != 38
>                          ^
> ../../../source/scriptinterface/ScriptTypes.h:82:25: error: operator '!=' has no left operand
>  #if MOZJS_MINOR_VERSION != 3
>                          ^
> In file included from /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/signal.h:316:0,
>                  from /gnu/store/y1g6991kxvdk4vxhsq07r5saww30v8dq-gcc-4.9.4/include/c++/csignal:42,
>                  from ../../../source/lib/pch/pch_stdlib.h:37,
>                  from ../../../source/lib/precompiled.h:103,
>                  from ../../../source/pch/network/precompiled.h:19:
> /gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74: warning: invalid access to non-static data member ‘js::PerThreadDataFriendFields::RuntimeDummy::mainThread’  of NULL object [-Winvalid-offsetof]
>      static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);
>                                                                           ^
> /gnu/store/9vn87bm1872c6b9w4lpqnm5ckx5h6gia-mozjs-38.2.1.rc0/include/mozjs-/jspubtd.h:459:74: warning: (perhaps the ‘offsetof’ macro was used incorrectly) [-Winvalid-offsetof]
> make[1]: *** [network.make:202: obj/network_Release/NetTurnManager.o] Error 1
> make: *** [Makefile:21: network] Error 2
> make: Leaving directory '/tmp/guix-build-0ad-0.0.21-alpha.drv-0/0ad-0.0.21-alpha/build/workspaces/gcc'
> phase `build' failed after 8.8 seconds
> builder for `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed with exit code 1
> @ build-failed /gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv - 1 builder for `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed with exit code 1
> guix build: error: build failed: build of `/gnu/store/122kd4f8ygnhwzwki437kx2hrp2mj40q-0ad-0.0.21-alpha.drv' failed
>
>

-- 
♥Ⓐ  ng0
PGP keys and more: https://n0is.noblogs.org/ http://ng0.chaosnet.org

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-06 14:45 ` Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
@ 2017-01-06 17:49   ` Maxim Cournoyer
  2017-01-06 20:44     ` ng0
  0 siblings, 1 reply; 11+ messages in thread
From: Maxim Cournoyer @ 2017-01-06 17:49 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel, iyzsong

Hi ng0!

Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?
These are the first errors. Fixing those might make the picture a bit prettier?

Do other distributions do something special wrt these constants?

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-06 17:49   ` Maxim Cournoyer
@ 2017-01-06 20:44     ` ng0
  2017-01-22 10:17       ` Ricardo Wurmus
  0 siblings, 1 reply; 11+ messages in thread
From: ng0 @ 2017-01-06 20:44 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: guix-devel

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi ng0!
>
> Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?
> These are the first errors. Fixing those might make the picture a bit prettier?

It's not about pretty, it's about this being a terrible piece of
unstable, not 100% released software which is public available
and being bundled by some applications (for example 0ad) and you
either accept the bundle or unbundle it.

Today I've found
https://mskalick.fedorapeople.org/mozjs38/mozjs38.spec referenced
from https://bugzilla.redhat.com/show_bug.cgi?id=1269539 and I've
updated my branch but did not progress visibly. Check the 3
patches out and try to build mozjs-38 yourself, still doesn't
build like it should.
https://pagure.io/guix-dev/c/07c579fd3e7e0621ef0f323b6130c74fe5a09f62

> Do other distributions do something special wrt these constants?
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-06 20:44     ` ng0
@ 2017-01-22 10:17       ` Ricardo Wurmus
  2017-01-22 10:50         ` ng0
  0 siblings, 1 reply; 11+ messages in thread
From: Ricardo Wurmus @ 2017-01-22 10:17 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel, Maxim Cournoyer


ng0 <ng0@libertad.pw> writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Hi ng0!
>>
>> Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?
>> These are the first errors. Fixing those might make the picture a bit prettier?
>
> It's not about pretty, it's about this being a terrible piece of
> unstable, not 100% released software which is public available
> and being bundled by some applications (for example 0ad) and you
> either accept the bundle or unbundle it.

You haven’t yet answered Maxim’s question.  The error you showed in your
previous email is likely because these values are undefined.  Do you get
different errors when these values are defined?

Are these values set by the build system at some point?  (Just grep the
sources to see where these values are used.)

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-22 10:17       ` Ricardo Wurmus
@ 2017-01-22 10:50         ` ng0
  2017-01-22 11:04           ` ng0
  2017-01-22 11:36           ` Ricardo Wurmus
  0 siblings, 2 replies; 11+ messages in thread
From: ng0 @ 2017-01-22 10:50 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> writes:

> ng0 <ng0@libertad.pw> writes:
>
>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>
>>> Hi ng0!
>>>
>>> Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?
>>> These are the first errors. Fixing those might make the picture a bit prettier?
>>
>> It's not about pretty, it's about this being a terrible piece of
>> unstable, not 100% released software which is public available
>> and being bundled by some applications (for example 0ad) and you
>> either accept the bundle or unbundle it.
>
> You haven’t yet answered Maxim’s question.  The error you showed in your
> previous email is likely because these values are undefined.  Do you get
> different errors when these values are defined?

Okay, note to self: Do not assume that everyone can read between
the lines. That was a bad reply I gave to a question.
To answer: yes, I have tried to set this and other reasonable envs
(see
https://pagure.io/guix-dev/c/07c579fd3e7e0621ef0f323b6130c74fe5a09f62?branch=games%2F0ad
) and it had no effect. 

> Are these values set by the build system at some point?  (Just grep the
> sources to see where these values are used.)

The values are used, but they are not changed/applied during the
build.
There's a Makefile, but everyone else (distros) is just skipping
that. I did so too, but I haven't documented the reason(s) for
myself. I will try running autotools and use this Makefile, to
document at least what it does.

> --
> Ricardo
>
> GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
> https://elephly.net
>
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-22 10:50         ` ng0
@ 2017-01-22 11:04           ` ng0
  2017-01-22 11:36           ` Ricardo Wurmus
  1 sibling, 0 replies; 11+ messages in thread
From: ng0 @ 2017-01-22 11:04 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

ng0 <contact.ng0@cryptolab.net> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> ng0 <ng0@libertad.pw> writes:
>>
>>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>>
>>>> Hi ng0!
>>>>
>>>> Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?
>>>> These are the first errors. Fixing those might make the picture a bit prettier?
>>>
>>> It's not about pretty, it's about this being a terrible piece of
>>> unstable, not 100% released software which is public available
>>> and being bundled by some applications (for example 0ad) and you
>>> either accept the bundle or unbundle it.
>>
>> You haven’t yet answered Maxim’s question.  The error you showed in your
>> previous email is likely because these values are undefined.  Do you get
>> different errors when these values are defined?
>
> Okay, note to self: Do not assume that everyone can read between
> the lines. That was a bad reply I gave to a question.
> To answer: yes, I have tried to set this and other reasonable envs
> (see
> https://pagure.io/guix-dev/c/07c579fd3e7e0621ef0f323b6130c74fe5a09f62?branch=games%2F0ad
> ) and it had no effect. 
>
>> Are these values set by the build system at some point?  (Just grep the
>> sources to see where these values are used.)
>
> The values are used, but they are not changed/applied during the
> build.
> There's a Makefile, but everyone else (distros) is just skipping
> that. I did so too, but I haven't documented the reason(s) for
> myself. I will try running autotools and use this Makefile, to
> document at least what it does.

This is why I did it:

ng0@wasp ~/r/mozjs-38.0.0> cat INSTALL
Full build documentation for SpiderMonkey is hosted on MDN:
  https://developer.mozilla.org/en-US/docs/SpiderMonkey/Build_Documentation

Note that the libraries produced by the build system include
symbols,
causing the binaries to be extremely large. It is highly
suggested that `strip`
be run over the binaries before deploying them.

Building with default options may be performed as follows:
  cd js/src
  ./configure
  make

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

* Re: Mozilla help needed - 0ad, or: how to pass the version to mozjs-38?
  2017-01-22 10:50         ` ng0
  2017-01-22 11:04           ` ng0
@ 2017-01-22 11:36           ` Ricardo Wurmus
  1 sibling, 0 replies; 11+ messages in thread
From: Ricardo Wurmus @ 2017-01-22 11:36 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel


ng0 <contact.ng0@cryptolab.net> writes:

maxim> Have you tried defining MOZJS_MAJOR_VERSION or MOZJS_MINOR_VERSION?

[…]

ng0> To answer: yes, I have tried to set this and other reasonable envs
ng0> (see
ng0> https://pagure.io/guix-dev/c/07c579fd3e7e0621ef0f323b6130c74fe5a09f62?branch=games%2F0ad
ng0> ) and it had no effect.

I don’t see definitions of these two values at the linked URL.  You only
set environment variables, but this is about pre-processor definitions.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

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

end of thread, other threads:[~2017-01-22 11:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-30 18:04 Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
2016-12-30 18:04 ` [PATCH 1/3] gnu: Add mozjs-38 ng0
2016-12-30 18:04 ` [PATCH 2/3] gnu: Add 0ad-data ng0
2016-12-30 18:04 ` [PATCH 3/3] gnu: Add 0ad ng0
2017-01-06 14:45 ` Mozilla help needed - 0ad, or: how to pass the version to mozjs-38? ng0
2017-01-06 17:49   ` Maxim Cournoyer
2017-01-06 20:44     ` ng0
2017-01-22 10:17       ` Ricardo Wurmus
2017-01-22 10:50         ` ng0
2017-01-22 11:04           ` ng0
2017-01-22 11:36           ` 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).