├── mods ├── pce │ ├── lib │ │ ├── dust_test │ │ ├── dust_text │ │ ├── dust_templates │ │ ├── dust_cmd │ │ └── dust_setup │ └── config │ │ └── mod.json └── c64 │ ├── lib │ ├── dust_templates │ ├── dust_cmd │ ├── dust_text │ ├── dust_test │ └── dust_setup │ └── config │ └── mod.json ├── .gitignore ├── .npmignore ├── lib ├── dust_templates ├── dust_externals ├── dust_env ├── dust_github ├── dust_setup ├── dust_boot ├── dust_test ├── dust_text ├── dust_tutorials └── dust_cmd ├── package.json ├── MIT-LICENSE.txt ├── README.md └── bin └── dust /mods/pce/lib/dust_test: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mods/pce/lib/dust_text: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mods/pce/lib/dust_templates: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | .DS_Store -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .git/ 3 | .DS_Store 4 | .gitignore 5 | -------------------------------------------------------------------------------- /lib/dust_templates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * to be overwritten by mods * 6 | ***************************************/ -------------------------------------------------------------------------------- /lib/dust_externals: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * progress bar when downloading * 6 | ***************************************/ 7 | 8 | /* 9 | var externalConfig = dust.config.externals 10 | 11 | // overwrite to display progress bar 12 | exports.config = externalConfig; 13 | */ 14 | 15 | exports.download = function download(os, link, filename, silent){ 16 | dust.color.bold(); 17 | process.stdout.write('downloading '); 18 | console.log(""); 19 | dust.shell.exec('curl --progress-bar -L -o "$HOME/temp_dust_compile/' + filename + '" "' + link + '"' , {silent: false}); 20 | dust.color.reset(); 21 | console.log(""); 22 | } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dustlayer", 3 | "preferGlobal": true, 4 | "version": "0.5.3", 5 | "homepage": "http://dustlayer.com", 6 | "author": "actraiser ", 7 | "description": "command line suite for new and experienced retro programmers. Check homepage for details.", 8 | "main": "./bin/dust", 9 | "bin": { 10 | "dust": "./bin/dust" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/actraiser/dustlayer.git" 15 | }, 16 | "bugs": { 17 | "url" : "https://github.com/actraiser/dustlayer/issues", 18 | "email" : "actraiser@dustlayer.com" 19 | }, 20 | "keywords": [ 21 | "cli", 22 | "c64", 23 | "programming", 24 | "setup" 25 | ], 26 | "preferGlobal": true, 27 | "dependencies" : { 28 | "shelljs" : "0.1.2", 29 | "commander" : "0.6.1", 30 | "github" : "0.1.8", 31 | "ansi": "0.1.2" 32 | }, 33 | "license": "MIT", 34 | "engines": { 35 | "node": ">=0.8" 36 | }, 37 | "os" : [ "darwin" ] 38 | } -------------------------------------------------------------------------------- /lib/dust_env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * get operating system * 6 | * and set DUST version * 7 | ***************************************/ 8 | 9 | var operatingSystem = operatingSystem(); 10 | var osVersion = dust.shell.exec("sw_vers -productVersion", {silent:dust.silent}).output; 11 | var dustVersion = '0.5.2 (2015-12-01)'; 12 | 13 | exports.operatingSystem = operatingSystem 14 | exports.osVersion = osVersion; 15 | exports.dustVersion = dustVersion; 16 | 17 | 18 | function operatingSystem(){ 19 | // Check which platform we are working with 20 | var operatingSystem = process.platform; 21 | switch (operatingSystem) { 22 | case 'linux': 23 | operatingSystem = 'Linux'; 24 | break; 25 | case 'darwin': 26 | operatingSystem = 'Mac'; 27 | break; 28 | //match(/^win/) == Windows Platform, we default to it 29 | default: 30 | operatingSystem = 'Windows'; 31 | break; 32 | } 33 | 34 | return operatingSystem 35 | 36 | } 37 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016 Rocco Di Leo aka actraiser/Dustlayer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /lib/dust_github: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * Setup Github Access * 6 | * Get information of repositories * 7 | ***************************************/ 8 | 9 | var GitHubApi = require("github"); 10 | var github = new GitHubApi({ 11 | version: "3.0.0", 12 | timeout: 5000 13 | }); 14 | 15 | exports.getJSON = function(keyword,callback){ 16 | github.repos.getFromUser({ 17 | "user": "actraiser", 18 | "keyword": keyword, 19 | "type": "owner", 20 | "sort": "full_name", 21 | "order": "asc" 22 | }, function(err, res) { 23 | var jsonObj = []; 24 | for (var i = 0, iLen = res.length; i < iLen; i++) { 25 | if (res[i].name.match(keyword,'g')){ 26 | jsonObj.push({ 27 | id: res[i].id, 28 | name: res[i].name, 29 | description: res[i].description, 30 | created_at: res[i].created_at, 31 | homepage: res[i].homepage, 32 | git_url: res[i].git_url, 33 | owner: res[i].owner.login 34 | }); 35 | }; 36 | } 37 | callback(jsonObj); 38 | }); 39 | 40 | } -------------------------------------------------------------------------------- /lib/dust_setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * check setup progress * 6 | * and glboal clean up methods * 7 | ***************************************/ 8 | 9 | exports.compatibilityCheck = function(){ 10 | if (dust.config.mod.support.mac === false){ 11 | dust.color.red(); 12 | console.log("operating system not supported:"); 13 | process.stdout.write("Supported systems: "); 14 | console.log(dust.config.mod.support); 15 | dust.color.reset(); 16 | dust.shell.exit(1); 17 | } 18 | 19 | } 20 | 21 | exports.installStatus = function(success){ 22 | if (success === true){ 23 | dust.color.bold(); 24 | console.log('-> completed!') 25 | dust.color.reset(); 26 | } 27 | else{ 28 | 29 | dust.color.red(); 30 | dust.color.bold(); 31 | console.log('-> failed!') 32 | dust.color.reset(); 33 | } 34 | } 35 | 36 | 37 | exports.removeTemporaryDirectory = function(){ 38 | process.stdout.write('removing temporary directory '); 39 | if (dust.shell.test("-d", dust.shell.env['HOME'] + "/temp_dust_compile")){ 40 | dust.shell.exec('rm -rf "$HOME/temp_dust_compile"', {silent:dust.silent}); 41 | } 42 | dust.setup.installStatus(true); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /lib/dust_boot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /************************************ 4 | * while booting include * 5 | * files required by the mod * 6 | * and parse the user input * 7 | *************************************/ 8 | 9 | var dust = require('../bin/dust'); 10 | 11 | // set up active mod from config file (default: c64) 12 | dust.config.mod = require("../mods/" + dust.config.activeMod + '/config/mod.json'); 13 | 14 | // get texts used for this mod 15 | require("../mods/" + dust.config.activeMod + '/lib/dust_text'); 16 | 17 | /* Initial Message */ 18 | dust.shell.exec("clear"); 19 | 20 | // show Dustlayer logo unless disabled by configuration 21 | if (dust.config.dustLogo === true) { 22 | dust.text.dustLogo(); 23 | } 24 | // show welcome message and version number 25 | dust.text.welcomeMessage(dust.env.operatingSystem+ " " + dust.env.osVersion, dust.env.dustVersion); 26 | 27 | // include modded tests 28 | require("../mods/" + dust.config.activeMod + '/lib/dust_test'); 29 | 30 | // include modded setup 31 | require("../mods/" + dust.config.activeMod + '/lib/dust_setup'); 32 | 33 | // include modded commands 34 | require("../mods/" + dust.config.activeMod + '/lib/dust_cmd'); 35 | 36 | // include modded templates 37 | require("../mods/" + dust.config.activeMod + '/lib/dust_templates'); 38 | 39 | // parse the command entered by the user 40 | dust.cmd.parse(process.argv); 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /lib/dust_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | exports.okay = function(text){ 5 | dust.color.green(); 6 | dust.color.bold(); 7 | process.stdout.write(text); 8 | dust.color.reset(); 9 | } 10 | 11 | exports.fail = function(text){ 12 | dust.color.red(); 13 | dust.color.bold(); 14 | process.stdout.write(text); 15 | dust.color.reset(); 16 | } 17 | 18 | 19 | exports.all = function (){ 20 | dust.test.defaults(); 21 | dust.test.modDependencies(); 22 | } 23 | 24 | exports.defaults = function defaults(){ 25 | console.log("Testing which tools used by 'dust' are installed on your system."); 26 | console.log("This is a good way to check if 'dust setup' has worked properly."); 27 | console.log(""); 28 | dust.color.bold(); 29 | console.log("Tools required on this machine before 'dust' can be used"); 30 | console.log("--------------------------------------------------------"); 31 | dust.color.reset(); 32 | dust.shell.which('gcc') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 33 | dust.color.yellow(); 34 | console.log("gcc is required to compile various sources"); 35 | dust.shell.which('git') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 36 | dust.color.yellow(); 37 | console.log("git fetches tutorials and tools from the Dustlayer Repository"); 38 | dust.shell.which('node') ? dust.test.okay('[installed] ') : dust.test.fail('[not found]'); 39 | dust.color.yellow(); 40 | console.log("node.js is the framework 'dust' is build on"); 41 | dust.color.reset(); 42 | console.log(""); 43 | } 44 | 45 | exports.modDependencies = function modDependencies(){ 46 | return; 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /lib/dust_text: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | 5 | exports.dustLogo = function dustLogo(){ 6 | dust.color.bold(); 7 | console.log(""); 8 | console.log("________ __ __ "); 9 | console.log("\\______ \\ __ __ _______/ |_| | _____ ___.__. ___________ "); 10 | console.log(" | | \\| | \\/ ___/\\ __\\ | \\__ \\< | |/ __ \\_ __ \\"); 11 | console.log(" | ` \\ | /\\___ \\ | | | |__/ __ \\\\___ \\ ___/| | \\/"); 12 | console.log("/_______ /____//____ > |__| |____(____ / ____|\\___ >__| "); 13 | console.log(" \\/ \\/ \\/\\/ \\/ "); 14 | console.log(""); 15 | dust.color.reset(); 16 | } 17 | 18 | exports.welcomeMessage = function welcomeMessage(os,version){ 19 | console.log("Welcome to Dust (c) actraiser/Dustlayer - v" + version + " on " + os); 20 | dust.color.yellow(); 21 | dust.color.bold(); 22 | console.log("Use dust --help for command overview and examples (active mod: " + dust.config.activeMod + ")"); 23 | dust.color.reset(); 24 | dust.text.modTagline(); 25 | console.log(""); 26 | } 27 | 28 | exports.modTagline = function modTagLine(){ 29 | console.log("Visit http://dustlayer.com"); 30 | } 31 | 32 | // custom help examples 33 | exports.defaultHelp = function(){ 34 | console.log(' Examples:'); 35 | console.log(''); 36 | console.log(' $ dust setup help : information on what setup does'); 37 | console.log(' $ dust setup : setups tools from the cloned repository'); 38 | console.log(' $ dust test : checks the system if required tools are installed'); 39 | console.log(' $ dust tutorials : list and download tutorial code'); 40 | } 41 | -------------------------------------------------------------------------------- /lib/dust_tutorials: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | exports.list = function(){ 4 | dust.github.getJSON(dust.config.mods[dust.config.activeMod].tutorialsIdentifier, function (res){ 5 | formatTutorialsList(res); 6 | }); 7 | }; 8 | 9 | exports.create = function downloadTutorial(repo){ 10 | if (dust.shell.test('-d',repo)){ 11 | console.log("Deleting previous download") 12 | dust.shell.exec('rm -rf ' + repo); 13 | } 14 | dust.shell.exec("git clone https://github.com/actraiser/" + repo + '.git '); 15 | dust.shell.exec("rm -rf " + repo + '/.git'); 16 | dust.color.reset(); 17 | dust.shell.exit(0); 18 | console.log("Tutorial with id #" + id + " not found!"); 19 | dust.shell.exit(1); 20 | } 21 | 22 | function downloadTutorial(repo){ 23 | console.log("downloading from repo " + repo); 24 | dust.tutorials.create(repo); 25 | } 26 | 27 | function formatTutorialsList(data){ 28 | var list = new Array(); 29 | console.log("-----------------------------------------------------"); 30 | for (var i = 0, iLen = data.length; i < iLen; i++) { 31 | var formattedName = formatName(data[i].name); 32 | dust.color.bold(); 33 | console.log(formattedName + " by " + data[i].owner); 34 | list.push(formattedName); 35 | dust.color.reset(); 36 | console.log(data[i].description); 37 | console.log("Tutorial: " + data[i].homepage); 38 | console.log("-----------------------------------------------------"); 39 | dust.color.reset(); 40 | } 41 | dust.color.yellow().bold(); 42 | console.log("Please choose which tutorial code to download: "); 43 | 44 | 45 | dust.cmd.choose(list, function(i){ 46 | console.log('you chose "%s"', i, list[i]); 47 | downloadTutorial(data[i].name); 48 | }); 49 | 50 | dust.color.reset(); 51 | } 52 | 53 | function formatName(repositoryName){ 54 | var strippedName = repositoryName.match(new RegExp(dust.config.mods[dust.config.activeMod].tutorialsIdentifier + '-','i')); 55 | strippedName = repositoryName.replace(strippedName[0], ''); 56 | strippedName = strippedName.replace(/-/g, ' '); 57 | return strippedName; 58 | } 59 | -------------------------------------------------------------------------------- /mods/c64/lib/dust_templates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | dust.templates.list = function(target){ 4 | dust.github.getJSON(dust.config.mods[dust.config.activeMod].templatesIdentifier, function (res){ 5 | formatTemplatesList(res,target); 6 | }); 7 | }; 8 | 9 | dust.templates.create = function downloadTemplate(repo,target){ 10 | if (dust.shell.test('-d',target)){ 11 | console.log("Deleting previous download") 12 | dust.shell.exec('rm -rf ' + target); 13 | } 14 | dust.shell.exec("git clone https://github.com/actraiser/" + repo + '.git ' + target); 15 | dust.shell.exec("rm -rf " + repo + '/.git'); 16 | dust.color.reset(); 17 | dust.shell.exit(0); 18 | console.log("Template with id #" + id + " not found!"); 19 | dust.shell.exit(1); 20 | } 21 | 22 | function downloadTemplate(repo, target){ 23 | console.log("downloading from repo " + repo + " into directory '" + target + "'"); 24 | dust.templates.create(repo,target); 25 | } 26 | 27 | function formatTemplatesList(data,target){ 28 | var list = new Array(); 29 | console.log("-----------------------------------------------------"); 30 | for (var i = 0, iLen = data.length; i < iLen; i++) { 31 | var formattedName = formatName(data[i].name); 32 | dust.color.bold(); 33 | console.log(formattedName + " by " + data[i].owner); 34 | list.push(formattedName); 35 | dust.color.reset(); 36 | console.log(data[i].description); 37 | console.log("-----------------------------------------------------"); 38 | dust.color.reset(); 39 | } 40 | dust.color.yellow().bold(); 41 | console.log("Please choose which template to download: "); 42 | 43 | 44 | dust.cmd.choose(list, function(i){ 45 | console.log('you chose "%s"', i, list[i]); 46 | downloadTemplate(data[i].name, target); 47 | }); 48 | 49 | dust.color.reset(); 50 | } 51 | 52 | function formatName(repositoryName){ 53 | var strippedName = repositoryName.match(new RegExp(dust.config.mods[dust.config.activeMod].templatesIdentifier + '-','i')); 54 | strippedName = repositoryName.replace(strippedName[0], ''); 55 | strippedName = strippedName.replace(/-/g, ' '); 56 | return strippedName; 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dust # 2 | 3 | (c) actraiser/Dustlayer 4 | 5 | Dustlayer WHQ: http://dustlayer.com 6 | Facebook: https://www.facebook.com/dustlayer.c64.coding 7 | Twitter: https://twitter.com/actraiser 8 | Email: actraiser@dustlayer.com 9 | 10 | Dust is part of a bigger project consisting of a blog with coding tutorials and various projects. Check the Website. 11 | 12 | ## Synopsis ## 13 | 14 | Dust ist a node.js driven versatile command line suite for new and experienced C64 programmers on Mac OSX. 15 | This first version installs and configures the tool chain and helps you to kickstart cross-development projects. 16 | 17 | ## Feature List ## 18 | 19 | - Cross Development Setup Installer 20 | - Installs and configures all tools required for efficient C64 Coding (currently only OSX) 21 | - ACME 22 | - Vice 23 | - Crunchers 24 | - and more 25 | - Automatic Sublime Installation and Configuration 26 | - 6502 and BASIC syntax highlighting 27 | - Instangt Build & Run Options for ASM and BASIC projects 28 | - Auto-Start in Vice via BASIC loader 29 | - Advanced Vice integration 30 | - Labels export to Vice Monitor at Build time 31 | - Compile and Run in Vice from Editor 32 | - C64 Coding Tutorials 33 | - Generate new ASM or BASIC project from Tutorials Database 34 | - Preconfigured Projects with BASIC Loader 35 | - Follows Dustlayer project layout 36 | - Runs and Compiles without modifications 37 | 38 | ## Installation ## 39 | 40 | Install node.js from [nodejs.org](http://nodejs.org/download/) for your operating system. Then install *dust* via the node package manager 41 | 42 | sudo npm install -g dustlayer 43 | 44 | Then you are good to go, typical you want to setup the tools: 45 | 46 | dust setup 47 | 48 | [... once this is done ...] 49 | 50 | dust test # shows if everything is in place 51 | 52 | 53 | Download a tutorial to check if your setup works: 54 | 55 | cd ~ 56 | dust tutorials # list tutorial code and select one for download 57 | # cd into the directory and run dust compile 58 | dust compile # compiles the C64 code and runs it in the C64 Emulator 59 | 60 | or open the project in Sublime first and build from context menu 61 | 62 | # cd into the directory 63 | sublime . 64 | 65 | Then hit CMD-B - if nothing happens, you need to select one time the appropriate build system in Tools->Build System->C64-6502, then hit again CMD-B 66 | 67 | Checkout http://dustlayer.com for tutorials and an indepth explanation how all that stuff works. 68 | 69 | -act/Dustlayer 70 | -------------------------------------------------------------------------------- /mods/pce/lib/dust_cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | 4 | 5 | // create skeletons for ASM or BASIC projects 6 | dust.cmd 7 | .command('create ') 8 | .description('create a new project from template into a directory') 9 | .action(function(){ 10 | createFromTemplate(dust.cmd.args); 11 | }); 12 | 13 | 14 | 15 | // compile ASM 16 | dust.cmd 17 | .command('compile [path]') 18 | .description('assemble dust.cmd, create pce image and run it') 19 | .action(function(){ 20 | compile(dust.cmd.args); 21 | }); 22 | 23 | 24 | 25 | /************************************** 26 | * function to exec * 27 | ***************************************/ 28 | 29 | function compile(args){ 30 | console.log("CMD compile TODO") 31 | return; 32 | if (!dust.shell.test('-e', '/usr/local/bin/assemble_6502')) { 33 | dust.color.red().bold(); 34 | console.log ("assembler not set up correctly, please do dust setup"); 35 | dust.color.reset(); 36 | dust.shell.exit(1); 37 | } 38 | 39 | if (args[0] === undefined){ 40 | path = process.env['PWD']; 41 | 42 | if (dust.shell.test('-e', path + '/index.a')) { 43 | console.log('index.a found - assembling 6502 code.'); 44 | dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/index.a\""); 45 | dust.shell.exit(0); 46 | } 47 | 48 | if (dust.shell.test('-e', path + '/index.asm')) { 49 | console.log('index.asm found - assembling 6502 code.'); 50 | dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/index.asm\""); 51 | dust.shell.exit(0); 52 | } 53 | dust.color.red().bold(); 54 | console.log("Did not find any index.a or index.asm file to compile"); 55 | dust.color.reset(); 56 | dust.shell.exit(1); 57 | } 58 | 59 | if (!dust.shell.test('-e', args[0])) { 60 | console.log('given file does not exist.'); 61 | dust.shell.exit(1); 62 | } else { 63 | path = process.env['PWD']; 64 | if (args[0].match(process.env['PWD'])){ 65 | path = ""; 66 | } 67 | dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/" + args[0] + "\""); 68 | dust.shell.exit(0); 69 | } 70 | } 71 | 72 | function createFromTemplate(args){ 73 | console.log("CMD createFromTemplate TODO") 74 | return; 75 | if (!dust.shell.which('git')) { 76 | dust.color.red().bold(); 77 | console.log ("git not set up correctly, please install git"); 78 | dust.color.reset(); 79 | dust.shell.exit(1); 80 | } 81 | if (args.length > 0){ 82 | console.log('Listing available Templates' ); 83 | dust.templates.list(args[0]); 84 | } 85 | } -------------------------------------------------------------------------------- /mods/pce/config/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "about": { 3 | "name": "PC-Engine", 4 | "author": "actraiser/Dustlayer", 5 | "contact": "acrtraiser@dustlayer.com", 6 | "website": "http://www.dustlayer.com", 7 | "description": "PC-Engine cross development and tutorials" 8 | }, 9 | "support": { 10 | "mac": true, 11 | "linux": false, 12 | "windows": false 13 | }, 14 | "setup": { 15 | "mac": { 16 | "preBundleUrl": "https://github.com/actraiser/dust-bundle-pce-mac.git", 17 | "preBundleList": { 18 | "buildscripts" : { 19 | "directory": "compileScripts", 20 | "installer": "installCompileScripts" 21 | }, 22 | "pceas" : { 23 | "directory": "", 24 | "installer": "installPceas" 25 | } 26 | }, 27 | "externals": { 28 | "sublime": { 29 | "name": "Sublime Text 2 v2.0.2 (Text Editor)", 30 | "downloads": ["http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.dmg", 31 | "https://www.dropbox.com/s/941yqzlgub88cth/Sublime%20Text%202.0.1.dmg"], 32 | "filename": "Sublime Text 2.0.2.dmg", 33 | "installer": "installSublimeText", 34 | "postinstaller": "postInstallSublimeText", 35 | "directory": "configurationSublime" 36 | }, 37 | "magicengine": { 38 | "name": "Magic Engine v1.1.3 (PCE Emulator)", 39 | "downloads": ["http://www.magicengine.com/files/magicengine113.dmg",""], 40 | "filename": "magicengine113.dmg", 41 | "installer": "installMagicEngine" 42 | } 43 | 44 | }, 45 | "installOptions": { 46 | "all": { 47 | "description" : "Install everything", 48 | "list": { 49 | "magicengine": true, 50 | "buildscripts": true, 51 | "sublime": true, 52 | "pceas": true 53 | } 54 | }, 55 | "skip_sublime": { 56 | "description" : "Install everything but Sublime Text 2", 57 | "list": { 58 | "magicengine": true, 59 | "buildscripts": true, 60 | "pceas": true 61 | } 62 | } 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /mods/c64/lib/dust_cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var dust = require('../../../bin/dust'); 4 | 5 | 6 | // create skeletons for ASM or BASIC projects 7 | dust.cmd 8 | .command('create ') 9 | .description('create a new project from template into a directory') 10 | .action(function() { 11 | createFromTemplate(dust.cmd.args); 12 | }); 13 | 14 | 15 | 16 | // compile ASM 17 | dust.cmd 18 | .command('compile [path]') 19 | .description('assemble dust.cmd, create c64 executable and run it') 20 | .action(function() { 21 | compile(dust.cmd.args); 22 | }); 23 | 24 | 25 | 26 | /************************************** 27 | * function to exec * 28 | ***************************************/ 29 | 30 | function compile(args) { 31 | 32 | var targetFile = ""; 33 | if (!dust.shell.test('-e', '/usr/local/bin/assemble_6502')) { 34 | dust.color.red().bold(); 35 | console.log("assembler not set up correctly, please do dust setup"); 36 | dust.color.reset(); 37 | dust.shell.exit(1); 38 | } 39 | 40 | if (args[0] === undefined) { 41 | path = process.env['PWD']; 42 | 43 | if (dust.shell.test('-e', path + '/index.a')) { 44 | targetFile = "index.a"; 45 | } else if (dust.shell.test('-e', path + '/index.asm')) { 46 | targetFile = "index.asm"; 47 | } 48 | if (targetFile == "") { 49 | dust.color.red().bold(); 50 | console.log("Did not find any index.a or index.asm file to compile"); 51 | dust.color.reset(); 52 | dust.shell.exit(1); 53 | } 54 | } else { 55 | 56 | if (!dust.shell.test('-e', args[0])) { 57 | console.log('given file does not exist.'); 58 | dust.shell.exit(1); 59 | } else { 60 | targetFile = args[0] 61 | path = process.env['PWD']; 62 | if (args[0].match(process.env['PWD'])) { 63 | path = ""; 64 | } 65 | } 66 | } 67 | // Execute compiler 68 | console.log(targetFile + ' found - assembling 6502 code.'); 69 | dust.shell.exec("/usr/local/bin/assemble_6502 " + "\"" + path + "/" + targetFile + "\""); 70 | var out = dust.shell.exit(0); 71 | if (out.output.search("Error") > -1) { 72 | dust.shell.exit(1); 73 | } 74 | else { 75 | dust.shell.exit(0); 76 | } 77 | } 78 | 79 | function createFromTemplate(args) { 80 | if (!dust.shell.which('git')) { 81 | dust.color.red().bold(); 82 | console.log("git not set up correctly, please install git"); 83 | dust.color.reset(); 84 | dust.shell.exit(1); 85 | } 86 | if (args.length > 0) { 87 | console.log('Listing available Templates'); 88 | dust.templates.list(args[0]); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /mods/c64/lib/dust_text: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | 4 | dust.text.displayOutroText = function displayOutroText(){ 5 | console.log(""); 6 | console.log("#######################################################"); 7 | console.log("# #"); 8 | console.log("# Installation is completed! Congratulations! #"); 9 | console.log("# #"); 10 | console.log("# use 'dust test' to check installation status. #"); 11 | console.log("# #"); 12 | console.log("# type 'dust --help' for examples on using DUST #"); 13 | console.log("# #"); 14 | console.log("# check http://dustlayer.com for indepth tutorials! #"); 15 | console.log("#######################################################"); 16 | console.log(""); 17 | } 18 | 19 | 20 | dust.text.modTagline = function modTagLine(){ 21 | console.log("Visit http://dustlayer.com for C64 Tutorials"); 22 | } 23 | 24 | 25 | dust.text.displayInstallationHelp = function(){ 26 | console.log(""); 27 | console.log("DUST needs a few command line tools installed to work properly."); 28 | console.log("Also cross-development for C64 without the emulator Vice"); 29 | console.log("does not make much sense, so this must be installed as well and"); 30 | console.log("properly linked to DUST. 'dust setup' will take of this."); 31 | console.log(""); 32 | console.log("Unless you dont want to DUST will install some great tools to make "); 33 | console.log("C64 development more fun - notable the following:"); 34 | console.log(""); 35 | console.log("'Sublime Text 2' is an awesome editor which will"); 36 | console.log("not only be installed but also configured for C64 development with Syntax Highlighting"); 37 | console.log("and build systems to compile and run 6502 and BASIC code on a keypress"); 38 | console.log("If you skip the installation because you already have 'Sublime Text 2'installed, "); 39 | console.log("DUST will add the requirement build systems and syntax highlighting "); 40 | console.log("to your existing installation."); 41 | console.log(""); 42 | console.log("Note that all configuration files of previously installed tools are not modified,"); 43 | console.log("so running the setup routine again to update software or add new tools is fine."); 44 | console.log(""); 45 | console.log("Change to your cloned tools directory and type 'dust setup' to choose your"); 46 | console.log("prefered installation."); 47 | console.log(""); 48 | 49 | }; 50 | 51 | dust.text.displayInstallationRequirements = function(){ 52 | console.log("To setup utilities and make everything in DUST work, the following must be in place:"); 53 | console.log(""); 54 | console.log("'XCode' to install gcc compiler and other useful command line tools."); 55 | console.log("'git' to clone the tools repository and the tutorial source codes"); 56 | console.log(""); 57 | console.log("More information is available in the introduction to DUST on http://dustlayer.com"); 58 | console.log(""); 59 | }; 60 | 61 | dust.text.modHelp = function(){ 62 | console.log(' $ dust create : create new C64 project from template into specified directory'); 63 | console.log(' $ dust compile : looks for index.a or index.asm, compiles and runs it'); 64 | console.log(' $ dust compile /myproject/source.asm : compiles and runs given file'); 65 | } -------------------------------------------------------------------------------- /bin/dust: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 4 | /************************************ 5 | * * 6 | * main executable * 7 | * * 8 | *************************************/ 9 | 10 | // flag to indicate if installation is verbose 11 | var silent = true; 12 | exports.silent = silent; 13 | 14 | // file system access 15 | var fs = require('fs'); 16 | exports.fs = fs; 17 | 18 | // shell commands access 19 | var shell = require('shelljs'); 20 | exports.shell = shell; 21 | 22 | // default config template to be installed on first use 23 | activeMod = "c64"; 24 | var config = { 25 | "activeMod" : activeMod, 26 | "dustLogo": true, 27 | "mods": { 28 | "c64": { 29 | "systemName": "Commodore C64", 30 | "tutorialsIdentifier": "dust-tutorial-c64", 31 | "templatesIdentifier": "dust-template-c64" 32 | } 33 | } 34 | } 35 | 36 | // Look for existing config file 37 | // Create file if absent 38 | try { 39 | // config file location 40 | configFile = process.env['HOME'] + "/.dust.json"; 41 | // query for the file 42 | stats = fs.lstatSync(configFile); 43 | // if no error, file was found. Load active mod 44 | activeMod = require(process.env['HOME'] + "/.dust.json").activeMod; 45 | } 46 | catch (e) { 47 | // file was not found 48 | console.log("Config File not found - creating one in ~/.dust.json"); 49 | // create the file using the default template and set activeMod to c65 50 | fs.writeFile(configFile, JSON.stringify(config,null, 4), function (err) { 51 | // throw error if file can not be written 52 | if (err) throw err; 53 | // prompt a hint that we installed the config file 54 | console.log("Started for the first time, created config file."); 55 | }); 56 | } 57 | 58 | /************************************ 59 | * * 60 | * export sub modules * 61 | * * 62 | *************************************/ 63 | 64 | 65 | // current configuration 66 | exports.config = config; 67 | 68 | // allowed DUST commands 69 | var cmd = require('commander'); 70 | exports.cmd = cmd; 71 | require('../lib/dust_cmd'); 72 | 73 | // Environment checks 74 | var env = require('../lib/dust_env'); 75 | exports.env = env; 76 | 77 | // All text that is outputted by DUST 78 | var text = require('../lib/dust_text'); 79 | exports.text = text; 80 | 81 | // Support for color in terminal 82 | var ansi = require('ansi'); 83 | var color = ansi(process.stdout); 84 | exports.color = color; 85 | 86 | // Functions to check setup 87 | var test = require('../lib/dust_test'); 88 | exports.test = test; 89 | 90 | // Functions to setup environment and install tools 91 | var setup = require('../lib/dust_setup'); 92 | exports.setup = setup; 93 | 94 | // Access to github repository via Github API 95 | var github = require('../lib/dust_github'); 96 | exports.github = github; 97 | 98 | // Functions to pull Tutorials and Templates 99 | var tutorials = require('../lib/dust_tutorials'); 100 | exports.tutorials = tutorials; 101 | 102 | // progress bar while downloading files from external sources 103 | var externals = require('../lib/dust_externals') 104 | exports.externals = externals; 105 | 106 | // code templates stub, to be implemented by the active mod 107 | var templates = require('../lib/dust_templates') 108 | exports.templates = templates; 109 | 110 | // boot DUST 111 | require('../lib/dust_boot'); 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /mods/c64/config/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "about": { 3 | "name": "c64", 4 | "author": "actraiser/Dustlayer", 5 | "contact": "acrtraiser@dustlayer.com", 6 | "website": "http://www.dustlayer.com", 7 | "description": "C64 cross development and tutorials" 8 | }, 9 | "support": { 10 | "mac": true, 11 | "linux": false, 12 | "windows": false 13 | }, 14 | "setup": { 15 | "mac": { 16 | "preBundleUrl": "https://github.com/actraiser/dust-bundle-c64-mac.git", 17 | "preBundleList": { 18 | "buildscripts" : { 19 | "directory": "compileScripts", 20 | "installer": "installCompileScripts" 21 | }, 22 | "acme" : { 23 | "directory": "tools/Acme 0.94.5/src", 24 | "installer": "installAcme" 25 | }, 26 | "exomizer" : { 27 | "directory": "tools/Exomizer 2.0.6/src", 28 | "installer": "installExomizer" 29 | }, 30 | "pucrunch" : { 31 | "directory": "tools/pucrunch 8.3.2002", 32 | "installer": "installPuCrunch" 33 | }, 34 | "sidreloc" : { 35 | "directory": "tools/Sidreloc 1.0", 36 | "installer": "installSidreloc" 37 | } 38 | }, 39 | "externals": { 40 | "sublime": { 41 | "name": "Sublime Text 2 v2.0.2 (Text Editor)", 42 | "downloads": ["https://download.sublimetext.com/Sublime%20Text%202.0.2.dmg", 43 | "https://www.dropbox.com/s/941yqzlgub88cth/Sublime%20Text%202.0.1.dmg"], 44 | "filename": "Sublime Text 2.0.2.dmg", 45 | "installer": "installSublimeText", 46 | "postinstaller": "postInstallSublimeText", 47 | "directory": "configurationSublime" 48 | }, 49 | "vice": { 50 | "name": "Vice v2.4 (C64 Emulator)", 51 | "downloads": ["http://sourceforge.net/projects/vice-emu/files/releases/binaries/macosx/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg/download", 52 | "https://www.dropbox.com/s/jiepb1ngr17gq2j/vice-macosx-cocoa-i386%2Bx86_64-10.6-gcc42-2.4.dmg"], 53 | "filename": "vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg", 54 | "installer": "installVice" 55 | } 56 | 57 | }, 58 | "installOptions": { 59 | "all": { 60 | "description" : "Install everything", 61 | "list": { 62 | "acme": true, 63 | "buildscripts": true, 64 | "exomizer": true, 65 | "pucrunch": true, 66 | "sidreloc": true, 67 | "sublime": true, 68 | "vice": true 69 | } 70 | }, 71 | "skip_sublime": { 72 | "description" : "Install everything but Sublime Text 2", 73 | "list": { 74 | "acme": true, 75 | "buildscripts": true, 76 | "exomizer": true, 77 | "pucrunch": true, 78 | "sidreloc": true, 79 | "sublime": false, 80 | "vice": true 81 | } 82 | } 83 | } 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /lib/dust_cmd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../bin/dust'); 3 | 4 | /************************************** 5 | * default commands * 6 | * which are extended by the mod * 7 | ***************************************/ 8 | 9 | // show version information and usage 10 | dust.cmd 11 | .version('0.5.2') 12 | .usage(' [arguments]'); 13 | 14 | 15 | // select mod to use with DUST, default is c64 16 | dust.cmd 17 | .command('mod ') 18 | .description("switch modding for 'dust', default: 'c64'") 19 | .action(function(){ 20 | setMod(dust.cmd.args); 21 | }); 22 | 23 | 24 | // see available mods to choose from 25 | dust.cmd 26 | .command('mods') 27 | .description("show list of available mods") 28 | .action(function(){ 29 | listMods(); 30 | }); 31 | 32 | // setup environment and install tools 33 | dust.cmd 34 | .command('setup [help]') 35 | .description('setups bundled tools or displays information on the setup') 36 | .action(function(args){ 37 | if (args === undefined){ 38 | setup(); 39 | } 40 | else{ 41 | switch(args){ 42 | case "help": 43 | dust.text.displayInstallationHelp(); 44 | break; 45 | case "requirements": 46 | dust.text.displayInstallationRequirements(); 47 | break; 48 | default: 49 | dust.color.red().bold(); 50 | console.log('accepted setup arguments: help, requirements'); 51 | console.log(''); 52 | dust.color.reset(); 53 | } 54 | dust.shell.exit(0); 55 | } 56 | }); 57 | 58 | 59 | // test environment and check for installed tools 60 | dust.cmd 61 | .command('test') 62 | .description('check if everything is installed properly') 63 | .action(function(){ 64 | dust.test.all(); 65 | }); 66 | 67 | 68 | // show list of available tutorials 69 | dust.cmd 70 | .command('tutorials') 71 | .description('list and download tutorials') 72 | .action(function(){ 73 | tutorials(); 74 | }); 75 | 76 | 77 | 78 | 79 | 80 | // custom help examples 81 | dust.cmd.on('--help', function(){ 82 | dust.text.defaultHelp(); 83 | dust.text.modHelp(); 84 | console.log(''); 85 | dust.color.reset(); 86 | }); 87 | 88 | /************************************** 89 | * default command functions * 90 | ***************************************/ 91 | 92 | function setup(){ 93 | dust.setup.compatibilityCheck(); 94 | eval("dust.setup.install." + dust.env.operatingSystem.toLowerCase() + ".options();"); 95 | } 96 | 97 | /* 98 | function clone(){ 99 | dust.setup.compatibilityCheck(); 100 | eval("dust.setup.clone." + dust.env.operatingSystem.toLowerCase() + "();"); 101 | } 102 | */ 103 | 104 | function setMod(mod){ 105 | 106 | for (key in dust.config.mods) { 107 | if (key == mod){ 108 | console.log("setting mod to " + mod); 109 | var path = process.env['HOME'] + "/.dust.json"; 110 | var modifiedConfig = require(process.env['HOME'] + "/.dust.json"); 111 | modifiedConfig.activeMod = mod.toString(); 112 | delete modifiedConfig.mod; 113 | dust.fs.writeFileSync(path, JSON.stringify(modifiedConfig, null, 4)); 114 | // calls dust again to show the proper info on the active mod 115 | console.log("restarting dust to reflect changes..."); 116 | dust.shell.exec('dust'); 117 | dust.shell.exit(0); 118 | } 119 | } 120 | dust.test.fail('System not supported.'); 121 | console.log(""); 122 | console.log(""); 123 | listMods(); 124 | dust.shell.exit(0); 125 | } 126 | 127 | function listMods(){ 128 | console.log("Supported mods:") 129 | dust.color.bold(); 130 | for (key in dust.config.mods) { 131 | console.log(dust.config.mods[key].systemName + ': ' + key ); 132 | } 133 | dust.color.reset(); 134 | console.log(""); 135 | console.log("switch mod with 'dust mod '"); 136 | console.log(""); 137 | dust.shell.exit(0); 138 | } 139 | 140 | function tutorials(){ 141 | if (!dust.shell.which('git')) { 142 | dust.color.red().bold(); 143 | console.log ("git not set up correctly, please install git"); 144 | dust.color.reset(); 145 | dust.shell.exit(1); 146 | } 147 | console.log('Listing available Tutorial Code' ); 148 | dust.tutorials.list(); 149 | } 150 | 151 | 152 | -------------------------------------------------------------------------------- /mods/c64/lib/dust_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | 4 | dust.test.modDependencies = function modDependencies(){ 5 | console.log("Tools which are installed and configured by 'dust'"); 6 | console.log("--------------------------------------------------"); 7 | dust.color.reset(); 8 | 9 | dust.shell.which('acme') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 10 | dust.color.yellow(); 11 | console.log("ACME 6502 Cross Compiler"); 12 | 13 | dust.shell.test('-e', '/Applications/Vice64/x64.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 14 | dust.color.yellow(); 15 | console.log("Vice64 C64 Emulator"); 16 | 17 | dust.shell.test('-e', '/usr/local/bin/assemble_6502') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 18 | dust.color.yellow(); 19 | console.log("6502 build script invoked from shell or IDE"); 20 | 21 | dust.shell.test('-e', '/usr/local/bin/tokenize_basic') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 22 | dust.color.yellow(); 23 | console.log("BASIC build script invoked from shell or IDE"); 24 | 25 | dust.shell.test('-e', '/usr/local/bin/sidreloc') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 26 | dust.color.yellow(); 27 | console.log("Sidreloc is a tool to relocate SIDs in memory"); 28 | 29 | dust.shell.test('-e', '/usr/local/bin/pucrunch') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 30 | dust.color.yellow(); 31 | console.log("PuCrunch is a packer for your compiled 6502 programs"); 32 | 33 | dust.shell.test('-e', '/usr/local/bin/petcat') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 34 | dust.color.yellow(); 35 | console.log("Petcat converts between ASCII and PETSCII Format"); 36 | 37 | dust.shell.test('-e', '/usr/local/bin/exobasic') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 38 | dust.color.yellow(); 39 | console.log("Exobasic builds and optionally packs BASIC programs"); 40 | 41 | dust.color.reset(); 42 | dust.color.bold(); 43 | console.log(""); 44 | console.log("Optional tools which 'dust' offers to install and to configure"); 45 | console.log("--------------------------------------------------------------"); 46 | dust.color.reset(); 47 | 48 | dust.shell.test('-e', '/Applications/Sublime Text 2.app') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 49 | dust.color.yellow(); 50 | console.log("Sublime Text 2 - the popular editor for Mac OSX"); 51 | 52 | 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] '); 53 | dust.color.yellow(); 54 | console.log("6502 Syntax Highlighting for Sublime Text 2"); 55 | 56 | 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] '); 57 | dust.color.yellow(); 58 | console.log("6502 Syntax Highlighting Configuration for Sublime Text 2"); 59 | 60 | 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] '); 61 | dust.color.yellow(); 62 | console.log("6502 Build System for Sublime Text 2"); 63 | 64 | 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] '); 65 | dust.color.yellow(); 66 | console.log("BASIC Highlighting for Sublime Text 2"); 67 | 68 | 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] '); 69 | dust.color.yellow(); 70 | console.log("BASIC Syntax Highlighting Configuration for Sublime Text 2"); 71 | 72 | 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] '); 73 | dust.color.yellow(); 74 | console.log("BASIC Build System for Sublime Text 2"); 75 | 76 | dust.shell.test('-e', '/usr/local/bin/sublime') ? dust.test.okay('[installed] ') : dust.test.fail('[not found] '); 77 | dust.color.yellow(); 78 | console.log("a terminal shortcut that launches Sublime Text 2"); 79 | 80 | dust.color.reset(); 81 | console.log(""); 82 | } 83 | -------------------------------------------------------------------------------- /mods/pce/lib/dust_setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | var savePWD = process.env['HOME']; 4 | 5 | dust.setup.clone = { 6 | "mac": function(){ 7 | cloneMac(); 8 | } 9 | } 10 | 11 | 12 | dust.setup.install = { 13 | "mac": { 14 | "options": function(){ 15 | showOptionsMac(); 16 | }, 17 | "run": function(){ 18 | runInstallMac(); 19 | } 20 | } 21 | } 22 | 23 | 24 | /* installation start */ 25 | function runInstallMac(configKey){ 26 | var start = new Date().getTime(); 27 | 28 | // github location of a package of software prebundled for this mod 29 | preBundleUrl = dust.config.mod.setup.mac.preBundleUrl; 30 | // list of software prebundled 31 | preBundleList = dust.config.mod.setup.mac.preBundleList; 32 | // list of software downloaded from external sites 33 | externalsList = dust.config.mod.setup.mac.externals; 34 | 35 | // selected installation configuration (includes prebundled and external software) 36 | selectedInstallOptions = dust.config.mod.setup.mac.installOptions[configKey].list; 37 | 38 | // Create Temp Directory to work in 39 | dust.shell.exec('mkdir "$HOME/temp_dust_compile"', {silent:dust.silent}); 40 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile", {silent:dust.silent}); 41 | regex = /.*\/(.*).git$/ 42 | preBundleDirectory = regex.exec(preBundleUrl)[1]; 43 | 44 | // rm existing clone 45 | dust.shell.rm('-rf', preBundleDirectory); 46 | // clone repository 47 | dust.shell.exec('git clone --progress ' + preBundleUrl); 48 | 49 | if (dust.shell.test('-d', dust.shell.env['HOME'] + "/temp_dust_compile/" + preBundleDirectory) === false){ 50 | dust.test.fail("git clone failed - did you enter your password correctly?"); 51 | console.log(""); 52 | dust.shell.exit(1); 53 | } 54 | 55 | dust.shell.cd(preBundleDirectory); 56 | dust.shell.rm('-rf', '.git'); 57 | 58 | dust.color.bold(); 59 | console.log(""); 60 | console.log("Enter Sudo password if required to create system directories and copy binaries."); 61 | console.log(""); 62 | dust.color.reset(); 63 | 64 | 65 | // all binaries go to /usr/local/bin - create if it does not exist 66 | dust.shell.exec('sudo mkdir -p "/usr/local/bin"', {silent:dust.silent}); 67 | 68 | // install prebundled Software 69 | for (var key in selectedInstallOptions){ 70 | if (selectedInstallOptions[key] === true){ 71 | // check if this is a prebundled or external software 72 | if (dust.config.mod.setup.mac.preBundleList[key] != undefined){ 73 | eval(preBundleList[key]['installer'] + "('" + preBundleList[key]['directory'] + "','" + preBundleDirectory + "');"); 74 | } 75 | else if (dust.config.mod.setup.mac.externals[key] != undefined){ 76 | eval(externalsList[key]['installer'] + "('" + externalsList[key]['filename'] + "');"); 77 | if (externalsList[key]['postinstaller'] != undefined) { 78 | eval(externalsList[key]['postinstaller'] + "('" + externalsList[key]['directory'] + "','" + preBundleDirectory + "');"); 79 | } 80 | } 81 | else{ 82 | dust.test.fail("Error: " + key + " not found in the configuration file."); 83 | } 84 | } 85 | else { 86 | console.log('skipping ' + key + ' installation'); 87 | } 88 | } 89 | 90 | dust.setup.removeTemporaryDirectory(); 91 | 92 | dust.text.displayOutroText(); 93 | var end = new Date().getTime(); 94 | var time = end - start; 95 | console.log(""); 96 | dust.color.bold(); 97 | console.log('Execution time: ' + parseInt(time/1000) + ' seconds'); 98 | dust.color.reset(); 99 | console.log(""); 100 | dust.shell.exit(0) 101 | } 102 | 103 | 104 | function showOptionsMac(){ 105 | combinations = eval("dust.config.mod.setup." + dust.env.operatingSystem.toLowerCase() + ".installOptions"); 106 | options = []; 107 | i=1; 108 | dust.color.bold(); 109 | for (var key in combinations) { 110 | options[i] = []; 111 | options[i]['key'] = key; 112 | options[i]['description'] = combinations[key]['description']; 113 | console.log(i+". " + options[i]['description']); 114 | i++; 115 | } 116 | 117 | dust.cmd.prompt('Choice: ', function(choice){ 118 | choice = parseInt(choice); 119 | 120 | if (choice>i || choice < 1 || isNaN(choice) ){ 121 | dust.test.fail('Choice out of range - please retry'); 122 | console.log(""); 123 | showOptionsMac(); 124 | return; 125 | } 126 | console.log('You have chosen option #%d "%s"', choice, options[choice]['description']); 127 | dust.color.reset(); 128 | runInstallMac(options[choice]['key']); 129 | }); 130 | 131 | } 132 | 133 | function installPceas(workdir,bundledir){ 134 | console.log("PCEAS Installer TODO"); 135 | return; 136 | process.stdout.write('installing acme '); 137 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 138 | dust.shell.cd(workdir); 139 | dust.shell.exec('make', {silent:dust.silent}); 140 | dust.shell.exec('sudo make install', {silent:dust.silent}); 141 | dust.setup.installStatus(true); 142 | } 143 | 144 | 145 | 146 | function installCompileScripts(workdir,bundledir){ 147 | console.log("CompileScripts Installer TODO"); 148 | return; 149 | process.stdout.write('installing build scripts for 6502 and BASIC '); 150 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 151 | dust.shell.cd(workdir); 152 | dust.shell.exec('sudo cp -v "assemble_6502" "/usr/local/bin"', {silent:dust.silent}); 153 | dust.shell.exec('sudo cp -v "tokenize_basic" "/usr/local/bin"', {silent:dust.silent}); 154 | dust.setup.installStatus(true); 155 | } 156 | 157 | function installSublimeText(filename){ 158 | console.log("Install sublime Todo"); 159 | return; 160 | 161 | process.stdout.write('installing Sublime Text 2 '); 162 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); 163 | dust.externals.download('mac', dust.config.mod.setup.mac.externals.sublime.downloads[0], filename,true); 164 | process.stdout.write('installing '); 165 | 166 | dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/' + filename +'"', {silent:dust.silent}); 167 | dust.shell.exec('cp -R -v "/Volumes/Sublime Text 2/Sublime Text 2.app" "/Volumes/Sublime Text 2/Applications"', {silent:dust.silent}); 168 | dust.shell.exec('hdiutil detach "/Volumes/Sublime Text 2"', {silent:dust.silent}); 169 | dust.setup.installStatus(true); 170 | } 171 | 172 | function postInstallSublimeText(workdir,bundledir){ 173 | console.log("Post Install sublime Todo"); 174 | return; 175 | 176 | process.stdout.write("Copying Sublime Text 2 Configuration "); 177 | if (dust.shell.test("-d", "/Applications/Sublime Text 2.app")){ 178 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 179 | dust.shell.cd(workdir); 180 | dust.shell.exec('sudo mv -v "Sublime Text 2/sublime" "/usr/local/bin"', {silent:dust.silent}); 181 | dust.shell.exec('mkdir -p "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); 182 | dust.shell.exec('cp -R -v "Sublime Text 2/" "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); 183 | dust.setup.installStatus(true); 184 | } 185 | else { 186 | dust.color.yellow(); 187 | console.log("sublime not available - no build systems were configured"); 188 | dust.color.reset(); 189 | } 190 | } 191 | 192 | function installMagicEngine(filename){ 193 | console.log("Magic Engine Installer TODO"); 194 | return; 195 | 196 | process.stdout.write('installing Sublime Text 2 '); 197 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); 198 | dust.externals.download('mac', dust.config.mod.setup.mac.externals.sublime.downloads[0], filename,true); 199 | process.stdout.write('installing '); 200 | 201 | dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/' + filename +'"', {silent:dust.silent}); 202 | dust.shell.exec('cp -R -v "/Volumes/Sublime Text 2/Sublime Text 2.app" "/Volumes/Sublime Text 2/Applications"', {silent:dust.silent}); 203 | dust.shell.exec('hdiutil detach "/Volumes/Sublime Text 2"', {silent:dust.silent}); 204 | dust.setup.installStatus(true); 205 | } 206 | 207 | 208 | function cloneMac(){ 209 | console.log("Clone Install Repo TODO"); 210 | return; 211 | 212 | console.log (""); 213 | console.log("Cloning Repository - this may take a while."); 214 | console.log (""); 215 | 216 | if (dust.shell.exec('which git').code !== 0){ 217 | dust.color.red(); 218 | dust.color.bold(); 219 | console.log('git command not found - have you installed git?'); 220 | console.log('download it at http://git-scm.com/downloads') 221 | console.log("More information on setup requirements with 'dust setup requirements") 222 | dust.color.reset(); 223 | dust.shell.exit(0); 224 | } 225 | 226 | 227 | if (dust.shell.exec('git clone --verbose https://github.com/actraiser/dust-setup-osx.git').code === 0) { 228 | dust.color.green(); 229 | console.log('Cloning Repository succeeded'); 230 | console.log("Change to 'dust-setup-osx' directory and run 'dust setup'"); 231 | dust.color.reset(); 232 | dust.shell.exit(1); 233 | } else { 234 | console.log("there was a problem cloning the repository - please try to clone again!"); 235 | dust.shell.exit(1); 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /mods/c64/lib/dust_setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var dust = require('../../../bin/dust'); 3 | var savePWD = process.env['HOME']; 4 | 5 | dust.setup.clone = { 6 | "mac": function(){ 7 | cloneMac(); 8 | } 9 | } 10 | 11 | 12 | dust.setup.install = { 13 | "mac": { 14 | "options": function(){ 15 | showOptionsMac(); 16 | }, 17 | "run": function(){ 18 | runInstallMac(); 19 | } 20 | } 21 | } 22 | 23 | 24 | /* installation start */ 25 | function runInstallMac(configKey){ 26 | var start = new Date().getTime(); 27 | 28 | // github location of a package of software prebundled for this mod 29 | preBundleUrl = dust.config.mod.setup.mac.preBundleUrl; 30 | // list of software prebundled 31 | preBundleList = dust.config.mod.setup.mac.preBundleList; 32 | // list of software downloaded from external sites 33 | externalsList = dust.config.mod.setup.mac.externals; 34 | 35 | // selected installation configuration (includes prebundled and external software) 36 | selectedInstallOptions = dust.config.mod.setup.mac.installOptions[configKey].list; 37 | 38 | // Create Temp Directory to work in 39 | dust.shell.exec('mkdir "$HOME/temp_dust_compile"', {silent:dust.silent}); 40 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile", {silent:dust.silent}); 41 | regex = /.*\/(.*).git$/ 42 | preBundleDirectory = regex.exec(preBundleUrl)[1]; 43 | 44 | // rm existing clone 45 | dust.shell.rm('-rf', preBundleDirectory); 46 | // clone repository 47 | dust.shell.exec('git clone --progress ' + preBundleUrl); 48 | 49 | if (dust.shell.test('-d', dust.shell.env['HOME'] + "/temp_dust_compile/" + preBundleDirectory) === false){ 50 | dust.test.fail("git clone failed - did you enter your password correctly?"); 51 | console.log(""); 52 | dust.shell.exit(1); 53 | } 54 | 55 | dust.shell.cd(preBundleDirectory); 56 | dust.shell.rm('-rf', '.git'); 57 | 58 | dust.color.bold(); 59 | console.log(""); 60 | console.log("Enter Sudo password if required to create system directories and copy binaries."); 61 | console.log(""); 62 | dust.color.reset(); 63 | 64 | 65 | // all binaries go to /usr/local/bin - create if it does not exist 66 | dust.shell.exec('sudo mkdir -p "/usr/local/bin"', {silent:dust.silent}); 67 | 68 | // install prebundled Software 69 | for (var key in selectedInstallOptions){ 70 | if (selectedInstallOptions[key] === true){ 71 | // check if this is a prebundled or external software 72 | if (dust.config.mod.setup.mac.preBundleList[key] != undefined){ 73 | eval(preBundleList[key]['installer'] + "('" + preBundleList[key]['directory'] + "','" + preBundleDirectory + "');"); 74 | } 75 | else if (dust.config.mod.setup.mac.externals[key] != undefined){ 76 | eval(externalsList[key]['installer'] + "('" + externalsList[key]['filename'] + "');"); 77 | if (externalsList[key]['postinstaller'] != undefined) { 78 | eval(externalsList[key]['postinstaller'] + "('" + externalsList[key]['directory'] + "','" + preBundleDirectory + "');"); 79 | } 80 | } 81 | else{ 82 | dust.test.fail("Error: " + key + " not found in the configuration file."); 83 | } 84 | } 85 | else { 86 | console.log('skipping ' + key + ' installation'); 87 | } 88 | } 89 | 90 | dust.setup.removeTemporaryDirectory(); 91 | 92 | dust.text.displayOutroText(); 93 | var end = new Date().getTime(); 94 | var time = end - start; 95 | console.log(""); 96 | dust.color.bold(); 97 | console.log('Execution time: ' + parseInt(time/1000) + ' seconds'); 98 | dust.color.reset(); 99 | console.log(""); 100 | dust.shell.exit(0) 101 | } 102 | 103 | 104 | function showOptionsMac(){ 105 | combinations = eval("dust.config.mod.setup." + dust.env.operatingSystem.toLowerCase() + ".installOptions"); 106 | options = []; 107 | i=1; 108 | dust.color.bold(); 109 | for (var key in combinations) { 110 | options[i] = []; 111 | options[i]['key'] = key; 112 | options[i]['description'] = combinations[key]['description']; 113 | console.log(i+". " + options[i]['description']); 114 | i++; 115 | } 116 | 117 | dust.cmd.prompt('Choice: ', function(choice){ 118 | choice = parseInt(choice); 119 | 120 | if (choice>i || choice < 1 || isNaN(choice) ){ 121 | dust.test.fail('Choice out of range - please retry'); 122 | console.log(""); 123 | showOptionsMac(); 124 | return; 125 | } 126 | console.log('You have chosen option #%d "%s"', choice, options[choice]['description']); 127 | dust.color.reset(); 128 | runInstallMac(options[choice]['key']); 129 | }); 130 | 131 | } 132 | 133 | function installAcme(workdir,bundledir){ 134 | process.stdout.write('installing acme '); 135 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 136 | dust.shell.cd(workdir); 137 | dust.shell.exec('make', {silent:dust.silent}); 138 | dust.shell.exec('sudo make install', {silent:dust.silent}); 139 | dust.setup.installStatus(true); 140 | } 141 | 142 | function installExomizer(workdir,bundledir){ 143 | process.stdout.write('installing Exomizer '); 144 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 145 | dust.shell.cd(workdir); 146 | dust.shell.exec('make', {silent:dust.silent}); 147 | dust.shell.exec('sudo cp "exobasic" "/usr/local/bin"', {silent:dust.silent}); 148 | dust.shell.exec('sudo cp "exomizer" "/usr/local/bin"', {silent:dust.silent}); 149 | dust.setup.installStatus(true); 150 | } 151 | 152 | function installPuCrunch(workdir,bundledir){ 153 | process.stdout.write('installing PuCrunch '); 154 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 155 | dust.shell.cd(workdir); 156 | dust.shell.exec('make', {silent:dust.silent}); 157 | dust.shell.exec('sudo cp "pucrunch" "/usr/local/bin"', {silent:dust.silent}); 158 | dust.setup.installStatus(true); 159 | } 160 | 161 | function installSidreloc(workdir,bundledir){ 162 | process.stdout.write('installing Sidreloc '); 163 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 164 | dust.shell.cd(workdir); 165 | dust.shell.exec('make', {silent:dust.silent}); 166 | dust.shell.exec('sudo make install', {silent:dust.silent}); 167 | dust.setup.installStatus(true); 168 | } 169 | 170 | function installCompileScripts(workdir,bundledir){ 171 | process.stdout.write('installing build scripts for 6502 and BASIC '); 172 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 173 | dust.shell.cd(workdir); 174 | dust.shell.exec('sudo cp -v "assemble_6502" "/usr/local/bin"', {silent:dust.silent}); 175 | dust.shell.exec('sudo cp -v "tokenize_basic" "/usr/local/bin"', {silent:dust.silent}); 176 | dust.setup.installStatus(true); 177 | } 178 | 179 | function installSublimeText(filename){ 180 | process.stdout.write('installing Sublime Text 2 '); 181 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); 182 | dust.externals.download('mac', dust.config.mod.setup.mac.externals.sublime.downloads[0], filename,true); 183 | process.stdout.write('installing '); 184 | 185 | dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/' + filename +'"', {silent:dust.silent}); 186 | dust.shell.exec('cp -R -v "/Volumes/Sublime Text 2/Sublime Text 2.app" "/Volumes/Sublime Text 2/Applications"', {silent:dust.silent}); 187 | dust.shell.exec('hdiutil detach "/Volumes/Sublime Text 2"', {silent:dust.silent}); 188 | dust.setup.installStatus(true); 189 | } 190 | 191 | function postInstallSublimeText(workdir,bundledir){ 192 | process.stdout.write("Copying Sublime Text 2 Configuration "); 193 | if (dust.shell.test("-d", "/Applications/Sublime Text 2.app")){ 194 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/" + bundledir, {silent:dust.silent}); 195 | dust.shell.cd(workdir); 196 | dust.shell.exec('sudo mv -v "Sublime Text 2/sublime" "/usr/local/bin"', {silent:dust.silent}); 197 | dust.shell.exec('mkdir -p "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); 198 | dust.shell.exec('cp -R -v "Sublime Text 2/" "$HOME/Library/Application Support/Sublime Text 2/Packages"', {silent:dust.silent}); 199 | dust.setup.installStatus(true); 200 | } 201 | else { 202 | dust.color.yellow(); 203 | console.log("sublime not available - no build systems were configured"); 204 | dust.color.reset(); 205 | } 206 | } 207 | 208 | function installVice(filename){ 209 | process.stdout.write('installing Vice '); 210 | dust.shell.cd(dust.shell.env['HOME'] + "/temp_dust_compile/", {silent:dust.silent}); 211 | 212 | dust.externals.download('mac', dust.config.mod.setup.mac.externals.vice.downloads[0], filename,true); 213 | process.stdout.write('installing '); 214 | 215 | dust.shell.exec('mkdir /Applications/Vice64', {silent:dust.silent}); 216 | dust.shell.exec('hdiutil attach "$HOME/temp_dust_compile/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4.dmg"', {silent:dust.silent}); 217 | dust.shell.exec('cp -R -v "/Volumes/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4/" "/Applications/Vice64"', {silent:dust.silent}); 218 | dust.shell.exec('hdiutil detach "/Volumes/vice-macosx-cocoa-i386+x86_64-10.6-gcc42-2.4"', {silent:dust.silent}); 219 | dust.shell.exec('sudo cp -v "/Applications/Vice64/tools/petcat" "/usr/local/bin"', {silent:dust.silent}); 220 | 221 | dust.setup.installStatus(true); 222 | } 223 | 224 | 225 | function cloneMac(){ 226 | console.log (""); 227 | console.log("Cloning Repository - this may take a while."); 228 | console.log (""); 229 | 230 | if (dust.shell.exec('which git').code !== 0){ 231 | dust.color.red(); 232 | dust.color.bold(); 233 | console.log('git command not found - have you installed git?'); 234 | console.log('download it at http://git-scm.com/downloads') 235 | console.log("More information on setup requirements with 'dust setup requirements") 236 | dust.color.reset(); 237 | dust.shell.exit(0); 238 | } 239 | 240 | 241 | if (dust.shell.exec('git clone --verbose https://github.com/actraiser/dust-setup-osx.git').code === 0) { 242 | dust.color.green(); 243 | console.log('Cloning Repository succeeded'); 244 | console.log("Change to 'dust-setup-osx' directory and run 'dust setup'"); 245 | dust.color.reset(); 246 | dust.shell.exit(1); 247 | } else { 248 | console.log("there was a problem cloning the repository - please try to clone again!"); 249 | dust.shell.exit(1); 250 | } 251 | } 252 | --------------------------------------------------------------------------------