- If you haven't already done so, install Eclipse. You can do this from your * nix repositories, or from [the Eclipse download page][eclipse-download]. The Scala IDE for Eclipse claims that either Eclipse IDE for Java Developers or Eclipse Classic will suffice.
- Install the Scala distribution. Once again, if possible grab this from your repositories, if not then from [the Scala download page][scala-download]. I'd recommend the IzPack installer; it seems to work on all systems I've used it on.
- Install the Scala IDE for Eclipse. Head to [the Scala IDE for Eclipse download page][scala-ide-download] and follow the instructions to install it for Scala 2.9.x.
- Download and extract CSO. Head to [Bernard Sufrin's CSO files][cso-download] and download
cso.jar
, andcso-sources-scala2.9.0.tgz
. Choose somewhere to put them - if you're root and on * nix,/usr/share/java
is a good place. Putcso.jar
in there, and extract thesrc/
folder from the sou
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ touch libfoo.c | |
$ echo "int main(void) { return 0; }" > foo.c | |
$ cat SConstruct | |
env = Environment() | |
lib = env.Library('libfoo', 'libfoo.c') | |
program = env.Program('foo', LIBS=[lib]) | |
$ scons --tree=all | |
scons: Reading SConscript files ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def glob_recursive(path, pattern, exclude=None): | |
import SCons.Node.FS | |
globbed = Dir(path).glob(pattern, exclude=exclude) | |
sources = [] | |
for source in globbed: | |
if isinstance(source, SCons.Node.FS.Dir): | |
childpath = os.path.join(path, os.path.basename(source.path)) | |
sources += glob_recursive(childpath, pattern, exclude=exclude) | |
else: | |
sources += [source] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env = Environment() | |
# preprocess compiler.in to compiler | |
compiler = env.Command('compiler', 'compiler.in', 'cp $SOURCE $TARGET') | |
env['compiler'] = File(compiler)[0].abspath | |
# and then use that to compile foo.in | |
target = env.Command('foo', 'foo.in', '$compiler < $SOURCE > $TARGET') | |
Default(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import re | |
import subprocess | |
import SCons.Action | |
from SCons.Tool import cc | |
def detect_version(env, clang): | |
clang = env.subst(clang) | |
if not clang: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char** argv) { | |
string s("ab"); | |
{ | |
istringstream stream(s); | |
stream.ignore(1); stream.ignore(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package glslplugin.lang.scanner; | |
import com.intellij.lang.ForeignLeafType; | |
import com.intellij.lang.TokenWrapper; | |
import com.intellij.lexer.Lexer; | |
import com.intellij.lexer.LookAheadLexer; | |
import com.intellij.psi.tree.IElementType; | |
import com.intellij.util.containers.ImmutableUserMap; | |
import org.jetbrains.annotations.NotNull; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void GLMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void*) | |
{ | |
std::cout << message << std::endl; | |
} | |
static void SetupMessageCallback { | |
if (!ogl_ext_KHR_debug) return; | |
glDebugMessageCallback(GLMessageCallback, nullptr); | |
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); | |
glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
start=$(pwd) | |
while read line; do | |
dirname=$(dirname "$line") | |
basename=$(basename "$line") | |
cd "$dirname" | |
lowercase=$(echo "$basename" | tr '[A-Z]' '[a-z]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e # terminate on any error | |
[ -f p4v.tgz ] || wget http://www.perforce.com/downloads/perforce/r14.3/bin.linux26x86_64/p4v.tgz | |
mkdir -p opt && tar xf p4v.tgz -C opt | |
mkdir -p usr/bin | |
for f in p4admin p4merge p4v p4vc; do | |
[ -x "usr/bin/$f" ] || ln -s "../../opt/p4v-2014.3.1007540/bin/$f" "usr/bin/$f" | |
done |
NewerOlder