1 { lib, fetchFromGitHub, makeDesktopItem, copyDesktopItems, makeWrapper
7 pkgDescription = "A digital logic designer and circuit simulator.";
9 buildDate = "2024-09-03T14:02:31+02:00"; # v0.31 commit date
11 desktopItem = makeDesktopItem {
14 desktopName = "Digital";
15 comment = "Easy-to-use digital logic designer and circuit simulator";
18 categories = [ "Education" "Electronics" ];
19 mimeTypes = [ "text/x-digital" ];
21 keywords = [ "simulator" "digital" "circuits" ];
24 # Use the "no-git-rev" maven profile, which deactivates the plugin that
25 # inspect the .git folder to find the version number we are building, we then
26 # provide that version number manually as a property.
27 # (see https://github.com/hneemann/Digital/issues/289#issuecomment-513721481)
28 # Also use the commit date as a build and output timestamp.
29 mvnParameters = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
31 maven.buildMavenPackage rec {
32 inherit pname version jre;
34 src = fetchFromGitHub {
38 hash = "sha256-6XaM3U1x/yvoCrkJ2nMtBmj972gCFlWn3F4DM7TLWgw=";
41 inherit mvnParameters;
42 mvnHash = "sha256-wm/axWJucoW9P98dKqHI4bjrUnmBTfosCOdJg9VBJ+4=";
44 nativeBuildInputs = [ copyDesktopItems makeWrapper ];
50 mkdir -p $out/share/java
52 classpath=$(find $mvnDeps/.m2 -name "*.jar" -printf ':%h/%f');
53 install -Dm644 target/Digital.jar $out/share/java
55 makeWrapper ${jre}/bin/java $out/bin/${pname} \
56 --add-flags "-classpath $out/share/java/${pname}-${version}.jar:''${classpath#:}" \
57 --add-flags "-jar $out/share/java/Digital.jar"
59 install -Dm644 src/main/svg/icon.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg
60 for size in 16 32 48 64 128; do
61 install -Dm644 src/main/resources/icons/icon"$size".png $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
67 desktopItems = [ desktopItem ];
70 homepage = "https://github.com/hneemann/Digital";
71 description = pkgDescription;
72 mainProgram = "digital";
73 license = licenses.gpl3Only;
74 platforms = platforms.all;
75 maintainers = with maintainers; [ Dettorer ];