commit 3dda068d2bd731518b8d2ca7eedde9b8f1b96b79
parent f5632455556626f3f83fccf2fdc64f11f3f1c2b9
Author: Kyle Milz <kyle@0x30.net>
Date: Mon, 27 Jun 2016 00:19:49 -0600
tt: patch vim on osx
Diffstat:
3 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/Test/Package.pm b/Test/Package.pm
@@ -76,6 +76,11 @@ sub parse_output {
return @pkgs;
}
+sub patch {
+ my ($self, $patch_cmd) = @_;
+ system("cd $self->{srcdir} && $patch_cmd") == 0 or die "patching failed";
+}
+
sub get_file_size {
my ($self, $file) = @_;
diff --git a/tt/patches/vim_osx.diff b/tt/patches/vim_osx.diff
@@ -0,0 +1,12 @@
+diff -ur vim74/src/os_unix.c vim74_a/src/os_unix.c
+--- a/src/os_unix.c 2013-07-03 08:32:32.000000000 -0600
++++ b/src/os_unix.c 2016-03-23 20:11:27.000000000 -0600
+@@ -827,7 +827,7 @@
+ || MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
+ /* missing prototype. Adding it to osdef?.h.in doesn't work, because
+ * "struct sigaltstack" needs to be declared. */
+- extern int sigaltstack __ARGS((const struct sigaltstack *ss, struct sigaltstack *oss));
++ //extern int sigaltstack __ARGS((const struct sigaltstack *ss, struct sigaltstack *oss));
+ # endif
+
+ # ifdef HAVE_SS_BASE
diff --git a/tt/vim.t b/tt/vim.t
@@ -1,6 +1,7 @@
use strict;
use warnings;
+use Cwd;
use Expect;
use List::MoreUtils qw( each_array );
use Test::More tests => 238;
@@ -30,6 +31,10 @@ my @scalar_citrun;
my $srcdir = $package->set_srcdir("/vim74/src");
+# Patch: Vim doesn't compile natively on OSX.
+my $cwd = getcwd;
+$package->patch("patch -p2 < $cwd/tt/patches/vim_osx.diff") if ($^O eq "darwin");
+
# Vanilla configure.
$scalar_vanilla[0] = $package->configure("make config");
#$package->copy_file("auto/config.log", "config.log.vanilla");