GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit a050c7bf authored by boklm's avatar boklm
Browse files

Add support for OSX

parent f480de63
......@@ -29,6 +29,7 @@ sub get_os_name {
sub get_arch {
return 'x86_64' if $Config{archname} =~ m/^x86_64/;
return 'x86_64' if $Config{archname} eq 'darwin-thread-multi-2level';
return 'x86';
}
......
......@@ -33,7 +33,7 @@ BEGIN {
# not work on Windows, so we're not creating thumbnails if we're
# on Windows. In that case, the thumbnails should be created by the
# server that receives the results.
if ($OSNAME ne 'cygwin') {
if ($OSNAME ne 'cygwin' && $OSNAME ne 'darwin') {
require TBBTestSuite::Thumbnail;
$screenshot_thumbnail = \&TBBTestSuite::Thumbnail::screenshot_thumbnail;
} else {
......
......@@ -29,7 +29,7 @@ BEGIN {
# not work on Windows, so we're not creating thumbnails if we're
# on Windows. In that case, the thumbnails should be created by the
# server that receives the results.
if ($OSNAME ne 'cygwin') {
if ($OSNAME ne 'cygwin' && $OSNAME ne 'darwin') {
require TBBTestSuite::Thumbnail;
$screenshot_thumbnail = \&TBBTestSuite::Thumbnail::screenshot_thumbnail;
} else {
......@@ -520,6 +520,12 @@ sub extract_tbb {
$tbbinfos->{tbbdir} = "$tmpdir/torbrowser/Browser";
move("$tmpdir/\$_OUTDIR", "$tmpdir/torbrowser");
move ("$tmpdir/Start Tor Browser.exe", "$tmpdir/torbrowser/");
} elsif ($tbbinfos->{os} eq 'MacOSX') {
my $mountpoint = File::Temp::newdir('XXXXXX', DIR => $options->{tmpdir});
system('hdiutil', 'mount', '-mountpoint', $mountpoint, $tbbfile);
system('cp', '-a', "$mountpoint/TorBrowser.app", "$tmpdir/TorBrowser.app");
system('hdiutil', 'unmount', $mountpoint);
$tbbinfos->{tbbdir} = "$tmpdir/TorBrowser.app";
}
}
......@@ -663,6 +669,7 @@ sub ffbin_path {
if ($options->{use_strace} && $t{$test->{type}}) {
return ff_strace_wrapper($tbbinfos, $test);
}
return $tbbinfos->{ffbin} if $OSNAME eq 'darwin';
return ff_wrapper($tbbinfos, $test);
}
......@@ -792,6 +799,9 @@ sub set_tbbpaths {
$tbbinfos->{ffbin} = "$tbbinfos->{tbbdir}/firefox";
$tbbinfos->{tordir} = "$tbbinfos->{tbbdir}/TorBrowser/Tor";
$tbbinfos->{datadir} = "$tbbinfos->{tbbdir}/TorBrowser/Data";
if ($tbbinfos->{os} eq 'MacOSX') {
$tbbinfos->{ffbin} = "$tbbinfos->{tbbdir}/Contents/MacOS/firefox";
}
$tbbinfos->{torbin} = "$tbbinfos->{tordir}/tor";
$tbbinfos->{ptdir} = winpath("$tbbinfos->{tordir}/PluggableTransports");
$tbbinfos->{ffprofiledir} = "$tbbinfos->{datadir}/Browser/profile.default";
......
......@@ -85,7 +85,7 @@ then
fi
fi
if [ a$(uname -o) = aCygwin ]
if [ a$(uname -s) = aDarwin ] || [ a$(uname -o) = aCygwin ]
then
for perlmod in $perlmodules
do
......@@ -93,6 +93,13 @@ then
done
fi
if [ a$(uname -s) = aDarwin ]
then
brew install python
brew install p7zip
brew install imagemagick
fi
install_X() {
packages="fluxbox"
if [ -f /etc/debian_version ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment