You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.3KB

  1. SHELL:=/bin/bash
  2. UBUNTU_VERSION ?= 2404
  3. CODENAME ?= noble
  4. VERSION:=3.0.1
  5. build: $(CODENAME)/cppse-vivid_$(VERSION)_amd64.deb
  6. $(CODENAME)/cppse-vivid_$(VERSION)_amd64.deb:
  7. mkdir -p $(CODENAME)
  8. make ubuntu$(UBUNTU_VERSION)
  9. ubuntu2204:
  10. git clone -b v3.0.1 https://github.com/gurki/vivid
  11. bash ../ubuntu2204.sh make impl
  12. bash ../ubuntu2204.sh make impl-emscripten
  13. make package-ubuntu2204
  14. bash ../ubuntu2204.sh chown $$(id -u):$$(id -g) . -R # fix permissions
  15. ubuntu$(UBUNTU_VERSION):
  16. git clone -b v3.0.1 https://github.com/gurki/vivid || true
  17. bash ../ubuntu$(UBUNTU_VERSION).sh make impl
  18. bash ../ubuntu$(UBUNTU_VERSION).sh make impl-emscripten
  19. make package-ubuntu$(UBUNTU_VERSION)
  20. bash ../ubuntu$(UBUNTU_VERSION).sh chown $$(id -u):$$(id -g) . -R # fix permissions
  21. impl:
  22. git config --global --add safe.directory '*'
  23. switch-to-latest-clang
  24. # patch away issue of adding tests, currently catch is broken in clang 14.
  25. cat vivid/CMakeLists.txt | head -n -1 > vivid/CMakeLists.txt.new
  26. mv vivid/CMakeLists.txt.new vivid/CMakeLists.txt
  27. # build without tests for now
  28. mkdir -p vivid_out && \
  29. pushd vivid && \
  30. mkdir -p build && \
  31. pushd build && \
  32. cmake -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/../vivid_out .. && \
  33. make -j $$(nproc) && \
  34. make install
  35. impl-emscripten:
  36. git config --global --add safe.directory '*'
  37. switch-to-latest-clang
  38. # patch away issue of adding tests, currently catch is broken in clang 14.
  39. cat vivid/CMakeLists.txt | head -n -1 > vivid/CMakeLists.txt.new
  40. mv vivid/CMakeLists.txt.new vivid/CMakeLists.txt
  41. # build without tests for now
  42. mkdir -p vivid_out && \
  43. pushd vivid && \
  44. mkdir -p build2 && \
  45. pushd build2 && \
  46. CXX=/emsdk/upstream/emscripten/em++ cmake -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/../vivid_out2 .. && \
  47. make -j $$(nproc) && \
  48. make install
  49. package-ubuntu2204:
  50. rm -rf out
  51. mkdir -p out/opt/cppse/build/vivid/
  52. cp -prv vivid/vivid_out/* out/opt/cppse/build/vivid/
  53. # emscripten version
  54. cp -prv vivid/vivid_out2/lib/libvivid.a out/opt/cppse/build/vivid/lib/libvivid-em.a
  55. cp -prv vivid/build/_deps/glm-src/glm out/opt/cppse/build/vivid/include/
  56. rm -rf vivid_*_amd64.deb
  57. docker run -v "$$(pwd):/src/" rayburgemeestre/fpm-ubuntu:22.04 fpm -f -v 1.1.1 -s dir -t deb -n vivid --license MPL2 --maintainer "Ray Burgemeestre <ray@cppse.nl>" --description "vivid - build dependency" --url "https://github.com/gurki/vivid.git" --deb-generate-changes -C /src/out
  58. package-ubuntu$(UBUNTU_VERSION):
  59. rm -rf out
  60. mkdir -p out/opt/cppse/build/vivid/
  61. cp -prv vivid/vivid_out/* out/opt/cppse/build/vivid/
  62. # emscripten version
  63. cp -prv vivid/vivid_out2/lib/libvivid.a out/opt/cppse/build/vivid/lib/libvivid-em.a
  64. cp -prv vivid/build/_deps/glm-src/glm out/opt/cppse/build/vivid/include/
  65. rm -rf $(CODENAME)/cppse-vivid_*_amd64.deb
  66. docker run -v "$$(pwd):/src/" rayburgemeestre/fpm-ubuntu:24.04 fpm -f -v $(VERSION) --iteration $(CODENAME) -s dir -t deb -n cppse-vivid --license MPL2 --maintainer "Ray Burgemeestre <ray@cppse.nl>" --description "vivid - build dependency" --url "https://github.com/gurki/vivid.git" --deb-generate-changes -C /src/out
  67. mv -v cppse-vivid_*_amd64.deb $(CODENAME)/
  68. clean:
  69. rm -rf vivid
  70. rm -rf out
  71. shell:
  72. FLAGS="-i --privileged" bash ../ubuntu2204.sh /bin/bash