Can't install on NixOS

Post your question about installing or upgrading QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Post one question per topic.

Post Reply
leetschi
Newbie Member
Posts: 9
Joined: Wed Oct 20, 2021 7:53 pm

Can't install on NixOS

Post by leetschi » Mon Jun 12, 2023 7:17 pm

Hello Forum

I tried to install the pro version on NixOS.
I got the following error message:
Verifying archive integrity... All good.

Code: Select all

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?

User avatar
andrew
Site Admin
Posts: 9063
Joined: Fri Mar 30, 2007 6:07 am

Re: Can't install on NixOS

Post by andrew » Mon Jun 12, 2023 8:00 pm

Can you try the tar.gz bundle instead? You can extract it and then adjust the "qcad" run script as required.

leetschi
Newbie Member
Posts: 9
Joined: Wed Oct 20, 2021 7:53 pm

Re: Can't install on NixOS

Post by leetschi » Tue Jun 13, 2023 4:54 am

ok, I will give it a try.

Would be lovely to have flatpak or appimage though. But such a great software for the great price I shouldn't complaint :-)

leetschi
Newbie Member
Posts: 9
Joined: Wed Oct 20, 2021 7:53 pm

Re: Can't install on NixOS

Post by leetschi » Tue Jun 13, 2023 5:39 am

I changed like so:

Code: Select all

#!/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:

Code: Select all

./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
What should I change for it to work?

User avatar
andrew
Site Admin
Posts: 9063
Joined: Fri Mar 30, 2007 6:07 am

Re: Can't install on NixOS

Post by andrew » Wed Jun 14, 2023 7:25 am

I did some research and stumbled across this page:

https://discourse.nixos.org/t/smapi-doe ... ixos/25700
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.

leetschi
Newbie Member
Posts: 9
Joined: Wed Oct 20, 2021 7:53 pm

Re: Can't install on NixOS

Post by leetschi » Mon Jul 03, 2023 6:03 pm

Thank you Andrew sir!

Would be great to have a flatpak for linux users that can also activate the pro version. But I understand we are not many ...

Post Reply

Return to “QCAD Installation and Upgrades”