Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An update to making macOS standalones. #2881

Merged
merged 8 commits into from
Jun 12, 2017
Merged

Conversation

adcxyz
Copy link
Contributor

@adcxyz adcxyz commented May 21, 2017

Hi,
following @brianlheim asking about old standalone-related code, and requests to make my
related scripts official, I updated and tested my scripts for making simple OSX standalones.
They are now in the Guides help file proposed here, and could go into 3.9.

Please test and let me know about any snags, and add pointers to other related projects, such as @miguel-negrao 's work on the project feature.

best adc

@vivid-synth vivid-synth added env: SCIDE comp: Qt GUI sclang Qt components -- for IDE tickets, use "env: SCIDE" instead labels May 22, 2017
@adcxyz adcxyz changed the title first commit of simple guide to standalones. A simple guide to OSX standalones. May 26, 2017
Copy link
Member

@LFSaw LFSaw left a comment

Choose a reason for hiding this comment

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


I'd suggest a merge with

https://github.com/supercollider/supercollider/blob/master/HelpSource/Guides/standalones.schelp

especially the motivation section.

Also, we should discuss its location in the HelpSource directory (Tutorial? Guide?)

all in all I could not complete the review because of an error in step 3 (class did not compile successfully)

This Guide is for exporting copies of an existing SC3 setup,
for at least two scenarios:

A - Freezing an SC-based setup for non-expert users,
Copy link
Member

Choose a reason for hiding this comment

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

why not make this a list:: ?

This set of scripts creates a SuperCollider-based
Standalone app in a few basic steps:

1. copy the open SuperCollider.app or SC3-derived standalone.
Copy link
Member

Choose a reason for hiding this comment

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

why not make this a list::?


subsection:: What to prepare

* have your system ready with all desired quarks installed,
Copy link
Member

Choose a reason for hiding this comment

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

would be great to have such a minimal startup file listing here... something like

s.waitForBoot{
	{
		Line.kr(1, 0, 10, doneAction: 2) * SinOsc.ar(1000) * EnvGen.ar(Env.perc(0.01, 0.25), Impulse.kr(2), 0.1)!2
		
	}.play;
}

~newAppName = "Utopia_GenComp_39d";
~newAppLocation = "~/Desktop".standardizePath;

// some helper functions
Copy link
Member

Choose a reason for hiding this comment

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

maybe add
// nothing to be changed below this line


// 3. *** time for the first wakeup kiss *** //
unixCmd("open" + ~pathToNewApp);

Copy link
Member

Choose a reason for hiding this comment

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

I got lots of

ERROR: duplicate Class found: 'BinaryOpXStream' 
[...]
ERROR: There is a discrepancy.
numClassDeps 3482   gNumClasses 4752
Library has not been compiled successfully.
Library has not been compiled successfully.

maybe because I have a custom LanguageConfig file?

so I cannot test further...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @LFSaw,
Did I address all your requests in todays commits, or is anything still missing?
For the conflict, can you please test again whether it works now?
If your config is pointing to a git repo and not the internal classlib, things can go wrong.
So best to make a test config with internal classlib and help, plus a few quark includePaths.
thanks, adc

@bagong
Copy link
Contributor

bagong commented May 27, 2017

I'd suggest a merge with
https://github.com/supercollider/supercollider/blob/master/HelpSource/Guides/standalones.schelp
especially the motivation section.

Or just replace that version. It is not possible to open that guide in a sc-version that still supports the feature described there 😄 And I don't think anybody is able to run the SC-version required for the feature (3.4) let alone build it.

@LFSaw
Copy link
Member

LFSaw commented May 27, 2017

IMHO a mention of GPL in the standalone guide would be beneficial.

merged with standalones.schelp, pointed out GPL,
lists done with list:: , added basic startup file example.
@adcxyz
Copy link
Contributor Author

adcxyz commented Jun 4, 2017

@LFSaw @bagong,
Thanks for all the helpful comments, addressed all of them!
I hope this is substantial enough now for a merge.

Unfortunately, one puzzling question came back again:
With the exact same app-to-export-from and exact same scripts (these), the new app
sometimes has the intended userAppSupportDir "Library/Application Support/",
sometimes it stills falls back to "Library/Application Support/SuperCollider"!
I have no reproducer for what circumstances make it one or the other ...

I would appreciate any hunches, ideas, hints for what could cause this ...
Thanks adc

@adcxyz adcxyz changed the title A simple guide to OSX standalones. An update to making mascOS standalones. Jun 4, 2017
@adcxyz
Copy link
Contributor Author

adcxyz commented Jun 4, 2017

@LFSaw - could be in Tutorials or Guides, both is fine with me.

@mossheim
Copy link
Contributor

mossheim commented Jun 5, 2017

I will take a look at this today! No idea re: userAppSupportDir, I will see if I can figure out anything about that. Thanks for all your work on this @adcxyz!

