[PATCH 0/9] Add the Haxe language and tools.

  • Done
  • quality assurance status badge
Details
2 participants
  • 宋文武
  • John Kehayias
Owner
unassigned
Submitted by
John Kehayias
Severity
normal

Debbugs page

John Kehayias wrote 3 years ago
(name . Guix-patches)(address . guix-patches@gnu.org)
9PX8REXHYFolHkT-TXF_SZcRFDEe1-1KwK9riBoz1tnsKV2raznmLO3YTlzbpdyJ9dBOqnpcaUomHmLfOWjytFrkLEvIW_upqCAA_-byN50=@protonmail.com
Hi Guix,

Incoming is a patch series to add the Haxe [0] language and tools, including the language/VM Neko [1] that it is built with and the Haxe VM Hashlink [2]. It starts with OCaml that these are built on top of, and includes some other needed packages. Here is a breakdown of what the patches do:

Patch 1-4: Add needed OCaml dependencies. I relied on the importer and fixed up the builds, descriptions, licenses, etc. I haven't packaged any OCaml before (or know anything about it), but everything appeared to work and I followed our existing packages.

Patch 5 & 6: Add 2 small libraries, minimp3 and mikktspace.

Minimp3 is a single header library, though also included the extended version (so, 2 headers). The repo has a lot of other files for what looks like tests, but wasn't sure how to easily run them with all the files and scripts and a lack of instructions. I left that as a TODO for the future.

Mikktspace is a header and C file. There is no makefile or instructions, so upon discussion on #guix I built a shared library manually. It works for what I needed and means Hashlink can be completely unbundled.

Patch 7-9: Add Neko (language/VM used to build Haxe), the Haxe toolkit, and the Haxe VM Hashlink.

Haxe: this builds the compiler and library manager, haxelib. Perhaps these could be separated, but it seemed to make more sense to keep them together as intended by upstream. haxelib-src is a bare origin to use rather than Haxe's haxelib submodule. There was also a manual change so that the default location haxelib will suggest for libraries is user writeable: ~/.haxe/lib (rather than /usr/lib/haxe/lib).

Hashlink: unbundled the included libraries with Guix packages. I left a comment about there being a CMake build that seemed perhaps incomplete (there is bug reports on confusion of how to build with CMake) and is also where the tests seemed to be. I could get the CMake build to build, but it didn't build everything needed and didn't seem to be fully linked. The tests may also need network access as they want to call haxelib (typically would download haxe libraries). Tests disabled until future updates can sort this out.

I've run guix lint on all and have built and used Haxe and Hashlink. Everything seems to run well, it can download Haxe libraries to then build, the Hashlink VM works to run e.g. SDL graphics code; even building to JS with Haxe works just fine. I used [3] as an example of a non-trivial Haxe package, using the Heaps.io game engine [4]; everything worked without modification.

I put Neko (since it is used to build Haxe) and the Haxe packages in a new module (gnu packages haxe). Perhaps in the future someone may want a haxe-build-system to manage libraries with Guix, but so far everything works well with how Haxe wants it to.

Hope everything looks good, let me know any needed changes.

John





John Kehayias wrote 3 years ago
[PATCH 1/9] gnu: Add ocaml-luv.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
HNANXaAbhLuLIARPOyft_4EvsW3Imo1zuAuPbBRC0nLK5N9DBRIuYjcJVrPOqk1bvAeQYREipIUQvg6wocn3rEAaECCMD6TM2Lm-H2TjwZ0=@protonmail.com
Empty Message
From d96390019a22b1b01b5845f971e46523a42848e5 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:31:26 -0400
Subject: [PATCH 1/9] gnu: Add ocaml-luv.

