schemaspy: convert to mavenfod

This commit is contained in:
Weijia Wang 2023-06-20 12:56:20 +03:00
parent 940fcf2e5b
commit 1431c97d55

View File

@ -1,10 +1,7 @@
{ lib
, stdenv
, callPackage
, javaPackages
, maven
, jdk
, jre
, buildMaven
, makeWrapper
, git
, fetchFromGitHub
@ -12,53 +9,32 @@
, ensureNewerSourcesHook
}:
let
version = "6.1.1-SNAPSHOT";
javaPackages.mavenfod rec {
pname = "schemaspy";
version = "6.1.1-SNAPSHOT";
src = fetchFromGitHub {
owner = "schemaspy";
repo = "schemaspy";
rev = "110b1614f9ae4aec0e4dc4e8f0e7c647274d3af6";
sha256 = "sha256-X5B34zGhD/NxcK8TQvwdk1NljGJ1HwfBp47ocbE4HiU=";
hash = "sha256-X5B34zGhD/NxcK8TQvwdk1NljGJ1HwfBp47ocbE4HiU=";
};
deps = stdenv.mkDerivation {
name = "${pname}-${version}-deps";
inherit src;
nativeBuildInputs = [ jdk maven git ];
buildInputs = [ jre ];
buildPhase = ''
mvn package -Dmaven.test.skip=true -Dmaven.repo.local=$out/.m2 -Dmaven.wagon.rto=5000
'';
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside
installPhase = ''
find $out/.m2 -type f -regex '.+\(\.lastUpdated\|resolver-status\.properties\|_remote\.repositories\)' -delete
find $out/.m2 -type f -iname '*.pom' -exec sed -i -e 's/\r\+$//' {} \;
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "sha256-CUFA9L6qqjo3Jp5Yy1yCqbS9QAEb9PElys4ArPa9VhA=";
doCheck = false;
mvnParameters = "-Dmaven.test.skip=true";
mvnFetchExtraArgs = {
nativeBuildInputs = [
# the build system gets angry if it doesn't see git (even though it's not
# actually in a git repository)
git
maven
];
};
in
stdenv.mkDerivation rec {
inherit version pname src;
buildInputs = [
maven
];
mvnHash = "sha256-udjk5YlTK+Mm8weDhesK6X7qZn4w9HbKZ821SyWxsOE=";
nativeBuildInputs = [
makeWrapper
# the build system gets angry if it doesn't see git (even though it's not
# actually in a git repository)
git
maven
# springframework boot gets angry about 1970 sources
# fix from https://github.com/nix-community/mavenix/issues/25
@ -69,11 +45,9 @@ stdenv.mkDerivation rec {
graphviz
];
buildPhase = ''
preBuild = ''
VERSION=${version}
SEMVER_STR=${version}
mvn package --offline -Dmaven.test.skip=true -Dmaven.repo.local=$(cp -dpR ${deps}/.m2 ./ && chmod +w -R .m2 && pwd)/.m2
'';
installPhase = ''