recipe 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Build recipe for luarocks.
  2. #
  3. # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. # Based on recipes written by Mateus P. Rodrigues, <mprodrigues@dragora.org>
  18. # and Matias Fonzo, <selk@dragora.org>.
  19. program=luarocks
  20. version=3.3.0
  21. release=3
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch=https://luarocks.org/releases/${tarname}
  25. description="
  26. luarocks - the package manager for Lua modules
  27. Luarocks allows you to create and install Lua modules as self-contained packages
  28. called rocks.
  29. "
  30. homepage=https://luarocks.org/
  31. license="MIT License"
  32. # Source documentation
  33. docs="CHANGELOG.md COPYING CODE_OF_CONDUCT.md README.md"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. set -e
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. ./configure --prefix=/usr
  41. make ./build/luarocks ./build/luarocks-admin ./build/config-5.3.lua
  42. make LUA_VERSION=5.1 LUA_INTERPRETER=lua5.1 LUA_INCDIR=/usr/include/lua5.1 ./build/config-5.1.lua
  43. make LUA_VERSION=5.2 LUA_INTERPRETER=lua5.2 LUA_INCDIR=/usr/include/lua5.2 ./build/config-5.2.lua
  44. make DESTDIR="$destdir" install
  45. make DESTDIR="$destdir" LUA_VERSION=5.1 install-config
  46. make DESTDIR="$destdir" LUA_VERSION=5.2 install-config
  47. # Delete index file for the package
  48. if test -d "${destdir}/$infodir"
  49. then
  50. rm -f "${destdir}/${infodir}/dir"
  51. fi
  52. # Copy documentation
  53. mkdir -p "${destdir}${docsdir}"
  54. for file in $docs
  55. do
  56. if test -e $file
  57. then
  58. cp -p $file "${destdir}${docsdir}"
  59. fi
  60. done
  61. }