* gnu/packages/ocaml.scm (ocaml-luv): New variable.
---
gnu/packages/ocaml.scm | 43 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (63 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index ff24861eb0..895b99320e 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -25,6 +25,7 @@
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2624,6 +2625,48 @@ (define-public ocaml-lwt
locks or other synchronization primitives.")
(license license:lgpl2.1)))
+(define-public ocaml-luv
+ (package
+ (name "ocaml-luv")
+ (version "0.5.11")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/aantron/luv/releases/download/"
+ version "/luv-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0hrsi8n2l31bcwgj847df4chjgqb9lmwkaky8fvvi15k25rz9v6c"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Remove bundled configure and libuv.
+ (delete-file-recursively "src/c/vendor")
+ #t))))
+ (build-system dune-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'use-system-libuv
+ (lambda _
+ (setenv "LUV_USE_SYSTEM_LIBUV" "yes")))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "dune" "runtest" "--no-buffer" "--force")))))))
+ (inputs (list libuv))
+ (propagated-inputs (list ocaml-ctypes ocaml-result ocaml-odoc))
+ (native-inputs (list ocaml-base ocaml-alcotest))
+ (home-page "https://github.com/aantron/luv")
+ (synopsis "Binding to libuv: cross-platform asynchronous I/O")
+ (description
+ "Luv is a binding to libuv, the cross-platform C library that does
+asynchronous I/O in Node.js and runs its main loop. Besides asynchronous I/O,
+libuv also supports multiprocessing and multithreading. Multiple event loops
+can be run in different threads. libuv also exposes a lot of other
+functionality, amounting to a full OS API, and an alternative to the standard
+module Unix.")
+ (license license:expat)))
+
(define-public ocaml-lwt-react
(package
(inherit ocaml-lwt)
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 2/9] gnu: Add ocaml-ptmap.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
zIborLNqjCAtYkVbymySnEAHz4NrAT1OiHGKlyd1cgTSnoXuxvVEBbglHz7QFgtS8OAH6foeDlLK6nP6ajKKc6LvsuThy9jPsRejPuzX40k=@protonmail.com
Empty Message
From 8f67088861460984d5ed1147c58d66d0658528be Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:31:45 -0400
Subject: [PATCH 2/9] gnu: Add ocaml-ptmap.

* gnu/packages/ocaml.scm (ocaml-ptmap): New variable.
---
gnu/packages/ocaml.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (41 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 895b99320e..da7086ab2b 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -4407,6 +4407,34 @@ (define-public ocaml4.07-utop
("ocaml-zed" ,ocaml-zed)))
(properties '()))))
+(define-public ocaml-ptmap
+ (package
+ (name "ocaml-ptmap")
+ (version "2.0.5")
+ (source (origin
+ (method url-fetch)
+ (uri
+ (string-append "https://github.com/backtracking/ptmap/releases/download/"
+ version "/ptmap-" version ".tbz"))
+ (sha256
+ (base32
+ "1apk61fc1y1g7x3m3c91fnskvxp6i0vk5nxwvipj56k7x2pzilgb"))))
+ (build-system dune-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "dune" "runtest")))))))
+ (propagated-inputs (list ocaml-stdlib-shims ocaml-seq))
+ (home-page "https://github.com/backtracking/ptmap")
+ (synopsis "Maps of integers implemented as Patricia trees")
+ (description
+ "An implementation inspired by Okasaki & Gill's paper 'Fast Mergeable
+Integer Maps.'")
+ (license license:lgpl2.1))) ; with linking exception
+
(define-public ocaml-integers
(package
(name "ocaml-integers")
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 3/9] gnu: Add ocaml-sha.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
sjw5UM6C6vmKHDzSFGOBZcYeBC5tSwL9LJxoobA7tVtA1v8eewPs9jqUXykPcgO--mg0_C-2gIkX_7DmW7a40YizRbA2K2XsAWUAu9vnXgw=@protonmail.com
Empty Message
From 268e976b4410be89e8e655704732e42a74f6a654 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:31:57 -0400
Subject: [PATCH 3/9] gnu: Add ocaml-sha.

* gnu/packages/ocaml.scm (ocaml-sha): New variable.
---
gnu/packages/ocaml.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index da7086ab2b..8620d2bde3 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5930,6 +5930,28 @@ (define-public ocaml-octavius
(description "Octavius is a library to parse the `ocamldoc` comment syntax.")
(license license:isc)))
+(define-public ocaml-sha
+ (package
+ (name "ocaml-sha")
+ (version "1.15.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/djs55/ocaml-sha/releases/download/"
+ version "/sha-" version ".tbz"))
+ (sha256
+ (base32
+ "1dzzhchknnbrpp5s81iqbvmqp4s0l75yrq8snj70ch3wkarmgg9z"))))
+ (build-system dune-build-system)
+ (propagated-inputs (list ocaml-stdlib-shims ocaml-odoc))
+ (native-inputs (list ocaml-ounit2))
+ (home-page "https://github.com/djs55/ocaml-sha")
+ (synopsis "OCaml binding to the SHA cryptographic functions")
+ (description
+ "This is the binding for SHA interface code in OCaml, offering the same
+interface as the MD5 digest included in the OCaml standard library. It
+currently provides SHA1, SHA256 and SHA512 hash functions.")
+ (license license:isc)))
+
(define-public ocaml-ppx-hash
(package
(name "ocaml-ppx-hash")
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 4/9] gnu: Add ocaml-xml-light.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
4uEkvxdO9wKNr_NlJqIucgyi7X8nk4MjGUnza5ANlBqa8CQ1-41OsubmA3x5gvtTY9mYfq-O7347Ny_PuU57vbrlfeZSbgc65ZOsegiDB9E=@protonmail.com
Empty Message
From 2733ca5c0a423155a9db5f6dfbda678463f39647 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:32:04 -0400
Subject: [PATCH 4/9] gnu: Add ocaml-xml-light.

* gnu/packages/ocaml.scm (ocaml-xml-light): New variable.
---
gnu/packages/ocaml.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 8620d2bde3..3df81e498b 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -2812,6 +2812,45 @@ (define-public ocaml-bos
run command line programs.")
(license license:isc)))
+(define-public ocaml-xml-light
+ (package
+ (name "ocaml-xml-light")
+ (version "2.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ncannasse/xml-light")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "089ywjz84y4p5iln94y54vh03b5fm2zrl2dld1398dyrby96dp6s"))))
+ (build-system ocaml-build-system)
+ (arguments
+ (list #:tests? #f ; There are no tests.
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'prefix
+ (lambda _
+ (substitute* "Makefile"
+ (("`\\$\\(OCAMLC\\) -where`")
+ (string-append #$output "/lib/ocaml/site-lib/xml-light")))))
+ (delete 'configure) ; no configure
+ (add-before 'install 'mkdir
+ (lambda _
+ (mkdir-p (string-append #$output "/lib/ocaml/site-lib/xml-light"))))
+ (replace 'install
+ (lambda _
+ (invoke "make" "install_ocamlfind"))))))
+ (home-page "https://github.com/ncannasse/xml-light")
+ (synopsis "Xml-Light is a minimal XML parser & printer for OCaml")
+ (description
+ "Xml-Light provides functions to parse an XML document into an OCaml data
+structure, work with it, and print it back to an XML document. It also
+supports DTD parsing and checking, and is entirely written in OCaml, hence it
+does not require additional C libraries.")
+ (license license:lgpl2.1+))) ; with linking exception
+
(define-public ocaml-xmlm
(package
(name "ocaml-xmlm")
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 5/9] gnu: Add mikktspace.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
-SOYDPbYrBg0NM1yceWAD9ce-EZEBGIZPvbH8NlKBtyfPWxXrOR2t9AO65XwSEGnjBfMLMkOt6yX-X0iQOcQY9E__nBU-Ajzc4Lwi4aqw0E=@protonmail.com
Empty Message
From 441a3faaa94688ff01313644d7ee0bd83cf067e9 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:32:42 -0400
Subject: [PATCH 5/9] gnu: Add mikktspace.

* gnu/packages/graphics.scm (mikktspace): New variable.
---
gnu/packages/graphics.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index c193be1efb..1acec5ea76 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -584,6 +584,45 @@ (define-public assimp
more.")
(license license:bsd-3)))
+(define-public mikktspace
+ ;; The latest commit is used as there is no release.
+ (let ((commit "3e895b49d05ea07e4c2133156cfa94369e19e409")
+ (revision "0"))
+ (package
+ (name "mikktspace")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mmikk/MikkTSpace")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1rjh9zflx51hdhnfadal87v4hhkrbprkv692hjkg9wkxx0ch39zi"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+ (invoke #$(cc-for-target) "mikktspace.c" "-O2" "-g" "-fPIC"
+ "-shared" "-o" "libmikktspace.so")))
+ (replace 'install
+ (lambda _
+ (install-file "mikktspace.h"
+ (string-append #$output "/include"))
+ (install-file "libmikktspace.so"
+ (string-append #$output "/lib")))))))
+ (home-page "http://www.mikktspace.com/")
+ (synopsis "Library for a common standard for tangent spaces")
+ (description
+ "This package provides a common standard tangent space library used in
+baking tools to produce normal maps.")
+ (license license:zlib))))
+
(define-public openshadinglanguage
(package
(name "openshadinglanguage")
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 6/9] gnu: Add minimp3.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
uUckbZ71qmGBkWj4hEcMhOw58F7F1o_LcUUSDVOHRKDSZcWPurEU26GSXr76QWaTR6KHbiJP4mHCdm5e09tLY-HmhKPX5IfAkfLYJgU2U5M=@protonmail.com
Empty Message
From 5b653ede7baa7afdf2a6ea226fbf4b130af61d0b Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:32:54 -0400
Subject: [PATCH 6/9] gnu: Add minimp3.

* gnu/packages/mp3.scm (minimp3): New variable.
---
gnu/packages/mp3.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm
index 4a8bdad711..275468d343 100644
--- a/gnu/packages/mp3.scm
+++ b/gnu/packages/mp3.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,6 +55,7 @@ (define-module (gnu packages mp3)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (guix build-system cmake))
@@ -247,6 +249,35 @@ (define-public taglib
;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
(license (list license:lgpl2.1 license:mpl1.1))))
+(define-public minimp3
+ ;; The latest commit is used as there is no release.
+ (let ((commit "afb604c06bc8beb145fecd42c0ceb5bda8795144")
+ (revision "0"))
+ (package
+ (name "minimp3")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/lieff/minimp3")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0brgrbij8swhp7lac21xnnrr5l0371lkr5vz6h9x0dbz1qq2xhsj"))))
+ ;; TODO: minimp3 has many more files for at least tests with scripts to
+ ;; run them, although it is unclear how to easily package them.
+ (build-system copy-build-system)
+ (arguments
+ '(#:install-plan
+ '(("minimp3.h" "include/")
+ ("minimp3_ex.h" "include/"))))
+ (home-page "https://github.com/lieff/minimp3")
+ (synopsis "Minimalistic MP3 decoder header library")
+ (description
+ "Minimp3 is a header-only MP3 decoder library.")
+ (license license:cc0))))
+
(define-public mp3info
(package
(name "mp3info")
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 7/9] gnu: Add neko.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
kO3r7nQwJlDuzeG0IqJBO5JZT-wQlswJurMckHCRe8gjC_Cpnbg8k-irxvbmmeZMQpFwu12kil5S56FYf74nyBkU96j8iwsjoPRPDfBTRvk=@protonmail.com
Empty Message
John Kehayias wrote 3 years ago
[PATCH 8/9] gnu: Add haxe.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
oLQQNxDCp_ElslhdzjxXn1hXKwKrIds1udg7TExbM2rFbMTObjVkVS2mQY_7_wbcK-3r_3AO-wrlEbX9ekCeLpHb2htf1fY4UJaJKAL8RSs=@protonmail.com
Empty Message
From 0f26e1d05ffa9c108e026cc68dfeef25ec76a239 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:43:32 -0400
Subject: [PATCH 8/9] gnu: Add haxe.

* gnu/packages/haxe.scm (haxelib-src): New variable.
(haxe): New variable.
---
gnu/packages/haxe.scm | 84 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)

Toggle diff (94 lines)
diff --git a/gnu/packages/haxe.scm b/gnu/packages/haxe.scm
index 6d8d9caca1..95de4c5e4b 100644
--- a/gnu/packages/haxe.scm
+++ b/gnu/packages/haxe.scm
@@ -105,3 +105,87 @@ (define-public neko
the VM, or as a Neko library to perform compile-and-run funtions for
interactive languages.")
(license license:expat)))
+
+(define haxelib-src
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/HaxeFoundation/haxelib")
+ ;; This should match the haxelib submodule in haxe.
+ (commit "4b27f91d8a4ff279d9903091680fee2c93a0d574")
+ ;; This repo includes some Haxe libs as well.
+ (recursive? #t)))
+ (sha256
+ (base32
+ "0mwrm6gxgclwziiprfiswmjbz6z3dnvdwl8gq3gaym18pvx4p3ny"))))
+
+(define-public haxe
+ (package
+ (name "haxe")
+ (version "4.2.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/HaxeFoundation/haxe")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0pl8vpyb7gl2yqjg85yc4zxq9c3ipvw4yrrpliaxs25ynrj3l51n"))))
+ (build-system dune-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ ;; Needs the haxelib sources for haxelib client
+ (add-after 'unpack 'copy-haxelib-src
+ (lambda _
+ (copy-recursively #$haxelib-src
+ "extra/haxelib_src")))
+ ;; Change the default directory for the haxelib package
+ ;; manager to be something writeable for a user.
+ (add-after 'copy-haxelib-src 'change-default-dir
+ (lambda _
+ (substitute* "extra/haxelib_src/src/haxelib/client/Main.hx"
+ (("'/usr/lib/haxe/\\$REPNAME'")
+ "Path.addTrailingSlash( getHomePath() ) + '.haxe/$REPNAME'"))))
+ (add-after 'unpack 'prefix
+ (lambda _
+ (substitute* "Makefile"
+ (("/usr/local")
+ (string-append #$output)))))
+ ;; Haxe uses a straight forward make, dune runtest, and make
+ ;; install process.
+ (replace 'build
+ (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+ (invoke "make" "-j" (if parallel-build?
+ (number->string (parallel-job-count))
+ "1"))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "dune" "runtest"))))
+ (replace 'install
+ (lambda _
+ (invoke "make" "install"))))))
+ (inputs (list libuv
+ mbedtls-apache
+ neko
+ ocaml-extlib
+ ocaml-luv
+ ocaml-ptmap
+ ocaml-sedlex
+ ocaml-sha
+ ocaml-xml-light
+ pcre
+ zlib))
+ (native-inputs (list ocaml-findlib camlp5))
+ (home-page "https://haxe.org/")
+ (synopsis "Multi-target universal programming language")
+ (description
+ "Haxe is a toolkit based on a modern, high level, static-typed
+programming language, a cross-compiler, a complete cross-platform standard
+library and ways to access each platform's native capabilities. This package
+includes the compiler and library manager.")
+ (license (list license:gpl2+ ; the compiler itself
+ license:expat)))) ; the standard library
+
--
2.37.1
John Kehayias wrote 3 years ago
[PATCH 9/9] gnu: Add hashlink.
(name . 56806@debbugs.gnu.org)(address . 56806@debbugs.gnu.org)
7qTaPCHNgqby8ax2a2rAvMFc7fTMsapBKAUMfeSwop-hCRs--vhp8SbCwOwXXpTmSwcf3n_98XDb1fmuzIsqBVfn3pMw-oGvwt3Tl3w_ghU=@protonmail.com
Empty Message
From fa69682cc2051d5058322228cc45e6e5a3ecfc55 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 27 Jul 2022 23:45:22 -0400
Subject: [PATCH 9/9] gnu: Add hashlink.

* gnu/packages/haxe.scm (hashlink): New variable.
---
gnu/packages/haxe.scm | 93 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)

Toggle diff (103 lines)
diff --git a/gnu/packages/haxe.scm b/gnu/packages/haxe.scm
index 95de4c5e4b..6876dbdc6f 100644
--- a/gnu/packages/haxe.scm
+++ b/gnu/packages/haxe.scm
@@ -189,3 +189,96 @@ (define-public haxe
(license (list license:gpl2+ ; the compiler itself
license:expat)))) ; the standard library
+(define-public hashlink
+ (package
+ (name "hashlink")
+ (version "1.12")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/HaxeFoundation/hashlink")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0i5f1mxpgjcdirx60kxrw0r0y15qh3j16a6fj8mzkq3k7j2hc982"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Remove bundled libraries (mainly used for Windows build).
+ (delete-file-recursively "include")
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ ;; Looks like there are tests with CMake, but there is confusion if this
+ ;; is a supported way to build on Linux. See, e.g.
+ ;; https://github.com/HaxeFoundation/hashlink/issues/397. Also, the
+ ;; CMake build requires running the library manager haxelib in the build
+ ;; process for the tests, likely requiring network access.
+ ;; TODO: Use cmake-build-system instead and enable tests?
+ (list #:tests? #f
+ #:make-flags
+ ;; The built hdll libraries need help finding libhl.so.
+ #~(list (string-append "LIBFLAGS=-Wl,-rpath=" #$output "/lib"))
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Don't try to build the (removed) bundled libraries pcre,
+ ;; minimp3, and mikktspace. Provide the approriate paths and
+ ;; linking options.
+ (add-after 'unpack 'use-system-libs
+ (lambda _
+ (substitute* "Makefile"
+ (("\\$\\{PCRE\\}") "")
+ (("-lpthread") "-lpthread -lpcre16")
+ (("include/minimp3")
+ (string-append #$(this-package-input "minimp3") "/include"))
+ (("include/mikktspace ")
+ (string-append #$(this-package-input "mikktspace") "/include "))
+ (("include/mikktspace/mikktspace.o") "")
+ (("-lpng") "-lpng -lmikktspace"))))
+ (replace 'configure
+ (lambda* _
+ (setenv "CC" #$(cc-for-target))
+ (setenv "PREFIX" #$output)))
+ (replace 'build
+ (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+ (apply invoke "make" "-j" (if parallel-build?
+ (number->string (parallel-job-count))
+ "1")
+ make-flags))))))
+ (inputs (list glu
+ haxe
+ libjpeg-turbo
+ libpng
+ libuv
+ libvorbis
+ mbedtls-apache
+ mikktspace
+ minimp3
+ openal
+ pcre
+ sdl2
+ sqlite
+ zlib))
+ (native-inputs (list pkg-config))
+ (home-page "https://hashlink.haxe.org/")
+ (synopsis "Virtual machine for the Haxe language")
+ (description
+ "HashLink (HL) is a virtual machine for the Haxe language. It can run
+bytecode produced by the Haxe compiler, or converted to C by HL. The HashLink runtime
+includes the following features:
+@itemize
+@item Fully compatible with the Haxe specification
+@item Support file I/O, regular expressions, network, etc.
+@item Unicode strings by default
+@item Mark-and-not-sweep Garbage Collector
+@item x86 and x86-64 HL/C compilation
+@item x86 and x86-64 HL/JIT compilation
+@end itemize
+
+While the standard HL runtime provides support for Haxe standard library,
+HashLink also provides several libraries that can optionally be used to build
+HL-specific applications. This includes the FMT library for compression and
+image support and SDL for mouse, keyboard, and game controller support,
+OpenGL, and more.")
+ (license license:expat)))
--
2.37.1
宋文武 wrote 3 years ago
Re: bug#56806: [PATCH 0/9] Add the Haxe language and tools.
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 56806-done@debbugs.gnu.org)
878ro5rf60.fsf@envs.net
John Kehayias <john.kehayias@protonmail.com> writes:

Toggle quote (8 lines)
> Hi Guix,
>
> Incoming is a patch series to add the Haxe [0] language and tools,
> including the language/VM Neko [1] that it is built with and the Haxe
> VM Hashlink [2]. It starts with OCaml that these are built on top of,
> and includes some other needed packages.
> [...]

Look great to me, pushed, thank you!

I only removed 'XML-Light' from the synopsis of ocaml-xml-light.
Closed
John Kehayias wrote 3 years ago
(name . 宋文武)(address . iyzsong@envs.net)(address . 56806-done@debbugs.gnu.org)
6F4NDYq2U2E6gO_NAmshvHrDu90tWvXTYPETJ_LJl1nLBJAdhK5KUvSNBZ1zUuVw4M7fWXatymHNzjvkDmCT07qd7mDRTSshxAugmuhWRQo=@protonmail.com
------- Original Message -------
On Wednesday, August 3rd, 2022 at 2:53 AM, 宋文武 wrote:


Toggle quote (4 lines)
> Look great to me, pushed, thank you!
>
> I only removed 'XML-Light' from the synopsis of ocaml-xml-light.

Wonderful, thanks!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 56806@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 56806
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help