I tried to install the pro version on NixOS.
I got the following error message:
Verifying archive integrity… All good.
Uncompressing QCAD..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
./qcad-3.27.1-pro-linux-x86_64.run: line 392: ./setup.sh: cannot execute: required file not found
./qcad-3.27.1-pro-linux-x86_64.run: line 400: /bin/rm: No such file or directory
I guess this error is due to the way NixOS is working the shell script can’t find the right path.
Usually a path in NixOS looks like: /run/current-system/sw/bin/bash
Is there a way to fix this? How can I change the .sh by myselfe?
#!/usr/bin/env /run/current-system/sw/bin/bash
#
# QCAD startup script
#
DIR=$"/home/usr/qcad-3.28.1-pro-linux-x86_64"
test -L "$0" && DIR=$(dirname $(readlink -f $0))
binary="/home/usr/qcad-3.28.1-pro-linux-x86_64/qcad-bin"
# set to 1 if QCAD renders with very small icons / menus on a high resolution screen:
QT_AUTO_SCREEN_SCALE_FACTOR=0 LD_LIBRARY_PATH="$DIR" "$binary" "$@"
ret=$?
if [ $ret -ne 0 ]
then
echo ""
echo "QCAD has unexpectedly quit."
echo ""
echo "Please use the offscreen or minimal platform plugin for headless systems"
echo "(without a running X11 server):"
echo "$0 -platform offscreen"
echo ""
echo "In addition, you might have to override the default Qt style"
echo "to prevent the loading of a native desktop style (such as GTK):"
echo "$0 -style plastique"
fi
exit $ret
Now I get this error message:
./qcad: line 13: /home/usr/qcad-3.28.1-pro-linux-x86_64/qcad-bin: cannot execute: required file not found
QCAD has unexpectedly quit.
Please use the offscreen or minimal platform plugin for headless systems
(without a running X11 server):
./qcad -platform offscreen
In addition, you might have to override the default Qt style
to prevent the loading of a native desktop style (such as GTK):
./qcad -style plastique
I did some research and stumbled across this page:
Running generic linux executables generally does not work on nixos. This is because the ELF interpreter (ld-linux.so) is not in the standard location in /lib (there isn’t even a /lib on nixos!), because script interpreters aren’t found at their usual locations aside from /bin/sh and /usr/bin/env, and because there is no global library path on nixos at all.
The possible solutions include, in rough order of preference:
Package whatever program it is from source, if possible
Package whatever program it is with autoPatchelfHook
Package whatever program it is with buildFHSUserEnv
Run it with steam-run
Run it with nix-ld and/or envfs
So I don’t think it’s easily possible to run QCAD on your particular system as it does things very differently from a “regular” Linux installation. nix-ld might be a way, but certainly not straight-forward.
You can contact me for a refund as your system is not supported at this point by QCAD.