diff options
author | M0Rf30 | 2017-11-04 17:02:08 +0100 |
---|---|---|
committer | M0Rf30 | 2017-11-04 17:02:08 +0100 |
commit | 2175b6079b0ba2cebdc2f143265c11acd424ed12 (patch) | |
tree | a051fa16805c02887506c8c47f0cd76cc587130f | |
parent | 09c7064c52245c015b0c8454b9270b800fff64c7 (diff) | |
download | aur-2175b6079b0ba2cebdc2f143265c11acd424ed12.tar.gz |
openbazaar-git: some launcher cleanups and icons fixes
-rw-r--r-- | PKGBUILD | 33 | ||||
-rw-r--r-- | icons.patch | 29 | ||||
-rw-r--r-- | openbazaar.desktop | 14 | ||||
-rwxr-xr-x | openbazaar.js | 30 |
4 files changed, 85 insertions, 21 deletions
@@ -2,44 +2,48 @@ _pkgname=openbazaar pkgname=${_pkgname}-git -pkgver=v2.0.17.r14.gaf9cdbb1 +pkgver=v2.0.17.r16.g77be2641 pkgrel=1 pkgdesc="Front-end Electron application for talking with the OpenBazaar daemon (Latest devel version)" arch=(any) url="http://openbazaar.org" license=('MIT') depends=(electron) -makedepends=(git npm asar) +makedepends=(git npm) +conflicts=('openbazaar') source=( "${_pkgname}::git+https://github.com/OpenBazaar/openbazaar-desktop.git" - "${_pkgname}.sh" - "${_pkgname}.desktop" + "${_pkgname}.js" + "${_pkgname}.desktop" + icons.patch ) install=${_pkgname}.install options=('!strip') build(){ cd $srcdir/${_pkgname} + patch -Np1 -i ../icons.patch npm install npm run build rm -rf {.eslint*,.travis*} cp -rf prod/* js/ npm prune --production - asar pack ../${_pkgname} ../${_pkgname}-next.asar } package(){ cd $srcdir + appdir=/usr/lib/ -msg2 "Installing Openbazaar data" - install -Dm644 ${_pkgname}-next.asar $pkgdir/opt/${_pkgname}-next.asar + msg2 "Installing Openbazaar data" + install -d $pkgdir/$appdir + cp -r ${_pkgname} $pkgdir/$appdir${_pkgname} -msg2 "Installing execution script" - install -Dm755 ${_pkgname}.sh $pkgdir/usr/bin/${_pkgname}-next + msg2 "Installing execution script" + install -Dm755 ${_pkgname}.js $pkgdir/usr/bin/${_pkgname} -msg2 "Installing icons and desktop menu entry" - install -Dm644 ${_pkgname}/imgs/icon.png "$pkgdir"/usr/share/pixmaps/${_pkgname}-next.png - install -Dm644 ${_pkgname}.desktop "$pkgdir"/usr/share/applications/${_pkgname}-next.desktop + msg2 "Installing icons and desktop menu entry" + install -Dm644 ${_pkgname}/imgs/icon.png $pkgdir/usr/share/pixmaps/${_pkgname}.png + install -Dm644 ${_pkgname}.desktop "$pkgdir"/usr/share/applications/${_pkgname}.desktop } pkgver() { @@ -48,5 +52,6 @@ pkgver() { } md5sums=('SKIP' - 'da45494abaae2de78bc1f7253facb653' - 'c73725d3737122cca0197da8fedee48f') + '122a3e23d7ecfef0a82e756cb97c3e98' + 'f48876b52eee00c24abb7bbbb53d8e6c' + '90f70698f1593b1dda1349b1353451fd') diff --git a/icons.patch b/icons.patch new file mode 100644 index 000000000000..2898c8765057 --- /dev/null +++ b/icons.patch @@ -0,0 +1,29 @@ +diff --git a/main.js b/main.js +index 69b9bd8c2..545bbe7e1 100644 +--- a/main.js ++++ b/main.js +@@ -378,8 +378,12 @@ function createWindow() { + }); + + // put logic here to set tray icon based on OS +- const osTrayIcon = 'openbazaar-mac-system-tray.png'; +- ++ if (process.platform === 'linux') { ++ var osTrayIcon = 'icon.png'; ++ } else { ++ var osTrayIcon = 'openbazaar-mac-system-tray.png'; ++ } ++ + trayMenu = new Tray(`${__dirname}/imgs/${osTrayIcon}`); + + let trayTemplate = []; +@@ -455,7 +459,7 @@ function createWindow() { + center: true, + title: 'OpenBazaar', + frame: false, +- icon: 'imgs/openbazaar-icon.png', ++ icon: process.platform === 'linux' && `${__dirname}/imgs/icon.png`, + }); + + // and load the index.html of the app. + diff --git a/openbazaar.desktop b/openbazaar.desktop index a8aeeca1bb6b..726e6406573e 100644 --- a/openbazaar.desktop +++ b/openbazaar.desktop @@ -1,11 +1,11 @@ [Desktop Entry] -Name=OpenBazaar Next -GenericName=Decentralized marketplace for trading with anyone using Bitcoin. -Comment=OpenBazaar is an open source project to create a decentralized network for commerce online—using Bitcoin—that has no fees and cannot be censored. -Exec=/usr/bin/openbazaar-next %U -Icon=openbazaar-next -Terminal=false +Name=OpenBazaar +Comment=Decentralized Peer to Peer Marketplace for Bitcoin +GenericName=OpenBazaar Desktop Client +Exec=openbazaar %U +Icon=openbazaar Type=Application +StartupNotify=true +Categories=Utility; Categories=Application;Network; MimeType=application/x-openbazaar;x-scheme-handler/ob; - diff --git a/openbazaar.js b/openbazaar.js new file mode 100755 index 000000000000..1d7a2c55b571 --- /dev/null +++ b/openbazaar.js @@ -0,0 +1,30 @@ +#!/usr/bin/electron + +const name = 'openbazaar'; + +const {app} = require('electron'); +const fs = require('fs'); +const path = require('path'); + +// Change command name. +const fd = fs.openSync('/proc/self/comm', fs.constants.O_WRONLY); +fs.writeSync(fd, name); +fs.closeSync(fd); + +// Remove first command line argument (/usr/bin/electron). +process.argv.splice(0, 1); + +// Set application paths. +const appPath = path.join(path.dirname(__dirname), 'lib', name); +const packageJson = require(path.join(appPath, 'package.json')); +const productName = packageJson.productName; +app.setAppPath(appPath); +app.setDesktopName(name + '.desktop'); +app.setName(productName); +app.setPath('userCache', path.join(app.getPath('cache'), productName)); +app.setPath('userData', path.join(app.getPath('appData'), productName)); +app.setVersion(packageJson.version); + +// Run the application. +require('module')._load(appPath, module, true); + |