Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dg/reflex platform 21.05 #22

Open
wants to merge 3 commits into
base: reflex-platform-21.05
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkgs/development/compilers/ghc/8.10.7.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
, # GHC can be built with system libffi or a bundled one.
libffi ? null

, useLLVM ? !stdenv.targetPlatform.isx86
, useLLVM ? stdenv.targetPlatform.useiOSPrebuilt || !stdenv.targetPlatform.isx86
, # LLVM is conceptually a run-time-only depedendency, but for
# non-x86, we need LLVM to bootstrap later stages, so it becomes a
# build-time dependency too.
Expand Down Expand Up @@ -248,7 +248,10 @@ stdenv.mkDerivation (rec {
buildInputs = [ perl bash ] ++ (libDeps hostPlatform);

propagatedBuildInputs = [ targetPackages.stdenv.cc ]
++ lib.optional useLLVM llvmPackages.llvm;
++ lib.optionals useLLVM [
llvmPackages.llvm
llvmPackages.llvm.out
];

depsTargetTarget = map lib.getDev (libDeps targetPlatform);
depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
Expand Down
11 changes: 9 additions & 2 deletions pkgs/development/haskell-modules/with-packages-wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
{ lib, stdenv, ghc, darwin, llvmPackages, packages, symlinkJoin, makeWrapper
, withLLVM ? !(stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isPowerPC)
, postBuild ? ""
, ghcLibdir ? null # only used by ghcjs, when resolving plugins
Expand Down Expand Up @@ -44,6 +44,10 @@ let
packageCfgDir = "${libDir}/package.conf.d";
paths = lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages);
hasLibraries = lib.any (x: x.isHaskellLibrary) paths;

dyld_root_path = "${darwin.iosSdkPkgs.sdk.iPhoneOSRoot}/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot";
isSimulator = stdenv.targetPlatform.isiOS && stdenv.targetPlatform.isx86_64;

# CLang is needed on Darwin for -fllvm to work:
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm
llvm = lib.makeBinPath
Expand Down Expand Up @@ -73,6 +77,9 @@ symlinkJoin {
${lib.optionalString (ghc.isGhcjs or false)
''--set NODE_PATH "${ghc.socket-io}/lib/node_modules"''
} \
${lib.optionalString (isSimulator)
''--set DYLD_ROOT_PATH "${dyld_root_path}" \''
}
${lib.optionalString withLLVM ''--prefix "PATH" ":" "${llvm}"''}
fi
done
Expand All @@ -92,7 +99,7 @@ symlinkJoin {
for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do
if [[ -x "${ghc}/bin/$prg" ]]; then
rm -f $out/bin/$prg
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" ${lib.optionalString (isSimulator) ''--set DYLD_ROOT_PATH "${dyld_root_path}"''}
fi
done

Expand Down
2 changes: 2 additions & 0 deletions pkgs/os-specific/darwin/xcode/sdk-pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ rec {
type = "derivation";
outPath = xcode + "/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${version}.sdk";

iPhoneOSRoot = xcode + "/Contents/Developer/Platforms/iPhoneOS.platform";

platform = targetPlatform.xcodePlatform;
version = targetPlatform.sdkVer;
};
Expand Down
7 changes: 6 additions & 1 deletion pkgs/stdenv/cross/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ in lib.init bootStages ++ [
++ lib.optional (hostPlatform.config == "x86_64-w64-mingw32") buildPackages.file
;



# temp hack to avoid ios macos clash
preHook = lib.concatStringsSep "\n"
preHook = lib.optionalString (crossSystem.useiOSPrebuilt && crossSystem.isx86_64) ''
export DYLD_ROOT_PATH=${buildPackages.darwin.iosSdkPkgs.sdk.iPhoneOSRoot}/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
echo -e "\n!! iOS Simulator in use !!\nDYLD_ROOT_PATH: $DYLD_ROOT_PATH\n!! iOS Simulator !!\n"
'' + lib.concatStringsSep "\n"
(lib.filter
(l: ! lib.strings.hasInfix "-sdk_version" l)
(lib.strings.splitString "\n" old.preHook));
Expand Down