@mossheim mossheim added this to the 3.9 milestone Jun 5, 2017
@LFSaw
Copy link
Member

LFSaw commented Jun 5, 2017

Unfortunately, I cannot have a close look atm... too much other things here. Hope someone else will jump in and try building a standalone. Great work anyhow!

Copy link
Contributor

@nhthn nhthn left a comment

Choose a reason for hiding this comment

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

thanks! i'm not going to review this really thoroughly since you know what you're doing and a help file can't really hurt anyone anyway. but just to be safe, a few unix commands could be made less destructive so that someone experimenting with the code is less likely to shoot themselves in the foot.

code::
/*
// if it failed, delete the app
unixCmd("rm -r" + quote(~pathToNewApp));
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a safer alternative to rm -r? i think there's a way to move something to trash from the command line on mac, but you gotta install something

Copy link
Contributor

Choose a reason for hiding this comment

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

brew install trash, but idk, I think this could also just be prefixed by a check that ~pathToNewApp has a good value.

Copy link
Contributor

Choose a reason for hiding this comment

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

or rm -ir like you've suggested above—it'll check on each directory to be deleted rather than on each file

Copy link
Member

Choose a reason for hiding this comment

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

if pathToNewApp = "*" you get a pretty bad command, don't you?

Copy link
Member

Choose a reason for hiding this comment

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

There is File.delete(path), and path.pathMatch.

Copy link
Member

Choose a reason for hiding this comment

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

have a look at install, a really great alternative to mv and thelike...

};
~writeText = { |path, string| File(path, "w").write(string).close; };
~copyFolder = { |orig, dest|
var str = "cp -r" + quote(orig) + quote(dest);
Copy link
Contributor

@nhthn nhthn Jun 5, 2017

Choose a reason for hiding this comment

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

cp -ir?

~pathsToCopy.do { |path|
unixCmd(
"cd" + quote(~newAppQuarksDir) ++ ";"
" cp -r" + quote(path).postln + ".");
Copy link
Contributor

@nhthn nhthn Jun 5, 2017

Choose a reason for hiding this comment

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

cp -ir?

Copy link
Member

Choose a reason for hiding this comment

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

have a look at install, a really great alternative to mv and thelike...

// b. rename the binary file:
"renaming macos binary to: ".post;
// fixups in the new app - 2. rename the binary inside the app folder
unixCmd("mv"
Copy link
Contributor

@nhthn nhthn Jun 5, 2017

Choose a reason for hiding this comment

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

mv -i?

@adcxyz
Copy link
Contributor Author

adcxyz commented Jun 6, 2017

OK, thanks for the tips!

  • the safest thing for the rm command is to replace it with user instructions to toss the app file ;-)
  • for the others, will look at install, and add safer flags.
    best a

removed obsolete help file images.
@LFSaw LFSaw changed the title An update to making mascOS standalones. An update to making macOS standalones. Jun 6, 2017
Copy link
Contributor

@nhthn nhthn left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

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

The code works perfectly on my machine, thank you so much for adding this material! There are two small issues I noticed; I think this can be merged once those are fixed.

~pathsToCopy.do { |path|
unixCmd(
"cd" + quote(~newAppQuarksDir) ++ ";"
" cp -ir" + quote(path).postln + ".");
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, I get a parse error. I think you need to add ++ to the end of the line above, possibly also a newline if that's what you were going for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

weird - I dont get a parse error here (3.9 dev). SO, I added the ++ as suggested just to make sure,
and it still runs fine.


Customize the "Standalone Resources" directory, which is located at the root of the SuperCollider source directory. Any files you put in this directory will override the files originating from the SuperCollider source at the same destination.
// TO PREPARE, CHECK YOUR CURRENT config in Preferences->Interpreter:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you intended this to go in the code:: block below; when rendered as-is this does not look well-formatted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, done.

@mossheim
Copy link
Contributor

mossheim commented Jun 8, 2017

Also, sorry it took me so long to look at this. I planned to give it a try Monday, but a friend visited unexpectedly :)

@adcxyz
Copy link
Contributor Author

adcxyz commented Jun 12, 2017

ok, done, ready to merge :-)

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

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

awesome, thanks! parse error might have been because I was copy-pasting from the help window, so I got nbsp's (possibly CRLF? not sure)

@mossheim mossheim merged commit 43b5762 into master Jun 12, 2017
@mossheim mossheim deleted the topic-guide-standalone branch June 12, 2017 14:42
@telephon
Copy link
Member

thank you!

@adcxyz
Copy link
Contributor Author

adcxyz commented Jun 13, 2017

happy to have it finalized :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: Qt GUI sclang Qt components -- for IDE tickets, use "env: SCIDE" instead enhancement env: SCIDE os: macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants