add piston nix pkg for openjdk-java
This commit is contained in:
parent
c3d1ece81e
commit
93cf2319f3
|
@ -1,9 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put instructions to build your package in here
|
||||
|
||||
curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz
|
||||
|
||||
tar xzf java.tar.gz --strip-components=1
|
||||
rm java.tar.gz
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put 'export' statements here for environment variables
|
||||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "java",
|
||||
"version": "15.0.2",
|
||||
"aliases": []
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Put instructions to run the runtime
|
||||
mv $1 $1.java
|
||||
filename=$1.java
|
||||
shift
|
||||
java $filename "$@"
|
|
@ -1,5 +0,0 @@
|
|||
public class HelloWorld {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("OK");
|
||||
}
|
||||
}
|
|
@ -40,4 +40,5 @@ args: {
|
|||
"jvm-kotlin" = import ./jvm-kotlin.nix args;
|
||||
"julia" = import ./julia.nix args;
|
||||
"jelly" = import ./jelly.nix args;
|
||||
"openjdk-java" = import ./openjdk-java.nix args;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{pkgs, piston, ...}:
|
||||
let
|
||||
pkg = pkgs.openjdk;
|
||||
in piston.mkRuntime {
|
||||
language = "java";
|
||||
version = pkg.version;
|
||||
runtime = "openjdk";
|
||||
aliases = [];
|
||||
|
||||
run = ''
|
||||
mv $1 $1.java
|
||||
filename=$1.java
|
||||
shift
|
||||
${pkg}/bin/java $filename "$@"
|
||||
'';
|
||||
|
||||
tests = [
|
||||
(piston.mkTest {
|
||||
files = {
|
||||
"test.java" = ''
|
||||
public class PrinOK {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("OK");
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
args = [];
|
||||
stdin = "";
|
||||
packages = [];
|
||||
main = "test.java";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue