Move into own folder and cleanup/instructions

Only blocking issue is needing to use yarn instead of npm
This commit is contained in:
FoxxMD
2023-03-21 11:09:25 -04:00
parent ec97ec428a
commit ddb3e0e02d
6 changed files with 74 additions and 17 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ config/*.bak
/docs
/logs
.flatpak-builder
generated-sources.json
flatpak/generated-sources.json
+1 -1
View File
@@ -126,4 +126,4 @@ src/**/**.js.map
*.bak
.flatpak-builder
generated-sources.json
flatpak/generated-sources.json
+53
View File
@@ -0,0 +1,53 @@
Flatpak build is a little convoluted until someone sets me straight...
# 1. Install Requirements
## Flatpak and flatpak-builder
Install [Flatpak](https://flatpak.org/setup/)
Install [flatpak-builder](https://docs.flatpak.org/en/latest/first-build.html#building-your-first-flatpak)
## Yarn
```console
npm install -g yarn
```
## [flatpak-node-generator](https://github.com/flatpak/flatpak-builder-tools/tree/master/node)
Requires python 3.7+, [pip](https://pip.pypa.io/en/stable/)/[pipx](https://pypa.github.io/pipx/)
##
# 1. Update Project source
Set the `branch` `tag` or `commit` to use for MS in the `git` source in [`io.github.multiscrobbler.yml`](/flatpak/io.github.multiscrobbler.yml)
# 2. Use Yarn to generate lock file
Currently [flatpak-node-generator](https://github.com/flatpak/flatpak-builder-tools/tree/master/node) does not like building from npm `package-lock.json` so we need to use yarn to create a lock file before using it. I also do not want to switch to yarn as of now because dockerfile and all docs use npm shrug.jpg
From the MS project root:
```console
yarn
```
Should generate a `yarn.lock` file
# 3. Use `flatpak-node-generator` to generate sources
From MS project root:
```
flatpak-node-generator yarn yarn.lock
```
Move `generated-sources.json` into [`/flatpak`](/flatpak)
# 4. Build flatpak
From MS project root:
flatpak-builder --repo=/tmp/multi-scrobbler-repo /tmp/multi-scrobbler-build flatpak/io.github.multiscrobbler.yml --force-clean
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="service">
<id>io.github.foxxmd.multiscrobbler</id>
<id>io.github.multiscrobbler</id>
<name>multi-scrobbler</name>
<summary>Scrobbles music from many sources to many clients</summary>
<url type="homepage">https://github.com/FoxxMD/multi-scrobbler</url>
<url type="help">https://github.com/FoxxMD/multi-scrobbler/blob/flatpak-clean/docs/configuration.md</url>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
@@ -14,7 +15,7 @@
</p>
</description>
<launchable type="service">multi-scrobbler</launchable>
<launchable type="service">io.github.multiscrobbler</launchable>
<icon type="stock">multi-scrobbler</icon>
@@ -1,4 +1,4 @@
app-id: io.github.foxxmd.multiscrobbler
app-id: io.github.multiscrobbler
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
@@ -32,6 +32,8 @@ modules:
#- ./node_modules/.bin/tsc
- cp -r node_modules/* /app/lib/node_modules
- cp -r src/* /app/lib/src
# not a desktop app (for now) so don't include this
#- install -Dm644 ../${FLATPAK_ID}.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml
- install -Dm755 ../run.sh /app/bin/multiscrobbler
subdir: main
sources:
@@ -52,8 +54,9 @@ modules:
commands:
- export CONFIG_DIR=$XDG_CONFIG_HOME
- cd /app/lib && node src/index.js
- type: file
path: io.github.multiscrobbler.appdata.xml
# not a desktop app (for now) so don't include this
# - type: file
# path: io.github.multiscrobbler.metainfo.xml
- generated-sources.json
# https://docs.flatpak.org/en/latest/electron.html
+9 -9
View File
@@ -208,9 +208,9 @@
integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==
"@types/node@*", "@types/node@>=10.0.0", "@types/node@^18.0.0":
version "18.15.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.3.tgz#f0b991c32cfc6a4e7f3399d6cb4b8cf9a0315014"
integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==
version "18.15.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.5.tgz#3af577099a99c61479149b716183e70b5239324a"
integrity sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew==
"@types/node@^12.12.54":
version "12.20.55"
@@ -218,9 +218,9 @@
integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==
"@types/node@^16.9.2":
version "16.18.16"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.16.tgz#09ff98b144abae2d7cce3e9fe9040ab2bf73222c"
integrity sha512-ZOzvDRWp8dCVBmgnkIqYCArgdFOO9YzocZp8Ra25N/RStKiWvMOXHMz+GjSeVNe5TstaTmTWPucGJkDw0XXJWA==
version "16.18.18"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.18.tgz#06cb0eeb5a0175d26d99b7acf4db613ca30cb07f"
integrity sha512-fwGw1uvQAzabxL1pyoknPlJIF2t7+K90uTqynleKRx24n3lYcxWa3+KByLhgkF8GEAK2c7hC8Ki0RkNM5H15jQ==
"@types/passport@^1.0.12":
version "1.0.12"
@@ -255,9 +255,9 @@
"@types/node" "*"
"@types/spotify-api@*":
version "0.0.20"
resolved "https://registry.yarnpkg.com/@types/spotify-api/-/spotify-api-0.0.20.tgz#04486807175f7acfba3540213b5a4ca2a8270bd7"
integrity sha512-HRBwiOthYAT0r/vUQlGlNTdXMnPg/CS3MzTuQKDy2PtalUDXhj0Ep9YZ4tXmL68K0j7FMcLFcYTzy7k7nVu5mg==
version "0.0.21"
resolved "https://registry.yarnpkg.com/@types/spotify-api/-/spotify-api-0.0.21.tgz#ebc98ee2887f50986406e883a0d4c46af60ef578"
integrity sha512-26dd63oO7sxKt48dnivb8c1hvHEtNmGWi/vesAFm55Z1NiI09ytYUyKPVY8tBMn1nNbglfGA3cGxXhlOYN6SAw==
"@types/spotify-web-api-node@^5.0.7":
version "5.0.7"