picrate 2.0.0.pre-java → 2.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/MavenWrapperDownloader.java +1 -1
- data/.mvn/wrapper/maven-wrapper.properties +2 -2
- data/CHANGELOG.md +10 -0
- data/README.md +11 -9
- data/Rakefile +9 -8
- data/docs/_config.yml +1 -1
- data/docs/_editors/geany.md +1 -0
- data/docs/_gems/gems/gems.md +1 -1
- data/docs/_methods/alternative_methods.md +2 -1
- data/docs/_posts/2018-05-06-getting_started.md +4 -4
- data/docs/_posts/2018-05-06-install_jruby.md +5 -11
- data/docs/_posts/2018-05-11-arch-linux-arm.md +1 -11
- data/docs/_posts/2018-11-18-building-gem.md +4 -2
- data/docs/_posts/2018-11-27-getting_started_geany.md +1 -1
- data/docs/_posts/2019-11-11-getting_started_buster.md +4 -7
- data/docs/_posts/{2018-06-26-auto_install_picrate.md → 2020-03-09-auto_install_picrate.md} +9 -6
- data/docs/_posts/2020-05-11-getting_started_manjaro.md +106 -0
- data/docs/about.md +1 -1
- data/lib/picrate.rb +2 -1
- data/lib/picrate/app.rb +1 -0
- data/lib/picrate/helper_methods.rb +1 -1
- data/lib/picrate/native_folder.rb +6 -7
- data/lib/picrate/runner.rb +4 -4
- data/lib/picrate/version.rb +1 -1
- data/library/jcomplex/jcomplex.rb +1 -0
- data/mvnw +2 -2
- data/mvnw.cmd +2 -2
- data/picrate.gemspec +3 -5
- data/pom.rb +18 -15
- data/pom.xml +20 -8
- data/src/main/java/monkstone/complex/JComplex.java +252 -0
- data/src/main/java/processing/awt/PGraphicsJava2D.java +22 -23
- data/src/main/java/processing/awt/PImageAWT.java +377 -0
- data/src/main/java/processing/awt/ShimAWT.java +545 -0
- data/src/main/java/processing/core/PApplet.java +2030 -2556
- data/src/main/java/processing/core/PGraphics.java +138 -124
- data/src/main/java/processing/core/PImage.java +1517 -1702
- data/src/main/java/processing/core/PSurface.java +105 -139
- data/src/main/java/processing/core/PSurfaceNone.java +29 -0
- data/src/main/java/processing/opengl/PGL.java +649 -3699
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +223 -184
- data/src/main/java/processing/opengl/PJOGL.java +374 -1526
- data/src/main/java/processing/opengl/PShapeOpenGL.java +5 -6
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +220 -86
- data/vendors/Rakefile +33 -21
- data/vendors/{picrate_sketches.geany → geany.rb} +32 -7
- metadata +17 -48
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdddfc2a81e103e5e35ecf3e45af1420d9d476b8d972b4843c3476d4ad77cbe4
|
4
|
+
data.tar.gz: b58efaf4b2b75dea12197f91351832df20b259e620dcf533b993838e08ef7246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1d0f48db5a13ba7ef0b52d4ceca8f856d71151e65ad8fb7edd863068cea034da00e2c961dac336b51a28d37f17a79a51c1a510ab4512d54a9dc68f088cda29b
|
7
|
+
data.tar.gz: 528f50eeb4307547999670ab4059a316ce671b748f86e2fc2beeebbd1c3bf7f38b89663c77b63ddafb9988d8c5345e3e51a10e8554d9b59262333c8f03fc7193
|
data/.mvn/extensions.xml
CHANGED
@@ -20,7 +20,7 @@ import java.util.Properties;
|
|
20
20
|
|
21
21
|
public class MavenWrapperDownloader {
|
22
22
|
|
23
|
-
private static final String WRAPPER_VERSION = "0.5.
|
23
|
+
private static final String WRAPPER_VERSION = "0.5.6";
|
24
24
|
/**
|
25
25
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
26
26
|
*/
|
@@ -1,2 +1,2 @@
|
|
1
|
-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.
|
2
|
-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.
|
1
|
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
2
|
+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
v2.2.0 Bump to latest JOGL-rc January 2021
|
2
|
+
|
3
|
+
v2.1.2 Bump to JRuby-9.2.14.0
|
4
|
+
|
5
|
+
v2.1.1 Bump to JRuby-9.2.13.0, include examples using ruby `clamp` in place of processing `constrain`, update to video-2.0 release, add run instruction to help
|
6
|
+
|
7
|
+
v2.1.0 Refactor how we configure geany so we can use ENV['HOME'] rather hard code config file. Bump to JRuby-9.2.12.0, include Sam Pottingers July 2020 staging changes.
|
8
|
+
|
9
|
+
v2.0.1 Use JOGL-2.4.0-rc fixes reflection warnings, remove geomerative and wordcram gem dependencies since can now be in step with JRubyArt and propane (re jdk compatibility), bump version for release. Removed Gottfreid Haider shaders, warn legacy driver doesn't work with P2D and P3D sketches. Support aarch64 architecture on RaspberriPI4.
|
10
|
+
|
1
11
|
v2.0.0 Use JDK11+ update to processing-3.5.4 suggest jruby-9.2.11.0
|
2
12
|
|
3
13
|
v1.2.4 Extract picrate examples to ~/projects/examples instead of ~/picrate_samples for tighter integration with geany editor. Remove non-functioning sound library as an install option (direct toward minim as option).
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
__C6H3N3O7__ [![Gem Version](https://badge.fury.io/rb/picrate.svg)](https://badge.fury.io/rb/picrate)![Travis CI](https://travis-ci.org/ruby-processing/PiCrate.svg)
|
2
2
|
|
3
3
|
# PiCrate
|
4
|
-
New version for `Buster` on raspberryPI 3B+
|
5
|
-
|
4
|
+
New version for `Buster` on raspberryPI 3B+ works with jdk11 (reflective access warnings fixed for jdk11). Since version 2.0.1 also works on 64 bit Manjaro distro on RaspberryPI4. Create processing sketches in ruby on raspberry-pi and linux (this project is a parallel development of [propane][propane] targetting the raspberry-pi, but will initially be developed on a regular linux box). The aim is to produce a gem installable app that can be run with jruby, with minimal dependencies. Drop the `C` and you get pirate, or and an `e` and get `PiCreate`, a happy coincidence?
|
5
|
+
|
6
6
|
|
7
7
|
### To install from rubygems ###
|
8
8
|
|
@@ -12,21 +12,21 @@ jgem install picrate
|
|
12
12
|
|
13
13
|
### To Build and Test ###
|
14
14
|
|
15
|
-
Clone
|
15
|
+
Clone main branch:-
|
16
16
|
|
17
|
-
Requires java to build, but uses a maven wrapper so you don't need to install maven. Suggest build/test on regular linux box, but is designed for use on RaspberryPI 3B
|
17
|
+
Requires java to build (and [jogl-2.4.0-rc jars][jogl_jars]), but uses a maven wrapper so you don't need to install maven. Suggest build/test on regular linux box, but is designed for use on both RaspberryPI 3B+ and RaspberryPI4. Needs installed jruby to test/run.
|
18
18
|
|
19
19
|
```bash
|
20
|
-
cd PiCrate
|
20
|
+
cd PiCrate # or whatever you call it
|
21
21
|
rake # assumes an installed version of vanilla processing
|
22
|
-
jgem install picrate-
|
22
|
+
jgem install picrate-2.2.0-java.gem
|
23
23
|
|
24
24
|
```
|
25
25
|
To create a template sketch:-
|
26
26
|
```bash
|
27
27
|
picrate -c my_sketch 200 200
|
28
28
|
```
|
29
|
-
Edit sketch (vim is a good choice):-
|
29
|
+
Edit sketch ([vim][vim] is a good choice, but we recommend [geany][geany]) :-
|
30
30
|
```ruby
|
31
31
|
#!/usr/bin/env jruby
|
32
32
|
# frozen_string_literal: false
|
@@ -55,6 +55,8 @@ MySketch.new
|
|
55
55
|
jruby --dev my_sketch.rb # --dev flag speeds start-up
|
56
56
|
```
|
57
57
|
|
58
|
-
|
58
|
+
[buster]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
|
59
59
|
[propane]:https://ruby-processing.github.io/propane/
|
60
|
-
[
|
60
|
+
[vim]:https://github.com/ruby-processing/PiCrate/blob/master/docs/_editors/vim.md
|
61
|
+
[geany]:https://github.com/ruby-processing/PiCrate/blob/master/docs/_editors/geany.md
|
62
|
+
[jogl_jars]:https://jogamp.org/deployment/archive/rc/v2.4.0-rc-20210111/jar/
|
data/Rakefile
CHANGED
@@ -6,18 +6,14 @@ HOME_DIR = ENV['HOME']
|
|
6
6
|
|
7
7
|
task default: %i[init compile install test gem]
|
8
8
|
|
9
|
-
# depends on
|
9
|
+
# Currently depends on local jogl-2.4.0 jars on path ~/jogl24
|
10
10
|
desc 'Copy Jars'
|
11
11
|
task :init do
|
12
|
-
|
13
|
-
|
14
|
-
# alternative for debian linux etc
|
15
|
-
processing_root = File.join(HOME_DIR, 'processing-3.5.4')
|
16
|
-
jar_dir = File.join(processing_root, 'core', 'library')
|
17
|
-
opengl = Dir.entries(jar_dir).grep(/amd64|armv6hf/).select { |jar| jar =~ /linux/ }
|
12
|
+
jogl24 = File.join(HOME_DIR, 'jogl-2.4-rc2021011')
|
13
|
+
opengl = Dir.entries(jogl24).grep(/amd64|armv6hf|aarch64/).select { |jar| jar =~ /linux/ }
|
18
14
|
opengl.concat %w[jogl-all.jar gluegen-rt.jar]
|
19
15
|
opengl.each do |gl|
|
20
|
-
FileUtils.cp(File.join(
|
16
|
+
FileUtils.cp(File.join(jogl24, gl), File.join('.', 'lib'))
|
21
17
|
end
|
22
18
|
end
|
23
19
|
|
@@ -50,6 +46,11 @@ task :test do
|
|
50
46
|
system 'jruby --dev test/vecmath_spec_test.rb'
|
51
47
|
end
|
52
48
|
|
49
|
+
desc 'JDeps Tool'
|
50
|
+
task :jdeps do
|
51
|
+
system './mvnw jdeps:jdkinternals'
|
52
|
+
end
|
53
|
+
|
53
54
|
desc 'clean'
|
54
55
|
task :clean do
|
55
56
|
Dir['./**/*.{jar,gem}'].each do |path|
|
data/docs/_config.yml
CHANGED
@@ -4,7 +4,7 @@ title: PiCrate gem
|
|
4
4
|
email: mamba2928@yahoo.co.uk
|
5
5
|
description: > # this means to ignore newlines until "baseurl:"
|
6
6
|
The picrate gem is ruby implementation of processing, targetting raspberrypi and
|
7
|
-
linux
|
7
|
+
linux works on 32 bit raspbian Buster (and 64 bit Manajaro raspberryPI4).
|
8
8
|
baseurl: "" # the subpath of your site, e.g. /blog
|
9
9
|
regenerate: true
|
10
10
|
url: "https://ruby-processing.github.io/PiCrate"
|
data/docs/_editors/geany.md
CHANGED
@@ -9,6 +9,7 @@ Geany is highly configurable, and we have created a `geany` project file `picrat
|
|
9
9
|
```bash
|
10
10
|
picrate --install samples
|
11
11
|
```
|
12
|
+
Examples get installed in `~/projects/examples`, you can use `~/projects/sketchbook` to save your own sketches.
|
12
13
|
|
13
14
|
#### Using picrate.rb template ####
|
14
15
|
|
data/docs/_gems/gems/gems.md
CHANGED
@@ -18,7 +18,7 @@ NB: the arcball gem is installed as a picrate dependency
|
|
18
18
|
jbox2d ([pbox2d][jbox2d])
|
19
19
|
|
20
20
|
### Stand Alone Gems
|
21
|
-
[cf3][cf3] context free art in ruby
|
21
|
+
[cf3][cf3] context free art in ruby, examples may need a bit of hacking
|
22
22
|
|
23
23
|
[cf3]:https://github.com/monkstone/cf3ruby/
|
24
24
|
[arcball]:https://github.com/ruby-processing/ArcBall/
|
@@ -28,8 +28,9 @@ Here is a list of ruby alternatives to some 'processing' convenience methods; wh
|
|
28
28
|
| |`second` |`t.second` |
|
29
29
|
| |`year` |`t.year` |
|
30
30
|
|custom math |`map(x, b0, eo, b1, e1)`|`map1d(x, (b0..e0), (b1..e1))`|
|
31
|
-
| |`map(x, b0, eo, b1, e1)`|`p5map(x, b0, e0, b1, e1)`|
|
32
31
|
| |`max(array) `|`array.max` |
|
32
|
+
| |`map(x, b0, eo, b1, e1)`|`p5map(x, b0, e0, b1, e1)`|
|
33
|
+
| |`constrain(x, lo, hi)` |`x.clamp(lo, hi)` |
|
33
34
|
| |`min(array) `|`array.min` |
|
34
35
|
|conversion |`degrees(theta)` |`theta.degrees` |
|
35
36
|
|conversion |`radians(theta)` |`theta.radians` |
|
@@ -1,11 +1,11 @@
|
|
1
1
|
---
|
2
2
|
layout: post
|
3
|
-
title: "Getting Started
|
4
|
-
date:
|
3
|
+
title: "Getting Started Buster"
|
4
|
+
date: 2020-03-09 07:34:13
|
5
5
|
categories: PiCrate update
|
6
6
|
permalink: /getting/
|
7
7
|
---
|
8
|
-
Raspbian
|
8
|
+
Raspbian Buster installs OpenJDK11 (hard float) and that is just fine, if you have more that one version of java installed you could use `update-alternatives` tool to manage their use. NB: Will not work with OpenJDK-8.
|
9
9
|
|
10
10
|
__Then install JRuby see__ [jruby][jruby].
|
11
11
|
|
@@ -27,7 +27,7 @@ __Install processing libraries__
|
|
27
27
|
|
28
28
|
```bash
|
29
29
|
picrate -i Sound
|
30
|
-
picrate -i
|
30
|
+
picrate -i video # install beta verion of vanilla video for now
|
31
31
|
```
|
32
32
|
|
33
33
|
To create a template sketch from the command line:-
|
@@ -14,7 +14,7 @@ Get the latest version from [http://jruby.org/download][download]
|
|
14
14
|
|
15
15
|
```bash
|
16
16
|
cd /opt
|
17
|
-
sudo tar xzvf /pathToDownload/jruby-bin-9.2.
|
17
|
+
sudo tar xzvf /pathToDownload/jruby-bin-9.2.14.0.tar.gz
|
18
18
|
```
|
19
19
|
|
20
20
|
Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
|
@@ -36,17 +36,11 @@ export GEM_PATH="$HOME/tux/.gem/ruby/2.5.0"
|
|
36
36
|
export PATH="${PATH}:${GEM_PATH}/bin"
|
37
37
|
```
|
38
38
|
|
39
|
-
### Automated install using
|
40
|
-
Get the `Rakefile` [here][rake_gist] however it assumes an existing ruby install (which is not needed by PiCrate).
|
39
|
+
### Automated install using bash ###
|
41
40
|
|
42
|
-
|
43
|
-
mkdir installer
|
44
|
-
cd installer
|
45
|
-
rake
|
46
|
-
```
|
47
|
-
Currently installs jruby-9.2.11.0
|
41
|
+
The [picrate2_install.sh][bash] script currently installs jruby-9.2.14.0 and picrate-2.2.0.
|
48
42
|
|
49
43
|
If you know better please post on wiki
|
50
44
|
|
51
|
-
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.
|
52
|
-
[
|
45
|
+
[download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.14.0/jruby-dist-9.2.14.0-bin.tar.gz"
|
46
|
+
[bash]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
|
@@ -4,14 +4,4 @@ title: "Installing JRuby on Archlinux arm"
|
|
4
4
|
date: 2018-05-24 07:34:13
|
5
5
|
categories: PiCrate update
|
6
6
|
---
|
7
|
-
|
8
|
-
|
9
|
-
```bash
|
10
|
-
sudo pacman -Syu # get up to data
|
11
|
-
sudo pacman jdk-arm # but I'm not 100% sure what version is installed jdk8+ is reqd
|
12
|
-
sudo archlinux-java set java-8-openjdk/jre # case you have more than one java installed
|
13
|
-
sudo pacman jruby # should install latest version
|
14
|
-
```
|
15
|
-
|
16
|
-
|
17
|
-
[alarm]:https://archlinuxarm.org/platforms/armv6/raspberry-pi
|
7
|
+
Might work, please let us know!!! Manjaro works OK.
|
@@ -6,9 +6,9 @@ categories: PiCrate update
|
|
6
6
|
---
|
7
7
|
Requirements:-
|
8
8
|
|
9
|
-
1.
|
9
|
+
1. Latest jogl-2.4.0-rc jars (place in ~/jogl-2.4-rc2021011 folder see [jogl-jars][jars]).
|
10
10
|
|
11
|
-
2. jdk-11+ and maven
|
11
|
+
2. jdk-11+ and maven
|
12
12
|
|
13
13
|
Simply clone this distribution, then rake to build and test gem
|
14
14
|
```bash
|
@@ -16,3 +16,5 @@ git clone --depth 1 https://github.com/ruby-processing/PiCrate.git
|
|
16
16
|
cd PiCrate
|
17
17
|
rake # to build gem
|
18
18
|
```
|
19
|
+
|
20
|
+
[jars]:https://jogamp.org/deployment/archive/rc/v2.4.0-rc-20210111/jar/
|
@@ -5,7 +5,7 @@ date: 2018-11-27 07:34:13
|
|
5
5
|
categories: PiCrate update
|
6
6
|
permalink: /geany_ide/
|
7
7
|
---
|
8
|
-
The current version of raspbian installs jdk-
|
8
|
+
The current version of raspbian installs jdk-11 (hard float) and that is just fine, if you have more that one version of java installed you could use `update-alternatives` tool to manage their use.
|
9
9
|
|
10
10
|
Then install JRuby see [jruby][jruby].
|
11
11
|
|
@@ -5,17 +5,14 @@ date: 2019-11-11 07:34:13
|
|
5
5
|
categories: PiCrate update
|
6
6
|
permalink: /getting_buster/
|
7
7
|
---
|
8
|
-
|
9
|
-
```bash
|
10
|
-
bash buster_install.sh
|
11
|
-
```
|
8
|
+
Raspbian Buster usually comes with a pre-installed jdk11. Before installing JRuby it is worth setting the `JAVA_HOME` environmental variable (needed to supress reflection warnings).
|
12
9
|
|
13
10
|
__Otherwise follow these instructions in order as needed:-__
|
14
11
|
|
15
12
|
```bash
|
16
13
|
sudo apt-get update # sync your local database with current release
|
17
14
|
sudo update # update to latest release
|
18
|
-
sudo apt install openjdk-
|
15
|
+
sudo apt install openjdk-11-jdk # installs latest jdk11
|
19
16
|
java -version # check installed version
|
20
17
|
```
|
21
18
|
If you have already installed a version java the java version may not match you can control the _active_ java version on Debian using `update-alternatives` as follows:-
|
@@ -46,7 +43,7 @@ Install a local version of rake:-
|
|
46
43
|
```bash
|
47
44
|
jgem install rake
|
48
45
|
```
|
49
|
-
To install picrate and its dependencies:-
|
46
|
+
To install latest picrate and its dependencies:-
|
50
47
|
|
51
48
|
```bash
|
52
49
|
jgem install picrate
|
@@ -59,7 +56,7 @@ picrate --install # no args, install samples and geany config
|
|
59
56
|
picrate -i Samples # to omit geany config
|
60
57
|
```
|
61
58
|
|
62
|
-
This installs example sketches in `~/
|
59
|
+
This installs example sketches in `~/projects/examples` and ties them into a `geany` project `examples.geany`. It should also be possible to run sketches from the `geany` ide.
|
63
60
|
|
64
61
|
To create a template sketch from the command line:-
|
65
62
|
|
@@ -1,28 +1,31 @@
|
|
1
1
|
---
|
2
2
|
layout: post
|
3
3
|
title: "Automated PiCrate Install"
|
4
|
-
date:
|
4
|
+
date: 2020-03-09 07:34:13
|
5
5
|
categories: PiCrate update
|
6
6
|
permalink: /install_picrate/
|
7
7
|
---
|
8
8
|
|
9
|
-
For a semi-automated setup and install, download and extract [this gist](https://gist.github.com/monkstone/
|
9
|
+
For a semi-automated setup and install, download and extract [this gist](https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6). To keep your system clean put the file in a folder say
|
10
10
|
`~/install_picrate`
|
11
11
|
|
12
12
|
```bash
|
13
13
|
cd ~/picrate_install
|
14
|
-
bash
|
14
|
+
bash picrate2_install.sh # to run default task
|
15
15
|
```
|
16
16
|
#### What the script does ###
|
17
17
|
1. Downloads JRuby
|
18
18
|
2. Installs JRuby to `/opt`
|
19
19
|
3. Uses `update-alternatives` to configure `jruby`, `jgem` and `jirb`
|
20
20
|
4. The script checks for `GEM_HOME`, if undefined it modifies `~/.profile` to define `GEM_HOME` and puts gem binaries on your path, at logon.
|
21
|
-
5. Installs `
|
22
|
-
6.
|
21
|
+
5. Installs jdk11 if required sets `JAVA_HOME`, needed to support jruby
|
22
|
+
6. Creates `~/.gemrc` with `gem: no-document`
|
23
|
+
7. Installs `picrate` gem
|
24
|
+
To install `picrate_samples` also configures `geanyIDE` for use with `picrate` run
|
25
|
+
`picrate --install` in a bash console
|
23
26
|
|
24
27
|
#### Note ####
|
25
|
-
`GEM_HOME` and path to `gem` binaries
|
28
|
+
`GEM_HOME`, `JAVA_HOME` and path to `gem` binaries are not available until next logon, to use immediately you could:-
|
26
29
|
|
27
30
|
```bash
|
28
31
|
source ~/.profile
|
@@ -0,0 +1,106 @@
|
|
1
|
+
---
|
2
|
+
layout: post
|
3
|
+
title: "Getting Started Manjaro"
|
4
|
+
date: 2020-05-11 07:34:13
|
5
|
+
categories: PiCrate update
|
6
|
+
permalink: /getting_manjaro/
|
7
|
+
---
|
8
|
+
If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk14) should work.
|
9
|
+
|
10
|
+
```bash
|
11
|
+
sudo pacman -S jdk-openjdk # current distro version jdk14
|
12
|
+
```
|
13
|
+
You can also use pacman to install jruby
|
14
|
+
```bash
|
15
|
+
sudo pacman -S jruby # current version jruby-9.2.14.0
|
16
|
+
```
|
17
|
+
It is probably a good idea to create a local gem store (rather needing to use sudo to install gems)
|
18
|
+
|
19
|
+
```bash
|
20
|
+
mkdir -p ~/.gem/ruby/2.5.0 # current MRI version supported by jruby
|
21
|
+
```
|
22
|
+
Now set your `GEM_HOME`, `GEM_PATH` and amend your `PATH` as follows:-
|
23
|
+
|
24
|
+
```bash
|
25
|
+
echo "export GEM_HOME=\"\${HOME}/.gem/ruby/${MRI_RUBY}\"" >> ~/.bashrc
|
26
|
+
echo "export GEM_PATH=\"\${HOME}/.gem/ruby/${MRI_RUBY}\"" >> ~/.bashrc
|
27
|
+
echo "export PATH=\"\${PATH}:\${GEM_PATH}/bin\"" >> ~/.bashrc
|
28
|
+
source ~/.bashrc # to update environment without re-logging in
|
29
|
+
```
|
30
|
+
Now should be ready to install `picrate` and other gems. But speed up install time you should set `--no-document` option in ~/.gemrc
|
31
|
+
|
32
|
+
```bash
|
33
|
+
touch ~/.gemrc
|
34
|
+
echo "gem: --no-document" > ~/.gemrc
|
35
|
+
```
|
36
|
+
To install latest picrate and its dependencies:-
|
37
|
+
|
38
|
+
```bash
|
39
|
+
jgem install picrate
|
40
|
+
```
|
41
|
+
|
42
|
+
Geany is a good editor/ide for PiCrate on the RaspberryPI (install via pacman), but some may prefer vim. For geany you should edit/preferences/Terminal to `Execute programs in the VTE`.
|
43
|
+
|
44
|
+
__For a first install:-__
|
45
|
+
|
46
|
+
```bash
|
47
|
+
picrate --install # no args, install samples and geany config
|
48
|
+
# or
|
49
|
+
picrate -i Samples # to omit geany config
|
50
|
+
```
|
51
|
+
|
52
|
+
This installs example sketches in `~/projects/examples` and ties them into a `geany` project `examples.geany`. It should also be possible to run sketches from the `geany` ide. The geany config creates `picrate.rb` template sketch so you can create a new sketch with template.
|
53
|
+
|
54
|
+
To create a template sketch from the command line:-
|
55
|
+
|
56
|
+
```bash
|
57
|
+
picrate -c my_sketch 600 400
|
58
|
+
```
|
59
|
+
creates file my_sketch.rb
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
#!/usr/bin/env jruby
|
63
|
+
# frozen_string_literal: false
|
64
|
+
require 'picrate'
|
65
|
+
|
66
|
+
class MySketch < Processing::App
|
67
|
+
def settings
|
68
|
+
size 200, 200
|
69
|
+
end
|
70
|
+
|
71
|
+
def setup
|
72
|
+
sketch_title 'My Sketch'
|
73
|
+
end
|
74
|
+
|
75
|
+
def draw
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
79
|
+
MySketch.new
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
Edit in `vim` (at command line) or `geany` (gui), you may need to install `vim`
|
84
|
+
```bash
|
85
|
+
vim my_sketch.rb
|
86
|
+
:!jruby % # from vim runs the sketch
|
87
|
+
```
|
88
|
+
|
89
|
+
To run sketches from command line:-
|
90
|
+
|
91
|
+
```bash
|
92
|
+
jruby --dev my_sketch.rb
|
93
|
+
```
|
94
|
+
|
95
|
+
Or even `chmod +x my_sketch.rb` to make an executable script.
|
96
|
+
|
97
|
+
See [editors][geany] geany, for how to run sketches from a gui.
|
98
|
+
|
99
|
+
### JWishy Sketch Running on RaspberryPI
|
100
|
+
|
101
|
+
![jwishy_buster]({{ site.github.url }}/assets/jwishy_buster.png)
|
102
|
+
|
103
|
+
[buster]: https://gist.github.com/monkstone/04a1272ca9274a2c7e3e1bf170877bfb
|
104
|
+
[java]:http://ruby-processing.github.io/java/raspberry/
|
105
|
+
[jruby]:{{ site.github.url }}/install_jruby/
|
106
|
+
[geany]:{{ site.github.url }}/editors/geany
|