mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-03-11 03:32:41 +00:00
Merge pull request #206398 from fgaz/lgames/update-scripts
lgames: add updateScript, update
This commit is contained in:
commit
d895a5347b
@ -11,9 +11,10 @@
|
||||
, odd-unstable ? false
|
||||
, patchlevel-unstable ? false
|
||||
, url ? null
|
||||
, extraRegex ? null
|
||||
}:
|
||||
|
||||
genericUpdater {
|
||||
inherit pname version attrPath ignoredVersions rev-prefix odd-unstable patchlevel-unstable;
|
||||
versionLister = "${common-updater-scripts}/bin/list-directory-versions ${lib.optionalString (url != null) "--url=${lib.escapeShellArg url}"}";
|
||||
versionLister = "${common-updater-scripts}/bin/list-directory-versions ${lib.optionalString (url != null) "--url=${lib.escapeShellArg url}"} ${lib.optionalString (extraRegex != null) "--extra-regex=${lib.escapeShellArg extraRegex}"}";
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ parser.add_argument(
|
||||
parser.add_argument("--url", help="url of the page that lists the package versions")
|
||||
parser.add_argument("--file", help="file name for writing debugging information")
|
||||
|
||||
parser.add_argument("--extra-regex", help="additional regex to filter versions with")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
@ -59,7 +61,9 @@ if __name__ == "__main__":
|
||||
link_url = link.get("href", None)
|
||||
if link_url is not None:
|
||||
match = re.fullmatch(
|
||||
rf"{args.pname}-([\d.]+?(-[\d\w.-]+?)?)(\.tar)?(\.[^.]*)", link_url
|
||||
rf"(.*/)?{args.pname}-([\d.]+?(-[\d\w.-]+?)?)(\.tar)?(\.[^.]*)", link_url
|
||||
)
|
||||
if match:
|
||||
print(match.group(1))
|
||||
version = match.group(2)
|
||||
if (not args.extra_regex) or re.fullmatch(args.extra_regex, version):
|
||||
print(version)
|
||||
|
@ -5,15 +5,16 @@
|
||||
, SDL2_image
|
||||
, SDL2_mixer
|
||||
, SDL2_ttf
|
||||
, directoryListingUpdater
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lbreakouthd";
|
||||
version = "1.0.10";
|
||||
version = "1.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz";
|
||||
hash = "sha256-hlGhPa91u6pOaZoFJSDcXYQdizTFjuuTLnx9fcrXUhA=";
|
||||
hash = "sha256-5hjS0aJ5f8Oe0aSuVgcV10h5OmWsaMHF5B9wYVFrlDY=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@ -25,6 +26,12 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
passthru.updateScript = directoryListingUpdater {
|
||||
inherit pname version;
|
||||
url = "https://lgames.sourceforge.io/LBreakoutHD/";
|
||||
extraRegex = "(?!.*-win(32|64)).*";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
homepage = "https://lgames.sourceforge.io/LBreakoutHD/";
|
||||
|
@ -5,6 +5,7 @@
|
||||
, SDL2_image
|
||||
, SDL2_mixer
|
||||
, SDL2_ttf
|
||||
, directoryListingUpdater
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@ -23,6 +24,12 @@ stdenv.mkDerivation rec {
|
||||
SDL2_ttf
|
||||
];
|
||||
|
||||
passthru.updateScript = directoryListingUpdater {
|
||||
inherit pname version;
|
||||
url = "https://lgames.sourceforge.io/LPairs/";
|
||||
extraRegex = "(?!.*-win(32|64)).*";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
homepage = "http://lgames.sourceforge.net/LPairs/";
|
||||
|
@ -1,12 +1,18 @@
|
||||
{ lib, stdenv, fetchurl, SDL, SDL_mixer }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, SDL
|
||||
, SDL_mixer
|
||||
, directoryListingUpdater
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ltris";
|
||||
version = "1.2.5";
|
||||
version = "1.2.6";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz";
|
||||
hash = "sha256-Ksb5TdQMTEzaJfjHVhgq27dSFvZxUnNUQ6OpAU+xwzM=";
|
||||
hash = "sha256-wjziFFTAOJxSl6fvLhTv6ATZQGJefusDhqKXgOwsRvY=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
@ -16,6 +22,12 @@ stdenv.mkDerivation rec {
|
||||
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
passthru.updateScript = directoryListingUpdater {
|
||||
inherit pname version;
|
||||
url = "https://lgames.sourceforge.io/LTris/";
|
||||
extraRegex = "(?!.*-win(32|64)).*";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://lgames.sourceforge.io/LTris/";
|
||||
description = "Tetris clone from the LGames series";
|
||||
|
Loading…
Reference in New Issue
Block a user