| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (gnu packages haxe)
|
| 20 | #:use-module (gnu packages)
|
| 21 | #:use-module (gnu packages apr)
|
| 22 | #:use-module (gnu packages audio)
|
| 23 | #:use-module (gnu packages bdw-gc)
|
| 24 | #:use-module (gnu packages compression)
|
| 25 | #:use-module (gnu packages databases)
|
| 26 | #:use-module (gnu packages gl)
|
| 27 | #:use-module (gnu packages graphics)
|
| 28 | #:use-module (gnu packages gtk)
|
| 29 | #:use-module (gnu packages image)
|
| 30 | #:use-module (gnu packages libevent)
|
| 31 | #:use-module (gnu packages mp3)
|
| 32 | #:use-module (gnu packages ocaml)
|
| 33 | #:use-module (gnu packages pcre)
|
| 34 | #:use-module (gnu packages perl)
|
| 35 | #:use-module (gnu packages pkg-config)
|
| 36 | #:use-module (gnu packages sdl)
|
| 37 | #:use-module (gnu packages sqlite)
|
| 38 | #:use-module (gnu packages tls)
|
| 39 | #:use-module (gnu packages version-control)
|
| 40 | #:use-module (gnu packages web)
|
| 41 | #:use-module (gnu packages xiph)
|
| 42 | #:use-module (guix build-system cmake)
|
| 43 | #:use-module (guix build-system gnu)
|
| 44 | #:use-module (guix build-system dune)
|
| 45 | #:use-module (guix download)
|
| 46 | #:use-module (guix gexp)
|
| 47 | #:use-module (guix git-download)
|
| 48 | #:use-module ((guix licenses) #:prefix license:)
|
| 49 | #:use-module (guix packages)
|
| 50 | #:use-module (guix utils))
|
| 51 |
|
| 52 | (define-public neko
|
| 53 | (package
|
| 54 | (name "neko")
|
| 55 | (version "2.3.0")
|
| 56 | (source
|
| 57 | (origin
|
| 58 | (method git-fetch)
|
| 59 | (uri (git-reference
|
| 60 | (url "https://github.com/HaxeFoundation/neko")
|
| 61 | (commit (string-append
|
| 62 | "v"
|
| 63 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)))))
|
| 64 | (file-name (git-file-name name version))
|
| 65 | (sha256
|
| 66 | (base32 "1xgw646pghsjjbzd8qlaq17vq96swlrazpivrvyrhdj36vb3sci3"))))
|
| 67 | (build-system cmake-build-system)
|
| 68 | (arguments
|
| 69 | (list #:disallowed-references (list httpd)
|
| 70 | #:phases
|
| 71 | #~(modify-phases %standard-phases
|
| 72 | (add-after 'unpack 'prefix
|
| 73 | (lambda _
|
| 74 | (substitute* "CMakeLists.txt"
|
| 75 | (("\\\\\\$ORIGIN")
|
| 76 | (string-append #$output "/lib"))))))))
|
| 77 | (inputs (list apr
|
| 78 | apr-util
|
| 79 | gtk+-2
|
| 80 | libgc
|
| 81 | mbedtls-lts
|
| 82 | (list mariadb "dev")
|
| 83 | (list mariadb "lib")
|
| 84 | openssl
|
| 85 | pcre
|
| 86 | sqlite
|
| 87 | zlib))
|
| 88 | (native-inputs (list httpd
|
| 89 | git |
| 90 | pkg-config))
|
| 91 | (home-page "https://nekovm.org/")
|
| 92 | (synopsis "High-level dynamically typed programming language and virtual
|
| 93 | machine")
|
| 94 | (description
|
| 95 | "The Neko programming language is a high-level dynamically typed
|
| 96 | programming language. It can be used as an embedded scripting language. It
|
| 97 | has been designed to provide a common runtime for several different languages.
|
| 98 | You can easily extend the language with C libraries. You can also write
|
| 99 | generators from your own language to Neko and then use the Neko Runtime to
|
| 100 | compile, run, and access existing libraries.
|
| 101 |
|
| 102 | Neko has a compiler and a virtual machine. The Virtual Machine is both very
|
| 103 | lightweight and well optimized, so it can run very quickly. The VM can be
|
| 104 | easily embedded into any application and your libraries can be accessed using
|
| 105 | the C foreign function interface.
|
| 106 |
|
| 107 | You can use the compiler as standalone command line executable separate from
|
| 108 | the VM, or as a Neko library to perform compile-and-run functions for
|
| 109 | interactive languages.")
|
| 110 | (license license:expat)))
|
| 111 |
|
| 112 | (define haxelib-src
|
| 113 | (origin
|
| 114 | (method git-fetch)
|
| 115 | (uri (git-reference
|
| 116 | (url "https://github.com/HaxeFoundation/haxelib")
|
| 117 | |
| 118 | (commit "f17fffa97554b1bdba37750e3418051f017a5bc2")
|
| 119 | |
| 120 | (recursive? #t)))
|
| 121 | (sha256
|
| 122 | (base32
|
| 123 | "13ql042mxkybhw7di8c8cfq47p8snvadg9yglyif6b5k9ij85r6z"))))
|
| 124 |
|
| 125 | (define-public haxe
|
| 126 | (package
|
| 127 | (name "haxe")
|
| 128 | (version "4.3.7")
|
| 129 | (source
|
| 130 | (origin
|
| 131 | (method git-fetch)
|
| 132 | (uri (git-reference
|
| 133 | (url "https://github.com/HaxeFoundation/haxe")
|
| 134 | (commit version)))
|
| 135 | (file-name (git-file-name name version))
|
| 136 | (sha256
|
| 137 | (base32 "1w008l6112xr0nk5jjgi8mz1ifz6vxln1qbac1czp0kl5n976fqm"))))
|
| 138 | (build-system dune-build-system)
|
| 139 | (arguments
|
| 140 | (list #:phases
|
| 141 | #~(modify-phases %standard-phases
|
| 142 | |
| 143 | (add-after 'unpack 'copy-haxelib-src
|
| 144 | (lambda _
|
| 145 | (copy-recursively #$haxelib-src
|
| 146 | "extra/haxelib_src")))
|
| 147 | |
| 148 | |
| 149 | (add-after 'copy-haxelib-src 'change-default-dir
|
| 150 | (lambda _
|
| 151 | (substitute* "extra/haxelib_src/src/haxelib/client/Main.hx"
|
| 152 | (("'/usr/lib/haxe/\\$REPNAME'")
|
| 153 | "Path.addTrailingSlash( getHomePath() ) + '.haxe/$REPNAME'"))))
|
| 154 | (add-after 'unpack 'prefix
|
| 155 | (lambda _
|
| 156 | (substitute* "Makefile"
|
| 157 | (("/usr/local")
|
| 158 | (string-append #$output)))))
|
| 159 | |
| 160 | |
| 161 | (replace 'build
|
| 162 | (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
|
| 163 | (setenv "CC" #$(cc-for-target))
|
| 164 | (invoke "make" "-j" (if parallel-build?
|
| 165 | (number->string (parallel-job-count))
|
| 166 | "1"))))
|
| 167 | (replace 'check
|
| 168 | (lambda* (#:key tests? #:allow-other-keys)
|
| 169 | (when tests?
|
| 170 | (invoke "dune" "runtest"))))
|
| 171 | (replace 'install
|
| 172 | (lambda _
|
| 173 | (invoke "make" "install"))))))
|
| 174 | (inputs (list libuv
|
| 175 | mbedtls-lts
|
| 176 | neko
|
| 177 | ocaml-camlp-streams
|
| 178 | ocaml-extlib
|
| 179 | ocaml-luv
|
| 180 | ocaml-ptmap
|
| 181 | ocaml-sedlex-2
|
| 182 | ocaml-sha
|
| 183 | ocaml-xml-light
|
| 184 | pcre2
|
| 185 | zlib))
|
| 186 | (native-inputs (list ocaml-findlib camlp5))
|
| 187 | (home-page "https://haxe.org/")
|
| 188 | (synopsis "Multi-target universal programming language")
|
| 189 | (description
|
| 190 | "Haxe is a toolkit based on a modern, high level, static-typed
|
| 191 | programming language, a cross-compiler, a complete cross-platform standard
|
| 192 | library and ways to access each platform's native capabilities. This package
|
| 193 | includes the compiler and library manager.")
|
| 194 | (license (list license:gpl2+ |
| 195 | license:expat)))) |
| 196 |
|
| 197 | (define-public hashlink
|
| 198 | (package
|
| 199 | (name "hashlink")
|
| 200 | (version "1.15")
|
| 201 | (source
|
| 202 | (origin
|
| 203 | (method git-fetch)
|
| 204 | (uri (git-reference
|
| 205 | (url "https://github.com/HaxeFoundation/hashlink")
|
| 206 | (commit version)))
|
| 207 | (file-name (git-file-name name version))
|
| 208 | (sha256
|
| 209 | (base32 "1c6cpbijzprssy382vyz6mim6m2q3k3mw8pj3q2c2sv76xygwnlx"))
|
| 210 | (modules '((guix build utils)))
|
| 211 | (snippet
|
| 212 | '(begin
|
| 213 | |
| 214 | (delete-file-recursively "include")
|
| 215 | #t))))
|
| 216 | (build-system gnu-build-system)
|
| 217 | (arguments
|
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | (list #:tests? #f
|
| 225 | #:make-flags
|
| 226 | |
| 227 | #~(list (string-append "LIBFLAGS=-Wl,-rpath=" #$output "/lib"))
|
| 228 | #:phases
|
| 229 | #~(modify-phases %standard-phases
|
| 230 | |
| 231 | |
| 232 | |
| 233 | (add-after 'unpack 'use-system-libs
|
| 234 | (lambda _
|
| 235 | (substitute* "Makefile"
|
| 236 | (("\\$\\{PCRE\\}") "")
|
| 237 | (("-lpthread") "-lpthread -lpcre2-16")
|
| 238 | (("include/minimp3")
|
| 239 | (string-append #$(this-package-input "minimp3") "/include"))
|
| 240 | (("include/mikktspace ")
|
| 241 | (string-append #$(this-package-input "mikktspace") "/include "))
|
| 242 | (("include/meshoptimizer ")
|
| 243 | (string-append #$(this-package-input "meshoptimizer") "/include "))
|
| 244 | (("-I include/vhacd")
|
| 245 | (string-append "-I " #$(this-package-input "vhacd") "/include"))
|
| 246 | (("include/mikktspace/mikktspace.o") "")
|
| 247 | (("include/meshoptimizer/.*.o ") "")
|
| 248 | (("include/meshoptimizer/vcacheanalyzer.o") "")
|
| 249 | (("-lpng") "-lpng -lmikktspace"))))
|
| 250 | (replace 'configure
|
| 251 | (lambda* _
|
| 252 | (setenv "CC" #$(cc-for-target))
|
| 253 | (setenv "PREFIX" #$output)))
|
| 254 | (replace 'build
|
| 255 | (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
|
| 256 | (apply invoke "make" "-j" (if parallel-build?
|
| 257 | (number->string (parallel-job-count))
|
| 258 | "1")
|
| 259 | make-flags))))))
|
| 260 | (inputs (list glu
|
| 261 | haxe
|
| 262 | libjpeg-turbo
|
| 263 | libpng
|
| 264 | libuv
|
| 265 | libvorbis
|
| 266 | mbedtls-lts
|
| 267 | meshoptimizer
|
| 268 | mikktspace
|
| 269 | minimp3
|
| 270 | openal
|
| 271 | pcre2
|
| 272 | sdl2
|
| 273 | sqlite
|
| 274 | vhacd
|
| 275 | zlib))
|
| 276 | (native-inputs (list pkg-config))
|
| 277 | (home-page "https://hashlink.haxe.org/")
|
| 278 | (synopsis "Virtual machine for the Haxe language")
|
| 279 | (description
|
| 280 | "HashLink (HL) is a virtual machine for the Haxe language. It can run
|
| 281 | bytecode produced by the Haxe compiler, or converted to C by HL. The HashLink runtime
|
| 282 | includes the following features:
|
| 283 | @itemize
|
| 284 | @item Fully compatible with the Haxe specification
|
| 285 | @item Support file I/O, regular expressions, network, etc.
|
| 286 | @item Unicode strings by default
|
| 287 | @item Mark-and-not-sweep Garbage Collector
|
| 288 | @item x86 and x86-64 HL/C compilation
|
| 289 | @item x86 and x86-64 HL/JIT compilation
|
| 290 | @end itemize
|
| 291 |
|
| 292 | While the standard HL runtime provides support for Haxe standard library,
|
| 293 | HashLink also provides several libraries that can optionally be used to build
|
| 294 | HL-specific applications. This includes the FMT library for compression and
|
| 295 | image support and SDL for mouse, keyboard, and game controller support,
|
| 296 | OpenGL, and more.")
|
| 297 | (license license:expat)))
|