ohmtech-rdi / eurorack-blocks

Software to Hardware Prototyping for Eurorack using C++, Max/Gen~ or Faust
Other
309 stars 21 forks source link

erbb setup: install Max package #579

Closed eliottparis closed 1 year ago

eliottparis commented 1 year ago

This PR adds a --with-max-support option to erbb setup that installs the Eurorack-block Max package on macOS and Windows.

The package will only be installed if the path to the Max 8/packages exists, and thus Max is installed, on the target machine. The installed package will be a symlink on macOS or a junction on Windows, linking to the cloned repository's max/Eurorack-blocks folder.

ohmtech-rdi commented 1 year ago

@OmsInSerial could you please give a try to this branch?

OmsInSerial commented 1 year ago
xxxxx@xxxxx MINGW64 ~/eurorack-blocks (setup-install-max-package)
$ git status
On branch setup-install-max-package
Your branch is up to date with 'origin/setup-install-max-package'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        samples/VCV/
        samples/test/

nothing added to commit but untracked files present (use "git add" to track)

xxxxx@xxxxx MINGW64 ~/eurorack-blocks (setup-install-max-package)
$ erbb setup
Extracting msys2_mingw64.zip...
Extracting kicad_minimal_windows_6.0.11-0.tar.gz...
Extracting gcc-arm-none-eabi-10.3-2021.10-win32.zip...
Installing python packages...
Optimizing erbb...
Checking toolchain...
OK.

xxxxx@xxxxx MINGW64 ~/eurorack-blocks (setup-install-max-package)
$ git submodule update --init --recursive

Link to the eurorack-blocks is not created in Max packages, I have to do it manually :

xxxxx@xxxxx MINGW64 ~/OneDrive/Documents/Max 8/Packages
$ ln -s ~/eurorack-blocks/max/Eurorack-blocks/

Then saving in Max :

node.script: artifacts already exists, skipping.
gen~: exported: C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/module_max.cpp
node.script: Build starting
node.script: module: /Users/xxxxx/eurorack-blocks/samples/test/
node.script: Configuring...
node.script: child process exited with code 0
node.script: Building...
node.script: mingw32-make: Entering directory 'C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/simulator'
node.script: ACTION Max
node.script: ACTION UI
node.script: ACTION VCV Rack
node.script: COPY include/erb/vcvrack/resource/rogan.6ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.5ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.3ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.2ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.2s.black.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1s.black.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1s.svg
node.script: COPY include/erb/vcvrack/resource/sifam.dbn151.white.svg
node.script: COPY include/erb/vcvrack/resource/sifam.drn111.white.svg
node.script: COPY include/erb/vcvrack/resource/songhuei.9mm.svg
node.script: COPY include/erb/vcvrack/resource/thonk.pj398sm.knurled.svg
node.script: COPY include/erb/vcvrack/resource/thonk.pj398sm.hex.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.1.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.2.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.3.svg
node.script: CXX src/Button.cpp
node.script: CXX src/GateOut.cpp
node.script: CXX src/detail/Animation.cpp
node.script: CXX src/detail/Debounce.cpp
node.script: CXX src/detail/Sdram.cpp
node.script: CXX src/detail/Sram.cpp
node.script: CXX src/vcvrack/BoardGeneric.cpp
node.script: CXX src/vcvrack/ModuleBoard.cpp
node.script: CXX include/gen_dsp/genlib.cpp
node.script: CXX plugin_vcvrack.cpp
node.script: CXX test_erbb.cpp
node.script: CXX test_erbui.cpp
node.script: CXX module_max_alt.cpp
node.script: LINK plugin.dll
node.script: PACKAGE Release test
node.script: INSTALL C:Usersxxxxx/Documents/Rack2/plugins/test/ 
node.script: mingw32-make: Leaving directory 'C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/simulator'
node.script: child process exited with code 0

Also note that the path is not well fomated in

node.script: INSTALL C:Usersxxxxx/Documents/Rack2/plugins/test/  **<-- here / is missing in Users/xxxxx/...** 

Thanks

ohmtech-rdi commented 1 year ago

Ah ok, packages are on OneDrive, so maybe we should support that.

Apart from that, seems it's working @OmsInSerial ? For C:Usersxxxxx/Documents/Rack2/plugins/test/ that's because make doesn't escape properly \ when echoing the install path.

Also, any idea on why this import gyp problem is solved now?

OmsInSerial commented 1 year ago

