[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] quarks install actions
crucial felix wrote:
> This could also be used to alias ugen source code into a project.
>
> -cx
>
> On Dec 19, 2006, at 10:46 AM, stefan kersten wrote:
>
>>> What do you wanna build/cleanup when installing quarks?
>>
>> postInstall: { |quark|
>> quark.build_scons("install-local");
>> },
>> preUninstall: { |quark|
>> quark.build_scons("-c install-local");
>> }
>> )
i'm attaching what i'm using currently. build and execution task are
delayed to after installation and require a restart. they can be either
automatic or have to be initiated by the user. cleanup actions are
called automatically from Quarks.
<sk>
Quarkage
{
*packageName {
^this.name.asString.replace("Package", "").asSymbol
}
*path {
^this.filenameSymbol.asString.dirname
}
*makePath { | ... path |
^this.path +/+ path.join($/)
}
*makePlatformPath { | ... path |
^this.makePath(*(path ++ [thisProcess.platform.platformDir]))
}
// build tools
*build_scons { | ... args |
if (systemCmd("scons --directory=% %".format(this.path.escapeChar($ ), args.join(" "))) != 0) {
Error("scons failed").throw;
}
}
*warn { | aString |
var pkg = "[Package %]".format(this.packageName);
("==== WARNING " ++ pkg ++ "\n").postln;
aString.postln;
("==== " ++ pkg ++ "\n").postln;
}
*stampFile {
^this.makePath(".quarks-package-stamp-%".format(this.packageName));
}
*doOnce { | function |
var stampFile = this.stampFile;
if (File.exists(stampFile).not) {
File.use(stampFile, "w");
function.value;
}
}
*build {
}
*clean {
systemCmd("rm -f " ++ this.stampFile.escapeChar($ ));
}
*beforeUninstall {
try { this.clean };
}
*afterUninstall {
}
}
SCUMPackage : Quarkage
{
classvar serverProgram;
*initClass {
this.doOnce {
if (File.exists(this.serverProgram).not) {
this.warn("Before using SCUM you need to build the server program for your platform.
Execute
SCUMPackage.build;
to build the package.
Library requirements:
fltk-1.1.X from http://www.fltk.org
")
}
}
}
*serverProgram {
^serverProgram ?? { serverProgram = this.makePlatformPath("bin") +/+ "scum" }
}
*build {
super.build;
this.build_scons("install-local");
}
*clean {
{ this.build_scons("-c install-local") }.try;
super.clean;
}
}