qmakeHook: move libtool archives and qmake project files to $dev/lib

This commit is contained in:
Thomas Tuegel 2016-04-26 14:20:32 -05:00
parent f67be47333
commit 97d9368471
3 changed files with 24 additions and 1 deletions

View File

@ -45,7 +45,6 @@ let
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ self.fixQtModuleCMakeConfig self.qmakeHook ];
NIX_QT_SUBMODULE = args.NIX_QT_SUBMODULE or true;
dontFixLibtool = args.dontFixLibtool or true;
outputs = args.outputs or [ "dev" "out" ];
setOutputFlags = args.setOutputFlags or false;

View File

@ -53,6 +53,17 @@ _qtMultioutModuleDevs() {
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "${!outputDev}/share"
moveToOutput "share/doc" "${!outputDev}"
# Move libtool archives and qmake project files to $dev/lib
if [ "z${!outputLib}" != "z${!outputDev}" ]; then
pushd "${!outputLib}"
find lib -name '*.a' -o -name '*.la' -o -name '*.prl' -print0 | \
while read -r -d $'\0' file; do
mkdir -p "${!outputDev}/$(dirname "$file")"
mv "${!outputLib}/$file" "${!outputDev}/$file"
done
popd
fi
}
qmakeConfigurePhase() {

View File

@ -235,6 +235,19 @@ stdenv.mkDerivation {
# freetype-2.5.4 changed signedness of some struct fields
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";
preFixup = ''
# Move libtool archives and qmake projects
if [ "z''${!outputLib}" != "z''${!outputDev}" ]; then
pushd "''${!outputLib}"
find lib -name '*.a' -o -name '*.la' -o -name '*.prl' | \
while read -r file; do
mkdir -p "''${!outputDev}/$(dirname "$file")"
mv "''${!outputLib}/$file" "''${!outputDev}/$file"
done
popd
fi
'';
postFixup =
''
# Don't retain build-time dependencies like gdb and ruby.