Remove usages of `nix show-derivation` in build-desktop.sh for purity
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
f048b8a80d
commit
ea837ff353
|
@ -34,6 +34,10 @@ in
|
|||
unset QT_PATH
|
||||
'' else ''
|
||||
export QT_PATH="${qt5.full}"
|
||||
export QT_BASEBIN_PATH="${qt5.qtbase.bin}"
|
||||
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
|
||||
'');
|
||||
'') +
|
||||
lib.optionalString targetLinux linuxPlatform.shellHook +
|
||||
lib.optionalString targetDarwin darwinPlatform.shellHook +
|
||||
lib.optionalString targetWindows windowsPlatform.shellHook;
|
||||
}
|
||||
|
|
|
@ -11,4 +11,8 @@ let
|
|||
in
|
||||
{
|
||||
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ];
|
||||
|
||||
shellHook = ''
|
||||
export STATUSREACT_LINUX_BASEIMAGE_PATH="${baseImage}/src"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -9,4 +9,8 @@ let
|
|||
in
|
||||
{
|
||||
buildInputs = [ baseImage ];
|
||||
|
||||
shellHook = ''
|
||||
export STATUSREACT_MACOS_BASEIMAGE_PATH="${baseImage}/src"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -14,4 +14,8 @@ in
|
|||
baseImage
|
||||
go # Needed for Windows build only
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export STATUSREACT_WINDOWS_BASEIMAGE_PATH="${baseImage}/src"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -209,14 +209,12 @@ function bundleWindows() {
|
|||
fi
|
||||
|
||||
# TODO this needs to be fixed: status-react/issues/5378
|
||||
local windowsBaseImagePath="$(nix show-derivation -r -f $STATUSREACTPATH | jq -r '.[] | select(.env.name=="StatusIm-Windows-base-image") | .outputs.out.path')/src/"
|
||||
|
||||
local top_srcdir=$(joinExistingPath "$STATUSREACTPATH" '.')
|
||||
VERSION_MAJOR="$(cut -d'.' -f1 <<<"$VERSION")"
|
||||
VERSION_MINOR="$(cut -d'.' -f2 <<<"$VERSION")"
|
||||
VERSION_BUILD="$(cut -d'.' -f3 <<<"$VERSION")"
|
||||
makensis -Dtop_srcdir=${top_srcdir} \
|
||||
-Dbase_image_dir=${windowsBaseImagePath} \
|
||||
-Dbase_image_dir=${STATUSREACT_WINDOWS_BASEIMAGE_PATH} \
|
||||
-DCOMPRESSION_ALGO=${compressionAlgo} \
|
||||
-DCOMPRESSION_TYPE=${compressionType} \
|
||||
-DVERSION_MAJOR=$VERSION_MAJOR \
|
||||
|
@ -239,8 +237,7 @@ function bundleLinux() {
|
|||
rm -rf StatusImAppImage AppDir
|
||||
|
||||
# TODO this needs to be fixed: status-react/issues/5378
|
||||
local baseAppImagePath="$(nix show-derivation -r -f $STATUSREACTPATH | jq -r '.[] | select(.env.name=="StatusImAppImage") | .outputs.out.path')/src"
|
||||
cp -r $baseAppImagePath/StatusImAppImage .
|
||||
cp -r ${STATUSREACT_LINUX_BASEIMAGE_PATH}/StatusImAppImage .
|
||||
chmod -R +w StatusImAppImage/
|
||||
|
||||
mkdir AppDir
|
||||
|
@ -305,19 +302,6 @@ function bundleLinux() {
|
|||
}
|
||||
|
||||
if is_macos; then
|
||||
function getQtFullOutPathFromNixStore() {
|
||||
local qtFullDerivationPath=$(nix show-derivation -f $STATUSREACTPATH/default.nix | jq -r '.[] | .inputDrvs | 'keys' | .[]' | grep qt-full)
|
||||
|
||||
echo $(nix show-derivation $qtFullDerivationPath | jq -r '.[] | .outputs.out.path')
|
||||
}
|
||||
|
||||
function getQtBaseBinPathFromNixStore() {
|
||||
local qtFullDerivationPath=$(nix show-derivation -f $STATUSREACTPATH/default.nix | jq -r '.[] | .inputDrvs | 'keys' | .[]' | grep qt-full)
|
||||
local qtBaseDerivationPath=$(nix show-derivation $qtFullDerivationPath | jq -r '.[] | .inputDrvs | 'keys' | .[]' | grep qtbase)
|
||||
|
||||
echo $(nix show-derivation $qtBaseDerivationPath | jq -r '.[] | .outputs.bin.path')
|
||||
}
|
||||
|
||||
function copyDylibNixDependenciesToPackage() {
|
||||
local dylib="$1"
|
||||
local contentsDir="$2"
|
||||
|
@ -444,8 +428,7 @@ function bundleMacOS() {
|
|||
# download prepared package with mac bundle files (it contains qt libraries, icon)
|
||||
rm -rf Status.app
|
||||
# TODO this needs to be fixed: status-react/issues/5378
|
||||
local baseAppImagePath="$(nix show-derivation -r -f $STATUSREACTPATH | jq -r '.[] | select(.env.name=="StatusImAppBundle") | .outputs.out.path')/src"
|
||||
cp -r $baseAppImagePath/Status.app .
|
||||
cp -r ${STATUSREACT_MACOS_BASEIMAGE_PATH}/Status.app .
|
||||
chmod -R +w Status.app/
|
||||
|
||||
local contentsPath='Status.app/Contents'
|
||||
|
@ -468,11 +451,9 @@ function bundleMacOS() {
|
|||
if program_exists nix && [ -n "$IN_NIX_SHELL" ]; then
|
||||
# Since in the Nix qt.full package the different Qt modules are spread across several directories,
|
||||
# macdeployqt cannot find some qtbase plugins, so we copy them in its place
|
||||
local qtbaseBinPath=$(getQtBaseBinPathFromNixStore)
|
||||
local qtfullOutPath=$(getQtFullOutPathFromNixStore)
|
||||
mkdir -p "$contentsPath/PlugIns"
|
||||
for plugin in ${qtbaseplugins[@]}; do copyQtPlugInToPackage "$qtbaseBinPath" "$plugin" "$contentsPath"; done
|
||||
for plugin in ${qtfullplugins[@]}; do copyQtPlugInToPackage "$qtfullOutPath" "$plugin" "$contentsPath"; done
|
||||
for plugin in ${qtbaseplugins[@]}; do copyQtPlugInToPackage "$QT_BASEBIN_PATH" "$plugin" "$contentsPath"; done
|
||||
for plugin in ${qtfullplugins[@]}; do copyQtPlugInToPackage "$QT_PATH" "$plugin" "$contentsPath"; done
|
||||
fi
|
||||
|
||||
macdeployqt Status.app \
|
||||
|
|
Loading…
Reference in New Issue