Skip to content

Commit

Permalink
nix: add script to update qmake symlinks
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Jan 20, 2025
1 parent 0d7b029 commit c75bc68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions scripts/nix-update-qmake-symlinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
###
# This script updates the symlinks to the qmake binaries in the nix store
# It will be executed by direnv when entering the project directory via the shell.nix
# The symlinks are to be used in Qt Creator and CLion
###

# With direnv, the current directory is the project directory
BIN_DIR="$(pwd)/bin"

mkdir -p "${BIN_DIR}"
ln -sf "$(which qmake)" "${BIN_DIR}/qmake6" && "${BIN_DIR}/qmake6" --version
# Run a pure shell so the shell.nix will not be loaded again by direnv
nix-shell --pure -p which libsForQt5.qt5.qtbase --run "ln -sf \$(which qmake | tail -n1) \$PWD/bin/qmake5" && "${BIN_DIR}/qmake5" --version
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ pkgs.mkShell {
];

shellHook = ''
echo "qmake: $(qmake --version)"
./scripts/nix-update-qmake-symlinks.sh
'';
}

0 comments on commit c75bc68

Please sign in to comment.