Merge pull request #297196 from TomaSajt/brmodelo

brmodelo: make deterministic and clean up
This commit is contained in:
Peder Bergebakken Sundt 2024-04-22 23:34:10 +02:00 committed by GitHub
commit 52359fe80a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,27 +2,34 @@
, stdenv
, fetchFromGitHub
, fetchpatch
, openjdk8
, ant
, jdk8
, makeWrapper
, makeDesktopItem
, copyDesktopItems
, strip-nondeterminism
, stripJavaArchivesHook
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "brmodelo";
version = "3.31";
src = fetchFromGitHub {
owner = "chcandido";
repo = pname;
rev = version;
sha256 = "09qrhqhv264x8phnf3pnb0cwq75l7xdsj9xkwlvhry81nxz0d5v0";
repo = "brmodelo";
rev = finalAttrs.version;
hash = "sha256-YJcGfrcB+Qw35bMnqVs/tBzMGVj2DmfhRZ0YsSGGGSc=";
};
nativeBuildInputs = [ ant makeWrapper copyDesktopItems ];
buildInputs = [ openjdk8 ];
nativeBuildInputs = [
ant
jdk8
makeWrapper
copyDesktopItems
strip-nondeterminism
stripJavaArchivesHook
];
patches = [
# Fixes for building with Ant.
@ -30,22 +37,22 @@ stdenv.mkDerivation rec {
(fetchpatch {
name = "fix-self-closing-element-not-allowed.patch";
url = "https://github.com/yuuyins/brModelo/commit/0d712b74fd5d29d67be07480ed196da28a77893b.patch";
sha256 = "sha256-yy03arE6xetotzyvpToi9o9crg3KnMRn1J70jDUvSXE=";
hash = "sha256-yy03arE6xetotzyvpToi9o9crg3KnMRn1J70jDUvSXE=";
})
(fetchpatch {
name = "fix-tag-closing.patch";
url = "https://github.com/yuuyins/brModelo/commit/e8530ff75f024cf6effe0408ed69985405e9709c.patch";
sha256 = "sha256-MNuh/ORbaAkB5qDSlA/nPrXN+tqzz4oOglVyEtSangI=";
hash = "sha256-MNuh/ORbaAkB5qDSlA/nPrXN+tqzz4oOglVyEtSangI=";
})
(fetchpatch {
name = "fix-bad-use-greater-than.patch";
url = "https://github.com/yuuyins/brModelo/commit/498a6ef8129daff5a472b318f93c8f7f2897fc7f.patch";
sha256 = "sha256-MmAwYUmx38DGRsiSxCWCObtpqxk0ykUQiDSC76bCpFc=";
hash = "sha256-MmAwYUmx38DGRsiSxCWCObtpqxk0ykUQiDSC76bCpFc=";
})
(fetchpatch {
name = "fix-param-errors.patch";
url = "https://github.com/yuuyins/brModelo/commit/8a508aaba0bcffe13a3f95cff495230beea36bc4.patch";
sha256 = "sha256-qME9gZChSMzu1vs9HaosD+snb+jlOrQLY97meNoA8oU=";
hash = "sha256-qME9gZChSMzu1vs9HaosD+snb+jlOrQLY97meNoA8oU=";
})
# Add SVG icons.
@ -53,12 +60,14 @@ stdenv.mkDerivation rec {
(fetchpatch {
name = "add-brmodelo-logo-icons-svg.patch";
url = "https://github.com/yuuyins/brModelo/commit/f260b82b664fad3325bbf3ebd7a15488d496946b.patch";
sha256 = "sha256-UhgcWxsHkNFS1GgaRnmlZohjDR8JwHof2cIb3SBetYs=";
hash = "sha256-UhgcWxsHkNFS1GgaRnmlZohjDR8JwHof2cIb3SBetYs=";
})
];
buildPhase = ''
runHook postBuild
ant
runHook preBuild
'';
desktopItems = [
@ -68,15 +77,16 @@ stdenv.mkDerivation rec {
genericName = "Entity-relationship diagramming tool";
exec = "brmodelo";
icon = "brmodelo";
comment = meta.description;
comment = finalAttrs.meta.description;
categories = [ "Development" "Education" "Database" "2DGraphics" "ComputerScience" "DataVisualization" "Engineering" "Java" ];
})
];
installPhase = ''
install -d $out/bin $out/share/doc/${pname} $out/share/java
runHook preInstall
cp -rv ./dist/javadoc $out/share/doc/${pname}/
mkdir -p $out/share/doc/brmodelo
cp -rv ./dist/javadoc $out/share/doc/brmodelo/
install -Dm755 ./dist/brModelo.jar -t $out/share/java/
# NOTE: The standard Java GUI toolkit has a
@ -85,26 +95,28 @@ stdenv.mkDerivation rec {
# in WMs that are not in that list (e.g. XMonad).
# Solution/Workaround: set the environment variable
# _JAVA_AWT_WM_NONREPARENTING=1.
makeWrapper ${openjdk8}/bin/java $out/bin/brmodelo \
makeWrapper ${jdk8}/bin/java $out/bin/brmodelo \
--prefix _JAVA_AWT_WM_NONREPARENTING : 1 \
--prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on" \
--add-flags "-jar $out/share/java/brModelo.jar"
runHook postInstall
'';
postInstall = ''
for size in 16 24 32 48 64 128 256; do
install -Dm644 ./src/imagens/icone_"$size"x"$size".svg \
$out/share/icons/hicolor/"$size"x"$size"/apps/brmodelo.svg
done
runHook postInstall
'';
preFixup = ''
find $out/share/doc/brmodelo/javadoc -name "*.html" -exec strip-nondeterminism --type javadoc {} +
'';
meta = with lib; {
description = "Entity-relationship diagram tool for making conceptual and logical database models";
mainProgram = "brmodelo";
homepage = "https://github.com/chcandido/brModelo";
license = licenses.gpl3;
mainProgram = "brmodelo";
maintainers = with maintainers; [ yuu ];
};
}
})