joshmarinacci / ElectronIDE

New web based Arduino IDE
BSD 3-Clause "New" or "Revised" License
246 stars 50 forks source link

linux path support #22

Closed joshmarinacci closed 10 years ago

joshmarinacci commented 10 years ago

On linux it appears you must have arduino-core installed. Then you will get the avr compilers. They are not in the usual Arduino path structure, however. They will be installed in the regular /usr/bin/ directory. Also, the avrdude.conf path is slightly different. We should detect if on linux and use alternate paths.

https://packages.debian.org/sid/all/arduino-core/filelist

joshmarinacci commented 10 years ago

Just pushed back new platform code that makes it work on linux, at least for compiling.

chrwei commented 10 years ago

trying a compile now, not working, but i'm not sure if it's related.

last output is: scanned for included libs Arduino sending event { type: 'compile', message: 'scanned for included libs Arduino' } compliation error [TypeError: Cannot call method 'getStandardLibraryPath' of undefined]

I added a console.log(options) and it doens't have a platform entry.

joshmarinacci commented 10 years ago

My fault. new breakage. Just fixed it. Please try again. txh.

joshmarinacci commented 10 years ago

Dies it work for you now?

chrwei commented 10 years ago

that part seems to work, now I need to find time to move to distro packaged arduino. ElectronIDE should get rid of all the reasons I was using a portable system.

joshmarinacci commented 10 years ago

Yes. Eventually I will fetch the gcc toolchain from repos rather than relying on the OS having the standard IDE and tools installed, but I don't think that will be for version 0.1. Perhaps 0.2

chrwei commented 10 years ago

compile works with distro packages.

chrwei commented 10 years ago

upload does not. changed this in platform.js

    this.getAvrDudeConf = function(device) {
        if(this.os == 'linux') {
            return this.root + '/hardware/tools/avrdude.conf';
        } else {
            return this.root + '/hardware/tools/avr/etc/avrdude.conf';
        }
    }

a failed upload also provides no feedback in the GUI, only stdout/stderr

joshmarinacci commented 10 years ago

I've updated it to download the compiler toolchain and libs automatically to a scratch dir. You don't need arduino-core installed anymore.

Please check out the code, npm install, set the exports.repos variable in settings.js (exports.root no longer matters), then run 'node test_compile.js' to test compiling a sketch.

It should download the toolchain the first time you run it, then compile the sketch. It should work on Mac and Linux. I haven't tried Windows yet. I'm still uncertain about 32bit vs 64bit on linux, so I really need testing on those variants.

joshmarinacci commented 10 years ago

You no longer need to set anything in the settings.js file. It will all be calculated correctly for the current platform. Please do a fresh checkout to use the new stuff.