nbdesigner installation

This commit is contained in:
Gregory Bednov 2026-09-11 15:21:02 +03:00
commit 6987545aca
2 changed files with 60 additions and 0 deletions

View file

@ -31,6 +31,11 @@
inherit vcredist2019;
src = builtins.fetchurl { url = "${fileserver}/codesys3/prefix.tar.xz"; sha256 = "sha256:0x06y0151hmjsafnv469yyihmpy2n0pm7vnin9l64slngn1lh2zr"; };
};
nbdesigner = pkgs.callPackage ./pkgs/nbdesigner {
inherit mfc42;
src = builtins.fetchurl { url = "${fileserver}/nbdesigner/app.tar.xz"; sha256 = "sha256:0yc5pwqc7n7gm2rrq38maar7c6bkkp4l7m294wlr5cw6a7s4i5fk"; };
};
};
devShells.${system}.default = pkgs.mkShell {

View file

@ -0,0 +1,55 @@
{
stdenv, makeWrapper, makeDesktopItem, copyDesktopItems,
icoutils, wine, mfc42, src,
}:
stdenv.mkDerivation {
pname = "nbdesigner";
version = "1.36.0";
inherit src;
sourceRoot = "NB-Designer";
nativeBuildInputs = [ makeWrapper copyDesktopItems icoutils ];
desktopItems = [(makeDesktopItem {
name = "nbdesigner";
desktopName = "NB-Designer";
genericName = "HMI Programming";
exec = "nbdesigner";
icon = "nbdesigner";
categories = [ "Development" ];
startupWMClass = "NB-Designer.exe";
})];
winDlls = [ mfc42 ];
installPhase = ''
runHook preInstall
app=$out/share/nbdesigner
install -d $app
cp -r . $app/
for dep in $winDlls; do
install -Dm644 $dep/windll/*.dll -t $app
done
makeWrapper ${wine}/bin/wine $out/bin/nbdesigner \
--run '
PREFIX="$HOME/.local/share/nbdesigner-prefix"
if [ ! -d "$PREFIX" ]; then
WINEPREFIX="$PREFIX" WINEARCH=win32 wine wineboot --init 2>/dev/null
fi
export WINEPREFIX="$PREFIX"
export WINEARCH=win32
' \
--add-flags "$app/NB-Designer.exe"
wrestool -x -t 14 -n 1 NB-Designer.exe -o app.ico 2>/dev/null || true
for size in 16 32 48; do
icons=$out/share/icons/hicolor/''${size}x''${size}/apps
mkdir -p $icons
icotool -x --bit-depth=32 --width=$size --height=$size \
-o $icons/nbdesigner.png app.ico 2>/dev/null || true
done
runHook postInstall
'';
meta.mainProgram = "nbdesigner";
}