3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/electronics/diylc/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
2.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, makeDesktopItem, unzip, bash, jre8 }:
2021-01-06 14:00:31 +00:00
let
pname = "diylc";
2021-07-11 14:45:23 +01:00
version = "4.18.0";
2021-01-06 14:00:31 +00:00
files = {
app = fetchurl {
url = "https://github.com/bancika/diy-layout-creator/releases/download/v${version}/diylc-${version}.zip";
2021-07-11 14:45:23 +01:00
sha256 = "09fpp3dn086clgnjz5yj4fh5bnjvj6mvxkx9n3zamcwszjmxr40d";
2021-01-06 14:00:31 +00:00
};
icon16 = fetchurl {
url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_small.png";
sha256 = "1is50aidfwzwfzwqv57s2hwhx0r5c21cp77bkl93xkdqkh2wd8x4";
};
icon32 = fetchurl {
url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_medium.png";
sha256 = "0a45p18n84xz1nd3zv3y16jlimvqzhbzg3q3f4lawgx4rcrn2n3d";
};
icon48 = fetchurl {
url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_large.png";
sha256 = "06dkz0dcy8hfmnzr5ri5n1sh8r7mg83kzbvs3zy58wwhgzs1ddk6";
};
};
launcher = makeDesktopItem {
name = "diylc";
desktopName = "DIY Layout Creator";
comment = "Multi platform circuit layout and schematic drawing tool";
exec = "diylc";
icon = "diylc_icon";
categories = [ "Development" "Electronics" ];
2021-01-06 14:00:31 +00:00
};
in
stdenv.mkDerivation rec {
inherit pname version;
dontUnpack = true;
buildInputs = [ jre8 ];
nativeBuildInputs = [ unzip ];
installPhase = ''
runHook preInstall
2021-07-11 14:45:23 +01:00
mkdir -p $out/share/diylc
unzip -UU ${files.app} -d $out/share/diylc
2021-01-06 14:00:31 +00:00
rm $out/share/diylc/diylc.exe
rm $out/share/diylc/run.sh
# Nope, the icon cannot be named 'diylc' because KDE does not like it.
install -Dm644 ${files.icon16} $out/share/icons/hicolor/16x16/apps/diylc_icon.png
install -Dm644 ${files.icon32} $out/share/icons/hicolor/32x32/apps/diylc_icon.png
install -Dm644 ${files.icon48} $out/share/icons/hicolor/48x48/apps/diylc_icon.png
2021-07-11 14:45:23 +01:00
mkdir -p $out/share/applications
2021-01-06 14:00:31 +00:00
ln -s ${launcher}/share/applications/* $out/share/applications/
2021-07-11 14:45:23 +01:00
mkdir -p $out/bin
2021-01-06 14:00:31 +00:00
cat <<EOF > $out/bin/diylc
#!${bash}/bin/sh
cd $out/share/diylc
${jre8}/bin/java -Xms512m -Xmx2048m -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 -cp diylc.jar:lib org.diylc.DIYLCStarter
EOF
chmod +x $out/bin/diylc
runHook postInstall
2021-01-06 14:00:31 +00:00
'';
meta = with lib; {
2021-01-06 14:00:31 +00:00
description = "Multi platform circuit layout and schematic drawing tool";
homepage = "https://bancika.github.io/diy-layout-creator/";
changelog = "https://github.com/bancika/diy-layout-creator/releases";
license = licenses.gpl3Plus;
platforms = platforms.linux;
2021-10-28 15:21:46 +01:00
maintainers = with maintainers; [ ];
2021-01-06 14:00:31 +00:00
};
}