14 iconame = "STM32CubeMX";
15 package = stdenvNoCC.mkDerivation rec {
16 pname = "stm32cubemx";
20 url = "https://sw-center.st.com/packs/resource/library/stm32cube_mx_v${
21 builtins.replaceStrings [ "." ] [ "" ] version
23 hash = "sha256-ypZVVPmAsApaccWl7ZtAECwphD2SUUiVNC2DYC5rYb4=";
32 desktopItem = makeDesktopItem {
35 desktopName = "STM32CubeMX";
36 categories = [ "Development" ];
38 comment = meta.description;
40 startupNotify = false;
42 "x-scheme-handler/sgnl"
43 "x-scheme-handler/signalcaptcha"
48 mkdir -p $out/{bin,opt/STM32CubeMX,share/applications}
50 cp -r $src/MX/. $out/opt/STM32CubeMX/
51 chmod +rx $out/opt/STM32CubeMX/STM32CubeMX
53 cat << EOF > $out/bin/${pname}
55 ${jdk21}/bin/java -jar $out/opt/STM32CubeMX/STM32CubeMX "\$@"
57 chmod +x $out/bin/${pname}
59 icotool --extract $out/opt/STM32CubeMX/help/${iconame}.ico
60 fdupes -dN . > /dev/null
62 for size in 16 24 32 48 64 128 256; do
63 mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps
64 if [ $size -eq 256 ]; then
65 mv ${iconame}_*_"$size"x"$size"x32.png \
66 $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
68 convert -resize "$size"x"$size" ${iconame}_*_256x256x32.png \
69 $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png
73 cp ${desktopItem}/share/applications/*.desktop $out/share/applications
77 description = "A graphical tool for configuring STM32 microcontrollers and microprocessors";
79 A graphical tool that allows a very easy configuration of STM32
80 microcontrollers and microprocessors, as well as the generation of the
81 corresponding initialization C code for the Arm® Cortex®-M core or a
82 partial Linux® Device Tree for Arm® Cortex®-A core), through a
85 homepage = "https://www.st.com/en/development-tools/stm32cubemx.html";
86 sourceProvenance = with sourceTypes; [ binaryBytecode ];
87 license = licenses.unfree;
88 maintainers = with maintainers; [
92 platforms = [ "x86_64-linux" ];
97 inherit (package) pname version meta;
98 runScript = "${package.outPath}/bin/stm32cubemx";