1 { pkgs, lib, emscripten, python3 }:
7 pkgs.stdenv.mkDerivation (finalAttrs:
8 f (lib.toFunction argsFun finalAttrs)
12 { buildInputs ? [], nativeBuildInputs ? []
14 , enableParallelBuilding ? true
16 , meta ? {}, ... } @ args:
21 pname = "emscripten-${lib.getName args}";
22 version = lib.getVersion args;
23 buildInputs = [ emscripten python3 ] ++ buildInputs;
24 nativeBuildInputs = [ emscripten python3 ] ++ nativeBuildInputs;
26 # fake conftest results with emscripten's python magic
29 # removes archive indices
30 dontStrip = args.dontStrip or true;
32 configurePhase = args.configurePhase or ''
33 # FIXME: Some tests require writing at $HOME
37 emconfigure ./configure --prefix=$out
39 mkdir -p .emscriptencache
40 export EM_CACHE=$(pwd)/.emscriptencache
45 buildPhase = args.buildPhase or ''
57 checkPhase = args.checkPhase or ''
60 echo "Please provide a test for your emscripten based library/tool, see libxml2 as an exmple on how to use emcc/node to verify your build"
62 echo "In normal C 'unresolved symbols' would yield an error and a breake of execution. In contrast, in emscripten they are only a warning which is ok given that emscripten assumptions about shared libraries."
63 echo " -> https://github.com/kripken/emscripten/wiki/Linking"
64 echo "So just assume the dependencies were built using hydra, then YOU WILL NEVER see the warning and your code depending on a library will always fail!"
70 enableParallelBuilding = args.enableParallelBuilding or true;
73 # Add default meta information
74 platforms = lib.platforms.all;
75 # Do not build this automatically
78 # add an extra maintainer to every package
79 maintainers = (meta.maintainers or []) ++
80 [ lib.maintainers.qknight ];