-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Generate AppImage #2027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate AppImage #2027
Changes from all commits
f2e641d
38e461d
79ace21
e8ffe86
366ca5e
0da5206
a1d5148
1b9a437
d49c595
0c7fe08
4c57d1c
d627b6c
abfd190
0ea30ab
bb774e2
c9324f7
6a49585
bf7cba0
a18bce7
7476ad0
e7ca878
6b58119
b4e1cd7
7dc82b4
b07c6dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| #!/bin/bash | ||
|
|
||
| # This code is based on an example recipe from the AppImage project, | ||
| # https://github.com/probonopd/AppImages/blob/master/recipes/powershell/Recipe | ||
| # Copyright (c) 2016 Simon Peter | ||
| # The license of this code and of https://github.com/probonopd/AppImages/raw/master/functions.sh | ||
| # is the MIT License, see https://github.com/probonopd/AppImages/blob/master/LICENSE | ||
| # | ||
| # Generate AppImage, http://appimage.org | ||
| # | ||
| # The resulting PowerShell AppImage is known to run on | ||
| # CentOS-7.0-1406-x86_64-GnomeLive.iso | ||
| # CentOS-7-x86_64-LiveGNOME-1511.iso | ||
| # Chromixium-1.5-amd64.iso | ||
| # Fedora-Live-Workstation-x86_64-22-3.iso | ||
| # Fedora-Live-Workstation-x86_64-23-10.iso | ||
| # SL-72-x86_64-2016-02-03-LiveDVDgnome.iso | ||
| # debian-live-8.0.0-amd64-xfce-desktop+nonfree.iso | ||
| # debian-live-8.4.0-amd64-gnome-desktop.iso | ||
| # elementary_OS_0.3_freya_amd64.iso | ||
| # kali-linux-2.0-amd64.iso | ||
| # kali-linux-2016.1-amd64.iso | ||
| # kubuntu-14.04.4-desktop-amd64.iso | ||
| # kubuntu-15.04-desktop-amd64.iso | ||
| # kubuntu-16.04-desktop-amd64.iso | ||
| # linuxmint-17.3-cinnamon-64bit.iso | ||
| # neon-devedition-gitunstable-20160814-0806-amd64.iso | ||
| # netrunner-17-64bit.iso | ||
| # ubuntu-14.04.1-desktop-amd64.iso | ||
| # ubuntu-16.04-desktop-amd64.iso | ||
| # ubuntu-gnome-16.04-desktop-amd64.iso | ||
| # ubuntu-mate-16.04-desktop-amd64.iso | ||
| # xubuntu-16.04-desktop-amd64.iso | ||
|
|
||
| APP=powershell | ||
|
|
||
| mkdir -p ./$APP/$APP.AppDir/usr/lib | ||
|
|
||
| cd ./$APP/ | ||
|
|
||
| wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a link the the license, mention the license type, and the copyright. And add it to here: https://github.com/PowerShell/PowerShell/blob/master/license_thirdparty_proprietary.txt #Pending
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was saying here you should mention that functions.sh is covered by the MIT license, and the copyright it is covered under. In reply to: 75963644 [](ancestors = 75963644) |
||
| . ./functions.sh | ||
|
|
||
| # We get this app and almost all its dependencies via apt-get | ||
| # but not using the host system's information about what is | ||
| # installed on the system but our own assumptions instead | ||
|
|
||
| mkdir -p ./tmp/archives/ | ||
| mkdir -p ./tmp/lists/partial | ||
| touch tmp/pkgcache.bin tmp/srcpkgcache.bin | ||
|
|
||
| generate_status | ||
|
|
||
| echo "deb http://archive.ubuntu.com/ubuntu/ trusty main universe | ||
| " > sources.list | ||
|
|
||
| OPTIONS="-o Debug::NoLocking=1 | ||
| -o APT::Cache-Limit=125829120 | ||
| -o Dir::Etc::sourcelist=./sources.list | ||
| -o Dir::State=./tmp | ||
| -o Dir::Cache=./tmp | ||
| -o Dir::State::status=./status | ||
| -o Dir::Etc::sourceparts=- | ||
| -o APT::Get::List-Cleanup=0 | ||
| -o APT::Get::AllowUnauthenticated=1 | ||
| -o Debug::pkgProblemResolver=true | ||
| -o Debug::pkgDepCache::AutoInstall=true | ||
| -o APT::Install-Recommends=0 | ||
| -o APT::Install-Suggests=0 | ||
| " | ||
|
|
||
| cp ../powershell_*_amd64.deb . | ||
|
|
||
| # Add local repository so that we can install deb files | ||
| # that were downloaded outside of a repository | ||
| dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz | ||
| echo "deb file:$(readlink -e $PWD) ./" >> sources.list | ||
|
|
||
| apt-get $OPTIONS update | ||
|
|
||
| URLS=$(apt-get $OPTIONS -y install --print-uris $APP | cut -d "'" -f 2 | grep -e "^http") | ||
|
|
||
| wget -c $URLS | ||
|
|
||
| cd ./$APP.AppDir/ | ||
|
|
||
| find ../*.deb -exec dpkg -x {} . \; || true | ||
|
|
||
| rm usr/bin/powershell | ||
| mv opt/microsoft/powershell/*/* usr/bin/ | ||
|
|
||
| cat > $APP.desktop <<\EOF | ||
| [Desktop Entry] | ||
| Name=PowerShell | ||
| Comment=Microsoft PowerShell | ||
| Exec=powershell | ||
| Keywords=shell;prompt;command;commandline;cmd; | ||
| Icon=powershell | ||
| Type=Application | ||
| Categories=System;TerminalEmulator; | ||
| StartupNotify=true | ||
| Terminal=true | ||
| EOF | ||
|
|
||
| cp ../../assets/Powershell_256.png $APP.png | ||
|
|
||
| cat > ./AppRun <<\EOF | ||
| #!/bin/sh | ||
| HERE=$(dirname $(readlink -f "${0}")) | ||
| export PATH="${HERE}/usr/bin/":$PATH | ||
| export LD_LIBRARY_PATH="${HERE}/usr/lib/":$LD_LIBRARY_PATH | ||
| exec "${HERE}/usr/bin/powershell.wrapper" "$@" | ||
| EOF | ||
| chmod a+x ./AppRun | ||
|
|
||
| move_lib | ||
| mv ./usr/lib/x86_64-linux-gnu/* ./usr/lib/ # AppRun sets Qt env here | ||
|
|
||
| mv ./usr/lib/pulseaudio/*.so usr/lib/ || true | ||
|
|
||
| mv usr/local/share/man usr/share/ | ||
|
|
||
| delete_blacklisted | ||
| rm -rf ./etc/ ./home/ ./lib/ || true | ||
| rm -r opt/ usr/lib/x86_64-linux-gnu/ usr/lib64 usr/share/ | ||
|
|
||
| VERSION=$(find ../*.deb -name $APP"_*" | head -n 1 | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1-2 | sed -e 's|1%3a||g') | ||
| echo $VERSION | ||
|
|
||
| get_desktopintegration $APP | ||
| sed -i -e 's|^echo|# echo|g' usr/bin/$APP.wrapper # Make less verbose | ||
|
|
||
| # Go out of AppImage | ||
| cd .. | ||
|
|
||
| ARCH="x86_64" | ||
| generate_appimage | ||
|
|
||
| cp ../out/*AppImage .. | ||
|
|
||
| cd .. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| set -x | ||
| set -ex | ||
| ulimit -n 4096 | ||
| # Only build packages for branches, not pull requests | ||
| if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then | ||
| powershell -c "Import-Module ./build.psm1; Start-PSBootstrap -Package; Start-PSBuild -CrossGen; Start-PSPackage; Start-PSPester; Start-PSxUnit" | ||
| # Generate AppImage | ||
| ./tools/appimage.sh | ||
| else | ||
| powershell -c "Import-Module ./build.psm1; Start-PSBootstrap; Start-PSBuild -CrossGen; Start-PSPester; Start-PSxUnit" | ||
| fi |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix #Closed