Skip to content

Commit c75bc68

Browse files
committed
nix: add script to update qmake symlinks
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 0d7b029 commit c75bc68

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

scripts/nix-update-qmake-symlinks.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
###
3+
# This script updates the symlinks to the qmake binaries in the nix store
4+
# It will be executed by direnv when entering the project directory via the shell.nix
5+
# The symlinks are to be used in Qt Creator and CLion
6+
###
7+
8+
# With direnv, the current directory is the project directory
9+
BIN_DIR="$(pwd)/bin"
10+
11+
mkdir -p "${BIN_DIR}"
12+
ln -sf "$(which qmake)" "${BIN_DIR}/qmake6" && "${BIN_DIR}/qmake6" --version
13+
# Run a pure shell so the shell.nix will not be loaded again by direnv
14+
nix-shell --pure -p which libsForQt5.qt5.qtbase --run "ln -sf \$(which qmake | tail -n1) \$PWD/bin/qmake5" && "${BIN_DIR}/qmake5" --version

shell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ pkgs.mkShell {
5454
];
5555

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

0 commit comments

Comments
 (0)