mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
notion-app: drop x86_64-darwin support
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
unzip,
|
||||
}:
|
||||
let
|
||||
info =
|
||||
(lib.importJSON ./sources.json)."${stdenvNoCC.hostPlatform.parsed.cpu.name}-darwin"
|
||||
or (throw "Unsupported CPU architecture: ${stdenvNoCC.hostPlatform.parsed.cpu.name}");
|
||||
info = lib.importJSON ./source.json;
|
||||
in
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "notion-app";
|
||||
@@ -37,7 +35,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pradyuman
|
||||
];
|
||||
platforms = [
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
|
||||
5
pkgs/by-name/no/notion-app/source.json
Normal file
5
pkgs/by-name/no/notion-app/source.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "7.25.1",
|
||||
"url": "https://desktop-release.notion-static.com/Notion-arm64-7.25.1.zip",
|
||||
"hash": "sha512-1t+hNS33R3CX+inR8ArKvm4LDn0Wu7JiCU91ucnaAgQm85XUcWFdxk/f421M9XqG1Wte+webFX45LXDlixKa2A=="
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"x86_64-darwin": {
|
||||
"version": "7.25.1",
|
||||
"url": "https://desktop-release.notion-static.com/Notion-7.25.1.zip",
|
||||
"hash": "sha512-HBhe2onWY44JbMVIfiLglyNDk1tqepwCerqbgUuI56mstBlg+B0KuepTl+plJODoTVtRasmrg/WRBw+ESWpEeg=="
|
||||
},
|
||||
"aarch64-darwin": {
|
||||
"version": "7.25.1",
|
||||
"url": "https://desktop-release.notion-static.com/Notion-arm64-7.25.1.zip",
|
||||
"hash": "sha512-1t+hNS33R3CX+inR8ArKvm4LDn0Wu7JiCU91ucnaAgQm85XUcWFdxk/f421M9XqG1Wte+webFX45LXDlixKa2A=="
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,10 @@ const __dirname = import.meta.dirname;
|
||||
hash: `sha512-${string}`;
|
||||
}} Info */
|
||||
|
||||
/** @typedef {{
|
||||
"x86_64-darwin": Info;
|
||||
"aarch64-darwin": Info;
|
||||
}} InfoMap */
|
||||
|
||||
const BASE_URL = "https://desktop-release.notion-static.com/";
|
||||
/**
|
||||
*
|
||||
* @param {"latest-mac.yml" | "arm64-mac.yml"} liveCheckFile
|
||||
* @param {"arm64-mac.yml"} liveCheckFile
|
||||
* @returns {Promise<Info>}
|
||||
*/
|
||||
async function getInfo(liveCheckFile) {
|
||||
@@ -57,26 +52,20 @@ async function getInfo(liveCheckFile) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const filePath = path.join(__dirname, "../sources.json");
|
||||
/** @type {InfoMap} */
|
||||
const filePath = path.join(__dirname, "../source.json");
|
||||
/** @type {Info} */
|
||||
const oldInfo = JSON.parse(
|
||||
await fsPromises.readFile(filePath, { encoding: "utf-8" })
|
||||
);
|
||||
/** @type {InfoMap} */
|
||||
const info = {
|
||||
"x86_64-darwin": await getInfo("latest-mac.yml"),
|
||||
"aarch64-darwin": await getInfo("arm64-mac.yml"),
|
||||
};
|
||||
/** @type {Info} */
|
||||
const info = await getInfo("arm64-mac.yml");
|
||||
if (JSON.stringify(oldInfo) === JSON.stringify(info)) {
|
||||
console.log("[update] No updates found");
|
||||
return;
|
||||
}
|
||||
const platforms = /** @type {const} */ (["x86_64-darwin", "aarch64-darwin"]);
|
||||
for (const platform of platforms) {
|
||||
console.log(
|
||||
`[update] Updating Notion ${platform} ${oldInfo[platform].version} -> ${info[platform].version}`
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
`[update] Updating Notion ${oldInfo.version} -> ${info.version}`
|
||||
);
|
||||
await fsPromises.writeFile(
|
||||
filePath,
|
||||
JSON.stringify(info, null, 2) + "\n",
|
||||
|
||||
Reference in New Issue
Block a user