From 17ea94881f78ff37d0123bc67ee82471d6d014ca Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Thu, 22 Dec 2022 13:29:17 -0600 Subject: [PATCH 1/7] octavePackages: add automatic updating script based on Python's This script is heavily based on the script used to update all python libraries at pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py The Octave Packages' website uses YAML as their basis, so we must reformat to use YAML instead of JSON. --- maintainers/scripts/update-octave-packages | 468 ++++++++++++++++++ maintainers/scripts/update-octave-shell.nix | 12 + .../octave/build-octave-package.nix | 12 +- 3 files changed, 491 insertions(+), 1 deletion(-) create mode 100755 maintainers/scripts/update-octave-packages create mode 100644 maintainers/scripts/update-octave-shell.nix diff --git a/maintainers/scripts/update-octave-packages b/maintainers/scripts/update-octave-packages new file mode 100755 index 000000000000..00a1646184d5 --- /dev/null +++ b/maintainers/scripts/update-octave-packages @@ -0,0 +1,468 @@ +#!/usr/bin/env nix-shell +#!nix-shell update-octave-shell.nix -i python3 + +""" +Update a Octave package expression by passing in the `.nix` file, or the directory containing it. +You can pass in multiple files or paths. + +You'll likely want to use +`` + $ ./update-octave-libraries ../../pkgs/development/octave-modules/**/default.nix +`` +to update all non-pinned libraries in that folder. +""" + +import argparse +import os +import pathlib +import re +import requests +import yaml +from concurrent.futures import ThreadPoolExecutor as Pool +from packaging.version import Version as _Version +from packaging.version import InvalidVersion +from packaging.specifiers import SpecifierSet +import collections +import subprocess +import tempfile + +INDEX = "https://raw.githubusercontent.com/gnu-octave/packages/main/packages" +"""url of Octave packages' source on GitHub""" + +EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip'] +"""Permitted file extensions. These are evaluated from left to right and the first occurance is returned.""" + +PRERELEASES = False + +GIT = "git" + +NIXPGKS_ROOT = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode('utf-8').strip() + +import logging +logging.basicConfig(level=logging.INFO) + + +class Version(_Version, collections.abc.Sequence): + + def __init__(self, version): + super().__init__(version) + # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21` + # https://github.com/avian2/unidecode/issues/13#issuecomment-354538882 + self.raw_version = version + + def __getitem__(self, i): + return self._version.release[i] + + def __len__(self): + return len(self._version.release) + + def __iter__(self): + yield from self._version.release + + +def _get_values(attribute, text): + """Match attribute in text and return all matches. + + :returns: List of matches. + """ + regex = '{}\s+=\s+"(.*)";'.format(attribute) + regex = re.compile(regex) + values = regex.findall(text) + return values + +def _get_unique_value(attribute, text): + """Match attribute in text and return unique match. + + :returns: Single match. + """ + values = _get_values(attribute, text) + n = len(values) + if n > 1: + raise ValueError("found too many values for {}".format(attribute)) + elif n == 1: + return values[0] + else: + raise ValueError("no value found for {}".format(attribute)) + +def _get_line_and_value(attribute, text): + """Match attribute in text. Return the line and the value of the attribute.""" + regex = '({}\s+=\s+"(.*)";)'.format(attribute) + regex = re.compile(regex) + value = regex.findall(text) + n = len(value) + if n > 1: + raise ValueError("found too many values for {}".format(attribute)) + elif n == 1: + return value[0] + else: + raise ValueError("no value found for {}".format(attribute)) + + +def _replace_value(attribute, value, text): + """Search and replace value of attribute in text.""" + old_line, old_value = _get_line_and_value(attribute, text) + new_line = old_line.replace(old_value, value) + new_text = text.replace(old_line, new_line) + return new_text + + +def _fetch_page(url): + r = requests.get(url) + if r.status_code == requests.codes.ok: + return list(yaml.safe_load_all(r.content))[0] + else: + raise ValueError("request for {} failed".format(url)) + + +def _fetch_github(url): + headers = {} + token = os.environ.get('GITHUB_API_TOKEN') + if token: + headers["Authorization"] = f"token {token}" + r = requests.get(url, headers=headers) + + if r.status_code == requests.codes.ok: + return r.json() + else: + raise ValueError("request for {} failed".format(url)) + + +SEMVER = { + 'major' : 0, + 'minor' : 1, + 'patch' : 2, +} + + +def _determine_latest_version(current_version, target, versions): + """Determine latest version, given `target`, returning the more recent version. + """ + current_version = Version(current_version) + + def _parse_versions(versions): + for v in versions: + try: + yield Version(v) + except InvalidVersion: + pass + + versions = _parse_versions(versions) + + index = SEMVER[target] + + ceiling = list(current_version[0:index]) + if len(ceiling) == 0: + ceiling = None + else: + ceiling[-1]+=1 + ceiling = Version(".".join(map(str, ceiling))) + + # We do not want prereleases + versions = SpecifierSet(prereleases=PRERELEASES).filter(versions) + + if ceiling is not None: + versions = SpecifierSet(f"<{ceiling}").filter(versions) + + return (max(sorted(versions))).raw_version + + +def _get_latest_version_octave_packages(package, extension, current_version, target): + """Get latest version and hash from Octave Packages.""" + url = "{}/{}.yaml".format(INDEX, package) + yaml = _fetch_page(url) + + versions = list(map(lambda pv: pv['id'], yaml['versions'])) + version = _determine_latest_version(current_version, target, versions) + + try: + releases = [v if v['id'] == version else None for v in yaml['versions']] + except KeyError as e: + raise KeyError('Could not find version {} for {}'.format(version, package)) from e + for release in releases: + if release['url'].endswith(extension): + sha256 = release['sha256'] + break + else: + sha256 = None + return version, sha256, None + + +def _get_latest_version_github(package, extension, current_version, target): + def strip_prefix(tag): + return re.sub("^[^0-9]*", "", tag) + + def get_prefix(string): + matches = re.findall(r"^([^0-9]*)", string) + return next(iter(matches), "") + + # when invoked as an updateScript, UPDATE_NIX_ATTR_PATH will be set + # this allows us to work with packages which live outside of octave-modules + attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"octavePackages.{package}") + try: + homepage = subprocess.check_output( + ["nix", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"{attr_path}.src.meta.homepage"])\ + .decode('utf-8') + except Exception as e: + raise ValueError(f"Unable to determine homepage: {e}") + owner_repo = homepage[len("https://github.com/"):] # remove prefix + owner, repo = owner_repo.split("/") + + url = f"https://api.github.com/repos/{owner}/{repo}/releases" + all_releases = _fetch_github(url) + releases = list(filter(lambda x: not x['prerelease'], all_releases)) + + if len(releases) == 0: + raise ValueError(f"{homepage} does not contain any stable releases") + + versions = map(lambda x: strip_prefix(x['tag_name']), releases) + version = _determine_latest_version(current_version, target, versions) + + release = next(filter(lambda x: strip_prefix(x['tag_name']) == version, releases)) + prefix = get_prefix(release['tag_name']) + try: + sha256 = subprocess.check_output(["nix-prefetch-url", "--type", "sha256", "--unpack", f"{release['tarball_url']}"], stderr=subprocess.DEVNULL)\ + .decode('utf-8').strip() + except: + # this may fail if they have both a branch and a tag of the same name, attempt tag name + tag_url = str(release['tarball_url']).replace("tarball","tarball/refs/tags") + sha256 = subprocess.check_output(["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url], stderr=subprocess.DEVNULL)\ + .decode('utf-8').strip() + + + return version, sha256, prefix + +def _get_latest_version_git(package, extension, current_version, target): + """NOTE: Unimplemented!""" + # attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"octavePackages.{package}") + # try: + # download_url = subprocess.check_output( + # ["nix", "--extra-experimental-features", "nix-command", "eval", "-f", f"{NIXPGKS_ROOT}/default.nix", "--raw", f"{attr_path}.src.url"])\ + # .decode('utf-8') + # except Exception as e: + # raise ValueError(f"Unable to determine download link: {e}") + + # with tempfile.TemporaryDirectory(prefix=attr_path) as new_clone_location: + # subprocess.run(["git", "clone", download_url, new_clone_location]) + # newest_commit = subprocess.check_output( + # ["git" "rev-parse" "$(git branch -r)" "|" "tail" "-n" "1"]).decode('utf-8') + pass + + +FETCHERS = { + 'fetchFromGitHub' : _get_latest_version_github, + 'fetchurl' : _get_latest_version_octave_packages, + 'fetchgit' : _get_latest_version_git, +} + + +DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz' + + +FORMATS = { + 'setuptools' : DEFAULT_SETUPTOOLS_EXTENSION, +} + +def _determine_fetcher(text): + # Count occurrences of fetchers. + nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys()) + if nfetchers == 0: + raise ValueError("no fetcher.") + elif nfetchers > 1: + raise ValueError("multiple fetchers.") + else: + # Then we check which fetcher to use. + for fetcher in FETCHERS.keys(): + if 'src = {}'.format(fetcher) in text: + return fetcher + + +def _determine_extension(text, fetcher): + """Determine what extension is used in the expression. + + If we use: + - fetchPypi, we check if format is specified. + - fetchurl, we determine the extension from the url. + - fetchFromGitHub we simply use `.tar.gz`. + """ + if fetcher == 'fetchurl': + url = _get_unique_value('url', text) + extension = os.path.splitext(url)[1] + + elif fetcher == 'fetchFromGitHub' or fetcher == 'fetchgit': + if "fetchSubmodules" in text: + raise ValueError("fetchFromGitHub fetcher doesn't support submodules") + extension = "tar.gz" + + return extension + + +def _update_package(path, target): + + # Read the expression + with open(path, 'r') as f: + text = f.read() + + # Determine pname. Many files have more than one pname + pnames = _get_values('pname', text) + + # Determine version. + version = _get_unique_value('version', text) + + # First we check how many fetchers are mentioned. + fetcher = _determine_fetcher(text) + + extension = _determine_extension(text, fetcher) + + # Attempt a fetch using each pname, e.g. backports-zoneinfo vs backports.zoneinfo + successful_fetch = False + for pname in pnames: + if fetcher == "fetchgit": + logging.warning(f"You must update {pname} MANUALLY!") + return { 'path': path, 'target': target, 'pname': pname, + 'old_version': version, 'new_version': version } + try: + new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target) + successful_fetch = True + break + except ValueError: + continue + + if not successful_fetch: + raise ValueError(f"Unable to find correct package using these pnames: {pnames}") + + if new_version == version: + logging.info("Path {}: no update available for {}.".format(path, pname)) + return False + elif Version(new_version) <= Version(version): + raise ValueError("downgrade for {}.".format(pname)) + if not new_sha256: + raise ValueError("no file available for {}.".format(pname)) + + text = _replace_value('version', new_version, text) + # hashes from pypi are 16-bit encoded sha256's, normalize it to sri to avoid merge conflicts + # sri hashes have been the default format since nix 2.4+ + sri_hash = subprocess.check_output(["nix", "--extra-experimental-features", "nix-command", "hash", "to-sri", "--type", "sha256", new_sha256]).decode('utf-8').strip() + + + # fetchers can specify a sha256, or a sri hash + try: + text = _replace_value('sha256', sri_hash, text) + except ValueError: + text = _replace_value('hash', sri_hash, text) + + if fetcher == 'fetchFromGitHub': + # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";` + # in which no string value is meant to be substituted. However, we can just overwrite the previous value. + regex = '(rev\s+=\s+[^;]*;)' + regex = re.compile(regex) + matches = regex.findall(text) + n = len(matches) + + if n == 0: + raise ValueError("Unable to find rev value for {}.".format(pname)) + else: + # forcefully rewrite rev, incase tagging conventions changed for a release + match = matches[0] + text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";') + # incase there's no prefix, just rewrite without interpolation + text = text.replace('"${version}";', 'version;') + + with open(path, 'w') as f: + f.write(text) + + logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version)) + + result = { + 'path' : path, + 'target': target, + 'pname': pname, + 'old_version' : version, + 'new_version' : new_version, + #'fetcher' : fetcher, + } + + return result + + +def _update(path, target): + + # We need to read and modify a Nix expression. + if os.path.isdir(path): + path = os.path.join(path, 'default.nix') + + # If a default.nix does not exist, we quit. + if not os.path.isfile(path): + logging.info("Path {}: does not exist.".format(path)) + return False + + # If file is not a Nix expression, we quit. + if not path.endswith(".nix"): + logging.info("Path {}: does not end with `.nix`.".format(path)) + return False + + try: + return _update_package(path, target) + except ValueError as e: + logging.warning("Path {}: {}".format(path, e)) + return False + + +def _commit(path, pname, old_version, new_version, pkgs_prefix="octave: ", **kwargs): + """Commit result. + """ + + msg = f'{pkgs_prefix}{pname}: {old_version} -> {new_version}' + + try: + subprocess.check_call([GIT, 'add', path]) + subprocess.check_call([GIT, 'commit', '-m', msg]) + except subprocess.CalledProcessError as e: + subprocess.check_call([GIT, 'checkout', path]) + raise subprocess.CalledProcessError(f'Could not commit {path}') from e + + return True + + +def main(): + + epilog = """ +environment variables: + GITHUB_API_TOKEN\tGitHub API token used when updating github packages + """ + parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog) + parser.add_argument('package', type=str, nargs='+') + parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major') + parser.add_argument('--commit', action='store_true', help='Create a commit for each package update') + parser.add_argument('--use-pkgs-prefix', action='store_true', help='Use octavePackages.${pname}: instead of octave: ${pname}: when making commits') + + args = parser.parse_args() + target = args.target + + packages = list(map(os.path.abspath, args.package)) + + logging.info("Updating packages...") + + # Use threads to update packages concurrently + with Pool() as p: + results = list(filter(bool, p.map(lambda pkg: _update(pkg, target), packages))) + + logging.info("Finished updating packages.") + + commit_options = {} + if args.use_pkgs_prefix: + logging.info("Using octavePackages. prefix for commits") + commit_options["pkgs_prefix"] = "octavePackages." + + # Commits are created sequentially. + if args.commit: + logging.info("Committing updates...") + # list forces evaluation + list(map(lambda x: _commit(**x, **commit_options), results)) + logging.info("Finished committing updates") + + count = len(results) + logging.info("{} package(s) updated".format(count)) + + +if __name__ == '__main__': + main() diff --git a/maintainers/scripts/update-octave-shell.nix b/maintainers/scripts/update-octave-shell.nix new file mode 100644 index 000000000000..51d4844c79f3 --- /dev/null +++ b/maintainers/scripts/update-octave-shell.nix @@ -0,0 +1,12 @@ +{ nixpkgs ? import ../.. { } +}: +with nixpkgs; +let + pyEnv = python3.withPackages(ps: with ps; [ packaging requests toolz pyyaml ]); +in +mkShell { + packages = [ + pyEnv + nix-prefetch-scripts + ]; +} diff --git a/pkgs/development/interpreters/octave/build-octave-package.nix b/pkgs/development/interpreters/octave/build-octave-package.nix index 065992f91271..30f9bc3b5e1c 100644 --- a/pkgs/development/interpreters/octave/build-octave-package.nix +++ b/pkgs/development/interpreters/octave/build-octave-package.nix @@ -62,13 +62,21 @@ let ] ++ nativeBuildInputs; + passthru' = { + updateScript = [ + ../../../../maintainers/scripts/update-octave-packages + (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file + ]; + } + // passthru; + # This step is required because when # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; }; # (a // b).test = [ "c" "d" ]; # This used to mean that if a package defined extra nativeBuildInputs, it # would override the ones for building an Octave package (the hook and Octave # itself, causing everything to fail. - attrs' = builtins.removeAttrs attrs [ "nativeBuildInputs" ]; + attrs' = builtins.removeAttrs attrs [ "nativeBuildInputs" "passthru" ]; in stdenv.mkDerivation ({ packageName = "${fullLibName}"; @@ -121,5 +129,7 @@ in stdenv.mkDerivation ({ # together with Octave. dontInstall = true; + passthru = passthru'; + inherit meta; } // attrs') From be699cf06b37f1ec9e5a22b7b3273ea15827d445 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 23 Dec 2022 10:48:21 -0600 Subject: [PATCH 2/7] octavePackages: run update script on all packages octavePackages.arduino: 0.7.0 -> 0.10.0 octavePackages.audio: 2.0.3 -> 2.0.5 octavePackages.bim: 1.1.5 -> 1.1.6 octavePackages.communications: 1.2.3 -> 1.2.4 octavePackages.control: 3.3.1 -> 3.4.0 octavePackages.dicom: 0.4.0 -> 0.5.1 octavePackages.ga: 0.10.2 -> 0.10.3 octavePackages.general: 2.1.1 -> 2.1.2 octavePackages.generate_html: 0.3.2 -> 0.3.3 octavePackages.image: 2.12.0 -> 2.14.0 octavePackages.instrument-control: 0.7.0 -> 0.8.0 octavePackages.interval: 3.2.0 -> 3.2.1 octavePackages.io: 2.6.3 -> 2.6.4 octavePackages.mapping: 1.4.1 -> 1.4.2 octavePackages.msh: 1.0.10 -> 1.0.12 octavePackages.nan: 3.6.0 -> 3.7.0 octavePackages.ncarray: 1.0.4 -> 1.0.5 octavePackages.netcdf: 1.0.14 -> 1.0.16 octavePackages.ocl: 1.1.1 -> 1.2.0 octavePackages.octclip: 2.0.1 -> 2.0.3 octavePackages.octproj: 2.0.1 -> 3.0.2 octavePackages.optim: 1.6.1 -> 1.6.2 octavePackages.optiminterp: 0.3.6 -> 0.3.7 octavePackages.signal: 1.4.2 -> 1.4.3 octavePackages.sockets: 1.2.1 -> 1.4.0 octavePackages.statistics: 1.4.2 -> 1.5.2 octavePackages.stk: 2.6.1 -> 2.7.0 octavePackages.strings: 1.2.0 -> 1.3.0 octavePackages.struct: 1.0.17 -> 1.0.18 octavePackages.video: 2.0.0 -> 2.0.2 octavePackages.windows: 1.6.1 -> 1.6.3 octavePackages.zeromq: 1.5.3 -> 1.5.5 --- pkgs/development/octave-modules/arduino/default.nix | 4 ++-- pkgs/development/octave-modules/audio/default.nix | 4 ++-- pkgs/development/octave-modules/bim/default.nix | 4 ++-- pkgs/development/octave-modules/communications/default.nix | 4 ++-- pkgs/development/octave-modules/control/default.nix | 4 ++-- pkgs/development/octave-modules/dicom/default.nix | 4 ++-- pkgs/development/octave-modules/ga/default.nix | 4 ++-- pkgs/development/octave-modules/general/default.nix | 4 ++-- pkgs/development/octave-modules/generate_html/default.nix | 4 ++-- .../development/octave-modules/instrument-control/default.nix | 4 ++-- pkgs/development/octave-modules/interval/default.nix | 4 ++-- pkgs/development/octave-modules/io/default.nix | 4 ++-- pkgs/development/octave-modules/mapping/default.nix | 4 ++-- pkgs/development/octave-modules/msh/default.nix | 4 ++-- pkgs/development/octave-modules/nan/default.nix | 4 ++-- pkgs/development/octave-modules/ncarray/default.nix | 4 ++-- pkgs/development/octave-modules/netcdf/default.nix | 4 ++-- pkgs/development/octave-modules/ocl/default.nix | 4 ++-- pkgs/development/octave-modules/octclip/default.nix | 4 ++-- pkgs/development/octave-modules/octproj/default.nix | 4 ++-- pkgs/development/octave-modules/optim/default.nix | 4 ++-- pkgs/development/octave-modules/optiminterp/default.nix | 4 ++-- pkgs/development/octave-modules/signal/default.nix | 4 ++-- pkgs/development/octave-modules/sockets/default.nix | 4 ++-- pkgs/development/octave-modules/statistics/default.nix | 4 ++-- pkgs/development/octave-modules/stk/default.nix | 4 ++-- pkgs/development/octave-modules/strings/default.nix | 4 ++-- pkgs/development/octave-modules/struct/default.nix | 4 ++-- pkgs/development/octave-modules/video/default.nix | 4 ++-- pkgs/development/octave-modules/windows/default.nix | 4 ++-- pkgs/development/octave-modules/zeromq/default.nix | 4 ++-- 31 files changed, 62 insertions(+), 62 deletions(-) diff --git a/pkgs/development/octave-modules/arduino/default.nix b/pkgs/development/octave-modules/arduino/default.nix index fd97c55a40e9..3cd5838590f8 100644 --- a/pkgs/development/octave-modules/arduino/default.nix +++ b/pkgs/development/octave-modules/arduino/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "arduino"; - version = "0.7.0"; + version = "0.10.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0r0bcq2zkwba6ab6yi6czbhrj4adm9m9ggxmzzcd9h40ckqg6wjv"; + sha256 = "sha256-p9SDTXkIwnrkNXeVhzAHks7EL4NdwBokrH2j9hqAJqQ="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/audio/default.nix b/pkgs/development/octave-modules/audio/default.nix index c0b4551ceca7..6e00dd05fdd4 100644 --- a/pkgs/development/octave-modules/audio/default.nix +++ b/pkgs/development/octave-modules/audio/default.nix @@ -9,11 +9,11 @@ buildOctavePackage rec { pname = "audio"; - version = "2.0.3"; + version = "2.0.5"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1431pf7mhxsrnzrx8r3hsy537kha7jhaligmp2rghwyxhq25hs0r"; + sha256 = "sha256-/4akeeOQnvTlk9ah+e8RJfwJG2Eq2HAGOCejhiIUjF4="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/bim/default.nix b/pkgs/development/octave-modules/bim/default.nix index 5dc8ca88710d..56865493e46b 100644 --- a/pkgs/development/octave-modules/bim/default.nix +++ b/pkgs/development/octave-modules/bim/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "bim"; - version = "1.1.5"; + version = "1.1.6"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0y70w8mj80c5yns1j7nwngwwrxp1pa87kyz2n2yvmc3zdigcd6g8"; + sha256 = "sha256-pv64swrPlgopBlubpAlfoD9KJlOSgF9wdbgdHHTcr9c="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/communications/default.nix b/pkgs/development/octave-modules/communications/default.nix index 6c517ec6e5b6..8348aba3c3e9 100644 --- a/pkgs/development/octave-modules/communications/default.nix +++ b/pkgs/development/octave-modules/communications/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "communications"; - version = "1.2.3"; + version = "1.2.4"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1r4r0cia5l5fann1n78c1qdc6q8nizgb09n2fdwb76xnwjan23g3"; + sha256 = "sha256-SfA81UP0c7VgroxSA/RZVVKZ4arl8Uhpf324F7yGFTo="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/control/default.nix b/pkgs/development/octave-modules/control/default.nix index 79dbb99fadff..c265fe71d492 100644 --- a/pkgs/development/octave-modules/control/default.nix +++ b/pkgs/development/octave-modules/control/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "control"; - version = "3.3.1"; + version = "3.4.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0vndbzix34vfzdlsz57bgkyg31as4kv6hfg9pwrcqn75bzzjsivw"; + sha256 = "sha256-bsagbhOtKIr62GMcxB9yR+RwlvoejQQkDU7QHvvkp3o="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/dicom/default.nix b/pkgs/development/octave-modules/dicom/default.nix index e16b6447805e..e8f02deff546 100644 --- a/pkgs/development/octave-modules/dicom/default.nix +++ b/pkgs/development/octave-modules/dicom/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "dicom"; - version = "0.4.0"; + version = "0.5.1"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "131wn6mrv20np10plirvqia8dlpz3g0aqi3mmn2wyl7r95p3dnza"; + sha256 = "sha256-0qNqjpJWWBA0N5IgjV0e0SPQlCvbzIwnIgaWo+2wKw0="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/ga/default.nix b/pkgs/development/octave-modules/ga/default.nix index a5265a4ce450..83d444959423 100644 --- a/pkgs/development/octave-modules/ga/default.nix +++ b/pkgs/development/octave-modules/ga/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "ga"; - version = "0.10.2"; + version = "0.10.3"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0s5azn4n174avlmh5gw21zfqfkyxkzn4v09q4l9swv7ldmg3mirv"; + sha256 = "sha256-cbP7ucua7DdxLL422INxjZxz/x1pHoIq+jkjrtfaabE="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/general/default.nix b/pkgs/development/octave-modules/general/default.nix index 52ad9af93b0f..8dabd86ef933 100644 --- a/pkgs/development/octave-modules/general/default.nix +++ b/pkgs/development/octave-modules/general/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "general"; - version = "2.1.1"; + version = "2.1.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0jmvczssqz1aa665v9h8k9cchb7mg3n9af6b5kh9b2qcjl4r9l7v"; + sha256 = "sha256-owzRp5dDxiUo2uRuvUqD+EiuRqHB2sPqq8NmYtQilM8="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/generate_html/default.nix b/pkgs/development/octave-modules/generate_html/default.nix index 83f3a65bedc2..2082aa7f8207 100644 --- a/pkgs/development/octave-modules/generate_html/default.nix +++ b/pkgs/development/octave-modules/generate_html/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "generate_html"; - version = "0.3.2"; + version = "0.3.3"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1ai4h7jf9fqi7w565iprzylsh94pg4rhyf51hfj9kfdgdpb1abfs"; + sha256 = "sha256-CHJ0+90+SNXmslLrQc+8aetSnHK0m9PqEBipFuFjwHw="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/instrument-control/default.nix b/pkgs/development/octave-modules/instrument-control/default.nix index 17d9186da745..0b5429bd278c 100644 --- a/pkgs/development/octave-modules/instrument-control/default.nix +++ b/pkgs/development/octave-modules/instrument-control/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "instrument-control"; - version = "0.7.0"; + version = "0.8.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0cdnnbxihz7chdkhkcgy46pvkij43z9alwr88627z7jaiaah6xby"; + sha256 = "sha256-g3Pyz2b8hvg0MkFGA7cduYozcAd2UnqorBHzNs+Uuro="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/interval/default.nix b/pkgs/development/octave-modules/interval/default.nix index 0891a6143852..8cf9d555678c 100644 --- a/pkgs/development/octave-modules/interval/default.nix +++ b/pkgs/development/octave-modules/interval/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "interval"; - version = "3.2.0"; + version = "3.2.1"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0a0sz7b4y53qgk1xr4pannn4w7xiin2pf74x7r54hrr1wf4abp20"; + sha256 = "sha256-OOUmQnN1cTIpqz2Gpf4/WghVB0fYQgVBcG/eqQk/3Og="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/octave-modules/io/default.nix b/pkgs/development/octave-modules/io/default.nix index 57058c5f95de..42effce5a045 100644 --- a/pkgs/development/octave-modules/io/default.nix +++ b/pkgs/development/octave-modules/io/default.nix @@ -8,11 +8,11 @@ buildOctavePackage rec { pname = "io"; - version = "2.6.3"; + version = "2.6.4"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "044y8lfp93fx0592mv6x2ss0nvjkjgvlci3c3ahav76pk1j3rikb"; + sha256 = "sha256-p0pAC70ZIn9sB8WFiS3oec165S2CDaH2nxo+PolFL1o="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/mapping/default.nix b/pkgs/development/octave-modules/mapping/default.nix index 26cea27a7253..2c91fad72264 100644 --- a/pkgs/development/octave-modules/mapping/default.nix +++ b/pkgs/development/octave-modules/mapping/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "mapping"; - version = "1.4.1"; + version = "1.4.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0wj0q1rkrqs4qgpjh4vn9kcpdh94pzr6v4jc1vcrjwkp87yjv8c0"; + sha256 = "sha256-mrUQWqC15Ul5AHDvhMlNStqIMG2Zxa+hB2vDyeizLaI="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/msh/default.nix b/pkgs/development/octave-modules/msh/default.nix index a4e876c8128f..8ce1341419c0 100644 --- a/pkgs/development/octave-modules/msh/default.nix +++ b/pkgs/development/octave-modules/msh/default.nix @@ -13,11 +13,11 @@ buildOctavePackage rec { pname = "msh"; - version = "1.0.10"; + version = "1.0.12"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1mb5qrp9y1w1cbzrd9v84430ldy57ca843yspnrgbcqpxyyxbgfz"; + sha256 = "sha256-7xbB+RXq5SE7Ke5rNwSo/mqdSZTzCLXRhS4zdfGz55s="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/nan/default.nix b/pkgs/development/octave-modules/nan/default.nix index 3a972b76fdc6..e71d984a5eac 100644 --- a/pkgs/development/octave-modules/nan/default.nix +++ b/pkgs/development/octave-modules/nan/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "nan"; - version = "3.6.0"; + version = "3.7.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1zxdg0yg5jnwq6ppnikd13zprazia6w6zpgw99f62mc03iqk5c4q"; + sha256 = "sha256-d9J6BfNFeM5LtMqth0boSPd9giYU42KBnxrsUCmKK1s="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/ncarray/default.nix b/pkgs/development/octave-modules/ncarray/default.nix index 10db554c87fc..c028ba7f1d3e 100644 --- a/pkgs/development/octave-modules/ncarray/default.nix +++ b/pkgs/development/octave-modules/ncarray/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "ncarray"; - version = "1.0.4"; + version = "1.0.5"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0v96iziikvq2v7hczhbfs9zmk49v99kn6z3lgibqqpwam175yqgd"; + sha256 = "sha256-HhQWLUA/6wqYi6TP3PC+N2zgi4UojDxbG9pgQzFaQ8c="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/netcdf/default.nix b/pkgs/development/octave-modules/netcdf/default.nix index 9292da6918cd..1eed28253580 100644 --- a/pkgs/development/octave-modules/netcdf/default.nix +++ b/pkgs/development/octave-modules/netcdf/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "netcdf"; - version = "1.0.14"; + version = "1.0.16"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1wdwl76zgcg7kkdxjfjgf23ylzb0x4dyfliffylyl40g6cjym9lf"; + sha256 = "sha256-1Lr+6xLRXxSeUhM9+WdCUPFRZSWdxtAQlxpiv4CHJrs="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/ocl/default.nix b/pkgs/development/octave-modules/ocl/default.nix index 095b386e0736..21ba508500e9 100644 --- a/pkgs/development/octave-modules/ocl/default.nix +++ b/pkgs/development/octave-modules/ocl/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "ocl"; - version = "1.1.1"; + version = "1.2.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0ayi5x9zk9p4zm0qsr3i94lyp5468c9d1a7mqrqjqpdvkhrw0xnm"; + sha256 = "sha256-jQdwZwQNU3PZZFa3lp0hIr0GDt/XFHLJoq4waLI4gS8="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/octclip/default.nix b/pkgs/development/octave-modules/octclip/default.nix index 43bcfcd7d849..d8c607c391bd 100644 --- a/pkgs/development/octave-modules/octclip/default.nix +++ b/pkgs/development/octave-modules/octclip/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "octclip"; - version = "2.0.1"; + version = "2.0.3"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "05ijh3izgfaan84n6zp690nap9vnz0zicjd0cgvd1c6askm7vxql"; + sha256 = "sha256-u6wvCibdkLgmC8Q2LlpVLfXR3LYtssYlO2cRqYPmmR8="; }; # The only compilation problem is that no formatting specifier was provided diff --git a/pkgs/development/octave-modules/octproj/default.nix b/pkgs/development/octave-modules/octproj/default.nix index 4bb2962ed6e1..0f76ab684708 100644 --- a/pkgs/development/octave-modules/octproj/default.nix +++ b/pkgs/development/octave-modules/octproj/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "octproj"; - version = "2.0.1"; + version = "3.0.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1mb8gb0r8kky47ap85h9qqdvs40mjp3ya0nkh45gqhy67ml06paq"; + sha256 = "sha256-G2Ajnt4KGaq9hdXHLHL+6d9lGb83wkMHZqswNijwSzs="; }; # The sed changes below allow for the package to be compiled. diff --git a/pkgs/development/octave-modules/optim/default.nix b/pkgs/development/octave-modules/optim/default.nix index 57a606d3d58d..5a99fc3f9a68 100644 --- a/pkgs/development/octave-modules/optim/default.nix +++ b/pkgs/development/octave-modules/optim/default.nix @@ -9,11 +9,11 @@ buildOctavePackage rec { pname = "optim"; - version = "1.6.1"; + version = "1.6.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1175bckiryz0i6zm8zvq7y5rq3lwkmhyiky1gbn33np9qzxcsl3i"; + sha256 = "sha256-VUqOGLtxla6GH1BZwU8aVXhEJlwa3bW/vzq5iFUkeH4="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/optiminterp/default.nix b/pkgs/development/octave-modules/optiminterp/default.nix index 8409a10104e6..d830c563f73c 100644 --- a/pkgs/development/octave-modules/optiminterp/default.nix +++ b/pkgs/development/octave-modules/optiminterp/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "optiminterp"; - version = "0.3.6"; + version = "0.3.7"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "05nzj2jmrczbnsr64w2a7kww19s6yialdqnsbg797v11ii7aiylc"; + sha256 = "sha256-ubh/iOZlWTOYsTA6hJfPOituNBKTn2LbBnx+tmmSEug="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/signal/default.nix b/pkgs/development/octave-modules/signal/default.nix index b879b9f313a8..2579efc51889 100644 --- a/pkgs/development/octave-modules/signal/default.nix +++ b/pkgs/development/octave-modules/signal/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "signal"; - version = "1.4.2"; + version = "1.4.3"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "YqTgYRfcxDw2FpkF+CVdAVSBypgq6ukBOw2d8+SOcGI="; + sha256 = "sha256-VFuXVA6+ujtCDwiQb905d/wpOzvI/Db2uosJTOqI8zk="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/sockets/default.nix b/pkgs/development/octave-modules/sockets/default.nix index 688bd6a0e929..690c775f67e9 100644 --- a/pkgs/development/octave-modules/sockets/default.nix +++ b/pkgs/development/octave-modules/sockets/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "sockets"; - version = "1.2.1"; + version = "1.4.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "18f1zpqcf6h9b4fb0x2c5nvc3mvgj1141f1s8d9gnlhlrjlq8vqg"; + sha256 = "sha256-GNwFLNV1u3UKJp9lhLtCclD2VSKC9Mko1hBoSn5dTpI="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/statistics/default.nix b/pkgs/development/octave-modules/statistics/default.nix index 61133ec49e54..8067f257d3e7 100644 --- a/pkgs/development/octave-modules/statistics/default.nix +++ b/pkgs/development/octave-modules/statistics/default.nix @@ -6,11 +6,11 @@ buildOctavePackage rec { pname = "statistics"; - version = "1.4.2"; + version = "1.5.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0iv2hw3zp7h69n8ncfjfgm29xaihdl5gp2slcw1yf23mhd7q2xkr"; + sha256 = "sha256-JtXwR7bfFcRu6zRD1gGYG06Txmcu42w2C+zMXEiFf/U="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/stk/default.nix b/pkgs/development/octave-modules/stk/default.nix index 16ac7b7d03dc..fa67936d2bcd 100644 --- a/pkgs/development/octave-modules/stk/default.nix +++ b/pkgs/development/octave-modules/stk/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "stk"; - version = "2.6.1"; + version = "2.7.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1rqndfankwlwm4igw3xqpnrrl749zz1d5pjzh1qbfns7ixwrm19a"; + sha256 = "sha256-vIf+XDLvLNOMwptFCgiqfl+o3PIQ+KLpsJhOArd7gMM="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/strings/default.nix b/pkgs/development/octave-modules/strings/default.nix index cf5acd36855b..1d57aaf7f6a2 100644 --- a/pkgs/development/octave-modules/strings/default.nix +++ b/pkgs/development/octave-modules/strings/default.nix @@ -7,11 +7,11 @@ buildOctavePackage rec { pname = "strings"; - version = "1.2.0"; + version = "1.3.0"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1b0ravfvq3bxd0w3axjfsx13mmmkifmqz6pfdgyf2s8vkqnp1qng"; + sha256 = "sha256-agpTD9FN1qdp+BYdW5f+GZV0zqZMNzeOdymdo27mTOI="; }; buildInputs = [ diff --git a/pkgs/development/octave-modules/struct/default.nix b/pkgs/development/octave-modules/struct/default.nix index bd173aab1e37..91597d94f03e 100644 --- a/pkgs/development/octave-modules/struct/default.nix +++ b/pkgs/development/octave-modules/struct/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "struct"; - version = "1.0.17"; + version = "1.0.18"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0cw4cspkm553v019zsj2bsmal0i378pm0hv29w82j3v5vysvndq1"; + sha256 = "sha256-/M6n3YTBEE7TurtHoo8F4AEqicKE85qwlAkEUJFSlM4="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/video/default.nix b/pkgs/development/octave-modules/video/default.nix index 57868e83f55e..985ec3cfbf4e 100644 --- a/pkgs/development/octave-modules/video/default.nix +++ b/pkgs/development/octave-modules/video/default.nix @@ -8,11 +8,11 @@ buildOctavePackage rec { pname = "video"; - version = "2.0.0"; + version = "2.0.2"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "0s6j3c4dh5nsbh84s7vnd2ajcayy1gn07b4fcyrcynch3wl28mrv"; + sha256 = "sha256-bZNaRnmJl5UF0bQMNoEWvoIXJaB0E6/V9eChE725OHY="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/windows/default.nix b/pkgs/development/octave-modules/windows/default.nix index bed63aef9263..2bcff7c48ea3 100644 --- a/pkgs/development/octave-modules/windows/default.nix +++ b/pkgs/development/octave-modules/windows/default.nix @@ -5,11 +5,11 @@ buildOctavePackage rec { pname = "windows"; - version = "1.6.1"; + version = "1.6.3"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "110dh6jz088c4fxp9gw79kfib0dl7r3rkcavxx4xpk7bjl2l3xb6"; + sha256 = "sha256-U5Fe5mTn/ms8w9j6NdEtiRFZkKeyV0I3aR+zYQw4yIs="; }; meta = with lib; { diff --git a/pkgs/development/octave-modules/zeromq/default.nix b/pkgs/development/octave-modules/zeromq/default.nix index 557a43a9820c..33c0d70464af 100644 --- a/pkgs/development/octave-modules/zeromq/default.nix +++ b/pkgs/development/octave-modules/zeromq/default.nix @@ -8,11 +8,11 @@ buildOctavePackage rec { pname = "zeromq"; - version = "1.5.3"; + version = "1.5.5"; src = fetchurl { url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1h0pb2pqbnyiavf7r05j8bqxqd8syz16ab48hc74nlnx727anfwl"; + sha256 = "sha256-MAZEpbVuragVuXrMJ8q5/jU5cTchosAtrAR6ElLwfss="; }; preAutoreconf = '' From 525ba3e492446e6928d12c0ab79519924afe29d6 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 23 Dec 2022 09:28:08 -0600 Subject: [PATCH 3/7] octavePackages.strings: add pkg-config for build to pick up pcre(2) --- pkgs/development/octave-modules/strings/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/octave-modules/strings/default.nix b/pkgs/development/octave-modules/strings/default.nix index 1d57aaf7f6a2..77353faa4e84 100644 --- a/pkgs/development/octave-modules/strings/default.nix +++ b/pkgs/development/octave-modules/strings/default.nix @@ -2,7 +2,8 @@ , stdenv , lib , fetchurl -, pcre +, pkg-config +, pcre2 }: buildOctavePackage rec { @@ -14,8 +15,12 @@ buildOctavePackage rec { sha256 = "sha256-agpTD9FN1qdp+BYdW5f+GZV0zqZMNzeOdymdo27mTOI="; }; + nativeBuildInputs = [ + pkg-config + ]; + buildInputs = [ - pcre + pcre2 ]; # The gripes library no longer exists. From 45b015a1650f7b89b3148c9fff3a7029d7d35be9 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 23 Dec 2022 10:49:46 -0600 Subject: [PATCH 4/7] octavePackages: use alternative fetchers for moved projects Many projects moved from SourceForge to other hosting sites. Use an appropriate fetcher for each of the packages that have moved to the new sites. octavePackages.bim: fetchurl -> fetchFromGitHub There was a migration from SourceForge to GitHub by the authors. octavePackages.msh: fetchurl -> fetchFromGitHub There was a migration from SourceForge to GitHub by the authors. octavePackages.statistics: fetchurl -> fetchFromGitHub There was a migration from SourceForge to GitHub by the authors. octavePackages.octclip: fetchurl -> fetchFromBitbucket There was a migration from SourceForge to Bitbucket by the authors. octavePackages.geometry: fetchurl -> fetchhg Release 4.0.0 is broken. Revision 04965cda30b5f9e51774194c67879e7336df1710 was made shortly thereafter, fixing a compilation bug. The bug in question: polygon.cpp:208:22: error: static assertion failed: comparison object must be invocable as const is_invocable_v, octavePackages.octproj: fetchurl -> fetchFromBitbucket There was a migration from SourceForge to Bitbucket by the authors. --- pkgs/development/octave-modules/bim/default.nix | 10 ++++++---- pkgs/development/octave-modules/geometry/default.nix | 11 ++++++----- pkgs/development/octave-modules/msh/default.nix | 10 ++++++---- pkgs/development/octave-modules/octclip/default.nix | 10 ++++++---- pkgs/development/octave-modules/octproj/default.nix | 10 ++++++---- .../development/octave-modules/statistics/default.nix | 10 ++++++---- 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/pkgs/development/octave-modules/bim/default.nix b/pkgs/development/octave-modules/bim/default.nix index 56865493e46b..dc018ae6143e 100644 --- a/pkgs/development/octave-modules/bim/default.nix +++ b/pkgs/development/octave-modules/bim/default.nix @@ -1,6 +1,6 @@ { buildOctavePackage , lib -, fetchurl +, fetchFromGitHub , fpl , msh }: @@ -9,9 +9,11 @@ buildOctavePackage rec { pname = "bim"; version = "1.1.6"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-pv64swrPlgopBlubpAlfoD9KJlOSgF9wdbgdHHTcr9c="; + src = fetchFromGitHub { + owner = "carlodefalco"; + repo = "bim"; + rev = "v${version}"; + sha256 = "sha256-hgFb1KFE1KJC8skIaeT/7h/fg1aqRpedGnEPY24zZSI="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/geometry/default.nix b/pkgs/development/octave-modules/geometry/default.nix index b4bf57262fae..86ef985fd1b0 100644 --- a/pkgs/development/octave-modules/geometry/default.nix +++ b/pkgs/development/octave-modules/geometry/default.nix @@ -1,16 +1,17 @@ { buildOctavePackage , lib -, fetchurl +, fetchhg , matgeom }: buildOctavePackage rec { pname = "geometry"; - version = "4.0.0"; + version = "unstable-2021-07-07"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "1zmd97xir62fr5v57xifh2cvna5fg67h9yb7bp2vm3ll04y41lhs"; + src = fetchhg { + url = "http://hg.code.sf.net/p/octave/${pname}"; + rev = "04965cda30b5f9e51774194c67879e7336df1710"; + sha256 = "sha256-ECysYOJMF4gPiCFung9hFSlyyO60X3MGirQ9FlYDix8="; }; requiredOctavePackages = [ diff --git a/pkgs/development/octave-modules/msh/default.nix b/pkgs/development/octave-modules/msh/default.nix index 8ce1341419c0..e147b9a9c2a2 100644 --- a/pkgs/development/octave-modules/msh/default.nix +++ b/pkgs/development/octave-modules/msh/default.nix @@ -1,6 +1,6 @@ { buildOctavePackage , lib -, fetchurl +, fetchFromGitHub # Octave Dependencies , splines # Other Dependencies @@ -15,9 +15,11 @@ buildOctavePackage rec { pname = "msh"; version = "1.0.12"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-7xbB+RXq5SE7Ke5rNwSo/mqdSZTzCLXRhS4zdfGz55s="; + src = fetchFromGitHub { + owner = "carlodefalco"; + repo = "msh"; + rev = "v${version}"; + sha256 = "sha256-UnMrIruzm3ARoTgUlMMxfjTOMZw/znZUQJmj3VEOw8I="; }; nativeBuildInputs = [ diff --git a/pkgs/development/octave-modules/octclip/default.nix b/pkgs/development/octave-modules/octclip/default.nix index d8c607c391bd..c70a5ffc137a 100644 --- a/pkgs/development/octave-modules/octclip/default.nix +++ b/pkgs/development/octave-modules/octclip/default.nix @@ -1,15 +1,17 @@ { buildOctavePackage , lib -, fetchurl +, fetchFromBitbucket }: buildOctavePackage rec { pname = "octclip"; version = "2.0.3"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-u6wvCibdkLgmC8Q2LlpVLfXR3LYtssYlO2cRqYPmmR8="; + src = fetchFromBitbucket { + owner = "jgpallero"; + repo = pname; + rev = "OctCLIP-${version}"; + sha256 = "sha256-gG2b8Ix6bzO6O7GRACE81JCVxfXW/+ZdfoniigAEq3g="; }; # The only compilation problem is that no formatting specifier was provided diff --git a/pkgs/development/octave-modules/octproj/default.nix b/pkgs/development/octave-modules/octproj/default.nix index 0f76ab684708..3769f7f675b5 100644 --- a/pkgs/development/octave-modules/octproj/default.nix +++ b/pkgs/development/octave-modules/octproj/default.nix @@ -1,6 +1,6 @@ { buildOctavePackage , lib -, fetchurl +, fetchFromBitbucket , proj # >= 6.3.0 }: @@ -8,9 +8,11 @@ buildOctavePackage rec { pname = "octproj"; version = "3.0.2"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-G2Ajnt4KGaq9hdXHLHL+6d9lGb83wkMHZqswNijwSzs="; + src = fetchFromBitbucket { + owner = "jgpallero"; + repo = pname; + rev = "OctPROJ-${version}"; + sha256 = "sha256-d/Zf172Etj+GA0cnGsQaKMjOmirE7Hwyj4UECpg7QFM="; }; # The sed changes below allow for the package to be compiled. diff --git a/pkgs/development/octave-modules/statistics/default.nix b/pkgs/development/octave-modules/statistics/default.nix index 8067f257d3e7..eba27ab49b2d 100644 --- a/pkgs/development/octave-modules/statistics/default.nix +++ b/pkgs/development/octave-modules/statistics/default.nix @@ -1,6 +1,6 @@ { buildOctavePackage , lib -, fetchurl +, fetchFromGitHub , io }: @@ -8,9 +8,11 @@ buildOctavePackage rec { pname = "statistics"; version = "1.5.2"; - src = fetchurl { - url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz"; - sha256 = "sha256-JtXwR7bfFcRu6zRD1gGYG06Txmcu42w2C+zMXEiFf/U="; + src = fetchFromGitHub { + owner = "gnu-octave"; + repo = "statistics"; + rev = "release-${version}"; + sha256 = "sha256-+Eye29vH4HBfaZRzRNY6J0+wWjh6aCvnq7hZ7M34L2M="; }; requiredOctavePackages = [ From 59742a5e0446a204c27ea9ab3458521674ea75f9 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 23 Dec 2022 10:39:25 -0600 Subject: [PATCH 5/7] octavePackages.octproj: unmark as broken This package broke when Octave went to version 7.1. nixpkgs commit 8399907be3c008b6e12863364d6f7848f52034b1 fixed this. Octave's 7.2 release built the fix into Octave itself, so this is also a non-issue now. --- pkgs/development/octave-modules/octproj/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/octave-modules/octproj/default.nix b/pkgs/development/octave-modules/octproj/default.nix index 3769f7f675b5..bc0dd4ea2132 100644 --- a/pkgs/development/octave-modules/octproj/default.nix +++ b/pkgs/development/octave-modules/octproj/default.nix @@ -30,6 +30,5 @@ buildOctavePackage rec { license = licenses.gpl3Plus; maintainers = with maintainers; [ KarlJoad ]; description = "GNU Octave bindings to PROJ library for cartographic projections and CRS transformations"; - broken = true; # error: unlink: operation failed: No such file or directory }; } From 3d87986dd0ee8ff63769512f4edebce105fae209 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 23 Dec 2022 11:05:53 -0600 Subject: [PATCH 6/7] octavePackages.mapping: add gdal library for reading raster files --- pkgs/development/octave-modules/mapping/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/octave-modules/mapping/default.nix b/pkgs/development/octave-modules/mapping/default.nix index 2c91fad72264..13d7fd5dd526 100644 --- a/pkgs/development/octave-modules/mapping/default.nix +++ b/pkgs/development/octave-modules/mapping/default.nix @@ -3,6 +3,7 @@ , fetchurl , io # >= 2.2.7 , geometry # >= 4.0.0 +, gdal }: buildOctavePackage rec { @@ -14,6 +15,10 @@ buildOctavePackage rec { sha256 = "sha256-mrUQWqC15Ul5AHDvhMlNStqIMG2Zxa+hB2vDyeizLaI="; }; + buildInputs = [ + gdal + ]; + requiredOctavePackages = [ io geometry From e8afe3afc47a418eb056a998e347fc2e2baaa637 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 15 Mar 2023 13:54:28 +0000 Subject: [PATCH 7/7] =?UTF-8?q?octavePackages.statistics:=201.5.2=20?= =?UTF-8?q?=E2=86=92=201.5.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/octave-modules/statistics/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/octave-modules/statistics/default.nix b/pkgs/development/octave-modules/statistics/default.nix index eba27ab49b2d..433a70f19bdc 100644 --- a/pkgs/development/octave-modules/statistics/default.nix +++ b/pkgs/development/octave-modules/statistics/default.nix @@ -6,13 +6,13 @@ buildOctavePackage rec { pname = "statistics"; - version = "1.5.2"; + version = "1.5.4"; src = fetchFromGitHub { owner = "gnu-octave"; repo = "statistics"; - rev = "release-${version}"; - sha256 = "sha256-+Eye29vH4HBfaZRzRNY6J0+wWjh6aCvnq7hZ7M34L2M="; + rev = "refs/tags/release-${version}"; + sha256 = "sha256-gFauFIaXKzcPeNvpWHv5FAxYQvZNh7ELrSUIvn43IfQ="; }; requiredOctavePackages = [