2022-04-15 01:41:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, ant
|
2024-05-15 15:35:15 +00:00
|
|
|
, jdk8
|
2022-04-15 01:41:22 +00:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
2024-05-15 15:35:15 +00:00
|
|
|
, strip-nondeterminism
|
|
|
|
, stripJavaArchivesHook
|
2022-04-15 01:41:22 +00:00
|
|
|
}:
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-04-15 01:41:22 +00:00
|
|
|
pname = "brmodelo";
|
|
|
|
version = "3.31";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chcandido";
|
2024-05-15 15:35:15 +00:00
|
|
|
repo = "brmodelo";
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-YJcGfrcB+Qw35bMnqVs/tBzMGVj2DmfhRZ0YsSGGGSc=";
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
|
|
|
jdk8
|
|
|
|
makeWrapper
|
|
|
|
copyDesktopItems
|
|
|
|
strip-nondeterminism
|
|
|
|
stripJavaArchivesHook
|
|
|
|
];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fixes for building with Ant.
|
|
|
|
# https://github.com/chcandido/brModelo/pull/22
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-self-closing-element-not-allowed.patch";
|
|
|
|
url = "https://github.com/yuuyins/brModelo/commit/0d712b74fd5d29d67be07480ed196da28a77893b.patch";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-yy03arE6xetotzyvpToi9o9crg3KnMRn1J70jDUvSXE=";
|
2022-04-15 01:41:22 +00:00
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tag-closing.patch";
|
|
|
|
url = "https://github.com/yuuyins/brModelo/commit/e8530ff75f024cf6effe0408ed69985405e9709c.patch";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-MNuh/ORbaAkB5qDSlA/nPrXN+tqzz4oOglVyEtSangI=";
|
2022-04-15 01:41:22 +00:00
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-bad-use-greater-than.patch";
|
|
|
|
url = "https://github.com/yuuyins/brModelo/commit/498a6ef8129daff5a472b318f93c8f7f2897fc7f.patch";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-MmAwYUmx38DGRsiSxCWCObtpqxk0ykUQiDSC76bCpFc=";
|
2022-04-15 01:41:22 +00:00
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-param-errors.patch";
|
|
|
|
url = "https://github.com/yuuyins/brModelo/commit/8a508aaba0bcffe13a3f95cff495230beea36bc4.patch";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-qME9gZChSMzu1vs9HaosD+snb+jlOrQLY97meNoA8oU=";
|
2022-04-15 01:41:22 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
# Add SVG icons.
|
|
|
|
# https://github.com/chcandido/brModelo/pull/23
|
|
|
|
(fetchpatch {
|
|
|
|
name = "add-brmodelo-logo-icons-svg.patch";
|
|
|
|
url = "https://github.com/yuuyins/brModelo/commit/f260b82b664fad3325bbf3ebd7a15488d496946b.patch";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-UhgcWxsHkNFS1GgaRnmlZohjDR8JwHof2cIb3SBetYs=";
|
2022-04-15 01:41:22 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook postBuild
|
2022-04-15 01:41:22 +00:00
|
|
|
ant
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook preBuild
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "brmodelo";
|
|
|
|
desktopName = "brModelo";
|
|
|
|
genericName = "Entity-relationship diagramming tool";
|
|
|
|
exec = "brmodelo";
|
|
|
|
icon = "brmodelo";
|
2024-05-15 15:35:15 +00:00
|
|
|
comment = finalAttrs.meta.description;
|
2022-04-15 01:41:22 +00:00
|
|
|
categories = [ "Development" "Education" "Database" "2DGraphics" "ComputerScience" "DataVisualization" "Engineering" "Java" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook preInstall
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
mkdir -p $out/share/doc/brmodelo
|
|
|
|
cp -rv ./dist/javadoc $out/share/doc/brmodelo/
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
install -Dm755 ./dist/brModelo.jar -t $out/share/java/
|
|
|
|
# NOTE: The standard Java GUI toolkit has a
|
|
|
|
# hard-coded list of "non-reparenting" window managers,
|
|
|
|
# which cause issues while running brModelo
|
|
|
|
# in WMs that are not in that list (e.g. XMonad).
|
|
|
|
# Solution/Workaround: set the environment variable
|
|
|
|
# _JAVA_AWT_WM_NONREPARENTING=1.
|
2024-05-15 15:35:15 +00:00
|
|
|
makeWrapper ${jdk8}/bin/java $out/bin/brmodelo \
|
2022-04-15 01:41:22 +00:00
|
|
|
--prefix _JAVA_AWT_WM_NONREPARENTING : 1 \
|
|
|
|
--prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on" \
|
|
|
|
--add-flags "-jar $out/share/java/brModelo.jar"
|
|
|
|
|
|
|
|
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
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
find $out/share/doc/brmodelo/javadoc -name "*.html" -exec strip-nondeterminism --type javadoc {} +
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Entity-relationship diagram tool for making conceptual and logical database models";
|
|
|
|
homepage = "https://github.com/chcandido/brModelo";
|
|
|
|
license = licenses.gpl3;
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "brmodelo";
|
2022-04-15 01:41:22 +00:00
|
|
|
maintainers = with maintainers; [ yuu ];
|
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
})
|