Replace usage of stdenvNoCC.
- For Linux, the real fix is `hardeningDisable` of "fortify"; - For macOS, the real fix is setting the C and CXX compilers in `desktop/build.sh` as well as disabling CMake install step; - Unfortunately for iOS we still need stdenvNoCC (or find a way to use GNU's ld instead of Apple's) Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
e8f762ec6f
commit
6eb806d2c1
|
@ -20,7 +20,8 @@ with pkgs;
|
||||||
"ios" = true;
|
"ios" = true;
|
||||||
"" = true;
|
"" = true;
|
||||||
}.${target-os} or false;
|
}.${target-os} or false;
|
||||||
_stdenv = stdenvNoCC; # TODO: Try to use stdenv for Darwin
|
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
|
||||||
|
_stdenv = if target-os == "ios" || target-os == "" then stdenvNoCC else stdenv;
|
||||||
statusDesktop = callPackage ./scripts/lib/setup/nix/desktop { inherit target-os; stdenv = _stdenv; };
|
statusDesktop = callPackage ./scripts/lib/setup/nix/desktop { inherit target-os; stdenv = _stdenv; };
|
||||||
statusMobile = callPackage ./scripts/lib/setup/nix/mobile { inherit target-os; stdenv = _stdenv; };
|
statusMobile = callPackage ./scripts/lib/setup/nix/mobile { inherit target-os; stdenv = _stdenv; };
|
||||||
nodeInputs = import ./scripts/lib/setup/nix/global-node-packages/output {
|
nodeInputs = import ./scripts/lib/setup/nix/global-node-packages/output {
|
||||||
|
@ -53,7 +54,6 @@ with pkgs;
|
||||||
wget
|
wget
|
||||||
] ++ nodePkgs
|
] ++ nodePkgs
|
||||||
++ lib.optional isDarwin cocoapods
|
++ lib.optional isDarwin cocoapods
|
||||||
++ lib.optional isLinux gcc7
|
|
||||||
++ lib.optional targetDesktop statusDesktop.buildInputs
|
++ lib.optional targetDesktop statusDesktop.buildInputs
|
||||||
++ lib.optional targetMobile statusMobile.buildInputs;
|
++ lib.optional targetMobile statusMobile.buildInputs;
|
||||||
shellHook =
|
shellHook =
|
||||||
|
@ -68,4 +68,5 @@ with pkgs;
|
||||||
fi
|
fi
|
||||||
set +e
|
set +e
|
||||||
'';
|
'';
|
||||||
|
hardeningDisable = statusDesktop.hardeningDisable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,4 +34,12 @@ echo "build.sh desktop fonts: "$desktopFonts
|
||||||
rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile
|
rm -rf CMakeFiles CMakeCache.txt cmake_install.cmake Makefile
|
||||||
|
|
||||||
# Build project
|
# Build project
|
||||||
cmake -DCMAKE_BUILD_TYPE=Debug -DEXTERNAL_MODULES_DIR="$ExternalModulesPaths" -DJS_BUNDLE_PATH="$JsBundlePath" -DDESKTOP_FONTS="$desktopFonts" . && make
|
cmake -DCMAKE_BUILD_TYPE=Debug \
|
||||||
|
-DEXTERNAL_MODULES_DIR="$ExternalModulesPaths" \
|
||||||
|
-DJS_BUNDLE_PATH="$JsBundlePath" \
|
||||||
|
-DDESKTOP_FONTS="$desktopFonts" \
|
||||||
|
-DCMAKE_C_COMPILER='gcc'\
|
||||||
|
-DCMAKE_CXX_COMPILER='g++' \
|
||||||
|
-DCMAKE_INSTALL_COMPONENT='' \
|
||||||
|
. && \
|
||||||
|
make
|
||||||
|
|
|
@ -79,6 +79,9 @@ if is_windows_target; then
|
||||||
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_C_COMPILER='x86_64-w64-mingw32.shared-gcc'"
|
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_C_COMPILER='x86_64-w64-mingw32.shared-gcc'"
|
||||||
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_CXX_COMPILER='x86_64-w64-mingw32.shared-g++'"
|
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_CXX_COMPILER='x86_64-w64-mingw32.shared-g++'"
|
||||||
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_RC_COMPILER='x86_64-w64-mingw32.shared-windres'"
|
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_RC_COMPILER='x86_64-w64-mingw32.shared-windres'"
|
||||||
|
elif is_macos; then
|
||||||
|
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_C_COMPILER='gcc'"
|
||||||
|
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_CXX_COMPILER='g++'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STATUSREACTPATH="$(cd "$SCRIPTPATH" && cd '..' && pwd)"
|
STATUSREACTPATH="$(cd "$SCRIPTPATH" && cd '..' && pwd)"
|
||||||
|
|
|
@ -36,7 +36,8 @@ in
|
||||||
'' else ''
|
'' else ''
|
||||||
export QT_PATH="${qt5.full}"
|
export QT_PATH="${qt5.full}"
|
||||||
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
|
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
|
||||||
'') + (lib.optionalString isDarwin ''
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
# Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 )
|
||||||
|
hardeningDisable = linuxPlatform.hardeningDisable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ];
|
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ];
|
||||||
|
|
||||||
|
# Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 )
|
||||||
|
hardeningDisable = [ "fortify" ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue