Skip to content

Commit

Permalink
Fix mobile builds
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfmpe committed Dec 20, 2024
1 parent 5381781 commit 8e2b84c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
2 changes: 0 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ in rec {
#(hackage: (import "${marsObelisk.plan-nix}/default.nix").pkgs hackage)
];

ghcjs-app = self.crossSystems.ghcjs.hsPkgs.frontend.components.exes.frontend;

userSettings = {
android = reflexHasAttr "android";
ios = reflexHasAttr "ios";
Expand Down
4 changes: 2 additions & 2 deletions dep/mars/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "reflex-platform",
"branch": "haskell.nix",
"private": false,
"rev": "d5f1a1eb2ab91faa2fdb162085c40e417b0e5afe",
"sha256": "1vb69xjlb0c0f0hbrvbhw9na392sl7nn464d3kinpbjdyd9kdw6n"
"rev": "4fccfb196ac724695a5006a456b2125eeff331e5",
"sha256": "0f383z3pzcdnwv0ijbbm6xiky3k0lw31dx03x3nrpv46n929nh68"
}
50 changes: 49 additions & 1 deletion skeleton/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,38 @@
}
}:
with obelisk;
project {} ({ pkgs, ... }: {
let args = {
# You must accept the Android Software Development Kit License Agreement at
# https://developer.android.com/studio/terms in order to build Android apps.
# Uncomment this to indicate your acceptance:
android_sdk_accept_license = true;
allowUnfree = true;
}; in

project args ({ pkgs, ... }: {
name = "skeleton";
android = {
executable = ps: exes: (exes (ps.frontend)).frontend;
executableName = "obelisk-skeleton";
applicationId = "systems.obsidian.obelisk.examples.minimal";
displayName = "Obelisk Minimal Example";
};
ios = {
executable = ps: exes: (exes (ps.frontend)).frontend;
executableName = "obelisk-skeleton";
bundleIdentifier = "systems.obsidian.obelisk.examples.minimal";
bundleName = "Obelisk Minimal Example";
};
web = {
executable = ps: exes: (exes (ps.frontend)).frontend;
};
extraArgs = {
staticFiles = ./static;
};
src = ./.;
inputThunks = pkgs.obsidianCompilers.thunkSets.common ++ [
pkgs._dep.source.aeson-1541
pkgs._dep.source.android-activity
];
shells = ps: with ps; [
backend
Expand All @@ -32,6 +56,30 @@ project {} ({ pkgs, ... }: {
packages.obelisk-run.components.library.build-tools = with pkgs; [
iproute
];

config.enableShared = if pkgs.stdenv.targetPlatform.isiOS then lib.mkForce false else true;
config.enableStatic = lib.mkForce true;

packages.reflex-dom = {
flags = {
webkit2gtk = if (pkgs.stdenv.targetPlatform.isAndroid) then lib.mkForce false else true;
};
};

packages.frontend.components.exes.frontend = {
frameworks = if (!pkgs.stdenv.targetPlatform.isiOS && pkgs.stdenv.targetPlatform.isDarwin) then [ pkgs.darwin.apple_sdk.frameworks.CoreFoundation ] else [ ];
postInstall = lib.optionalString (pkgs.stdenv.hostPlatform.isDarwin) ''
mkdir -p $out/obelisk-skeleton.app
cp -r obelisk-skeleton $out
cp $out/bin/obelisk-skeleton $out/obelisk-skeleton.app
'';
};
packages.jsaddle-wkwebview.src = (thunkSource ../dep/jsaddle) + "/jsaddle-wkwebview";
packages.jsaddle-wkwebview.components.library = {
frameworks =
if (pkgs.stdenv.targetPlatform.isiOS) then lib.mkForce [ pkgs.darwin.iosSdkPkgs.sdk pkgs.darwin.apple_sdk.frameworks.CoreFoundation ]
else [ pkgs.darwin.apple_sdk.frameworks.CoreFoundation ];
};
})
];
})

0 comments on commit 8e2b84c

Please sign in to comment.