thesola10

diff to build Dweller's Empty Path Flatpak

Aug 8th, 2020 (edited)
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.97 KB | None | 0 0
  1. Right, before you begin:
  2. This diff applies to the Dwellers Empty Path folder WITHIN the archive, but your current directory when running `patch` should be OUTSIDE of the "Dwellers Empty Path" directory.
  3. Yes, you can indeed apply a diff to an entire directory. Cool, huh?
  4. After applying, to build the flatpak, first run `npm install` in the `www` directory. We need the node_modules in there.
  5. Run `dos2unix www/js/rpg_managers.js` to change the line endings in that file, we'll need to patch it and you'll get an error otherwise.
  6. You will need to have Flatpak and flatpak-builder installed on your system, and org.freedesktop.Sdk + org.freedesktop.Sdk.Extension.node12 from Flathub.
  7. Then, run `flatpak-builder build mybuilddir io.itch.tuyoki.DwellersEmptyPath.yaml`.
  8.  
  9. diff --color -ruN "Dwellers Empty Path/io.itch.tuyoki.DwellersEmptyPath.yaml" DwellerNew/io.itch.tuyoki.DwellersEmptyPath.yaml
  10. --- "Dwellers Empty Path/io.itch.tuyoki.DwellersEmptyPath.yaml" 1970-01-01 01:00:00.000000000 +0100
  11. +++ DwellerNew/io.itch.tuyoki.DwellersEmptyPath.yaml    2020-08-08 21:08:21.619488035 +0200
  12. @@ -0,0 +1,47 @@
  13. +app-id: "io.itch.tuyoki.DwellersEmptyPath"
  14. +runtime: org.freedesktop.Platform
  15. +runtime-version: '19.08'
  16. +sdk: org.freedesktop.Sdk
  17. +command: "/app/bin/Dweller"
  18. +
  19. +finish-args:
  20. +  - "--share=ipc"
  21. +  - "--socket=x11"
  22. +  - "--socket=wayland"
  23. +  - "--socket=pulseaudio"
  24. +  - "--device=dri"
  25. +  - "--persist=save"
  26. +
  27. +sdk-extensions:
  28. +  - 'org.freedesktop.Sdk.Extension.node12'
  29. +
  30. +add-extensions:
  31. +    'org.freedesktop.Platform.openh264':
  32. +        directory: "lib"
  33. +        version: '19.08'
  34. +
  35. +modules:
  36. +  - name: "nodejs"
  37. +    buildsystem: simple
  38. +    build-commands:
  39. +      - "/usr/lib/sdk/node12/install.sh"
  40. +      - "mkdir -p /app/bin"
  41. +      - "mv /app/node/bin/node /app/bin/node"
  42. +  - name: "game"
  43. +    buildsystem: simple
  44. +    build-commands:
  45. +      - "patch share/game/js/rpg_managers.js rpg_managers.js.patch"
  46. +      - "ln -s fonts share/game/Fonts"
  47. +      - "mkdir -p /app/lib"
  48. +      - "cp -r share /app/"
  49. +      - "install -D -m 755 share/run.sh /app/bin/Dweller"
  50. +      - "install -D share/game/icon/icon.png /app/share/icons/hicolor/128x128/apps/io.itch.tuyoki.DwellersEmptyPath.png"
  51. +    sources:
  52. +      - type: dir
  53. +        path: "static/linux"
  54. +        dest: "share"
  55. +      - type: dir
  56. +        path: "www"
  57. +        dest: "share/game"
  58. +      - type: file
  59. +        path: "rpg_managers.js.patch"
  60. diff --color -ruN "Dwellers Empty Path/package.json" DwellerNew/package.json
  61. --- "Dwellers Empty Path/package.json"  2018-10-25 15:10:48.000000000 +0200
  62. +++ DwellerNew/package.json 2020-08-08 21:36:41.928939488 +0200
  63. @@ -1,12 +1,18 @@
  64.  {
  65. -    "name": "",
  66. +    "name": "dwellers_empty_path",
  67.      "main": "www/index.html",
  68.      "js-flags": "--expose-gc",
  69.      "window": {
  70. -        "title": "",
  71. +        "title": "Dweller's Empty Path",
  72.          "toolbar": false,
  73.          "width": 816,
  74.          "height": 624,
  75.          "icon": "www/icon/icon.png"
  76. +    },
  77. +    "dependencies": {
  78. +        "nw": "^0.47.2"
  79. +    },
  80. +    "scripts": {
  81. +        "start": "nw"
  82.      }
  83.  }
  84. diff --color -ruN "Dwellers Empty Path/rpg_managers.js.patch" DwellerNew/rpg_managers.js.patch
  85. --- "Dwellers Empty Path/rpg_managers.js.patch" 1970-01-01 01:00:00.000000000 +0100
  86. +++ DwellerNew/rpg_managers.js.patch    2020-08-08 21:07:02.872213246 +0200
  87. @@ -0,0 +1,11 @@
  88. +--- www/js/rpg_managers.js 2020-08-07 18:54:46.931909235 +0200
  89. ++++ rpg_managers.js    2020-08-07 18:58:29.999573577 +0200
  90. +@@ -755,7 +755,7 @@
  91. + StorageManager.localFileDirectoryPath = function() {
  92. +     var path = require('path');
  93. +
  94. +-    var base = path.dirname(process.mainModule.filename);
  95. ++    var base = require('os').homedir();
  96. +     return path.join(base, 'save/');
  97. + };
  98. +
  99. diff --color -ruN "Dwellers Empty Path/static/linux/applications/io.itch.tuyoki.DwellersEmptyPath.desktop" DwellerNew/static/linux/applications/io.itch.tuyoki.DwellersEmptyPath.desktop
  100. --- "Dwellers Empty Path/static/linux/applications/io.itch.tuyoki.DwellersEmptyPath.desktop"    1970-01-01 01:00:00.000000000 +0100
  101. +++ DwellerNew/static/linux/applications/io.itch.tuyoki.DwellersEmptyPath.desktop   2020-08-08 21:11:04.841172719 +0200
  102. @@ -0,0 +1,7 @@
  103. +[Desktop Entry]
  104. +Name=Dweller's Empty Path
  105. +Comment=A small RPGMaker game exploring the life of a lost being from another world.
  106. +Exec=/app/bin/Dweller
  107. +Icon=io.itch.tuyoki.DwellersEmptyPath
  108. +Categories=Game
  109. +Type=Application
  110. diff --color -ruN "Dwellers Empty Path/static/linux/metainfo/io.itch.tuyoki.DwellersEmptyPath.metainfo.xml" DwellerNew/static/linux/metainfo/io.itch.tuyoki.DwellersEmptyPath.metainfo.xml
  111. --- "Dwellers Empty Path/static/linux/metainfo/io.itch.tuyoki.DwellersEmptyPath.metainfo.xml"   1970-01-01 01:00:00.000000000 +0100
  112. +++ DwellerNew/static/linux/metainfo/io.itch.tuyoki.DwellersEmptyPath.metainfo.xml  2020-08-08 21:13:20.063530217 +0200
  113. @@ -0,0 +1,26 @@
  114. +<?xml version="1.0" encoding="UTF-8"?>
  115. +
  116. +<component type="desktop-application">
  117. +    <name>Dweller's Empty Path</name>
  118. +    <id>io.itch.tuyoki.DwellersEmptyPath</id>
  119. +    <launchable type="desktop-id">io.itch.tuyoki.DwellersEmptyPath.desktop</launchable>
  120. +    <metadata_license>CC0-1.0</metadata_license>
  121. +    <project_license>LicenseRef-proprietary</project_license>
  122. +    <summary>A small RPGMaker game exploring the life of a lost being from another world.</summary>
  123. +
  124. +    <description>
  125. +        <p>Yoki wakes up from a nightmare and has some difficulty falling back asleep, so she decides to go on a short walk to clear her mind.</p>
  126. +        <p>As you play as Yoki, you can choose to end the game at any time by returning to her bed and attempt another shot at getting some much needed rest.</p>
  127. +    </description>
  128. +
  129. +    <url type="homepage">https://tuyoki.itch.io/dwellers-empty-path</url>
  130. +
  131. +    <developer_name>Temmie Chang</developer_name>
  132. +
  133. +    <provides>
  134. +        <binary>Dweller</binary>
  135. +    </provides>
  136. +    <releases>
  137. +        <release version="1.0" date="2020-07-14"/>
  138. +    </releases>
  139. +</component>
  140. diff --color -ruN "Dwellers Empty Path/static/linux/run.sh" DwellerNew/static/linux/run.sh
  141. --- "Dwellers Empty Path/static/linux/run.sh"   1970-01-01 01:00:00.000000000 +0100
  142. +++ DwellerNew/static/linux/run.sh  2020-08-08 21:06:55.432601443 +0200
  143. @@ -0,0 +1,2 @@
  144. +#!/bin/bash
  145. +exec /app/share/game/node_modules/nw/bin/nw /app/share/game
  146. diff --color -ruN "Dwellers Empty Path/www/package.json" DwellerNew/www/package.json
  147. --- "Dwellers Empty Path/www/package.json"  2019-10-08 13:29:54.000000000 +0200
  148. +++ DwellerNew/www/package.json 2020-08-08 21:36:50.028221303 +0200
  149. @@ -1,12 +1,18 @@
  150.  {
  151. -    "name": "",
  152. +    "name": "dwellers_empty_path",
  153.      "main": "index.html",
  154.      "js-flags": "--expose-gc",
  155.      "window": {
  156. -        "title": "",
  157. +        "title": "Dweller's Empty Path",
  158.          "toolbar": false,
  159.          "width": 816,
  160.          "height": 624,
  161.          "icon": "icon/icon.png"
  162. +    },
  163. +    "dependencies": {
  164. +        "nw": "^0.47.2"
  165. +    },
  166. +    "scripts": {
  167. +        "start": "nw"
  168.      }
  169.  }
  170.  
Add Comment
Please, Sign In to add comment