SnosMe / awakened-poe-trade

:heavy_dollar_sign: :hammer: Path of Exile trading app for price checking
https://snosme.github.io/awakened-poe-trade/download
MIT License
1.97k stars 423 forks source link

Trying to make a PKGBUILD for AUR #1254

Open binarydepth opened 6 months ago

binarydepth commented 6 months ago

I prefer to build from source, and trying to make the PKGBUILD. What is missing/wrong?

_npmname="awakened-poe-trade"
pkgname=awakened-poe-trade
pkgver=3.23.10003
pkgrel=1
pkgdesc="Path Of Exile trading price check tool"
arch=('x86_64')
url="https://github.com/SnosMe/awakened-poe-trade"
license=('MIT')

makedepends=('typescript' 'yarn' 'nodejs' 'npm')

source=("$pkgname-$pkgver.tar.gz::https://github.com/SnosMe/awakened-poe-trade/archive/v$pkgver.tar.gz")
sha512sums=('a80d3482b354cccc2bc22915def57f5b421cc6787179267a61ad05f46358645192e7333cb61f46657751f4dc688c5c61e436592bacfdb7482472be846dc50acf')

build() {

  cd "$srcdir/$_npmname-$pkgver"  # Change into the source directory

  # Install missing type definitions
  npm ci --no-optional --no-audit --save-dev @types/node
  npm ci --no-optional --no-audit --save-dev @types/electron
  npm ci --no-optional --no-audit --save-dev @types/uiohook-napi

  # Install dependencies
  npm ci --no-optional --no-audit

  cd "$srcdir/$pkgname-$pkgver/renderer"
  yarn install
  yarn make-index-files
  yarn build

  cd "$srcdir/$pkgname-$pkgver/main"
  yarn build

  # Sign with a distribution certificate.
  # We want to sign with a distribution certificate to ensure other users can
  # install without errors
  CSC_NAME="Certificate name in Keychain" yarn package
}

package() {
  install -Dm755 "$srcdir/Awakened PoE Trade-$pkgver.AppImage" "$pkgdir/usr/bin/Awakened_PoE_Trade"
  install -Dm644 "$srcdir/awakened-poe-trade-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
SnosMe commented 6 months ago
  cd "$srcdir/$pkgname-$pkgver/main"
  yarn build

didn't install deps here too?

binarydepth commented 6 months ago

Ok this build() works as per instruction but the Fuse image is not correct. Can you provide instructions for package()

build() {
  cd "$srcdir/$pkgname-$pkgver"  # Change into the source directory

  # Install missing type definitions
  npm install --no-optional --no-audit --save-dev @types/node
  npm install --no-optional --no-audit --save-dev @types/electron
  npm install --no-optional --no-audit --save-dev uiohook-napi

  # Install dependencies
  npm install --no-optional --no-audit --no-fund

  cd "$srcdir/$pkgname-$pkgver/renderer"
  yarn install
  yarn make-index-files
  yarn build

  cd "$srcdir/$pkgname-$pkgver/main"
  yarn install
  yarn build

  # Sign with a distribution certificate.
  # We want to sign with a distribution certificate to ensure other users can
  # install without errors
  CSC_NAME="Certificate name in Keychain" yarn package
}
SnosMe commented 6 months ago

sry, I have no clue how packaging in arch works. any existing packages have no connection with me

binarydepth commented 6 months ago

This shell script works and you just have to inform about build packages tar typescript'yarn nodejs npm and electron-builder (from AUR in my case) and that the AppImage is on awakened-poe-trade/awakened-poe-trade-3.23.10003/main/dist/ (I changed it to put the AppImage on the root folder)

And a shell script makes more sense than using AUR

#!/bin/sh

VERSION=3.23.10003

wget https://github.com/SnosMe/awakened-poe-trade/archive/refs/tags/v$VERSION.tar.gz && tar -xvf v$VERSION.tar.gz && cd awakened-poe-trade-$VERSION
npm ci --no-optional --no-audit --save-dev @types/node
npm ci --no-optional --no-audit --save-dev @types/electron
npm ci --no-optional --no-audit --save-dev @types/uiohook-nap
npm ci --no-optional --no-audit
cd renderer
yarn install
yarn make-index-files
yarn build

cd ../main
yarn install
yarn build
# We want to sign with a distribution certificate to ensure other users can
# install without errors
CSC_NAME="Certificate name in Keychain" yarn package

cd dist
mv "Awakened PoE Trade-3.23.10003.AppImage" ../../..
NINNiT commented 6 months ago

@binarydepth

I'm maintaining the awakened-poe-trade-git AUR package, if you'd like to take a look at my PKGBUILD. Link to AUR

It will always build from the latest commit on the master branch.