Unverified Commit 852e83db authored by Artturin's avatar Artturin Committed by GitHub
Browse files

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
parents 17a5dca7 88524695
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -69,14 +69,12 @@ let
    then ./linux.nix
    else ./darwin.nix;

  openasar = callPackage ./openasar.nix { };

  packages = (
    builtins.mapAttrs
      (_: value:
        callPackage package (value
          // {
          inherit src version openasar branch;
          inherit src version branch;
          meta = meta // { mainProgram = value.binaryName; };
        }))
      {
+26 −9
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, nodejs, bash, asar, unzip }:
{
  lib,
  stdenv,
  fetchFromGitHub,
  unstableGitUpdater,
  nodejs,
  bash,
  asar,
  unzip,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "openasar";
  version = "unstable-2023-10-24";
  version = "0-unstable-2024-01-13";

  src = fetchFromGitHub {
    owner = "GooseMod";
    repo = "OpenAsar";
    rev = "eee9bab822e3dbd97a735d0050ddd41ba27917f2";
    hash = "sha256-SSWQSqGgTZjowgrzF6qHZDTw/Y9xFHNTZvetxqZubYI=";
    rev = "4f264d860a5a6a32e1862ce26178b9cf6402335d";
    hash = "sha256-NPUUDqntsMxnT/RN5M9DtLDwJXDyjOED4GlXa1oU8l8=";
  };

  postPatch = ''
@@ -23,7 +32,7 @@ stdenv.mkDerivation rec {
    runHook preBuild

    bash scripts/injectPolyfills.sh
    substituteInPlace src/index.js --replace 'nightly' '${version}'
    substituteInPlace src/index.js --replace 'nightly' '${finalAttrs.version}'
    ${nodejs}/bin/node scripts/strip.js
    ${asar}/bin/asar pack src app.asar

@@ -40,11 +49,19 @@ stdenv.mkDerivation rec {

  doCheck = false;

  passthru.updateScript = unstableGitUpdater {
    # Only has a "nightly" tag (untaged version 0.2 is latest) see https://github.com/GooseMod/OpenAsar/commit/8f79dcef9b1f7732421235a392f06e5bd7382659
    hardcodeZeroVersion = true;
  };

  meta = with lib; {
    description = "Open-source alternative of Discord desktop's \"app.asar\".";
    homepage = "https://openasar.dev";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
    license = licenses.agpl3Only;
    maintainers = with maintainers; [
      Scrumplex
      jopejoe1
    ];
    platforms = nodejs.meta.platforms;
  };
}
})