tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
qmake: unify Darwin and Linux setup hooks
Thomas Tuegel
8 years ago
1607f516
870c07cc
+14
-51
4 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
qt-5
5.6
default.nix
5.8
default.nix
qmake-hook-darwin.sh
qmake-hook.sh
+4
-4
pkgs/development/libraries/qt-5/5.6/default.nix
···
151
151
{ deps = [ makeWrapper ]; }
152
152
(if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh);
153
153
154
154
-
qmake =
155
155
-
makeSetupHook
156
156
-
{ deps = [ self.qtbase.dev ]; }
157
157
-
(if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh);
154
154
+
qmake = makeSetupHook {
155
155
+
deps = [ self.qtbase.dev ];
156
156
+
substitutions = { inherit (stdenv) isDarwin; };
157
157
+
} ../qmake-hook.sh;
158
158
};
159
159
160
160
self = makeScope newScope addPackages;
+4
-4
pkgs/development/libraries/qt-5/5.8/default.nix
···
138
138
{ deps = [ makeWrapper ] ++ optionals (!stdenv.isDarwin) [ dconf.lib gtk3 ]; }
139
139
(if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh);
140
140
141
141
-
qmake =
142
142
-
makeSetupHook
143
143
-
{ deps = [ self.qtbase.dev ]; }
144
144
-
(if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh);
145
141
142
142
+
qmake = makeSetupHook {
143
143
+
deps = [ self.qtbase.dev ];
144
144
+
substitutions = { inherit (stdenv) isDarwin; };
145
145
+
} ../qmake-hook.sh;
146
146
};
147
147
148
148
self = makeScope newScope addPackages;
-42
pkgs/development/libraries/qt-5/qmake-hook-darwin.sh
···
1
1
-
qmakeConfigurePhase() {
2
2
-
runHook preConfigure
3
3
-
4
4
-
qmake PREFIX=$out $qmakeFlags
5
5
-
6
6
-
runHook postConfigure
7
7
-
}
8
8
-
9
9
-
if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
10
10
-
configurePhase=qmakeConfigurePhase
11
11
-
fi
12
12
-
13
13
-
_qtModuleMultioutDevsPre() {
14
14
-
# We cannot simply set these paths in configureFlags because libQtCore retains
15
15
-
# references to the paths it was built with.
16
16
-
moveToOutput "bin" "${!outputDev}"
17
17
-
moveToOutput "include" "${!outputDev}"
18
18
-
19
19
-
# The destination directory must exist or moveToOutput will do nothing
20
20
-
mkdir -p "${!outputDev}/share"
21
21
-
moveToOutput "share/doc" "${!outputDev}"
22
22
-
}
23
23
-
24
24
-
_qtModuleMultioutDevsPost() {
25
25
-
# Move libtool archives and qmake project files to $dev/lib
26
26
-
if [ "z${!outputLib}" != "z${!outputDev}" ]; then
27
27
-
pushd "${!outputLib}"
28
28
-
if [ -d "lib" ]; then
29
29
-
find lib \( -name '*.a' -o -name '*.la' \) -print0 | \
30
30
-
while read -r -d $'\0' file; do
31
31
-
mkdir -p "${!outputDev}/$(dirname "$file")"
32
32
-
mv "${!outputLib}/$file" "${!outputDev}/$file"
33
33
-
done
34
34
-
fi
35
35
-
popd
36
36
-
fi
37
37
-
}
38
38
-
39
39
-
if [ -n "$NIX_QT_SUBMODULE" ]; then
40
40
-
preFixupHooks+=(_qtModuleMultioutDevsPre)
41
41
-
postFixupHooks+=(_qtModuleMultioutDevsPost)
42
42
-
fi
+6
-1
pkgs/development/libraries/qt-5/qmake-hook.sh
···
22
22
}
23
23
24
24
_qtModuleMultioutDevsPost() {
25
25
+
local -a findopts=(-name '*.a' -o -name '*.la')
26
26
+
if [ -z "@isDarwin@" ]; then
27
27
+
findopts+=(-o -name '*.prl')
28
28
+
fi
29
29
+
25
30
# Move libtool archives and qmake project files to $dev/lib
26
31
if [ "z${!outputLib}" != "z${!outputDev}" ]; then
27
32
pushd "${!outputLib}"
28
33
if [ -d "lib" ]; then
29
29
-
find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \
34
34
+
find lib \( "${findopts[@]}" \) -print0 | \
30
35
while read -r -d $'\0' file; do
31
36
mkdir -p "${!outputDev}/$(dirname "$file")"
32
37
mv "${!outputLib}/$file" "${!outputDev}/$file"