13 iconame = "STM32CubeMX";
14 package = stdenvNoCC.mkDerivation rec {
15 pname = "stm32cubemx";
19 url = "https://sw-center.st.com/packs/resource/library/stm32cube_mx_v${builtins.replaceStrings ["."] [""] version}-lin.zip";
20 hash = "sha256-By9T43GLM1J63TkRi3kl05h1RflBorU1QHgYOrXQ9N0=";
24 nativeBuildInputs = [ fdupes icoutils imagemagick ];
25 desktopItem = makeDesktopItem {
28 desktopName = "STM32CubeMX";
29 categories = [ "Development" ];
31 comment = meta.description;
33 startupNotify = false;
35 "x-scheme-handler/sgnl"
36 "x-scheme-handler/signalcaptcha"
41 mkdir -p $out/{bin,opt/STM32CubeMX,share/applications}
43 cp -r $src/MX/. $out/opt/STM32CubeMX/
44 chmod +rx $out/opt/STM32CubeMX/STM32CubeMX
46 cat << EOF > $out/bin/${pname}
48 ${jdk17}/bin/java -jar $out/opt/STM32CubeMX/STM32CubeMX
50 chmod +x $out/bin/${pname}
52 icotool --extract $out/opt/STM32CubeMX/help/${iconame}.ico
53 fdupes -dN . > /dev/null
55 for size in 16 24 32 48 64 128 256; do
56 mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps
57 if [ $size -eq 256 ]; then
58 mv ${iconame}_*_"$size"x"$size"x32.png \
59 $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
61 convert -resize "$size"x"$size" ${iconame}_*_256x256x32.png \
62 $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
66 cp ${desktopItem}/share/applications/*.desktop $out/share/applications
70 description = "A graphical tool for configuring STM32 microcontrollers and microprocessors";
72 A graphical tool that allows a very easy configuration of STM32
73 microcontrollers and microprocessors, as well as the generation of the
74 corresponding initialization C code for the Arm® Cortex®-M core or a
75 partial Linux® Device Tree for Arm® Cortex®-A core), through a
78 homepage = "https://www.st.com/en/development-tools/stm32cubemx.html";
79 sourceProvenance = with sourceTypes; [ binaryBytecode ];
80 license = licenses.unfree;
81 maintainers = with maintainers; [ angaz wucke13 ];
82 platforms = [ "x86_64-linux" ];
87 inherit (package) pname version meta;
88 runScript = "${package.outPath}/bin/stm32cubemx";