summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Parreira2022-11-28 20:35:19 +0000
committerGustavo Parreira2022-11-28 20:43:19 +0000
commitd8b7874b568a95441a626b05b3b1ca915efbdc67 (patch)
treebdd696b892c208ec2c00e9fec2d351e7905b1591
downloadaur-d8b7874b568a95441a626b05b3b1ca915efbdc67.tar.gz
chore: initial release
-rw-r--r--.SRCINFO32
-rw-r--r--128x128.pngbin0 -> 19763 bytes
-rw-r--r--16x16.pngbin0 -> 1143 bytes
-rw-r--r--256x256.pngbin0 -> 58269 bytes
-rw-r--r--32x32.pngbin0 -> 2258 bytes
-rw-r--r--48x48.pngbin0 -> 4112 bytes
-rw-r--r--64x64.pngbin0 -> 6437 bytes
-rw-r--r--Dead-by-Daylight-Icon-Toolbox.desktop9
-rw-r--r--PKGBUILD87
-rw-r--r--linux-support.patch359
10 files changed, 487 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..07648a14af84
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = dbd-icon-toolbox-git
+ pkgdesc = Application for browsing/installing custom Dead by Daylight Perks/Icons/Char Portraits
+ pkgver = v2.8.4.r0.g7d83022
+ pkgrel = 1
+ url = https://github.com/nrcrast/DbdPerkTool
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = yarn
+ makedepends = nvm
+ provides = dbd-icon-toolbox
+ conflicts = dbd-icon-toolbox
+ source = dbd-icon-toolbox-git::git+https://github.com/nrcrast/DbdPerkTool.git
+ source = Dead-by-Daylight-Icon-Toolbox.desktop
+ source = linux-support.patch
+ source = 16x16.png
+ source = 32x32.png
+ source = 48x48.png
+ source = 64x64.png
+ source = 128x128.png
+ source = 256x256.png
+ sha256sums = SKIP
+ sha256sums = cea0d489bf7840398ab3c9ca12f6025055798c029da4b00061daaddae54e3365
+ sha256sums = 31e4d9908c8ee4b378fdb15093b33015cd5f3e4028a510fb6b3858ed10a579ca
+ sha256sums = 1779077f3baa180f06c10d243072483e41195926d7a6deae39f2227c1d067205
+ sha256sums = 63558e3f9b4b461c873cb7f692a12ef45ed755e80818bcdae5b6982cf40bbbc6
+ sha256sums = 561cb8dd13bcd7f3c3b2a715dac96cdd2115c2cb095010d19bb268fc19bf733e
+ sha256sums = d047b05d8b6de32a3c519028083c9124e20da052ac1dad938cc077f1fe33d3e7
+ sha256sums = c7fcdcf453d37aa4f1bd6a349ee0e36de13792be25aa982ae16810cbeb5c95ae
+ sha256sums = 36bd5df3142bcb0c335768f9b0ed192371086316d497b892324e839d839addfd
+
+pkgname = dbd-icon-toolbox-git
diff --git a/128x128.png b/128x128.png
new file mode 100644
index 000000000000..cf776456ef99
--- /dev/null
+++ b/128x128.png
Binary files differ
diff --git a/16x16.png b/16x16.png
new file mode 100644
index 000000000000..bbc2737695fb
--- /dev/null
+++ b/16x16.png
Binary files differ
diff --git a/256x256.png b/256x256.png
new file mode 100644
index 000000000000..353a54bc8972
--- /dev/null
+++ b/256x256.png
Binary files differ
diff --git a/32x32.png b/32x32.png
new file mode 100644
index 000000000000..60187746cea2
--- /dev/null
+++ b/32x32.png
Binary files differ
diff --git a/48x48.png b/48x48.png
new file mode 100644
index 000000000000..fdb68cdbeb3d
--- /dev/null
+++ b/48x48.png
Binary files differ
diff --git a/64x64.png b/64x64.png
new file mode 100644
index 000000000000..a81771420168
--- /dev/null
+++ b/64x64.png
Binary files differ
diff --git a/Dead-by-Daylight-Icon-Toolbox.desktop b/Dead-by-Daylight-Icon-Toolbox.desktop
new file mode 100644
index 000000000000..aea02b37cc90
--- /dev/null
+++ b/Dead-by-Daylight-Icon-Toolbox.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Dead By Daylight Icon Toolbox
+Exec="/usr/lib/dbd-icon-toolbox/dbdicontoolbox" %U
+Terminal=false
+Type=Application
+Icon=dbdicontoolbox
+StartupWMClass=Dead By Daylight Icon Toolbox
+Comment=Dead By Daylight Icon Toolbox
+Categories=Utility;
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..96101d42df3f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,87 @@
+# Maintainer: Gustavo Parreira <gustavotcparreira at gmail dot com>
+_basename=dbd-icon-toolbox
+_nodeversion=14
+pkgname="$_basename-git"
+pkgver=v2.8.4.r0.g7d83022
+pkgrel=1
+pkgdesc="Application for browsing/installing custom Dead by Daylight Perks/Icons/Char Portraits"
+arch=(x86_64)
+url=https://github.com/nrcrast/DbdPerkTool
+license=(MIT)
+groups=()
+depends=()
+makedepends=(git yarn nvm)
+provides=("$_basename")
+conflicts=("$_basename")
+source=("$pkgname::git+https://github.com/nrcrast/DbdPerkTool.git"
+ Dead-by-Daylight-Icon-Toolbox.desktop
+ linux-support.patch
+ 16x16.png
+ 32x32.png
+ 48x48.png
+ 64x64.png
+ 128x128.png
+ 256x256.png)
+sha256sums=('SKIP'
+ 'cea0d489bf7840398ab3c9ca12f6025055798c029da4b00061daaddae54e3365'
+ '31e4d9908c8ee4b378fdb15093b33015cd5f3e4028a510fb6b3858ed10a579ca'
+ '1779077f3baa180f06c10d243072483e41195926d7a6deae39f2227c1d067205'
+ '63558e3f9b4b461c873cb7f692a12ef45ed755e80818bcdae5b6982cf40bbbc6'
+ '561cb8dd13bcd7f3c3b2a715dac96cdd2115c2cb095010d19bb268fc19bf733e'
+ 'd047b05d8b6de32a3c519028083c9124e20da052ac1dad938cc077f1fe33d3e7'
+ 'c7fcdcf453d37aa4f1bd6a349ee0e36de13792be25aa982ae16810cbeb5c95ae'
+ '36bd5df3142bcb0c335768f9b0ed192371086316d497b892324e839d839addfd')
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "$srcdir/$pkgname"
+ export npm_config_cache="$srcdir/npm_cache"
+ _ensure_local_nvm
+ nvm install $_nodeversion
+
+ patch -p1 < "$srcdir"/linux-support.patch
+ # Copy png icons
+ for i in 16 32 48 64 128 256; do
+ cp "$srcdir"/${i}x${i}.png resources
+ done
+}
+
+build() {
+ cd "$srcdir/$pkgname"
+
+ nvm use $_nodeversion
+ yarn
+ yarn package-linux --dir
+}
+
+package() {
+ cd "$srcdir/$pkgname"
+
+ install -d "$pkgdir"/usr/lib/$_basename
+
+ cp -r release/linux-unpacked/. "$pkgdir"/usr/lib/$_basename
+
+ install -Dm644 ../Dead-by-Daylight-Icon-Toolbox.desktop -t "$pkgdir"/usr/share/applications/
+
+ # Icons
+ install -Dm644 resources/256x256.png "$pkgdir"/usr/share/icons/hicolor/scalable/apps/dbdicontoolbox.png
+ for i in 16 32 48 64 128 256; do
+ install -Dm644 resources/${i}x${i}.png "$pkgdir"/usr/share/icons/hicolor/${i}x${i}/apps/dbdicontoolbox.png
+ done
+}
+
+# https://wiki.archlinux.org/title/Node.js_package_guidelines#Using_nvm
+_ensure_local_nvm() {
+ # let's be sure we are starting clean
+ which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
+ export NVM_DIR="${srcdir}/.nvm"
+
+ # The init script returns 3 if version specified
+ # in ./.nvrc is not (yet) installed in $NVM_DIR
+ # but nvm itself still gets loaded ok
+ source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
+}
diff --git a/linux-support.patch b/linux-support.patch
new file mode 100644
index 000000000000..231add8837d7
--- /dev/null
+++ b/linux-support.patch
@@ -0,0 +1,359 @@
+From c684eba5a4946082ada8bd1349755b24c4ad3b9d Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 19:31:36 +0000
+Subject: [PATCH 1/8] fix: linux crash due to GPU process
+
+---
+ app/main.dev.ts | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/app/main.dev.ts b/app/main.dev.ts
+index 31825ef..8e65f5b 100644
+--- a/app/main.dev.ts
++++ b/app/main.dev.ts
+@@ -16,6 +16,7 @@ import MenuBuilder from './menu';
+ import axios from 'axios';
+ import { FileDownloader } from './utils/FileDownloader';
+ import { IpcCommandHandler, registerIpcCommands } from './ipc-commands';
++import os from 'os';
+ const { ipcMain: ipc } = require('electron-better-ipc');
+ const WIN32 = process.platform === 'win32';
+
+@@ -23,6 +24,10 @@ axios.defaults.adapter = require('axios/lib/adapters/http');
+
+ const gotTheLock = app.requestSingleInstanceLock();
+ app.allowRendererProcessReuse = false;
++if (os.platform() === 'linux') {
++ // Avoid GPU not usable error in linux
++ app.commandLine.appendSwitch('in-process-gpu');
++}
+
+ let mainWindow: BrowserWindow | null = null;
+ let ipcHandler = new IpcCommandHandler();
+--
+2.38.1
+
+
+From 1e81f91100ffb40b96bfa3690460a7dab66b3db6 Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 19:35:19 +0000
+Subject: [PATCH 2/8] fix: normalize paths diffently for DOS and Unix
+
+---
+ app/steam/DeadByDaylight.ts | 7 ++++++-
+ app/steam/PlatformSupport.ts | 16 ++++++++++++++++
+ app/steam/Steam.ts | 5 +++--
+ 3 files changed, 25 insertions(+), 3 deletions(-)
+ create mode 100644 app/steam/PlatformSupport.ts
+
+diff --git a/app/steam/DeadByDaylight.ts b/app/steam/DeadByDaylight.ts
+index 982bdc5..d20586f 100644
+--- a/app/steam/DeadByDaylight.ts
++++ b/app/steam/DeadByDaylight.ts
+@@ -2,6 +2,7 @@ import SteamApp from './SteamApp';
+ import fs from 'fs-extra';
+ import logger from 'electron-log';
+ import path from 'path';
++import PlatformSupport from './PlatformSupport';
+
+ const DEFAULT_DBD_DIRS = ['C:\\Program Files (x86)\\Steam\\steamapps\\common\\Dead by Daylight', 'C:\\Program Files\\Steam\\steamapps\\common\\Dead by Daylight']
+
+@@ -62,6 +63,10 @@ export default class DeadByDaylight {
+ logger.info('DBD installation found in registry: ' + dbdPath);
+ }
+
+- return dbdPath?.toLowerCase();
++ if (dbdPath) {
++ return PlatformSupport.normalizePath(dbdPath);
++ }
++
++ return null;
+ }
+ }
+diff --git a/app/steam/PlatformSupport.ts b/app/steam/PlatformSupport.ts
+new file mode 100644
+index 0000000..2eea9b2
+--- /dev/null
++++ b/app/steam/PlatformSupport.ts
+@@ -0,0 +1,16 @@
++import os from 'os';
++
++export default class PlatformSupport {
++ /**
++ * While Windows and DOS systems use case-insensitive file systems, Unix systems like Linux are case-sensitive.
++ * This function will normalize folder paths so they're only lowercased on Windows systems.
++ */
++ static normalizePath(path: string) {
++ switch (os.platform()) {
++ case 'win32':
++ return path.toLowerCase();
++ default:
++ return path;
++ }
++ }
++}
+\ No newline at end of file
+diff --git a/app/steam/Steam.ts b/app/steam/Steam.ts
+index fa92cb1..f0d979e 100644
+--- a/app/steam/Steam.ts
++++ b/app/steam/Steam.ts
+@@ -3,6 +3,7 @@ import Registry from 'winreg';
+ import fs from 'fs';
+ import vdf from 'node-vdf';
+ import path from 'path';
++import PlatformSupport from './PlatformSupport';
+
+ const readFileAsync = promisify(fs.readFile);
+
+@@ -24,8 +25,8 @@ class Steam {
+ Object.keys(manifest[libFolderKey]).forEach(folder => {
+ if (isNumeric(folder)) {
+ const steamPath = path.resolve(manifest[libFolderKey][folder].path ?? manifest[libFolderKey][folder]);
+- if(steamPath && !folders.includes(steamPath.toLowerCase())) {
+- folders.push(steamPath.toLowerCase());
++ if(steamPath && !folders.includes(PlatformSupport.normalizePath(steamPath))) {
++ folders.push(PlatformSupport.normalizePath(steamPath));
+ }
+ }
+ });
+--
+2.38.1
+
+
+From f40bad72eb842faabdfd4fbfcea79164a015f833 Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 19:36:36 +0000
+Subject: [PATCH 3/8] feat: finding install path for Steam in Linux
+
+---
+ app/steam/Steam.ts | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/app/steam/Steam.ts b/app/steam/Steam.ts
+index f0d979e..d5a3296 100644
+--- a/app/steam/Steam.ts
++++ b/app/steam/Steam.ts
+@@ -3,6 +3,8 @@ import Registry from 'winreg';
+ import fs from 'fs';
+ import vdf from 'node-vdf';
+ import path from 'path';
++import { remote } from 'electron';
++import os from 'os';
+ import PlatformSupport from './PlatformSupport';
+
+ const readFileAsync = promisify(fs.readFile);
+@@ -36,6 +38,10 @@ class Steam {
+ }
+
+ static async getInstallPath() {
++ if (os.platform() === 'linux') {
++ return Steam._getInstallPathLinux();
++ }
++
+ let regKey = new Registry({
+ hive: Registry.HKCU,
+ key: '\\Software\\Valve\\Steam\\'
+@@ -57,6 +63,12 @@ class Steam {
+ return keyValue.value;
+ }
+ }
++
++ static _getInstallPathLinux() {
++ // TODO: Support Flatpak
++ const homeFolder = remote.app.getPath('home');
++ return `${homeFolder}/.steam/steam`;
++ }
+ }
+
+ export default Steam;
+--
+2.38.1
+
+
+From 2c50bf03bcb110e8e477c8e68dde7ea69ebbb65a Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 19:40:28 +0000
+Subject: [PATCH 4/8] fix: missing newline
+
+---
+ app/steam/PlatformSupport.ts | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/app/steam/PlatformSupport.ts b/app/steam/PlatformSupport.ts
+index 2eea9b2..feef849 100644
+--- a/app/steam/PlatformSupport.ts
++++ b/app/steam/PlatformSupport.ts
+@@ -2,7 +2,8 @@ import os from 'os';
+
+ export default class PlatformSupport {
+ /**
+- * While Windows and DOS systems use case-insensitive file systems, Unix systems like Linux are case-sensitive.
++ * While Windows and DOS systems use case-insensitive file systems,
++ * Unix systems like Linux are case-sensitive.
+ * This function will normalize folder paths so they're only lowercased on Windows systems.
+ */
+ static normalizePath(path: string) {
+@@ -13,4 +14,4 @@ export default class PlatformSupport {
+ return path;
+ }
+ }
+-}
+\ No newline at end of file
++}
+--
+2.38.1
+
+
+From d1ad50316d692803a89b07596ab7cd476bdc3cff Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 20:05:41 +0000
+Subject: [PATCH 5/8] refactor: changed platform check for consistency
+
+---
+ app/main.dev.ts | 4 ++--
+ app/steam/PlatformSupport.ts | 4 +---
+ app/steam/Steam.ts | 2 +-
+ 3 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/app/main.dev.ts b/app/main.dev.ts
+index 8e65f5b..9be77db 100644
+--- a/app/main.dev.ts
++++ b/app/main.dev.ts
+@@ -16,15 +16,15 @@ import MenuBuilder from './menu';
+ import axios from 'axios';
+ import { FileDownloader } from './utils/FileDownloader';
+ import { IpcCommandHandler, registerIpcCommands } from './ipc-commands';
+-import os from 'os';
+ const { ipcMain: ipc } = require('electron-better-ipc');
+ const WIN32 = process.platform === 'win32';
++const LINUX = process.platform === 'linux';
+
+ axios.defaults.adapter = require('axios/lib/adapters/http');
+
+ const gotTheLock = app.requestSingleInstanceLock();
+ app.allowRendererProcessReuse = false;
+-if (os.platform() === 'linux') {
++if (LINUX) {
+ // Avoid GPU not usable error in linux
+ app.commandLine.appendSwitch('in-process-gpu');
+ }
+diff --git a/app/steam/PlatformSupport.ts b/app/steam/PlatformSupport.ts
+index feef849..529e18e 100644
+--- a/app/steam/PlatformSupport.ts
++++ b/app/steam/PlatformSupport.ts
+@@ -1,5 +1,3 @@
+-import os from 'os';
+-
+ export default class PlatformSupport {
+ /**
+ * While Windows and DOS systems use case-insensitive file systems,
+@@ -7,7 +5,7 @@ export default class PlatformSupport {
+ * This function will normalize folder paths so they're only lowercased on Windows systems.
+ */
+ static normalizePath(path: string) {
+- switch (os.platform()) {
++ switch (process.platform) {
+ case 'win32':
+ return path.toLowerCase();
+ default:
+diff --git a/app/steam/Steam.ts b/app/steam/Steam.ts
+index d5a3296..91864bf 100644
+--- a/app/steam/Steam.ts
++++ b/app/steam/Steam.ts
+@@ -38,7 +38,7 @@ class Steam {
+ }
+
+ static async getInstallPath() {
+- if (os.platform() === 'linux') {
++ if (process.platform === 'linux') {
+ return Steam._getInstallPathLinux();
+ }
+
+--
+2.38.1
+
+
+From ddf6e77bed238ee2af0a8ad04596b968680c8226 Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 20:07:46 +0000
+Subject: [PATCH 6/8] fix: removed unused import
+
+---
+ app/steam/Steam.ts | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/app/steam/Steam.ts b/app/steam/Steam.ts
+index 91864bf..582a9dc 100644
+--- a/app/steam/Steam.ts
++++ b/app/steam/Steam.ts
+@@ -4,7 +4,6 @@ import fs from 'fs';
+ import vdf from 'node-vdf';
+ import path from 'path';
+ import { remote } from 'electron';
+-import os from 'os';
+ import PlatformSupport from './PlatformSupport';
+
+ const readFileAsync = promisify(fs.readFile);
+--
+2.38.1
+
+
+From 46896b34734c9805a865a22d7bed4dab130e4c24 Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Fri, 25 Nov 2022 20:10:07 +0000
+Subject: [PATCH 7/8] refactor: saner path join
+
+---
+ app/steam/Steam.ts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/app/steam/Steam.ts b/app/steam/Steam.ts
+index 582a9dc..dac1b61 100644
+--- a/app/steam/Steam.ts
++++ b/app/steam/Steam.ts
+@@ -66,7 +66,7 @@ class Steam {
+ static _getInstallPathLinux() {
+ // TODO: Support Flatpak
+ const homeFolder = remote.app.getPath('home');
+- return `${homeFolder}/.steam/steam`;
++ return path.join(homeFolder, '.steam/steam');
+ }
+ }
+
+--
+2.38.1
+
+
+From ed880886b03a89a5c7a304ffae2d4154cb0b088b Mon Sep 17 00:00:00 2001
+From: Gustavo Parreira <gustavotcparreira@gmail.com>
+Date: Mon, 28 Nov 2022 19:58:39 +0000
+Subject: [PATCH 8/8] feat: linux build options
+
+---
+ package.json | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/package.json b/package.json
+index 8787eaf..2ceb223 100644
+--- a/package.json
++++ b/package.json
+@@ -77,6 +77,16 @@
+ "msi"
+ ]
+ },
++ "linux": {
++ "category": "Utility",
++ "icon": "resources",
++ "target": [
++ "AppImage",
++ "deb",
++ "rpm",
++ "tar.gz"
++ ]
++ },
+ "directories": {
+ "buildResources": "resources",
+ "output": "release"
+--
+2.38.1
+