Browse Source

Provide Arch Linux PKGBUILD to be pushed to AUR

closes #1145
master
meriadec 7 years ago
parent
commit
217c54a5c3
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 17
      .gitignore
  2. 53
      build/linux/arch/PKGBUILD
  3. 10
      build/linux/arch/ledger-live.desktop
  4. 6
      scripts/helpers/display-env.sh
  5. 44
      scripts/publish-arch-package.sh

17
.gitignore

@ -1,11 +1,20 @@
.DS_Store
*.log
/.env
/dist/
/flow-typed/
/node_modules/
/static/fonts/museosans/
/storybook-static/
thumbs.db
/build/linux/arch/.SRCINFO
/build/linux/arch/pkg
/build/linux/arch/src
/build/linux/arch/*.tar.gz
/build/linux/arch/*.tar.xz
# TODO this should be in devs global gitignore
# it makes no sense to have it here
*.log
.DS_Store
.vscode
jsconfig.json
thumbs.db
jsconfig.json

53
build/linux/arch/PKGBUILD

@ -0,0 +1,53 @@
# Maintainer: Meriadec Pillet <meriadec.pillet@gmail.com>
# shellcheck disable=SC2154,SC2034,SC2164
pkgname=ledger-live
pkgver=1.0.3
pkgrel=1
pkgdesc="Open source companion app for your Ledger devices"
arch=('x86_64')
url="https://www.ledgerwallet.com/live"
license=('MIT')
makedepends=(yarn python2)
# TODO generate changelog from release notes
changelog=
source=("https://github.com/LedgerHQ/ledger-live-desktop/archive/v${pkgver}.tar.gz"
"ledger-live.desktop")
md5sums=('51ff80d0db79e82c52c1732b52ff1174'
'52705147909a0a988907a23a71199092')
# TODO sign with ledger pgp
validpgpkeys=()
extractedFolder=ledger-live-desktop-$pkgver
prepare() {
cd $extractedFolder
export JOBS=max
yarn --ignore-scripts
}
build() {
cd $extractedFolder
export GIT_REVISION=$pkgver
export JOBS=max
yarn dist
}
package() {
install -D -m644 \
"${pkgname}.desktop" \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
cd $extractedFolder
install -dm755 "${pkgdir}/opt"
cp -r "dist/linux-unpacked" "${pkgdir}/opt/ledger-live"
install -dm755 "${pkgdir}/usr/bin"
ln -s "/opt/${pkgname}/ledger-live-desktop" "${pkgdir}/usr/bin/${pkgname}"
install -D -m644 \
"static/images/browser-window-icon-512x512.png" \
"${pkgdir}/usr/share/icons/hicolor/512x512/apps/ledger-live.png"
}

10
build/linux/arch/ledger-live.desktop

@ -0,0 +1,10 @@
[Desktop Entry]
Name=ledger-live
Comment=Open source companion app for your Ledger devices
Path=/opt/ledger-live
Exec=ledger-live
Icon=ledger-live
Type=Application
StartupNotify=true
Categories=Utility;
StartupWMClass=ledger-live

6
scripts/helpers/display-env.sh

@ -3,10 +3,12 @@
# shellcheck disable=SC1091
source scripts/helpers/format.sh
appVersion=$(grep version package.json | sed 's/.*"\(.*\)",$/\1/')
if [ "$GIT_REVISION" == "" ]; then
GIT_REVISION=$(git rev-parse HEAD)
fi
echo
printf " │ \\e[4;1m%s\\e[0;0m\\n" "Ledger Live Desktop - ${appVersion}"
printf " │ \\e[4;1m%s\\e[0;0m\\n" "Ledger Live Desktop - ${GIT_REVISION}"
printf " │ \\e[1;30m%s\\e[1;0m\\n" "$(uname -srmo)"
printf " │ \\e[2;1mcommit \\e[0;33m%s\\e[0;0m\\n" "$(git rev-parse HEAD)"
echo

44
scripts/publish-arch-package.sh

@ -0,0 +1,44 @@
#!/bin/bash
set -e
# shellcheck disable=SC1091
source scripts/helpers/run-job.sh
# shellcheck disable=SC1091
source scripts/helpers/display-env.sh
gitTag=$(git describe --tags)
tmpDir=$(mktemp -d)
runJob \
"pushd build/linux/arch >/dev/null; makepkg --printsrcinfo > .SRCINFO; popd >/dev/null" \
"creating .SRCINFO" \
"successfully created .SRCINFO" \
"error creating .SRCINFO"
runJob \
"git clone ssh://aur@aur.archlinux.org/ledger-live.git ${tmpDir}" \
"cloning AUR repository" \
"cloned AUR repository" \
"error cloning AUR repository"
runJob \
"cp build/linux/arch/* \"${tmpDir}\"; cp build/linux/arch/.SRCINFO \"${tmpDir}\"" \
"copying files" \
"copied files" \
"error copying files"
ls -l "$tmpDir"
# shellcheck disable=SC2164
cd "$tmpDir"
git add .
git commit -m "Build for ${gitTag}"
runJob \
"git push origin master" \
"pushing package" \
"successfully pushed package" \
"error pushing package"
Loading…
Cancel
Save