koodo-reader: init at 1.6.6

TomaSajt 07fcd33b 65d8de75

+571
+13
pkgs/by-name/ko/koodo-reader/fix-isdev.patch
··· 1 + diff --git a/main.js b/main.js 2 + index a4b5c8ef..743d63ca 100644 3 + --- a/main.js 4 + +++ b/main.js 5 + @@ -8,7 +8,7 @@ const { 6 + nativeTheme, 7 + } = require("electron"); 8 + const path = require("path"); 9 + -const isDev = require("electron-is-dev"); 10 + +const isDev = false; 11 + const Store = require("electron-store"); 12 + const store = new Store(); 13 + const fs = require("fs");
+58
pkgs/by-name/ko/koodo-reader/mime-types.xml
··· 1 + <?xml version="1.0" encoding="utf-8"?> 2 + <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> 3 + <mime-type type="application/epub+zip"> 4 + <glob pattern="*.epub"/> 5 + 6 + <icon name="x-office-document" /> 7 + </mime-type> 8 + <mime-type type="application/pdf"> 9 + <glob pattern="*.pdf"/> 10 + 11 + <icon name="x-office-document" /> 12 + </mime-type> 13 + <mime-type type="image/vnd.djvu"> 14 + <glob pattern="*.djvu"/> 15 + 16 + <icon name="x-office-document" /> 17 + </mime-type> 18 + <mime-type type="application/x-mobipocket-ebook"> 19 + <glob pattern="*.mobi"/> 20 + 21 + <icon name="x-office-document" /> 22 + </mime-type> 23 + <mime-type type="application/vnd.amazon.ebook"> 24 + <glob pattern="*.azw3"/> 25 + 26 + <icon name="x-office-document" /> 27 + </mime-type> 28 + <mime-type type="application/vnd.amazon.ebook"> 29 + <glob pattern="*.azw"/> 30 + 31 + <icon name="x-office-document" /> 32 + </mime-type> 33 + <mime-type type="application/x-cbz"> 34 + <glob pattern="*.cbz"/> 35 + 36 + <icon name="x-office-document" /> 37 + </mime-type> 38 + <mime-type type="application/x-cbr"> 39 + <glob pattern="*.cbr"/> 40 + 41 + <icon name="x-office-document" /> 42 + </mime-type> 43 + <mime-type type="application/x-cbt"> 44 + <glob pattern="*.cbt"/> 45 + 46 + <icon name="x-office-document" /> 47 + </mime-type> 48 + <mime-type type="application/x-cb7"> 49 + <glob pattern="*.cb7"/> 50 + 51 + <icon name="x-office-document" /> 52 + </mime-type> 53 + <mime-type type="application/x-fictionbook+xml"> 54 + <glob pattern="*.fb2"/> 55 + 56 + <icon name="x-office-document" /> 57 + </mime-type> 58 + </mime-info>
+312
pkgs/by-name/ko/koodo-reader/package.json
··· 1 + { 2 + "name": "koodo-reader", 3 + "main": "main.js", 4 + "version": "1.6.6", 5 + "description": "A cross-platform ebook reader", 6 + "author": { 7 + "name": "App by Troye", 8 + "email": "support@960960.xyz" 9 + }, 10 + "engines": { 11 + "node": ">=18.0.0", 12 + "npm": ">=6.0.0" 13 + }, 14 + "repository": "https://github.com/koodo-reader/koodo-reader", 15 + "private": false, 16 + "resolutions": { 17 + "//": "See https://github.com/facebook/create-react-app/issues/11773", 18 + "react-error-overlay": "6.0.9" 19 + }, 20 + "dependencies": { 21 + "@aws-sdk/client-s3": "^3.485.0", 22 + "adm-zip": "^0.5.2", 23 + "axios": "^0.19.2", 24 + "buffer": "^6.0.3", 25 + "copy-text-to-clipboard": "^2.2.0", 26 + "dompurify": "^3.0.1", 27 + "electron-is-dev": "^1.1.0", 28 + "electron-store": "^8.0.1", 29 + "font-list": "^1.4.5", 30 + "fs-extra": "^9.1.0", 31 + "ftp": "^0.3.10", 32 + "howler": "^2.2.3", 33 + "iconv-lite": "^0.6.3", 34 + "qs": "^6.11.2", 35 + "react-hot-toast": "^2.1.1", 36 + "react-tooltip": "^5.26.3", 37 + "ssh2-sftp-client": "^9.1.0", 38 + "webdav": "^3.6.2", 39 + "wink-lemmatizer": "^3.0.4", 40 + "ws": "^8.13.0", 41 + "zip-a-folder": "^0.0.12" 42 + }, 43 + "devDependencies": { 44 + "@types/i18next": "^13.0.0", 45 + "@types/iconv-lite": "^0.0.1", 46 + "@types/node": "^13.13.2", 47 + "@types/react": "17.0.2", 48 + "@types/react-dom": "17.0.2", 49 + "@types/react-i18next": "^8.1.0", 50 + "@types/react-lottie": "^1.2.5", 51 + "@types/react-redux": "^7.1.7", 52 + "@types/react-router-dom": "^5.1.6", 53 + "@types/spark-md5": "^3.0.2", 54 + "@types/ws": "^8.5.5", 55 + "classnames": "^2.2.6", 56 + "concurrently": "^5.0.1", 57 + "cross-env": "^6.0.3", 58 + "electron": "14.1.1", 59 + "electron-builder": "^23.6.0", 60 + "hard-source-webpack-plugin": "^0.13.1", 61 + "html-react-parser": "^0.13.0", 62 + "i18next": "^20.2.4", 63 + "node-sass": "^9.0.0", 64 + "nodemon": "^2.0.6", 65 + "rc-color-picker": "^1.2.6", 66 + "react": "^17.0.2", 67 + "react-device-detect": "^1.12.1", 68 + "react-dom": "^17.0.2", 69 + "react-dropzone": "^11.3.0", 70 + "react-i18next": "^13.2.2", 71 + "react-lottie": "^1.2.3", 72 + "react-redux": "^7.2.0", 73 + "react-router-dom": "^5.2.0", 74 + "react-scripts": "^5.0.1", 75 + "redux": "^4.0.5", 76 + "redux-thunk": "^2.3.0", 77 + "sass-loader": "^13.3.2", 78 + "source-map-explorer": "^2.5.2", 79 + "spark-md5": "^3.0.1", 80 + "typescript": "3.8.3", 81 + "wait-on": "^7.0.1" 82 + }, 83 + "scripts": { 84 + "analyze": "source-map-explorer 'build/static/js/*.js'", 85 + "start": "react-scripts start", 86 + "build": "react-scripts build", 87 + "test": "react-scripts test", 88 + "eject": "react-scripts eject", 89 + "ele": "electron .", 90 + "dev": "concurrently \"cross-env BROWSER=none npm start\" \"wait-on http://127.0.0.1:3000/ && nodemon --watch main.js --exec electron .\"", 91 + "release": "electron-builder", 92 + "prerelease": "react-scripts build" 93 + }, 94 + "homepage": "./", 95 + "build": { 96 + "appId": "xyz.960960.koodo", 97 + "productName": "Koodo Reader", 98 + "copyright": "Copyright (c) 2021-2022 ${author}", 99 + "files": [ 100 + "build/**/*", 101 + "node_modules/**/*", 102 + "package.json", 103 + "main.js", 104 + "edge-tts.js" 105 + ], 106 + "directories": { 107 + "buildResources": "assets" 108 + }, 109 + "publish": { 110 + "provider": "github", 111 + "repo": "koodo-reader", 112 + "owner": "koodo-reader" 113 + }, 114 + "buildDependenciesFromSource": false, 115 + "nodeGypRebuild": false, 116 + "fileAssociations": [ 117 + { 118 + "ext": "epub", 119 + "icon": "assets/icons/epub", 120 + "role": "Viewer", 121 + "mimeType": "application/epub+zip" 122 + }, 123 + { 124 + "ext": "pdf", 125 + "icon": "assets/icons/pdf", 126 + "role": "Viewer", 127 + "mimeType": "application/pdf" 128 + }, 129 + { 130 + "ext": "mobi", 131 + "icon": "assets/icons/mobi", 132 + "role": "Viewer", 133 + "mimeType": "application/x-mobipocket-ebook" 134 + }, 135 + { 136 + "ext": "azw3", 137 + "icon": "assets/icons/azw3", 138 + "role": "Viewer", 139 + "mimeType": "application/vnd.amazon.ebook" 140 + }, 141 + { 142 + "ext": "azw", 143 + "icon": "assets/icons/azw3", 144 + "role": "Viewer", 145 + "mimeType": "application/vnd.amazon.ebook" 146 + }, 147 + { 148 + "ext": "cbz", 149 + "icon": "assets/icons/comic", 150 + "role": "Viewer", 151 + "mimeType": "application/x-cbz" 152 + }, 153 + { 154 + "ext": "cbr", 155 + "icon": "assets/icons/comic", 156 + "role": "Viewer", 157 + "mimeType": "application/x-cbr" 158 + }, 159 + { 160 + "ext": "cbt", 161 + "icon": "assets/icons/comic", 162 + "role": "Viewer", 163 + "mimeType": "application/x-cbt" 164 + }, 165 + { 166 + "ext": "cb7", 167 + "icon": "assets/icons/comic", 168 + "role": "Viewer", 169 + "mimeType": "application/x-cb7" 170 + }, 171 + { 172 + "ext": "fb2", 173 + "icon": "assets/icons/fb2", 174 + "role": "Viewer", 175 + "mimeType": "application/x-fictionbook+xml" 176 + } 177 + ], 178 + "extends": null, 179 + "dmg": { 180 + "contents": [ 181 + { 182 + "x": 410, 183 + "y": 150, 184 + "type": "link", 185 + "path": "/Applications" 186 + }, 187 + { 188 + "x": 130, 189 + "y": 150, 190 + "type": "file" 191 + } 192 + ] 193 + }, 194 + "mac": { 195 + "target": [ 196 + { 197 + "target": "dmg", 198 + "arch": [ 199 + "x64", 200 + "arm64" 201 + ] 202 + } 203 + ], 204 + "icon": "assets/icons/icon.icns", 205 + "category": "public.app-category.productivity", 206 + "artifactName": "${productName}-${version}-${arch}.${ext}" 207 + }, 208 + "win": { 209 + "target": [ 210 + { 211 + "target": "nsis", 212 + "arch": [ 213 + "x64" 214 + ] 215 + }, 216 + { 217 + "target": "zip", 218 + "arch": [ 219 + "x64", 220 + "ia32", 221 + "arm64" 222 + ] 223 + }, 224 + { 225 + "target": "portable", 226 + "arch": [ 227 + "x64" 228 + ] 229 + } 230 + ], 231 + "icon": "assets/icons/icon.ico", 232 + "artifactName": "${productName}-${version}-${arch}-Win.${ext}", 233 + "publisherName": "App by Troye" 234 + }, 235 + "linux": { 236 + "icon": "assets/icons", 237 + "category": "Office", 238 + "target": [ 239 + { 240 + "target": "snap", 241 + "arch": [ 242 + "x64" 243 + ] 244 + }, 245 + { 246 + "target": "deb", 247 + "arch": [ 248 + "arm64", 249 + "ia32", 250 + "x64" 251 + ] 252 + }, 253 + { 254 + "target": "rpm", 255 + "arch": [ 256 + "x64" 257 + ] 258 + }, 259 + { 260 + "target": "AppImage", 261 + "arch": [ 262 + "arm64", 263 + "ia32", 264 + "x64" 265 + ] 266 + } 267 + ], 268 + "artifactName": "${productName}-${version}-${arch}.${ext}" 269 + }, 270 + "portable": { 271 + "artifactName": "${productName}-${version}-Portable.${ext}" 272 + }, 273 + "nsis": { 274 + "artifactName": "${productName}-${version}.${ext}", 275 + "oneClick": false, 276 + "allowToChangeInstallationDirectory": true, 277 + "include": "assets/windows/installer.nsh" 278 + }, 279 + "snap": { 280 + "publish": [ 281 + { 282 + "provider": "github" 283 + } 284 + ] 285 + } 286 + }, 287 + "eslintConfig": { 288 + "extends": "react-app" 289 + }, 290 + "browserslist": { 291 + "production": [ 292 + ">0.2%", 293 + "not dead", 294 + "not op_mini all" 295 + ], 296 + "development": [ 297 + "last 1 chrome version", 298 + "last 1 firefox version", 299 + "last 1 safari version" 300 + ] 301 + }, 302 + "babel": { 303 + "presets": [ 304 + "react-app" 305 + ], 306 + "plugins": [ 307 + [ 308 + "react-hot-loader/babel" 309 + ] 310 + ] 311 + } 312 + }
+130
pkgs/by-name/ko/koodo-reader/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + mkYarnPackage, 5 + fetchFromGitHub, 6 + applyPatches, 7 + fetchYarnDeps, 8 + makeDesktopItem, 9 + copyDesktopItems, 10 + wrapGAppsHook, 11 + electron, 12 + }: 13 + 14 + mkYarnPackage rec { 15 + pname = "koodo-reader"; 16 + version = "1.6.6"; 17 + 18 + src = applyPatches { 19 + src = fetchFromGitHub { 20 + owner = "troyeguo"; 21 + repo = "koodo-reader"; 22 + rev = "v${version}"; 23 + hash = "sha256-g2bVm8LFeEIPaWlaxzMI0SrpM+79zQFzJ7Vs5CbWBT4="; 24 + }; 25 + patches = [ ./update-react-i18next.patch ]; # Could be upstreamed 26 + }; 27 + 28 + # should be copied from `koodo-reader.src` 29 + packageJSON = ./package.json; 30 + 31 + patches = [ ./fix-isdev.patch ]; 32 + 33 + offlineCache = fetchYarnDeps { 34 + yarnLock = "${src}/yarn.lock"; 35 + hash = "sha256-VvYkotVb74zR9+/IWiQwOX/6RJf+xukpi7okRovfVzc="; 36 + }; 37 + 38 + nativeBuildInputs = [ 39 + copyDesktopItems 40 + wrapGAppsHook 41 + ]; 42 + 43 + dontWrapGApps = true; 44 + 45 + env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; 46 + 47 + configurePhase = '' 48 + runHook preConfigure 49 + 50 + cp -r $node_modules node_modules 51 + chmod +w node_modules 52 + 53 + runHook postConfigure 54 + ''; 55 + 56 + buildPhase = '' 57 + runHook preBuild 58 + 59 + export HOME=$(mktemp -d) 60 + yarn --offline build 61 + yarn --offline run electron-builder --dir \ 62 + -c.electronDist=${electron}/libexec/electron \ 63 + -c.electronVersion=${electron.version} 64 + 65 + runHook postBuild 66 + ''; 67 + 68 + installPhase = '' 69 + runHook preInstall 70 + 71 + install -Dm644 assets/icons/256x256.png $out/share/icons/hicolor/256x256/apps/koodo-reader.png 72 + install -Dm644 ${./mime-types.xml} $out/share/mime/packages/koodo-reader.xml 73 + 74 + mkdir -p $out/share/lib/koodo-reader 75 + cp -r dist/*-unpacked/{locales,resources{,.pak}} $out/share/lib/koodo-reader 76 + 77 + runHook postInstall 78 + ''; 79 + 80 + postFixup = '' 81 + makeWrapper ${electron}/bin/electron $out/bin/koodo-reader \ 82 + --add-flags $out/share/lib/koodo-reader/resources/app.asar \ 83 + "''${gappsWrapperArgs[@]}" \ 84 + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ 85 + --inherit-argv0 86 + ''; 87 + 88 + doDist = false; 89 + 90 + desktopItems = [ 91 + (makeDesktopItem { 92 + name = "koodo-reader"; 93 + desktopName = "Koodo Reader"; 94 + exec = "koodo-reader %U"; 95 + icon = "koodo-reader"; 96 + comment = meta.description; 97 + categories = [ "Office" ]; 98 + mimeTypes = [ 99 + "application/epub+zip" 100 + "application/pdf" 101 + "image/vnd.djvu" 102 + "application/x-mobipocket-ebook" 103 + "application/vnd.amazon.ebook" 104 + "application/vnd.amazon.ebook" 105 + "application/x-cbz" 106 + "application/x-cbr" 107 + "application/x-cbt" 108 + "application/x-cb7" 109 + "application/x-fictionbook+xml" 110 + ]; 111 + startupWMClass = "Koodo Reader"; 112 + terminal = false; 113 + }) 114 + ]; 115 + 116 + meta = { 117 + broken = stdenv.isDarwin; 118 + changelog = "https://github.com/troyeguo/koodo-reader/releases/tag/v${version}"; 119 + description = "A cross-platform ebook reader"; 120 + longDescription = '' 121 + A modern ebook manager and reader with sync and backup capacities 122 + for Windows, macOS, Linux and Web 123 + ''; 124 + homepage = "https://github.com/troyeguo/koodo-reader"; 125 + license = lib.licenses.agpl3Only; 126 + mainProgram = "koodo-reader"; 127 + maintainers = with lib.maintainers; [ tomasajt ]; 128 + platforms = electron.meta.platforms; 129 + }; 130 + }
+58
pkgs/by-name/ko/koodo-reader/update-react-i18next.patch
··· 1 + diff --git a/package.json b/package.json 2 + index c71b04a1..a4b4b3ef 100644 3 + --- a/package.json 4 + +++ b/package.json 5 + @@ -67,7 +67,7 @@ 6 + "react-device-detect": "^1.12.1", 7 + "react-dom": "^17.0.2", 8 + "react-dropzone": "^11.3.0", 9 + - "react-i18next": "^11.8.15", 10 + + "react-i18next": "^13.2.2", 11 + "react-lottie": "^1.2.3", 12 + "react-redux": "^7.2.0", 13 + "react-router-dom": "^5.2.0", 14 + diff --git a/yarn.lock b/yarn.lock 15 + index 881db5b2..2df4d362 100644 16 + --- a/yarn.lock 17 + +++ b/yarn.lock 18 + @@ -1828,7 +1828,7 @@ 19 + resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" 20 + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== 21 + 22 + -"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": 23 + +"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.20.6", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": 24 + version "7.21.0" 25 + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" 26 + integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== 27 + @@ -1842,6 +1842,13 @@ 28 + dependencies: 29 + regenerator-runtime "^0.14.0" 30 + 31 + +"@babel/runtime@^7.22.5": 32 + + version "7.23.1" 33 + + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" 34 + + integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== 35 + + dependencies: 36 + + regenerator-runtime "^0.14.0" 37 + + 38 + "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": 39 + version "7.20.7" 40 + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" 41 + @@ -10951,12 +10958,12 @@ react-i18next@*: 42 + "@babel/runtime" "^7.20.6" 43 + html-parse-stringify "^3.0.1" 44 + 45 + -react-i18next@^11.8.15: 46 + - version "11.18.6" 47 + - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887" 48 + - integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA== 49 + +react-i18next@^13.2.2: 50 + + version "13.2.2" 51 + + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.2.2.tgz#b1e78ed66a54f4bc819616f68b98221e1b1a1936" 52 + + integrity sha512-+nFUkbRByFwnrfDcYqvzBuaeZb+nACHx+fAWN/pZMddWOCJH5hoc21+Sa/N/Lqi6ne6/9wC/qRGOoQhJa6IkEQ== 53 + dependencies: 54 + - "@babel/runtime" "^7.14.5" 55 + + "@babel/runtime" "^7.22.5" 56 + html-parse-stringify "^3.0.1" 57 + 58 + react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0: