Merge pull request #307836 from jopejoe1/openasar/split-out

openasar: unstable-2023-10-24 -> 0-unstable-2024-01-13, move out of discord, adpot, update script

authored by Artturin and committed by GitHub 852e83db 17a5dca7

+68 -53
+1 -3
pkgs/applications/networking/instant-messengers/discord/default.nix
··· 69 then ./linux.nix 70 else ./darwin.nix; 71 72 - openasar = callPackage ./openasar.nix { }; 73 - 74 packages = ( 75 builtins.mapAttrs 76 (_: value: 77 callPackage package (value 78 // { 79 - inherit src version openasar branch; 80 meta = meta // { mainProgram = value.binaryName; }; 81 })) 82 {
··· 69 then ./linux.nix 70 else ./darwin.nix; 71 72 packages = ( 73 builtins.mapAttrs 74 (_: value: 75 callPackage package (value 76 // { 77 + inherit src version branch; 78 meta = meta // { mainProgram = value.binaryName; }; 79 })) 80 {
-50
pkgs/applications/networking/instant-messengers/discord/openasar.nix
··· 1 - { lib, stdenv, fetchFromGitHub, nodejs, bash, asar, unzip }: 2 - 3 - stdenv.mkDerivation rec { 4 - pname = "openasar"; 5 - version = "unstable-2023-10-24"; 6 - 7 - src = fetchFromGitHub { 8 - owner = "GooseMod"; 9 - repo = "OpenAsar"; 10 - rev = "eee9bab822e3dbd97a735d0050ddd41ba27917f2"; 11 - hash = "sha256-SSWQSqGgTZjowgrzF6qHZDTw/Y9xFHNTZvetxqZubYI="; 12 - }; 13 - 14 - postPatch = '' 15 - # Hardcode unzip path 16 - substituteInPlace ./src/updater/moduleUpdater.js \ 17 - --replace \'unzip\' \'${unzip}/bin/unzip\' 18 - # Remove auto-update feature 19 - echo "module.exports = async () => log('AsarUpdate', 'Removed');" > ./src/asarUpdate.js 20 - ''; 21 - 22 - buildPhase = '' 23 - runHook preBuild 24 - 25 - bash scripts/injectPolyfills.sh 26 - substituteInPlace src/index.js --replace 'nightly' '${version}' 27 - ${nodejs}/bin/node scripts/strip.js 28 - ${asar}/bin/asar pack src app.asar 29 - 30 - runHook postBuild 31 - ''; 32 - 33 - installPhase = '' 34 - runHook preInstall 35 - 36 - install app.asar $out 37 - 38 - runHook postInstall 39 - ''; 40 - 41 - doCheck = false; 42 - 43 - meta = with lib; { 44 - description = "Open-source alternative of Discord desktop's \"app.asar\"."; 45 - homepage = "https://openasar.dev"; 46 - license = licenses.mit; 47 - maintainers = with maintainers; [ ]; 48 - platforms = nodejs.meta.platforms; 49 - }; 50 - }
···
+67
pkgs/by-name/op/openasar/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + unstableGitUpdater, 6 + nodejs, 7 + bash, 8 + asar, 9 + unzip, 10 + }: 11 + 12 + stdenv.mkDerivation (finalAttrs: { 13 + pname = "openasar"; 14 + version = "0-unstable-2024-01-13"; 15 + 16 + src = fetchFromGitHub { 17 + owner = "GooseMod"; 18 + repo = "OpenAsar"; 19 + rev = "4f264d860a5a6a32e1862ce26178b9cf6402335d"; 20 + hash = "sha256-NPUUDqntsMxnT/RN5M9DtLDwJXDyjOED4GlXa1oU8l8="; 21 + }; 22 + 23 + postPatch = '' 24 + # Hardcode unzip path 25 + substituteInPlace ./src/updater/moduleUpdater.js \ 26 + --replace \'unzip\' \'${unzip}/bin/unzip\' 27 + # Remove auto-update feature 28 + echo "module.exports = async () => log('AsarUpdate', 'Removed');" > ./src/asarUpdate.js 29 + ''; 30 + 31 + buildPhase = '' 32 + runHook preBuild 33 + 34 + bash scripts/injectPolyfills.sh 35 + substituteInPlace src/index.js --replace 'nightly' '${finalAttrs.version}' 36 + ${nodejs}/bin/node scripts/strip.js 37 + ${asar}/bin/asar pack src app.asar 38 + 39 + runHook postBuild 40 + ''; 41 + 42 + installPhase = '' 43 + runHook preInstall 44 + 45 + install app.asar $out 46 + 47 + runHook postInstall 48 + ''; 49 + 50 + doCheck = false; 51 + 52 + passthru.updateScript = unstableGitUpdater { 53 + # Only has a "nightly" tag (untaged version 0.2 is latest) see https://github.com/GooseMod/OpenAsar/commit/8f79dcef9b1f7732421235a392f06e5bd7382659 54 + hardcodeZeroVersion = true; 55 + }; 56 + 57 + meta = with lib; { 58 + description = "Open-source alternative of Discord desktop's \"app.asar\"."; 59 + homepage = "https://openasar.dev"; 60 + license = licenses.agpl3Only; 61 + maintainers = with maintainers; [ 62 + Scrumplex 63 + jopejoe1 64 + ]; 65 + platforms = nodejs.meta.platforms; 66 + }; 67 + })