Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Mac OS X fixes #265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ Contributors
Changelog
=========

0.3.7
* Fixed issue with new Mac OS X and Homebrew Cask Arduino installations.
* Excluded `src` from the lib flags in the used by `Makefile`.

0.3.6
* Fix #74, #107, #108: Use of types declared in included files is allowed
in function definitions. Previously it led to: '<enum|struct|typedef>' not
Expand Down
6 changes: 3 additions & 3 deletions ino/argparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _split_lines(self, text, width):
sub_indent = indent + len(list_match.group(2))
else:
sub_indent = indent

# Textwrap will do all the hard work for us
line = self._whitespace_matcher.sub(' ', line).strip()
new_lines = textwrap.wrap(
Expand All @@ -74,7 +74,7 @@ def _split_lines(self, text, width):
initial_indent=' '*(indent-main_indent),
subsequent_indent=' '*(sub_indent-main_indent),
)

# Blank lines get eaten by textwrap, put it back with [' ']
lines.extend(new_lines or [' '])

Expand All @@ -93,7 +93,7 @@ def _split_lines(self, text, width):

You must use backslashes at the end of lines to indicate that you\
want the text to wrap instead of preserving the newline.

As with docstrings, the leading space to the text block is ignored.
''')
parser.parse_args(['-h'])
6 changes: 3 additions & 3 deletions ino/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def setup_flags(self, args):
self.e['cppflags'].append('-DUSB_VID=%s' % board['build']['vid'])
if 'pid' in board['build']:
self.e['cppflags'].append('-DUSB_PID=%s' % board['build']['pid'])

if self.e.arduino_lib_version.major:
variant_dir = os.path.join(self.e.arduino_variants_dir,
board['build']['variant'])
Expand Down Expand Up @@ -221,7 +221,7 @@ def recursive_inc_lib_flags(self, libdirs):
flags = SpaceList()
for d in libdirs:
flags.append('-I' + d)
flags.extend('-I' + subd for subd in list_subdirs(d, recursive=True, exclude=['examples']))
flags.extend('-I' + subd for subd in list_subdirs(d, recursive=True, exclude=['examples', 'src']))
return flags

def _scan_dependencies(self, dir, lib_dirs, inc_flags):
Expand Down Expand Up @@ -252,7 +252,7 @@ def scan_dependencies(self):
# If lib A depends on lib B it have to appear before B in final
# list so that linker could link all together correctly
# but order of `_scan_dependencies` is not defined, so...

# 1. Get dependencies of sources in arbitrary order
used_libs = list(self._scan_dependencies(self.e.src_dir, lib_dirs, inc_flags))

Expand Down
9 changes: 7 additions & 2 deletions ino/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ class Environment(dict):
]

if platform.system() == 'Darwin':
arduino_dist_dir_guesses.insert(0, '/Applications/Arduino.app/Contents/Resources/Java')
if os.path.exists('/Applications/Arduino.app/Contents/Java'):
arduino_dist_dir_guesees.insert(0, '/Applications/Arduino.app/Contents/Java')
Copy link

@alexcodreanu86 alexcodreanu86 Oct 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in guesees instead of guesses

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's quesees and where do you see any reference to it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 83 just before the insert function call @ipinak

elif os.path.exists('/Users/' + os.environ['USER'] + '/Applications/Arduino.app/Contents/Java'):
arduino_dist_dir_guesses.insert(0, '/Users/' + os.environ['USER'] + '/Applications/Arduino.app/Contents/Java')
else:
arduino_dist_dir_guesses.insert(0, '/Applications/Arduino.app/Contents/Resources/Java')

default_board_model = 'uno'
ino = sys.argv[0]
Expand Down Expand Up @@ -146,7 +151,7 @@ def _find(self, key, items, places, human_name, join, multi):
places = map(os.path.expanduser, places)

glob_places = itertools.chain.from_iterable(glob(p) for p in places)

print 'Searching for', human_name, '...',
results = []
for p in glob_places:
Expand Down
2 changes: 1 addition & 1 deletion ino/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def main():

if current_command not in run_anywhere:
# For valid projects create .build & lib
if not os.path.isdir(e.build_dir):
if not os.path.isdir(e.build_dir):
os.makedirs(e.build_dir)

if not os.path.isdir(e.lib_dir):
Expand Down