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.
 
 
 

167 lines
4.9 KiB

  1. # Copyright 1999-2020 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. WX_GTK_VER=3.0
  5. PLOCALES="ar bg ca cs da de el es eu fa fi fr_FR gl hu id it ja ko nl pl pt_BR pt_PT ru sr_RS sr_RS@latin uk_UA vi zh_CN zh_TW"
  6. inherit meson gnome2-utils l10n wxwidgets xdg-utils git-r3
  7. DESCRIPTION="Advanced subtitle editor"
  8. HOMEPAGE="http://www.aegisub.org/ https://github.com/Aegisub/Aegisub"
  9. EGIT_REPO_URI="https://github.com/odrling/${PN^}.git"
  10. EGIT_BRANCH="meson"
  11. _depctrlver="0.6.3-alpha"
  12. _ffiexpver=e8d9c915390aaa8ffa1d220f4696f4fe2ca6ae6e
  13. _luajsonver=1.3.3
  14. SRC_URI="dependency_control? (
  15. https://github.com/TypesettingTools/DependencyControl/archive/v${_depctrlver}.tar.gz -> DependencyControl-${_depctrlver}.tar.gz
  16. https://github.com/TypesettingTools/ffi-experiments/archive/${_ffiexpver}.tar.gz -> ffi-experiments-${_ffiexpver}.tar.gz
  17. https://github.com/harningt/luajson/archive/${_luajsonver}.tar.gz -> luajson-${_luajsonver}.tar.gz
  18. )"
  19. # Submodules are used to pull bundled libraries.
  20. EGIT_SUBMODULES=()
  21. LICENSE="BSD MIT"
  22. SLOT="0"
  23. KEYWORDS=""
  24. IUSE="+alsa +fonts debug +fftw openal oss portaudio pulseaudio spell +uchardet libressl dependency_control"
  25. RESTRICT="test"
  26. # aegisub bundles luabins (https://github.com/agladysh/luabins).
  27. # Unfortunately, luabins upstream is practically dead since 2010.
  28. # Thus unbundling luabins isn't worth the effort.
  29. RDEPEND="
  30. x11-libs/wxGTK:${WX_GTK_VER}[X,opengl,debug?]
  31. dev-lang/luajit:2[lua52compat]
  32. dev-libs/boost:=[icu,nls,threads]
  33. dev-libs/icu:=
  34. media-libs/ffmpegsource:=
  35. media-libs/fontconfig
  36. media-libs/freetype
  37. media-libs/libass:=[fontconfig]
  38. sys-libs/zlib
  39. virtual/libiconv
  40. virtual/opengl
  41. alsa? ( media-libs/alsa-lib )
  42. fftw? ( >=sci-libs/fftw-3.3:= )
  43. openal? ( media-libs/openal )
  44. portaudio? ( =media-libs/portaudio-19* )
  45. pulseaudio? ( media-sound/pulseaudio )
  46. spell? ( app-text/hunspell:= )
  47. uchardet? ( app-i18n/uchardet )
  48. libressl? ( dev-libs/libressl:0 )
  49. !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0 )
  50. fonts? ( media-fonts/japan7-fonts-ttf )
  51. "
  52. DEPEND="${RDEPEND}
  53. dev-util/intltool
  54. sys-devel/gettext
  55. virtual/pkgconfig
  56. dependency_control? ( dev-lua/moonscript )
  57. "
  58. REQUIRED_USE="|| ( alsa openal oss portaudio pulseaudio )"
  59. PATCHES=(
  60. )
  61. src_unpack() {
  62. default_src_unpack
  63. git-r3_src_unpack
  64. }
  65. src_prepare() {
  66. default_src_prepare
  67. sed -i 's/(unnamed branch)/master/g' tools/version.sh
  68. # Remove tests that require unavailable uuid Lua module.
  69. rm automation/tests/modules/lfs.moon || die
  70. remove_locale() {
  71. rm "po/${1}.po" || die
  72. }
  73. l10n_find_plocales_changes 'po' '' '.po'
  74. l10n_for_each_disabled_locale_do remove_locale
  75. use dependency_control && sed -i 's|#!/bin/sh|#!/bin/bash|' "${WORKDIR}/ffi-experiments-${_ffiexpver}/BuildLua.sh"
  76. }
  77. src_configure() {
  78. setup-wxwidgets
  79. use dependency_control && EMESON_SOURCE="${WORKDIR}/ffi-experiments-${_ffiexpver}" BUILD_DIR="${WORKDIR}/ffi-experiments-build" meson_src_configure
  80. local emesonargs=(
  81. -Dalsa=$(usex alsa enabled disabled)
  82. -Dopenal=$(usex openal enabled disabled)
  83. -Dlibpulse=$(usex pulseaudio enabled disabled)
  84. -Dportaudio=$(usex portaudio enabled disabled)
  85. #-Doss=$(usex oss true false)
  86. -Dfftw3=$(usex fftw enabled disabled)
  87. -Dffms2=enabled
  88. -Dhunspell=$(usex spell enabled disabled)
  89. -Duchardet=$(usex uchardet enabled disabled)
  90. -Dsystem_luajit=true
  91. )
  92. meson_src_configure
  93. }
  94. src_compile() {
  95. use dependency_control && BUILD_DIR="${WORKDIR}/ffi-experiments-build" meson_src_compile all lua
  96. meson_src_compile
  97. }
  98. src_install() {
  99. meson_src_install
  100. if use dependency_control; then
  101. ffi_build="${WORKDIR}/ffi-experiments-build"
  102. automation_dir="/usr/share/aegisub/automation"
  103. insinto "$automation_dir/include/BM/BadMutex"
  104. doins "${ffi_build}/bad-mutex/libBadMutex.so"
  105. insinto "$automation_dir/include/BM"
  106. doins "${ffi_build}/bad-mutex/BadMutex.lua"
  107. insinto "$automation_dir/include/DM/DownloadManager"
  108. doins "${ffi_build}/download-manager/libDownloadManager.so"
  109. insinto "$automation_dir/include/DM"
  110. doins "${ffi_build}/download-manager/DownloadManager.lua"
  111. insinto "$automation_dir/include/PT/PreciseTimer"
  112. doins "${ffi_build}/precise-timer/libPreciseTimer.so"
  113. insinto "$automation_dir/include/PT"
  114. doins "${ffi_build}/precise-timer/PreciseTimer.lua"
  115. insinto "$automation_dir/include/requireffi"
  116. doins "${ffi_build}/requireffi/requireffi.lua"
  117. insinto "$automation_dir/include/l0"
  118. doins "${WORKDIR}/DependencyControl-${_depctrlver}/modules/DependencyControl.moon"
  119. doins -r "${WORKDIR}/DependencyControl-${_depctrlver}/modules/DependencyControl"
  120. insinto "$automation_dir/autoload"
  121. doins "${WORKDIR}/DependencyControl-${_depctrlver}/macros/l0.DependencyControl.Toolbox.moon"
  122. insinto "$automation_dir/include"
  123. doins "${WORKDIR}/luajson-${_luajsonver}/lua/json.lua"
  124. doins -r "${WORKDIR}/luajson-${_luajsonver}/lua/json"
  125. fi
  126. }
  127. pkg_preinst() {
  128. gnome2_icon_savelist
  129. }
  130. pkg_postinst() {
  131. gnome2_icon_cache_update
  132. xdg_desktop_database_update
  133. }
  134. pkg_postrm() {
  135. gnome2_icon_cache_update
  136. xdg_desktop_database_update
  137. }