rules 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/make -f
  2. #Rodney Dawes Version simplifies things :)
  3. DH_CMAKE_BUILD_DIR=obj -${DEB_BUILD_GNU_TYPE}
  4. DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
  5. DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
  6. DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
  7. DEB_HOST_ARCH_BIT ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
  8. CMAKE_OPTS= -DCONTRIBUTORS=$(CURDIR)/doc/CONTRIBUTORS -DFORCE_VERSION=internal \
  9. -DWANT_QT5=1
  10. ifneq ($(DEB_HOST_ARCH_OS),linux)
  11. CMAKE_OPTS+= -DWANT_ALSA=0
  12. endif
  13. ifeq ($(DEB_HOST_ARCH),amd64)
  14. export PATH := $(PATH):/usr/lib/wine
  15. WINE_PATH := /usr/lib/$(DEB_HOST_MULTIARCH)/wine
  16. CMAKE_OPTS+= -DWANT_VST_32=OFF -DREMOTE_VST_PLUGIN_FILEPATH_32=../../i386-linux-gnu/lmms/32/RemoteVstPlugin32 \
  17. -DWINE_CXX_FLAGS=-Wl,--enable-new-dtags,-rpath=$(WINE_PATH)
  18. else ifeq ($(DEB_HOST_ARCH),i386)
  19. export PATH := $(PATH):/usr/lib/wine
  20. WINE_PATH := /usr/lib/$(DEB_HOST_MULTIARCH)/wine
  21. CMAKE_OPTS+= -DWANT_VST_64=OFF -DREMOTE_VST_PLUGIN_FILEPATH_64=../../x86_64-linux-gnu/lmms/RemoteVstPlugin64 \
  22. -DWINE_CXX_FLAGS=-Wl,--enable-new-dtags,-rpath=$(WINE_PATH)
  23. else
  24. CMAKE_OPTS+= -DWANT_VST=OFF
  25. endif
  26. # Define NDEBUG. This helps with reproducible builds.
  27. # Add -Wno-error=format-truncation because truncation is expected in snprintf.
  28. export CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS) -DNDEBUG
  29. export CXXFLAGS ?= $(shell dpkg-buildflags --get CXXFLAGS) -DNDEBUG \
  30. -Wno-error=format-truncation
  31. %:
  32. dh $@ --buildsystem cmake --parallel
  33. override_dh_auto_configure:
  34. dh_auto_configure -- -DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) $(CMAKE_OPTS)