Merge pull request #267706 from anthonyroussel/updates/h2

h2: 2.2.220 -> 2.2.224
This commit is contained in:
Mario Rodas 2023-11-19 09:38:18 -05:00 committed by GitHub
commit d69346e062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,47 +1,45 @@
{ lib, stdenv, fetchzip, jre, makeWrapper }: { lib, maven, fetchFromGitHub, jre, makeWrapper, nix-update-script }:
stdenv.mkDerivation rec {
pname = "h2";
version = "2.2.220";
src = fetchzip { maven.buildMavenPackage rec {
url = "https://github.com/h2database/h2database/releases/download/version-${version}/h2-2023-07-04.zip"; pname = "h2";
hash = "sha256-nSOkCZuHcy0GR4SRjx524+MLqxJyO1PRkImPOFR1yts="; version = "2.2.224";
};
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
src = fetchFromGitHub {
owner = "h2database";
repo = "h2database";
rev = "refs/tags/version-${version}";
hash = "sha256-pS9jSiuInA0eULPOZK5cjwr9y5KDVY51blhZ9vs4z+g=";
};
mvnParameters = "-f h2/pom.xml -DskipTests";
mvnHash = "sha256-hUzE4F+RNCAfoY836pjrivf04xqN4m9SkiLXhmVzZRA=";
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
installPhase = installPhase = ''
let mkdir -p $out/share/java
h2ToolScript = '' install -Dm644 h2/target/h2-${version}.jar $out/share/java
#!/usr/bin/env bash
dir=$(dirname "$0")
if [ -n "$1" ]; then makeWrapper ${jre}/bin/java $out/bin/h2 \
${jre}/bin/java -cp "$dir/h2-${version}.jar:$H2DRIVERS:$CLASSPATH" $1 "''${@:2}" --add-flags "-cp \"$out/share/java/h2-${version}.jar:\$H2DRIVERS:\$CLASSPATH\" org.h2.tools.Console"
else
echo "You have to provide the full java class path for the h2 tool you want to run. E.g. 'org.h2.tools.Server'"
fi
'';
in ''
mkdir -p $out $doc/share/doc/
cp -R bin $out/
cp -R docs $doc/share/doc/h2
echo '${h2ToolScript}' > $out/bin/h2tool.sh mkdir -p $doc/share/doc/h2
cp -r h2/src/docsrc/* $doc/share/doc/h2
'';
substituteInPlace $out/bin/h2.sh --replace "java" "${jre}/bin/java" passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex" "^version-([0-9.]+)$" ];
chmod +x $out/bin/*.sh };
'';
meta = with lib; { meta = with lib; {
description = "The Java SQL database"; description = "The Java SQL database";
homepage = "http://www.h2database.com/html/main.html"; homepage = "https://h2database.com/html/main.html";
sourceProvenance = with sourceTypes; [ binaryBytecode ]; changelog = "https://h2database.com/html/changelog.html";
license = licenses.mpl20; license = licenses.mpl20;
platforms = lib.platforms.linux; platforms = lib.platforms.unix;
maintainers = with maintainers; [ mahe ]; maintainers = with maintainers; [ mahe anthonyroussel ];
mainProgram = "h2";
}; };
} }