|
| 1 | +# Copyright 1999-2025 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +# Please report bugs/suggestions on: https://github.com/anyc/steam-overlay |
| 7 | +# or come to #gentoo-games in Libera Chat IRC |
| 8 | + |
| 9 | +inherit desktop linux-info pax-utils prefix xdg |
| 10 | + |
| 11 | +DESCRIPTION="Installer, launcher and supplementary files for Valve's Steam client" |
| 12 | +HOMEPAGE="https://store.steampowered.com" |
| 13 | +SRC_URI="https://repo.steampowered.com/steam/archive/stable/steam_${PV}.tar.gz" |
| 14 | +S="${WORKDIR}/${PN}" |
| 15 | + |
| 16 | +LICENSE="ValveSteamLicense MIT" |
| 17 | +SLOT="0" |
| 18 | +KEYWORDS="-* ~amd64 ~x86" |
| 19 | +IUSE="+desktop-portal +dialogs +joystick +pulseaudio +steamruntime steamvr trayicon +udev video_cards_nvidia wayland" |
| 20 | +RESTRICT="bindist mirror test" |
| 21 | + |
| 22 | +# This can help to determine the dependencies: |
| 23 | +# find ~/.steam/root/ -exec readelf -d {} + 2>/dev/null | grep -F NEEDED | sort -u | grep -F -v -f <(ls -1 ~/.steam/root/ubuntu12_32/) |
| 24 | + |
| 25 | +# REVIEW: it would be the best to have |
| 26 | +# >=sys-devel/gcc-4.6.0[multilib] |
| 27 | +# >=sys-libs/glibc-2.15[multilib] |
| 28 | +# in RDEPEND but pkgcheck throws NonsolvableDepsIn{Dev,Stable} |
| 29 | + |
| 30 | +RDEPEND=" |
| 31 | + media-libs/fontconfig[abi_x86_32] |
| 32 | + >=sys-devel/gcc-4.6.0 |
| 33 | + >=sys-libs/glibc-2.15 |
| 34 | + sys-libs/libudev-compat[abi_x86_32] |
| 35 | + sys-process/lsof |
| 36 | + virtual/opengl[abi_x86_32] |
| 37 | + virtual/ttf-fonts |
| 38 | + !x11-misc/virtualgl[-abi_x86_32] |
| 39 | +
|
| 40 | + amd64? ( |
| 41 | + >=sys-devel/gcc-4.6.0[multilib] |
| 42 | + >=sys-libs/glibc-2.15[multilib] |
| 43 | + ) |
| 44 | +
|
| 45 | + steamruntime? ( |
| 46 | + !sys-apps/dbus[abi_x86_32,-X] |
| 47 | + !x11-libs/cairo[abi_x86_32,-X] |
| 48 | + ) |
| 49 | +
|
| 50 | + !steamruntime? ( |
| 51 | + >=app-accessibility/at-spi2-core-2.46.0:2[abi_x86_32] |
| 52 | + app-arch/bzip2[abi_x86_32] |
| 53 | + app-i18n/ibus |
| 54 | + dev-libs/dbus-glib[abi_x86_32] |
| 55 | + dev-libs/expat[abi_x86_32] |
| 56 | + dev-libs/glib:2[abi_x86_32] |
| 57 | + dev-libs/nspr[abi_x86_32] |
| 58 | + dev-libs/nss[abi_x86_32] |
| 59 | + games-util/esteam |
| 60 | + media-libs/alsa-lib[abi_x86_32] |
| 61 | + media-libs/freetype[abi_x86_32] |
| 62 | + media-libs/libpng-compat:1.2 |
| 63 | + media-libs/libva:0/2[abi_x86_32] |
| 64 | + media-libs/openal[abi_x86_32] |
| 65 | + media-video/pipewire:0/0.4[abi_x86_32] |
| 66 | + net-misc/curl[abi_x86_32] |
| 67 | + net-misc/networkmanager[abi_x86_32] |
| 68 | + net-print/cups |
| 69 | + sys-apps/dbus[abi_x86_32,X] |
| 70 | + sys-libs/zlib[abi_x86_32] |
| 71 | + virtual/libusb[abi_x86_32] |
| 72 | + x11-libs/gdk-pixbuf[abi_x86_32] |
| 73 | + x11-libs/gtk+:2[abi_x86_32] |
| 74 | + x11-libs/libICE[abi_x86_32] |
| 75 | + x11-libs/libSM[abi_x86_32] |
| 76 | + x11-libs/libvdpau[abi_x86_32] |
| 77 | + x11-libs/libX11[abi_x86_32] |
| 78 | + x11-libs/libXcomposite[abi_x86_32] |
| 79 | + x11-libs/libXcursor[abi_x86_32] |
| 80 | + x11-libs/libXdamage[abi_x86_32] |
| 81 | + x11-libs/libXext[abi_x86_32] |
| 82 | + x11-libs/libXfixes[abi_x86_32] |
| 83 | + x11-libs/libXi[abi_x86_32] |
| 84 | + x11-libs/libXinerama[abi_x86_32] |
| 85 | + x11-libs/libXrandr[abi_x86_32] |
| 86 | + x11-libs/libXrender[abi_x86_32] |
| 87 | + x11-libs/libXScrnSaver[abi_x86_32] |
| 88 | + x11-libs/libXtst[abi_x86_32] |
| 89 | + x11-libs/pango[abi_x86_32] |
| 90 | +
|
| 91 | + dialogs? ( || ( |
| 92 | + >=gnome-extra/zenity-3 |
| 93 | + x11-terms/xterm |
| 94 | + ) ) |
| 95 | +
|
| 96 | + trayicon? ( dev-libs/libappindicator:2[abi_x86_32] ) |
| 97 | + ) |
| 98 | +
|
| 99 | + desktop-portal? ( sys-apps/xdg-desktop-portal ) |
| 100 | + pulseaudio? ( media-libs/libpulse[abi_x86_32] ) |
| 101 | + !pulseaudio? ( media-sound/apulse[abi_x86_32] ) |
| 102 | + steamvr? ( sys-apps/usbutils ) |
| 103 | + video_cards_nvidia? ( x11-drivers/nvidia-drivers[abi_x86_32] ) |
| 104 | +
|
| 105 | + joystick? ( |
| 106 | + udev? ( games-util/game-device-udev-rules ) |
| 107 | + wayland? ( || ( |
| 108 | + x11-libs/extest[abi_x86_32] |
| 109 | + >=x11-base/xwayland-23.2.1[libei(+)] |
| 110 | + ) ) |
| 111 | + ) |
| 112 | +" |
| 113 | + |
| 114 | +pkg_setup() { |
| 115 | + linux-info_pkg_setup |
| 116 | + |
| 117 | + if ! { linux_config_exists && linux_chkconfig_present INPUT_UINPUT; }; then |
| 118 | + ewarn "If you want to use Steam Input's virtual controller" |
| 119 | + ewarn "implementation, please make sure CONFIG_INPUT_UINPUT" |
| 120 | + ewarn "is enabled in your kernel config." |
| 121 | + |
| 122 | + # Device Drivers |
| 123 | + # -> Input device support |
| 124 | + # -> Miscellaneous devices |
| 125 | + # -> User level driver support |
| 126 | + fi |
| 127 | +} |
| 128 | + |
| 129 | +lib_path_entries() { |
| 130 | + while true; do |
| 131 | + echo -n ${EPREFIX}/usr/\\\\\${LIB}/${1} |
| 132 | + shift |
| 133 | + |
| 134 | + if [[ -n ${1} ]]; then |
| 135 | + echo -n : |
| 136 | + else |
| 137 | + break |
| 138 | + fi |
| 139 | + done |
| 140 | +} |
| 141 | + |
| 142 | +src_prepare() { |
| 143 | + default |
| 144 | + |
| 145 | + sed \ |
| 146 | + -e "s#@@PVR@@#${PVR}#g" \ |
| 147 | + -e "s#@@GENTOO_LD_LIBRARY_PATH@@#$(lib_path_entries debiancompat fltk)#g" \ |
| 148 | + -e "s#@@GENTOO_X86_LIBDIR@@#${EPREFIX}/usr/$(ABI=x86 get_libdir)#g" \ |
| 149 | + -e "s#@@STEAM_RUNTIME@@#$(usex steamruntime 1 0)#g" \ |
| 150 | + "${FILESDIR}"/steam-wrapper.sh > steam-wrapper.sh || die |
| 151 | + |
| 152 | + # Still need EPREFIX in the sed replacements above because the |
| 153 | + # regular expression used by hprefixify doesn't match there. |
| 154 | + hprefixify bin_steam.sh steam-wrapper.sh |
| 155 | +} |
| 156 | + |
| 157 | +src_install() { |
| 158 | + emake install-{icons,bootstrap} \ |
| 159 | + DESTDIR="${D}" PREFIX="${EPREFIX}/usr" |
| 160 | + |
| 161 | + newbin steam-wrapper.sh steam |
| 162 | + exeinto /usr/lib/steam |
| 163 | + doexe bin_steam.sh |
| 164 | + domenu steam.desktop |
| 165 | + |
| 166 | + dodoc README debian/changelog |
| 167 | + doman steam.6 |
| 168 | +} |
| 169 | + |
| 170 | +pkg_postinst() { |
| 171 | + xdg_pkg_postinst |
| 172 | + |
| 173 | + elog "Execute ${EPREFIX}/usr/bin/steam to download and install the actual" |
| 174 | + elog "client into your home folder. After installation, the script" |
| 175 | + elog "also starts the client from your home folder." |
| 176 | + elog "" |
| 177 | + |
| 178 | + ewarn "The Steam client and the games are _not_ controlled by Portage." |
| 179 | + ewarn "Updates are handled by the client itself." |
| 180 | + ewarn "" |
| 181 | + |
| 182 | + if use steamruntime; then |
| 183 | + elog "You have enabled the Steam runtime environment by default." |
| 184 | + elog "Steam will use bundled libraries if they are missing from" |
| 185 | + elog "your Gentoo system. Try disabling the runtime with the" |
| 186 | + elog "steamruntime USE flag if you have issues." |
| 187 | + elog "" |
| 188 | + else |
| 189 | + elog "You have disabled the Steam runtime environment by default." |
| 190 | + elog "Steam will not use bundled libraries if they are missing from" |
| 191 | + elog "your Gentoo system. Use games-util/esteam to install addiitonal" |
| 192 | + elog "dependencies needed by your games. Try setting STEAM_RUNTIME=1" |
| 193 | + elog "to temporarily enable the runtime if you have issues." |
| 194 | + elog "" |
| 195 | + ewarn "Notice: Valve only supports Steam with the runtime enabled!" |
| 196 | + ewarn "" |
| 197 | + fi |
| 198 | + |
| 199 | + if ! use desktop-portal; then |
| 200 | + ewarn "You have disabled desktop-portal, which is not supported." |
| 201 | + ewarn "An xdg-desktop-portal backend is needed for file pickers" |
| 202 | + ewarn "and other desktop components to work, e.g. when adding a" |
| 203 | + ewarn "non-Steam game or a new library folder." |
| 204 | + ewarn "" |
| 205 | + fi |
| 206 | + |
| 207 | + if ! has_version "gnome-extra/zenity"; then |
| 208 | + ewarn "Valve does not provide a xterm fallback for all calls of zenity." |
| 209 | + ewarn "Please install gnome-extra/zenity for full support." |
| 210 | + ewarn "" |
| 211 | + fi |
| 212 | + |
| 213 | + if host-is-pax; then |
| 214 | + elog "If you're using PAX, please see:" |
| 215 | + elog "https://wiki.gentoo.org/wiki/Steam#Hardened_Gentoo" |
| 216 | + elog "" |
| 217 | + fi |
| 218 | +} |
0 commit comments