2024-01-02 11:29:13 +00:00
|
|
|
{ lib, maven, fetchFromGitHub, jre, makeWrapper, nix-update-script }:
|
|
|
|
|
|
|
|
maven.buildMavenPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "h2";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.2.224";
|
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "h2database";
|
|
|
|
repo = "h2database";
|
|
|
|
rev = "refs/tags/version-${version}";
|
|
|
|
hash = "sha256-pS9jSiuInA0eULPOZK5cjwr9y5KDVY51blhZ9vs4z+g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
mvnParameters = "-f h2/pom.xml -DskipTests";
|
|
|
|
mvnHash = "sha256-hUzE4F+RNCAfoY836pjrivf04xqN4m9SkiLXhmVzZRA=";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/java
|
|
|
|
install -Dm644 h2/target/h2-${version}.jar $out/share/java
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/h2 \
|
|
|
|
--add-flags "-cp \"$out/share/java/h2-${version}.jar:\$H2DRIVERS:\$CLASSPATH\" org.h2.tools.Console"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
mkdir -p $doc/share/doc/h2
|
|
|
|
cp -r h2/src/docsrc/* $doc/share/doc/h2
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "^version-([0-9.]+)$" ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The Java SQL database";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://h2database.com/html/main.html";
|
|
|
|
changelog = "https://h2database.com/html/changelog.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mpl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with maintainers; [ mahe anthonyroussel ];
|
|
|
|
mainProgram = "h2";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|