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.

113 lines
2.8 KiB

  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit desktop pax-utils xdg
  5. DESCRIPTION="A community-driven, freely-licensed binary distribution of Microsoft's VSCode"
  6. HOMEPAGE="https://vscodium.com/"
  7. SRC_URI="
  8. amd64? ( https://github.com/VSCodium/${PN}/releases/download/${PV}/VSCodium-linux-x64-${PV}.tar.gz -> ${P}-amd64.tar.gz )
  9. arm? ( https://github.com/VSCodium/${PN}/releases/download/${PV}/VSCodium-linux-armhf-${PV}.tar.gz -> ${P}-arm.tar.gz )
  10. arm64? ( https://github.com/VSCodium/${PN}/releases/download/${PV}/VSCodium-linux-arm64-${PV}.tar.gz -> ${P}-arm64.tar.gz )
  11. "
  12. RESTRICT="mirror strip bindist"
  13. LICENSE="
  14. Apache-2.0
  15. BSD
  16. BSD-1
  17. BSD-2
  18. BSD-4
  19. CC-BY-4.0
  20. ISC
  21. LGPL-2.1+
  22. MIT
  23. MPL-2.0
  24. openssl
  25. PYTHON
  26. TextMate-bundle
  27. Unlicense
  28. UoI-NCSA
  29. W3C
  30. "
  31. SLOT="0"
  32. KEYWORDS="-* ~amd64 ~arm ~arm64"
  33. IUSE=""
  34. RDEPEND="
  35. app-accessibility/at-spi2-atk:2
  36. app-accessibility/at-spi2-core:2
  37. app-crypt/libsecret[crypt]
  38. dev-libs/atk
  39. dev-libs/expat
  40. dev-libs/glib:2
  41. dev-libs/nspr
  42. dev-libs/nss
  43. media-libs/alsa-lib
  44. media-libs/mesa
  45. net-print/cups
  46. sys-apps/dbus
  47. x11-libs/cairo
  48. x11-libs/gdk-pixbuf:2
  49. x11-libs/gtk+:3
  50. x11-libs/libdrm
  51. x11-libs/libX11
  52. x11-libs/libxcb
  53. x11-libs/libXcomposite
  54. x11-libs/libXdamage
  55. x11-libs/libXext
  56. x11-libs/libXfixes
  57. x11-libs/libxkbcommon
  58. x11-libs/libxkbfile
  59. x11-libs/libXrandr
  60. x11-libs/libxshmfence
  61. x11-libs/pango
  62. "
  63. QA_PREBUILT="
  64. /opt/vscodium/codium
  65. /opt/vscodium/libEGL.so
  66. /opt/vscodium/libffmpeg.so
  67. /opt/vscodium/libGLESv2.so
  68. /opt/vscodium/libvulkan.so*
  69. /opt/vscodium/chrome-sandbox
  70. /opt/vscodium/libvk_swiftshader.so
  71. /opt/vscodium/swiftshader/libEGL.so
  72. /opt/vscodium/swiftshader/libGLESv2.so
  73. /opt/vscodium/resources/app/extensions/*
  74. /opt/vscodium/resources/app/node_modules.asar.unpacked/*
  75. "
  76. S="${WORKDIR}"
  77. src_install() {
  78. # Cleanup
  79. rm "${S}/resources/app/LICENSE.txt" || die
  80. # Install
  81. pax-mark m codium
  82. insinto "/opt/${PN}"
  83. doins -r *
  84. fperms +x /opt/${PN}/{,bin/}codium
  85. fperms 4711 /opt/${PN}/chrome-sandbox
  86. fperms 755 /opt/${PN}/resources/app/extensions/git/dist/askpass.sh
  87. fperms 755 /opt/${PN}/resources/app/extensions/git/dist/askpass-empty.sh
  88. fperms -R +x /opt/${PN}/resources/app/out/vs/base/node
  89. fperms +x /opt/${PN}/resources/app/node_modules.asar.unpacked/vscode-ripgrep/bin/rg
  90. dosym "../../opt/${PN}/bin/codium" "usr/bin/vscodium"
  91. dosym "../../opt/${PN}/bin/codium" "usr/bin/codium"
  92. domenu "${FILESDIR}/vscodium.desktop"
  93. domenu "${FILESDIR}/vscodium-url-handler.desktop"
  94. domenu "${FILESDIR}/vscodium-wayland.desktop"
  95. domenu "${FILESDIR}/vscodium-url-handler-wayland.desktop"
  96. newicon "resources/app/resources/linux/code.png" "vscodium.png"
  97. }
  98. pkg_postinst() {
  99. xdg_pkg_postinst
  100. elog "When compared to the regular VSCode, VSCodium has a few quirks"
  101. elog "More information at: https://github.com/VSCodium/vscodium/blob/master/DOCS.md"
  102. }