digital: fix desktop item and copy icons (#305171)
* digital: refactor desktopItem fix desktopName change name, exec and icon to pname * digital: refactor installPhase copy icons run pre and post install hooks (we need postInstall to actually run copyDesktopItems)
This commit is contained in:
parent
b823e90023
commit
b87a96cf1d
@ -3,17 +3,18 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
pname = "digital";
|
||||||
pkgDescription = "A digital logic designer and circuit simulator.";
|
pkgDescription = "A digital logic designer and circuit simulator.";
|
||||||
version = "0.30";
|
version = "0.30";
|
||||||
buildDate = "2023-02-03T08:00:56+01:00"; # v0.30 commit date
|
buildDate = "2023-02-03T08:00:56+01:00"; # v0.30 commit date
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
type = "Application";
|
type = "Application";
|
||||||
name = "Digital";
|
name = pname;
|
||||||
desktopName = pkgDescription;
|
desktopName = "Digital";
|
||||||
comment = "Easy-to-use digital logic designer and circuit simulator";
|
comment = "Easy-to-use digital logic designer and circuit simulator";
|
||||||
exec = "digital";
|
exec = pname;
|
||||||
icon = "digital";
|
icon = pname;
|
||||||
categories = [ "Education" "Electronics" ];
|
categories = [ "Education" "Electronics" ];
|
||||||
mimeTypes = [ "text/x-digital" ];
|
mimeTypes = [ "text/x-digital" ];
|
||||||
terminal = false;
|
terminal = false;
|
||||||
@ -28,8 +29,7 @@ let
|
|||||||
mvnParameters = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
|
mvnParameters = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
|
||||||
in
|
in
|
||||||
maven.buildMavenPackage rec {
|
maven.buildMavenPackage rec {
|
||||||
pname = "digital";
|
inherit pname version jre;
|
||||||
inherit version jre;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "hneemann";
|
owner = "hneemann";
|
||||||
@ -44,6 +44,8 @@ maven.buildMavenPackage rec {
|
|||||||
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
|
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
mkdir -p $out/share/java
|
mkdir -p $out/share/java
|
||||||
|
|
||||||
@ -53,6 +55,13 @@ maven.buildMavenPackage rec {
|
|||||||
makeWrapper ${jre}/bin/java $out/bin/${pname} \
|
makeWrapper ${jre}/bin/java $out/bin/${pname} \
|
||||||
--add-flags "-classpath $out/share/java/${pname}-${version}.jar:''${classpath#:}" \
|
--add-flags "-classpath $out/share/java/${pname}-${version}.jar:''${classpath#:}" \
|
||||||
--add-flags "-jar $out/share/java/Digital.jar"
|
--add-flags "-jar $out/share/java/Digital.jar"
|
||||||
|
|
||||||
|
install -Dm644 src/main/svg/icon.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg
|
||||||
|
for size in 16 32 48 64 128; do
|
||||||
|
install -Dm644 src/main/resources/icons/icon"$size".png $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
|
||||||
|
done
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
desktopItems = [ desktopItem ];
|
desktopItems = [ desktopItem ];
|
||||||
|
Loading…
Reference in New Issue
Block a user