···11+/* Library of low-level helper functions for nix expressions.
22+ *
33+ * Please implement (mostly) exhaustive unit tests
44+ * for new functions in `./tests.nix'.
55+ */
16let
2738 # trivial, often used functions
+10
lib/tests.nix
···277277 expected = [ "2001" "db8" "0" "0042" "" "8a2e" "370" "" ];
278278 };
279279280280+ testComposeExtensions = {
281281+ expr = let obj = makeExtensible (self: { foo = self.bar; });
282282+ f = self: super: { bar = false; baz = true; };
283283+ g = self: super: { bar = super.baz or false; };
284284+ f_o_g = composeExtensions f g;
285285+ composed = obj.extend f_o_g;
286286+ in composed.foo;
287287+ expected = true;
288288+ };
289289+280290}
+9
lib/trivial.nix
···8585 # argument, but it's nice this way if several uses of `extends` are cascaded.
8686 extends = f: rattrs: self: let super = rattrs self; in super // f self super;
87878888+ # Compose two extending functions of the type expected by 'extends'
8989+ # into one where changes made in the first are available in the
9090+ # 'super' of the second
9191+ composeExtensions =
9292+ f: g: self: super:
9393+ let fApplied = f self super;
9494+ super' = super // fApplied;
9595+ in fApplied // g self super';
9696+8897 # Create an overridable, recursive attribute set. For example:
8998 #
9099 # nix-repl> obj = makeExtensible (self: { })
+2
nixos/doc/manual/release-notes/rl-1709.xml
···3535<itemizedlist>
3636 <listitem>
3737 <para>
3838+ Top-level <literal>idea</literal> package collection was renamed.
3939+ All JetBrains IDEs are now at <literal>jetbrains</literal>.
3840 </para>
3941 </listitem>
4042</itemizedlist>
+8-1
nixos/modules/security/acme.nix
···1919 '';
2020 };
21212222+ domain = mkOption {
2323+ type = types.nullOr types.str;
2424+ default = null;
2525+ description = "Domain to fetch certificate for (defaults to the entry name)";
2626+ };
2727+2228 email = mkOption {
2329 type = types.nullOr types.str;
2430 default = null;
···157163 servicesLists = mapAttrsToList certToServices cfg.certs;
158164 certToServices = cert: data:
159165 let
166166+ domain = if data.domain != null then data.domain else cert;
160167 cpath = "${cfg.directory}/${cert}";
161168 rights = if data.allowKeysForGroup then "750" else "700";
162162- cmdline = [ "-v" "-d" cert "--default_root" data.webroot "--valid_min" cfg.validMin ]
169169+ cmdline = [ "-v" "-d" domain "--default_root" data.webroot "--valid_min" cfg.validMin ]
163170 ++ optionals (data.email != null) [ "--email" data.email ]
164171 ++ concatMap (p: [ "-f" p ]) data.plugins
165172 ++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains);
···5757index 838d343..ca7fc0d 100644
5858--- a/giscanner/shlibs.py
5959+++ b/giscanner/shlibs.py
6060-@@ -53,10 +53,24 @@ def _resolve_libtool(options, binary, libraries):
6060+@@ -53,10 +53,27 @@ def _resolve_libtool(options, binary, libraries):
6161 # Match absolute paths on OS X to conform to how libraries are usually
6262 # referenced on OS X systems.
6363 def _ldd_library_pattern(library_name):
6464+ nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/'))
6565 pattern = "(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
6666-- if platform.system() == 'Darwin':
6767-- pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
6666+ if platform.system() == 'Darwin':
6767+ pattern = "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
6868- return re.compile(pattern % re.escape(library_name))
6969++ return re.compile(pattern % re.escape(library_name))
6970+ pattern = r'''
7071+ (
7172+ (?:
···858686878788 # This is a what we do for non-la files. We assume that we are on an
8888-@@ -115,7 +129,11 @@ def _resolve_non_libtool(options, binary, libraries):
8989+@@ -115,7 +132,11 @@ def _resolve_non_libtool(options, binary, libraries):
8990 m = pattern.search(line)
9091 if m:
9192 del patterns[library]
···11+diff --git a/Source/JavaScriptCore/API/WebKitAvailability.h b/Source/JavaScriptCore/API/WebKitAvailability.h
22+index ab53183..1310dec 100644
33+--- a/Source/JavaScriptCore/API/WebKitAvailability.h
44++++ b/Source/JavaScriptCore/API/WebKitAvailability.h
55+@@ -27,57 +27,12 @@
66+ #define __WebKitAvailability__
77+88+ #if defined(__APPLE__)
99+-
1010+-#include <AvailabilityMacros.h>
1111+ #include <CoreFoundation/CoreFoundation.h>
1212+-
1313+-#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED < 101100
1414+-/* To support availability macros that mention newer OS X versions when building on older OS X versions,
1515+- we provide our own definitions of the underlying macros that the availability macros expand to. We're
1616+- free to expand the macros as no-ops since frameworks built on older OS X versions only ship bundled with
1717+- an application rather than as part of the system.
1818+-*/
1919+-
2020+-#ifndef __NSi_10_10 // Building from trunk rather than SDK.
2121+-#define __NSi_10_10 introduced=10.0 // Use 10.0 to indicate that everything is available.
2222+-#endif
2323+-
2424+-#ifndef __NSi_10_11 // Building from trunk rather than SDK.
2525+-#define __NSi_10_11 introduced=10.0 // Use 10.0 to indicate that everything is available.
2626+-#endif
2727+-
2828+-#ifndef __NSi_10_12 // Building from trunk rather than SDK.
2929+-#define __NSi_10_12 introduced=10.0 // Use 10.0 to indicate that everything is available.
3030+-#endif
3131+-
3232+-#ifndef __AVAILABILITY_INTERNAL__MAC_10_9
3333+-#define __AVAILABILITY_INTERNAL__MAC_10_9
3434+-#endif
3535+-
3636+-#ifndef __AVAILABILITY_INTERNAL__MAC_10_10
3737+-#define __AVAILABILITY_INTERNAL__MAC_10_10
3838+ #endif
3939+4040+-#ifndef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
4141+-#define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
4242+-#endif
4343+-
4444+-#ifndef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
4545+-#define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
4646+-#endif
4747+-
4848+-#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED <= 101100 */
4949+-
5050+-#if defined(BUILDING_GTK__)
5151+ #undef CF_AVAILABLE
5252+ #define CF_AVAILABLE(_mac, _ios)
5353+ #undef CF_ENUM_AVAILABLE
5454+ #define CF_ENUM_AVAILABLE(_mac, _ios)
5555+-#endif
5656+-
5757+-#else
5858+-#define CF_AVAILABLE(_mac, _ios)
5959+-#define CF_ENUM_AVAILABLE(_mac, _ios)
6060+-#endif
6161+6262+ #endif /* __WebKitAvailability__ */
···11-Derivied from a patch distributed with the Homebrew formula:
22-https://github.com/Homebrew/homebrew-core/blob/6ae11ea82c00dc8c11297ecc3f06bc33979862d8/Formula/bonnie++.rb
33-44-55-Copyright 2009-2016 Homebrew contributors.
66-77-Redistribution and use in source and binary forms, with or without
88-modification, are permitted provided that the following conditions
99-are met:
1010-1111- 1. Redistributions of source code must retain the above copyright
1212- notice, this list of conditions and the following disclaimer.
1313- 2. Redistributions in binary form must reproduce the above copyright
1414- notice, this list of conditions and the following disclaimer in the
1515- documentation and/or other materials provided with the distribution.
1616-1717-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1818-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1919-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2020-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2121-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2222-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2323-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2424-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2626-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727-2828-2929-# Changes included in this patchset:
3030-# 3) Remove the #ifdef _LARGEFILE64_SOURCE macros which not only prohibits the intended functionality of
3131-# splitting into 2 GB files for such filesystems but also incorrectly tests for it in the first place.
3232-# The ideal fix would be to replace the AC_TRY_RUN() in configure.in if the fail code actually worked.
3333-# Files affected: bonnie++.cp
3434-3535-diff --git i/bonnie++.cpp w/bonnie++.cpp
3636-index 8c5a43a..8a4b3dc 100644
3737---- i/bonnie++.cpp
3838-+++ w/bonnie++.cpp
3939-@@ -294,11 +294,7 @@ int main(int argc, char *argv[])
4040- {
4141- char *sbuf = _strdup(optarg);
4242- char *size = strtok(sbuf, ":");
4343--#ifdef _LARGEFILE64_SOURCE
4444- file_size = size_from_str(size, "gt");
4545--#else
4646-- file_size = size_from_str(size, "g");
4747--#endif
4848- size = strtok(NULL, "");
4949- if(size)
5050- {
5151-@@ -384,15 +380,6 @@ int main(int argc, char *argv[])
5252- if(file_size % 1024 > 512)
5353- file_size = file_size + 1024 - (file_size % 1024);
5454- }
5555--#ifndef _LARGEFILE64_SOURCE
5656-- if(file_size == 2048)
5757-- file_size = 2047;
5858-- if(file_size > 2048)
5959-- {
6060-- fprintf(stderr, "Large File Support not present, can't do %dM.\n", file_size);
6161-- usage();
6262-- }
6363--#endif
6464- globals.byte_io_size = min(file_size, globals.byte_io_size);
6565- globals.byte_io_size = max(0, globals.byte_io_size);
6666-6767-@@ -465,14 +452,6 @@ int main(int argc, char *argv[])
6868- && (directory_max_size < directory_min_size || directory_max_size < 0
6969- || directory_min_size < 0) )
7070- usage();
7171--#ifndef _LARGEFILE64_SOURCE
7272-- if(file_size > (1 << (31 - 20 + globals.io_chunk_bits)) )
7373-- {
7474-- fprintf(stderr
7575-- , "The small chunk size and large IO size make this test impossible in 32bit.\n");
7676-- usage();
7777-- }
7878--#endif
7979- if(file_size && globals.ram && (file_size * concurrency) < (globals.ram * 2) )
8080- {
8181- fprintf(stderr