generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pkgs/rsshub,metacubexd): use nix-update to update them
- Loading branch information
Showing
5 changed files
with
118 additions
and
146 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,45 @@ | ||
{ | ||
source, | ||
nodePackages, | ||
nodejs, | ||
pnpm, | ||
vips, | ||
lib, | ||
pkg-config, | ||
python3, | ||
zlib, | ||
mkPnpmPackage, | ||
stdenvNoCC, | ||
fetchFromGitHub, | ||
}: | ||
let | ||
version = lib.removePrefix "v" source.version; | ||
in | ||
mkPnpmPackage { | ||
inherit (source) pname src; | ||
inherit version pnpm nodejs; | ||
installEnv = { | ||
# otherwise, node-gyp will try to download node headers from internet | ||
npm_config_nodedir = "${nodejs}"; | ||
COREPACK_ENABLE_STRICT = "0"; | ||
stdenvNoCC.mkDerivation rec { | ||
pname = "metacubexd"; | ||
version = "1.140.0"; | ||
src = fetchFromGitHub { | ||
owner = "MetaCubeX"; | ||
repo = "metacubexd"; | ||
rev = "v1.140.0"; | ||
fetchSubmodules = false; | ||
sha256 = "sha256-OVLG+MHgwWTorPuBTHsHUAY1FSN91j7xWgRDJ7FiO7E="; | ||
}; | ||
env = { | ||
COREPACK_ENABLE_STRICT = "0"; | ||
pnpmDeps = pnpm.fetchDeps { | ||
inherit pname version src; | ||
hash = "sha256-24PkWT5UZJwMtL3y8qdf3XFuf3v5PjiP9XESbw3oppY="; | ||
env = { | ||
# otherwise, node-gyp will try to download node headers from internet | ||
# It see | ||
npm_config_nodedir = "${nodejs}"; | ||
}; | ||
}; | ||
extraBuildInputs = [ | ||
nativeBuildInputs = [ | ||
pnpm.configHook | ||
nodePackages.node-gyp | ||
nodejs | ||
pkg-config | ||
python3 | ||
vips | ||
zlib | ||
]; | ||
noDevDependencies = true; | ||
buildPhase = "pnpm build"; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r dist/* $out | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,76 @@ | ||
{ | ||
mkPnpmPackage, | ||
fetchFromGitHub, | ||
pnpm, | ||
stdenvNoCC, | ||
nodejs, | ||
writeText, | ||
writeShellScriptBin, | ||
bash, | ||
fetchpatch, | ||
applyPatches, | ||
source, | ||
}: | ||
let | ||
node-modules = | ||
(mkPnpmPackage { | ||
inherit (source) pname version src; | ||
inherit pnpm; | ||
installEnv.PUPPETEER_SKIP_DOWNLOAD = "1"; | ||
installEnv.COREPACK_ENABLE_STRICT = "0"; | ||
noDevDependencies = true; | ||
}).passthru.nodeModules.overrideAttrs | ||
(old: { | ||
installPhase = | ||
old.installPhase | ||
+ '' | ||
rm -f $out/node_modules/.pnpm/lock.yaml | ||
''; | ||
}); | ||
rsshub-website = stdenvNoCC.mkDerivation { | ||
inherit (source) pname version src; | ||
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 }; | ||
'') | ||
]; | ||
passthru = { | ||
inherit node-modules; | ||
}; | ||
nativeBuildInputs = [ | ||
pnpm | ||
nodejs | ||
]; | ||
buildPhase = '' | ||
ln -s ${node-modules}/node_modules node_modules | ||
pnpm build | ||
''; | ||
installPhase = '' | ||
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 | ||
stdenvNoCC.mkDerivation rec { | ||
pname = "rsshub"; | ||
version = "9fd5c42951983918e488ff364d7e07e1bd64fe5d"; | ||
src = fetchFromGitHub { | ||
owner = "DIYGod"; | ||
repo = "RSSHub"; | ||
rev = "9fd5c42951983918e488ff364d7e07e1bd64fe5d"; | ||
fetchSubmodules = false; | ||
sha256 = "sha256-C0RME1RCdjcThUQbqsIobmVQDViJcBSAL46z2E95M0E="; | ||
}; | ||
pnpmDeps = pnpm.fetchDeps { | ||
inherit pname version src; | ||
hash = "sha256-PWLINjZ2dJHILLAXHIXJORxpI8V3CdZ61lcS5v7fCUI="; | ||
}; | ||
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 = '${version}'.slice(0, 8); | ||
+let gitDate: Date | undefined = new Date('1970-01-01'); | ||
+// 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 }; | ||
'') | ||
]; | ||
nativeBuildInputs = [ | ||
pnpm.configHook | ||
nodejs | ||
]; | ||
buildPhase = "pnpm build"; | ||
installPhase = '' | ||
mkdir -p $out | ||
mkdir -p $out/assets | ||
mv node_modules $out/node_modules | ||
cp -r assets/build $out/assets/build | ||
cp -r lib package.json tsconfig.json $out | ||
mkdir -p $out/bin | ||
cat > $out/bin/rsshub <<- EOF | ||
#!${bash}/bin/bash | ||
mkdir -p $out/bin | ||
cat > $out/bin/rsshub <<- EOF | ||
#!${bash}/bin/bash | ||
TSX_TSCONFIG_PATH=$out/tsconfig.json ${nodejs}/bin/node $out/node_modules/tsx/dist/cli.mjs $out/lib/index.ts | ||
EOF | ||
chmod +x $out/bin/rsshub | ||
''; | ||
}; | ||
in | ||
rsshub-website | ||
TSX_TSCONFIG_PATH=$out/tsconfig.json ${nodejs}/bin/node $out/node_modules/tsx/dist/cli.mjs $out/lib/index.ts | ||
EOF | ||
chmod +x $out/bin/rsshub | ||
''; | ||
} |