nixpkgs/pkgs/by-name/ap/apgdiff/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

47 lines
1.1 KiB
Nix

{ lib
, maven
, fetchFromGitHub
, jre
, makeWrapper
}:
maven.buildMavenPackage rec {
pname = "apgdiff";
version = "2.7.0";
src = fetchFromGitHub {
sparseCheckout = [ "src" ];
owner = "fordfrog";
repo = "apgdiff";
rev = "refs/tags/release_${version}";
hash = "sha256-2m+9QNwQV2tJwOabTXE2xjRB5gDrSwyL6zL2op+wmkM=";
};
# Fix wrong version string in --help
postPatch = ''
sed -i 's/VersionNumber=.*/VersionNumber=${version}/' \
src/main/resources/cz/startnet/utils/pgdiff/Resources.properties
'';
mvnHash = "sha256-zJQirS8sVqHKZsBukEOf7ox5IeiAVOP6wEHWb4CAyxc=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
install -Dm644 target/apgdiff-${version}.jar $out/lib/apgdiff.jar
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/apgdiff \
--argv0 apgdiff \
--add-flags "-jar $out/lib/apgdiff.jar"
'';
meta = with lib; {
description = "Another PostgreSQL diff tool";
mainProgram = "apgdiff";
homepage = "https://apgdiff.com";
license = licenses.mit;
inherit (jre.meta) platforms;
maintainers = [ maintainers.misterio77 ];
};
}