r343 - in /packages/mtasc/trunk/debian: changelog patches/04_include_dirs.patch patches/extc-fixes.patch patches/port-to-hurd.patch patches/series
pabs at users.alioth.debian.org
pabs at users.alioth.debian.org
Fri Jul 17 09:17:56 UTC 2009
Author: pabs
Date: Fri Jul 17 09:17:54 2009
New Revision: 343
URL: http://svn.debian.org/wsvn/pkg-flash/?sc=1&rev=343
Log:
Move extc changes to new extc-fixes.patch and add Hurd support to it
Added:
packages/mtasc/trunk/debian/patches/extc-fixes.patch
Removed:
packages/mtasc/trunk/debian/patches/port-to-hurd.patch
Modified:
packages/mtasc/trunk/debian/changelog
packages/mtasc/trunk/debian/patches/04_include_dirs.patch
packages/mtasc/trunk/debian/patches/series
Modified: packages/mtasc/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-flash/packages/mtasc/trunk/debian/changelog?rev=343&op=diff
==============================================================================
--- packages/mtasc/trunk/debian/changelog (original)
+++ packages/mtasc/trunk/debian/changelog Fri Jul 17 09:17:54 2009
@@ -1,6 +1,6 @@
mtasc (1.14-2) UNRELEASED; urgency=low
- * Add port-to-hurd.patch to fix FTBFS on hurd-i386
+ * Move extc changes to new extc-fixes.patch and add Hurd support to it
* Support nocheck in DEB_BUILD_OPTIONS
* Bump Standards-Version
Modified: packages/mtasc/trunk/debian/patches/04_include_dirs.patch
URL: http://svn.debian.org/wsvn/pkg-flash/packages/mtasc/trunk/debian/patches/04_include_dirs.patch?rev=343&op=diff
==============================================================================
--- packages/mtasc/trunk/debian/patches/04_include_dirs.patch (original)
+++ packages/mtasc/trunk/debian/patches/04_include_dirs.patch Fri Jul 17 09:17:54 2009
@@ -2,7 +2,6 @@
Paul Wise <pabs at debian.org>
Add a couple of paths to the default classpath
Keep the default path, needed during the test build
-Fix detection of the executable path
--- a/ocaml/mtasc/main.ml
+++ b/ocaml/mtasc/main.ml
@@ -117,7 +117,9 @@
@@ -27,27 +26,3 @@
Hashtbl.remove Lexer.keywords "add";
Parser.warning := (fun msg pos -> report ~do_exit:false (msg,pos) "Warning" (fun msg -> msg));
if !files = [] then begin
---- a/ocaml/extc/extc_stubs.c
-+++ b/ocaml/extc/extc_stubs.c
-@@ -137,14 +137,16 @@
- failwith("executable_path");
- return caml_copy_string(path);
- #else
-- const char *p = getenv("_");
-- if( p != NULL )
-- return caml_copy_string(p);
- {
- char path[200];
- int length = readlink("/proc/self/exe", path, sizeof(path));
-- if( length < 0 || length >= 200 )
-- failwith("executable_path");
-+ if( length < 0 || length >= 200 ){
-+ const char *p = getenv("_");
-+ if( p != NULL )
-+ return caml_copy_string(p);
-+ else
-+ failwith("executable_path");
-+ }
- path[length] = '\0';
- return caml_copy_string(path);
- }
Added: packages/mtasc/trunk/debian/patches/extc-fixes.patch
URL: http://svn.debian.org/wsvn/pkg-flash/packages/mtasc/trunk/debian/patches/extc-fixes.patch?rev=343&op=file
==============================================================================
--- packages/mtasc/trunk/debian/patches/extc-fixes.patch (added)
+++ packages/mtasc/trunk/debian/patches/extc-fixes.patch Fri Jul 17 09:17:54 2009
@@ -1,0 +1,68 @@
+Patch: extc-fixes.patch
+Author: Paul Wise <pabs at debian.org>
+Description: fix issues with extc (hurd, env stuff)
+--- a/ocaml/extc/extc_stubs.c
++++ b/ocaml/extc/extc_stubs.c
+@@ -26,6 +26,7 @@
+ #else
+ # include <limits.h>
+ # include <unistd.h>
++# include <caml/memory.h>
+ #endif
+ #ifdef __APPLE__
+ # include <sys/param.h>
+@@ -137,17 +138,27 @@
+ failwith("executable_path");
+ return caml_copy_string(path);
+ #else
+- const char *p = getenv("_");
+- if( p != NULL )
+- return caml_copy_string(p);
+- {
+- char path[200];
+- int length = readlink("/proc/self/exe", path, sizeof(path));
+- if( length < 0 || length >= 200 )
+- failwith("executable_path");
+- path[length] = '\0';
+- return caml_copy_string(path);
++ CAMLparam1 (u);
++ CAMLlocal1 (caml_path);
++ char exe_link_path[200];
++ int length = readlink("/proc/self/exe", exe_link_path, sizeof(exe_link_path));
++ if( length < 0 || length >= 200 ){
++ char* argv0_path = realpath(String_val(u),NULL);
++ if( NULL != argv0_path ){
++ caml_path = caml_copy_string(argv0_path);
++ free(argv0_path); argv0_path = NULL;
++ } else {
++ const char *shell_path = getenv("_");
++ if( shell_path != NULL )
++ caml_path = caml_copy_string(shell_path);
++ else
++ failwith("executable_path");
++ }
++ } else {
++ exe_link_path[length] = '\0';
++ caml_path = caml_copy_string(exe_link_path);
+ }
++ CAMLreturn(caml_path);
+ #endif
+ }
+
+@@ -158,9 +169,12 @@
+ failwith("get_full_path");
+ return caml_copy_string(path);
+ #else
+- char path[PATH_MAX];
+- if( realpath(String_val(f),path) == NULL )
+- failwith("get_full_path");
+- return caml_copy_string(path);
++ CAMLparam1 (f);
++ CAMLlocal1 (path_caml);
++ char* path = realpath(String_val(f),NULL);
++ if( NULL == path ) failwith("get_full_path");
++ path_caml = caml_copy_string(path);
++ free(path);
++ CAMLreturn(path_caml);
+ #endif
+ }
Modified: packages/mtasc/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-flash/packages/mtasc/trunk/debian/patches/series?rev=343&op=diff
==============================================================================
--- packages/mtasc/trunk/debian/patches/series (original)
+++ packages/mtasc/trunk/debian/patches/series Fri Jul 17 09:17:54 2009
@@ -2,4 +2,4 @@
02_makefile_kludges.patch
04_include_dirs.patch
fix_mtasc_for_camlp4_3.11.0.patch
-port-to-hurd.patch
+extc-fixes.patch
More information about the pkg-flash-devel
mailing list