discord draft
This commit is contained in:
		
							
								
								
									
										21
									
								
								discord-electron/discord-launcher.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								discord-electron/discord-launcher.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | #!/usr/bin/bash | ||||||
|  |  | ||||||
|  | set -euo pipefail | ||||||
|  |  | ||||||
|  | name=@PKGNAME@ | ||||||
|  | electron=@ELECTRON@ | ||||||
|  | flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf" | ||||||
|  |  | ||||||
|  | declare -a flags | ||||||
|  |  | ||||||
|  | if [[ -f "${flags_file}" ]]; then | ||||||
|  |     mapfile -t < "${flags_file}" | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | for line in "${MAPFILE[@]}"; do | ||||||
|  |     if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then | ||||||
|  |         flags+=("${line}") | ||||||
|  |     fi | ||||||
|  | done | ||||||
|  |  | ||||||
|  | exec ~/.npm/node_modules/electron/dist/electron /usr/lib/${name}/app.asar "${flags[@]}" "$@" | ||||||
							
								
								
									
										53
									
								
								discord-electron/lure.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								discord-electron/lure.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | |||||||
|  | name='discord-electron' | ||||||
|  | version='0.0.22' | ||||||
|  | release='1' | ||||||
|  | desc='Discord (popular voice + video app) using the system provided electron for increased security and performance' | ||||||
|  | homepage='homepage=''https://discord.com/' | ||||||
|  | architectures=('amd64') | ||||||
|  | license=('custom') | ||||||
|  | provides=('discord') | ||||||
|  | conflicts=('discord') | ||||||
|  |  | ||||||
|  | deps=('libXScrnSaver' 'libpulse' 'xdg-utils') | ||||||
|  | build_deps=('npm') | ||||||
|  |  | ||||||
|  | sources=("https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz") | ||||||
|  | checksums=('SKIP') | ||||||
|  |  | ||||||
|  | prepare() { | ||||||
|  |     sed -i "s|@PKGNAME@|discord|;s|@ELECTRON@|${_electron}|" discord-launcher.sh | ||||||
|  |     sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" Discord/discord.desktop | ||||||
|  |     mkdir ~/.npm | ||||||
|  | 	cd ~/.npm | ||||||
|  | 	npm install --engine-strict asar | ||||||
|  | 	npm install electron --save-dev | ||||||
|  |  | ||||||
|  | 	cd "${srcdir}" | ||||||
|  | 	~/.npm/node_modules/asar/bin/asar.js ef "${name}-${version}/resources/obsidian.asar" icon.png | ||||||
|  | } | ||||||
|  |  | ||||||
|  | package() { | ||||||
|  |  | ||||||
|  |   install -d "${pkgdir}/usr/lib/discord | ||||||
|  |  | ||||||
|  |   # HACKS FOR SYSTEM ELECTRON | ||||||
|  |   asar e Discord/resources/app.asar Discord/resources/app | ||||||
|  |   rm Discord/resources/app.asar | ||||||
|  |   sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/app_bootstrap/buildInfo.js | ||||||
|  |   sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js | ||||||
|  |   sed -i "s#^module\.paths.*;#module.paths = [(process.env.XDG_CONFIG_HOME || (process.env.HOME + \"/.config\")) + \"/discord/$pkgver/modules\"];#" Discord/resources/app/app_bootstrap/requireNative.js | ||||||
|  |   asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**' | ||||||
|  |   rm -rf Discord/resources/app | ||||||
|  |  | ||||||
|  |   # Copy Relevanat data | ||||||
|  |   cp -r Discord/resources/*  "$pkgdir"/usr/lib/$_pkgname/ | ||||||
|  |  | ||||||
|  |   install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}} | ||||||
|  |   install -Dm 755 "${srcdir}/discord-launcher.sh" "${pkgdir}/usr/bin/${_pkgname}" | ||||||
|  |  | ||||||
|  |   cp Discord/discord.png "$pkgdir"/usr/share/pixmaps/$_pkgname.png | ||||||
|  |   cp Discord/discord.desktop "$pkgdir"/usr/share/applications/$_pkgname.desktop | ||||||
|  |  | ||||||
|  |   # Licenses | ||||||
|  |   install -Dm 644 LICENSE.html "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.html | ||||||
|  |   install -Dm 644 OSS-LICENSES.html "$pkgdir"/usr/share/licenses/$pkgname/OSS-LICENSES.html | ||||||
| @@ -1,37 +0,0 @@ | |||||||
| name='discord-electron' |  | ||||||
| version='0.0.22' |  | ||||||
| release='1' |  | ||||||
| desc='Discord (popular voice + video app) using the system provided electron for increased security and performance' |  | ||||||
| homepage='homepage=''https://discord.com/' |  | ||||||
| architectures=('amd64') |  | ||||||
| license=('custom') |  | ||||||
| provides=('discord') |  | ||||||
| conflicts=('discord') |  | ||||||
|  |  | ||||||
| deps=('libXScrnSaver') |  | ||||||
| build_deps=('npm') |  | ||||||
|  |  | ||||||
| sources_amd64=("git+https://github.com/altlinux/${name}.git") |  | ||||||
| checksums_amd64=('SKIP') |  | ||||||
|  |  | ||||||
| prepare() { |  | ||||||
| 	cd ~/.npm |  | ||||||
| 	npm install --engine-strict asar |  | ||||||
| 	npm install electron --save-dev |  | ||||||
|  |  | ||||||
| 	cd "${srcdir}" |  | ||||||
| 	~/.npm/node_modules/asar/bin/asar.js ef "${name}-${version}/resources/obsidian.asar" icon.png |  | ||||||
| } |  | ||||||
|  |  | ||||||
| build() { |  | ||||||
| 	cd "${srcdir}/${name}/build" |  | ||||||
| 	cmake .. |  | ||||||
| 	make -j12 |  | ||||||
| } |  | ||||||
|  |  | ||||||
| package() { |  | ||||||
| 	install -Dm755 "${srcdir}/${name}/build/admc" "${pkgdir}/usr/bin/admc" |  | ||||||
| 	install -Dm644 "${srcdir}/${name}/build/libadldap.so" "${pkgdir}/usr/lib/libadldap.so" |  | ||||||
| 	install -Dm644 "${srcdir}/${name}/share/admc.desktop" "${pkgdir}/usr/share/applications/admc.desktop" |  | ||||||
| 	install -Dm644 "${srcdir}/${name}/share/admc.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/admc.svg" |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user