Merge pull request #207359 from KarlJoad/octavePackages/auto-update-script

Octave packages: auto update script and fixes

authored by

Doron Behar and committed by
GitHub
7a88e40d 17ebff16

+596 -86
+468
maintainers/scripts/update-octave-packages
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell update-octave-shell.nix -i python3 3 + 4 + """ 5 + Update a Octave package expression by passing in the `.nix` file, or the directory containing it. 6 + You can pass in multiple files or paths. 7 + 8 + You'll likely want to use 9 + `` 10 + $ ./update-octave-libraries ../../pkgs/development/octave-modules/**/default.nix 11 + `` 12 + to update all non-pinned libraries in that folder. 13 + """ 14 + 15 + import argparse 16 + import os 17 + import pathlib 18 + import re 19 + import requests 20 + import yaml 21 + from concurrent.futures import ThreadPoolExecutor as Pool 22 + from packaging.version import Version as _Version 23 + from packaging.version import InvalidVersion 24 + from packaging.specifiers import SpecifierSet 25 + import collections 26 + import subprocess 27 + import tempfile 28 + 29 + INDEX = "https://raw.githubusercontent.com/gnu-octave/packages/main/packages" 30 + """url of Octave packages' source on GitHub""" 31 + 32 + EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip'] 33 + """Permitted file extensions. These are evaluated from left to right and the first occurance is returned.""" 34 + 35 + PRERELEASES = False 36 + 37 + GIT = "git" 38 + 39 + NIXPGKS_ROOT = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode('utf-8').strip() 40 + 41 + import logging 42 + logging.basicConfig(level=logging.INFO) 43 + 44 + 45 + class Version(_Version, collections.abc.Sequence): 46 + 47 + def __init__(self, version): 48 + super().__init__(version) 49 + # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21` 50 + # https://github.com/avian2/unidecode/issues/13#issuecomment-354538882 51 + self.raw_version = version 52 + 53 + def __getitem__(self, i): 54 + return self._version.release[i] 55 + 56 + def __len__(self): 57 + return len(self._version.release) 58 + 59 + def __iter__(self): 60 + yield from self._version.release 61 + 62 + 63 + def _get_values(attribute, text): 64 + """Match attribute in text and return all matches. 65 + 66 + :returns: List of matches. 67 + """ 68 + regex = '{}\s+=\s+"(.*)";'.format(attribute) 69 + regex = re.compile(regex) 70 + values = regex.findall(text) 71 + return values 72 + 73 + def _get_unique_value(attribute, text): 74 + """Match attribute in text and return unique match. 75 + 76 + :returns: Single match. 77 + """ 78 + values = _get_values(attribute, text) 79 + n = len(values) 80 + if n > 1: 81 + raise ValueError("found too many values for {}".format(attribute)) 82 + elif n == 1: 83 + return values[0] 84 + else: 85 + raise ValueError("no value found for {}".format(attribute)) 86 + 87 + def _get_line_and_value(attribute, text): 88 + """Match attribute in text. Return the line and the value of the attribute.""" 89 + regex = '({}\s+=\s+"(.*)";)'.format(attribute) 90 + regex = re.compile(regex) 91 + value = regex.findall(text) 92 + n = len(value) 93 + if n > 1: 94 + raise ValueError("found too many values for {}".format(attribute)) 95 + elif n == 1: 96 + return value[0] 97 + else: 98 + raise ValueError("no value found for {}".format(attribute)) 99 + 100 + 101 + def _replace_value(attribute, value, text): 102 + """Search and replace value of attribute in text.""" 103 + old_line, old_value = _get_line_and_value(attribute, text) 104 + new_line = old_line.replace(old_value, value) 105 + new_text = text.replace(old_line, new_line) 106 + return new_text 107 + 108 + 109 + def _fetch_page(url): 110 + r = requests.get(url) 111 + if r.status_code == requests.codes.ok: 112 + return list(yaml.safe_load_all(r.content))[0] 113 + else: 114 + raise ValueError("request for {} failed".format(url)) 115 + 116 + 117 + def _fetch_github(url): 118 + headers = {} 119 + token = os.environ.get('GITHUB_API_TOKEN') 120 + if token: 121 + headers["Authorization"] = f"token {token}" 122 + r = requests.get(url, headers=headers) 123 + 124 + if r.status_code == requests.codes.ok: 125 + return r.json() 126 + else: 127 + raise ValueError("request for {} failed".format(url)) 128 + 129 + 130 + SEMVER = { 131 + 'major' : 0, 132 + 'minor' : 1, 133 + 'patch' : 2, 134 + } 135 + 136 + 137 + def _determine_latest_version(current_version, target, versions): 138 + """Determine latest version, given `target`, returning the more recent version. 139 + """ 140 + current_version = Version(current_version) 141 + 142 + def _parse_versions(versions): 143 + for v in versions: 144 + try: 145 + yield Version(v) 146 + except InvalidVersion: 147 + pass 148 + 149 + versions = _parse_versions(versions) 150 + 151 + index = SEMVER[target] 152 + 153 + ceiling = list(current_version[0:index]) 154 + if len(ceiling) == 0: 155 + ceiling = None 156 + else: 157 + ceiling[-1]+=1 158 + ceiling = Version(".".join(map(str, ceiling))) 159 + 160 + # We do not want prereleases 161 + versions = SpecifierSet(prereleases=PRERELEASES).filter(versions) 162 + 163 + if ceiling is not None: 164 + versions = SpecifierSet(f"<{ceiling}").filter(versions) 165 + 166 + return (max(sorted(versions))).raw_version 167 + 168 + 169 + def _get_latest_version_octave_packages(package, extension, current_version, target): 170 + """Get latest version and hash from Octave Packages.""" 171 + url = "{}/{}.yaml".format(INDEX, package) 172 + yaml = _fetch_page(url) 173 + 174 + versions = list(map(lambda pv: pv['id'], yaml['versions'])) 175 + version = _determine_latest_version(current_version, target, versions) 176 + 177 + try: 178 + releases = [v if v['id'] == version else None for v in yaml['versions']] 179 + except KeyError as e: 180 + raise KeyError('Could not find version {} for {}'.format(version, package)) from e 181 + for release in releases: 182 + if release['url'].endswith(extension): 183 + sha256 = release['sha256'] 184 + break 185 + else: 186 + sha256 = None 187 + return version, sha256, None 188 + 189 + 190 + def _get_latest_version_github(package, extension, current_version, target): 191 + def strip_prefix(tag): 192 + return re.sub("^[^0-9]*", "", tag) 193 + 194 + def get_prefix(string): 195 + matches = re.findall(r"^([^0-9]*)", string) 196 + return next(iter(matches), "") 197 + 198 + # when invoked as an updateScript, UPDATE_NIX_ATTR_PATH will be set 199 + # this allows us to work with packages which live outside of octave-modules 200 + attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"octavePackages.{package}") 201 + try: 202 + homepage = subprocess.check_output( 203 + ["nix", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"{attr_path}.src.meta.homepage"])\ 204 + .decode('utf-8') 205 + except Exception as e: 206 + raise ValueError(f"Unable to determine homepage: {e}") 207 + owner_repo = homepage[len("https://github.com/"):] # remove prefix 208 + owner, repo = owner_repo.split("/") 209 + 210 + url = f"https://api.github.com/repos/{owner}/{repo}/releases" 211 + all_releases = _fetch_github(url) 212 + releases = list(filter(lambda x: not x['prerelease'], all_releases)) 213 + 214 + if len(releases) == 0: 215 + raise ValueError(f"{homepage} does not contain any stable releases") 216 + 217 + versions = map(lambda x: strip_prefix(x['tag_name']), releases) 218 + version = _determine_latest_version(current_version, target, versions) 219 + 220 + release = next(filter(lambda x: strip_prefix(x['tag_name']) == version, releases)) 221 + prefix = get_prefix(release['tag_name']) 222 + try: 223 + sha256 = subprocess.check_output(["nix-prefetch-url", "--type", "sha256", "--unpack", f"{release['tarball_url']}"], stderr=subprocess.DEVNULL)\ 224 + .decode('utf-8').strip() 225 + except: 226 + # this may fail if they have both a branch and a tag of the same name, attempt tag name 227 + tag_url = str(release['tarball_url']).replace("tarball","tarball/refs/tags") 228 + sha256 = subprocess.check_output(["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url], stderr=subprocess.DEVNULL)\ 229 + .decode('utf-8').strip() 230 + 231 + 232 + return version, sha256, prefix 233 + 234 + def _get_latest_version_git(package, extension, current_version, target): 235 + """NOTE: Unimplemented!""" 236 + # attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"octavePackages.{package}") 237 + # try: 238 + # download_url = subprocess.check_output( 239 + # ["nix", "--extra-experimental-features", "nix-command", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"{attr_path}.src.url"])\ 240 + # .decode('utf-8') 241 + # except Exception as e: 242 + # raise ValueError(f"Unable to determine download link: {e}") 243 + 244 + # with tempfile.TemporaryDirectory(prefix=attr_path) as new_clone_location: 245 + # subprocess.run(["git", "clone", download_url, new_clone_location]) 246 + # newest_commit = subprocess.check_output( 247 + # ["git" "rev-parse" "$(git branch -r)" "|" "tail" "-n" "1"]).decode('utf-8') 248 + pass 249 + 250 + 251 + FETCHERS = { 252 + 'fetchFromGitHub' : _get_latest_version_github, 253 + 'fetchurl' : _get_latest_version_octave_packages, 254 + 'fetchgit' : _get_latest_version_git, 255 + } 256 + 257 + 258 + DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz' 259 + 260 + 261 + FORMATS = { 262 + 'setuptools' : DEFAULT_SETUPTOOLS_EXTENSION, 263 + } 264 + 265 + def _determine_fetcher(text): 266 + # Count occurrences of fetchers. 267 + nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys()) 268 + if nfetchers == 0: 269 + raise ValueError("no fetcher.") 270 + elif nfetchers > 1: 271 + raise ValueError("multiple fetchers.") 272 + else: 273 + # Then we check which fetcher to use. 274 + for fetcher in FETCHERS.keys(): 275 + if 'src = {}'.format(fetcher) in text: 276 + return fetcher 277 + 278 + 279 + def _determine_extension(text, fetcher): 280 + """Determine what extension is used in the expression. 281 + 282 + If we use: 283 + - fetchPypi, we check if format is specified. 284 + - fetchurl, we determine the extension from the url. 285 + - fetchFromGitHub we simply use `.tar.gz`. 286 + """ 287 + if fetcher == 'fetchurl': 288 + url = _get_unique_value('url', text) 289 + extension = os.path.splitext(url)[1] 290 + 291 + elif fetcher == 'fetchFromGitHub' or fetcher == 'fetchgit': 292 + if "fetchSubmodules" in text: 293 + raise ValueError("fetchFromGitHub fetcher doesn't support submodules") 294 + extension = "tar.gz" 295 + 296 + return extension 297 + 298 + 299 + def _update_package(path, target): 300 + 301 + # Read the expression 302 + with open(path, 'r') as f: 303 + text = f.read() 304 + 305 + # Determine pname. Many files have more than one pname 306 + pnames = _get_values('pname', text) 307 + 308 + # Determine version. 309 + version = _get_unique_value('version', text) 310 + 311 + # First we check how many fetchers are mentioned. 312 + fetcher = _determine_fetcher(text) 313 + 314 + extension = _determine_extension(text, fetcher) 315 + 316 + # Attempt a fetch using each pname, e.g. backports-zoneinfo vs backports.zoneinfo 317 + successful_fetch = False 318 + for pname in pnames: 319 + if fetcher == "fetchgit": 320 + logging.warning(f"You must update {pname} MANUALLY!") 321 + return { 'path': path, 'target': target, 'pname': pname, 322 + 'old_version': version, 'new_version': version } 323 + try: 324 + new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target) 325 + successful_fetch = True 326 + break 327 + except ValueError: 328 + continue 329 + 330 + if not successful_fetch: 331 + raise ValueError(f"Unable to find correct package using these pnames: {pnames}") 332 + 333 + if new_version == version: 334 + logging.info("Path {}: no update available for {}.".format(path, pname)) 335 + return False 336 + elif Version(new_version) <= Version(version): 337 + raise ValueError("downgrade for {}.".format(pname)) 338 + if not new_sha256: 339 + raise ValueError("no file available for {}.".format(pname)) 340 + 341 + text = _replace_value('version', new_version, text) 342 + # hashes from pypi are 16-bit encoded sha256's, normalize it to sri to avoid merge conflicts 343 + # sri hashes have been the default format since nix 2.4+ 344 + sri_hash = subprocess.check_output(["nix", "--extra-experimental-features", "nix-command", "hash", "to-sri", "--type", "sha256", new_sha256]).decode('utf-8').strip() 345 + 346 + 347 + # fetchers can specify a sha256, or a sri hash 348 + try: 349 + text = _replace_value('sha256', sri_hash, text) 350 + except ValueError: 351 + text = _replace_value('hash', sri_hash, text) 352 + 353 + if fetcher == 'fetchFromGitHub': 354 + # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";` 355 + # in which no string value is meant to be substituted. However, we can just overwrite the previous value. 356 + regex = '(rev\s+=\s+[^;]*;)' 357 + regex = re.compile(regex) 358 + matches = regex.findall(text) 359 + n = len(matches) 360 + 361 + if n == 0: 362 + raise ValueError("Unable to find rev value for {}.".format(pname)) 363 + else: 364 + # forcefully rewrite rev, incase tagging conventions changed for a release 365 + match = matches[0] 366 + text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";') 367 + # incase there's no prefix, just rewrite without interpolation 368 + text = text.replace('"${version}";', 'version;') 369 + 370 + with open(path, 'w') as f: 371 + f.write(text) 372 + 373 + logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version)) 374 + 375 + result = { 376 + 'path' : path, 377 + 'target': target, 378 + 'pname': pname, 379 + 'old_version' : version, 380 + 'new_version' : new_version, 381 + #'fetcher' : fetcher, 382 + } 383 + 384 + return result 385 + 386 + 387 + def _update(path, target): 388 + 389 + # We need to read and modify a Nix expression. 390 + if os.path.isdir(path): 391 + path = os.path.join(path, 'default.nix') 392 + 393 + # If a default.nix does not exist, we quit. 394 + if not os.path.isfile(path): 395 + logging.info("Path {}: does not exist.".format(path)) 396 + return False 397 + 398 + # If file is not a Nix expression, we quit. 399 + if not path.endswith(".nix"): 400 + logging.info("Path {}: does not end with `.nix`.".format(path)) 401 + return False 402 + 403 + try: 404 + return _update_package(path, target) 405 + except ValueError as e: 406 + logging.warning("Path {}: {}".format(path, e)) 407 + return False 408 + 409 + 410 + def _commit(path, pname, old_version, new_version, pkgs_prefix="octave: ", **kwargs): 411 + """Commit result. 412 + """ 413 + 414 + msg = f'{pkgs_prefix}{pname}: {old_version} -> {new_version}' 415 + 416 + try: 417 + subprocess.check_call([GIT, 'add', path]) 418 + subprocess.check_call([GIT, 'commit', '-m', msg]) 419 + except subprocess.CalledProcessError as e: 420 + subprocess.check_call([GIT, 'checkout', path]) 421 + raise subprocess.CalledProcessError(f'Could not commit {path}') from e 422 + 423 + return True 424 + 425 + 426 + def main(): 427 + 428 + epilog = """ 429 + environment variables: 430 + GITHUB_API_TOKEN\tGitHub API token used when updating github packages 431 + """ 432 + parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog) 433 + parser.add_argument('package', type=str, nargs='+') 434 + parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major') 435 + parser.add_argument('--commit', action='store_true', help='Create a commit for each package update') 436 + parser.add_argument('--use-pkgs-prefix', action='store_true', help='Use octavePackages.${pname}: instead of octave: ${pname}: when making commits') 437 + 438 + args = parser.parse_args() 439 + target = args.target 440 + 441 + packages = list(map(os.path.abspath, args.package)) 442 + 443 + logging.info("Updating packages...") 444 + 445 + # Use threads to update packages concurrently 446 + with Pool() as p: 447 + results = list(filter(bool, p.map(lambda pkg: _update(pkg, target), packages))) 448 + 449 + logging.info("Finished updating packages.") 450 + 451 + commit_options = {} 452 + if args.use_pkgs_prefix: 453 + logging.info("Using octavePackages. prefix for commits") 454 + commit_options["pkgs_prefix"] = "octavePackages." 455 + 456 + # Commits are created sequentially. 457 + if args.commit: 458 + logging.info("Committing updates...") 459 + # list forces evaluation 460 + list(map(lambda x: _commit(**x, **commit_options), results)) 461 + logging.info("Finished committing updates") 462 + 463 + count = len(results) 464 + logging.info("{} package(s) updated".format(count)) 465 + 466 + 467 + if __name__ == '__main__': 468 + main()
+12
maintainers/scripts/update-octave-shell.nix
··· 1 + { nixpkgs ? import ../.. { } 2 + }: 3 + with nixpkgs; 4 + let 5 + pyEnv = python3.withPackages(ps: with ps; [ packaging requests toolz pyyaml ]); 6 + in 7 + mkShell { 8 + packages = [ 9 + pyEnv 10 + nix-prefetch-scripts 11 + ]; 12 + }
+11 -1
pkgs/development/interpreters/octave/build-octave-package.nix
··· 62 62 ] 63 63 ++ nativeBuildInputs; 64 64 65 + passthru' = { 66 + updateScript = [ 67 + ../../../../maintainers/scripts/update-octave-packages 68 + (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file 69 + ]; 70 + } 71 + // passthru; 72 + 65 73 # This step is required because when 66 74 # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; }; 67 75 # (a // b).test = [ "c" "d" ]; 68 76 # This used to mean that if a package defined extra nativeBuildInputs, it 69 77 # would override the ones for building an Octave package (the hook and Octave 70 78 # itself, causing everything to fail. 71 - attrs' = builtins.removeAttrs attrs [ "nativeBuildInputs" ]; 79 + attrs' = builtins.removeAttrs attrs [ "nativeBuildInputs" "passthru" ]; 72 80 73 81 in stdenv.mkDerivation ({ 74 82 packageName = "${fullLibName}"; ··· 120 128 # We don't install here, because that's handled when we build the environment 121 129 # together with Octave. 122 130 dontInstall = true; 131 + 132 + passthru = passthru'; 123 133 124 134 inherit meta; 125 135 } // attrs')
+2 -2
pkgs/development/octave-modules/arduino/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "arduino"; 10 - version = "0.7.0"; 10 + version = "0.10.0"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0r0bcq2zkwba6ab6yi6czbhrj4adm9m9ggxmzzcd9h40ckqg6wjv"; 14 + sha256 = "sha256-p9SDTXkIwnrkNXeVhzAHks7EL4NdwBokrH2j9hqAJqQ="; 15 15 }; 16 16 17 17 requiredOctavePackages = [
+2 -2
pkgs/development/octave-modules/audio/default.nix
··· 9 9 10 10 buildOctavePackage rec { 11 11 pname = "audio"; 12 - version = "2.0.3"; 12 + version = "2.0.5"; 13 13 14 14 src = fetchurl { 15 15 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 16 - sha256 = "1431pf7mhxsrnzrx8r3hsy537kha7jhaligmp2rghwyxhq25hs0r"; 16 + sha256 = "sha256-/4akeeOQnvTlk9ah+e8RJfwJG2Eq2HAGOCejhiIUjF4="; 17 17 }; 18 18 19 19 nativeBuildInputs = [
+7 -5
pkgs/development/octave-modules/bim/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchFromGitHub 4 4 , fpl 5 5 , msh 6 6 }: 7 7 8 8 buildOctavePackage rec { 9 9 pname = "bim"; 10 - version = "1.1.5"; 10 + version = "1.1.6"; 11 11 12 - src = fetchurl { 13 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0y70w8mj80c5yns1j7nwngwwrxp1pa87kyz2n2yvmc3zdigcd6g8"; 12 + src = fetchFromGitHub { 13 + owner = "carlodefalco"; 14 + repo = "bim"; 15 + rev = "v${version}"; 16 + sha256 = "sha256-hgFb1KFE1KJC8skIaeT/7h/fg1aqRpedGnEPY24zZSI="; 15 17 }; 16 18 17 19 requiredOctavePackages = [
+2 -2
pkgs/development/octave-modules/communications/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "communications"; 10 - version = "1.2.3"; 10 + version = "1.2.4"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "1r4r0cia5l5fann1n78c1qdc6q8nizgb09n2fdwb76xnwjan23g3"; 14 + sha256 = "sha256-SfA81UP0c7VgroxSA/RZVVKZ4arl8Uhpf324F7yGFTo="; 15 15 }; 16 16 17 17 buildInputs = [
+2 -2
pkgs/development/octave-modules/control/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "control"; 10 - version = "3.3.1"; 10 + version = "3.4.0"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0vndbzix34vfzdlsz57bgkyg31as4kv6hfg9pwrcqn75bzzjsivw"; 14 + sha256 = "sha256-bsagbhOtKIr62GMcxB9yR+RwlvoejQQkDU7QHvvkp3o="; 15 15 }; 16 16 17 17 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/dicom/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "dicom"; 10 - version = "0.4.0"; 10 + version = "0.5.1"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "131wn6mrv20np10plirvqia8dlpz3g0aqi3mmn2wyl7r95p3dnza"; 14 + sha256 = "sha256-0qNqjpJWWBA0N5IgjV0e0SPQlCvbzIwnIgaWo+2wKw0="; 15 15 }; 16 16 17 17 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/ga/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "ga"; 8 - version = "0.10.2"; 8 + version = "0.10.3"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "0s5azn4n174avlmh5gw21zfqfkyxkzn4v09q4l9swv7ldmg3mirv"; 12 + sha256 = "sha256-cbP7ucua7DdxLL422INxjZxz/x1pHoIq+jkjrtfaabE="; 13 13 }; 14 14 15 15 meta = with lib; {
+2 -2
pkgs/development/octave-modules/general/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "general"; 10 - version = "2.1.1"; 10 + version = "2.1.2"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0jmvczssqz1aa665v9h8k9cchb7mg3n9af6b5kh9b2qcjl4r9l7v"; 14 + sha256 = "sha256-owzRp5dDxiUo2uRuvUqD+EiuRqHB2sPqq8NmYtQilM8="; 15 15 }; 16 16 17 17 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/generate_html/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "generate_html"; 8 - version = "0.3.2"; 8 + version = "0.3.3"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "1ai4h7jf9fqi7w565iprzylsh94pg4rhyf51hfj9kfdgdpb1abfs"; 12 + sha256 = "sha256-CHJ0+90+SNXmslLrQc+8aetSnHK0m9PqEBipFuFjwHw="; 13 13 }; 14 14 15 15 meta = with lib; {
+6 -5
pkgs/development/octave-modules/geometry/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchhg 4 4 , matgeom 5 5 }: 6 6 7 7 buildOctavePackage rec { 8 8 pname = "geometry"; 9 - version = "4.0.0"; 9 + version = "unstable-2021-07-07"; 10 10 11 - src = fetchurl { 12 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "1zmd97xir62fr5v57xifh2cvna5fg67h9yb7bp2vm3ll04y41lhs"; 11 + src = fetchhg { 12 + url = "http://hg.code.sf.net/p/octave/${pname}"; 13 + rev = "04965cda30b5f9e51774194c67879e7336df1710"; 14 + sha256 = "sha256-ECysYOJMF4gPiCFung9hFSlyyO60X3MGirQ9FlYDix8="; 14 15 }; 15 16 16 17 requiredOctavePackages = [
+2 -2
pkgs/development/octave-modules/instrument-control/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "instrument-control"; 8 - version = "0.7.0"; 8 + version = "0.8.0"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "0cdnnbxihz7chdkhkcgy46pvkij43z9alwr88627z7jaiaah6xby"; 12 + sha256 = "sha256-g3Pyz2b8hvg0MkFGA7cduYozcAd2UnqorBHzNs+Uuro="; 13 13 }; 14 14 15 15 meta = with lib; {
+2 -2
pkgs/development/octave-modules/interval/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "interval"; 9 - version = "3.2.0"; 9 + version = "3.2.1"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "0a0sz7b4y53qgk1xr4pannn4w7xiin2pf74x7r54hrr1wf4abp20"; 13 + sha256 = "sha256-OOUmQnN1cTIpqz2Gpf4/WghVB0fYQgVBcG/eqQk/3Og="; 14 14 }; 15 15 16 16 propagatedBuildInputs = [
+2 -2
pkgs/development/octave-modules/io/default.nix
··· 8 8 9 9 buildOctavePackage rec { 10 10 pname = "io"; 11 - version = "2.6.3"; 11 + version = "2.6.4"; 12 12 13 13 src = fetchurl { 14 14 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 15 - sha256 = "044y8lfp93fx0592mv6x2ss0nvjkjgvlci3c3ahav76pk1j3rikb"; 15 + sha256 = "sha256-p0pAC70ZIn9sB8WFiS3oec165S2CDaH2nxo+PolFL1o="; 16 16 }; 17 17 18 18 buildInputs = [
+7 -2
pkgs/development/octave-modules/mapping/default.nix
··· 3 3 , fetchurl 4 4 , io # >= 2.2.7 5 5 , geometry # >= 4.0.0 6 + , gdal 6 7 }: 7 8 8 9 buildOctavePackage rec { 9 10 pname = "mapping"; 10 - version = "1.4.1"; 11 + version = "1.4.2"; 11 12 12 13 src = fetchurl { 13 14 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0wj0q1rkrqs4qgpjh4vn9kcpdh94pzr6v4jc1vcrjwkp87yjv8c0"; 15 + sha256 = "sha256-mrUQWqC15Ul5AHDvhMlNStqIMG2Zxa+hB2vDyeizLaI="; 15 16 }; 17 + 18 + buildInputs = [ 19 + gdal 20 + ]; 16 21 17 22 requiredOctavePackages = [ 18 23 io
+7 -5
pkgs/development/octave-modules/msh/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchFromGitHub 4 4 # Octave Dependencies 5 5 , splines 6 6 # Other Dependencies ··· 13 13 14 14 buildOctavePackage rec { 15 15 pname = "msh"; 16 - version = "1.0.10"; 16 + version = "1.0.12"; 17 17 18 - src = fetchurl { 19 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 20 - sha256 = "1mb5qrp9y1w1cbzrd9v84430ldy57ca843yspnrgbcqpxyyxbgfz"; 18 + src = fetchFromGitHub { 19 + owner = "carlodefalco"; 20 + repo = "msh"; 21 + rev = "v${version}"; 22 + sha256 = "sha256-UnMrIruzm3ARoTgUlMMxfjTOMZw/znZUQJmj3VEOw8I="; 21 23 }; 22 24 23 25 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/nan/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "nan"; 9 - version = "3.6.0"; 9 + version = "3.7.0"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "1zxdg0yg5jnwq6ppnikd13zprazia6w6zpgw99f62mc03iqk5c4q"; 13 + sha256 = "sha256-d9J6BfNFeM5LtMqth0boSPd9giYU42KBnxrsUCmKK1s="; 14 14 }; 15 15 16 16 buildInputs = [
+2 -2
pkgs/development/octave-modules/ncarray/default.nix
··· 7 7 8 8 buildOctavePackage rec { 9 9 pname = "ncarray"; 10 - version = "1.0.4"; 10 + version = "1.0.5"; 11 11 12 12 src = fetchurl { 13 13 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "0v96iziikvq2v7hczhbfs9zmk49v99kn6z3lgibqqpwam175yqgd"; 14 + sha256 = "sha256-HhQWLUA/6wqYi6TP3PC+N2zgi4UojDxbG9pgQzFaQ8c="; 15 15 }; 16 16 17 17 buildInputs = [
+2 -2
pkgs/development/octave-modules/netcdf/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "netcdf"; 9 - version = "1.0.14"; 9 + version = "1.0.16"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "1wdwl76zgcg7kkdxjfjgf23ylzb0x4dyfliffylyl40g6cjym9lf"; 13 + sha256 = "sha256-1Lr+6xLRXxSeUhM9+WdCUPFRZSWdxtAQlxpiv4CHJrs="; 14 14 }; 15 15 16 16 buildInputs = [
+2 -2
pkgs/development/octave-modules/ocl/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "ocl"; 9 - version = "1.1.1"; 9 + version = "1.2.0"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "0ayi5x9zk9p4zm0qsr3i94lyp5468c9d1a7mqrqjqpdvkhrw0xnm"; 13 + sha256 = "sha256-jQdwZwQNU3PZZFa3lp0hIr0GDt/XFHLJoq4waLI4gS8="; 14 14 }; 15 15 16 16 meta = with lib; {
+7 -5
pkgs/development/octave-modules/octclip/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchFromBitbucket 4 4 }: 5 5 6 6 buildOctavePackage rec { 7 7 pname = "octclip"; 8 - version = "2.0.1"; 8 + version = "2.0.3"; 9 9 10 - src = fetchurl { 11 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "05ijh3izgfaan84n6zp690nap9vnz0zicjd0cgvd1c6askm7vxql"; 10 + src = fetchFromBitbucket { 11 + owner = "jgpallero"; 12 + repo = pname; 13 + rev = "OctCLIP-${version}"; 14 + sha256 = "sha256-gG2b8Ix6bzO6O7GRACE81JCVxfXW/+ZdfoniigAEq3g="; 13 15 }; 14 16 15 17 # The only compilation problem is that no formatting specifier was provided
+7 -6
pkgs/development/octave-modules/octproj/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchFromBitbucket 4 4 , proj # >= 6.3.0 5 5 }: 6 6 7 7 buildOctavePackage rec { 8 8 pname = "octproj"; 9 - version = "2.0.1"; 9 + version = "3.0.2"; 10 10 11 - src = fetchurl { 12 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "1mb8gb0r8kky47ap85h9qqdvs40mjp3ya0nkh45gqhy67ml06paq"; 11 + src = fetchFromBitbucket { 12 + owner = "jgpallero"; 13 + repo = pname; 14 + rev = "OctPROJ-${version}"; 15 + sha256 = "sha256-d/Zf172Etj+GA0cnGsQaKMjOmirE7Hwyj4UECpg7QFM="; 14 16 }; 15 17 16 18 # The sed changes below allow for the package to be compiled. ··· 28 30 license = licenses.gpl3Plus; 29 31 maintainers = with maintainers; [ KarlJoad ]; 30 32 description = "GNU Octave bindings to PROJ library for cartographic projections and CRS transformations"; 31 - broken = true; # error: unlink: operation failed: No such file or directory 32 33 }; 33 34 }
+2 -2
pkgs/development/octave-modules/optim/default.nix
··· 9 9 10 10 buildOctavePackage rec { 11 11 pname = "optim"; 12 - version = "1.6.1"; 12 + version = "1.6.2"; 13 13 14 14 src = fetchurl { 15 15 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 16 - sha256 = "1175bckiryz0i6zm8zvq7y5rq3lwkmhyiky1gbn33np9qzxcsl3i"; 16 + sha256 = "sha256-VUqOGLtxla6GH1BZwU8aVXhEJlwa3bW/vzq5iFUkeH4="; 17 17 }; 18 18 19 19 buildInputs = [
+2 -2
pkgs/development/octave-modules/optiminterp/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "optiminterp"; 9 - version = "0.3.6"; 9 + version = "0.3.7"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "05nzj2jmrczbnsr64w2a7kww19s6yialdqnsbg797v11ii7aiylc"; 13 + sha256 = "sha256-ubh/iOZlWTOYsTA6hJfPOituNBKTn2LbBnx+tmmSEug="; 14 14 }; 15 15 16 16 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/signal/default.nix
··· 6 6 7 7 buildOctavePackage rec { 8 8 pname = "signal"; 9 - version = "1.4.2"; 9 + version = "1.4.3"; 10 10 11 11 src = fetchurl { 12 12 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "YqTgYRfcxDw2FpkF+CVdAVSBypgq6ukBOw2d8+SOcGI="; 13 + sha256 = "sha256-VFuXVA6+ujtCDwiQb905d/wpOzvI/Db2uosJTOqI8zk="; 14 14 }; 15 15 16 16 requiredOctavePackages = [
+2 -2
pkgs/development/octave-modules/sockets/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "sockets"; 8 - version = "1.2.1"; 8 + version = "1.4.0"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "18f1zpqcf6h9b4fb0x2c5nvc3mvgj1141f1s8d9gnlhlrjlq8vqg"; 12 + sha256 = "sha256-GNwFLNV1u3UKJp9lhLtCclD2VSKC9Mko1hBoSn5dTpI="; 13 13 }; 14 14 15 15 meta = with lib; {
+7 -5
pkgs/development/octave-modules/statistics/default.nix
··· 1 1 { buildOctavePackage 2 2 , lib 3 - , fetchurl 3 + , fetchFromGitHub 4 4 , io 5 5 }: 6 6 7 7 buildOctavePackage rec { 8 8 pname = "statistics"; 9 - version = "1.4.2"; 9 + version = "1.5.4"; 10 10 11 - src = fetchurl { 12 - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 13 - sha256 = "0iv2hw3zp7h69n8ncfjfgm29xaihdl5gp2slcw1yf23mhd7q2xkr"; 11 + src = fetchFromGitHub { 12 + owner = "gnu-octave"; 13 + repo = "statistics"; 14 + rev = "refs/tags/release-${version}"; 15 + sha256 = "sha256-gFauFIaXKzcPeNvpWHv5FAxYQvZNh7ELrSUIvn43IfQ="; 14 16 }; 15 17 16 18 requiredOctavePackages = [
+2 -2
pkgs/development/octave-modules/stk/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "stk"; 8 - version = "2.6.1"; 8 + version = "2.7.0"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "1rqndfankwlwm4igw3xqpnrrl749zz1d5pjzh1qbfns7ixwrm19a"; 12 + sha256 = "sha256-vIf+XDLvLNOMwptFCgiqfl+o3PIQ+KLpsJhOArd7gMM="; 13 13 }; 14 14 15 15 meta = with lib; {
+9 -4
pkgs/development/octave-modules/strings/default.nix
··· 2 2 , stdenv 3 3 , lib 4 4 , fetchurl 5 - , pcre 5 + , pkg-config 6 + , pcre2 6 7 }: 7 8 8 9 buildOctavePackage rec { 9 10 pname = "strings"; 10 - version = "1.2.0"; 11 + version = "1.3.0"; 11 12 12 13 src = fetchurl { 13 14 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 14 - sha256 = "1b0ravfvq3bxd0w3axjfsx13mmmkifmqz6pfdgyf2s8vkqnp1qng"; 15 + sha256 = "sha256-agpTD9FN1qdp+BYdW5f+GZV0zqZMNzeOdymdo27mTOI="; 15 16 }; 16 17 18 + nativeBuildInputs = [ 19 + pkg-config 20 + ]; 21 + 17 22 buildInputs = [ 18 - pcre 23 + pcre2 19 24 ]; 20 25 21 26 # The gripes library no longer exists.
+2 -2
pkgs/development/octave-modules/struct/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "struct"; 8 - version = "1.0.17"; 8 + version = "1.0.18"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "0cw4cspkm553v019zsj2bsmal0i378pm0hv29w82j3v5vysvndq1"; 12 + sha256 = "sha256-/M6n3YTBEE7TurtHoo8F4AEqicKE85qwlAkEUJFSlM4="; 13 13 }; 14 14 15 15 meta = with lib; {
+2 -2
pkgs/development/octave-modules/video/default.nix
··· 8 8 9 9 buildOctavePackage rec { 10 10 pname = "video"; 11 - version = "2.0.0"; 11 + version = "2.0.2"; 12 12 13 13 src = fetchurl { 14 14 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 15 - sha256 = "0s6j3c4dh5nsbh84s7vnd2ajcayy1gn07b4fcyrcynch3wl28mrv"; 15 + sha256 = "sha256-bZNaRnmJl5UF0bQMNoEWvoIXJaB0E6/V9eChE725OHY="; 16 16 }; 17 17 18 18 nativeBuildInputs = [
+2 -2
pkgs/development/octave-modules/windows/default.nix
··· 5 5 6 6 buildOctavePackage rec { 7 7 pname = "windows"; 8 - version = "1.6.1"; 8 + version = "1.6.3"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 12 - sha256 = "110dh6jz088c4fxp9gw79kfib0dl7r3rkcavxx4xpk7bjl2l3xb6"; 12 + sha256 = "sha256-U5Fe5mTn/ms8w9j6NdEtiRFZkKeyV0I3aR+zYQw4yIs="; 13 13 }; 14 14 15 15 meta = with lib; {
+2 -2
pkgs/development/octave-modules/zeromq/default.nix
··· 8 8 9 9 buildOctavePackage rec { 10 10 pname = "zeromq"; 11 - version = "1.5.3"; 11 + version = "1.5.5"; 12 12 13 13 src = fetchurl { 14 14 url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; 15 - sha256 = "1h0pb2pqbnyiavf7r05j8bqxqd8syz16ab48hc74nlnx727anfwl"; 15 + sha256 = "sha256-MAZEpbVuragVuXrMJ8q5/jU5cTchosAtrAR6ElLwfss="; 16 16 }; 17 17 18 18 preAutoreconf = ''