Update for compatibility with latest narwhal. Switch back to 280north/narwhal

This commit is contained in:
Tom Robinson
2010-01-06 20:00:37 -08:00
parent af03085d5f
commit 85c68f78da
3 changed files with 22 additions and 12 deletions
+5 -3
View File
@@ -62,12 +62,14 @@ if (system.env["OBJJ_INCLUDE_PATHS"])
// TODO: somehow make window object the top scope?
with (window)
{
var objectivejSource = FILE.read(objectivejPath, { charset:"UTF-8" });
// read and eval Objective-J.js with the module's scope
if (system.engine === "rhino")
Packages.org.mozilla.javascript.Context.getCurrentContext().evaluateString(window, FILE.read(objectivejPath, { charset:"UTF-8" }), "Objective-J.js", 0, null);
Packages.org.mozilla.javascript.Context.getCurrentContext().evaluateString(window, objectivejSource, objectivejPath, 0, null);
else
eval(FILE.read(objectivejPath, { charset:"UTF-8" }));
eval(objectivejSource);
// export desired variables. must eval variable name to obtain a reference.
[
"objj_preprocess",
+9 -5
View File
@@ -16,7 +16,7 @@ function prompt () {
}
function which () {
echo "$PATH" | tr ":" "\n" | while read line; do [ -f "$line/$1" ] && echo "$line/$1" && return 0; done
echo "$PATH" | tr ":" "\n" | while read line; do [ -x "$line/$1" ] && echo "$line/$1" && return 0; done
}
function ask_remove_dir () {
@@ -66,7 +66,7 @@ else
tusk_install_command="install"
fi
github_project="tlrobinson-narwhal"
github_project="280north-narwhal"
github_path=$(echo "$github_project" | tr '-' '/')
install_directory="/usr/local/narwhal"
tmp_zip="/tmp/narwhal.zip"
@@ -123,7 +123,7 @@ if ! prompt; then
exit 1
fi
echo "Installing necessary dependencies..."
echo "Installing necessary packages..."
if ! tusk update; then
echo "Error: unable to update tusk catalog. Check that you have sufficient permissions."
@@ -138,9 +138,13 @@ if [ `uname` = "Darwin" ]; then
echo "This is optional but will make building and running Objective-J much faster."
if prompt; then
tusk $tusk_install_command narwhal-jsc
(cd "$install_directory/packages/narwhal-jsc" && make webkit)
if ! [ "$NARWHAL_ENGINE" = "jsc" ]; then
if ! (cd "$install_directory/packages/narwhal-jsc" && make webkit); then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "WARNING: building narwhal-jsc failed. Hit enter to continue."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
read
elif ! [ "$NARWHAL_ENGINE" = "jsc" ]; then
echo "================================================================================"
echo "Rhino is the default Narwhal engine, should we change the default to JavaScriptCore for you?"
echo "This can by overridden by setting the NARWHAL_ENGINE environment variable to \"jsc\" or \"rhino\"."
+8 -4
View File
@@ -7,10 +7,14 @@ function ensurePackageUpToDate(packageName, requiredVersion)
print("You are missing package \"" + packageName + "\", version " + requiredVersion + " or later. Please install using \"tusk install "+packageName+"\" and re-run jake");
require("os").exit(1);
}
var version = packageInfo.version;
if (version && require("util").compare(version.split("."), requiredVersion.split(".")) !== -1)
// newer versions of packages provide already split versions
var version = typeof packageInfo.version === "string" ? packageInfo.version.split(".") : packageInfo;
if (typeof requiredVersion === "string")
requiredVersion = requiredVersion.split(".");
if (version && require("util").compare(version, requiredVersion) !== -1)
return;
print("Your copy of " + packageName + " is out of date (version " + version + "). Update? yes or no:");
@@ -28,7 +32,7 @@ function ensurePackageUpToDate(packageName, requiredVersion)
// UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
ensurePackageUpToDate("jake", "0.1.1");
ensurePackageUpToDate("browserjs", "0.1");
ensurePackageUpToDate("browserjs", "0.1.1");
var Jake = require("jake");