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.

68 lines
2.5KB

  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. ubuntu$(UBUNTU_VERSION):
  10. git clone -b v3.0.1 https://github.com/gurki/vivid || true
  11. bash ../ubuntu$(UBUNTU_VERSION).sh make impl
  12. bash ../ubuntu$(UBUNTU_VERSION).sh make impl-emscripten
  13. make package-ubuntu$(UBUNTU_VERSION)
  14. bash ../ubuntu$(UBUNTU_VERSION).sh chown $$(id -u):$$(id -g) . -R # fix permissions
  15. impl:
  16. git config --global --add safe.directory '*'
  17. switch-to-latest-clang
  18. # patch away issue of adding tests, currently catch is broken in clang 14.
  19. cat vivid/CMakeLists.txt | head -n -1 > vivid/CMakeLists.txt.new
  20. mv vivid/CMakeLists.txt.new vivid/CMakeLists.txt
  21. # build without tests for now
  22. mkdir -p vivid_out && \
  23. pushd vivid && \
  24. mkdir -p build && \
  25. pushd build && \
  26. cmake -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/../vivid_out .. && \
  27. make -j $$(nproc) && \
  28. make install
  29. impl-emscripten:
  30. git config --global --add safe.directory '*'
  31. switch-to-latest-clang
  32. # patch away issue of adding tests, currently catch is broken in clang 14.
  33. cat vivid/CMakeLists.txt | head -n -1 > vivid/CMakeLists.txt.new
  34. mv vivid/CMakeLists.txt.new vivid/CMakeLists.txt
  35. # build without tests for now
  36. mkdir -p vivid_out && \
  37. pushd vivid && \
  38. mkdir -p build2 && \
  39. pushd build2 && \
  40. CXX=/emsdk/upstream/emscripten/em++ cmake -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/../vivid_out2 .. && \
  41. make -j $$(nproc) && \
  42. make install
  43. package-ubuntu$(UBUNTU_VERSION):
  44. rm -rf out
  45. mkdir -p out/opt/cppse/build/vivid/
  46. cp -prv vivid/vivid_out/* out/opt/cppse/build/vivid/
  47. # emscripten version
  48. cp -prv vivid/vivid_out2/lib/libvivid.a out/opt/cppse/build/vivid/lib/libvivid-em.a
  49. cp -prv vivid/build/_deps/glm-src/glm out/opt/cppse/build/vivid/include/
  50. rm -rf $(CODENAME)/cppse-vivid_*_amd64.deb
  51. 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
  52. mv -v cppse-vivid_*_amd64.deb $(CODENAME)/
  53. clean:
  54. rm -rf vivid
  55. rm -rf out
  56. shell:
  57. FLAGS="-i --privileged" bash ../ubuntu2204.sh /bin/bash