Skip to content
Merged
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
14 changes: 0 additions & 14 deletions binaryen.nix

This file was deleted.

1 change: 1 addition & 0 deletions build-wasm-app.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let
in { ename, pkg, assets ? [], scripts ? [], styles ? [] }: runCommand "wasm-app-${ename}" {
nativeBuildInputs = [ buildPackages.xorg.lndir buildPackages.binaryen ];
passthru = { inherit pkg; };
meta.platforms = ["wasm32-unknown"];

@ElvishJerricco ElvishJerricco Dec 4, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should see if we can remove this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that. Makes sense now I think

} ''
mkdir -p $out
lndir ${buildPackages.buildPackages.webabi}/lib/node_modules/webabi/build $out
Expand Down
6 changes: 3 additions & 3 deletions cross-overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ self: super: {

haskell = let inherit (super) haskell; in haskell // {
packages = haskell.packages // {
ghcWasm = haskell.packages.ghc863.override (drv: {
ghcWasm = haskell.packages.ghc865.override (drv: {
Comment thread
ElvishJerricco marked this conversation as resolved.
ghc = (self.buildPackages.haskell.compiler.ghcHEAD.override {
enableShared = false;
enableRelocatedStaticLibs = false;
Expand All @@ -26,8 +26,8 @@ self: super: {
nativeBuildInputs = drv.nativeBuildInputs or [] ++ [self.buildPackages.autoreconfHook];
src = self.buildPackages.fetchgit {
url = "https://github.com/WebGHC/ghc.git";
rev = "9af15622eead357865f33eb1945bd2fe3da70c90";
sha256 = "08xzlasdv14hhfdszk7khjlhjifpzdlc1fybaiwgik3nrhphlkjf";
rev = "26c2e9fb99d16bbea7da9f54f21c1475dc4d7999";
sha256 = "0dqqkarp1s5s6mjq6x7zrq7km5cjwdmfvh7f71135s2r0v71hzz0";
fetchSubmodules = true;
preFetch = ''
export HOME=$(pwd)
Expand Down
8 changes: 5 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
debugVersion = debugLlvm;
};

wabt = self.callPackage ./wabt.nix {};
binaryen = self.callPackage ./binaryen.nix {};

webabi = self.callPackage ./webabi-nix {};

webghc-runner = self.writeShellScriptBin "webghc-runner" ''
exec ${self.nodejs-8_x}/bin/node ${self.webabi}/lib/node_modules/webabi/build/node_runner.js "$@"
'';

build-wasm-app = self.callPackage ./build-wasm-app.nix {};

# Issue happens when combining pkgsStatic & custom cross stdenv.
# We need to force a normal busybox here to avoid hitting a
# weird bootstrapping issue.
busybox-sandbox-shell = super.busybox-sandbox-shell.override { busybox = self.busybox; };
})] ++ overlays;
};
nixpkgsCrossArgs = project.nixpkgsArgs // {
Expand Down
74 changes: 37 additions & 37 deletions libiconv-wasm32.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
diff -ruN libiconv-1.15/build-aux/config.sub libiconv-1.15-patched/build-aux/config.sub
--- libiconv-1.15/build-aux/config.sub 2017-01-02 09:02:47.000000000 +1000
+++ libiconv-1.15-patched/build-aux/config.sub 2017-11-22 08:38:36.995036311 +1000
@@ -118,7 +118,7 @@
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
+ storm-chaos* | os2-emx* | rtmk-nova* | unknown-wasm)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -1543,6 +1543,8 @@
diff -ruN libiconv-1.16/build-aux/config.sub libiconv-1.16-patched/build-aux/config.sub
--- libiconv-1.16/build-aux/config.sub 2019-04-27 03:29:05.000000000 +0900
+++ libiconv-1.16-patched/build-aux/config.sub 2019-11-23 21:36:56.794790501 +0900
@@ -135,7 +135,7 @@
| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
- | storm-chaos* | os2-emx* | rtmk-nova*)
+ | storm-chaos* | os2-emx* | rtmk-nova* | unknown-wasm)
basic_machine=$field1
os=$maybe_os
;;
@@ -1511,6 +1511,8 @@
;;
-ios)
ios)
;;
+ -unknown-wasm)
+ unknown-wasm)
+ ;;
-none)
none)
;;
*)
diff -ruN libiconv-1.15/lib/loop_wchar.h libiconv-1.15-patched/lib/loop_wchar.h
--- libiconv-1.15/lib/loop_wchar.h 2014-01-02 17:23:02.000000000 -0500
+++ libiconv-1.15-patched/lib/loop_wchar.h 2018-05-29 11:23:49.342538241 -0400
*-eabi)
diff -ruN libiconv-1.16/lib/loop_wchar.h libiconv-1.16-patched/lib/loop_wchar.h
--- libiconv-1.16/lib/loop_wchar.h 2018-09-18 01:06:14.000000000 +0900
+++ libiconv-1.16-patched/lib/loop_wchar.h 2019-11-23 21:40:43.599165612 +0900
@@ -36,7 +36,9 @@
# include <wchar.h>
# define BUF_SIZE 64 /* assume MB_LEN_MAX <= 64 */
Expand All @@ -32,24 +32,24 @@ diff -ruN libiconv-1.15/lib/loop_wchar.h libiconv-1.15-patched/lib/loop_wchar.h
# ifdef mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc)(pwc, s, n, 0)
# define mbsinit(ps) 1
diff -ruN libiconv-1.15/libcharset/build-aux/config.sub libiconv-1.15-patched/libcharset/build-aux/config.sub
--- libiconv-1.15/libcharset/build-aux/config.sub 2017-01-02 09:02:47.000000000 +1000
+++ libiconv-1.15-patched/libcharset/build-aux/config.sub 2017-11-22 08:52:03.504787774 +1000
@@ -118,7 +118,7 @@
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
+ storm-chaos* | os2-emx* | rtmk-nova* | unknown-wasm)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -1543,6 +1543,8 @@
diff -ruN libiconv-1.16/libcharset/build-aux/config.sub libiconv-1.16-patched/libcharset/build-aux/config.sub
--- libiconv-1.16/libcharset/build-aux/config.sub 2019-04-27 03:29:05.000000000 +0900
+++ libiconv-1.16-patched/libcharset/build-aux/config.sub 2019-11-23 21:39:26.892696874 +0900
@@ -135,7 +135,7 @@
| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
- | storm-chaos* | os2-emx* | rtmk-nova*)
+ | storm-chaos* | os2-emx* | rtmk-nova* | unknown-wasm)
basic_machine=$field1
os=$maybe_os
;;
@@ -1511,6 +1511,8 @@
;;
-ios)
ios)
;;
+ -unknown-wasm)
+ unknown-wasm)
+ ;;
-none)
none)
;;
*)
*-eabi)
10 changes: 5 additions & 5 deletions llvm-head/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ in stdenv.mkDerivation rec {
postBuild = ''
rm -fR $out

paxmark m bin/{lli,llvm-rtdyld}
paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests
paxmark m unittests/ExecutionEngine/Orc/OrcJITTests
paxmark m unittests/Support/SupportTests
paxmark m bin/lli-child-target
'';
# paxmark m bin/{lli,llvm-rtdyld}
# paxmark m unittests/ExecutionEngine/MCJIT/MCJITTests
# paxmark m unittests/ExecutionEngine/Orc/OrcJITTests
# paxmark m unittests/Support/SupportTests
# paxmark m bin/lli-child-target

preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
Expand Down
4 changes: 2 additions & 2 deletions nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import (builtins.fetchTarball {
url = https://github.com/WebGHC/nixpkgs/archive/b57b10d243afe32b2d43d10b45ee1c34252e526b.tar.gz;
sha256 = "0bf39y7i7bvawn2y2bjnfx7hympa79v6jv2yi7hdm27srln0bg1z";
url = https://github.com/WebGHC/nixpkgs/archive/ce2baad4b5c99b374d7e2106d0dadb168c00216d.tar.gz;
sha256 = "0gwlg6wznpb4yy2xam592rqjw0briy6gyc5k7mm89mjilmnrjqj1";
})
14 changes: 0 additions & 14 deletions wabt.nix

This file was deleted.