git.iko.soy/typeable/nixpkgs
on master help sign in
Merge master into staging-next
commite0950ae9ad7e101c16ce8bbc28d566c75bb298fb authorFrederik Rietdijk <fridh@fridh.nl> dateSat 8 Dec 2018, 12:40 (8 years ago) parent12e8ec085d9f63
28 files changed+716−427
maintainers/scripts/update-python-libraries+2−360 nixos/modules/services/databases/mysql.nix+17−17 pkgs/applications/altcoins/monero-gui/default.nix+1−1 pkgs/applications/audio/opus-tools/default.nix+4−4 pkgs/applications/misc/aminal/default.nix+2−2 pkgs/applications/networking/cluster/cni/default.nix+8−2 pkgs/applications/networking/cluster/cni/plugins.nix+8−2 pkgs/applications/networking/instant-messengers/bitlbee-discord/default.nix+2−2 pkgs/applications/networking/vnstat/default.nix+4−4 pkgs/applications/office/todoman/default.nix+2−9 pkgs/applications/science/astronomy/gildas/default.nix+3−3 pkgs/build-support/agda/default.nix+3−3 pkgs/data/icons/elementary-icon-theme/default.nix+7−2 pkgs/development/compilers/ghc/8.6.3.nix+232 pkgs/development/interpreters/python/build-python-package.nix+4−1 pkgs/development/interpreters/python/mk-python-derivation.nix+14−2 pkgs/development/interpreters/python/update-python-libraries/default.nix+12 pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py+362 pkgs/development/ruby-modules/bundix/default.nix+2−2 pkgs/development/tools/misc/elfinfo/default.nix+2−2 pkgs/development/tools/skaffold/default.nix+4−4 pkgs/misc/emulators/wine/base.nix+1 pkgs/misc/emulators/wine/default.nix+2−1 pkgs/servers/uwsgi/default.nix+1−1 pkgs/tools/X11/grobi/default.nix+3−3 pkgs/top-level/all-packages.nix+2 pkgs/top-level/haskell-packages.nix+11 pkgs/top-level/wine-packages.nix+1
maintainers/scripts/update-python-libraries+2−360
@@ -1,361 +1,3 @@
1−#! /usr/bin/env nix-shell
2−#! nix-shell -i python3 -p "python3.withPackages(ps: with ps; [ packaging requests toolz ])" -p git
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
33
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.
207−
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()
nixos/modules/services/databases/mysql.nix+17−17
@@ -29,21 +29,6 @@ let
2929 installOptions =
3030 "${mysqldAndInstallOptions} ${lib.optionalString isMysqlAtLeast57 "--insecure"}";
3131
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−
4732in
4833
4934{
@@ -242,6 +227,21 @@ in
242227
243228 environment.systemPackages = [mysql];
244229
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+
245245 systemd.services.mysql = let
246246 hasNotify = (cfg.package == pkgs.mariadb);
247247 in {
@@ -263,7 +263,7 @@ in
263263 if ! test -e ${cfg.dataDir}/mysql; then
264264 mkdir -m 0700 -p ${cfg.dataDir}
265265 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}
267267 touch /tmp/mysql_init
268268 fi
269269
@@ -274,7 +274,7 @@ in
274274 serviceConfig = {
275275 Type = if hasNotify then "notify" else "simple";
276276 RuntimeDirectory = "mysqld";
277− ExecStart = "${mysql}/bin/mysqld --defaults-extra-file=${myCnf} ${mysqldOptions}";
277+ ExecStart = "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions}";
278278 };
279279
280280 postStart = ''
pkgs/applications/altcoins/monero-gui/default.nix+1−1
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
6060 name = "monero-wallet-gui";
6161 exec = "monero-wallet-gui";
6262 icon = "monero";
63− desktopName = "Monero Wallet";
63+ desktopName = "Monero";
6464 genericName = "Wallet";
6565 categories = "Application;Network;Utility;";
6666 };
pkgs/applications/audio/opus-tools/default.nix+4−4
@@ -1,14 +1,14 @@
1−{stdenv, fetchurl, libogg, libao, pkgconfig, libopus, flac}:
1+{stdenv, fetchurl, libogg, libao, pkgconfig, flac, opusfile, libopusenc}:
22
33stdenv.mkDerivation rec {
4− name = "opus-tools-0.1.10";
4+ name = "opus-tools-0.2";
55 src = fetchurl {
66 url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
7− sha256 = "135jfb9ny3xvd27idsxj7j5ns90lslbyrq70cq3bfwcls4r7add2";
7+ sha256 = "11pzl27s4vcz4m18ch72nivbhww2zmzn56wspb7rll1y1nq6rrdl";
88 };
99
1010 nativeBuildInputs = [ pkgconfig ];
11− buildInputs = [ libogg libao libopus flac ];
11+ buildInputs = [ libogg libao flac opusfile libopusenc ];
1212
1313 meta = {
1414 description = "Tools to work with opus encoded audio streams";
pkgs/applications/misc/aminal/default.nix+2−2
@@ -12,7 +12,7 @@
1212
1313buildGoPackage rec {
1414 name = "aminal-${version}";
15− version = "0.7.8";
15+ version = "0.7.12";
1616
1717 goPackagePath = "github.com/liamg/aminal";
1818
@@ -36,7 +36,7 @@ buildGoPackage rec {
3636 owner = "liamg";
3737 repo = "aminal";
3838 rev = "v${version}";
39− sha256 = "02gamvvs56w4zwqdvalbsgb2gbh0398gl7qk36pgyqkcgj3bcwv8";
39+ sha256 = "1ak5g2i4ggi00b4q7qigfwsrwb5rvswjjbr2hp9kyxd45nycb0g4";
4040 };
4141
4242 preBuild = ''
pkgs/applications/networking/cluster/cni/default.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub, go }:
1+{ stdenv, fetchFromGitHub, go, removeReferencesTo }:
22
33stdenv.mkDerivation rec {
44 name = "cni-${version}";
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
1111 sha256 = "00ajs2r5r2z3l0vqwxrcwhjfc9px12qbcv5vnvs2mdipvvls1y2y";
1212 };
1313
14− buildInputs = [ go ];
14+ buildInputs = [ removeReferencesTo go ];
15+
16+ GOCACHE = "off";
1517
1618 buildPhase = ''
1719 patchShebangs build.sh
@@ -23,6 +25,10 @@ stdenv.mkDerivation rec {
2325 mv bin/cnitool $out/bin
2426 '';
2527
28+ preFixup = ''
29+ find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
30+ '';
31+
2632 meta = with stdenv.lib; {
2733 description = "Container Network Interface - networking for Linux containers";
2834 license = licenses.asl20;
pkgs/applications/networking/cluster/cni/plugins.nix+8−2
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchFromGitHub, go }:
1+{ stdenv, lib, fetchFromGitHub, go, removeReferencesTo }:
22
33stdenv.mkDerivation rec {
44 name = "cni-plugins-${version}";
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
1111 sha256 = "1sywllwnr6lc812sgkqjdd3y10r82shl88dlnwgnbgzs738q2vp2";
1212 };
1313
14− buildInputs = [ go ];
14+ buildInputs = [ removeReferencesTo go ];
15+
16+ GOCACHE = "off";
1517
1618 buildPhase = ''
1719 patchShebangs build.sh
@@ -23,6 +25,10 @@ stdenv.mkDerivation rec {
2325 mv bin/* $out/bin
2426 '';
2527
28+ preFixup = ''
29+ find $out/bin -type f -exec remove-references-to -t ${go} '{}' +
30+ '';
31+
2632 meta = with lib; {
2733 description = "Some standard networking plugins, maintained by the CNI team";
2834 homepage = https://github.com/containernetworking/plugins;
pkgs/applications/networking/instant-messengers/bitlbee-discord/default.nix+2−2
@@ -3,13 +3,13 @@
33with stdenv.lib;
44stdenv.mkDerivation rec {
55 name = "bitlbee-discord-${version}";
6− version = "0.4.1";
6+ version = "0.4.2";
77
88 src = fetchFromGitHub {
99 rev = version;
1010 owner = "sm00th";
1111 repo = "bitlbee-discord";
12− sha256 = "1n3xw5mcmg7224r09gbm39bd6h2158dwl6jx21290636b4345f4c";
12+ sha256 = "02pigk2vbz0jdz11f96sygdvp1j762yjn62h124fkcsc070g7a2f";
1313 };
1414
1515 nativeBuildInputs = [ autoreconfHook pkgconfig ];
pkgs/applications/networking/vnstat/default.nix+4−4
@@ -1,15 +1,15 @@
1−{ stdenv, fetchurl, gd, ncurses }:
1+{ stdenv, fetchurl, gd, ncurses, sqlite }:
22
33stdenv.mkDerivation rec {
44 name = "vnstat-${version}";
5− version = "1.18";
5+ version = "2.1";
66
77 src = fetchurl {
8− sha256 = "1mc7qqvrnl0zyhgh8n7wx1g1cbwq74xpvbz8rfjmyi77p693a6fp";
8+ sha256 = "0yk0x6bg9f36dsslhayyyi8fg04yvzjzqkjmlrcsrv6nnggchb6i";
99 url = "https://humdi.net/vnstat/${name}.tar.gz";
1010 };
1111
12− buildInputs = [ gd ncurses ];
12+ buildInputs = [ gd ncurses sqlite ];
1313
1414 postPatch = ''
1515 substituteInPlace src/cfg.c --replace /usr/local $out
pkgs/applications/office/todoman/default.nix+2−9
@@ -5,12 +5,12 @@ let
55in
66buildPythonApplication rec {
77 pname = "todoman";
8− version = "3.4.1";
8+ version = "3.5.0";
99 name = "${pname}-${version}";
1010
1111 src = fetchPypi {
1212 inherit pname version;
13− sha256 = "1rvid1rklvgvsf6xmxd91j2fi46v4fzn5z6zbs5yn0wpb0k605r5";
13+ sha256 = "051qjdpwif06x7qspnb4pfwdhb8nnmz99yqcp4kla5hv0n3jh0w9";
1414 };
1515
1616 LOCALE_ARCHIVE = stdenv.lib.optionalString stdenv.isLinux
@@ -29,13 +29,6 @@ buildPythonApplication rec {
2929 makeWrapperArgs = [ "--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive"
3030 "--set CHARSET en_us.UTF-8" ];
3131
32− patches = [
33− (fetchpatch {
34− url = "https://github.com/pimutils/todoman/commit/3e191111b72df9ec91a773befefa291799374422.patch";
35− sha256 = "12mskbp0d8p2lllkxm3m9wyy2hsbnz2qs297civsc3ly2l5bcrag";
36− })
37− ];
38−
3932 preCheck = ''
4033 # Remove one failing test that only checks whether the command line works
4134 rm tests/test_main.py
pkgs/applications/science/astronomy/gildas/default.nix+3−3
@@ -7,8 +7,8 @@ let
77in
88
99stdenv.mkDerivation rec {
10− srcVersion = "nov18a";
11− version = "20181101_a";
10+ srcVersion = "dec18a";
11+ version = "20181201_a";
1212 name = "gildas-${version}";
1313
1414 src = fetchurl {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
1616 # source code of the previous release to a different directory
1717 urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.gz"
1818 "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.gz" ];
19− sha256 = "1dl2v8y6vrwaxm3b7nf6dv3ipzybhlhy2kxwnwgc7gqz5704251v";
19+ sha256 = "f295b5b7f999c0d746a52b307af7b7bdbed0d9b3d87100a6a102e0cc64f3a9bd";
2020 };
2121
2222 enableParallelBuilding = true;
pkgs/build-support/agda/default.nix+3−3
@@ -3,7 +3,7 @@
33# Contact: stdenv.lib.maintainers.fuuzetsu
44
55{ stdenv, Agda, glibcLocales
6−, writeScriptBin
6+, writeShellScriptBin
77, extension ? (self: super: {})
88}:
99
@@ -77,8 +77,8 @@ let
7777 buildInputs = let
7878 # Makes a wrapper available to the user. Very useful in
7979 # nix-shell where all dependencies are -i'd.
80− agdaWrapper = writeScriptBin "agda" ''
81− ${self.agdaWithArgs} "$@"
80+ agdaWrapper = writeShellScriptBin "agda" ''
81+ exec ${self.agdaWithArgs} "$@"
8282 '';
8383 in [agdaWrapper] ++ self.buildDepends;
8484 };
pkgs/data/icons/elementary-icon-theme/default.nix+7−2
@@ -2,17 +2,22 @@
22
33stdenv.mkDerivation rec {
44 name = "elementary-icon-theme-${version}";
5− version = "5.0";
5+ version = "5.0.1";
66
77 src = fetchFromGitHub {
88 owner = "elementary";
99 repo = "icons";
1010 rev = version;
11− sha256 = "146s26q4bb5sag35iv42hrnbdciam2ajl7s5s5jayli5vp8bw08w";
11+ sha256 = "1rw924b3ixfdff368dpv4vgsykwncmrvj9a6yfss0cf236xnvr9b";
1212 };
1313
1414 nativeBuildInputs = [ meson ninja python3 gtk3 ];
1515
16+ # Disable installing gimp and inkscape palette files
17+ mesonFlags = [
18+ "-Dpalettes=false"
19+ ];
20+
1621 postPatch = ''
1722 chmod +x meson/symlink.py
1823 patchShebangs .
pkgs/development/compilers/ghc/8.6.3.nixnew file+232
@@ -0,0 +1,232 @@
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+})
pkgs/development/interpreters/python/build-python-package.nix+4−1
@@ -12,6 +12,8 @@
1212, namePrefix
1313, bootstrapped-pip
1414, flit
15+, writeScript
16+, update-python-libraries
1517}:
1618
1719let
@@ -20,7 +22,8 @@ let
2022 wheel-specific = import ./build-python-package-wheel.nix { };
2123 common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
2224 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;
2427 };
2528in
2629
pkgs/development/interpreters/python/mk-python-derivation.nix+14−2
@@ -10,6 +10,8 @@
1010# Whether the derivation provides a Python module or not.
1111, toPythonModule
1212, namePrefix
13+, writeScript
14+, update-python-libraries
1315}:
1416
1517{ name ? "${attrs.pname}-${attrs.version}"
@@ -64,7 +66,7 @@ if disabled
6466then throw "${name} not supported for interpreter ${python.executable}"
6567else
6668
67−toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
69+let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
6870 "disabled" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts"
6971 ] // {
7072
@@ -106,4 +108,14 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
106108 platforms = python.meta.platforms;
107109 isBuildPythonPackage = python.meta.platforms;
108110 } // 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
pkgs/development/interpreters/python/update-python-libraries/default.nixnew file+12
@@ -0,0 +1,12 @@
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+''
pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.pynew file+362
@@ -0,0 +1,362 @@
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()
pkgs/development/ruby-modules/bundix/default.nix+2−2
@@ -6,13 +6,13 @@ buildRubyGem rec {
66
77 name = "${gemName}-${version}";
88 gemName = "bundix";
9− version = "2.4.0";
9+ version = "2.4.1";
1010
1111 src = fetchFromGitHub {
1212 owner = "manveru";
1313 repo = "bundix";
1414 rev = version;
15− sha256 = "1lq8nday6031mj7ivnk2wd47v2smz6frnb8xh2yhyhpld045v1rz";
15+ sha256 = "175qmv7dj7v50v71b78dzn5pb4a35ml6p15asks9q1rrlkz0n4gn";
1616 };
1717
1818 buildInputs = [ ruby bundler ];
pkgs/development/tools/misc/elfinfo/default.nix+2−2
@@ -2,14 +2,14 @@
22
33buildGoPackage rec {
44 name = "elfinfo-${version}";
5− version = "0.7.4";
5+ version = "0.7.5";
66
77 goPackagePath = "github.com/xyproto/elfinfo";
88 src = fetchFromGitHub {
99 rev = version;
1010 owner = "xyproto";
1111 repo = "elfinfo";
12− sha256 = "12n86psri9077v7s6b4j7djg5kijf9gybd80f9sfs0xmgkbly3gv";
12+ sha256 = "0b6zyfq0yhpbf03h52q2lgf6ff086gcsbnhm6chx18h0q1g17m96";
1313 };
1414
1515 meta = with stdenv.lib; {
pkgs/development/tools/skaffold/default.nix+4−4
@@ -2,9 +2,9 @@
22
33buildGoPackage rec {
44 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";
88
99 goPackagePath = "github.com/GoogleContainerTools/skaffold";
1010 subPackages = ["cmd/skaffold"];
@@ -20,7 +20,7 @@ buildGoPackage rec {
2020 owner = "GoogleContainerTools";
2121 repo = "skaffold";
2222 rev = "v${version}";
23− sha256 = "0an3g4jqch7a6ckh8yhia7lykpvb5lvz4kd5kqfmw9479kygv9sa";
23+ sha256 = "0s7dyfdmgslwnmbkzyqvf2622gj5d7vx9igwz3bf6dpaz382mk6h";
2424 };
2525
2626 meta = {
pkgs/misc/emulators/wine/base.nix+1
@@ -45,6 +45,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (! isNull buildScript) {
4545 ++ lib.optional xineramaSupport pkgs.xorg.libXinerama
4646 ++ lib.optional udevSupport pkgs.udev
4747 ++ lib.optional vulkanSupport pkgs.vulkan-loader
48+ ++ lib.optional sdlSupport pkgs.SDL2
4849 ++ lib.optionals gstreamerSupport (with pkgs.gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ])
4950 ++ lib.optionals gtkSupport [ pkgs.gtk3 pkgs.glib ]
5051 ++ lib.optionals openclSupport [ pkgs.opencl-headers pkgs.ocl-icd ]
pkgs/misc/emulators/wine/default.nix+2−1
@@ -42,6 +42,7 @@
4242 xineramaSupport ? false,
4343 xmlSupport ? false,
4444 vulkanSupport ? false,
45+ sdlSupport ? false,
4546}:
4647
4748let wine-build = build: release:
@@ -53,7 +54,7 @@ let wine-build = build: release:
5354 netapiSupport cursesSupport vaSupport pcapSupport v4lSupport saneSupport
5455 gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport
5556 pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport
56− openglSupport gstreamerSupport udevSupport vulkanSupport;
57+ openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport;
5758 };
5859 });
5960
pkgs/servers/uwsgi/default.nix+1−1
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
8989 ${lib.concatMapStringsSep "\n" (x: x.install or "") needed}
9090 '';
9191
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;
9393
9494 meta = with stdenv.lib; {
9595 homepage = https://uwsgi-docs.readthedocs.org/en/latest/;
pkgs/tools/X11/grobi/default.nix+3−3
@@ -1,16 +1,16 @@
11{ stdenv, fetchFromGitHub, buildGoPackage }:
22
33buildGoPackage rec {
4− version = "0.3.0";
4+ version = "0.5.1";
55 name = "grobi-${version}";
66
77 goPackagePath = "github.com/fd0/grobi";
88
99 src = fetchFromGitHub {
10− rev = "78a0639ffad765933a5233a1c94d2626e24277b8";
10+ rev = "5ddc167b9e4f84755a515828360abda15c54b7de";
1111 owner = "fd0";
1212 repo = "grobi";
13− sha256 = "16q7vnhb1p6ds561832sfdszvlafww67bjn3lc0d18v7lyak2l3i";
13+ sha256 = "0iyxidq60pf6ki52f8fffplf10nl8w9jx1b7igg98csnc6iqxh89";
1414 };
1515
1616 meta = with stdenv.lib; {
pkgs/top-level/all-packages.nix+2
@@ -7912,6 +7912,8 @@ in
79127912 python37Packages = recurseIntoAttrs python37.pkgs;
79137913 pypyPackages = pypy.pkgs;
79147914
7915+ update-python-libraries = callPackage ../development/interpreters/python/update-python-libraries { };
7916+
79157917 # Should eventually be moved inside Python interpreters.
79167918 python-setup-hook = callPackage ../development/interpreters/python/setup-hook.nix { };
79177919
pkgs/top-level/haskell-packages.nix+11
@@ -68,6 +68,12 @@ in {
6868 buildLlvmPackages = buildPackages.llvmPackages_6;
6969 llvmPackages = pkgs.llvmPackages_6;
7070 };
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+ };
7177 ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
7278 bootPkgs = packages.ghc822Binary;
7379 inherit (buildPackages.python3Packages) sphinx;
@@ -130,6 +136,11 @@ in {
130136 ghc = bh.compiler.ghc862;
131137 compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { };
132138 };
139+ ghc863 = callPackage ../development/haskell-modules {
140+ buildHaskellPackages = bh.packages.ghc863;
141+ ghc = bh.compiler.ghc863;
142+ compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.6.x.nix { };
143+ };
133144 ghcHEAD = callPackage ../development/haskell-modules {
134145 buildHaskellPackages = bh.packages.ghcHEAD;
135146 ghc = bh.compiler.ghcHEAD;
pkgs/top-level/wine-packages.nix+1
@@ -25,6 +25,7 @@ rec {
2525 udevSupport = true;
2626 xineramaSupport = true;
2727 xmlSupport = true;
28+ sdlSupport = true;
2829 };
2930
3031 full = base.override {