@ohmtech-rdi yes it's working now thanks to the added link. Absolute no idea about the import gyp issue. If I remember correctly max/node.script worked in a weird directory in Issue when saving max patch under Windows #561 :

node.script: Error: python3: can't open file 'C:\\Users\\xxxxx\\OneDrive\\Documents\\Max 8\\build-system\\scripts\\erbb': [Errno 2] No such file or directory

Don't know why, but it seems that the path is now pointing to C:\Users\xxxxx\eurorack-blocks\build-system.

eliottparis commented 1 year ago

@ohmtech-rdi The --with-max-support has been added. @OmsInSerial Support for custom Documents paths such as OneDrive on Windows has been added.

ohmtech-rdi commented 1 year ago

Problem on CI: most probably an outage of Launchpad. Weird that it is affecting only Ubuntu 22 though. Let's wait for now.

eliottparis commented 1 year ago

@OmsInSerial could you please give a last try to this branch?

OmsInSerial commented 1 year ago

@eliottparis as requested, I gave it a try on setup-install-max-package branch

Link to Eurorack-blocks deleted in C:\Users\xxxxx\OneDrive\Documents\Max 8\Packages

MaxPackages

xxxxx@xxxxx MINGW64 ~/eurorack-blocks  (main)
$ git switch setup-install-max-package
xxxxx@xxxxx MINGW64 ~/eurorack-blocks (setup-install-max-package)
$ git pull
Already up to date.
xxxxx@xxxxx MINGW64 ~/eurorack-blocks (setup-install-max-package)
$ erbb setup --with-max-support
Extracting msys2_mingw64.zip...
Extracting kicad_minimal_windows_6.0.11-0.tar.gz...
Extracting gcc-arm-none-eabi-10.3-2021.10-win32.zip...
Adding Max support...
Installing python packages...
Adding Max support...
Optimizing erbb...
Checking toolchain...
OK.

Link to Eurorack-blocks created in C:\Users\xxxxx\OneDrive\Documents\Max 8\Packages

MaxPackages2

Saving a test patch in Max :

node.script: artifacts already exists, skipping.
gen~: exported: C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/module_max.cpp
node.script: Build starting
node.script: module: /Users/xxxxx/eurorack-blocks/samples/test/
node.script: Configuring...
node.script: child process exited with code 0
node.script: Building...
node.script: mingw32-make: Entering directory 'C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/simulator'
node.script: ACTION Max
node.script: ACTION UI
node.script: ACTION VCV Rack
node.script: COPY include/erb/vcvrack/resource/rogan.6ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.5ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.3ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.2ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.2s.black.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1ps.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1s.black.svg
node.script: COPY include/erb/vcvrack/resource/rogan.1s.svg
node.script: COPY include/erb/vcvrack/resource/sifam.dbn151.white.svg
node.script: COPY include/erb/vcvrack/resource/sifam.drn111.white.svg
node.script: COPY include/erb/vcvrack/resource/songhuei.9mm.svg
node.script: COPY include/erb/vcvrack/resource/thonk.pj398sm.knurled.svg
node.script: COPY include/erb/vcvrack/resource/thonk.pj398sm.hex.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.1.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.2.svg
node.script: COPY include/erb/vcvrack/resource/dailywell.2ms.3.svg
node.script: CXX src/Button.cpp
node.script: CXX src/GateOut.cpp
node.script: CXX src/detail/Animation.cpp
node.script: CXX src/detail/Debounce.cpp
node.script: CXX src/detail/Sdram.cpp
node.script: CXX src/detail/Sram.cpp
node.script: CXX src/vcvrack/BoardGeneric.cpp
node.script: CXX src/vcvrack/ModuleBoard.cpp
node.script: CXX include/gen_dsp/genlib.cpp
node.script: CXX plugin_vcvrack.cpp
node.script: CXX test_erbb.cpp
node.script: CXX test_erbui.cpp
node.script: CXX module_max_alt.cpp
node.script: LINK plugin.dll
node.script: PACKAGE Release test
node.script: INSTALL C:Usersxxxxx/Documents/Rack2/plugins/test/
node.script: mingw32-make: Leaving directory 'C:/Users/xxxxx/eurorack-blocks/samples/test/artifacts/simulator'
node.script: child process exited with code 0

👍

ohmtech-rdi commented 1 year ago

Funny that the line Adding Max support... appeared twice, but I guess that was some sort of console glitch somehow. Checked the code, and I don't possibly see how this can happen. Anyway that wouldn't even be a big problem so I'm merging this now.