ASIO to JACK driver for WINE
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.

90 lines
3.1KB

  1. #!/usr/bin/make -f
  2. # Makefile for WineASIO Settings GUI #
  3. # ---------------------------------- #
  4. # Created by falkTX
  5. #
  6. PREFIX = /usr
  7. PYUIC ?= pyuic5
  8. PYRCC ?= pyrcc5
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. all:
  11. # ---------------------------------------------------------------------------------------------------------------------
  12. # UI code
  13. define UI_IMPORTS
  14. try:\\n
  15. from PyQt6.QtCore import Qt, QCoreApplication, QMetaObject\\n
  16. from PyQt6.QtWidgets import QCheckBox, QComboBox, QDialogButtonBox, QLabel, QGroupBox, QSpinBox\\n
  17. from PyQt6.QtWidgets import QHBoxLayout, QVBoxLayout, QSpacerItem, QSizePolicy\\n
  18. Qt.AlignRight = Qt.AlignmentFlag.AlignRight\\n
  19. Qt.AlignTrailing = Qt.AlignmentFlag.AlignTrailing\\n
  20. Qt.AlignVCenter = Qt.AlignmentFlag.AlignVCenter\\n
  21. Qt.Horizontal = Qt.Orientation.Horizontal\\n
  22. QSizePolicy.Fixed = QSizePolicy.Policy.Fixed\\n
  23. QSizePolicy.Minimum = QSizePolicy.Policy.Minimum\\n
  24. QDialogButtonBox.Cancel = QDialogButtonBox.StandardButton.Cancel\\n
  25. QDialogButtonBox.Ok = QDialogButtonBox.StandardButton.Ok\\n
  26. QDialogButtonBox.RestoreDefaults = QDialogButtonBox.StandardButton.RestoreDefaults\\n
  27. except ImportError:\\n
  28. from PyQt5.QtCore import Qt, QCoreApplication, QMetaObject\\n
  29. from PyQt5.QtWidgets import QCheckBox, QComboBox, QDialogButtonBox, QLabel, QGroupBox, QSpinBox\\n
  30. from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QSpacerItem, QSizePolicy
  31. endef
  32. export UI_IMPORTS
  33. regen: ui_settings.py
  34. ui_%.py: %.ui
  35. $(PYUIC) $< -o $@
  36. sed -i 's/QtCore.//g' $@
  37. sed -i 's/QtGui.//g' $@
  38. sed -i 's/QtWidgets.//g' $@
  39. sed -i 's/_translate = QCoreApplication.translate/_tr = QCoreApplication.translate/' $@
  40. sed -i 's/_translate(/_tr(/g' $@
  41. sed -i 's/"WineASIOSettings"/self.OBJECT_NAME/g' $@
  42. sed -i 's/ # type: ignore//g' $@
  43. sed -i 's/WineASIOSettings(object):/WineASIOSettings(object):\n OBJECT_NAME = "WineASIOSettings"\n/' $@
  44. sed -i 's/from PyQt5 import QtWidgets/$(shell echo "$$UI_IMPORTS")/' $@
  45. sed -i 's/ except ImportError:/except ImportError:/' $@
  46. # ---------------------------------------------------------------------------------------------------------------------
  47. clean:
  48. rm -f *~ *.pyc
  49. destroy: clean
  50. rm -f ui_*.py
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. install:
  53. # Create directories
  54. install -d $(DESTDIR)$(PREFIX)/bin/
  55. install -d $(DESTDIR)$(PREFIX)/share/wineasio/
  56. # Install script files and binaries
  57. install -m 755 \
  58. wineasio-settings \
  59. $(DESTDIR)$(PREFIX)/bin/
  60. # Adjust PREFIX value in script files
  61. sed -i "s?X-PREFIX-X?$(PREFIX)?" \
  62. $(DESTDIR)$(PREFIX)/bin/wineasio-settings
  63. # Install code
  64. install -m 644 *.py $(DESTDIR)$(PREFIX)/share/wineasio/
  65. # ---------------------------------------------------------------------------------------------------------------------
  66. uninstall:
  67. rm -f $(DESTDIR)$(PREFIX)/bin/wineasio-settings
  68. rm -rf $(DESTDIR)$(PREFIX)/share/wineasio/
  69. # ---------------------------------------------------------------------------------------------------------------------