lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

emscriptenfastcomp: move wrap magic to own file, use newScope

+76 -66
+19 -51
pkgs/development/compilers/emscripten-fastcomp/default.nix
··· 1 - { stdenv, fetchFromGitHub, cmake, python, ... }: 2 - 1 + { newScope, stdenv, wrapCC, wrapCCWith, symlinkJoin }: 3 2 let 4 - rev = "1.37.16"; 5 - gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; 6 - in 7 - stdenv.mkDerivation rec { 8 - name = "emscripten-fastcomp-${rev}"; 9 - 10 - src = fetchFromGitHub { 11 - owner = "kripken"; 12 - repo = "emscripten-fastcomp"; 13 - sha256 = "0wj9sc0gciaiidcjv6wb0qn6ks06xds7q34351masc7qpvd217by"; 14 - inherit rev; 15 - }; 16 - 17 - srcFL = fetchFromGitHub { 18 - owner = "kripken"; 19 - repo = "emscripten-fastcomp-clang"; 20 - sha256 = "1akdgxzxhzjbhp4d14ajcrp9jrf39x004a726ly2gynqc185l4j7"; 21 - inherit rev; 22 - }; 23 - 24 - nativeBuildInputs = [ cmake python ]; 25 - preConfigure = '' 26 - cp -Lr ${srcFL} tools/clang 27 - chmod +w -R tools/clang 28 - ''; 29 - cmakeFlags = [ 30 - "-DCMAKE_BUILD_TYPE=Release" 31 - "-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'" 32 - "-DLLVM_INCLUDE_EXAMPLES=OFF" 33 - "-DLLVM_INCLUDE_TESTS=OFF" 34 - # "-DCLANG_INCLUDE_EXAMPLES=OFF" 35 - "-DCLANG_INCLUDE_TESTS=OFF" 36 - ] ++ (stdenv.lib.optional stdenv.isLinux 37 - # necessary for clang to find crtend.o 38 - "-DGCC_INSTALL_PREFIX=${gcc}" 39 - ); 40 - enableParallelBuilding = true; 3 + callPackage = newScope (self // {inherit stdenv;}); 41 4 42 - passthru = { 43 - isClang = true; 44 - inherit gcc; 5 + self = { 6 + emscriptenfastcomp-unwrapped = callPackage ./emscripten-fastcomp.nix {}; 7 + emscriptenfastcomp-wrapped = wrapCCWith stdenv.cc.libc '' 8 + # hardening flags break WASM support 9 + cat > $out/nix-support/add-hardening.sh 10 + '' self.emscriptenfastcomp-unwrapped; 11 + emscriptenfastcomp = symlinkJoin { 12 + name = "emscriptenfastcomp"; 13 + paths = [ self.emscriptenfastcomp-wrapped self.emscriptenfastcomp-unwrapped ]; 14 + preferLocalBuild = false; 15 + allowSubstitutes = true; 16 + postBuild = '' 17 + # replace unwrapped clang-3.9 binary by wrapper 18 + ln -sf $out/bin/clang $out/bin/clang-[0-9]* 19 + ''; 20 + }; 45 21 }; 46 - 47 - meta = with stdenv.lib; { 48 - homepage = https://github.com/kripken/emscripten-fastcomp; 49 - description = "Emscripten LLVM"; 50 - platforms = platforms.all; 51 - maintainers = with maintainers; [ qknight matthewbauer ]; 52 - license = stdenv.lib.licenses.ncsa; 53 - }; 54 - } 22 + in self
+54
pkgs/development/compilers/emscripten-fastcomp/emscripten-fastcomp.nix
··· 1 + { stdenv, fetchFromGitHub, cmake, python, ... }: 2 + 3 + let 4 + rev = "1.37.16"; 5 + gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; 6 + in 7 + stdenv.mkDerivation rec { 8 + name = "emscripten-fastcomp-${rev}"; 9 + 10 + src = fetchFromGitHub { 11 + owner = "kripken"; 12 + repo = "emscripten-fastcomp"; 13 + sha256 = "0wj9sc0gciaiidcjv6wb0qn6ks06xds7q34351masc7qpvd217by"; 14 + inherit rev; 15 + }; 16 + 17 + srcFL = fetchFromGitHub { 18 + owner = "kripken"; 19 + repo = "emscripten-fastcomp-clang"; 20 + sha256 = "1akdgxzxhzjbhp4d14ajcrp9jrf39x004a726ly2gynqc185l4j7"; 21 + inherit rev; 22 + }; 23 + 24 + nativeBuildInputs = [ cmake python ]; 25 + preConfigure = '' 26 + cp -Lr ${srcFL} tools/clang 27 + chmod +w -R tools/clang 28 + ''; 29 + cmakeFlags = [ 30 + "-DCMAKE_BUILD_TYPE=Release" 31 + "-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'" 32 + "-DLLVM_INCLUDE_EXAMPLES=OFF" 33 + "-DLLVM_INCLUDE_TESTS=OFF" 34 + # "-DCLANG_INCLUDE_EXAMPLES=OFF" 35 + "-DCLANG_INCLUDE_TESTS=OFF" 36 + ] ++ (stdenv.lib.optional stdenv.isLinux 37 + # necessary for clang to find crtend.o 38 + "-DGCC_INSTALL_PREFIX=${gcc}" 39 + ); 40 + enableParallelBuilding = true; 41 + 42 + passthru = { 43 + isClang = true; 44 + inherit gcc; 45 + }; 46 + 47 + meta = with stdenv.lib; { 48 + homepage = https://github.com/kripken/emscripten-fastcomp; 49 + description = "Emscripten LLVM"; 50 + platforms = platforms.all; 51 + maintainers = with maintainers; [ qknight matthewbauer ]; 52 + license = stdenv.lib.licenses.ncsa; 53 + }; 54 + }
+3 -15
pkgs/top-level/all-packages.nix
··· 1816 1816 1817 1817 emscripten = callPackage ../development/compilers/emscripten { }; 1818 1818 1819 - emscriptenfastcomp-unwrapped = callPackage ../development/compilers/emscripten-fastcomp { }; 1820 - emscriptenfastcomp-wrapped = wrapCCWith stdenv.cc.libc '' 1821 - # hardening flags break WASM support 1822 - cat > $out/nix-support/add-hardening.sh 1823 - '' emscriptenfastcomp-unwrapped; 1824 - emscriptenfastcomp = symlinkJoin { 1825 - name = "emscriptenfastcomp"; 1826 - paths = [ emscriptenfastcomp-wrapped emscriptenfastcomp-unwrapped ]; 1827 - preferLocalBuild = false; 1828 - allowSubstitutes = true; 1829 - postBuild = '' 1830 - # replace unwrapped clang-3.9 binary by wrapper 1831 - ln -sf $out/bin/clang $out/bin/clang-[0-9]* 1832 - ''; 1833 - }; 1819 + emscriptenfastcompPackages = callPackage ../development/compilers/emscripten-fastcomp { }; 1820 + 1821 + emscriptenfastcomp = emscriptenfastcompPackages.emscriptenfastcomp; 1834 1822 1835 1823 emscriptenPackages = recurseIntoAttrs (callPackage ./emscripten-packages.nix { }); 1836 1824