eiwd-1.17-r1.ebuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Copyright 2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit linux-info
  5. DESCRIPTION="iwd without dbus"
  6. HOMEPAGE="https://github.com/illiliti/eiwd"
  7. SRC_URI="
  8. ${HOMEPAGE}/releases/download/${PVR/r/}/${P##e}.tar.xz
  9. -> ${PF}.tar.xz
  10. "
  11. LICENSE="LGPL-2.1"
  12. SLOT="0"
  13. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
  14. IUSE="
  15. +builtin-dns crda monitor ofono wired
  16. cpu_flags_x86_aes cpu_flags_x86_ssse3
  17. "
  18. DEPEND=">=dev-libs/ell-0.43"
  19. RDEPEND="
  20. ${DEPEND}
  21. !net-wireless/iwd
  22. net-wireless/wireless-regdb
  23. crda? ( net-wireless/crda )
  24. builtin-dns? ( net-dns/openresolv )
  25. "
  26. BDEPEND="virtual/pkgconfig"
  27. S="${WORKDIR}/${P#e}"
  28. PATCHES=(
  29. "${FILESDIR}/${PN}-1.12-clang.patch"
  30. "${FILESDIR}/${PN}-1.15-clang.patch"
  31. "${FILESDIR}/${PN}-1.16-clang.patch"
  32. )
  33. pkg_setup() {
  34. CONFIG_CHECK="
  35. ~ASYMMETRIC_KEY_TYPE
  36. ~ASYMMETRIC_PUBLIC_KEY_SUBTYPE
  37. ~CFG80211
  38. ~CRYPTO_AES
  39. ~CRYPTO_CBC
  40. ~CRYPTO_CMAC
  41. ~CRYPTO_DES
  42. ~CRYPTO_ECB
  43. ~CRYPTO_HMAC
  44. ~CRYPTO_MD4
  45. ~CRYPTO_MD5
  46. ~CRYPTO_RSA
  47. ~CRYPTO_SHA1
  48. ~CRYPTO_SHA256
  49. ~CRYPTO_SHA512
  50. ~CRYPTO_USER_API_HASH
  51. ~CRYPTO_USER_API_SKCIPHER
  52. ~KEY_DH_OPERATIONS
  53. ~PKCS7_MESSAGE_PARSER
  54. ~RFKILL
  55. ~X509_CERTIFICATE_PARSER
  56. "
  57. if use crda; then
  58. CONFIG_CHECK="${CONFIG_CHECK} ~CFG80211_CRDA_SUPPORT"
  59. WARNING_CFG80211_CRDA_SUPPORT="REGULATORY DOMAIN PROBLEM: please enable CFG80211_CRDA_SUPPORT for proper regulatory domain support"
  60. fi
  61. if use amd64; then
  62. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_DES3_EDE_X86_64"
  63. WARNING_CRYPTO_DES3_EDE_X86_64="CRYPTO_DES3_EDE_X86_64: enable for increased performance"
  64. fi
  65. if use cpu_flags_x86_aes; then
  66. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_AES_NI_INTEL"
  67. WARNING_CRYPTO_AES_NI_INTEL="CRYPTO_AES_NI_INTEL: enable for increased performance"
  68. fi
  69. if use cpu_flags_x86_ssse3 && use amd64; then
  70. CONFIG_CHECK="${CONFIG_CHECK} ~CRYPTO_SHA1_SSSE3 ~CRYPTO_SHA256_SSSE3 ~CRYPTO_SHA512_SSSE3"
  71. WARNING_CRYPTO_SHA1_SSSE3="CRYPTO_SHA1_SSSE3: enable for increased performance"
  72. WARNING_CRYPTO_SHA256_SSSE3="CRYPTO_SHA256_SSSE3: enable for increased performance"
  73. WARNING_CRYPTO_SHA512_SSSE3="CRYPTO_SHA512_SSSE3: enable for increased performance"
  74. fi
  75. if use kernel_linux && kernel_is -ge 4 20; then
  76. CONFIG_CHECK="${CONFIG_CHECK} ~PKCS8_PRIVATE_KEY_PARSER"
  77. fi
  78. check_extra_config
  79. if ! use crda; then
  80. if use kernel_linux && kernel_is -lt 4 15; then
  81. ewarn "POSSIBLE REGULATORY DOMAIN PROBLEM:"
  82. ewarn "Regulatory domain support for kernels older than 4.15 requires crda."
  83. fi
  84. if linux_config_exists && linux_chkconfig_builtin CFG80211 &&
  85. [[ $(linux_chkconfig_string EXTRA_FIRMWARE) != *regulatory.db* ]]
  86. then
  87. ewarn ""
  88. ewarn "REGULATORY DOMAIN PROBLEM:"
  89. ewarn "With CONFIG_CFG80211=y (built-in), the driver won't be able to load regulatory.db from"
  90. ewarn " /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m"
  91. ewarn " or add regulatory.db and regulatory.db.p7s to CONFIG_EXTRA_FIRMWARE."
  92. ewarn ""
  93. fi
  94. fi
  95. }
  96. src_configure() {
  97. local myeconfargs=(
  98. --localstatedir="${EPREFIX}/var"
  99. --sysconfdir="${EPREFIX}/etc/iwd"
  100. --disable-dbus
  101. --enable-external-ell
  102. $(use_enable monitor)
  103. $(use_enable ofono)
  104. $(use_enable wired)
  105. )
  106. econf "${myeconfargs[@]}"
  107. }
  108. src_install() {
  109. default
  110. keepdir /var/lib/iwd
  111. newinitd "${FILESDIR}/iwd.initd" iwd
  112. insinto /etc/iwd/
  113. doins "${FILESDIR}/main.conf"
  114. echo 'rc_provide="net"' > "${ED}/etc/conf.d/iwd"
  115. }