neko: 2.1.0 -> 2.2.0

This commit is contained in:
volth 2017-12-20 17:55:43 +00:00 committed by Orivej Desh
parent 30b7624a08
commit e19f22c55a
2 changed files with 7 additions and 92 deletions

View File

@ -1,50 +1,24 @@
{ stdenv, fetchurl, fetchpatch, boehmgc, zlib, sqlite, pcre, cmake, pkgconfig
, git, apacheHttpd, apr, aprutil, mariadb, mbedtls, openssl, pkgs, gtk2
{ stdenv, fetchurl, boehmgc, zlib, sqlite, pcre, cmake, pkgconfig
, git, apacheHttpd, apr, aprutil, mariadb, mbedtls, openssl, pkgs, gtk2, libpthreadstubs
}:
stdenv.mkDerivation rec {
name = "neko-${version}";
version = "2.1.0";
version = "2.2.0";
src = fetchurl {
url = "http://nekovm.org/media/neko-${version}-src.tar.gz";
sha256 = "15ng9ad0jspnhj38csli1pvsv3nxm75f0nlps7i10194jvzdb4qc";
sha256 = "1qv47zaa0vzhjlq5wb71627n7dbsxpc1gqpg0hsngjxnbnh1q46g";
};
# Patches backported with reference to https://github.com/HaxeFoundation/neko/issues/131
# They can probably be removed when bumping to next version
patches = [
(fetchpatch {
url = "https://github.com/HaxeFoundation/neko/commit/"
+ "a8c71ad97faaccff6c6e9e09eba2d5efd022f8dc.patch";
sha256 = "0mnx15cdjs8mnl01mhc9z2gpzh4d1q0ygqnjackrqxz6x235ydyp";
})
(fetchpatch {
url = "https://github.com/HaxeFoundation/neko/commit/"
+ "fe87462d9c7a6ee27e28f5be5e4fc0ac87b34574.patch";
sha256 = "1jbmq6j32vg3qv20dbh82cp54886lgrh7gkcqins8a2y4l4dl3sc";
})
# https://github.com/HaxeFoundation/neko/pull/165
(fetchpatch {
url = "https://github.com/HaxeFoundation/neko/commit/"
+ "c6d9c6d796200990b3b6a53a4dc716c9192398e6.patch";
sha256 = "1pq0qhhb9gbhc3zbgylwp0amhwsz0q0ggpj6v2xgv0hfy7d63rcd";
})
# Glibc 2.26 no longer has xlocale.h, patch backported from upstream commit
# e286c8f3301fa443255a3101d14b7392467051b8.
./xlocale-fix.patch
];
nativeBuildInputs = [ cmake pkgconfig git ];
buildInputs =
[ boehmgc zlib sqlite pcre cmake pkgconfig git apacheHttpd apr aprutil
mariadb.client mbedtls openssl ]
[ boehmgc zlib sqlite pcre apacheHttpd apr aprutil
mariadb.client mbedtls openssl libpthreadstubs ]
++ stdenv.lib.optional stdenv.isLinux gtk2
++ stdenv.lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.Carbon];
cmakeFlags = [ "-DRUN_LDCONFIG=OFF" ];
prePatch = ''
sed -i -e '/allocated = strdup/s|"[^"]*"|"'"$out/lib/neko:$out/bin"'"|' vm/load.c
'';
checkPhase = ''
bin/neko bin/test.n

View File

@ -1,59 +0,0 @@
commit 31d3ac3d691b2a1b07991e67302fd52b0f409cac
Author: Andy Li <andy@onthewings.net>
Date: Thu Jul 13 13:23:33 2017 +0800
include xlocale.h only if it is available since it is removed in recent glibc
see: https://bugzilla.redhat.com/show_bug.cgi?id=1464244
(Backported from e286c8f3301fa443255a3101d14b7392467051b8)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8de1702..d64cab9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.8.7)
+include(CheckIncludeFile)
project(neko C)
set(CMAKE_OSX_ARCHITECTURES x86_64)
@@ -48,6 +49,8 @@ set(NEKO_VERSION_MAJOR 2)
set(NEKO_VERSION_MINOR 1)
set(NEKO_VERSION_PATCH 0)
+check_include_file(xlocale.h HAVE_XLOCALE_H)
+
configure_file (
"${CMAKE_SOURCE_DIR}/vm/neko.h.in"
"${CMAKE_BINARY_DIR}/neko.h"
diff --git a/libs/std/sys.c b/libs/std/sys.c
index 8003d41..ae0cfee 100644
--- a/libs/std/sys.c
+++ b/libs/std/sys.c
@@ -41,7 +41,11 @@
# include <sys/time.h>
# include <sys/times.h>
# include <sys/wait.h>
+#ifdef HAVE_XLOCALE_H
# include <xlocale.h>
+#else
+# include <locale.h>
+#endif
#endif
#ifdef NEKO_MAC
diff --git a/vm/neko.h.in b/vm/neko.h.in
index bb9ec1b..147ecce 100644
--- a/vm/neko.h.in
+++ b/vm/neko.h.in
@@ -88,6 +88,8 @@
# include <stdint.h>
#endif
+#cmakedefine HAVE_XLOCALE_H
+
#define NEKO_VERSION_MAJOR @NEKO_VERSION_MAJOR@
#define NEKO_VERSION_MINOR @NEKO_VERSION_MINOR@
#define NEKO_VERSION_PATCH @NEKO_VERSION_PATCH@