Skip to content

Commit

Permalink
feat(pkgs/rsshub): repack it
Browse files Browse the repository at this point in the history
  • Loading branch information
wrvsrx committed Apr 3, 2024
1 parent d69c5f1 commit a7172ba
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 17 deletions.
44 changes: 39 additions & 5 deletions pkgs/to-normal-packages/rsshub/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
mkPnpmPackage,
stdenvNoCC,
nodePackages,
gitMinimal,
source,
writeText,
}:
let
node-modules =
Expand All @@ -15,15 +15,49 @@ let
in
stdenvNoCC.mkDerivation {
inherit (source) pname version src;
buildInputs = [
nodePackages.pnpm
gitMinimal
patches = [
(writeText "git.patch" ''
diff --git a/lib/utils/git-hash.ts b/lib/utils/git-hash.ts
index 9a8131696..62afc27ec 100644
--- a/lib/utils/git-hash.ts
+++ b/lib/utils/git-hash.ts
@@ -1,14 +1,14 @@
import { execSync } from 'child_process';
-let gitHash = process.env.HEROKU_SLUG_COMMIT?.slice(0, 8) || process.env.VERCEL_GIT_COMMIT_SHA?.slice(0, 8);
-let gitDate: Date | undefined;
-if (!gitHash) {
- try {
- gitHash = execSync('git rev-parse HEAD').toString().trim().slice(0, 8);
- gitDate = new Date(execSync('git log -1 --format=%cd').toString().trim());
- } catch {
- gitHash = 'unknown';
- }
-}
+let gitHash = '${source.version}'.slice(0, 8);
+let gitDate: Date | undefined = new Date('${source.date}');
+// if (!gitHash) {
+// try {
+// gitHash = execSync('git rev-parse HEAD').toString().trim().slice(0, 8);
+// gitDate = new Date(execSync('git log -1 --format=%cd').toString().trim());
+// } catch {
+// gitHash = 'unknown';
+// }
+// }
export { gitHash, gitDate };
'')
];
buildInputs = [ nodePackages.pnpm ];
buildPhase = ''
ln -s ${node-modules}/node_modules node_modules
pnpm build
'';
installPhase = ''
cp -r . $out
mkdir -p $out
mkdir -p $out/assets
ln -s ${node-modules}/node_modules $out/node_modules
cp -r assets/build $out/assets/build
cp -r lib package.json tsconfig.json $out
'';
}
10 changes: 5 additions & 5 deletions pkgs/to-sources/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,23 +481,23 @@
},
"rsshub": {
"cargoLocks": null,
"date": "2024-04-02",
"date": "2024-04-03",
"extract": null,
"name": "rsshub",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": true,
"leaveDotGit": false,
"name": null,
"owner": "DIYGod",
"repo": "RSSHub",
"rev": "ab77defb07853d6cc057f062cbcd83207505bdab",
"sha256": "sha256-+O6/rHmYlIXTuoiXoY36tW1As69s1di9lEMunphu688=",
"rev": "e3d0769545eeac0c0ab291e3009bb8d7bd65aa40",
"sha256": "sha256-K3t5d/mlXiKelRI3gyzgFhAXrW2VdHloktBYihkk/bE=",
"type": "github"
},
"version": "ab77defb07853d6cc057f062cbcd83207505bdab"
"version": "e3d0769545eeac0c0ab291e3009bb8d7bd65aa40"
},
"seal_lake": {
"cargoLocks": null,
Expand Down
10 changes: 4 additions & 6 deletions pkgs/to-sources/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,15 @@
};
rsshub = {
pname = "rsshub";
version = "ab77defb07853d6cc057f062cbcd83207505bdab";
version = "e3d0769545eeac0c0ab291e3009bb8d7bd65aa40";
src = fetchFromGitHub {
owner = "DIYGod";
repo = "RSSHub";
rev = "ab77defb07853d6cc057f062cbcd83207505bdab";
rev = "e3d0769545eeac0c0ab291e3009bb8d7bd65aa40";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = true;
sha256 = "sha256-+O6/rHmYlIXTuoiXoY36tW1As69s1di9lEMunphu688=";
sha256 = "sha256-K3t5d/mlXiKelRI3gyzgFhAXrW2VdHloktBYihkk/bE=";
};
date = "2024-04-02";
date = "2024-04-03";
};
seal_lake = {
pname = "seal_lake";
Expand Down
1 change: 0 additions & 1 deletion pkgs/to-sources/nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ fetch.github = "NVIDIA/cccl"
[rsshub]
src.git = "https://github.com/DIYGod/RSSHub"
fetch.github = "DIYGod/RSSHub"
git.leaveDotGit = true

[calibre]
src.github_tag = "kovidgoyal/calibre"
Expand Down

0 comments on commit a7172ba

Please sign in to comment.