daid / LegacyCura

Read this, it's important! NEW CURA DEVELOPMENT IS HAPPENING AT https://github.com/Ultimaker/Cura, this is the Cura 15.04 archive. Cura 2.1 and newer is on the Ultimaker github.
https://www.ultimaker.com/pages/our-software
584 stars 429 forks source link

homebrew setup script fails to setup environment #1100

Open phonyphonecall opened 9 years ago

phonyphonecall commented 9 years ago

When setting up a new dev environment the homebrew script fails to execute properly. Error:

$ brew install --build-bottle --fresh Cura/scripts/darwin/python.rb --universal
==> Downloading http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
Already downloaded: /Library/Caches/Homebrew/python-2.7.3.tar.bz2
==> Downloading https://gist.github.com/raw/4349132/25662c6b382315b5db67bf949773d76471bbcee7/python-nfs-shutil.diff
######################################################################## 100.0%
==> Patching
patching file Lib/shutil.py
patching file Lib/test/test_shutil.py
patching file Modules/errnomodule.c
==> ./configure --prefix=/usr/local/Cellar/python/2.7.3 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/2.7.3/share --datadir=/usr/local/Cellar/python/2.7.3/share --enable-framework=/usr/local/Ce
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.3
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.3/share/python
Error: wrong number of arguments (0 for 3)
Please report this bug:
    http://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/formula.rb:86:in `initialize'
/Users/Scott/dev/github/Cura/scripts/darwin/python.rb:158:in `new'
/Users/Scott/dev/github/Cura/scripts/darwin/python.rb:158:in `install'
/usr/local/Library/Homebrew/build.rb:136:in `block in install'
/usr/local/Library/Homebrew/formula.rb:390:in `block in brew'
/usr/local/Library/Homebrew/formula.rb:745:in `block in stage'
/usr/local/Library/Homebrew/resource.rb:91:in `block in unpack'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/resource.rb:88:in `unpack'
/usr/local/Library/Homebrew/resource.rb:81:in `stage'
/usr/local/Library/Homebrew/formula.rb:743:in `stage'
/usr/local/Library/Homebrew/formula.rb:386:in `brew'
/usr/local/Library/Homebrew/build.rb:114:in `install'
/usr/local/Library/Homebrew/build.rb:185:in `<main>'

I've fixed all issues in brew doctor, and uninstalled everything python I could find on the machine. I would report it to the homebrew issues, but similar issues in that issue tracker claim that this error is a formulaic issue. Reference: https://github.com/Homebrew/homebrew/issues/33903

Let me know how I can help.

brew --verson: 0.9.5 OSX 10.10.1

daid commented 9 years ago

Honestly, no clue. I'm glad my MacOS environenmt works. A few people have been trying to replicate it, but so far no-one has been successful. I have very little knowledge on this area, so there is little I can do to help here.

phonyphonecall commented 9 years ago

@daid understandable. Do you have a suggested alternate method to setup a mac dev environment?

melka commented 9 years ago

Here are the steps I followed to setup a build env on MacOS X 10.10.1, feel free to adapt it to your own setup.

Python

brew uninstall python
brew install python --universal --framework

This should give you the necessary requirements for the non-system framework based universal python.

Virtualenv

http://docs.python-guide.org/en/latest/dev/virtualenvs/

pip install virtualenv
virtualenv Cura
cd Cura
source bin/activate

Git

http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git http://stackoverflow.com/questions/2411031/how-do-i-clone-into-a-non-empty-directory

cd Cura
git init
git remote add origin https://github.com/daid/Cura
git fetch
git checkout

wxPython

http://umforum.ultimaker.com/index.php?/topic/7577-cura-mac-os-x-sources-compil/

download wxPython sources versions 3.0.1.1 here and uncompress it somewhere. I did it in the Cura folder, and added the wxPython folder to .gitignore. You might get some build errors if you're on Yosemite, so apply the necessary changes from this link https://github.com/KiCad/KicadOSXBuilder/issues/40

cd wxPython-src-3.0.1.1/wxPython
python build-wxpython.py --osx_cocoa --mac_arch=i386,x86_64 --install

Create file Cura/bin/pythonw with the following content:

#!/bin/bash
ENV=`python -c "import sys; print sys.prefix"`
PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
export PYTHONHOME=$ENV
exec $PYTHON "$@"

Quit terminal, reopen, go back to Cura folder and reactivate virtualenv.

cd Cura-15.01-RC5-Makerbot
source bin/activate

power

Download power 1.3 sources here.

"super has no attribute init" build error https://bitbucket.org/ronaldoussoren/pyobjc/issue/110/subclass-of-nsobject-super-has-no

cd power-1.3
python setup.py build
python setup.py install

Python packages

cd Cura
pip install -r requirements.txt
pip install -r requirements_darwin.txt

modulegraph error https://bitbucket.org/jinnko/py2app/commits/dba244c843397345d2bac8cdfc92ba9d66192bfc

Run in debug mode

cd Cura
pythonw -m Cura.cura

Package Cura

cd Cura
./package.sh darwin
phonyphonecall commented 9 years ago

@melka thanks! I'll have a run through this.