Merge pull request #106456 from eduardosm/diylc

This commit is contained in:
Sandro 2021-01-07 17:24:42 +01:00 committed by GitHub
commit ec56bf6ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,71 @@
{ stdenv, fetchurl, makeDesktopItem, unzip, bash, jre8 }:
let
pname = "diylc";
version = "4.15.1";
files = {
app = fetchurl {
url = "https://github.com/bancika/diy-layout-creator/releases/download/v${version}/diylc-${version}.zip";
sha256 = "09vzbxas654n8npxljqljf930y5gcjfvv3r4dv97dwk5sy66xvaf";
};
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;";
};
in
stdenv.mkDerivation rec {
inherit pname version;
dontUnpack = true;
buildInputs = [ jre8 ];
nativeBuildInputs = [ unzip ];
installPhase = ''
install -d $out/share/diylc
${unzip}/bin/unzip -UU ${files.app} -d $out/share/diylc
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
install -d $out/share/applications
ln -s ${launcher}/share/applications/* $out/share/applications/
install -d $out/bin
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
'';
meta = with stdenv.lib; {
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;
};
}

View File

@ -27585,6 +27585,8 @@ in
csxcad = callPackage ../applications/science/electronics/csxcad { };
diylc = callPackage ../applications/science/electronics/diylc { };
flatcam = callPackage ../applications/science/electronics/flatcam { };
fparser = callPackage ../applications/science/electronics/fparser { };