From 7f4a1caaea933ccf4ca7ef8eb5aac9a9e09bd47f Mon Sep 17 00:00:00 2001 From: actraiser Date: Wed, 3 Apr 2013 14:00:10 +0200 Subject: [PATCH] initial commit --- .gitignore | 2 + .npmignore | 4 + MIT-LICENSE.txt | 20 +++ README.md | 76 ++++++++++ bin/dust | 74 ++++++++++ config/defaults.json | 10 ++ lib/dust_boot | 31 ++++ lib/dust_cmd | 157 ++++++++++++++++++++ lib/dust_env | 31 ++++ lib/dust_externals | 18 +++ lib/dust_github | 35 +++++ lib/dust_setup | 40 +++++ lib/dust_test | 49 +++++++ lib/dust_text | 44 ++++++ lib/dust_tutorials | 65 +++++++++ mods/c64/README.md | 4 + mods/c64/config/mod.json | 120 +++++++++++++++ mods/c64/lib/dust_cmd | 77 ++++++++++ mods/c64/lib/dust_setup | 307 +++++++++++++++++++++++++++++++++++++++ mods/c64/lib/dust_test | 102 +++++++++++++ mods/c64/lib/dust_text | 71 +++++++++ package.json | 41 ++++++ 22 files changed, 1378 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 MIT-LICENSE.txt create mode 100644 README.md create mode 100755 bin/dust create mode 100644 config/defaults.json create mode 100644 lib/dust_boot create mode 100644 lib/dust_cmd create mode 100644 lib/dust_env create mode 100644 lib/dust_externals create mode 100644 lib/dust_github create mode 100755 lib/dust_setup create mode 100644 lib/dust_test create mode 100644 lib/dust_text create mode 100644 lib/dust_tutorials create mode 100644 mods/c64/README.md create mode 100644 mods/c64/config/mod.json create mode 100644 mods/c64/lib/dust_cmd create mode 100644 mods/c64/lib/dust_setup create mode 100644 mods/c64/lib/dust_test create mode 100644 mods/c64/lib/dust_text create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9303c34 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c68e28f --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +node_modules/ +.git/ +.DS_Store +.gitignore diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt new file mode 100644 index 0000000..accad76 --- /dev/null +++ b/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2013 Rocco Di Leo aka actraiser/Dustlayer + +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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b85f01c --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# Dust # + +(c) actraiser/Dustlayer + +Dustlayer WHQ: http://dustlayer.com +Contact: actraiser@dustlayer.com + +## Synopsis ## + +Dust ist a node.js driven versatile command line suite for new and experienced C64 programmers on Mac OSX. +This first version installs and configures the tool chain and helps you to kickstart cross-development projects. + +## Feature List ## + +- Cross Development Setup Installer + - Installs and configures all tools required for efficient C64 Coding (currently only OSX) + - ACME + - Vice + - Crunchers + - and more + - Automatic Sublime Installation and Configuration + - 6502 and BASIC syntax highlighting + - Instangt Build & Run Options for ASM and BASIC projects + - Auto-Start in Vice via BASIC loader +- Advanced Vice integration + - Labels export to Vice Monitor at Build time +- C64 Project Skeletons + - Generate new ASM or BASIC project from Skeletons + - Preconfigured Projects with BASIC Loader + - Follows Dustlayer project layout + - Runs and Compiles without modifications + - Tutorials on dustlayer.com follow the layout conventions + +## Installation ## + +Install node.js from [nodejs.org](http://nodejs.org/download/) for your operating system. Then install *dust* via the node package manager + + sudo npm install -g dust + +Then you are good to go, typical you want to clone the tools, set them up and start a first project. + + cd ~ + dust clone + cd dust-osx-setup + dust setup + + [... once this is done ...] + + dust test # shows if everything is in place + + + Then create for example a new 6502 ASM project into the directory myFirstProject. You can choose from preconfigured skeletons which are listed when you execute the command. + + cd ~ + dust create asm myProject # creates a new asm project from a template + + cd myProject + dust compile # compiles the C64 code and runs it in the C64 Emulator + + +Checkout http://dustlayer.com for tutorials and an indepth explanation how all that stuff works. + +From time to time the tool repository is upgraded with new versions or additional tools. The following commands will update your dust executable and the cloned repository. Aftewards you can restart the installation progress. + + cd ~/dust-osx-setup + dust update + dust setup # updates everything or installs whats missing + +## Next Features ## + +- Compatibility Windows/Linux +- Tighter integration with Vice/Debugging +- More skeletons to choose from +- Additional tools to ease C64 development + + diff --git a/bin/dust b/bin/dust new file mode 100755 index 0000000..98954e9 --- /dev/null +++ b/bin/dust @@ -0,0 +1,74 @@ +#!/usr/bin/env node + + +/************************************ +* * +* main binary - sets up defaults * +* * +*************************************/ + +var silent = true; +exports.silent = silent; + +var fs = require('fs'); +exports.fs = fs; + +var shell = require('shelljs'); +exports.shell = shell; + +// Create config for the first time if it does not exist +if (!shell.test("-e", process.env['HOME'] + '/.dust.json')){ + console.log("creating default config file in ~/.dust.json"); + var path = process.env['HOME'] + "/.dust.json"; + shell.cp("./config/defaults.json", path); +} +var config = require(process.env['HOME'] + '/.dust.json'); + +exports.config = config; + + + +var cmd = require('commander'); +exports.cmd = cmd; +require('../lib/dust_cmd'); + +var env = require('../lib/dust_env'); +exports.env = env; + +var text = require('../lib/dust_text'); +exports.text = text; + +var ansi = require('ansi'); +var color = ansi(process.stdout); +exports.color = color; + +var test = require('../lib/dust_test'); +exports.test = test; + +var setup = require('../lib/dust_setup'); +exports.setup = setup; + +var github = require('../lib/dust_github'); +exports.github = github; + +var tutorials = require('../lib/dust_tutorials'); +exports.tutorials = tutorials; + +var externals = require('../lib/dust_externals') +exports.externals = externals; + + +/* booting 'dust' */ +require('../lib/dust_boot'); + + + + + + + + + + + + diff --git a/config/defaults.json b/config/defaults.json new file mode 100644 index 0000000..0016bc7 --- /dev/null +++ b/config/defaults.json @@ -0,0 +1,10 @@ +{ + "activeMod" : "c64", + "dustLogo": true, + "mods": { + "c64": { + "systemName": "Commodore C64", + "tutorialsIdentifier": "dust-tutorial-c64" + } + } +} \ No newline at end of file diff --git a/lib/dust_boot b/lib/dust_boot new file mode 100644 index 0000000..493b958 --- /dev/null +++ b/lib/dust_boot @@ -0,0 +1,31 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +// require modules to startup 'dust' +dust.config.mod = require("../mods/" + dust.config.activeMod + '/config/mod.json'); + +require("../mods/" + dust.config.activeMod + '/lib/dust_text'); + +/* Initial Message */ +dust.shell.exec("clear"); + +if (dust.config.dustLogo === true) { + dust.text.dustLogo(); +} +dust.text.welcomeMessage(dust.env.operatingSystem+ " " + dust.env.osVersion, dust.env.dustVersion); + + +// modded tests +require("../mods/" + dust.config.activeMod + '/lib/dust_test'); + +// modded setup +require("../mods/" + dust.config.activeMod + '/lib/dust_setup'); + +// modded commands +require("../mods/" + dust.config.activeMod + '/lib/dust_cmd'); + +dust.cmd.parse(process.argv); + + + + diff --git a/lib/dust_cmd b/lib/dust_cmd new file mode 100644 index 0000000..3b5d411 --- /dev/null +++ b/lib/dust_cmd @@ -0,0 +1,157 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +/************************************** +* default commands * +***************************************/ + +dust.cmd + .version('0.2.0') + .usage(' [arguments]'); + +// set Mode +dust.cmd + .command('mod ') + .description("switch modding for 'dust', default: 'c64'") + .action(function(){ + setMod(dust.cmd.args); + }); + + +// set Mode +dust.cmd + .command('mods') + .description("show list of available mods") + .action(function(){ + listMods(); + }); + + + + +// clone tools repository +dust.cmd + .command('clone') + .description('clones the bundled tools repository for the selected mod') + .action(function(){ + clone(); + }); + +// setup tools +dust.cmd + .command('setup [help]') + .description('setups bundled tools or displays information on the setup') + .action(function(args){ + if (args === undefined){ + setup(); + } + else{ + switch(args){ + case "help": + dust.text.displayInstallationHelp(); + break; + case "requirements": + dust.text.displayInstallationRequirements(); + break; + default: + dust.color.red().bold(); + console.log('accepted setup arguments: help, requirements'); + console.log(''); + dust.color.reset(); + } + dust.shell.exit(0); + } + }); + + +// test setup +dust.cmd + .command('test') + .description('check if everything is installed properly') + .action(function(){ + dust.test.all(); + }); + + +// tutorials list and download +dust.cmd + .command('tutorials [download] [id]') + .description('list and download tutorials') + .action(function(){ + tutorials(dust.cmd.args); + }); + +// custom help examples +dust.cmd.on('--help', function(){ + dust.text.defaultHelp(); + dust.text.modHelp(); + console.log(''); + dust.color.reset(); +}); + +/************************************** +* default command functions * +***************************************/ + +function setup(){ + dust.setup.compatibilityCheck(); + eval("dust.setup.install." + dust.env.operatingSystem.toLowerCase() + ".options();"); +} + +function clone(){ + dust.setup.compatibilityCheck(); + eval("dust.setup.clone." + dust.env.operatingSystem.toLowerCase() + "();"); +} + + +function setMod(mod){ + + for (key in dust.config.mods) { + if (key == mod){ + console.log("setting mod to " + mod); + var path = process.env['HOME'] + "/.dust.json"; + var modifiedConfig = require(process.env['HOME'] + "/.dust.json"); + modifiedConfig.activeMod = mod.toString(); + delete modifiedConfig.mod; + dust.fs.writeFileSync(path, JSON.stringify(modifiedConfig, null, 4)); + dust.shell.exit(0); + } + } + dust.test.fail('System not supported.'); + console.log(""); + console.log(""); + listMods(); + dust.shell.exit(0); +} + +function listMods(){ + console.log("Supported mods:") + dust.color.bold(); + for (key in dust.config.mods) { + console.log(dust.config.mods[key].systemName + ': ' + key ); + } + dust.color.reset(); + console.log(""); + console.log("switch mod with 'dust mod '"); + console.log(""); + dust.shell.exit(0); +} + +function tutorials(args){ + if (!dust.shell.which('git')) { + dust.color.red().bold(); + console.log ("git not set up correctly, please install git"); + dust.color.reset(); + dust.shell.exit(1); + } + if (args.length > 0){ + console.log('Downloading Tutorial #' + args[1] ); + dust.tutorials.download(args[1]); + } + else{ + console.log('Downloading Tutorials Index' ); + dust.tutorials.list(); + } +} + + diff --git a/lib/dust_env b/lib/dust_env new file mode 100644 index 0000000..5b74f5d --- /dev/null +++ b/lib/dust_env @@ -0,0 +1,31 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +var operatingSystem = operatingSystem(); +var osVersion = dust.shell.exec("sw_vers -productVersion", {silent:dust.silent}).output; +var dustVersion = '0.2.0 (2013-03-31)'; + +exports.operatingSystem = operatingSystem +exports.osVersion = osVersion; +exports.dustVersion = dustVersion; + + +function operatingSystem(){ + // Check which platform we are working with + var operatingSystem = process.platform; + switch (operatingSystem) { + case 'linux': + operatingSystem = 'Linux'; + break; + case 'darwin': + operatingSystem = 'Mac'; + break; + //match(/^win/) == Windows Platform, we default to it + default: + operatingSystem = 'Windows'; + break; + } + +return operatingSystem + +} diff --git a/lib/dust_externals b/lib/dust_externals new file mode 100644 index 0000000..eb2da07 --- /dev/null +++ b/lib/dust_externals @@ -0,0 +1,18 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +/* +var externalConfig = dust.config.externals + +// overwrite to display progress bar +exports.config = externalConfig; +*/ + +exports.download = function download(os, link, filename, silent){ + dust.color.bold(); + process.stdout.write('downloading '); + console.log(""); + dust.shell.exec('curl --progress-bar -L -o "$HOME/temp_dust_compile/' + filename + '" "' + link + '"' , {silent: false}); + dust.color.reset(); + console.log(""); +} diff --git a/lib/dust_github b/lib/dust_github new file mode 100644 index 0000000..a38ed12 --- /dev/null +++ b/lib/dust_github @@ -0,0 +1,35 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +var GitHubApi = require("github"); +var github = new GitHubApi({ + version: "3.0.0", + timeout: 5000 +}); + +exports.getJSON = function(keyword,callback){ + github.repos.getFromUser({ + "user": "actraiser", + "keyword": keyword, + "type": "owner", + "sort": "full_name", + "order": "asc" + }, function(err, res) { + var jsonObj = []; + for (var i = 0, iLen = res.length; i < iLen; i++) { + if (res[i].name.match(keyword,'g')){ + jsonObj.push({ + id: res[i].id, + name: res[i].name, + description: res[i].description, + created_at: res[i].created_at, + homepage: res[i].homepage, + git_url: res[i].git_url, + owner: res[i].owner.login + }); + }; + } + callback(jsonObj); + }); + +} \ No newline at end of file diff --git a/lib/dust_setup b/lib/dust_setup new file mode 100755 index 0000000..7c50c39 --- /dev/null +++ b/lib/dust_setup @@ -0,0 +1,40 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + + +exports.compatibilityCheck = function(){ + if (dust.config.mod.support.mac === false){ + dust.color.red(); + console.log("operating system not supported:"); + process.stdout.write("Supported systems: "); + console.log(dust.config.mod.support); + dust.color.reset(); + dust.shell.exit(1); + } + +} + +exports.installStatus = function(success){ + if (success === true){ + dust.color.bold(); + console.log('-> completed!') + dust.color.reset(); + } + else{ + + dust.color.red(); + dust.color.bold(); + console.log('-> failed!') + dust.color.reset(); + } +} + + +exports.removeTemporaryDirectory = function(){ + process.stdout.write('removing temporary directory '); + if (dust.shell.test("-d", dust.shell.env['HOME'] + "/temp_dust_compile")){ + dust.shell.exec('rm -rf "$HOME/temp_dust_compile"', {silent:dust.silent}); + } + dust.setup.installStatus(true); +} + diff --git a/lib/dust_test b/lib/dust_test new file mode 100644 index 0000000..a530962 --- /dev/null +++ b/lib/dust_test @@ -0,0 +1,49 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +exports.okay = function(text){ + dust.color.green(); + dust.color.bold(); + process.stdout.write(text); + dust.color.reset(); +} + +exports.fail = function(text){ + dust.color.red(); + dust.color.bold(); + process.stdout.write(text); + dust.color.reset(); +} + + +exports.all = function (){ + dust.test.defaults(); + dust.test.modDependencies(); +} + +exports.defaults = function defaults(){ + console.log("Testing which tools used by 'dust' are installed on your system."); + console.log("This is a good way to check if 'dust setup' has worked properly."); + console.log(""); + dust.color.bold(); + console.log("Tools required on this machine before 'dust' can be used"); + console.log("--------------------------------------------------------"); + dust.color.reset(); + dust.shell.which('gcc') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("gcc is required to compile various sources"); + dust.shell.which('git') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("git fetches tutorials and tools from the Dustlayer Repository"); + dust.shell.which('node') ? dust.test.okay('[installed] ') : dust.test.fail('[not found]'); + dust.color.yellow(); + console.log("node.js is the framework 'dust' is build on"); + dust.color.reset(); + console.log(""); +} + +exports.modDependencies = function modDependencies(){ + return; +} + + diff --git a/lib/dust_text b/lib/dust_text new file mode 100644 index 0000000..2ec4cc3 --- /dev/null +++ b/lib/dust_text @@ -0,0 +1,44 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + + +exports.dustLogo = function dustLogo(){ + dust.color.bold(); + console.log(""); + console.log("________ __ __ "); + console.log("\\______ \\ __ __ _______/ |_| | _____ ___.__. ___________ "); + console.log(" | | \\| | \\/ ___/\\ __\\ | \\__ \\< | |/ __ \\_ __ \\"); + console.log(" | ` \\ | /\\___ \\ | | | |__/ __ \\\\___ \\ ___/| | \\/"); + console.log("/_______ /____//____ > |__| |____(____ / ____|\\___ >__| "); + console.log(" \\/ \\/ \\/\\/ \\/ "); + console.log(""); + dust.color.reset(); +} + +exports.welcomeMessage = function welcomeMessage(os,version){ + console.log("Welcome to Dust (c) actraiser/Dustlayer - v" + version + " on " + os); + dust.color.yellow(); + dust.color.bold(); + console.log("Use dust --help for command overview and examples (active mod: " + dust.config.activeMod + ")"); + dust.color.reset(); + dust.text.modTagline(); + console.log(""); +} + +exports.modTagline = function modTagLine(){ + console.log("Visit http://dustlayer.com"); +} + +// custom help examples +exports.defaultHelp = function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ dust clone : clones the dustlayer tools repository'); + console.log(' $ dust setup help : information on what setup does'); + console.log(' $ dust mods : list moddings for dust'); + console.log(' $ dust mod dust-mod-c64 : switch to c64 modding'); + console.log(' $ dust setup : setups tools from the cloned repository'); + console.log(' $ dust test : checks the system if required tools are installed'); + console.log(' $ dust tutorials : list avaialble tutorials for download'); + console.log(' $ dust tutorials download 1 : download tutorial #1'); +} diff --git a/lib/dust_tutorials b/lib/dust_tutorials new file mode 100644 index 0000000..0550a68 --- /dev/null +++ b/lib/dust_tutorials @@ -0,0 +1,65 @@ +#!/usr/bin/env node +var dust = require('../bin/dust'); + +exports.list = function(){ + dust.github.getJSON(dust.config.mods[dust.config.activeMod].tutorialsIdentifier,function (res){ + formatTutorialsList(res); + }); +}; + + + +exports.download = function downloadTutorial(id){ + dust.github.getJSON(dust.config.mods[dust.config.activeMod].tutorialsIdentifier,function (res){ + for (var i = 0, iLen = res.length; i < iLen; i++) { + if(i == parseInt(id, 10)){ + console.log(res[i].description); + if (dust.shell.test('-d',res[i].name)){ + console.log("Deleting previous download") + dust.shell.exec('rm -rf ' + res[i].name); + } + dust.shell.exec("git clone " + res[i].git_url); + dust.shell.exec("rm -rf " + res[i].name + '/.git'); + dust.color.reset(); + process.stdout.write("Tutorial: " ); + console.log(res[i].homepage); + dust.color.reset(); + dust.shell.exit(0); + } + } + console.log("Tutorial with id #" + id + " not found!"); + dust.shell.exit(1); + }); +} + +function formatTutorialsList(data){ + console.log("-----------------------------------------------------"); + for (var i = 0, iLen = data.length; i < iLen; i++) { + + var formattedName = formatName(data[i].name); + + dust.color.bold(); + console.log(padNumber(i,3,'0') + " " + formattedName + " by " + data[i].owner); + dust.color.reset(); + console.log("Description: " + data[i].description); + console.log("Indepth Info: " + data[i].homepage); + console.log("-----------------------------------------------------"); + dust.color.reset(); + } + dust.color.yellow().bold(); + console.log("you can download any tutorial code with the command: "); + console.log(" dust tutorials download "); + console.log("After the download a link with online help is shown! "); + dust.color.reset(); +} + +function padNumber(n, width, z) { + z = z || '0'; + n = n + ''; + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; +} + +function formatName(repositoryName){ + var strippedName = repositoryName.match(new RegExp(dust.config.mods[dust.config.activeMod].tutorialsIdentifier + '-[0-9]{3}-(.*)','i')); + return strippedName = strippedName[1].replace(/-/g, ' '); +} diff --git a/mods/c64/README.md b/mods/c64/README.md new file mode 100644 index 0000000..f24a507 --- /dev/null +++ b/mods/c64/README.md @@ -0,0 +1,4 @@ +dust-mod-c64 +============ + +dust-mod-c64 yo \ No newline at end of file diff --git a/mods/c64/config/mod.json b/mods/c64/config/mod.json new file mode 100644 index 0000000..47b4496 --- /dev/null +++ b/mods/c64/config/mod.json @@ -0,0 +1,120 @@ +{ + "about": { + "name": "c64", + "author": "actraiser/Dustlayer", + "contact": "acrtraiser@dustlayer.com", + "website": "http://www.dustlayer.com", + "description": "C64 cross development and tutorials" + }, + "support": { + "mac": true, + "linux": false, + "windows": false + }, + "setup": { + "mac": { + "preBundleUrl": "https://github.com/actraiser/dust-bundle-c64-mac.git", + "preBundleList": { + "acme" : { + "directory": "tools/Acme 0.94.4/src", + "installer": "installAcme" + }, + "exomizer" : { + "directory": "tools/Exomizer 2.0.6/src", + "installer": "installExomizer" + }, + "pucrunch" : { + "directory": "tools/pucrunch 8.3.2002", + "installer": "installPuCrunch" + }, + "sidreloc" : { + "directory": "tools/Sidreloc 1.0", + "installer": "installSidreloc" + }, + "installCompileScripts" : { + "directory": "compileScripts", + "installer": "installCompileScripts" + } + }, + "externals": { + "sublime": { + "name": "Sublime Text 2 v2.0.1 (Text Editor)", + "downloads": ["http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.dmg", + "https://www.dropbox.com/s/941yqzlgub88cth/Sublime%20Text%202.0.1.dmg"], + "filename": "Sublime Text 2.0.1.dmg", + "installer": "installSublimeText", + "postinstaller": "postInstallSublimeText", + "directory": "configurationSublime" + }, + "vice": { + "name": "Vice v2.4 (C64 Emulator)", + "downloads": ["http://sourceforge.net/projects/vice-emu/files/releases/binaries/macosx/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg/download", + "https://www.dropbox.com/s/jiepb1ngr17gq2j/vice-macosx-cocoa-i386%2Bx86_64-10.6-gcc42-2.4.dmg"], + "filename": "vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg", + "installer": "installVice" + }, + "winebottler": { + "name": "WineBottler v1.2.5 (Win32 Emulator)", + "downloads": ["http://mirrors.nolabelstudios.com/mikesmassivemess/files/WineBottlerCombo_1.2.5.dmg", + "https://www.dropbox.com/s/myia7xtp9u5oje0/WineBottlerCombo_1.2.5.dmg"], + "filename": "WineBottlerCombo_1.2.5.dmg", + "installer": "installWineBottler", + "postinstaller": "postInstallWineBottler", + "directory": "Win32" + + } + + }, + "installOptions": { + "all": { + "description" : "Install everything", + "list": { + "acme": true, + "exomizer": true, + "pucrunch": true, + "sidreloc": true, + "sublime": true, + "vice": true, + "winebottler": true + } + }, + "skip_sublime": { + "description" : "Install everything but Sublime Text 2", + "list": { + "acme": true, + "exomizer": true, + "pucrunch": true, + "sidreloc": true, + "sublime": false, + "vice": true, + "winebottler": true + } + }, + "skip_wine": { + "description" : "Install everything but WineBottler", + "list": { + "acme": true, + "exomizer": true, + "pucrunch": true, + "sidreloc": true, + "sublime": true, + "vice": true, + "winebottler": false + } + }, + "skip_sublime_and_wine": { + "description" : "Install without Sublime Text 2 or WineBottler", + "list": { + "acme": true, + "exomizer": true, + "pucrunch": true, + "sidreloc": true, + "sublime": false, + "vice": true, + "winebottler": false + } + } + } + } + } +} \ No newline at end of file diff --git a/mods/c64/lib/dust_cmd b/mods/c64/lib/dust_cmd new file mode 100644 index 0000000..0660b17 --- /dev/null +++ b/mods/c64/lib/dust_cmd @@ -0,0 +1,77 @@ +#!/usr/bin/env node +var dust = require('../../../bin/dust'); + + +// create skeletons for ASM or BASIC projects +dust.cmd + .command('create ') + .description('create new ASM or BASIC project') + .action(function(){ + createTemplate(dust.cmd.args); + }); + + + +// compile ASM +dust.cmd + .command('compile [path]') + .description('assemble dust.cmd, create c64 executable and run it') + .action(function(){ + compile(dust.cmd.args); + }); + + + +/************************************** +* function to exec * +***************************************/ + +function createTemplate(args){ + dust.color.green(); + console.log('Creating new ' + args[0] + ' template in ' + args[1]); + dust.color.reset(); + dust.templates.create(args); +} + + + +function compile(args){ + if (!test('-e', '/usr/local/bin/assemble_6502')) { + dust.color.red().bold(); + console.log ("assembler not set up correctly, please do dust setup"); + dust.color.reset(); + dust.shell.exit(1); + } + + if (args[0] === undefined){ + path = process.env['PWD']; + + if (test('-e', path + '/index.a')) { + console.log('index.a found - assembling 6502 code.'); + dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/index.a\""); + dust.shell.exit(0); + } + + if (test('-e', path + '/index.asm')) { + console.log('index.asm found - assembling 6502 code.'); + dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/index.asm\""); + dust.shell.exit(0); + } + dust.color.red().bold(); + console.log("Did not find any index.a or index.asm file to compile"); + dust.color.reset(); + dust.shell.exit(1); + } + + if (!test('-e', args[0])) { + console.log('given file does not exist.'); + dust.shell.exit(1); + } else { + path = process.env['PWD']; + if (args[0].match(process.env['PWD'])){ + path = ""; + } + dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/" + args[0] + "\""); + dust.shell.exit(0); + } +} \ No newline at end of file diff --git a/mods/c64/lib/dust_setup b/mods/c64/lib/dust_setup new file mode 100644 index 0000000..985a886 --- /dev/null +++ b/mods/c64/lib/dust_setup @@ -0,0 +1,307 @@ +#!/usr/bin/env node +var dust = require('../../../bin/dust'); +var savePWD = process.env['HOME']; + +dust.setup.clone = { + "mac": function(){ + cloneMac(); + } +} + + +dust.setup.install = { + "mac": { + "options": function(){ + showOptionsMac(); + }, + "run": function(){ + runInstallMac(); + } + } +} + + +/* installation start */ +function runInstallMac(configKey){ + var start = new Date().getTime(); + + // github location of a package of software prebundled for this mod + preBundleUrl = dust.config.mod.setup.mac.preBundleUrl; + // list of software prebundled + preBundleList = dust.config.mod.setup.mac.preBundleList; + // list of software downloaded from external sites + externalsList = dust.config.mod.setup.mac.externals; + + // selected installation configuration (includes prebundled and external software) + selectedInstallOptions = dust.config.mod.setup.mac.installOptions[configKey].list; + + // Create Temp Directory to work in + dust.shell.exec('mkdir "$HOME/temp_dust_compile"', {silent:dust.silent}); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile", {silent:dust.silent}); + regex = /.*\/(.*).git$/ + preBundleDirectory = regex.exec(preBundleUrl)[1]; + + // rm existing clone + dust.shell.rm('-rf', preBundleDirectory); + // clone repository + dust.shell.exec('git clone --progress ' + preBundleUrl); + + if (dust.shell.test('-d', dust.shell.env['HOME'] + "/temp_dust_compile/" + preBundleDirectory) === false){ + dust.test.fail("git clone failed - did you enter your password correctly?"); + console.log(""); + dust.shell.exit(1); + } + + dust.shell.cd(preBundleDirectory); + dust.shell.rm('-rf', '.git'); + + dust.color.bold(); + console.log(""); + console.log("Enter Sudo password if required to create system directories and copy binaries."); + console.log(""); + dust.color.reset(); + + + // all binaries go to /usr/local/bin - create if it does not exist + dust.shell.exec('sudo mkdir -p "/usr/local/bin"', {silent:dust.silent}); + + // install prebundled Software + for (var key in selectedInstallOptions){ + if (selectedInstallOptions[key] === true){ + // check if this is a prebundled or external software + if (dust.config.mod.setup.mac.preBundleList[key] != undefined){ + eval(preBundleList[key]['installer'] + "('" + preBundleList[key]['directory'] + "','" + preBundleDirectory + "');"); + } + else if (dust.config.mod.setup.mac.externals[key] != undefined){ + eval(externalsList[key]['installer'] + "('" + externalsList[key]['filename'] + "');"); + if (externalsList[key]['postinstaller'] != undefined) { + eval(externalsList[key]['postinstaller'] + "('" + externalsList[key]['directory'] + "','" + preBundleDirectory + "');"); + } + } + else{ + dust.test.fail("Error: " + key + " not found in the configuration file."); + } + } + else { + console.log('skipping ' + key + ' installation'); + } + } + + dust.setup.removeTemporaryDirectory(); + + dust.text.displayOutroText(); + var end = new Date().getTime(); + var time = end - start; + console.log(""); + dust.color.bold(); + console.log('Execution time: ' + parseInt(time/1000) + ' seconds'); + dust.color.reset(); + console.log(""); + dust.shell.exit(0) +} + + +function showOptionsMac(){ + combinations = eval("dust.config.mod.setup." + dust.env.operatingSystem.toLowerCase() + ".installOptions"); + options = []; + i=1; + dust.color.bold(); + for (var key in combinations) { + options[i] = []; + options[i]['key'] = key; + options[i]['description'] = combinations[key]['description']; + console.log(i+". " + options[i]['description']); + i++; + } + + dust.cmd.prompt('Choice: ', function(choice){ + choice = parseInt(choice); + + if (choice>i || choice < 1 || isNaN(choice) ){ + dust.test.fail('Choice out of range - please retry'); + console.log(""); + showOptionsMac(); + return; + } + console.log('You have chosen option #%d "%s"', choice, options[choice]['description']); + dust.color.reset(); + runInstallMac(options[choice]['key']); + }); + +} + +function installAcme(workdir,bundledir){ + process.stdout.write('installing acme '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec('make', {silent:dust.silent}); + dust.shell.exec('sudo make install', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function installExomizer(workdir,bundledir){ + process.stdout.write('installing Exomizer '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec('make', {silent:dust.silent}); + dust.shell.exec('sudo cp "exobasic" "/usr/local/bin"', {silent:dust.silent}); + dust.shell.exec('sudo cp "exomizer" "/usr/local/bin"', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function installPuCrunch(workdir,bundledir){ + process.stdout.write('installing PuCrunch '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec('make', {silent:dust.silent}); + dust.shell.exec('sudo cp "pucrunch" "/usr/local/bin"', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function installSidreloc(workdir,bundledir){ + process.stdout.write('installing Sidreloc '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec('make', {silent:dust.silent}); + dust.shell.exec('sudo make install', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function installCompileScripts(workdir,bundledir){ + process.stdout.write('installing Sidreloc '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + process.stdout.write('installing build scripts for 6502 and BASIC '); + dust.shell.exec('sudo cp -v "$PWD/scripts/assemble_6502" "/usr/local/bin"', {silent:dust.silent}); + dust.shell.exec('sudo cp -v "$PWD/scripts/tokenize_basic" "/usr/local/bin"', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function installSublimeText(filename){ + process.stdout.write('installing Sublime Text 2 '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); + dust.externals.download('mac', dust.config.mod.setup.mac.externals.sublime.downloads[0], filename,true); + process.stdout.write('installing '); + + dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/' + filename +'"', {silent:dust.silent}); + dust.shell.exec('cp -R -v "/Volumes/Sublime Text 2/Sublime Text 2.app" "/Volumes/Sublime Text 2/Applications"', {silent:dust.silent}); + dust.shell.exec('hdiutil detach "/Volumes/Sublime Text 2"', {silent:dust.silent}); + dust.setup.installStatus(true); +} + +function postInstallSublimeText(workdir,bundledir){ + process.stdout.write("Copying Sublime Text 2 Configuration "); + if (dust.shell.test("-d", "/Applications/Sublime Text 2.app")){ + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec('sudo mv -v "Sublime Text 2/sublime" "/usr/local/bin"', {silent:dust.silent}); + dust.shell.exec('mkdir -p "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); + dust.shell.exec('cp -R -v "Sublime Text 2/" "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); + dust.setup.installStatus(true); + } + else { + dust.color.yellow(); + console.log("sublime not available - no build systems were configured"); + dust.color.reset(); + } +} + +function installVice(filename){ + process.stdout.write('installing Vice '); + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); + + dust.externals.download('mac', dust.config.mod.setup.mac.externals.vice.downloads[0], filename,true); + process.stdout.write('installing '); + + dust.shell.exec('mkdir /Applications/Vice64', {silent:dust.silent}); + dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg"', {silent:dust.silent}); + dust.shell.exec('cp -R -v "/Volumes/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4/" "/Applications/Vice64"', {silent:dust.silent}); + dust.shell.exec('hdiutil detach "/Volumes/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4"', {silent:dust.silent}); + dust.shell.exec('sudo cp -v "/Applications/Vice64/tools/petcat" "/usr/local/bin"', {silent:dust.silent}); + + dust.setup.installStatus(true); +} + +function installWineBottler(filename){ + process.stdout.write('installing Winebottler '); + dust.externals.download('mac', dust.config.mod.setup.mac.externals.winebottler.downloads[0], filename,true); + process.stdout.write('installing '); + + dust.shell.exec('hdiutil attach -nobrowse "$HOME/temp_dust_compile/WineBottlerCombo_1.2.5.dmg"', {silent:dust.silent}); + dust.shell.exec('cp -R -v "/Volumes/WineBottler Combo/Wine.app" "/Volumes/WineBottler Combo/Applications"', {silent:dust.silent}); + dust.shell.exec('cp -R -v "/Volumes/WineBottler Combo/WineBottler.app" "/Volumes/WineBottler Combo/Applications"', {silent:dust.silent}); + dust.shell.exec('hdiutil detach "/Volumes/WineBottler Combo"', {silent:dust.silent}); + dust.setup.installStatus(true); +} + + +function sleeper(seconds){ + dust.shell.exec('sleep ' + seconds); + process.stdout.write("."); +} + + +function postInstallWineBottler(workdir,bundledir){ + + if (dust.shell.test("-d", dust.shell.env['HOME'] + "/Wine Files/drive_c/Program Files") === false){ + dust.color.bold(); + dust.color.red(); + console.log(""); + console.log("We will need to open a Win32 App briefly to auto-configure wine."); + console.log("You can close the application when it finished loading."); + console.log("'dust' setup will finish automatically."); + dust.color.reset(); + + dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); + dust.shell.cd(workdir); + dust.shell.exec("open 'SpritePad 1.8/SpritePad.exe'"); + + waitForDirectory(); + + } +} + + +function waitForDirectory(){ + if (dust.shell.test("-d", dust.shell.env['HOME'] + "/Wine Files/drive_c/Program Files") === true){ + console.log("Wine has created required directories") + //dust.shell.exec("sudo kill $(ps aux | grep 'X11' | awk '{print $2}')") + process.stdout.write("Copying Win32 programs "); + dust.shell.exec('cp -R -v "." "$HOME/Wine Files/drive_c/Program Files"', {silent:dust.silent}); + dust.shell.exec('ln -s "$HOME/Wine Files/drive_c/Program Files" "$HOME/Desktop/Win32 Apps"', {silent:dust.silent}); + dust.setup.installStatus(true); + } + else{ + sleeper(1); + waitForDirectory(); + + } +} + +function cloneMac(){ + console.log (""); + console.log("Cloning Repository - this may take a while."); + console.log (""); + + if (dust.shell.exec('which git').code !== 0){ + dust.color.red(); + dust.color.bold(); + console.log('git command not found - have you installed git?'); + console.log('download it at http://git-scm.com/downloads') + console.log("More information on setup requirements with 'dust setup requirements") + dust.color.reset(); + dust.shell.exit(0); + } + + + if (dust.shell.exec('git clone --verbose https://github.com/actraiser/dust-setup-osx.git').code === 0) { + dust.color.green(); + console.log('Cloning Repository succeeded'); + console.log("Change to 'dust-setup-osx' directory and run 'dust setup'"); + dust.color.reset(); + dust.shell.exit(1); + } else { + console.log("there was a problem cloning the repository - please try to clone again!"); + dust.shell.exit(1); + } +} diff --git a/mods/c64/lib/dust_test b/mods/c64/lib/dust_test new file mode 100644 index 0000000..86ffd9b --- /dev/null +++ b/mods/c64/lib/dust_test @@ -0,0 +1,102 @@ +#!/usr/bin/env node +var dust = require('../../../bin/dust'); + +dust.test.modDependencies = function modDependencies(){ + console.log("Tools which are installed and configured by 'dust'"); + console.log("--------------------------------------------------"); + dust.color.reset(); + + dust.shell.which('acme') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("ACME 6502 Cross Compiler"); + + dust.shell.test('-e', '/Applications/Vice64/x64.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Vice64 C64 Emulator"); + + dust.shell.test('-e', '/usr/local/bin/assemble_6502') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("6502 build script invoked from shell or IDE"); + + dust.shell.test('-e', '/usr/local/bin/tokenize_basic') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("BASIC build script invoked from shell or IDE"); + + dust.shell.test('-e', '/usr/local/bin/sidreloc') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Sidreloc is a tool to relocate SIDs in memory"); + + dust.shell.test('-e', '/usr/local/bin/pucrunch') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("PuCrunch is a packer for your compiled 6502 programs"); + + dust.shell.test('-e', '/usr/local/bin/petcat') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Petcat converts between ASCII and PETSCII Format"); + + dust.shell.test('-e', '/usr/local/bin/exobasic') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Exobasic builds and optionally packs BASIC programs"); + + dust.color.reset(); + dust.color.bold(); + console.log(""); + console.log("Optional tools which 'dust' offers to install and to configure"); + console.log("--------------------------------------------------------------"); + dust.color.reset(); + + dust.shell.test('-e', '/Applications/Sublime Text 2.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Sublime Text 2 - the popular editor for Mac OSX"); + + dust.shell.test('-d', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/6502asm.tmbundle") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("6502 Syntax Highlighting for Sublime Text 2"); + + dust.shell.test('-e', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/User/6502 Assembly (DASM).sublime-settings") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("6502 Syntax Highlighting Configuration for Sublime Text 2"); + + dust.shell.test('-e', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/User/C64-6502.sublime-build") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("6502 Build System for Sublime Text 2"); + + dust.shell.test('-d', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/asp.vb.net.tmbundle") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("BASIC Highlighting for Sublime Text 2"); + + dust.shell.test('-e', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/User/ASP.sublime-settings") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("BASIC Syntax Highlighting Configuration for Sublime Text 2"); + + dust.shell.test('-e', process.env['HOME'] + "/Library/Application Support/Sublime Text 2/Packages/User/C64-BASIC.sublime-build") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("BASIC Build System for Sublime Text 2"); + + dust.shell.test('-e', '/usr/local/bin/sublime') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("a terminal shortcut that launches Sublime Text 2"); + + dust.shell.test('-e', '/Applications/Wine.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Wine emulates Win32 programs on Mac OSX"); + + dust.shell.test('-e', '/Applications/WineBottler.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("WineBottler is a GUI for Wine"); + + dust.shell.test('-d', process.env['HOME'] + "/Wine Files/drive_c/Program Files/CharPad 1.8") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("CharPad 1.8 Win32 Character Editor"); + + dust.shell.test('-d', process.env['HOME'] + "/Wine Files/drive_c/Program Files/SpritePad 1.8") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("SpritePad 1.8 Win32 Sprite Editor"); + + dust.shell.test('-d', process.env['HOME'] + "/Desktop/Win32 Apps") ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); + dust.color.yellow(); + console.log("Shortcut on Desktop to Win32 Apps directory"); + + dust.color.reset(); + console.log(""); +} diff --git a/mods/c64/lib/dust_text b/mods/c64/lib/dust_text new file mode 100644 index 0000000..0b3154b --- /dev/null +++ b/mods/c64/lib/dust_text @@ -0,0 +1,71 @@ +#!/usr/bin/env node +var dust = require('../../../bin/dust'); + +dust.text.displayOutroText = function displayOutroText(){ + console.log(""); + console.log("#######################################################"); + console.log("# #"); + console.log("# Installation is completed! Congratulations! #"); + console.log("# #"); + console.log("# use 'dust test' to check installation status. #"); + console.log("# #"); + console.log("# type 'dust --help' for examples on using 'dust' #"); + console.log("# #"); + console.log("# check http://dustlayer.com for indepth tutorials! #"); + console.log("#######################################################"); + console.log(""); +} + + +dust.text.modTagline = function modTagLine(){ + console.log("Visit http://dustlayer.com for C64 Tutorials"); +} + + +dust.text.displayInstallationHelp = function(){ + console.log(""); + console.log("'dust' needs a few command line tools installed to work properly."); + console.log("Also cross-development for C64 without the emulator Vice"); + console.log("does not make much sense, so this must be installed as well and"); + console.log("properly linked to 'dust'. 'dust setup' will take of this."); + console.log(""); + console.log("Unless you dont want to 'dust' will install some great tools to make "); + console.log("C64 development more fun - notable the following:"); + console.log(""); + console.log("'Sublime Text 2' is an awesome editor which will"); + console.log("not only be installed but also configured for C64 development with Syntax Highlighting"); + console.log("and build systems to compile and run 6502 and BASIC code on a keypress"); + console.log("If you skip the installation because you already have 'Sublime Text 2'installed, "); + console.log("'dust' will add the requirement build systems and syntax highlighting "); + console.log("to your existing installation."); + console.log(""); + console.log("There are also not any viable program ons Mac to work with C64 graphics, sprites "); + console.log("and character sets. To provide this, 'dust' will install 'Wine' which can run"); + console.log("Windows Applications on your Mac. Together with Wine a few standard C64-related "); + console.log("Windows applications are installed and configured."); + console.log(""); + console.log("Note that all configuration files of previously installed tools are not modified,"); + console.log("so running the setup routine again to update software or add new tools is fine."); + console.log(""); + console.log("Change to your cloned tools directory and type 'dust setup' to choose your"); + console.log("prefered installation."); + console.log(""); + +}; + +dust.text.displayInstallationRequirements = function(){ + console.log("To setup utilities and make everything in 'dust' work, the following must be in place:"); + console.log(""); + console.log("'XCode' to install gcc compiler and other useful command line tools."); + console.log("'git' to clone the tools repository and the tutorial source codes"); + console.log(""); + console.log("More information is available in the introduction to 'dust' on http://dustlayer.com"); + console.log(""); +}; + +dust.text.modHelp = function(){ + console.log(' $ dust create asm my_asm : create new ASM project in "my_asm"' ); + console.log(' $ dust create basic my_basic : create new BASIC project in "my_basic"' ); + console.log(' $ dust compile : looks for index.a or index.asm, compiles and runs it'); + console.log(' $ dust compile /myproject/source.asm : compiles and runs given file'); +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..930a641 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "dustlayer", + "preferGlobal": true, + "version": "0.2.0", + "homepage": "http://dustlayer.com", + "author": "actraiser ", + "description": "command line suite for new and experienced retro programmers. Check homepage for details.", + "main": "./bin/dust", + "bin": "./bin/dust", + "repository": { + "type": "git", + "url": "https://github.com/actraiser/dust.git" + }, + "bugs": { + "url" : "https://github.com/actraiser/dust/issues", + "email" : "actraiser@dustlayer.com" + }, + "keywords": [ + "cli", + "c64", + "programming", + "setup" + ], + "preferGlobal": true, + "dependencies" : { + "shelljs" : ">=0.1.2", + "commander" : ">=0.1.0", + "github" : ">=0.1.8", + "ansi": ">=0.1.2" + }, + "analyze": false, + "bundledDependencies": [ + "union", + "ecstatic" + ], + "license": "MIT", + "engines": { + "node": ">=0.8" + }, + "os" : [ "darwin" ] +} \ No newline at end of file