diff options
author | Aidan Harris | 2017-10-16 21:28:36 +0100 |
---|---|---|
committer | Aidan Harris | 2017-10-16 21:28:36 +0100 |
commit | 51a7ac87b86946833573525ba70c62a7e19044f0 (patch) | |
tree | cdf02176dafe26357e8332d4b4a78b87ce784c30 /PKGBUILD | |
download | aur-51a7ac87b86946833573525ba70c62a7e19044f0.tar.gz |
Initial Commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..61a61692a001 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,103 @@ +# Maintainer: ahrs <Forward dot to at hotmail dot co dot uk> + +# Special thanks to the following people that provided the +# original PKGBUILD from hyper (https://aur.archlinux.org/packages/hyper/) +# Contributor: Aaron Abbott <aabmass@gmail.com> +# Contributer: fleischie +# Contributer: auk + +pkgname=hyper-git +pkgver=r958.3015855 +pkgrel=1 +epoch= +pkgdesc="A terminal built on web technologies" +arch=('any') +url="https://hyper.is/" +license=('MIT') +groups=() +depends=('nodejs' 'electron' 'gconf') +makedepends=('git' 'npm' 'yarn' 'python2') +checkdepends=() +optdepends=() +provides=() + +conflicts=('hyperterm') +replaces=('hyperterm') +backup=() +options=() +install= +changelog= + +# You can set HYPER_BRANCH to master (or another branch) e.g +# export HYPER_BRANCH=master +if [[ -z "$HYPER_BRANCH" ]] +then + export HYPER_BRANCH="canary" +fi + +source=( + "$pkgname::git+https://github.com/zeit/${pkgname/-git/}.git#branch=$HYPER_BRANCH" + "https://raw.githubusercontent.com/zeit/art/master/hyper/mark/Hyper-Mark-120@3x.png" + "Hyper.desktop" +) +noextract=() +md5sums=('SKIP' + 'f3481e14cba331160339b3b5ab78872b' + '74cb7ba38e37332aa8300e4b6ba9c61c') +validpgpkeys=() + +pkgver() { + cd "${srcdir}/${pkgname}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$pkgname" + + # yarn is a build-dep according to the README + yarn install +} + +build() { + cd "$pkgname" + + # This build command is the same as the one defined in package.json via + # npm run dist except that it doesn't build for debian, rpm, etc. and + # doesn't require some other dependencies + + # add node_modules binaries to PATH + oldpath=$PATH + PATH=$(pwd)/node_modules/.bin:$PATH + + npm run build && + cross-env BABEL_ENV=production babel \ + --out-file app/renderer/bundle.js \ + --no-comments \ + --minified app/renderer/bundle.js && + command build --linux --dir # need to use command because the + # function name is build + + PATH=$oldpath +} + +package() { + cd "$pkgname" + + _appdir="/usr/lib/$pkgname" + _libinstall="${pkgdir}${_appdir}" + + mkdir -p "$pkgdir/usr/bin" "$_libinstall" + cp -R dist/linux-unpacked/* "$_libinstall" + + # link the binary to /usr/bin + cd $pkgdir/usr/bin + ln -s "../lib/$pkgname/hyper" hyper + + # # TODO: remove included electron libs and use the system ones by symlink + # cd "$_libinstall" + # rm libnode.so libffmpeg.so + # ln -s /usr/share/electron/lib{node,ffmpeg}.so . + + install -Dm644 "$srcdir/Hyper.desktop" "$pkgdir/usr/share/applications/Hyper.desktop" + install -Dm644 "$srcdir/Hyper-Mark-120@3x.png" "$pkgdir/usr/share/pixmaps/hyper.png" +} |