emscripten.spec 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. ##
  2. ## emscripten.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2017 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: emscripten
  25. Summary: LLVM to JavaScript Compiler
  26. URL: http://emscripten.org/
  27. Vendor: Emscripten Project
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Language
  32. License: MIT
  33. Version: 1.37.5
  34. Release: 20170313
  35. # list of sources
  36. Source0: https://github.com/kripken/emscripten/archive/%{version}.tar.gz
  37. # build information
  38. BuildPreReq: OpenPKG, openpkg >= 20160101
  39. PreReq: OpenPKG, openpkg >= 20160101
  40. BuildPreReq: llvm, node, python
  41. PreReq: llvm, node, python
  42. %description
  43. Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode
  44. -- which can be generated from C/C++, using llvm-gcc or clang, or
  45. any other language that can be converted into LLVM -- and compiles
  46. that into JavaScript, which can be run on the web (or anywhere else
  47. JavaScript can run).
  48. %track
  49. prog emscripten = {
  50. version = %{version}
  51. url = https://github.com/kripken/emscripten/releases
  52. regex = (\d+\.\d+\.\d+)\.tar\.gz
  53. }
  54. %prep
  55. %setup -q
  56. %build
  57. # fix paths to Python
  58. %{l_shtool} subst \
  59. -e 's;#!/usr/bin/env python2;#!%{l_prefix}/bin/python;' \
  60. em++ em-config emar emcc emconfigure emlink.py emmake emranlib emscons emscripten.py
  61. # remove unneccessary parts
  62. rm -rf third_party/websockify/Windows
  63. rm -rf tests
  64. rm -f system/include/libc/bits
  65. rm -f "site/source/_themes/emscripten_sphinx_rtd_theme/static/css/theme - prior to centering.css"
  66. %install
  67. # create installation hierarchy
  68. %{l_shtool} mkdir -f -p -m 755 \
  69. $RPM_BUILD_ROOT%{l_prefix}/bin \
  70. $RPM_BUILD_ROOT%{l_prefix}/libexec/emscripten
  71. # install Emscripten as a whole
  72. cp -rp * \
  73. $RPM_BUILD_ROOT%{l_prefix}/libexec/emscripten/
  74. # provide executable wrappers
  75. for prog in em++ em-config emar emcc emconfigure emmake emranlib emrun emscons; do
  76. ( echo "#!/bin/sh"
  77. echo "EMSCRIPTEN=%{l_prefix}/libexec/emscripten"
  78. echo "export EMSCRIPTEN"
  79. echo "EMCC_FAST_COMPILER=0"
  80. echo "export EMCC_FAST_COMPILER"
  81. echo "exec %{l_prefix}/libexec/emscripten/$prog \${1+\"\$@\"}"
  82. ) >$prog.sh
  83. %{l_shtool} install -c -m 755 \
  84. $prog.sh $RPM_BUILD_ROOT%{l_prefix}/bin/$prog
  85. done
  86. # determime installation files
  87. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  88. %files -f files
  89. %clean