Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge master into staging-next

+716 -427
+2 -360
maintainers/scripts/update-python-libraries
··· 1 - #! /usr/bin/env nix-shell 2 - #! nix-shell -i python3 -p "python3.withPackages(ps: with ps; [ packaging requests toolz ])" -p git 3 - 4 - """ 5 - Update a Python 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-python-libraries ../../pkgs/development/python-modules/* 11 - `` 12 - to update all libraries in that folder. 13 - """ 14 - 15 - import argparse 16 - import logging 17 - import os 18 - import re 19 - import requests 20 - import toolz 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 - 28 - INDEX = "https://pypi.io/pypi" 29 - """url of PyPI""" 30 - 31 - EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip', '.whl'] 32 - """Permitted file extensions. These are evaluated from left to right and the first occurance is returned.""" 33 - 34 - PRERELEASES = False 35 - 36 - import logging 37 - logging.basicConfig(level=logging.INFO) 38 - 39 - 40 - class Version(_Version, collections.abc.Sequence): 41 - 42 - def __init__(self, version): 43 - super().__init__(version) 44 - # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21` 45 - # https://github.com/avian2/unidecode/issues/13#issuecomment-354538882 46 - self.raw_version = version 47 - 48 - def __getitem__(self, i): 49 - return self._version.release[i] 50 - 51 - def __len__(self): 52 - return len(self._version.release) 53 - 54 - def __iter__(self): 55 - yield from self._version.release 56 - 57 - 58 - def _get_values(attribute, text): 59 - """Match attribute in text and return all matches. 60 - 61 - :returns: List of matches. 62 - """ 63 - regex = '{}\s+=\s+"(.*)";'.format(attribute) 64 - regex = re.compile(regex) 65 - values = regex.findall(text) 66 - return values 67 - 68 - def _get_unique_value(attribute, text): 69 - """Match attribute in text and return unique match. 70 - 71 - :returns: Single match. 72 - """ 73 - values = _get_values(attribute, text) 74 - n = len(values) 75 - if n > 1: 76 - raise ValueError("found too many values for {}".format(attribute)) 77 - elif n == 1: 78 - return values[0] 79 - else: 80 - raise ValueError("no value found for {}".format(attribute)) 81 - 82 - def _get_line_and_value(attribute, text): 83 - """Match attribute in text. Return the line and the value of the attribute.""" 84 - regex = '({}\s+=\s+"(.*)";)'.format(attribute) 85 - regex = re.compile(regex) 86 - value = regex.findall(text) 87 - n = len(value) 88 - if n > 1: 89 - raise ValueError("found too many values for {}".format(attribute)) 90 - elif n == 1: 91 - return value[0] 92 - else: 93 - raise ValueError("no value found for {}".format(attribute)) 94 - 95 - 96 - def _replace_value(attribute, value, text): 97 - """Search and replace value of attribute in text.""" 98 - old_line, old_value = _get_line_and_value(attribute, text) 99 - new_line = old_line.replace(old_value, value) 100 - new_text = text.replace(old_line, new_line) 101 - return new_text 102 - 103 - def _fetch_page(url): 104 - r = requests.get(url) 105 - if r.status_code == requests.codes.ok: 106 - return r.json() 107 - else: 108 - raise ValueError("request for {} failed".format(url)) 109 - 110 - 111 - SEMVER = { 112 - 'major' : 0, 113 - 'minor' : 1, 114 - 'patch' : 2, 115 - } 116 - 117 - 118 - def _determine_latest_version(current_version, target, versions): 119 - """Determine latest version, given `target`. 120 - """ 121 - current_version = Version(current_version) 122 - 123 - def _parse_versions(versions): 124 - for v in versions: 125 - try: 126 - yield Version(v) 127 - except InvalidVersion: 128 - pass 129 - 130 - versions = _parse_versions(versions) 131 - 132 - index = SEMVER[target] 133 - 134 - ceiling = list(current_version[0:index]) 135 - if len(ceiling) == 0: 136 - ceiling = None 137 - else: 138 - ceiling[-1]+=1 139 - ceiling = Version(".".join(map(str, ceiling))) 140 - 141 - # We do not want prereleases 142 - versions = SpecifierSet(prereleases=PRERELEASES).filter(versions) 143 - 144 - if ceiling is not None: 145 - versions = SpecifierSet(f"<{ceiling}").filter(versions) 146 - 147 - return (max(sorted(versions))).raw_version 148 - 149 - 150 - def _get_latest_version_pypi(package, extension, current_version, target): 151 - """Get latest version and hash from PyPI.""" 152 - url = "{}/{}/json".format(INDEX, package) 153 - json = _fetch_page(url) 154 - 155 - versions = json['releases'].keys() 156 - version = _determine_latest_version(current_version, target, versions) 157 - 158 - try: 159 - releases = json['releases'][version] 160 - except KeyError as e: 161 - raise KeyError('Could not find version {} for {}'.format(version, package)) from e 162 - for release in releases: 163 - if release['filename'].endswith(extension): 164 - # TODO: In case of wheel we need to do further checks! 165 - sha256 = release['digests']['sha256'] 166 - break 167 - else: 168 - sha256 = None 169 - return version, sha256 170 - 171 - 172 - def _get_latest_version_github(package, extension, current_version, target): 173 - raise ValueError("updating from GitHub is not yet supported.") 174 - 175 - 176 - FETCHERS = { 177 - 'fetchFromGitHub' : _get_latest_version_github, 178 - 'fetchPypi' : _get_latest_version_pypi, 179 - 'fetchurl' : _get_latest_version_pypi, 180 - } 181 - 182 - 183 - DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz' 184 - 185 - 186 - FORMATS = { 187 - 'setuptools' : DEFAULT_SETUPTOOLS_EXTENSION, 188 - 'wheel' : 'whl' 189 - } 190 - 191 - def _determine_fetcher(text): 192 - # Count occurences of fetchers. 193 - nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys()) 194 - if nfetchers == 0: 195 - raise ValueError("no fetcher.") 196 - elif nfetchers > 1: 197 - raise ValueError("multiple fetchers.") 198 - else: 199 - # Then we check which fetcher to use. 200 - for fetcher in FETCHERS.keys(): 201 - if 'src = {}'.format(fetcher) in text: 202 - return fetcher 203 - 204 - 205 - def _determine_extension(text, fetcher): 206 - """Determine what extension is used in the expression. 1 + #!/bin/sh 2 + exec nix-shell -p "python3.withPackages(ps: with ps; [ packaging requests toolz ])" -p git --run pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py 207 3 208 - If we use: 209 - - fetchPypi, we check if format is specified. 210 - - fetchurl, we determine the extension from the url. 211 - - fetchFromGitHub we simply use `.tar.gz`. 212 - """ 213 - if fetcher == 'fetchPypi': 214 - try: 215 - src_format = _get_unique_value('format', text) 216 - except ValueError as e: 217 - src_format = None # format was not given 218 - 219 - try: 220 - extension = _get_unique_value('extension', text) 221 - except ValueError as e: 222 - extension = None # extension was not given 223 - 224 - if extension is None: 225 - if src_format is None: 226 - src_format = 'setuptools' 227 - elif src_format == 'flit': 228 - raise ValueError("Don't know how to update a Flit package.") 229 - extension = FORMATS[src_format] 230 - 231 - elif fetcher == 'fetchurl': 232 - url = _get_unique_value('url', text) 233 - extension = os.path.splitext(url)[1] 234 - if 'pypi' not in url: 235 - raise ValueError('url does not point to PyPI.') 236 - 237 - elif fetcher == 'fetchFromGitHub': 238 - raise ValueError('updating from GitHub is not yet implemented.') 239 - 240 - return extension 241 - 242 - 243 - def _update_package(path, target): 244 - 245 - # Read the expression 246 - with open(path, 'r') as f: 247 - text = f.read() 248 - 249 - # Determine pname. 250 - pname = _get_unique_value('pname', text) 251 - 252 - # Determine version. 253 - version = _get_unique_value('version', text) 254 - 255 - # First we check how many fetchers are mentioned. 256 - fetcher = _determine_fetcher(text) 257 - 258 - extension = _determine_extension(text, fetcher) 259 - 260 - new_version, new_sha256 = FETCHERS[fetcher](pname, extension, version, target) 261 - 262 - if new_version == version: 263 - logging.info("Path {}: no update available for {}.".format(path, pname)) 264 - return False 265 - elif Version(new_version) <= Version(version): 266 - raise ValueError("downgrade for {}.".format(pname)) 267 - if not new_sha256: 268 - raise ValueError("no file available for {}.".format(pname)) 269 - 270 - text = _replace_value('version', new_version, text) 271 - text = _replace_value('sha256', new_sha256, text) 272 - 273 - with open(path, 'w') as f: 274 - f.write(text) 275 - 276 - logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version)) 277 - 278 - result = { 279 - 'path' : path, 280 - 'target': target, 281 - 'pname': pname, 282 - 'old_version' : version, 283 - 'new_version' : new_version, 284 - #'fetcher' : fetcher, 285 - } 286 - 287 - return result 288 - 289 - 290 - def _update(path, target): 291 - 292 - # We need to read and modify a Nix expression. 293 - if os.path.isdir(path): 294 - path = os.path.join(path, 'default.nix') 295 - 296 - # If a default.nix does not exist, we quit. 297 - if not os.path.isfile(path): 298 - logging.info("Path {}: does not exist.".format(path)) 299 - return False 300 - 301 - # If file is not a Nix expression, we quit. 302 - if not path.endswith(".nix"): 303 - logging.info("Path {}: does not end with `.nix`.".format(path)) 304 - return False 305 - 306 - try: 307 - return _update_package(path, target) 308 - except ValueError as e: 309 - logging.warning("Path {}: {}".format(path, e)) 310 - return False 311 - 312 - 313 - def _commit(path, pname, old_version, new_version, **kwargs): 314 - """Commit result. 315 - """ 316 - 317 - msg = f'python: {pname}: {old_version} -> {new_version}' 318 - 319 - try: 320 - subprocess.check_call(['git', 'add', path]) 321 - subprocess.check_call(['git', 'commit', '-m', msg]) 322 - except subprocess.CalledProcessError as e: 323 - subprocess.check_call(['git', 'checkout', path]) 324 - raise subprocess.CalledProcessError(f'Could not commit {path}') from e 325 - 326 - return True 327 - 328 - 329 - def main(): 330 - 331 - parser = argparse.ArgumentParser() 332 - parser.add_argument('package', type=str, nargs='+') 333 - parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major') 334 - parser.add_argument('--commit', action='store_true', help='Create a commit for each package update') 335 - 336 - args = parser.parse_args() 337 - target = args.target 338 - 339 - packages = list(map(os.path.abspath, args.package)) 340 - 341 - logging.info("Updating packages...") 342 - 343 - # Use threads to update packages concurrently 344 - with Pool() as p: 345 - results = list(p.map(lambda pkg: _update(pkg, target), packages)) 346 - 347 - logging.info("Finished updating packages.") 348 - 349 - # Commits are created sequentially. 350 - if args.commit: 351 - logging.info("Committing updates...") 352 - list(map(lambda x: _commit(**x), filter(bool, results))) 353 - logging.info("Finished committing updates") 354 - 355 - count = sum(map(bool, results)) 356 - logging.info("{} package(s) updated".format(count)) 357 - 358 - 359 - 360 - if __name__ == '__main__': 361 - main()
+17 -17
nixos/modules/services/databases/mysql.nix
··· 29 29 installOptions = 30 30 "${mysqldAndInstallOptions} ${lib.optionalString isMysqlAtLeast57 "--insecure"}"; 31 31 32 - myCnf = pkgs.writeText "my.cnf" 33 - '' 34 - [mysqld] 35 - port = ${toString cfg.port} 36 - datadir = ${cfg.dataDir} 37 - ${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" } 38 - ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"} 39 - ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"} 40 - ${optionalString (cfg.ensureUsers != []) 41 - '' 42 - plugin-load-add = auth_socket.so 43 - ''} 44 - ${cfg.extraOptions} 45 - ''; 46 - 47 32 in 48 33 49 34 { ··· 242 227 243 228 environment.systemPackages = [mysql]; 244 229 230 + environment.etc."my.cnf".text = 231 + '' 232 + [mysqld] 233 + port = ${toString cfg.port} 234 + datadir = ${cfg.dataDir} 235 + ${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" } 236 + ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"} 237 + ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"} 238 + ${optionalString (cfg.ensureUsers != []) 239 + '' 240 + plugin-load-add = auth_socket.so 241 + ''} 242 + ${cfg.extraOptions} 243 + ''; 244 + 245 245 systemd.services.mysql = let 246 246 hasNotify = (cfg.package == pkgs.mariadb); 247 247 in { ··· 263 263 if ! test -e ${cfg.dataDir}/mysql; then 264 264 mkdir -m 0700 -p ${cfg.dataDir} 265 265 chown -R ${cfg.user} ${cfg.dataDir} 266 - ${mysql}/bin/mysql_install_db ${installOptions} 266 + ${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${installOptions} 267 267 touch /tmp/mysql_init 268 268 fi 269 269 ··· 274 274 serviceConfig = { 275 275 Type = if hasNotify then "notify" else "simple"; 276 276 RuntimeDirectory = "mysqld"; 277 - ExecStart = "${mysql}/bin/mysqld --defaults-extra-file=${myCnf} ${mysqldOptions}"; 277 + ExecStart = "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions}"; 278 278 }; 279 279 280 280 postStart = ''
+1 -1
pkgs/applications/altcoins/monero-gui/default.nix
··· 60 60 name = "monero-wallet-gui"; 61 61 exec = "monero-wallet-gui"; 62 62 icon = "monero"; 63 - desktopName = "Monero Wallet"; 63 + desktopName = "Monero"; 64 64 genericName = "Wallet"; 65 65 categories = "Application;Network;Utility;"; 66 66 };
+4 -4
pkgs/applications/audio/opus-tools/default.nix
··· 1 - {stdenv, fetchurl, libogg, libao, pkgconfig, libopus, flac}: 1 + {stdenv, fetchurl, libogg, libao, pkgconfig, flac, opusfile, libopusenc}: 2 2 3 3 stdenv.mkDerivation rec { 4 - name = "opus-tools-0.1.10"; 4 + name = "opus-tools-0.2"; 5 5 src = fetchurl { 6 6 url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz"; 7 - sha256 = "135jfb9ny3xvd27idsxj7j5ns90lslbyrq70cq3bfwcls4r7add2"; 7 + sha256 = "11pzl27s4vcz4m18ch72nivbhww2zmzn56wspb7rll1y1nq6rrdl"; 8 8 }; 9 9 10 10 nativeBuildInputs = [ pkgconfig ]; 11 - buildInputs = [ libogg libao libopus flac ]; 11 + buildInputs = [ libogg libao flac opusfile libopusenc ]; 12 12 13 13 meta = { 14 14 description = "Tools to work with opus encoded audio streams";
+2 -2
pkgs/applications/misc/aminal/default.nix
··· 12 12 13 13 buildGoPackage rec { 14 14 name = "aminal-${version}"; 15 - version = "0.7.8"; 15 + version = "0.7.12"; 16 16 17 17 goPackagePath = "github.com/liamg/aminal"; 18 18 ··· 36 36 owner = "liamg"; 37 37 repo = "aminal"; 38 38 rev = "v${version}"; 39 - sha256 = "02gamvvs56w4zwqdvalbsgb2gbh0398gl7qk36pgyqkcgj3bcwv8"; 39 + sha256 = "1ak5g2i4ggi00b4q7qigfwsrwb5rvswjjbr2hp9kyxd45nycb0g4"; 40 40 }; 41 41 42 42 preBuild = ''
+8 -2
pkgs/applications/networking/cluster/cni/default.nix
··· 1 - { stdenv, fetchFromGitHub, go }: 1 + { stdenv, fetchFromGitHub, go, removeReferencesTo }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "cni-${version}"; ··· 11 11 sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y"; 12 12 }; 13 13 14 - buildInputs = [ go ]; 14 + buildInputs = [ removeReferencesTo go ]; 15 + 16 + GOCACHE = "off"; 15 17 16 18 buildPhase = '' 17 19 patchShebangs build.sh ··· 21 23 installPhase = '' 22 24 mkdir -p $out/bin 23 25 mv bin/cnitool $out/bin 26 + ''; 27 + 28 + preFixup = '' 29 + find $out/bin -type f -exec remove-references-to -t ${go} '{}' + 24 30 ''; 25 31 26 32 meta = with stdenv.lib; {
+8 -2
pkgs/applications/networking/cluster/cni/plugins.nix
··· 1 - { stdenv, lib, fetchFromGitHub, go }: 1 + { stdenv, lib, fetchFromGitHub, go, removeReferencesTo }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "cni-plugins-${version}"; ··· 11 11 sha256 = "1sywllwnr6lc812sgkqjdd3y10r82shl88dlnwgnbgzs738q2vp2"; 12 12 }; 13 13 14 - buildInputs = [ go ]; 14 + buildInputs = [ removeReferencesTo go ]; 15 + 16 + GOCACHE = "off"; 15 17 16 18 buildPhase = '' 17 19 patchShebangs build.sh ··· 21 23 installPhase = '' 22 24 mkdir -p $out/bin 23 25 mv bin/* $out/bin 26 + ''; 27 + 28 + preFixup = '' 29 + find $out/bin -type f -exec remove-references-to -t ${go} '{}' + 24 30 ''; 25 31 26 32 meta = with lib; {
+2 -2
pkgs/applications/networking/instant-messengers/bitlbee-discord/default.nix
··· 3 3 with stdenv.lib; 4 4 stdenv.mkDerivation rec { 5 5 name = "bitlbee-discord-${version}"; 6 - version = "0.4.1"; 6 + version = "0.4.2"; 7 7 8 8 src = fetchFromGitHub { 9 9 rev = version; 10 10 owner = "sm00th"; 11 11 repo = "bitlbee-discord"; 12 - sha256 = "1n3xw5mcmg7224r09gbm39bd6h2158dwl6jx21290636b4345f4c"; 12 + sha256 = "02pigk2vbz0jdz11f96sygdvp1j762yjn62h124fkcsc070g7a2f"; 13 13 }; 14 14 15 15 nativeBuildInputs = [ autoreconfHook pkgconfig ];
+4 -4
pkgs/applications/networking/vnstat/default.nix
··· 1 - { stdenv, fetchurl, gd, ncurses }: 1 + { stdenv, fetchurl, gd, ncurses, sqlite }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "vnstat-${version}"; 5 - version = "1.18"; 5 + version = "2.1"; 6 6 7 7 src = fetchurl { 8 - sha256 = "1mc7qqvrnl0zyhgh8n7wx1g1cbwq74xpvbz8rfjmyi77p693a6fp"; 8 + sha256 = "0yk0x6bg9f36dsslhayyyi8fg04yvzjzqkjmlrcsrv6nnggchb6i"; 9 9 url = "https://humdi.net/vnstat/${name}.tar.gz"; 10 10 }; 11 11 12 - buildInputs = [ gd ncurses ]; 12 + buildInputs = [ gd ncurses sqlite ]; 13 13 14 14 postPatch = '' 15 15 substituteInPlace src/cfg.c --replace /usr/local $out
+2 -9
pkgs/applications/office/todoman/default.nix
··· 5 5 in 6 6 buildPythonApplication rec { 7 7 pname = "todoman"; 8 - version = "3.4.1"; 8 + version = "3.5.0"; 9 9 name = "${pname}-${version}"; 10 10 11 11 src = fetchPypi { 12 12 inherit pname version; 13 - sha256 = "1rvid1rklvgvsf6xmxd91j2fi46v4fzn5z6zbs5yn0wpb0k605r5"; 13 + sha256 = "051qjdpwif06x7qspnb4pfwdhb8nnmz99yqcp4kla5hv0n3jh0w9"; 14 14 }; 15 15 16 16 LOCALE_ARCHIVE = stdenv.lib.optionalString stdenv.isLinux ··· 28 28 29 29 makeWrapperArgs = [ "--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive" 30 30 "--set CHARSET en_us.UTF-8" ]; 31 - 32 - patches = [ 33 - (fetchpatch { 34 - url = "https://github.com/pimutils/todoman/commit/3e191111b72df9ec91a773befefa291799374422.patch"; 35 - sha256 = "12mskbp0d8p2lllkxm3m9wyy2hsbnz2qs297civsc3ly2l5bcrag"; 36 - }) 37 - ]; 38 31 39 32 preCheck = '' 40 33 # Remove one failing test that only checks whether the command line works
+3 -3
pkgs/applications/science/astronomy/gildas/default.nix
··· 7 7 in 8 8 9 9 stdenv.mkDerivation rec { 10 - srcVersion = "nov18a"; 11 - version = "20181101_a"; 10 + srcVersion = "dec18a"; 11 + version = "20181201_a"; 12 12 name = "gildas-${version}"; 13 13 14 14 src = fetchurl { ··· 16 16 # source code of the previous release to a different directory 17 17 urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.gz" 18 18 "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.gz" ]; 19 - sha256 = "1dl2v8y6vrwaxm3b7nf6dv3ipzybhlhy2kxwnwgc7gqz5704251v"; 19 + sha256 = "f295b5b7f999c0d746a52b307af7b7bdbed0d9b3d87100a6a102e0cc64f3a9bd"; 20 20 }; 21 21 22 22 enableParallelBuilding = true;
+3 -3
pkgs/build-support/agda/default.nix
··· 3 3 # Contact: stdenv.lib.maintainers.fuuzetsu 4 4 5 5 { stdenv, Agda, glibcLocales 6 - , writeScriptBin 6 + , writeShellScriptBin 7 7 , extension ? (self: super: {}) 8 8 }: 9 9 ··· 77 77 buildInputs = let 78 78 # Makes a wrapper available to the user. Very useful in 79 79 # nix-shell where all dependencies are -i'd. 80 - agdaWrapper = writeScriptBin "agda" '' 81 - ${self.agdaWithArgs} "$@" 80 + agdaWrapper = writeShellScriptBin "agda" '' 81 + exec ${self.agdaWithArgs} "$@" 82 82 ''; 83 83 in [agdaWrapper] ++ self.buildDepends; 84 84 };
+7 -2
pkgs/data/icons/elementary-icon-theme/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "elementary-icon-theme-${version}"; 5 - version = "5.0"; 5 + version = "5.0.1"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "elementary"; 9 9 repo = "icons"; 10 10 rev = version; 11 - sha256 = "146s26q4bb5sag35iv42hrnbdciam2ajl7s5s5jayli5vp8bw08w"; 11 + sha256 = "1rw924b3ixfdff368dpv4vgsykwncmrvj9a6yfss0cf236xnvr9b"; 12 12 }; 13 13 14 14 nativeBuildInputs = [ meson ninja python3 gtk3 ]; 15 + 16 + # Disable installing gimp and inkscape palette files 17 + mesonFlags = [ 18 + "-Dpalettes=false" 19 + ]; 15 20 16 21 postPatch = '' 17 22 chmod +x meson/symlink.py
+232
pkgs/development/compilers/ghc/8.6.3.nix
··· 1 + { stdenv, targetPackages 2 + 3 + # build-tools 4 + , bootPkgs 5 + , autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4, sphinx 6 + 7 + , libiconv ? null, ncurses 8 + 9 + , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) 10 + , # LLVM is conceptually a run-time-only depedendency, but for 11 + # non-x86, we need LLVM to bootstrap later stages, so it becomes a 12 + # build-time dependency too. 13 + buildLlvmPackages, llvmPackages 14 + 15 + , # If enabled, GHC will be built with the GPL-free but slower integer-simple 16 + # library instead of the faster but GPLed integer-gmp library. 17 + enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp 18 + 19 + , # If enabled, use -fPIC when compiling static libs. 20 + enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform 21 + 22 + , # Whether to build dynamic libs for the standard library (on the target 23 + # platform). Static libs are always built. 24 + enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt 25 + 26 + , # Whetherto build terminfo. 27 + enableTerminfo ? !stdenv.targetPlatform.isWindows 28 + 29 + , # What flavour to build. An empty string indicates no 30 + # specific flavour and falls back to ghc default values. 31 + ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" 32 + }: 33 + 34 + assert !enableIntegerSimple -> gmp != null; 35 + 36 + let 37 + inherit (stdenv) buildPlatform hostPlatform targetPlatform; 38 + 39 + inherit (bootPkgs) ghc; 40 + 41 + # TODO(@Ericson2314) Make unconditional 42 + targetPrefix = stdenv.lib.optionalString 43 + (targetPlatform != hostPlatform) 44 + "${targetPlatform.config}-"; 45 + 46 + buildMK = '' 47 + BuildFlavour = ${ghcFlavour} 48 + ifneq \"\$(BuildFlavour)\" \"\" 49 + include mk/flavours/\$(BuildFlavour).mk 50 + endif 51 + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 52 + INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 53 + '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 54 + Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 55 + CrossCompilePrefix = ${targetPrefix} 56 + HADDOCK_DOCS = NO 57 + BUILD_SPHINX_HTML = NO 58 + BUILD_SPHINX_PDF = NO 59 + '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' 60 + GhcLibHcOpts += -fPIC 61 + GhcRtsHcOpts += -fPIC 62 + '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' 63 + EXTRA_CC_OPTS += -std=gnu99 64 + ''; 65 + 66 + # Splicer will pull out correct variations 67 + libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ] 68 + ++ stdenv.lib.optional (!enableIntegerSimple) gmp 69 + ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv; 70 + 71 + toolsForTarget = 72 + if hostPlatform == buildPlatform then 73 + [ targetPackages.stdenv.cc ] ++ stdenv.lib.optional useLLVM llvmPackages.llvm 74 + else assert targetPlatform == hostPlatform; # build != host == target 75 + [ stdenv.cc ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm; 76 + 77 + targetCC = builtins.head toolsForTarget; 78 + 79 + in 80 + stdenv.mkDerivation (rec { 81 + version = "8.6.3"; 82 + name = "${targetPrefix}ghc-${version}"; 83 + 84 + src = fetchurl { 85 + url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; 86 + sha256 = "08vzq0dpg4a39bs61j6rq4z0n7jby5mc69h4m25xhd8rjyvkg7lz"; 87 + }; 88 + 89 + enableParallelBuilding = true; 90 + 91 + outputs = [ "out" "doc" ]; 92 + 93 + patches = [(fetchpatch rec { # https://phabricator.haskell.org/D5123 94 + url = "http://tarballs.nixos.org/sha256/${sha256}"; 95 + name = "D5123.diff"; 96 + sha256 = "0nhqwdamf2y4gbwqxcgjxs0kqx23w9gv5kj0zv6450dq19rji82n"; 97 + })]; 98 + 99 + postPatch = "patchShebangs ."; 100 + 101 + # GHC is a bit confused on its cross terminology. 102 + preConfigure = '' 103 + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do 104 + export "''${env#TARGET_}=''${!env}" 105 + done 106 + # GHC is a bit confused on its cross terminology, as these would normally be 107 + # the *host* tools. 108 + export CC="${targetCC}/bin/${targetCC.targetPrefix}cc" 109 + export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx" 110 + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 111 + export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString targetPlatform.isAarch32 ".gold"}" 112 + export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as" 113 + export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar" 114 + export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm" 115 + export RANLIB="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ranlib" 116 + export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" 117 + export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" 118 + 119 + echo -n "${buildMK}" > mk/build.mk 120 + sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 121 + '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 122 + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" 123 + '' + stdenv.lib.optionalString stdenv.isDarwin '' 124 + export NIX_LDFLAGS+=" -no_dtrace_dof" 125 + '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' 126 + sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets 127 + '' + stdenv.lib.optionalString targetPlatform.isMusl '' 128 + echo "patching llvm-targets for musl targets..." 129 + echo "Cloning these existing '*-linux-gnu*' targets:" 130 + grep linux-gnu llvm-targets | sed 's/^/ /' 131 + echo "(go go gadget sed)" 132 + sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets 133 + echo "llvm-targets now contains these '*-linux-musl*' targets:" 134 + grep linux-musl llvm-targets | sed 's/^/ /' 135 + 136 + echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" 137 + # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) 138 + for x in configure aclocal.m4; do 139 + substituteInPlace $x \ 140 + --replace '*-android*|*-gnueabi*)' \ 141 + '*-android*|*-gnueabi*|*-musleabi*)' 142 + done 143 + ''; 144 + 145 + # TODO(@Ericson2314): Always pass "--target" and always prefix. 146 + configurePlatforms = [ "build" "host" ] 147 + ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; 148 + # `--with` flags for libraries needed for RTS linker 149 + configureFlags = [ 150 + "--datadir=$doc/share/doc/ghc" 151 + "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" 152 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ 153 + "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" 154 + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ 155 + "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" 156 + ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ 157 + "--enable-bootstrap-with-devel-snapshot" 158 + ] ++ stdenv.lib.optionals (targetPlatform.isAarch32) [ 159 + "CFLAGS=-fuse-ld=gold" 160 + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" 161 + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" 162 + ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ 163 + # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ 164 + "--disable-large-address-space" 165 + ]; 166 + 167 + # Make sure we never relax`$PATH` and hooks support for compatability. 168 + strictDeps = true; 169 + 170 + nativeBuildInputs = [ 171 + perl autoconf automake m4 python3 sphinx 172 + ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour 173 + ]; 174 + 175 + # For building runtime libs 176 + depsBuildTarget = toolsForTarget; 177 + 178 + buildInputs = [ perl ] ++ (libDeps hostPlatform); 179 + 180 + propagatedBuildInputs = [ targetPackages.stdenv.cc ] 181 + ++ stdenv.lib.optional useLLVM llvmPackages.llvm; 182 + 183 + depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform); 184 + depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform); 185 + 186 + # required, because otherwise all symbols from HSffi.o are stripped, and 187 + # that in turn causes GHCi to abort 188 + stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols"; 189 + 190 + checkTarget = "test"; 191 + 192 + hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie"; 193 + 194 + postInstall = '' 195 + for bin in "$out"/lib/${name}/bin/*; do 196 + isELF "$bin" || continue 197 + paxmark m "$bin" 198 + done 199 + 200 + # Install the bash completion file. 201 + install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc 202 + 203 + # Patch scripts to include "readelf" and "cat" in $PATH. 204 + for i in "$out/bin/"*; do 205 + test ! -h $i || continue 206 + egrep --quiet '^#!' <(head -n 1 $i) || continue 207 + sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i 208 + done 209 + ''; 210 + 211 + passthru = { 212 + inherit bootPkgs targetPrefix; 213 + 214 + inherit llvmPackages; 215 + inherit enableShared; 216 + 217 + # Our Cabal compiler name 218 + haskellCompilerName = "ghc-8.6.3"; 219 + }; 220 + 221 + meta = { 222 + homepage = http://haskell.org/ghc; 223 + description = "The Glasgow Haskell Compiler"; 224 + maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ]; 225 + inherit (ghc.meta) license platforms; 226 + }; 227 + 228 + } // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { 229 + dontStrip = true; 230 + dontPatchELF = true; 231 + noAuditTmpdir = true; 232 + })
+4 -1
pkgs/development/interpreters/python/build-python-package.nix
··· 12 12 , namePrefix 13 13 , bootstrapped-pip 14 14 , flit 15 + , writeScript 16 + , update-python-libraries 15 17 }: 16 18 17 19 let ··· 20 22 wheel-specific = import ./build-python-package-wheel.nix { }; 21 23 common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; }; 22 24 mkPythonDerivation = import ./mk-python-derivation.nix { 23 - inherit lib config python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook toPythonModule namePrefix; 25 + inherit lib config python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook; 26 + inherit toPythonModule namePrefix writeScript update-python-libraries; 24 27 }; 25 28 in 26 29
+14 -2
pkgs/development/interpreters/python/mk-python-derivation.nix
··· 10 10 # Whether the derivation provides a Python module or not. 11 11 , toPythonModule 12 12 , namePrefix 13 + , writeScript 14 + , update-python-libraries 13 15 }: 14 16 15 17 { name ? "${attrs.pname}-${attrs.version}" ··· 64 66 then throw "${name} not supported for interpreter ${python.executable}" 65 67 else 66 68 67 - toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [ 69 + let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [ 68 70 "disabled" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" 69 71 ] // { 70 72 ··· 106 108 platforms = python.meta.platforms; 107 109 isBuildPythonPackage = python.meta.platforms; 108 110 } // meta; 109 - })) 111 + })); 112 + 113 + passthru = { 114 + updateScript = let 115 + filename = builtins.head (lib.splitString ":" self.meta.position); 116 + in writeScript "update-python" '' 117 + #!${python.stdenv.shell} 118 + ${update-python-libraries} ${filename} 119 + ''; 120 + }; 121 + in lib.extendDerivation true passthru self
+12
pkgs/development/interpreters/python/update-python-libraries/default.nix
··· 1 + { python3, runCommand, git }: 2 + 3 + runCommand "update-python-libraries" { 4 + buildInputs = [ 5 + (python3.withPackages(ps: with ps; [ packaging requests toolz ])) 6 + git 7 + ]; 8 + } '' 9 + cp ${./update-python-libraries.py} $out 10 + patchShebangs $out 11 + substituteInPlace $out --replace 'GIT = "git"' 'GIT = "${git}/bin/git"' 12 + ''
+362
pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py
··· 1 + #!/usr/bin/env python3 2 + 3 + """ 4 + Update a Python package expression by passing in the `.nix` file, or the directory containing it. 5 + You can pass in multiple files or paths. 6 + 7 + You'll likely want to use 8 + `` 9 + $ ./update-python-libraries ../../pkgs/development/python-modules/* 10 + `` 11 + to update all libraries in that folder. 12 + """ 13 + 14 + import argparse 15 + import logging 16 + import os 17 + import re 18 + import requests 19 + import toolz 20 + from concurrent.futures import ThreadPoolExecutor as Pool 21 + from packaging.version import Version as _Version 22 + from packaging.version import InvalidVersion 23 + from packaging.specifiers import SpecifierSet 24 + import collections 25 + import subprocess 26 + 27 + INDEX = "https://pypi.io/pypi" 28 + """url of PyPI""" 29 + 30 + EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip', '.whl'] 31 + """Permitted file extensions. These are evaluated from left to right and the first occurance is returned.""" 32 + 33 + PRERELEASES = False 34 + 35 + GIT = "git" 36 + 37 + import logging 38 + logging.basicConfig(level=logging.INFO) 39 + 40 + 41 + class Version(_Version, collections.abc.Sequence): 42 + 43 + def __init__(self, version): 44 + super().__init__(version) 45 + # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21` 46 + # https://github.com/avian2/unidecode/issues/13#issuecomment-354538882 47 + self.raw_version = version 48 + 49 + def __getitem__(self, i): 50 + return self._version.release[i] 51 + 52 + def __len__(self): 53 + return len(self._version.release) 54 + 55 + def __iter__(self): 56 + yield from self._version.release 57 + 58 + 59 + def _get_values(attribute, text): 60 + """Match attribute in text and return all matches. 61 + 62 + :returns: List of matches. 63 + """ 64 + regex = '{}\s+=\s+"(.*)";'.format(attribute) 65 + regex = re.compile(regex) 66 + values = regex.findall(text) 67 + return values 68 + 69 + def _get_unique_value(attribute, text): 70 + """Match attribute in text and return unique match. 71 + 72 + :returns: Single match. 73 + """ 74 + values = _get_values(attribute, text) 75 + n = len(values) 76 + if n > 1: 77 + raise ValueError("found too many values for {}".format(attribute)) 78 + elif n == 1: 79 + return values[0] 80 + else: 81 + raise ValueError("no value found for {}".format(attribute)) 82 + 83 + def _get_line_and_value(attribute, text): 84 + """Match attribute in text. Return the line and the value of the attribute.""" 85 + regex = '({}\s+=\s+"(.*)";)'.format(attribute) 86 + regex = re.compile(regex) 87 + value = regex.findall(text) 88 + n = len(value) 89 + if n > 1: 90 + raise ValueError("found too many values for {}".format(attribute)) 91 + elif n == 1: 92 + return value[0] 93 + else: 94 + raise ValueError("no value found for {}".format(attribute)) 95 + 96 + 97 + def _replace_value(attribute, value, text): 98 + """Search and replace value of attribute in text.""" 99 + old_line, old_value = _get_line_and_value(attribute, text) 100 + new_line = old_line.replace(old_value, value) 101 + new_text = text.replace(old_line, new_line) 102 + return new_text 103 + 104 + def _fetch_page(url): 105 + r = requests.get(url) 106 + if r.status_code == requests.codes.ok: 107 + return r.json() 108 + else: 109 + raise ValueError("request for {} failed".format(url)) 110 + 111 + 112 + SEMVER = { 113 + 'major' : 0, 114 + 'minor' : 1, 115 + 'patch' : 2, 116 + } 117 + 118 + 119 + def _determine_latest_version(current_version, target, versions): 120 + """Determine latest version, given `target`. 121 + """ 122 + current_version = Version(current_version) 123 + 124 + def _parse_versions(versions): 125 + for v in versions: 126 + try: 127 + yield Version(v) 128 + except InvalidVersion: 129 + pass 130 + 131 + versions = _parse_versions(versions) 132 + 133 + index = SEMVER[target] 134 + 135 + ceiling = list(current_version[0:index]) 136 + if len(ceiling) == 0: 137 + ceiling = None 138 + else: 139 + ceiling[-1]+=1 140 + ceiling = Version(".".join(map(str, ceiling))) 141 + 142 + # We do not want prereleases 143 + versions = SpecifierSet(prereleases=PRERELEASES).filter(versions) 144 + 145 + if ceiling is not None: 146 + versions = SpecifierSet(f"<{ceiling}").filter(versions) 147 + 148 + return (max(sorted(versions))).raw_version 149 + 150 + 151 + def _get_latest_version_pypi(package, extension, current_version, target): 152 + """Get latest version and hash from PyPI.""" 153 + url = "{}/{}/json".format(INDEX, package) 154 + json = _fetch_page(url) 155 + 156 + versions = json['releases'].keys() 157 + version = _determine_latest_version(current_version, target, versions) 158 + 159 + try: 160 + releases = json['releases'][version] 161 + except KeyError as e: 162 + raise KeyError('Could not find version {} for {}'.format(version, package)) from e 163 + for release in releases: 164 + if release['filename'].endswith(extension): 165 + # TODO: In case of wheel we need to do further checks! 166 + sha256 = release['digests']['sha256'] 167 + break 168 + else: 169 + sha256 = None 170 + return version, sha256 171 + 172 + 173 + def _get_latest_version_github(package, extension, current_version, target): 174 + raise ValueError("updating from GitHub is not yet supported.") 175 + 176 + 177 + FETCHERS = { 178 + 'fetchFromGitHub' : _get_latest_version_github, 179 + 'fetchPypi' : _get_latest_version_pypi, 180 + 'fetchurl' : _get_latest_version_pypi, 181 + } 182 + 183 + 184 + DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz' 185 + 186 + 187 + FORMATS = { 188 + 'setuptools' : DEFAULT_SETUPTOOLS_EXTENSION, 189 + 'wheel' : 'whl' 190 + } 191 + 192 + def _determine_fetcher(text): 193 + # Count occurences of fetchers. 194 + nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys()) 195 + if nfetchers == 0: 196 + raise ValueError("no fetcher.") 197 + elif nfetchers > 1: 198 + raise ValueError("multiple fetchers.") 199 + else: 200 + # Then we check which fetcher to use. 201 + for fetcher in FETCHERS.keys(): 202 + if 'src = {}'.format(fetcher) in text: 203 + return fetcher 204 + 205 + 206 + def _determine_extension(text, fetcher): 207 + """Determine what extension is used in the expression. 208 + 209 + If we use: 210 + - fetchPypi, we check if format is specified. 211 + - fetchurl, we determine the extension from the url. 212 + - fetchFromGitHub we simply use `.tar.gz`. 213 + """ 214 + if fetcher == 'fetchPypi': 215 + try: 216 + src_format = _get_unique_value('format', text) 217 + except ValueError as e: 218 + src_format = None # format was not given 219 + 220 + try: 221 + extension = _get_unique_value('extension', text) 222 + except ValueError as e: 223 + extension = None # extension was not given 224 + 225 + if extension is None: 226 + if src_format is None: 227 + src_format = 'setuptools' 228 + elif src_format == 'flit': 229 + raise ValueError("Don't know how to update a Flit package.") 230 + extension = FORMATS[src_format] 231 + 232 + elif fetcher == 'fetchurl': 233 + url = _get_unique_value('url', text) 234 + extension = os.path.splitext(url)[1] 235 + if 'pypi' not in url: 236 + raise ValueError('url does not point to PyPI.') 237 + 238 + elif fetcher == 'fetchFromGitHub': 239 + raise ValueError('updating from GitHub is not yet implemented.') 240 + 241 + return extension 242 + 243 + 244 + def _update_package(path, target): 245 + 246 + # Read the expression 247 + with open(path, 'r') as f: 248 + text = f.read() 249 + 250 + # Determine pname. 251 + pname = _get_unique_value('pname', text) 252 + 253 + # Determine version. 254 + version = _get_unique_value('version', text) 255 + 256 + # First we check how many fetchers are mentioned. 257 + fetcher = _determine_fetcher(text) 258 + 259 + extension = _determine_extension(text, fetcher) 260 + 261 + new_version, new_sha256 = FETCHERS[fetcher](pname, extension, version, target) 262 + 263 + if new_version == version: 264 + logging.info("Path {}: no update available for {}.".format(path, pname)) 265 + return False 266 + elif Version(new_version) <= Version(version): 267 + raise ValueError("downgrade for {}.".format(pname)) 268 + if not new_sha256: 269 + raise ValueError("no file available for {}.".format(pname)) 270 + 271 + text = _replace_value('version', new_version, text) 272 + text = _replace_value('sha256', new_sha256, text) 273 + 274 + with open(path, 'w') as f: 275 + f.write(text) 276 + 277 + logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version)) 278 + 279 + result = { 280 + 'path' : path, 281 + 'target': target, 282 + 'pname': pname, 283 + 'old_version' : version, 284 + 'new_version' : new_version, 285 + #'fetcher' : fetcher, 286 + } 287 + 288 + return result 289 + 290 + 291 + def _update(path, target): 292 + 293 + # We need to read and modify a Nix expression. 294 + if os.path.isdir(path): 295 + path = os.path.join(path, 'default.nix') 296 + 297 + # If a default.nix does not exist, we quit. 298 + if not os.path.isfile(path): 299 + logging.info("Path {}: does not exist.".format(path)) 300 + return False 301 + 302 + # If file is not a Nix expression, we quit. 303 + if not path.endswith(".nix"): 304 + logging.info("Path {}: does not end with `.nix`.".format(path)) 305 + return False 306 + 307 + try: 308 + return _update_package(path, target) 309 + except ValueError as e: 310 + logging.warning("Path {}: {}".format(path, e)) 311 + return False 312 + 313 + 314 + def _commit(path, pname, old_version, new_version, **kwargs): 315 + """Commit result. 316 + """ 317 + 318 + msg = f'python: {pname}: {old_version} -> {new_version}' 319 + 320 + try: 321 + subprocess.check_call([GIT, 'add', path]) 322 + subprocess.check_call([GIT, 'commit', '-m', msg]) 323 + except subprocess.CalledProcessError as e: 324 + subprocess.check_call([GIT, 'checkout', path]) 325 + raise subprocess.CalledProcessError(f'Could not commit {path}') from e 326 + 327 + return True 328 + 329 + 330 + def main(): 331 + 332 + parser = argparse.ArgumentParser() 333 + parser.add_argument('package', type=str, nargs='+') 334 + parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major') 335 + parser.add_argument('--commit', action='store_true', help='Create a commit for each package update') 336 + 337 + args = parser.parse_args() 338 + target = args.target 339 + 340 + packages = list(map(os.path.abspath, args.package)) 341 + 342 + logging.info("Updating packages...") 343 + 344 + # Use threads to update packages concurrently 345 + with Pool() as p: 346 + results = list(p.map(lambda pkg: _update(pkg, target), packages)) 347 + 348 + logging.info("Finished updating packages.") 349 + 350 + # Commits are created sequentially. 351 + if args.commit: 352 + logging.info("Committing updates...") 353 + list(map(lambda x: _commit(**x), filter(bool, results))) 354 + logging.info("Finished committing updates") 355 + 356 + count = sum(map(bool, results)) 357 + logging.info("{} package(s) updated".format(count)) 358 + 359 + 360 + 361 + if __name__ == '__main__': 362 + main()
+2 -2
pkgs/development/ruby-modules/bundix/default.nix
··· 6 6 7 7 name = "${gemName}-${version}"; 8 8 gemName = "bundix"; 9 - version = "2.4.0"; 9 + version = "2.4.1"; 10 10 11 11 src = fetchFromGitHub { 12 12 owner = "manveru"; 13 13 repo = "bundix"; 14 14 rev = version; 15 - sha256 = "1lq8nday6031mj7ivnk2wd47v2smz6frnb8xh2yhyhpld045v1rz"; 15 + sha256 = "175qmv7dj7v50v71b78dzn5pb4a35ml6p15asks9q1rrlkz0n4gn"; 16 16 }; 17 17 18 18 buildInputs = [ ruby bundler ];
+2 -2
pkgs/development/tools/misc/elfinfo/default.nix
··· 2 2 3 3 buildGoPackage rec { 4 4 name = "elfinfo-${version}"; 5 - version = "0.7.4"; 5 + version = "0.7.5"; 6 6 7 7 goPackagePath = "github.com/xyproto/elfinfo"; 8 8 src = fetchFromGitHub { 9 9 rev = version; 10 10 owner = "xyproto"; 11 11 repo = "elfinfo"; 12 - sha256 = "12n86psri9077v7s6b4j7djg5kijf9gybd80f9sfs0xmgkbly3gv"; 12 + sha256 = "0b6zyfq0yhpbf03h52q2lgf6ff086gcsbnhm6chx18h0q1g17m96"; 13 13 }; 14 14 15 15 meta = with stdenv.lib; {
+4 -4
pkgs/development/tools/skaffold/default.nix
··· 2 2 3 3 buildGoPackage rec { 4 4 name = "skaffold-${version}"; 5 - version = "0.18.0"; 6 - # rev is the 0.18.0 commit, mainly for skaffold version command output 7 - rev = "34651689be78b2c6bcfbace5072b00b93661f895"; 5 + version = "0.19.0"; 6 + # rev is the 0.19.0 commit, mainly for skaffold version command output 7 + rev = "9eb0dfc1bf634b97462c66b4dfb80e4cea378ade"; 8 8 9 9 goPackagePath = "github.com/GoogleContainerTools/skaffold"; 10 10 subPackages = ["cmd/skaffold"]; ··· 20 20 owner = "GoogleContainerTools"; 21 21 repo = "skaffold"; 22 22 rev = "v${version}"; 23 - sha256 = "0an3g4jqch7a6ckh8yhia7lykpvb5lvz4kd5kqfmw9479kygv9sa"; 23 + sha256 = "0s7dyfdmgslwnmbkzyqvf2622gj5d7vx9igwz3bf6dpaz382mk6h"; 24 24 }; 25 25 26 26 meta = {
+1
pkgs/misc/emulators/wine/base.nix
··· 45 45 ++ lib.optional xineramaSupport pkgs.xorg.libXinerama 46 46 ++ lib.optional udevSupport pkgs.udev 47 47 ++ lib.optional vulkanSupport pkgs.vulkan-loader 48 + ++ lib.optional sdlSupport pkgs.SDL2 48 49 ++ lib.optionals gstreamerSupport (with pkgs.gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ]) 49 50 ++ lib.optionals gtkSupport [ pkgs.gtk3 pkgs.glib ] 50 51 ++ lib.optionals openclSupport [ pkgs.opencl-headers pkgs.ocl-icd ]
+2 -1
pkgs/misc/emulators/wine/default.nix
··· 42 42 xineramaSupport ? false, 43 43 xmlSupport ? false, 44 44 vulkanSupport ? false, 45 + sdlSupport ? false, 45 46 }: 46 47 47 48 let wine-build = build: release: ··· 53 54 netapiSupport cursesSupport vaSupport pcapSupport v4lSupport saneSupport 54 55 gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport 55 56 pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport 56 - openglSupport gstreamerSupport udevSupport vulkanSupport; 57 + openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport; 57 58 }; 58 59 }); 59 60
+1 -1
pkgs/servers/uwsgi/default.nix
··· 89 89 ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} 90 90 ''; 91 91 92 - NIX_CFLAGS_LINK = [ "-lsystemd" ] ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed; 92 + NIX_CFLAGS_LINK = lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed; 93 93 94 94 meta = with stdenv.lib; { 95 95 homepage = https://uwsgi-docs.readthedocs.org/en/latest/;
+3 -3
pkgs/tools/X11/grobi/default.nix
··· 1 1 { stdenv, fetchFromGitHub, buildGoPackage }: 2 2 3 3 buildGoPackage rec { 4 - version = "0.3.0"; 4 + version = "0.5.1"; 5 5 name = "grobi-${version}"; 6 6 7 7 goPackagePath = "github.com/fd0/grobi"; 8 8 9 9 src = fetchFromGitHub { 10 - rev = "78a0639ffad765933a5233a1c94d2626e24277b8"; 10 + rev = "5ddc167b9e4f84755a515828360abda15c54b7de"; 11 11 owner = "fd0"; 12 12 repo = "grobi"; 13 - sha256 = "16q7vnhb1p6ds561832sfdszvlafww67bjn3lc0d18v7lyak2l3i"; 13 + sha256 = "0iyxidq60pf6ki52f8fffplf10nl8w9jx1b7igg98csnc6iqxh89"; 14 14 }; 15 15 16 16 meta = with stdenv.lib; {
+2
pkgs/top-level/all-packages.nix
··· 7912 7912 python37Packages = recurseIntoAttrs python37.pkgs; 7913 7913 pypyPackages = pypy.pkgs; 7914 7914 7915 + update-python-libraries = callPackage ../development/interpreters/python/update-python-libraries { }; 7916 + 7915 7917 # Should eventually be moved inside Python interpreters. 7916 7918 python-setup-hook = callPackage ../development/interpreters/python/setup-hook.nix { }; 7917 7919
+11
pkgs/top-level/haskell-packages.nix
··· 68 68 buildLlvmPackages = buildPackages.llvmPackages_6; 69 69 llvmPackages = pkgs.llvmPackages_6; 70 70 }; 71 + ghc863 = callPackage ../development/compilers/ghc/8.6.3.nix { 72 + bootPkgs = packages.ghc822; 73 + inherit (buildPackages.python3Packages) sphinx; 74 + buildLlvmPackages = buildPackages.llvmPackages_6; 75 + llvmPackages = pkgs.llvmPackages_6; 76 + }; 71 77 ghcHEAD = callPackage ../development/compilers/ghc/head.nix { 72 78 bootPkgs = packages.ghc822Binary; 73 79 inherit (buildPackages.python3Packages) sphinx; ··· 128 134 ghc862 = callPackage ../development/haskell-modules { 129 135 buildHaskellPackages = bh.packages.ghc862; 130 136 ghc = bh.compiler.ghc862; 137 + compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { }; 138 + }; 139 + ghc863 = callPackage ../development/haskell-modules { 140 + buildHaskellPackages = bh.packages.ghc863; 141 + ghc = bh.compiler.ghc863; 131 142 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { }; 132 143 }; 133 144 ghcHEAD = callPackage ../development/haskell-modules {
+1
pkgs/top-level/wine-packages.nix
··· 25 25 udevSupport = true; 26 26 xineramaSupport = true; 27 27 xmlSupport = true; 28 + sdlSupport = true; 28 29 }; 29 30 30 31 full = base.override {