Skip to content

Commit 10ac919

Browse files
committed
ecwolf: add passthru.updateScript
Before this change, nixpkgs-update had to rely on on Repology in order to determine if there was an ECWolf update. When it comes to ECWolf updates, Repology is a tertiary source of information. This change allows nixpkgs-update (and any other tools) to use debian.drdteam.org to determine if there is an ECWolf update. When it comes to ECWolf updates, debian.drdteam.org is a primary source of information.
1 parent 573cead commit 10ac919

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pkgs/games/ecwolf/default.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
, SDL2_net
1313
, SDL2_mixer
1414
, gtk3
15+
, writers
16+
, python3Packages
17+
, nix-update
1518
}:
1619

1720
stdenv.mkDerivation rec {
@@ -41,6 +44,33 @@ stdenv.mkDerivation rec {
4144
makeWrapper $out/{Applications/ecwolf.app/Contents/MacOS,bin}/ecwolf
4245
'';
4346

47+
passthru.updateScript = let
48+
updateScriptPkg = writers.writePython3 "ecwolf_update_script" {
49+
libraries = with python3Packages; [ debian-inspector requests ];
50+
} ''
51+
from os import execl
52+
from sys import argv
53+
54+
from debian_inspector.debcon import get_paragraphs_data
55+
from requests import get
56+
57+
# The debian.drdteam.org repo is a primary source of information. It’s
58+
# run by Blzut3, the creator and primary developer of ECWolf. It’s also
59+
# listed on ECWolf’s download page:
60+
# <https://maniacsvault.net/ecwolf/download.php>.
61+
url = 'https://debian.drdteam.org/dists/stable/multiverse/binary-amd64/Packages' # noqa: E501
62+
response = get(url)
63+
packages = get_paragraphs_data(response.text)
64+
for package in packages:
65+
if package['package'] == 'ecwolf':
66+
latest_version = package['version']
67+
break
68+
nix_update_path = argv[1]
69+
70+
execl(nix_update_path, nix_update_path, '--version', latest_version)
71+
'';
72+
in [ updateScriptPkg (lib.getExe nix-update) ];
73+
4474
meta = with lib; {
4575
description = "Enhanched SDL-based port of Wolfenstein 3D for various platforms";
4676
homepage = "https://maniacsvault.net/ecwolf/";

0 commit comments

Comments
 (0)