debian/0000755000000000000000000000000012170262172007166 5ustar debian/nekotools.10000644000000000000000000000104711564005221011263 0ustar .TH NEKOTOOLS 1 "Oct 31, 2006" "" .SH NAME nekotools \- tools for running Neko programs. .SH SYNOPSIS .B nekotools [options] .SH OPTIONS .TP .B server start a neko web server. The server can be configured through .IR "http://localhost:2000/server:config" . .TP .BI "boot " file.n build an standalone executable. .SH DESCRIPTION .B nekotools is a command-line tool to create executables from Neko bytecode. .SH AUTHOR Neko is written by Nicolas Cannasse for Motion-Twin. .SH SEE ALSO .BR "neko" (1), .BR "nekoc" (1). .SH WEB .IR "http://nekovm.org" . debian/neko.lintian-overrides0000644000000000000000000000045211564005221013477 0ustar # Lintian overrides for neko. # # The dynamic modules /usr/lib/neko/*.ndll are not stripped because they # are created as concatenations of the virtual machine bootloader and # some bytecode, which makes stripping impossible (cf. OCaml Packaging # Policy). neko binary: unstripped-binary-or-object debian/neko.examples0000644000000000000000000000003411564005221011653 0ustar bin/*.n src/tools/test.neko debian/neko.conf0000644000000000000000000000014411564005221010764 0ustar AddHandler neko-handler .n DirectoryIndex index.n debian/rules0000755000000000000000000000372212170261313010246 0ustar #!/usr/bin/make -f ## debian/rules for neko. ## General compile options. cflags := \ $(shell dpkg-buildflags --get CFLAGS) \ -Wall -fPIC -I vm -DCOMPACT_TABLE -D_GNU_SOURCE -I libs/common ldflags := \ $(shell dpkg-buildflags --get LDFLAGS) \ -pthread ## Both AMD64 and all kFreeBSDs seem to have problems with the type ## punning used in the Neko source. ifeq (amd64,$(DEB_HOST_ARCH)) cflags += -fno-strict-aliasing endif ifeq (kfreebsd,$(DEB_HOST_ARCH_OS)) cflags += -fno-strict-aliasing endif build: build-stamp build-arch: build-stamp build-indep: build-stamp build-stamp: dh_testdir make CFLAGS="$(cflags)" EXTFLAGS="$(ldflags)" touch $@ debian := $(CURDIR)/debian overrides := usr/share/lintian/overrides binary-indep: build dh_testdir dh_testroot dh_install -plibapache2-mod-neko -pneko-dev dh_apache2 -plibapache2-mod-neko -e dh_installdocs -plibapache2-mod-neko -pneko-dev dh_installchangelogs -plibapache2-mod-neko -pneko-dev CHANGES dh_compress -plibapache2-mod-neko -pneko-dev dh_fixperms -plibapache2-mod-neko -pneko-dev dh_installdeb -plibapache2-mod-neko -pneko-dev dh_gencontrol -plibapache2-mod-neko -pneko-dev dh_md5sums -plibapache2-mod-neko -pneko-dev dh_builddeb -plibapache2-mod-neko -pneko-dev binary-arch: build dh_testdir dh_testroot dh_install -a mkdir -p $(debian)/neko/$(overrides) cp $(debian)/neko.lintian-overrides $(debian)/neko/$(overrides)/neko dh_installdocs -a dh_installexamples -a dh_installchangelogs -a CHANGES dh_installman -pneko debian/neko.1 debian/nekoc.1 debian/nekotools.1 dh_strip -a -Xnekoc -Xnekotools dh_compress -a dh_fixperms -a dh_makeshlibs dh_installdeb -a dh_shlibdeps -a find $(debian) -name '*.ndll' -exec chmod -x '{}' ';' find $(debian) -name '*.neko' -exec chmod -x '{}' ';' dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch clean: dh_testdir dh_testroot -rm -f *-stamp make clean dh_clean .PHONY: binary binary-indep binary-arch build clean debian/neko.load0000644000000000000000000000006411564005221010757 0ustar LoadModule neko_module /usr/lib/neko/mod_neko2.ndll debian/neko.10000644000000000000000000000067011564005221010203 0ustar .TH NEKO 1 "Oct 31, 2006" "" .SH NAME neko \- Neko virtual machine. .SH SYNOPSIS .B neko .I file.n .SH DESCRIPTION .B neko is a command-line tool for running Neko bytecode. .PP Neko can be called from the Apache2 web server via the module mod_neko2 contained in package libapache2-mod-neko. .SH AUTHOR Neko is written by Nicolas Cannasse for Motion-Twin. .SH SEE ALSO .BR "nekoc" (1), .BR "nekotools" (1). .SH WEB .IR "http://nekovm.org" . debian/libapache2-mod-neko.postinst0000644000000000000000000000150312170261250014467 0ustar #!/bin/sh set -e ENABLE2=/usr/sbin/a2enmod case "$1" in configure) ## Register with Apache 2, if present. if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then . /usr/share/apache2/apache2-maintscript-helper ## mod_neko requires the prefork MPM. if [ "$(a2query -M)" != prefork ]; then if apache2_switch_mpm prefork; then apache2_invoke enmod neko else apache2_msg err "Could not switch to prefork; not enabling mod_neko." fi else apache2_invoke enmod neko fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 esac #DEBHELPER# exit 0 debian/libapache2-mod-neko.apache20000644000000000000000000000005212170260323014105 0ustar mod debian/neko.conf mod debian/neko.load debian/copyright0000644000000000000000000000245112165554553011136 0ustar This is the Debian packaging of the Neko virtual machine, compiled by Jens Peter Secher . The original source was downloaded from http://nekovm.org. ---[ Neko License begin ]--- Copyright (C)2005-2013 Haxe Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---[ Neko License end ]--- debian/nekoc.10000644000000000000000000000056411564005221010350 0ustar .TH NEKOC 1 "Oct 31, 2006" "" .SH NAME nekoc \- compile Neko programs to Neko bytecode. .SH SYNOPSIS .B nekoc .I file.neko .SH DESCRIPTION .B nekoc is a command-line compiler which compiles Neko programs into Neko bytecode. .SH AUTHOR Neko is written by Nicolas Cannasse for Motion-Twin. .SH SEE ALSO .BR "neko" (1), .BR "nekotools" (1). .SH WEB .IR "http://nekovm.org" . debian/neko-dev.install0000644000000000000000000000005111564005221012256 0ustar bin/*.so usr/lib vm/neko*.h usr/include debian/source/0000755000000000000000000000000011564005221010462 5ustar debian/source/format0000644000000000000000000000001411564005221011670 0ustar 3.0 (quilt) debian/libneko0.install0000644000000000000000000000002511564005221012252 0ustar bin/*.so.* usr/lib debian/patches/0000755000000000000000000000000012165552015010617 5ustar debian/patches/soname-strip.diff0000644000000000000000000000324112165552015014072 0ustar ## soname-strip.diff by Jens Peter Secher ## ## Make it possible to override the stripping of the neko executable ## prior to building rest of compiler tools and introduce a proper ## SONAME for libneko. Index: b/Makefile =================================================================== --- a/Makefile +++ b/Makefile @@ -14,11 +14,13 @@ CFLAGS = -Wall -O3 -fPIC -fomit-frame-pointer -I vm -D_GNU_SOURCE -I libs/common EXTFLAGS = -pthread -MAKESO = $(CC) -shared -Wl,-Bsymbolic -LIBNEKO_NAME = libneko.so +MAJOR=0 +MINOR=1 +MAKESO = $(CC) -shared -Wl,-soname,libneko.so.${MAJOR} +LIBNEKO_NAME = libneko.so.${MAJOR}.${MINOR} LIBNEKO_LIBS = -ldl -lgc -lm NEKOVM_FLAGS = -Lbin -lneko -STD_NDLL_FLAGS = ${NEKOVM_FLAGS} -lrt +STD_NDLL_FLAGS = -lm -lrt INSTALL_FLAGS = NEKO_EXEC = LD_LIBRARY_PATH=../bin:${LD_LIBRARY_PATH} NEKOPATH=../boot:../bin ../bin/neko @@ -70,6 +72,8 @@ -mkdir bin 2>/dev/null libneko: bin/${LIBNEKO_NAME} + ln -sf ${LIBNEKO_NAME} bin/libneko.so.${MAJOR} + ln -sf libneko.so.${MAJOR} bin/libneko.so libs: (cd src; ${NEKO_EXEC} nekoc tools/install.neko) @@ -108,6 +112,7 @@ clean: rm -rf bin/${LIBNEKO_NAME} ${LIBNEKO_OBJECTS} ${VM_OBJECTS} + rm -rf bin/libneko.so* rm -rf bin/neko bin/nekoc bin/nekoml bin/nekotools rm -rf bin/std bin/*.ndll bin/*.n libs/*/*.o rm -rf src/*.n src/neko/*.n src/nekoml/*.n src/tools/*.n @@ -115,6 +120,7 @@ install: cp bin/${LIBNEKO_NAME} ${INSTALL_PREFIX}/lib + ln -sf ${LIBNEKO_NAME} ${INSTALL_PREFIX}/lib/libneko.so.${MAJOR} cp bin/neko bin/nekoc bin/nekotools bin/nekoml bin/nekoml.std ${INSTALL_PREFIX}/bin -mkdir ${INSTALL_PREFIX}/lib/neko cp bin/*.ndll ${INSTALL_PREFIX}/lib/neko debian/patches/include-and-link.diff0000644000000000000000000000762312165544051014600 0ustar ## include-and-link.diff by Jens Peter Secher ## ## Use the right include directories, shared libraries and cflags. ## Use -rpath to force search in /usr/lib/neko. Index: b/src/tools/install.neko =================================================================== --- a/src/tools/install.neko +++ b/src/tools/install.neko @@ -43,11 +43,6 @@ // LIBS DATAS libs = { - mod_neko => { - src => $array("../../vm/stats","mod_neko","cgi"), - inc => "httpd.h", - incname => "Apache 1.3.x" - }, mod_neko2 => { src => $array("../../vm/stats","mod_neko","cgi"), inc => $array("httpd.h","apr.h"), @@ -59,15 +54,8 @@ mysql => { src => $array("mysql"), inc => "mysql.h", - incname => "MySQL 4.+" - lib => "libmysqlclient_r.a", - lparams => "-lz -lssl" - }, - mysql5 => { - src => $array("../common/sha1","../common/socket","my_proto/my_proto","my_proto/my_api","mysql"), - inc => $array(), - realdir => "mysql", - cflags => "-Imy_proto -I../common", + incname => "MySQL" + lparams => "-lmysqlclient" }, regexp => { src => $array("regexp"), @@ -92,13 +80,7 @@ inc => switch system { "Mac" => "Carbon.h" default => "gtk/gtk.h" }, incname => switch system { "Mac" => "Carbon" default => "GTK+2.0" }, cflags => switch system { "Mac" => "" default => "`pkg-config --cflags gtk+-2.0`" }, - lparams => switch system { "Mac" => "-framework Carbon" default => "`pkg-config --libs gtk+-2.0` -lgthread-2.0" }, - }, - mod_tora => { - src => $array("../common/socket","protocol","mod_tora"), - inc => "httpd.h", - incname => "Apache 1.3.x", - cflags => "-I../common", + lparams => switch system { "Mac" => "-framework Carbon" default => "-lgthread-2.0" }, }, mod_tora2 => { src => $array("../common/socket","protocol","mod_tora"), @@ -121,15 +103,14 @@ // PLATFORM -cflags = "-O3 -fPIC"; +cflags = "-O3 -DEAPI -fPIC -pthread $(pkg-config --cflags apr-1)"; if( system == "Linux" ) cflags += " -pthread"; cc = getenv("CC"); if( cc == null ) cc = "gcc"; linkcmd = switch system { "BSD" => "ld" default => cc }; -linkneko = "-lneko"; linkoptions = switch system { "Mac" => "-bundle -undefined dynamic_lookup -L../../bin" - default => "-shared -L../../bin -pthread" + default => "-shared -L../../bin -pthread -lneko" }; nekovm = switch system { "Windows" => "..\\bin\\neko" default => "../bin/neko" }; @@ -142,40 +123,16 @@ search_includes = function(isap2) { var inc1 = $array( "/usr/include", - "/usr/local/include/mysql", "/usr/include/mysql", - "/usr/local/include", "/usr/include/gtk-2.0", - "/opt/local/include", - "/opt/local/include/mysql", - "/opt/local/include/mysql5/mysql", "/Developer/Headers/FlatCarbon", ); var inc2; - if( isap2 ) - inc2 = $array( - "/usr/local/apache2/include", - "/usr/include/apache2", - "/opt/local/apache2/include", - "/usr/include/apr-1", - "/usr/include/apr-1.0", - "/usr/include/apr-0", - "/usr/local/include/apr-1", - "/usr/local/include/apr-1.0", - "/usr/local/include/apr-0", - "/opt/local/include/apr-1", - "/opt/local/include/apr-1.0", - "/opt/local/include/apr-0" - ); - else - inc2 = $array( - "/usr/apache/include", - "/usr/include/apache-1.3", - "/usr/include/httpd", - "/opt/local/include/apache", - "/opt/local/include/httpd", - "/usr/local/apache/include" - ); + inc2 = $array( + "/usr/include/apache2", + "/usr/include/apr-1", + "/usr/include/apr-1.0", + ); return $aconcat($array(inc1,inc2)); } @@ -185,11 +142,6 @@ cwd, "/usr/lib", "/usr/lib/mysql", - "/usr/local/lib", - "/usr/local/lib/mysql", - "/opt/local/lib", - "/opt/local/lib/mysql", - "/opt/local/lib/mysql5/mysql", ); exec = function(cmd) { @@ -303,8 +255,6 @@ dir[0] + ".o" })); var opt = linkoptions; - if( target != "mod_tora" && target != "mod_tora2" ) - opt += " "+linkneko; var cmd = linkcmd+" "+make("-L",libraries); var out = " -o ../../bin/"+target+".ndll "; exec(cmd+out+files+params1+params2+" "+opt); debian/patches/kfreebsd-compile-fix.diff0000644000000000000000000000311512165544256015460 0ustar Description: Fix build failure on GNU/kFreeBSD. Use NEKO_POSIX instead of NEKO_LINUX. Author: Cyril Brulebois Bug-Debian: http://bugs.debian.org/543995 Reviewed-by: Jens Peter Secher Forwarded: yes Last-Update: 2009-09-09 Index: b/libs/ui/ui.c =================================================================== --- a/libs/ui/ui.c +++ b/libs/ui/ui.c @@ -33,7 +33,7 @@ # define UIEvent 0xFFFFAA00 # define eCall 0x0 enum { pFunc = 'func' }; -#elif defined(NEKO_LINUX) +#elif defined(NEKO_POSIX) # include # include # include @@ -57,7 +57,7 @@ HWND wnd; #elif defined(NEKO_MAC) pthread_t tid; -#elif defined(NEKO_LINUX) +#elif defined(NEKO_POSIX) pthread_t tid; pthread_mutex_t lock; #endif @@ -103,7 +103,7 @@ return 0; } -#elif defined(NEKO_LINUX) +#elif defined(NEKO_POSIX) static gint onSyncCall( gpointer data ) { value *r = (value*)data; @@ -147,7 +147,7 @@ data.tid = pthread_self(); EventTypeSpec ets = { UIEvent, eCall }; InstallEventHandler(GetApplicationEventTarget(),NewEventHandlerUPP(handleEvents),1,&ets,0,0); -# elif defined(NEKO_LINUX) +# elif defined(NEKO_POSIX) g_thread_init(NULL); gdk_threads_init(); gtk_init(NULL,NULL); @@ -241,7 +241,7 @@ SetEventParameter(e,pFunc,typeVoidPtr,sizeof(void*),&r); PostEventToQueue(GetMainEventQueue(),e,kEventPriorityStandard); ReleaseEvent(e); -# elif defined(NEKO_LINUX) +# elif defined(NEKO_POSIX) // the lock should not be needed because GTK is MT-safe // however the GTK lock mechanism is a LOT slower than // using a pthread_mutex debian/patches/kfreebsd-executable-path.diff0000644000000000000000000000247212165544300016312 0ustar Description: Make executable_path() work on kFreeBSD Fix for finding executable_path() on kFreeBSD, which only seemed to work when invoked from bash, thanks to Roman Neuhauser. Author: Jens Peter Secher Forwarded: no Last-Update: 2010-02-13 Index: b/vm/main.c =================================================================== --- a/vm/main.c +++ b/vm/main.c @@ -35,6 +35,9 @@ #ifdef NEKO_POSIX # include #endif +#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) +# include +#endif #ifdef NEKO_STANDALONE extern void neko_standalone_init(); @@ -62,10 +65,24 @@ if ( _NSGetExecutablePath(path, &path_len) ) return NULL; return path; +#elif defined(__FreeBSD_kernel__) || defined (__FreeBSD__) + int mib[4]; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = -1; + static char path[1024]; + size_t length = sizeof(path); + sysctl(mib, 4, path, &length, NULL, 0); + if( length < 0 || length >= 1024 ) { + return NULL; + } + path[length] = '\0'; + return path; #else - static char path[200]; + static char path[1024]; int length = readlink("/proc/self/exe", path, sizeof(path)); - if( length < 0 || length >= 200 ) { + if( length < 0 || length >= 1024 ) { char *p = getenv(" "); // for upx if( p == NULL ) p = getenv("_"); debian/patches/series0000644000000000000000000000017112165545646012047 0ustar soname-strip.diff include-and-link.diff kfreebsd-compile-fix.diff kfreebsd-executable-path.diff hurd.diff apache2.4.diff debian/patches/apache2.4.diff0000644000000000000000000001007012165550741013120 0ustar Index: b/libs/mod_tora/mod_tora.c =================================================================== --- a/libs/mod_tora/mod_tora.c +++ b/libs/mod_tora/mod_tora.c @@ -50,7 +50,7 @@ # define ap_palloc apr_palloc # define LOG_SUCCESS APR_SUCCESS, # define REDIRECT HTTP_MOVED_TEMPORARILY -# define REMOTE_ADDR(c) c->remote_addr->sa.sin.sin_addr +# define REMOTE_ADDR(c) c->client_addr->sa.sin.sin_addr #else # define LOG_SUCCESS # define REMOTE_ADDR(c) c->remote_addr.sin_addr @@ -148,7 +148,7 @@ do_print(c,"Error : ",8); do_print(c,msg,(int)strlen(msg)); } else - ap_log_rerror(__FILE__, __LINE__, APLOG_WARNING, LOG_SUCCESS c->r, "[mod_tora] %s", msg); + ap_log_rerror(APLOG_MARK, APLOG_WARNING, LOG_SUCCESS c->r, "[mod_tora] %s", msg); } static void log_error( mcontext *c, const char *msg ) { @@ -232,7 +232,7 @@ if( config.proxy_mode ) { const char *xff = ap_table_get(r->headers_in,"X-Forwarded-For"); if( xff == NULL ) - infos.client_ip = r->connection->remote_ip; + infos.client_ip = r->connection->client_ip; else { char tmp; char *xend = (char*)xff + strlen(xff) - 1; @@ -319,7 +319,7 @@ else if( strcmp(code,"PORT_MAX") == 0 ) config.port_max = value; else if( strcmp(code,"POST_SIZE") == 0 ) config.max_post_size = value; else if( strcmp(code,"PROXY_MODE") == 0 ) config.proxy_mode = value; - else ap_log_error(__FILE__,__LINE__,APLOG_WARNING,LOG_SUCCESS cmd->server,"Unknown ModTora configuration command '%s'",code); + else ap_log_error(APLOG_MARK,APLOG_WARNING,LOG_SUCCESS cmd->server,"Unknown ModTora configuration command '%s'",code); free(code); return NULL; } Index: b/libs/mod_neko/mod_neko.c =================================================================== --- a/libs/mod_neko/mod_neko.c +++ b/libs/mod_neko/mod_neko.c @@ -44,7 +44,7 @@ #define apache_error(level,request,message) \ ap_rprintf(request,"Error : %s",message); \ - ap_log_rerror(__FILE__, __LINE__, level, LOG_SUCCESS request, "[mod_neko error] %s", message) + ap_log_rerror(APLOG_MARK, level, LOG_SUCCESS request, "[mod_neko error] %s", message) typedef struct cache { value file; @@ -385,7 +385,7 @@ if( exc ) { buffer b = alloc_buffer(NULL); val_buffer(b,exc); - ap_log_error(__FILE__,__LINE__,APLOG_WARNING,LOG_SUCCESS serv,"Failed to preload module '%s' : %s",name,val_string(buffer_to_string(b))); + ap_log_error(APLOG_MARK,APLOG_WARNING,LOG_SUCCESS serv,"Failed to preload module '%s' : %s",name,val_string(buffer_to_string(b))); } neko_vm_select(NULL); } @@ -415,7 +415,7 @@ else if( strcmp(code,"STATS") == 0 ) config.use_stats = value; else if( strcmp(code,"PRIM_STATS") == 0 ) config.use_prim_stats = value; else if( strcmp(code,"PRELOAD") == 0 ) preload_module(args,cmd->server); - else ap_log_error(__FILE__,__LINE__,APLOG_WARNING,LOG_SUCCESS cmd->server,"Unknown ModNeko configuration command '%s'",code); + else ap_log_error(APLOG_MARK,APLOG_WARNING,LOG_SUCCESS cmd->server,"Unknown ModNeko configuration command '%s'",code); free(code); return NULL; } Index: b/libs/mod_neko/cgi.c =================================================================== --- a/libs/mod_neko/cgi.c +++ b/libs/mod_neko/cgi.c @@ -572,9 +572,9 @@ mcontext *c = CONTEXT(); val_check(message, string); #ifdef APACHE_2_X - ap_log_rerror(__FILE__, __LINE__, APLOG_NOTICE, APR_SUCCESS, c->r, "[mod_neko] %s", val_string(message)); + ap_log_rerror(APLOG_MARK, APLOG_NOTICE, APR_SUCCESS, c->r, "[mod_neko] %s", val_string(message)); #else - ap_log_rerror(__FILE__, __LINE__, APLOG_NOTICE, c->r, "[mod_neko] %s", val_string(message)); + ap_log_rerror(APLOG_MARK, APLOG_NOTICE, c->r, "[mod_neko] %s", val_string(message)); #endif return val_null; } Index: b/libs/mod_neko/mod_neko.h =================================================================== --- a/libs/mod_neko/mod_neko.h +++ b/libs/mod_neko/mod_neko.h @@ -60,7 +60,7 @@ #ifdef STANDARD20_MODULE_STUFF # define APACHE_2_X -# define REMOTE_ADDR(c) c->remote_addr->sa.sin.sin_addr +# define REMOTE_ADDR(c) c->client_addr->sa.sin.sin_addr #else # define REMOTE_ADDR(c) c->remote_addr.sin_addr #endif debian/patches/hurd.diff0000644000000000000000000001000312165544346012415 0ustar Description: Fix compile errors on hurd-i386. The following are the issues I found (and how I fixed them), and other changes needed: * __MACH__ identifies the Mach microkernel which both Mac OSX and Hurd use (well, different versions/forks of it), so do not use it for identifying Mac OSX. * Introduce new NEKO_HURD and OS_HURD defines, making them being considered as POSIX (as Hurd is). * realpath: we don't have PATH_MAX on Hurd (since we have no limits on paths); given that glibc's realpath has, since years, the POSIX 2008 behaviour (i.e. if called with NULL as second argument, return a newly allocated buffer), then make use of it in glibc-based OSes. * /proc/self is a Linux-specific feature, so limit its usage (in two places) to just Linux, providing a fallback for the remaining cases (which include Hurd). Author: Pino Toscano Origin: debian-hurd@lists.debian.org Bug-Debian: http://bugs.debian.org/626260 Forwarded: Nicolas Cannasse Last-Update: 2011-05-15 Index: b/vm/neko.h =================================================================== --- a/vm/neko.h +++ b/vm/neko.h @@ -27,7 +27,7 @@ # define NEKO_WINDOWS #endif -#if defined(__APPLE__) || defined(__MACH__) || defined(macintosh) +#if defined(__APPLE__) || defined(macintosh) # define NEKO_MAC #endif @@ -43,6 +43,10 @@ # define NEKO_BSD #endif +#if defined(__GNU__) +# define NEKO_HURD +#endif + // COMPILER/PROCESSOR FLAGS #if defined(__GNUC__) # define NEKO_GCC @@ -70,7 +74,7 @@ # define NEKO_64BITS #endif -#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) +#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) || defined(NEKO_HURD) # define NEKO_POSIX #endif Index: b/libs/std/sys.c =================================================================== --- a/libs/std/sys.c +++ b/libs/std/sys.c @@ -200,6 +200,8 @@ return alloc_string("BSD"); #elif defined(NEKO_MAC) return alloc_string("Mac"); +#elif defined(NEKO_HURD) + return alloc_string("GNU/Hurd"); #else #error Unknow system string #endif @@ -537,6 +539,14 @@ if( GetFullPathName(val_string(path),MAX_PATH+1,buf,NULL) == 0 ) neko_error(); return alloc_string(buf); +#elif defined(__GLIBC__) + val_check(path,string); + char *buf = realpath(val_string(path), NULL); + if( buf == NULL ) + neko_error(); + value ret = alloc_string(buf); + free(buf); + return ret; #else char buf[PATH_MAX]; val_check(path,string); @@ -562,7 +572,7 @@ if( _NSGetExecutablePath(path, &path_len) ) neko_error(); return alloc_string(path); -#else +#elif defined(NEKO_LINUX) const char *p = getenv("_"); if( p != NULL ) return alloc_string(p); @@ -574,6 +584,11 @@ path[length] = '\0'; return alloc_string(path); } +#else + const char *p = getenv("_"); + if( p != NULL ) + return alloc_string(p); + neko_error(); #endif } Index: b/libs/common/osdef.h =================================================================== --- a/libs/common/osdef.h +++ b/libs/common/osdef.h @@ -26,7 +26,7 @@ # define OS_WINDOWS #endif -#if defined(__APPLE__) || defined(__MACH__) || defined(macintosh) +#if defined(__APPLE__) || defined(macintosh) # define OS_MAC #endif @@ -38,7 +38,11 @@ # define OS_BSD #endif -#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) +#if defined(__GNU__) +# define OS_HURD +#endif + +#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) || defined(NEKO_HURD) # define OS_POSIX #endif Index: b/vm/main.c =================================================================== --- a/vm/main.c +++ b/vm/main.c @@ -79,7 +79,7 @@ } path[length] = '\0'; return path; -#else +#elif defined(NEKO_LINUX) static char path[1024]; int length = readlink("/proc/self/exe", path, sizeof(path)); if( length < 0 || length >= 1024 ) { @@ -90,6 +90,8 @@ } path[length] = '\0'; return path; +#else + return getenv("_"); #endif } debian/compat0000644000000000000000000000000211564005221010360 0ustar 7 debian/neko.install0000644000000000000000000000012111564005221011500 0ustar bin/*.ndll usr/lib/neko bin/neko usr/bin bin/nekoc usr/bin bin/nekotools usr/bin debian/control0000644000000000000000000000473712170260735010607 0ustar Source: neko Section: interpreters Priority: optional Maintainer: Debian QA Group Standards-Version: 3.9.4 Build-Depends: debhelper (>= 7), quilt, pkg-config, libgc-dev, dh-apache2, apache2-dev, libmysqlclient-dev, libsqlite3-dev, libpcre3-dev, libapr1-dev, libgtk2.0-dev Vcs-Hg: http://hg.debian.org/hg/collab-maint/neko Homepage: http://nekovm.org Package: libneko0 Architecture: any Section: libs Depends: ${shlibs:Depends}, ${misc:Depends} Conflicts: neko (<< 1.8.0-2), neko-dev (<< 1.8.1) Description: Lightweight virtual machine - shared library Neko provides a common runtime for several different languages, including JavaScript and haXe. . This is the shared library implementing the Neko virtual machine. . Neko was written by Nicolas Cannasse. Package: neko-dev Architecture: all Section: libdevel Depends: libneko0 (>= ${source:Upstream-Version}), libneko0 (<< ${source:Upstream-Version}+1~), ${misc:Depends} Conflicts: neko (<< 1.8.0-2) Description: Lightweight virtual machine - headers Neko provides a common runtime for several different languages, including JavaScript and haXe. . The virtual machine is both very lightweight and well optimized. It can be easily embedded into other applications, and libraries are directly accessible using the C foreign function interface. . This package includes the header files for development using the Neko virtual machine. . Neko was written by Nicolas Cannasse. Package: neko Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: libapache2-mod-neko, neko-dev Description: Lightweight virtual machine - compiler and tools Neko provides a common runtime for several different languages, including JavaScript and haXe. . The compiler converts a source file (.neko) into a bytecode file (.n) that can be executed with the Virtual Machine. You can use the compiler as standalone commandline executable separated from the virtual machine, or as a Neko library to perform compile-and-run for interactive languages. . Neko was written by Nicolas Cannasse. Package: libapache2-mod-neko Architecture: all Section: httpd Depends: neko (>= ${source:Version}), ${misc:Depends} Description: Apache module for running server-side Neko programs Neko provides a common runtime for several different languages, including JavaScript and haXe. . This package includes a module for Apache 2 so that you can dynamically generate server-side web pages from Apache. . Neko was written by Nicolas Cannasse. debian/changelog0000644000000000000000000002367212170262172011052 0ustar neko (2.0.0-3) unstable; urgency=low * QA upload. * Convert to dh-apache2. * Switch MPM to prefork in postinst; do not depend on apache2-mpm-prefork. -- Colin Watson Sat, 13 Jul 2013 15:30:16 +0100 neko (2.0.0-2) unstable; urgency=low * QA upload. * Update copyright, changed to BSD. -- Matthias Klose Fri, 05 Jul 2013 16:32:32 +0200 neko (2.0.0-1) unstable; urgency=low * QA upload. * New upstream version. * Properly orphan the package (see #628939). * Build-depend on apache2-dev, fix build errors with apache2.4. Closes: #666858. * Fix build failure with ld --as-needed. Closes: #641613. * Fix some lintian warnings. * TODO: Pass build flags to submodules. -- Matthias Klose Fri, 05 Jul 2013 14:47:28 +0200 neko (1.8.1-6) unstable; urgency=low * Include patch to fix compile errors on hurd-i386, thanks to Pino Toscano. (Closes: #626260) -- Jens Peter Secher Sun, 15 May 2011 18:44:31 +0200 neko (1.8.1-5) unstable; urgency=low * Avoid spurious build failures (stack overflows and segmentation faults) by using both -fno-strict-aliasing and lower optimisation level. (Closes: #569806) -- Jens Peter Secher Thu, 18 Feb 2010 22:26:27 +0100 neko (1.8.1-4) unstable; urgency=low * Attempt to fix executable_path() on kFreeBSD, which only seemed to work when invoked from bash, thanks to Roman Neuhauser. -- Jens Peter Secher Sat, 13 Feb 2010 16:34:13 +0100 neko (1.8.1-3) unstable; urgency=low * Converted to dpkg-source format 3.0 (quilt). * Use mercurial-buildpackage for repository maintenance, so old repository does not exist any more. * Bumped Standards-Version to 3.8.4, no change. * Use misc:Depends macro for all binary packages, and tighten depency for the header-files package. -- Jens Peter Secher Sat, 13 Feb 2010 15:20:34 +0100 neko (1.8.1-2) unstable; urgency=low * Do not install broken mysql5.ndll library. The dynamically linked mysql.ndll works fine for all versions of MySql. (Closes: #542024) * Build-Depend on generic libmysqlclient-dev instead of specific version. * Fixed build failure on kFreeBSD, thanks to Cyril Brulebois. (Closes: #543995) * Bumped the Standards-Version to 3.8.3, no changes. -- Jens Peter Secher Wed, 09 Sep 2009 14:40:17 +0200 neko (1.8.1-1) unstable; urgency=low * New upstream version. * Bump SONAME to libneko.0.1 and make libneko0 conflict with previous version of neko-dev. * Change libapache2-mod-neko package section to httpd, and updated Standards-Version to 3.8.2. * Removed obsolete patch tora-pwrite-diversion.diff. * Added tora-missing-include.diff to include stdlib.h. * Added mysql-missing-include.diff to include stdlib.h. -- Jens Peter Secher Tue, 28 Jul 2009 22:32:00 +0200 neko (1.8.0-4) unstable; urgency=low * Fix broken NDLLs (shared libraries) by reverting some of the previous changes. -- Jens Peter Secher Sat, 28 Mar 2009 09:40:24 +0100 neko (1.8.0-3) unstable; urgency=low * Fix build failure on MIPS by tightening up the linking process. * Make neko-dev architecture independent since there are no binary files in neko-dev. * Bumped the Standards-Version to 3.8.1. * Bumped debhelper version to 7. -- Jens Peter Secher Thu, 26 Mar 2009 20:00:40 +0100 neko (1.8.0-2) unstable; urgency=low * Promoted libneko to a proper shared library living in /usr/lib. (Closes: #509454) * No need to Build-Conflict with itself because all rpaths have been removed. * Use quilt instead of dpatch for patches, and describe how to use quilt in Debian.source (thanks to Russ Allbery). * Strip all shared libraries. * Put test.n and test.neko in examples directory. * Added a Vcs-Hg control filed to indicate the location of the public repository. * Bumped the Standards-Version to 3.8.0. -- Jens Peter Secher Sat, 14 Mar 2009 21:01:12 +0100 neko (1.8.0-1) experimental; urgency=low * New upstream release. * Bumped debhelper version to 6. -- Jens Peter Secher Sat, 04 Oct 2008 16:44:58 +0200 neko (1.7.1-1~bpo40+1) etch-backports; urgency=low * Backport to Etch (no change). -- Jens Peter Secher Sun, 03 Aug 2008 13:32:05 +0200 neko (1.7.1-1) unstable; urgency=low * New upstream release. * Call dh_makeshlibs before dh_installdeb in debian/rules. * Define _GNU_SOURCE to get threads to work. -- Jens Peter Secher Thu, 31 Jul 2008 13:17:14 +0200 neko (1.7.0-1) unstable; urgency=low * New upstream release. -- Jens Peter Secher Thu, 27 Mar 2008 20:53:37 +0100 neko (1.6.0-4~bpo40+2) etch-backports; urgency=low * Pass version extracted by dpkg-parsechangelog to dh_makeshlibs instead of error prone hard-coding. -- Jens Peter Secher Tue, 27 Nov 2007 21:09:43 +0100 neko (1.6.0-4~bpo40+1) etch-backports; urgency=low * Without the Homepage field. -- Jens Peter Secher Tue, 27 Nov 2007 21:09:43 +0100 neko (1.6.0-4) unstable; urgency=low * Give libneko a proper SONAME to avoid breakage by new dpkg-shlibdeps. * Avoid a lot of unnecessary shared library dependencies. * Place the apache module in section web. * Use the Homepage field in the control file. * Bump debhelper to version 5. -- Jens Peter Secher Mon, 26 Nov 2007 19:03:00 +0100 neko (1.6.0-3) unstable; urgency=low * Fixed missing reference to shared mysqlclient library. -- Jens Peter Secher Tue, 13 Nov 2007 00:42:42 +0100 neko (1.6.0-2~bpo40+1) etch-backports; urgency=low * Backport to Etch (no change). -- Jens Peter Secher Sat, 08 Sep 2007 14:16:50 +0200 neko (1.6.0-2) unstable; urgency=low * Support non-stripped builds (DEB_BUILD_OPTIONS=nostrip). (Closes: #437609) -- Jens Peter Secher Sat, 18 Aug 2007 22:34:21 +0200 neko (1.6.0-1) unstable; urgency=low * New upstream release, which obsoletes 75-kfreebsd-defines.dpatch and incorporates 50-embed-endianess.dpatch . * New build-depends libgtk2.0-dev. * Update man pages. -- Jens Peter Secher Thu, 26 Jul 2007 23:39:47 +0200 neko (1.5.3-6) unstable; urgency=low * Drop support for obsolete Apache 1. (Closes: #429139) * Provide Apache 2 module as seperate package. -- Jens Peter Secher Sat, 16 Jun 2007 20:25:06 +0200 neko (1.5.3-5bpo1) stable; urgency=low * Backport to Etch (no change). -- Jens Peter Secher Sun, 27 May 2007 10:57:37 +0200 neko (1.5.3-5) unstable; urgency=low * Compile with -DEAPI. (Closes: #415803) -- Jens Peter Secher Thu, 22 Mar 2007 20:48:35 +0100 neko (1.5.3-4) unstable; urgency=low * Fix FTBFS on GNU/kFreeBSD, thanks to Cyril Brulebois. (Closes: #414123) -- Jens Peter Secher Sat, 10 Mar 2007 15:26:46 +0100 neko (1.5.3-3) unstable; urgency=low * Fix endianess problem in embedded-code loader. (Closes: #412567) -- Jens Peter Secher Sat, 3 Mar 2007 11:32:21 +0100 neko (1.5.3-2) unstable; urgency=low * It turned out that binaries cannot really be stripped, so no stripping. -- Jens Peter Secher Sat, 24 Feb 2007 16:42:32 +0100 neko (1.5.3-1) unstable; urgency=low * New upstream release. * The bootable vm implementation changed, so now binaries are now stripped, and the aligment patch has become obsolete. -- Jens Peter Secher Thu, 22 Feb 2007 00:19:25 +0100 neko (1.5.2-3) unstable; urgency=low * Fix build failure on various architectures by aligning bytecode at 16 byte offset. (Closes: #406033) -- Jens Peter Secher Mon, 8 Jan 2007 22:55:16 +0100 neko (1.5.2-2) unstable; urgency=low * Neko modules now work for non-threaded Apache 2.2, that is, it works for apache2-mpm-prefork. -- Jens Peter Secher Wed, 3 Jan 2007 23:12:04 +0100 neko (1.5.2-1) experimental; urgency=low * New upstream release. * Unfortunately Apache 2.2 still hangs when serving Neko files, but I am leaving the setup in case others figure out why. * Build-Conflicts with itself because the hardcoded rpath gets in the way when different versions of the VM do not agree. -- Jens Peter Secher Wed, 29 Nov 2006 22:50:48 +0100 neko (1.5-3) experimental; urgency=low * Register Apache 1.3 module automatically if Apcahe is installed. * Register Apache 2.2 modules automatically if Apcahe is installed. -- Jens Peter Secher Tue, 21 Nov 2006 22:59:48 +0100 neko (1.5-2) experimental; urgency=low * Note to ftpmasters: Neko is written in Neko, so the files boot/* are needed to bootstrap the compiler. The source for them is in src/*. -- Jens Peter Secher Tue, 21 Nov 2006 22:17:50 +0100 neko (1.5-1bpo1) stable; urgency=low * Fit dependencies and include directories so that is is possible to backport to sarge. -- Jens Peter Secher Sat, 11 Nov 2006 12:55:24 +0100 neko (1.5-1) experimental; urgency=low * Manpages written for the three executable. * The executables searches for the libneko.so by use of -rpath in /usr/lib/neko since we do not want this private library to end up in /usr/lib. * The dynamic modules /usr/lib/neko/*.ndll are not stripped because they are created as concatenations of the virtual machine bootloader and some bytecode, which makes stripping impossible (cf. OCaml Packaging Policy). Lintian overrides included for not stripping. * The additional Apache modules are placed in /usr/lib/neko, but not registered with Apache automatically, which avoids a dependency on Apache until we have made proper arrangements with the Apache team. -- Jens Peter Secher Mon, 6 Nov 2006 23:58:34 +0100