diff options
author | Robert Schütz <nix@dotlambda.de> | 2023-08-26 19:56:59 -0700 |
---|---|---|
committer | Robert Schütz <nix@dotlambda.de> | 2023-08-26 20:27:43 -0700 |
commit | 745de518cd1e93b8ef7a4090aced2cb447f599bb (patch) | |
tree | 3686e24a2a48b26fd5a986db3fad50bda44e3dbc | |
parent | fcfa6f73f8adccdcaa8ed1a908e834a3afa06505 (diff) |
asar: use buildNpmPackage
-rw-r--r-- | pkgs/applications/editors/pulsar/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/editors/vscode/generic.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/misc/teleprompter/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/misc/whalebird/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/networking/breitbandmessung/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/networking/instant-messengers/discord/openasar.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/networking/instant-messengers/slack/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/networking/instant-messengers/teams/default.nix | 4 | ||||
-rw-r--r-- | pkgs/applications/office/morgen/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/node-packages/aliases.nix | 1 | ||||
-rw-r--r-- | pkgs/development/node-packages/node-packages.json | 1 | ||||
-rw-r--r-- | pkgs/development/node-packages/node-packages.nix | 36 | ||||
-rw-r--r-- | pkgs/tools/compression/asar/default.nix | 48 | ||||
-rw-r--r-- | pkgs/tools/compression/asar/package.json | 62 | ||||
-rw-r--r-- | pkgs/tools/misc/flexoptix-app/default.nix | 6 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
16 files changed, 134 insertions, 58 deletions
diff --git a/pkgs/applications/editors/pulsar/default.nix b/pkgs/applications/editors/pulsar/default.nix index 0cdc2d81e75b..1e1969ae2dea 100644 --- a/pkgs/applications/editors/pulsar/default.nix +++ b/pkgs/applications/editors/pulsar/default.nix @@ -17,7 +17,7 @@ , makeDesktopItem , copyDesktopItems , makeWrapper -, nodePackages +, asar , python3 }: @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ wrapGAppsHook copyDesktopItems - nodePackages.asar + asar ]; buildInputs = [ diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index 1742c1e0a0af..39e4fbc966d7 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -8,7 +8,7 @@ , tests # needed to fix "Save as Root" -, nodePackages, bash +, asar, bash # Attributes inherit from specific versions , version, src, meta, sourceRoot, commandLineArgs @@ -74,7 +74,7 @@ let nativeBuildInputs = [ unzip ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook - nodePackages.asar + asar # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 (buildPackages.wrapGAppsHook.override { inherit (buildPackages) makeWrapper; }) ]; diff --git a/pkgs/applications/misc/teleprompter/default.nix b/pkgs/applications/misc/teleprompter/default.nix index 7e4ac3a5701a..9e4f711d125c 100644 --- a/pkgs/applications/misc/teleprompter/default.nix +++ b/pkgs/applications/misc/teleprompter/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, electron_10, makeDesktopItem, makeWrapper, nodePackages, autoPatchelfHook}: +{ lib, stdenv, fetchurl, electron_10, makeDesktopItem, makeWrapper, asar, autoPatchelfHook}: let electron = electron_10; @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { dontBuild = true; dontStrip = true; - nativeBuildInputs = [ autoPatchelfHook makeWrapper nodePackages.asar ]; + nativeBuildInputs = [ autoPatchelfHook makeWrapper asar ]; installPhase = '' mkdir -p $out/bin $out/opt/teleprompter $out/share/applications asar e resources/app.asar $out/opt/teleprompter/resources/app.asar.unpacked diff --git a/pkgs/applications/misc/whalebird/default.nix b/pkgs/applications/misc/whalebird/default.nix index 36868690d81d..ce7d178f1c05 100644 --- a/pkgs/applications/misc/whalebird/default.nix +++ b/pkgs/applications/misc/whalebird/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl -, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, gnugrep, nodePackages +, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, gnugrep, asar , electron, python3, alsa-lib, gtk3, libdbusmenu, libxshmfence, mesa, nss }: @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { makeWrapper copyDesktopItems gnugrep - nodePackages.asar + asar ]; buildInputs = [ alsa-lib gtk3 libdbusmenu libxshmfence mesa nss ]; diff --git a/pkgs/applications/networking/breitbandmessung/default.nix b/pkgs/applications/networking/breitbandmessung/default.nix index 22ffc8903c4a..09ec430e6548 100644 --- a/pkgs/applications/networking/breitbandmessung/default.nix +++ b/pkgs/applications/networking/breitbandmessung/default.nix @@ -1,11 +1,11 @@ { lib , stdenv , fetchurl +, asar , dpkg , electron_24 , makeWrapper , nixosTests -, nodePackages , undmg }: @@ -22,9 +22,9 @@ let }; nativeBuildInputs = [ + asar dpkg makeWrapper - nodePackages.asar ]; unpackPhase = "dpkg-deb -x $src ."; diff --git a/pkgs/applications/networking/instant-messengers/discord/openasar.nix b/pkgs/applications/networking/instant-messengers/discord/openasar.nix index 8954d363d5fc..0c4bebcab96a 100644 --- a/pkgs/applications/networking/instant-messengers/discord/openasar.nix +++ b/pkgs/applications/networking/instant-messengers/discord/openasar.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, nodejs, bash, nodePackages, unzip }: +{ lib, stdenv, fetchFromGitHub, nodejs, bash, asar, unzip }: stdenv.mkDerivation rec { pname = "openasar"; @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { bash scripts/injectPolyfills.sh substituteInPlace src/index.js --replace 'nightly' '${version}' ${nodejs}/bin/node scripts/strip.js - ${nodePackages.asar}/bin/asar pack src app.asar + ${asar}/bin/asar pack src app.asar runHook postBuild ''; diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix index 66c81f9f6b4e..0b4093735022 100644 --- a/pkgs/applications/networking/instant-messengers/slack/default.nix +++ b/pkgs/applications/networking/instant-messengers/slack/default.nix @@ -4,7 +4,7 @@ , dpkg , undmg , makeWrapper -, nodePackages +, asar , alsa-lib , at-spi2-atk , at-spi2-core @@ -143,7 +143,7 @@ let gtk3 # needed for GSETTINGS_SCHEMAS_PATH ]; - nativeBuildInputs = [ dpkg makeWrapper nodePackages.asar ]; + nativeBuildInputs = [ dpkg makeWrapper asar ]; dontUnpack = true; dontBuild = true; diff --git a/pkgs/applications/networking/instant-messengers/teams/default.nix b/pkgs/applications/networking/instant-messengers/teams/default.nix index be4334438c33..601643edcfd6 100644 --- a/pkgs/applications/networking/instant-messengers/teams/default.nix +++ b/pkgs/applications/networking/instant-messengers/teams/default.nix @@ -14,7 +14,7 @@ , gawk , xdg-utils , systemd -, nodePackages +, asar , xar , cpio , makeWrapper @@ -55,7 +55,7 @@ let hash = hashes.linux; }; - nativeBuildInputs = [ dpkg autoPatchelfHook wrapGAppsHook nodePackages.asar ]; + nativeBuildInputs = [ dpkg autoPatchelfHook wrapGAppsHook asar ]; unpackCmd = "dpkg -x $curSrc ."; diff --git a/pkgs/applications/office/morgen/default.nix b/pkgs/applications/office/morgen/default.nix index 9edacf7b3de8..b64e15e29de3 100644 --- a/pkgs/applications/office/morgen/default.nix +++ b/pkgs/applications/office/morgen/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron -, nodePackages, alsa-lib, gtk3, libxshmfence, mesa, nss }: +, asar, alsa-lib, gtk3, libxshmfence, mesa, nss }: stdenv.mkDerivation rec { pname = "morgen"; @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { dpkg autoPatchelfHook makeWrapper - nodePackages.asar + asar ]; buildInputs = [ alsa-lib gtk3 libxshmfence mesa nss ]; diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index e3ff0d15396a..f95f129c459d 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -47,6 +47,7 @@ mapAliases { "@medable/mdctl-cli" = throw "@medable/mdctl-cli was removed because it was broken"; # added 2023-08-21 "@nestjs/cli" = pkgs.nest-cli; # Added 2023-05-06 antennas = pkgs.antennas; # added 2023-07-30 + inherit (pkgs) asar; # added 2023-08-26 balanceofsatoshis = pkgs.balanceofsatoshis; # added 2023-07-31 bibtex-tidy = pkgs.bibtex-tidy; # added 2023-07-30 bitwarden-cli = pkgs.bitwarden-cli; # added 2023-07-25 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index c715380e4f2a..8febed463fbe 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -26,7 +26,6 @@ , {"@webassemblyjs/wast-refmt": "1.11.1"} , "alex" , "alloy" -, "asar" , "audiosprite" , "autoprefixer" , "auto-changelog" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 845812fdad5e..0e32e8c58930 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -75588,42 +75588,6 @@ in bypassCache = true; reconstructLock = true; }; - asar = nodeEnv.buildNodePackage { - name = "asar"; - packageName = "asar"; - version = "3.2.0"; - src = fetchurl { - url = "https://registry.npmjs.org/asar/-/asar-3.2.0.tgz"; - sha512 = "COdw2ZQvKdFGFxXwX3oYh2/sOsJWJegrdJCGxnN4MZ7IULgRBp9P6665aqj9z1v9VwP4oP1hRBojRDQ//IGgAg=="; - }; - dependencies = [ - sources."@types/glob-7.2.0" - sources."@types/minimatch-5.1.2" - sources."@types/node-20.5.3" - sources."balanced-match-1.0.2" - sources."brace-expansion-1.1.11" - sources."chromium-pickle-js-0.2.0" - sources."commander-5.1.0" - sources."concat-map-0.0.1" - sources."fs.realpath-1.0.0" - sources."glob-7.2.3" - sources."inflight-1.0.6" - sources."inherits-2.0.4" - sources."minimatch-3.1.2" - sources."once-1.4.0" - sources."path-is-absolute-1.0.1" - sources."wrappy-1.0.2" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Creating Electron app packages"; - homepage = "https://github.com/electron/asar"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; audiosprite = nodeEnv.buildNodePackage { name = "audiosprite"; packageName = "audiosprite"; diff --git a/pkgs/tools/compression/asar/default.nix b/pkgs/tools/compression/asar/default.nix new file mode 100644 index 000000000000..3d6c017674a8 --- /dev/null +++ b/pkgs/tools/compression/asar/default.nix @@ -0,0 +1,48 @@ +{ lib +, mkYarnPackage +, fetchFromGitHub +, fetchYarnDeps +}: + +mkYarnPackage rec { + pname = "asar"; + version = "3.2.4"; + + src = fetchFromGitHub { + owner = "electron"; + repo = "asar"; + rev = "v${version}"; + hash = "sha256-12FP8VRDo1PQ+tiN4zhzkcfAx9zFs/0MU03t/vFo074="; + }; + + packageJSON = ./package.json; + + offlineCache = fetchYarnDeps { + yarnLock = "${src}/yarn.lock"; + hash = "sha256-/fV3hd98pl46+fgmiMH9sDQrrZgdLY1oF9c3TaIxRSg="; + }; + + doDist = false; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/lib/node_modules" + mv deps/@electron "$out/lib/node_modules" + rm "$out/lib/node_modules/@electron/asar/node_modules" + mv node_modules "$out/lib/node_modules/@electron/asar" + + mkdir "$out/bin" + ln -s "$out/lib/node_modules/@electron/asar/bin/asar.js" "$out/bin/asar" + + runHook postInstall + ''; + + meta = { + description = "Simple extensive tar-like archive format with indexing"; + homepage = "https://github.com/electron/asar"; + license = lib.licenses.mit; + mainProgram = "asar"; + maintainers = with lib.maintainers; [ xvapx ]; + }; +} diff --git a/pkgs/tools/compression/asar/package.json b/pkgs/tools/compression/asar/package.json new file mode 100644 index 000000000000..51ed0e24ffeb --- /dev/null +++ b/pkgs/tools/compression/asar/package.json @@ -0,0 +1,62 @@ +{ + "name": "@electron/asar", + "description": "Creating Electron app packages", + "version": "0.0.0-development", + "main": "./lib/asar.js", + "types": "./lib/index.d.ts", + "bin": { + "asar": "./bin/asar.js" + }, + "files": [ + "bin", + "lib", + "lib/index.d.ts" + ], + "engines": { + "node": ">=10.12.0" + }, + "license": "MIT", + "homepage": "https://github.com/electron/asar", + "repository": { + "type": "git", + "url": "https://github.com/electron/asar.git" + }, + "bugs": { + "url": "https://github.com/electron/asar/issues" + }, + "scripts": { + "mocha": "xvfb-maybe electron-mocha --reporter spec && mocha --reporter spec", + "test": "npm run lint && npm run mocha", + "lint": "tsd && standard", + "standard": "standard", + "tsd": "tsd" + }, + "standard": { + "env": { + "mocha": true + }, + "globals": [ + "BigInt" + ] + }, + "tsd": { + "directory": "test" + }, + "dependencies": { + "chromium-pickle-js": "^0.2.0", + "commander": "^5.0.0", + "glob": "^7.1.6", + "minimatch": "^3.0.4" + }, + "devDependencies": { + "@continuous-auth/semantic-release-npm": "^3.0.0", + "electron": "^22.0.0", + "electron-mocha": "^11.0.2", + "lodash": "^4.17.15", + "mocha": "^10.1.0", + "rimraf": "^3.0.2", + "standard": "^14.3.3", + "tsd": "^0.25.0", + "xvfb-maybe": "^0.2.1" + } +} diff --git a/pkgs/tools/misc/flexoptix-app/default.nix b/pkgs/tools/misc/flexoptix-app/default.nix index 45f28b8ee442..6fb4c5df775d 100644 --- a/pkgs/tools/misc/flexoptix-app/default.nix +++ b/pkgs/tools/misc/flexoptix-app/default.nix @@ -1,4 +1,4 @@ -{ lib, appimageTools, fetchurl, nodePackages }: let +{ lib, appimageTools, fetchurl, asar }: let pname = "flexoptix-app"; version = "5.13.4"; @@ -18,9 +18,9 @@ ${oA.buildCommand} # Get rid of the autoupdater - ${nodePackages.asar}/bin/asar extract $out/resources/app.asar app + ${asar}/bin/asar extract $out/resources/app.asar app sed -i 's/async isUpdateAvailable.*/async isUpdateAvailable(updateInfo) { return false;/g' app/node_modules/electron-updater/out/AppUpdater.js - ${nodePackages.asar}/bin/asar pack app $out/resources/app.asar + ${asar}/bin/asar pack app $out/resources/app.asar ''; }); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a483bb5f7a00..bc2239a25094 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1652,6 +1652,8 @@ with pkgs; amidst = callPackage ../tools/games/minecraft/amidst { }; + asar = callPackage ../tools/compression/asar { }; + askalono = callPackage ../tools/misc/askalono { }; asleap = callPackage ../tools/networking/asleap { }; |