Skip to content

Commit

Permalink
Fix examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakhtiyarneyman committed Feb 2, 2024
1 parent ba1b2c1 commit 95b06ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions generate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
purs-backend-es,
purs-tidy,
}: let
npmDependencies = slimlock.buildPackageLock {src = ./.;};
packages = purix.buildSpagoLock {
locked = purix.buildSpagoLock {
src = ./.;
corefn = true;
};
Expand All @@ -30,8 +29,8 @@ in
buildInputs = [prefetch-npm-deps];

buildPhase = ''
ln -s ${npmDependencies}/js/node_modules .
cp -r ${packages.${name}}/output .
ln -s ${locked.npmDependencies}/js/node_modules .
cp -r ${locked.jsArtifacts.${name}}/output .
set -f
echo "Optimizing..."
purs-backend-es build
Expand Down
8 changes: 3 additions & 5 deletions nix/examples/simple-ffi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
stdenv,
writeText,
esbuild,
slimlock,
purix,
purs-bin,
}: let
packageLock = slimlock.buildPackageLock {src = ./.;};
spagoLock = purix.buildSpagoLock {src = ./.;};
locked = purix.buildSpagoLock {src = ./.;};
entrypoint = writeText "entrypoint.js" ''
import { main } from "./output/Main";
main();
Expand All @@ -19,8 +17,8 @@ in
nativeBuildInputs = [purs-bin.purs-0_15_9 esbuild];
buildPhase = ''
echo "Linking ..."
ln -s ${packageLock}/js/node_modules .
cp -r ${spagoLock.simple-ffi}/output .
ln -s ${locked.npmDependencies}/js/node_modules .
cp -r ${locked.jsArtifacts.simple-ffi}/output .
cp ${entrypoint} entrypoint.js
cat entrypoint.js
esbuild entrypoint.js \
Expand Down
4 changes: 2 additions & 2 deletions nix/examples/simple/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
stdenv,
purix,
}: let
lock = purix.buildSpagoLock {
locked = purix.buildSpagoLock {
src = ./.;
lockfile = ./spago.lock;
};
Expand All @@ -12,7 +12,7 @@ in
src = ./.;
buildPhase = ''
echo "Linking ..."
ln -s ${lock.simple}/output .
ln -s ${locked.jsArtifacts.simple}/output .
'';
installPhase = ''
mkdir -p $out
Expand Down

0 comments on commit 95b06ed

Please sign in to comment.