Merge master into staging-next

This commit is contained in:
Frederik Rietdijk 2019-05-24 12:39:37 +02:00
commit 6e4e7c5dc6
193 changed files with 3306 additions and 6412 deletions

View File

@ -953,7 +953,7 @@ is essentially a "free software" license (BSD3), according to
paragraph 2 of the LGPL, GHC must be distributed under the terms of the LGPL!
To work around these problems GHC can be build with a slower but LGPL-free
alternative implemention for Integer called
alternative implementation for Integer called
[integer-simple](http://hackage.haskell.org/package/integer-simple).
To get a GHC compiler build with `integer-simple` instead of `integer-gmp` use

View File

@ -918,4 +918,52 @@ citrix_receiver.override {
</para>
</section>
</section>
<section xml:id="sec-nginx">
<title>Nginx</title>
<para>
<link xlink:href="https://nginx.org/">Nginx</link> is a
reverse proxy and lightweight webserver.
</para>
<section xml:id="sec-nginx-etag">
<title>ETags on static files served from the Nix store</title>
<para>
HTTP has a couple different mechanisms for caching to prevent
clients from having to download the same content repeatedly
if a resource has not changed since the last time it was requested.
When nginx is used as a server for static files, it implements
the caching mechanism based on the
<link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link>
response header automatically; unfortunately, it works by using
filesystem timestamps to determine the value of the
<literal>Last-Modified</literal> header. This doesn't give the
desired behavior when the file is in the Nix store, because all
file timestamps are set to 0 (for reasons related to build
reproducibility).
</para>
<para>
Fortunately, HTTP supports an alternative (and more effective)
caching mechanism: the
<link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link>
response header. The value of the <literal>ETag</literal> header
specifies some identifier for the particular content that the
server is sending (e.g. a hash). When a client makes a second
request for the same resource, it sends that value back in an
<literal>If-None-Match</literal> header. If the ETag value is
unchanged, then the server does not need to resend the content.
</para>
<para>
As of NixOS 19.09, the nginx package in Nixpkgs is patched such
that when nginx serves a file out of <filename>/nix/store</filename>,
the hash in the store path is used as the <literal>ETag</literal>
header in the HTTP response, thus providing proper caching functionality.
This happens automatically; you do not need to do modify any
configuration to get this behavior.
</para>
</section>
</section>
</chapter>

View File

@ -178,7 +178,7 @@ rec {
toPlist = {}: v: let
isFloat = builtins.isFloat or (x: false);
expr = ind: x: with builtins;
if isNull x then "" else
if x == null then "" else
if isBool x then bool ind x else
if isInt x then int ind x else
if isString x then str ind x else

View File

@ -83,7 +83,7 @@ rec {
# Sometimes git stores the commitId directly in the file but
# sometimes it stores something like: «ref: refs/heads/branch-name»
matchRef = match "^ref: (.*)$" fileContent;
in if isNull matchRef
in if matchRef == null
then fileContent
else readCommitFromFile (lib.head matchRef) path
# Sometimes, the file isn't there at all and has been packed away in the
@ -92,7 +92,7 @@ rec {
then
let fileContent = readFile packedRefsName;
matchRef = match (".*\n([^\n ]*) " + file + "\n.*") fileContent;
in if isNull matchRef
in if matchRef == null
then throw ("Could not find " + file + " in " + packedRefsName)
else lib.head matchRef
else throw ("Not a .git directory: " + path);

View File

@ -112,7 +112,7 @@ rec {
# Function to call
f:
# Argument to check for null before passing it to `f`
a: if isNull a then a else f a;
a: if a == null then a else f a;
# Pull in some builtins not included elsewhere.
inherit (builtins)

View File

@ -1359,9 +1359,13 @@
name = "David Sferruzza";
};
dtzWill = {
email = "nix@wdtz.org";
email = "w@wdtz.org";
github = "dtzWill";
name = "Will Dietz";
keys = [{
longkeyid = "rsa4096/0xFD42C7D0D41494C8";
fingerprint = "389A 78CB CD88 5E0C 4701 DEB9 FD42 C7D0 D414 94C8";
}];
};
dxf = {
email = "dingxiangfei2009@gmail.com";
@ -4001,6 +4005,11 @@
github = "Ptival";
name = "Valentin Robert";
};
ptrhlm = {
email = "ptrhlm0@gmail.com";
github = "ptrhlm";
name = "Piotr Halama";
};
puffnfresh = {
email = "brian@brianmckenna.org";
github = "puffnfresh";

View File

@ -145,7 +145,7 @@ let
displayOptionsGraph =
let
checkList =
if !(isNull testOption) then [ testOption ]
if testOption != null then [ testOption ]
else testOptions;
checkAll = checkList == [];
in

View File

@ -31,7 +31,7 @@ let
# use latest when no version is passed
makeCacheConf = { version ? null }:
let
fcPackage = if builtins.isNull version
fcPackage = if version == null
then "fontconfig"
else "fontconfig_${version}";
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; };

View File

@ -46,7 +46,7 @@ let cfg = config.fonts.fontconfig;
# use latest when no version is passed
makeCacheConf = { version ? null }:
let
fcPackage = if builtins.isNull version
fcPackage = if version == null
then "fontconfig"
else "fontconfig_${version}";
makeCache = fontconfig: pkgs.makeFontsCache { inherit fontconfig; fontDirectories = config.fonts.fonts; };

View File

@ -8,7 +8,7 @@ let
name = "sysctl option value";
check = val:
let
checkType = x: isBool x || isString x || isInt x || isNull x;
checkType = x: isBool x || isString x || isInt x || x == null;
in
checkType val || (val._type or "" == "override" && checkType val.content);
merge = loc: defs: mergeOneOption loc (filterOverrides defs);

View File

@ -198,7 +198,7 @@ let
fi
${ # When there is a theme configured, use it, otherwise use the background image.
if (!isNull config.isoImage.grubTheme) then ''
if config.isoImage.grubTheme != null then ''
# Sets theme.
set theme=(hd0)/EFI/boot/grub-theme/theme.txt
# Load theme fonts
@ -622,7 +622,7 @@ in
{ source = "${pkgs.memtest86plus}/memtest.bin";
target = "/boot/memtest.bin";
}
] ++ optionals (!isNull config.isoImage.grubTheme) [
] ++ optionals (config.isoImage.grubTheme != null) [
{ source = config.isoImage.grubTheme;
target = "/EFI/boot/grub-theme";
}

View File

@ -34,7 +34,7 @@ let
bashAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
(filterAttrs (k: v: !isNull v) cfg.shellAliases)
(filterAttrs (k: v: v != null) cfg.shellAliases)
);
in

View File

@ -10,7 +10,7 @@ let
fishAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
(filterAttrs (k: v: !isNull v) cfg.shellAliases)
(filterAttrs (k: v: v != null) cfg.shellAliases)
);
in

View File

@ -148,7 +148,7 @@ in
UseSTARTTLS=${yesNo cfg.useSTARTTLS}
#Debug=YES
${optionalString (cfg.authUser != "") "AuthUser=${cfg.authUser}"}
${optionalString (!isNull cfg.authPassFile) "AuthPassFile=${cfg.authPassFile}"}
${optionalString (cfg.authPassFile != null) "AuthPassFile=${cfg.authPassFile}"}
'';
environment.systemPackages = [pkgs.ssmtp];

View File

@ -12,7 +12,7 @@ let
zshAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
(filterAttrs (k: v: !isNull v) cfg.shellAliases)
(filterAttrs (k: v: v != null) cfg.shellAliases)
);
in

View File

@ -248,7 +248,7 @@ let
cfg = config.services.znapzend;
onOff = b: if b then "on" else "off";
nullOff = b: if isNull b then "off" else toString b;
nullOff = b: if b == null then "off" else toString b;
stripSlashes = replaceStrings [ "/" ] [ "." ];
attrsToFile = config: concatStringsSep "\n" (builtins.attrValues (
@ -256,7 +256,7 @@ let
mkDestAttrs = dst: with dst;
mapAttrs' (n: v: nameValuePair "dst_${label}${n}" v) ({
"" = optionalString (! isNull host) "${host}:" + dataset;
"" = optionalString (host != null) "${host}:" + dataset;
_plan = plan;
} // optionalAttrs (presend != null) {
_precmd = presend;

View File

@ -3,7 +3,7 @@
with lib;
let
version = "1.3.1";
version = "1.5.0";
cfg = config.services.kubernetes.addons.dns;
ports = {
dns = 10053;
@ -55,9 +55,9 @@ in {
type = types.attrs;
default = {
imageName = "coredns/coredns";
imageDigest = "sha256:02382353821b12c21b062c59184e227e001079bb13ebd01f9d3270ba0fcbf1e4";
imageDigest = "sha256:e83beb5e43f8513fa735e77ffc5859640baea30a882a11cc75c4c3244a737d3c";
finalImageTag = version;
sha256 = "0vbylgyxv2jm2mnzk6f28jbsj305zsxmx3jr6ngjq461czcl5fi5";
sha256 = "15sbmhrxjxidj0j0cccn1qxpg6al175w43m6ngspl0mc132zqc9q";
};
};
};
@ -160,7 +160,7 @@ in {
fallthrough in-addr.arpa ip6.arpa
}
prometheus :${toString ports.metrics}
proxy . /etc/resolv.conf
forward . /etc/resolv.conf
cache 30
loop
reload

View File

@ -184,6 +184,12 @@ in
type = bool;
};
preferredAddressTypes = mkOption {
description = "List of the preferred NodeAddressTypes to use for kubelet connections.";
type = nullOr str;
default = null;
};
proxyClientCertFile = mkOption {
description = "Client certificate to use for connections to proxy.";
default = null;
@ -349,6 +355,8 @@ in
"--kubelet-client-certificate=${cfg.kubeletClientCertFile}"} \
${optionalString (cfg.kubeletClientKeyFile != null)
"--kubelet-client-key=${cfg.kubeletClientKeyFile}"} \
${optionalString (cfg.preferredAddressTypes != null)
"--kubelet-preferred-address-types=${cfg.preferredAddressTypes}"} \
${optionalString (cfg.proxyClientCertFile != null)
"--proxy-client-cert-file=${cfg.proxyClientCertFile}"} \
${optionalString (cfg.proxyClientKeyFile != null)

View File

@ -7,9 +7,9 @@ let
cfg = top.kubelet;
cniConfig =
if cfg.cni.config != [] && !(isNull cfg.cni.configDir) then
if cfg.cni.config != [] && cfg.cni.configDir != null then
throw "Verbatim CNI-config and CNI configDir cannot both be set."
else if !(isNull cfg.cni.configDir) then
else if cfg.cni.configDir != null then
cfg.cni.configDir
else
(pkgs.buildEnv {
@ -373,7 +373,7 @@ in
boot.kernelModules = ["br_netfilter"];
services.kubernetes.kubelet.hostname = with config.networking;
mkDefault (hostName + optionalString (!isNull domain) ".${domain}");
mkDefault (hostName + optionalString (domain != null) ".${domain}");
services.kubernetes.pki.certs = with top.lib; {
kubelet = mkCert {

View File

@ -285,7 +285,7 @@ in
};
};
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (!isNull cfg.etcClusterAdminKubeconfig)
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (cfg.etcClusterAdminKubeconfig != null)
(top.lib.mkKubeConfig "cluster-admin" clusterAdminKubeconfig);
environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [

View File

@ -236,7 +236,7 @@ in
};
assertions = [
{ assertion = cfg.hooksPath == hooksDir || all isNull (attrValues cfg.hooks);
{ assertion = cfg.hooksPath == hooksDir || all (v: v == null) (attrValues cfg.hooks);
message = ''
Options `services.buildkite-agent.hooksPath' and
`services.buildkite-agent.hooks.<name>' are mutually exclusive.

View File

@ -189,7 +189,7 @@ in {
preStart =
let replacePlugins =
if isNull cfg.plugins
if cfg.plugins == null
then ""
else
let pluginCmds = lib.attrsets.mapAttrsToList

View File

@ -22,11 +22,11 @@ let
else {})
);
cassandraConfigWithAddresses = cassandraConfig //
( if isNull cfg.listenAddress
( if cfg.listenAddress == null
then { listen_interface = cfg.listenInterface; }
else { listen_address = cfg.listenAddress; }
) // (
if isNull cfg.rpcAddress
if cfg.rpcAddress == null
then { rpc_interface = cfg.rpcInterface; }
else { rpc_address = cfg.rpcAddress; }
);
@ -219,19 +219,13 @@ in {
config = mkIf cfg.enable {
assertions =
[ { assertion =
((isNull cfg.listenAddress)
|| (isNull cfg.listenInterface)
) && !((isNull cfg.listenAddress)
&& (isNull cfg.listenInterface)
);
(cfg.listenAddress == null || cfg.listenInterface == null)
&& !(cfg.listenAddress == null && cfg.listenInterface == null);
message = "You have to set either listenAddress or listenInterface";
}
{ assertion =
((isNull cfg.rpcAddress)
|| (isNull cfg.rpcInterface)
) && !((isNull cfg.rpcAddress)
&& (isNull cfg.rpcInterface)
);
(cfg.rpcAddress == null || cfg.rpcInterface == null)
&& !(cfg.rpcAddress == null && cfg.rpcInterface == null);
message = "You have to set either rpcAddress or rpcInterface";
}
];
@ -276,7 +270,7 @@ in {
};
};
systemd.timers.cassandra-full-repair =
mkIf (!isNull cfg.fullRepairInterval) {
mkIf (cfg.fullRepairInterval != null) {
description = "Schedule full repairs on Cassandra";
wantedBy = [ "timers.target" ];
timerConfig =
@ -300,7 +294,7 @@ in {
};
};
systemd.timers.cassandra-incremental-repair =
mkIf (!isNull cfg.incrementalRepairInterval) {
mkIf (cfg.incrementalRepairInterval != null) {
description = "Schedule incremental repairs on Cassandra";
wantedBy = [ "timers.target" ];
timerConfig =

View File

@ -7,7 +7,7 @@ let
crdb = cfg.package;
escape = builtins.replaceStrings ["%"] ["%%"];
ifNotNull = v: s: optionalString (!isNull v) s;
ifNotNull = v: s: optionalString (v != null) s;
startupCommand = lib.concatStringsSep " "
[ # Basic startup
@ -164,7 +164,7 @@ in
config = mkIf config.services.cockroachdb.enable {
assertions = [
{ assertion = !cfg.insecure -> !(isNull cfg.certsDir);
{ assertion = !cfg.insecure -> cfg.certsDir != null;
message = "CockroachDB must have a set of SSL certificates (.certsDir), or run in Insecure Mode (.insecure = true)";
}
];

View File

@ -16,7 +16,7 @@ let
super_only = ${builtins.toJSON cfg.superOnly}
${optionalString (!isNull cfg.loginGroup) "login_group = ${cfg.loginGroup}"}
${optionalString (cfg.loginGroup != null) "login_group = ${cfg.loginGroup}"}
login_timeout = ${toString cfg.loginTimeout}
@ -24,7 +24,7 @@ let
sql_root = ${cfg.sqlRoot}
${optionalString (!isNull cfg.tls) ''
${optionalString (cfg.tls != null) ''
tls_cert = ${cfg.tls.cert}
tls_key = ${cfg.tls.key}
''}

View File

@ -215,8 +215,8 @@ in {
networking.firewall = mkIf cfg.openFirewall (if cfg.declarative then {
allowedUDPPorts = [ serverPort ];
allowedTCPPorts = [ serverPort ]
++ optional (! isNull queryPort) queryPort
++ optional (! isNull rconPort) rconPort;
++ optional (queryPort != null) queryPort
++ optional (rconPort != null) rconPort;
} else {
allowedUDPPorts = [ defaultServerPort ];
allowedTCPPorts = [ defaultServerPort ];

View File

@ -227,7 +227,7 @@ in
'';
services.cron.systemCronJobs =
let withTime = name: {timeArgs, ...}: ! (builtins.isNull timeArgs);
let withTime = name: {timeArgs, ...}: timeArgs != null;
mkCron = name: {user, cmdline, timeArgs, ...}: ''
${timeArgs} ${user} ${cmdline}
'';

View File

@ -16,13 +16,13 @@ let
sendmail_path = /run/wrappers/bin/sendmail
''
(if isNull cfg.sslServerCert then ''
(if cfg.sslServerCert == null then ''
ssl = no
disable_plaintext_auth = no
'' else ''
ssl_cert = <${cfg.sslServerCert}
ssl_key = <${cfg.sslServerKey}
${optionalString (!(isNull cfg.sslCACert)) ("ssl_ca = <" + cfg.sslCACert)}
${optionalString (cfg.sslCACert != null) ("ssl_ca = <" + cfg.sslCACert)}
ssl_dh = <${config.security.dhparams.params.dovecot2.path}
disable_plaintext_auth = yes
'')
@ -298,7 +298,7 @@ in
config = mkIf cfg.enable {
security.pam.services.dovecot2 = mkIf cfg.enablePAM {};
security.dhparams = mkIf (! isNull cfg.sslServerCert) {
security.dhparams = mkIf (cfg.sslServerCert != null) {
enable = true;
params.dovecot2 = {};
};
@ -384,14 +384,14 @@ in
{ assertion = intersectLists cfg.protocols [ "pop3" "imap" ] != [];
message = "dovecot needs at least one of the IMAP or POP3 listeners enabled";
}
{ assertion = isNull cfg.sslServerCert == isNull cfg.sslServerKey
&& (!(isNull cfg.sslCACert) -> !(isNull cfg.sslServerCert || isNull cfg.sslServerKey));
{ assertion = (cfg.sslServerCert == null) == (cfg.sslServerKey == null)
&& (cfg.sslCACert != null -> !(cfg.sslServerCert == null || cfg.sslServerKey == null));
message = "dovecot needs both sslServerCert and sslServerKey defined for working crypto";
}
{ assertion = cfg.showPAMFailure -> cfg.enablePAM;
message = "dovecot is configured with showPAMFailure while enablePAM is disabled";
}
{ assertion = (cfg.sieveScripts != {}) -> ((cfg.mailUser != null) && (cfg.mailGroup != null));
{ assertion = cfg.sieveScripts != {} -> (cfg.mailUser != null && cfg.mailGroup != null);
message = "dovecot requires mailUser and mailGroup to be set when sieveScripts is set";
}
];

View File

@ -143,7 +143,7 @@ in
serviceConfig = {
Type = "simple";
PrivateTmp = true;
ExecStartPre = assert !isNull server.secretKeyFile; pkgs.writeScript "bepasty-server.${name}-init" ''
ExecStartPre = assert server.secretKeyFile != null; pkgs.writeScript "bepasty-server.${name}-init" ''
#!/bin/sh
mkdir -p "${server.workDir}"
mkdir -p "${server.dataDir}"

View File

@ -81,7 +81,7 @@ in {
systemd.services = mapAttrs' (name: instanceCfg: nameValuePair "errbot-${name}" (
let
dataDir = if !isNull instanceCfg.dataDir then instanceCfg.dataDir else
dataDir = if instanceCfg.dataDir != null then instanceCfg.dataDir else
"/var/lib/errbot/${name}";
in {
after = [ "network-online.target" ];

View File

@ -48,7 +48,7 @@ let
type = types.nullOr types.int;
default = null;
example = 365;
apply = val: if isNull val then -1 else val;
apply = val: if val == null then -1 else val;
description = mkAutoDesc ''
The expiration time of ${desc} in days or <literal>null</literal> for no
expiration time.
@ -82,7 +82,7 @@ let
then attrByPath newPath (notFound newPath) cfg.pki.manual
else findPkiDefinitions newPath val;
in flatten (mapAttrsToList mkSublist attrs);
in all isNull (findPkiDefinitions [] manualPkiOptions);
in all (x: x == null) (findPkiDefinitions [] manualPkiOptions);
orgOptions = { ... }: {
options.users = mkOption {

View File

@ -17,7 +17,7 @@ let
defaultDir = "/var/lib/${user}";
home = if useCustomDir then cfg.storageDir else defaultDir;
useCustomDir = !(builtins.isNull cfg.storageDir);
useCustomDir = cfg.storageDir != null;
socket = "/run/phpfpm/${dirName}.sock";

View File

@ -19,13 +19,13 @@ let
graphiteLocalSettings = pkgs.writeText "graphite_local_settings.py" (
"STATIC_ROOT = '${staticDir}'\n" +
optionalString (! isNull config.time.timeZone) "TIME_ZONE = '${config.time.timeZone}'\n"
optionalString (config.time.timeZone != null) "TIME_ZONE = '${config.time.timeZone}'\n"
+ cfg.web.extraConfig
);
graphiteApiConfig = pkgs.writeText "graphite-api.yaml" ''
search_index: ${dataDir}/index
${optionalString (!isNull config.time.timeZone) ''time_zone: ${config.time.timeZone}''}
${optionalString (config.time.timeZone != null) ''time_zone: ${config.time.timeZone}''}
${optionalString (cfg.api.finders != []) ''finders:''}
${concatMapStringsSep "\n" (f: " - " + f.moduleName) cfg.api.finders}
${optionalString (cfg.api.functions != []) ''functions:''}

View File

@ -92,7 +92,7 @@ in {
Needed when running with Kubernetes as backend as this cannot be auto-detected";
'';
type = types.nullOr types.str;
default = with config.networking; (hostName + optionalString (!isNull domain) ".${domain}");
default = with config.networking; (hostName + optionalString (domain != null) ".${domain}");
example = "node1.example.com";
};

View File

@ -12,9 +12,9 @@ let
boolOpt = k: v: k + " = " + boolToString v;
intOpt = k: v: k + " = " + toString v;
lstOpt = k: xs: k + " = " + concatStringsSep "," xs;
optionalNullString = o: s: optional (! isNull s) (strOpt o s);
optionalNullBool = o: b: optional (! isNull b) (boolOpt o b);
optionalNullInt = o: i: optional (! isNull i) (intOpt o i);
optionalNullString = o: s: optional (s != null) (strOpt o s);
optionalNullBool = o: b: optional (b != null) (boolOpt o b);
optionalNullInt = o: i: optional (i != null) (intOpt o i);
optionalEmptyList = o: l: optional ([] != l) (lstOpt o l);
mkEnableTrueOption = name: mkEnableOption name // { default = true; };
@ -225,7 +225,7 @@ let
i2pdSh = pkgs.writeScriptBin "i2pd" ''
#!/bin/sh
exec ${pkgs.i2pd}/bin/i2pd \
${if isNull cfg.address then "" else "--host="+cfg.address} \
${if cfg.address == null then "" else "--host="+cfg.address} \
--service \
--conf=${i2pdConf} \
--tunconf=${tunnelConf}

View File

@ -56,7 +56,7 @@ rec {
};
documentDefault = description : strongswanDefault :
if isNull strongswanDefault
if strongswanDefault == null
then description
else description + ''
</para><para>

View File

@ -45,10 +45,10 @@ rec {
filterEmptySets (
(mapParamsRecursive (path: name: param:
let value = attrByPath path null cfg;
in optionalAttrs (!isNull value) (param.render name value)
in optionalAttrs (value != null) (param.render name value)
) ps));
filterEmptySets = set : filterAttrs (n: v: !(isNull v)) (mapAttrs (name: value:
filterEmptySets = set : filterAttrs (n: v: (v != null)) (mapAttrs (name: value:
if isAttrs value
then let value' = filterEmptySets value;
in if value' == {}

View File

@ -129,7 +129,7 @@ in {
This defaults to the singleton list [ca] when the <option>ca</option> option is defined.
'';
default = if isNull cfg.elasticsearch.ca then [] else [ca];
default = if cfg.elasticsearch.ca == null then [] else [ca];
type = types.listOf types.path;
};

View File

@ -58,11 +58,11 @@ let
httponly = cookie.httpOnly;
};
set-xauthrequest = setXauthrequest;
} // lib.optionalAttrs (!isNull cfg.email.addresses) {
} // lib.optionalAttrs (cfg.email.addresses != null) {
authenticated-emails-file = authenticatedEmailsFile;
} // lib.optionalAttrs (cfg.passBasicAuth) {
basic-auth-password = cfg.basicAuthPassword;
} // lib.optionalAttrs (!isNull cfg.htpasswd.file) {
} // lib.optionalAttrs (cfg.htpasswd.file != null) {
display-htpasswd-file = cfg.htpasswd.displayForm;
} // lib.optionalAttrs tls.enable {
tls-cert = tls.certificate;
@ -71,7 +71,7 @@ let
} // (getProviderOptions cfg cfg.provider) // cfg.extraConfig;
mapConfig = key: attr:
if (!isNull attr && attr != []) then (
if attr != null && attr != [] then (
if isDerivation attr then mapConfig key (toString attr) else
if (builtins.typeOf attr) == "set" then concatStringsSep " "
(mapAttrsToList (name: value: mapConfig (key + "-" + name) value) attr) else
@ -538,7 +538,7 @@ in
config = mkIf cfg.enable {
services.oauth2_proxy = mkIf (!isNull cfg.keyFile) {
services.oauth2_proxy = mkIf (cfg.keyFile != null) {
clientID = mkDefault null;
clientSecret = mkDefault null;
cookie.secret = mkDefault null;

View File

@ -215,7 +215,7 @@ in {
# /etc/icingaweb2
environment.etc = let
doModule = name: optionalAttrs (cfg.modules."${name}".enable) (nameValuePair "icingaweb2/enabledModules/${name}" { source = "${pkgs.icingaweb2}/modules/${name}"; });
doModule = name: optionalAttrs (cfg.modules."${name}".enable) { "icingaweb2/enabledModules/${name}".source = "${pkgs.icingaweb2}/modules/${name}"; };
in {}
# Module packages
// (mapAttrs' (k: v: nameValuePair "icingaweb2/enabledModules/${k}" { source = v; }) cfg.modulePackages)

View File

@ -85,7 +85,7 @@ in
DynamicUser = true;
RuntimeDirectory = "miniflux";
RuntimeDirectoryMode = "0700";
EnvironmentFile = if isNull cfg.adminCredentialsFile
EnvironmentFile = if cfg.adminCredentialsFile == null
then defaultCredentials
else cfg.adminCredentialsFile;
};

View File

@ -184,7 +184,7 @@ in
phpOptions = ''
date.timezone = "CET"
${optionalString (!isNull cfg.email.server) ''
${optionalString (cfg.email.server != null) ''
SMTP = ${cfg.email.server}
smtp_port = ${toString cfg.email.port}
auth_username = ${cfg.email.login}
@ -282,7 +282,7 @@ in
sed -i "s@^php@${config.services.phpfpm.phpPackage}/bin/php@" "${runDir}/server/php/shell/"*.sh
${if (isNull cfg.database.host) then ''
${if (cfg.database.host == null) then ''
sed -i "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', 'localhost');/g" "${runDir}/server/php/config.inc.php"
sed -i "s/^.*'R_DB_PASSWORD'.*$/define('R_DB_PASSWORD', 'restya');/g" "${runDir}/server/php/config.inc.php"
'' else ''
@ -311,7 +311,7 @@ in
chown -R "${cfg.user}"."${cfg.group}" "${cfg.dataDir}/media"
chown -R "${cfg.user}"."${cfg.group}" "${cfg.dataDir}/client/img"
${optionalString (isNull cfg.database.host) ''
${optionalString (cfg.database.host == null) ''
if ! [ -e "${cfg.dataDir}/.db-initialized" ]; then
${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} \
${config.services.postgresql.package}/bin/psql -U ${config.services.postgresql.superUser} \
@ -367,14 +367,14 @@ in
};
users.groups.restya-board = {};
services.postgresql.enable = mkIf (isNull cfg.database.host) true;
services.postgresql.enable = mkIf (cfg.database.host == null) true;
services.postgresql.identMap = optionalString (isNull cfg.database.host)
services.postgresql.identMap = optionalString (cfg.database.host == null)
''
restya-board-users restya-board restya_board
'';
services.postgresql.authentication = optionalString (isNull cfg.database.host)
services.postgresql.authentication = optionalString (cfg.database.host == null)
''
local restya_board all ident map=restya-board-users
'';

View File

@ -690,7 +690,7 @@ in
; Don't advertise PHP
expose_php = off
'' + optionalString (!isNull config.time.timeZone) ''
'' + optionalString (config.time.timeZone != null) ''
; Apparently PHP doesn't use $TZ.
date.timezone = "${config.time.timeZone}"

View File

@ -29,6 +29,7 @@ in {
environment.etc."tmpfiles.d/colord.conf".source = "${pkgs.colord}/lib/tmpfiles.d/colord.conf";
users.users.colord = {
isSystemUser = true;
home = "/var/lib/colord";
group = "colord";
};

View File

@ -174,13 +174,13 @@ let
"--rm"
"--name=%n"
"--log-driver=${container.log-driver}"
] ++ optional (! isNull container.entrypoint)
] ++ optional (container.entrypoint != null)
"--entrypoint=${escapeShellArg container.entrypoint}"
++ (mapAttrsToList (k: v: "-e ${escapeShellArg k}=${escapeShellArg v}") container.environment)
++ map (p: "-p ${escapeShellArg p}") container.ports
++ optional (! isNull container.user) "-u ${escapeShellArg container.user}"
++ optional (container.user != null) "-u ${escapeShellArg container.user}"
++ map (v: "-v ${escapeShellArg v}") container.volumes
++ optional (! isNull container.workdir) "-w ${escapeShellArg container.workdir}"
++ optional (container.workdir != null) "-w ${escapeShellArg container.workdir}"
++ map escapeShellArg container.extraDockerOptions
++ [container.image]
++ map escapeShellArg container.cmd

View File

@ -51,7 +51,7 @@ in
popd
'';
format = "raw";
configFile = if isNull cfg.configFile then defaultConfigFile else cfg.configFile;
configFile = if cfg.configFile == null then defaultConfigFile else cfg.configFile;
inherit (cfg) diskSize;
inherit config lib pkgs;
};

View File

@ -1,6 +1,6 @@
let
version = "2.5.0";
sha256 = "1dsckybjg2cvrvcs1bya03xymcm0whfxcb1v0vljn5pghyazgvhx";
cargoSha256 = "0z7dmzpqg0qnkga7r4ykwrvz8ds1k9ik7cx58h2vnmhrhrddvizr";
version = "2.5.1";
sha256 = "0nnrgc2qyqqld3znjigryqpg5jaqh3jnmin4a334dbr4jw50dz3d";
cargoSha256 = "184vfhsalk5dims3k13zrsv4lmm45a7nm3r0b84g72q7hhbl8pkf";
in
import ./parity.nix { inherit version sha256 cargoSha256; }

View File

@ -1,6 +1,6 @@
let
version = "2.4.5";
sha256 = "02ajwjw6cz86x6zybvw5l0pgv7r370hickjv9ja141w7bhl70q3v";
cargoSha256 = "1n218c43gf200xlb3q03bd6w4kas0jsqx6ciw9s6h7h18wwibvf1";
version = "2.4.6";
sha256 = "0vfq1pyd92n60h9gimn4d5j56xanvl43sgxk9h2kb16amy0mmh3z";
cargoSha256 = "04gi9vddahq1q207f83n3wriwdjnmmnby6mq4crdh7yx1p4b26m9";
in
import ./parity.nix { inherit version sha256 cargoSha256; }

View File

@ -7,12 +7,12 @@
with stdenv.lib;
stdenv.mkDerivation rec {
version = "2.3.1";
version = "2.3.2";
name = "audacity-${version}";
src = fetchurl {
url = "https://github.com/audacity/audacity/archive/Audacity-${version}.tar.gz";
sha256 = "089kz6hgqg0caz33sps19wpkfnza5gf7brdq2p9y6bnwkipw1w9f";
sha256 = "0cf7fr1qhyyylj8g9ax1rq5sb887bcv5b8d7hwlcfwamzxqpliyc";
};
preConfigure = /* we prefer system-wide libs */ ''

View File

@ -1,9 +1,35 @@
{ stdenv, fetchurl, ncurses, pkgconfig, alsaLib, flac, libmad, speex, ffmpeg
, libvorbis, libmpc, libsndfile, libjack2, db, libmodplug, timidity, libid3tag
, libtool
{ stdenv, fetchurl, pkgconfig
, ncurses, db , popt, libtool
# Sound sub-systems
, alsaSupport ? true, alsaLib
, pulseSupport ? true, libpulseaudio, autoreconfHook
, jackSupport ? true, libjack2
, ossSupport ? true
# Audio formats
, aacSupport ? true, faad2, libid3tag
, flacSupport ? true, flac
, midiSupport ? true, timidity
, modplugSupport ? true, libmodplug
, mp3Support ? true, libmad
, musepackSupport ? true, libmpc, libmpcdec, taglib
, vorbisSupport ? true, libvorbis
, speexSupport ? true, speex
, ffmpegSupport ? true, ffmpeg
, sndfileSupport ? true, libsndfile
, wavpackSupport ? true, wavpack
# Misc
, withffmpeg4 ? false, ffmpeg_4
, curlSupport ? true, curl
, samplerateSupport ? true, libsamplerate
, withDebug ? false
}:
stdenv.mkDerivation rec {
let
opt = stdenv.lib.optional;
mkFlag = c: f: if c then "--with-${f}" else "--without-${f}";
in stdenv.mkDerivation rec {
name = "moc-${version}";
version = "2.5.2";
@ -12,18 +38,67 @@ stdenv.mkDerivation rec {
sha256 = "026v977kwb0wbmlmf6mnik328plxg8wykfx9ryvqhirac0aq39pk";
};
nativeBuildInputs = [ pkgconfig ];
patches = []
++ opt withffmpeg4 ./moc-ffmpeg4.patch
++ opt pulseSupport ./pulseaudio.patch;
buildInputs = [
ncurses alsaLib flac libmad speex ffmpeg libvorbis libmpc libsndfile libjack2
db libmodplug timidity libid3tag libtool
nativeBuildInputs = [ pkgconfig ]
++ opt pulseSupport autoreconfHook;
buildInputs = [ ncurses db popt libtool ]
# Sound sub-systems
++ opt alsaSupport alsaLib
++ opt pulseSupport libpulseaudio
++ opt jackSupport libjack2
# Audio formats
++ opt (aacSupport || mp3Support) libid3tag
++ opt aacSupport faad2
++ opt flacSupport flac
++ opt midiSupport timidity
++ opt modplugSupport libmodplug
++ opt mp3Support libmad
++ opt musepackSupport [ libmpc libmpcdec taglib ]
++ opt vorbisSupport libvorbis
++ opt speexSupport speex
++ opt (ffmpegSupport && !withffmpeg4) ffmpeg
++ opt (ffmpegSupport && withffmpeg4) ffmpeg_4
++ opt sndfileSupport libsndfile
++ opt wavpackSupport wavpack
# Misc
++ opt curlSupport curl
++ opt samplerateSupport libsamplerate;
configureFlags = [
# Sound sub-systems
(mkFlag alsaSupport "alsa")
(mkFlag pulseSupport "pulse")
(mkFlag jackSupport "jack")
(mkFlag ossSupport "oss")
# Audio formats
(mkFlag aacSupport "aac")
(mkFlag flacSupport "flac")
(mkFlag midiSupport "timidity")
(mkFlag modplugSupport "modplug")
(mkFlag mp3Support "mp3")
(mkFlag musepackSupport "musepack")
(mkFlag vorbisSupport "vorbis")
(mkFlag speexSupport "speex")
(mkFlag ffmpegSupport "ffmpeg")
(mkFlag sndfileSupport "sndfile")
(mkFlag wavpackSupport "wavpack")
# Misc
(mkFlag curlSupport "curl")
(mkFlag samplerateSupport "samplerate")
("--enable-debug=" + (if withDebug then "yes" else "no"))
"--disable-cache"
"--without-rcc"
];
meta = with stdenv.lib; {
description = "An ncurses console audio player designed to be powerful and easy to use";
homepage = http://moc.daper.net/;
license = licenses.gpl2;
maintainers = with maintainers; [ pSub jagajaga ];
maintainers = with maintainers; [ aethelz pSub jagajaga ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,33 @@
Index: decoder_plugins/ffmpeg/ffmpeg.c
===================================================================
--- /decoder_plugins/ffmpeg/ffmpeg.c (revisión: 2963)
+++ /decoder_plugins/ffmpeg/ffmpeg.c (copia de trabajo)
@@ -697,7 +697,7 @@
* FFmpeg/LibAV in use. For some versions this will be caught in
* *_find_stream_info() above and misreported as an unfound codec
* parameters error. */
- if (data->codec->capabilities & CODEC_CAP_EXPERIMENTAL) {
+ if (data->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) {
decoder_error (&data->error, ERROR_FATAL, 0,
"The codec is experimental and may damage MOC: %s",
data->codec->name);
@@ -705,8 +705,8 @@
}
set_downmixing (data);
- if (data->codec->capabilities & CODEC_CAP_TRUNCATED)
- data->enc->flags |= CODEC_FLAG_TRUNCATED;
+ if (data->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
+ data->enc->flags |= AV_CODEC_FLAG_TRUNCATED;
if (avcodec_open2 (data->enc, data->codec, NULL) < 0)
{
@@ -725,7 +725,7 @@
data->sample_width = sfmt_Bps (data->fmt);
- if (data->codec->capabilities & CODEC_CAP_DELAY)
+ if (data->codec->capabilities & AV_CODEC_CAP_DELAY)
data->delay = true;
data->seek_broken = is_seek_broken (data);
data->timing_broken = is_timing_broken (data->ic);

View File

@ -0,0 +1,800 @@
diff --git a/audio.c b/audio.c
--- a/audio.c
+++ b/audio.c
@@ -32,6 +32,9 @@
#include "log.h"
#include "lists.h"
+#ifdef HAVE_PULSE
+# include "pulse.h"
+#endif
#ifdef HAVE_OSS
# include "oss.h"
#endif
@@ -893,6 +896,15 @@
}
#endif
+#ifdef HAVE_PULSE
+ if (!strcasecmp(name, "pulseaudio")) {
+ pulse_funcs (funcs);
+ printf ("Trying PulseAudio...\n");
+ if (funcs->init(&hw_caps))
+ return;
+ }
+#endif
+
#ifdef HAVE_OSS
if (!strcasecmp(name, "oss")) {
oss_funcs (funcs);
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -162,6 +162,21 @@
AC_MSG_ERROR([BerkeleyDB (libdb) not found.]))
fi
+AC_ARG_WITH(pulse, AS_HELP_STRING(--without-pulse,
+ Compile without PulseAudio support.))
+
+if test "x$with_pulse" != "xno"
+then
+ PKG_CHECK_MODULES(PULSE, [libpulse],
+ [SOUND_DRIVERS="$SOUND_DRIVERS PULSE"
+ EXTRA_OBJS="$EXTRA_OBJS pulse.o"
+ AC_DEFINE([HAVE_PULSE], 1, [Define if you have PulseAudio.])
+ EXTRA_LIBS="$EXTRA_LIBS $PULSE_LIBS"
+ CFLAGS="$CFLAGS $PULSE_CFLAGS"],
+ [true])
+fi
+
+
AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],
[Compile without OSS support]))
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
@@ -572,10 +572,11 @@
#ifdef OPENBSD
add_list ("SoundDriver", "SNDIO:JACK:OSS",
- CHECK_DISCRETE(5), "SNDIO", "Jack", "ALSA", "OSS", "null");
+ CHECK_DISCRETE(5), "SNDIO", "PulseAudio", "Jack", "ALSA", "OSS", "null");
+
#else
add_list ("SoundDriver", "Jack:ALSA:OSS",
- CHECK_DISCRETE(5), "SNDIO", "Jack", "ALSA", "OSS", "null");
+ CHECK_DISCRETE(5), "SNDIO", "PulseAudio", "Jack", "ALSA", "OSS", "null");
#endif
add_str ("JackClientName", "moc", CHECK_NONE);
diff --git a/pulse.c b/pulse.c
new file mode 100644
--- /dev/null
+++ b/pulse.c
@@ -0,0 +1,705 @@
+/*
+ * MOC - music on console
+ * Copyright (C) 2011 Marien Zwart <marienz@marienz.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+/* PulseAudio backend.
+ *
+ * FEATURES:
+ *
+ * Does not autostart a PulseAudio server, but uses an already-started
+ * one, which should be better than alsa-through-pulse.
+ *
+ * Supports control of either our stream's or our entire sink's volume
+ * while we are actually playing. Volume control while paused is
+ * intentionally unsupported: the PulseAudio documentation strongly
+ * suggests not passing in an initial volume when creating a stream
+ * (allowing the server to track this instead), and we do not know
+ * which sink to control if we do not have a stream open.
+ *
+ * IMPLEMENTATION:
+ *
+ * Most client-side (resource allocation) errors are fatal. Failure to
+ * create a server context or stream is not fatal (and MOC should cope
+ * with these failures too), but server communication failures later
+ * on are currently not handled (MOC has no great way for us to tell
+ * it we no longer work, and I am not sure if attempting to reconnect
+ * is worth it or even a good idea).
+ *
+ * The pulse "simple" API is too simple: it combines connecting to the
+ * server and opening a stream into one operation, while I want to
+ * connect to the server when MOC starts (and fall back to a different
+ * backend if there is no server), and I cannot open a stream at that
+ * time since I do not know the audio format yet.
+ *
+ * PulseAudio strongly recommends we use a high-latency connection,
+ * which the MOC frontend code might not expect from its audio
+ * backend. We'll see.
+ *
+ * We map MOC's percentage volumes linearly to pulse's PA_VOLUME_MUTED
+ * (0) .. PA_VOLUME_NORM range. This is what the PulseAudio docs recommend
+ * ( http://pulseaudio.org/wiki/WritingVolumeControlUIs ). It does mean
+ * PulseAudio volumes above PA_VOLUME_NORM do not work well with MOC.
+ *
+ * Comments in audio.h claim "All functions are executed only by one
+ * thread" (referring to the function in the hw_funcs struct). This is
+ * a blatant lie. Most of them are invoked off the "output buffer"
+ * thread (out_buf.c) but at least the "playing" thread (audio.c)
+ * calls audio_close which calls our close function. We can mostly
+ * ignore this problem because we serialize on the pulseaudio threaded
+ * mainloop lock. But it does mean that functions that are normally
+ * only called between open and close (like reset) are sometimes
+ * called without us having a stream. Bulletproof, therefore:
+ * serialize setting/unsetting our global stream using the threaded
+ * mainloop lock, and check for that stream being non-null before
+ * using it.
+ *
+ * I am not convinced there are no further dragons lurking here: can
+ * the "playing" thread(s) close and reopen our output stream while
+ * the "output buffer" thread is sending output there? We can bail if
+ * our stream is simply closed, but we do not currently detect it
+ * being reopened and no longer using the same sample format, which
+ * might have interesting results...
+ *
+ * Also, read_mixer is called from the main server thread (handling
+ * commands). This crashed me once when it got at a stream that was in
+ * the "creating" state and therefore did not have a valid stream
+ * index yet. Fixed by only assigning to the stream global when the
+ * stream is valid.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define DEBUG
+
+#include <pulse/pulseaudio.h>
+#include "common.h"
+#include "log.h"
+#include "audio.h"
+
+
+/* The pulse mainloop and context are initialized in pulse_init and
+ * destroyed in pulse_shutdown.
+ */
+static pa_threaded_mainloop *mainloop = NULL;
+static pa_context *context = NULL;
+
+/* The stream is initialized in pulse_open and destroyed in pulse_close. */
+static pa_stream *stream = NULL;
+
+static int showing_sink_volume = 0;
+
+/* Callbacks that do nothing but wake up the mainloop. */
+
+static void context_state_callback (pa_context *context ATTR_UNUSED,
+ void *userdata)
+{
+ pa_threaded_mainloop *m = userdata;
+
+ pa_threaded_mainloop_signal (m, 0);
+}
+
+static void stream_state_callback (pa_stream *stream ATTR_UNUSED,
+ void *userdata)
+{
+ pa_threaded_mainloop *m = userdata;
+
+ pa_threaded_mainloop_signal (m, 0);
+}
+
+static void stream_write_callback (pa_stream *stream ATTR_UNUSED,
+ size_t nbytes ATTR_UNUSED, void *userdata)
+{
+ pa_threaded_mainloop *m = userdata;
+
+ pa_threaded_mainloop_signal (m, 0);
+}
+
+/* Initialize pulse mainloop and context. Failure to connect to the
+ * pulse daemon is nonfatal, everything else is fatal (as it
+ * presumably means we ran out of resources).
+ */
+static int pulse_init (struct output_driver_caps *caps)
+{
+ pa_context *c;
+ pa_proplist *proplist;
+
+ assert (!mainloop);
+ assert (!context);
+
+ mainloop = pa_threaded_mainloop_new ();
+ if (!mainloop)
+ fatal ("Cannot create PulseAudio mainloop");
+
+ if (pa_threaded_mainloop_start (mainloop) < 0)
+ fatal ("Cannot start PulseAudio mainloop");
+
+ /* TODO: possibly add more props.
+ *
+ * There are a few we could set in proplist.h but nothing I
+ * expect to be very useful.
+ *
+ * http://pulseaudio.org/wiki/ApplicationProperties recommends
+ * setting at least application.name, icon.name and media.role.
+ *
+ * No need to set application.name here, the name passed to
+ * pa_context_new_with_proplist overrides it.
+ */
+ proplist = pa_proplist_new ();
+ if (!proplist)
+ fatal ("Cannot allocate PulseAudio proplist");
+
+ pa_proplist_sets (proplist,
+ PA_PROP_APPLICATION_VERSION, PACKAGE_VERSION);
+ pa_proplist_sets (proplist, PA_PROP_MEDIA_ROLE, "music");
+ pa_proplist_sets (proplist, PA_PROP_APPLICATION_ID, "net.daper.moc");
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ c = pa_context_new_with_proplist (
+ pa_threaded_mainloop_get_api (mainloop),
+ PACKAGE_NAME, proplist);
+ pa_proplist_free (proplist);
+
+ if (!c)
+ fatal ("Cannot allocate PulseAudio context");
+
+ pa_context_set_state_callback (c, context_state_callback, mainloop);
+
+ /* Ignore return value, rely on state being set properly */
+ pa_context_connect (c, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL);
+
+ while (1) {
+ pa_context_state_t state = pa_context_get_state (c);
+
+ if (state == PA_CONTEXT_READY)
+ break;
+
+ if (!PA_CONTEXT_IS_GOOD (state)) {
+ error ("PulseAudio connection failed: %s",
+ pa_strerror (pa_context_errno (c)));
+
+ goto unlock_and_fail;
+ }
+
+ debug ("waiting for context to become ready...");
+ pa_threaded_mainloop_wait (mainloop);
+ }
+
+ /* Only set the global now that the context is actually ready */
+ context = c;
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ /* We just make up the hardware capabilities, since pulse is
+ * supposed to be abstracting these out. Assume pulse will
+ * deal with anything we want to throw at it, and that we will
+ * only want mono or stereo audio.
+ */
+ caps->min_channels = 1;
+ caps->max_channels = 2;
+ caps->formats = (SFMT_S8 | SFMT_S16 | SFMT_S32 |
+ SFMT_FLOAT | SFMT_BE | SFMT_LE);
+
+ return 1;
+
+unlock_and_fail:
+
+ pa_context_unref (c);
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ pa_threaded_mainloop_stop (mainloop);
+ pa_threaded_mainloop_free (mainloop);
+ mainloop = NULL;
+
+ return 0;
+}
+
+static void pulse_shutdown (void)
+{
+ pa_threaded_mainloop_lock (mainloop);
+
+ pa_context_disconnect (context);
+ pa_context_unref (context);
+ context = NULL;
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ pa_threaded_mainloop_stop (mainloop);
+ pa_threaded_mainloop_free (mainloop);
+ mainloop = NULL;
+}
+
+static int pulse_open (struct sound_params *sound_params)
+{
+ pa_sample_spec ss;
+ pa_buffer_attr ba;
+ pa_stream *s;
+
+ assert (!stream);
+ /* Initialize everything to -1, which in practice gets us
+ * about 2 seconds of latency (which is fine). This is not the
+ * same as passing NULL for this struct, which gets us an
+ * unnecessarily short alsa-like latency.
+ */
+ ba.fragsize = (uint32_t) -1;
+ ba.tlength = (uint32_t) -1;
+ ba.prebuf = (uint32_t) -1;
+ ba.minreq = (uint32_t) -1;
+ ba.maxlength = (uint32_t) -1;
+
+ ss.channels = sound_params->channels;
+ ss.rate = sound_params->rate;
+ switch (sound_params->fmt) {
+ case SFMT_U8:
+ ss.format = PA_SAMPLE_U8;
+ break;
+ case SFMT_S16 | SFMT_LE:
+ ss.format = PA_SAMPLE_S16LE;
+ break;
+ case SFMT_S16 | SFMT_BE:
+ ss.format = PA_SAMPLE_S16BE;
+ break;
+ case SFMT_FLOAT | SFMT_LE:
+ ss.format = PA_SAMPLE_FLOAT32LE;
+ break;
+ case SFMT_FLOAT | SFMT_BE:
+ ss.format = PA_SAMPLE_FLOAT32BE;
+ break;
+ case SFMT_S32 | SFMT_LE:
+ ss.format = PA_SAMPLE_S32LE;
+ break;
+ case SFMT_S32 | SFMT_BE:
+ ss.format = PA_SAMPLE_S32BE;
+ break;
+
+ default:
+ fatal ("pulse: got unrequested format");
+ }
+
+ debug ("opening stream");
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ /* TODO: figure out if there are useful stream properties to set.
+ *
+ * I do not really see any in proplist.h that we can set from
+ * here (there are media title/artist/etc props but we do not
+ * have that data available here).
+ */
+ s = pa_stream_new (context, "music", &ss, NULL);
+ if (!s)
+ fatal ("pulse: stream allocation failed");
+
+ pa_stream_set_state_callback (s, stream_state_callback, mainloop);
+ pa_stream_set_write_callback (s, stream_write_callback, mainloop);
+
+ /* Ignore return value, rely on failed stream state instead. */
+ pa_stream_connect_playback (
+ s, NULL, &ba,
+ PA_STREAM_INTERPOLATE_TIMING |
+ PA_STREAM_AUTO_TIMING_UPDATE |
+ PA_STREAM_ADJUST_LATENCY,
+ NULL, NULL);
+
+ while (1) {
+ pa_stream_state_t state = pa_stream_get_state (s);
+
+ if (state == PA_STREAM_READY)
+ break;
+
+ if (!PA_STREAM_IS_GOOD (state)) {
+ error ("PulseAudio stream connection failed");
+
+ goto fail;
+ }
+
+ debug ("waiting for stream to become ready...");
+ pa_threaded_mainloop_wait (mainloop);
+ }
+
+ /* Only set the global stream now that it is actually ready */
+ stream = s;
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ return 1;
+
+fail:
+ pa_stream_unref (s);
+
+ pa_threaded_mainloop_unlock (mainloop);
+ return 0;
+}
+
+static void pulse_close (void)
+{
+ debug ("closing stream");
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ pa_stream_disconnect (stream);
+ pa_stream_unref (stream);
+ stream = NULL;
+
+ pa_threaded_mainloop_unlock (mainloop);
+}
+
+static int pulse_play (const char *buff, const size_t size)
+{
+ size_t offset = 0;
+
+ debug ("Got %d bytes to play", (int)size);
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ /* The buffer is usually writable when we get here, and there
+ * are usually few (if any) writes after the first one. So
+ * there is no point in doing further writes directly from the
+ * callback: we can just do all writes from this thread.
+ */
+
+ /* Break out of the loop if some other thread manages to close
+ * our stream underneath us.
+ */
+ while (stream) {
+ size_t towrite = MIN(pa_stream_writable_size (stream),
+ size - offset);
+ debug ("writing %d bytes", (int)towrite);
+
+ /* We have no working way of dealing with errors
+ * (see below). */
+ if (pa_stream_write(stream, buff + offset, towrite,
+ NULL, 0, PA_SEEK_RELATIVE))
+ error ("pa_stream_write failed");
+
+ offset += towrite;
+
+ if (offset >= size)
+ break;
+
+ pa_threaded_mainloop_wait (mainloop);
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ debug ("Done playing!");
+
+ /* We should always return size, calling code does not deal
+ * well with anything else. Only read the rest if you want to
+ * know why.
+ *
+ * The output buffer reader thread (out_buf.c:read_thread)
+ * repeatedly loads some 64k/0.1s of audio into a buffer on
+ * the stack, then calls audio_send_pcm repeatedly until this
+ * entire buffer has been processed (similar to the loop in
+ * this function). audio_send_pcm applies the softmixer and
+ * equalizer, then feeds the result to this function, passing
+ * through our return value.
+ *
+ * So if we return less than size the equalizer/softmixer is
+ * re-applied to the remaining data, which is silly. Also,
+ * audio_send_pcm checks for our return value being zero and
+ * calls fatal() if it is, so try to always process *some*
+ * data. Also, out_buf.c uses the return value of this
+ * function from the last run through its inner loop to update
+ * its time attribute, which means it will be interestingly
+ * off if that loop ran more than once.
+ *
+ * Oh, and alsa.c seems to think it can return -1 to indicate
+ * failure, which will cause out_buf.c to rewind its buffer
+ * (to before its start, usually).
+ */
+ return size;
+}
+
+static void volume_cb (const pa_cvolume *v, void *userdata)
+{
+ int *result = userdata;
+
+ if (v)
+ *result = 100 * pa_cvolume_avg (v) / PA_VOLUME_NORM;
+
+ pa_threaded_mainloop_signal (mainloop, 0);
+}
+
+static void sink_volume_cb (pa_context *c ATTR_UNUSED,
+ const pa_sink_info *i, int eol ATTR_UNUSED,
+ void *userdata)
+{
+ volume_cb (i ? &i->volume : NULL, userdata);
+}
+
+static void sink_input_volume_cb (pa_context *c ATTR_UNUSED,
+ const pa_sink_input_info *i,
+ int eol ATTR_UNUSED,
+ void *userdata ATTR_UNUSED)
+{
+ volume_cb (i ? &i->volume : NULL, userdata);
+}
+
+static int pulse_read_mixer (void)
+{
+ pa_operation *op;
+ int result = 0;
+
+ debug ("read mixer");
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ if (stream) {
+ if (showing_sink_volume)
+ op = pa_context_get_sink_info_by_index (
+ context, pa_stream_get_device_index (stream),
+ sink_volume_cb, &result);
+ else
+ op = pa_context_get_sink_input_info (
+ context, pa_stream_get_index (stream),
+ sink_input_volume_cb, &result);
+
+ while (pa_operation_get_state (op) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait (mainloop);
+
+ pa_operation_unref (op);
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ return result;
+}
+
+static void pulse_set_mixer (int vol)
+{
+ pa_cvolume v;
+ pa_operation *op;
+
+ /* Setting volume for one channel does the right thing. */
+ pa_cvolume_set(&v, 1, vol * PA_VOLUME_NORM / 100);
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ if (stream) {
+ if (showing_sink_volume)
+ op = pa_context_set_sink_volume_by_index (
+ context, pa_stream_get_device_index (stream),
+ &v, NULL, NULL);
+ else
+ op = pa_context_set_sink_input_volume (
+ context, pa_stream_get_index (stream),
+ &v, NULL, NULL);
+
+ pa_operation_unref (op);
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+}
+
+static int pulse_get_buff_fill (void)
+{
+ /* This function is problematic. MOC uses it to for the "time
+ * remaining" in the UI, but calls it more than once per
+ * second (after each chunk of audio played, not for each
+ * playback time update). We have to be fairly accurate here
+ * for that time remaining to not jump weirdly. But PulseAudio
+ * cannot give us a 100% accurate value here, as it involves a
+ * server roundtrip. And if we call this a lot it suggests
+ * switching to a mode where the value is interpolated, making
+ * it presumably more inaccurate (see the flags we pass to
+ * pa_stream_connect_playback).
+ *
+ * MOC also contains what I believe to be a race: it calls
+ * audio_get_buff_fill "soon" (after playing the first chunk)
+ * after starting playback of the next song, at which point we
+ * still have part of the previous song buffered. This means
+ * our position into the new song is negative, which fails an
+ * assert (in out_buf.c:out_buf_time_get). There is no sane
+ * way for us to detect this condition. I believe no other
+ * backend triggers this because the assert sits after an
+ * implicit float -> int seconds conversion, which means we
+ * have to be off by at least an entire second to get a
+ * negative value, and none of the other backends have buffers
+ * that large (alsa buffers are supposedly a few 100 ms).
+ */
+ pa_usec_t buffered_usecs = 0;
+ int buffered_bytes = 0;
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ /* Using pa_stream_get_timing_info and returning the distance
+ * between write_index and read_index would be more obvious,
+ * but because of how the result is actually used I believe
+ * using the latency value is slightly more correct, and it
+ * makes the following crash-avoidance hack more obvious.
+ */
+
+ /* This function will frequently fail the first time we call
+ * it (pulse does not have the requested data yet). We ignore
+ * that and just return 0.
+ *
+ * Deal with stream being NULL too, just in case this is
+ * called in a racy fashion similar to how reset() is.
+ */
+ if (stream &&
+ pa_stream_get_latency (stream, &buffered_usecs, NULL) >= 0) {
+ /* Crash-avoidance HACK: floor our latency to at most
+ * 1 second. It is usually more, but reporting that at
+ * the start of playback crashes MOC, and we cannot
+ * sanely detect when reporting it is safe.
+ */
+ if (buffered_usecs > 1000000)
+ buffered_usecs = 1000000;
+
+ buffered_bytes = pa_usec_to_bytes (
+ buffered_usecs,
+ pa_stream_get_sample_spec (stream));
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ debug ("buffer fill: %d usec / %d bytes",
+ (int) buffered_usecs, (int) buffered_bytes);
+
+ return buffered_bytes;
+}
+
+static void flush_callback (pa_stream *s ATTR_UNUSED, int success,
+ void *userdata)
+{
+ int *result = userdata;
+
+ *result = success;
+
+ pa_threaded_mainloop_signal (mainloop, 0);
+}
+
+static int pulse_reset (void)
+{
+ pa_operation *op;
+ int result = 0;
+
+ debug ("reset requested");
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ /* We *should* have a stream here, but MOC is racy, so bulletproof */
+ if (stream) {
+ op = pa_stream_flush (stream, flush_callback, &result);
+
+ while (pa_operation_get_state (op) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait (mainloop);
+
+ pa_operation_unref (op);
+ } else
+ logit ("pulse_reset() called without a stream");
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ return result;
+}
+
+static int pulse_get_rate (void)
+{
+ /* This is called once right after open. Do not bother making
+ * this fast. */
+
+ int result;
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ if (stream)
+ result = pa_stream_get_sample_spec (stream)->rate;
+ else {
+ error ("get_rate called without a stream");
+ result = 0;
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ return result;
+}
+
+static void pulse_toggle_mixer_channel (void)
+{
+ showing_sink_volume = !showing_sink_volume;
+}
+
+static void sink_name_cb (pa_context *c ATTR_UNUSED,
+ const pa_sink_info *i, int eol ATTR_UNUSED,
+ void *userdata)
+{
+ char **result = userdata;
+
+ if (i && !*result)
+ *result = xstrdup (i->name);
+
+ pa_threaded_mainloop_signal (mainloop, 0);
+}
+
+static void sink_input_name_cb (pa_context *c ATTR_UNUSED,
+ const pa_sink_input_info *i,
+ int eol ATTR_UNUSED,
+ void *userdata)
+{
+ char **result = userdata;
+
+ if (i && !*result)
+ *result = xstrdup (i->name);
+
+ pa_threaded_mainloop_signal (mainloop, 0);
+}
+
+static char *pulse_get_mixer_channel_name (void)
+{
+ char *result = NULL;
+ pa_operation *op;
+
+ pa_threaded_mainloop_lock (mainloop);
+
+ if (stream) {
+ if (showing_sink_volume)
+ op = pa_context_get_sink_info_by_index (
+ context, pa_stream_get_device_index (stream),
+ sink_name_cb, &result);
+ else
+ op = pa_context_get_sink_input_info (
+ context, pa_stream_get_index (stream),
+ sink_input_name_cb, &result);
+
+ while (pa_operation_get_state (op) == PA_OPERATION_RUNNING)
+ pa_threaded_mainloop_wait (mainloop);
+
+ pa_operation_unref (op);
+ }
+
+ pa_threaded_mainloop_unlock (mainloop);
+
+ if (!result)
+ result = xstrdup ("disconnected");
+
+ return result;
+}
+
+void pulse_funcs (struct hw_funcs *funcs)
+{
+ funcs->init = pulse_init;
+ funcs->shutdown = pulse_shutdown;
+ funcs->open = pulse_open;
+ funcs->close = pulse_close;
+ funcs->play = pulse_play;
+ funcs->read_mixer = pulse_read_mixer;
+ funcs->set_mixer = pulse_set_mixer;
+ funcs->get_buff_fill = pulse_get_buff_fill;
+ funcs->reset = pulse_reset;
+ funcs->get_rate = pulse_get_rate;
+ funcs->toggle_mixer_channel = pulse_toggle_mixer_channel;
+ funcs->get_mixer_channel_name = pulse_get_mixer_channel_name;
+}
diff --git a/pulse.h b/pulse.h
new file mode 100644
--- /dev/null
+++ b/pulse.h
@@ -0,0 +1,14 @@
+#ifndef PULSE_H
+#define PULSE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void pulse_funcs (struct hw_funcs *funcs);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

View File

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
if builtins.isNull releasePath then
if releasePath == null then
fetchurl {
url = "https://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86_64.tar.bz2";
sha256 = "0pan68fr22xbj7a930y29527vpry3f07q3i9ya4fp6g7aawffsga";
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
else
releasePath
else if stdenv.hostPlatform.system == "i686-linux" then
if builtins.isNull releasePath then
if releasePath == null then
fetchurl {
url = "http://files.renoise.com/demo/Renoise_${urlVersion version}_Demo_x86.tar.bz2";
sha256 = "1lccjj4k8hpqqxxham5v01v2rdwmx3c5kgy1p9lqvzqma88k4769";

View File

@ -9,7 +9,7 @@ with stdenv.lib;
stdenv.mkDerivation rec {
pname = "lightdm";
version = "1.28.0";
version = "1.30.0";
outputs = [ "out" "dev" ];
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
owner = "CanonicalLtd";
repo = pname;
rev = version;
sha256 = "1mmqy1jdvgc0h0h9gli7n4vdv5p8m5019qjr5ni4h73iz6mjdj2b";
sha256 = "0i1yygmjbkdjnqdl9jn8zsa1mfs2l19qc4k2capd8q1ndhnjm2dx";
};
nativeBuildInputs = [

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
pname = "tiled";
version = "1.2.3";
version = "1.2.4";
src = fetchFromGitHub {
owner = "bjorn";
repo = pname;
rev = "v${version}";
sha256 = "1zsfhw539zwyf5qfnirzkkgy5bmrrs2cry4gimrhpky9fjlaa9h8";
sha256 = "18a0pkq8j20v1njrl0sswm0ch10c6c4fas7q9kk2d2fd610ga6gh";
};
nativeBuildInputs = [ pkgconfig qmake ];

View File

@ -0,0 +1,65 @@
{ stdenv
, fetchFromGitHub
, desktop-file-utils
, gettext
, glib
, gtk3
, hicolor-icon-theme
, libgee
, libdazzle
, meson
, ninja
, pantheon
, pkgconfig
, python3
, webkitgtk
, wrapGAppsHook
, glib-networking
}:
stdenv.mkDerivation rec {
pname = "ephemeral";
version = "5.1.0";
src = fetchFromGitHub {
owner = "cassidyjames";
repo = "ephemeral";
rev = version;
sha256 = "1wfrbbdw429q2mkycn87fhci0jidcsflk5f2lbzfzccbcs8msffz";
};
nativeBuildInputs = [
desktop-file-utils
gettext
meson
ninja
pantheon.vala
pkgconfig
python3
wrapGAppsHook
];
buildInputs = [
glib
glib-networking
gtk3
hicolor-icon-theme
libdazzle
libgee
pantheon.granite
webkitgtk
];
postPatch = ''
chmod +x meson/post_install.py
patchShebangs meson/post_install.py
'';
meta = with stdenv.lib; {
description = "The always-incognito web browser";
homepage = https://github.com/cassidyjames/ephemeral;
maintainers = with maintainers; [ kjuvi ] ++ pantheon.maintainers;
platforms = platforms.linux;
license = licenses.gpl3;
};
}

View File

@ -10,7 +10,7 @@ let
alternativeConfig = builtins.toFile "lumail2.lua"
(builtins.readFile alternativeGlobalConfigFilePath);
globalConfig = if isNull alternativeGlobalConfigFilePath then ''
globalConfig = if alternativeGlobalConfigFilePath == null then ''
mkdir -p $out/etc/lumail2
cp global.config.lua $out/etc/lumail2.lua
for n in ./lib/*.lua; do

View File

@ -16,4 +16,4 @@ DEPENDENCIES
timetrap
BUNDLED WITH
1.10.6
1.17.2

View File

@ -1,17 +1,15 @@
{ lib, bundlerEnv, ruby }:
{ lib, bundlerApp }:
bundlerEnv rec {
name = "timetrap-${version}";
version = (import gemset).timetrap.version;
inherit ruby;
bundlerApp {
pname = "timetrap";
gemdir = ./.;
gemset = ./gemset.nix;
exes = [ "timetrap" ];
meta = with lib; {
description = "A simple command line time tracker written in ruby";
homepage = https://github.com/samg/timetrap;
license = licenses.mit;
maintainers = [ maintainers.jerith666 ];
homepage = https://github.com/samg/timetrap;
license = licenses.mit;
maintainers = with maintainers; [ jerith666 manveru ];
platforms = platforms.unix;
};
}

View File

@ -1,5 +1,7 @@
{
chronic = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1hrdkn4g8x7dlzxwb1rfgr8kw3bp4ywg5l4y4i9c2g5cwv62yvvn";
@ -8,6 +10,8 @@
version = "0.10.2";
};
sequel = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "121z4sq2m4vsgxwy8hs6d12cc1i4xa5rjiv0nbviyj87jldxapw0";
@ -16,6 +20,8 @@
version = "4.43.0";
};
sqlite3 = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "01ifzp8nwzqppda419c9wcvr8n82ysmisrs0hph9pdmv1lpa4f5i";
@ -25,6 +31,8 @@
};
timetrap = {
dependencies = ["chronic" "sequel" "sqlite3"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0ylaz9q99hbxnw6h1df6wphmh68fj847d1l4f9jylcx3nzzp5cyd";

View File

@ -0,0 +1,32 @@
{ stdenv, fetchurl, argtable }:
stdenv.mkDerivation rec {
version = "1.2.4";
name = "clustal-omega-${version}";
src = fetchurl {
url = "http://www.clustal.org/omega/${name}.tar.gz";
sha256 = "1vm30mzncwdv881vrcwg11vzvrsmwy4wg80j5i0lcfk6dlld50w6";
};
buildInputs = [ argtable ];
preConfigure = ''
for f in configure \
src/clustal-omega-config.h \
src/clustal-omega-config.h \
src/config.h.in \
src/mymain.c
do
sed -i -re 's/argtable2/argtable3/g' $f
done
'';
meta = with stdenv.lib; {
description = "General purpose multiple sequence alignment program for protein and DNA/RNA";
homepage = http://www.clustal.org/omega/;
license = licenses.gpl2;
maintainers = [ maintainers.bzizou ];
platforms = platforms.unix;
};
}

View File

@ -1,12 +1,12 @@
{ stdenv, fetchurl, which, gfortran, libGLU, xorg } :
stdenv.mkDerivation rec {
version = "5.9.5";
version = "6.1";
name = "molden-${version}";
src = fetchurl {
url = "ftp://ftp.cmbi.ru.nl/pub/molgraph/molden/molden${version}.tar.gz";
sha256 = "0va5g03kvnzydx0b77y1p536iy7swzvnx6yknp87qgpw1bgrzdj9";
sha256 = "0swbjnqlkwhy8lvjkbx8yklqj4zfphwdg6s3haawxi3dd65ij539";
};
nativeBuildInputs = [ which ];

View File

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
version = "128";
src =
if builtins.isNull releasePath then
if releasePath == null then
throw ''
This nix expression requires that the cplex installer is already
downloaded to your machine. Get it from IBM:

View File

@ -59,7 +59,7 @@ let
# return the names of all dependencies in the transitive closure
transitiveClosure = dep:
if isNull dep then
if dep == null then
# propagatedBuildInputs might contain null
# (although that might be considered a programming error in the derivation)
[]

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, git, makeWrapper, openssl }:
{ stdenv, fetchFromGitHub, git, makeWrapper, openssl, coreutils, utillinux, gnugrep, gnused, gawk }:
stdenv.mkDerivation rec {
name = "transcrypt-${version}";
@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
sha256 = "1dkr69plk16wllk5bzlkchrzw63pk239dgbjhrb3mb61i065jdam";
};
buildInputs = [ git makeWrapper openssl ];
buildInputs = [ makeWrapper git openssl coreutils utillinux gnugrep gnused gawk ];
patches = [ ./helper-scripts_depspathprefix.patch ];
installPhase = ''
install -m 755 -D transcrypt $out/bin/transcrypt
@ -20,7 +22,13 @@ stdenv.mkDerivation rec {
install -m 644 -D contrib/zsh/_transcrypt $out/share/zsh/site-functions/_transcrypt
wrapProgram $out/bin/transcrypt \
--prefix PATH : "${stdenv.lib.makeBinPath [ git openssl ]}"
--prefix PATH : "${stdenv.lib.makeBinPath [ git openssl coreutils utillinux gnugrep gnused gawk ]}"
cat > $out/bin/transcrypt-depspathprefix << EOF
#!${stdenv.shell}
echo "${stdenv.lib.makeBinPath [ git openssl coreutils gawk ]}:"
EOF
chmod +x $out/bin/transcrypt-depspathprefix
'';
meta = with stdenv.lib; {

View File

@ -0,0 +1,37 @@
diff --git a/transcrypt b/transcrypt
index a0b562d..7888f5d 100755
--- a/transcrypt
+++ b/transcrypt
@@ -278,6 +278,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/clean"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
filename=$1
# ignore empty files
if [[ -s $filename ]]; then
@@ -300,6 +301,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/smudge"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
tempfile=$(mktemp 2> /dev/null || mktemp -t tmp)
trap 'rm -f "$tempfile"' EXIT
cipher=$(git config --get --local transcrypt.cipher)
@@ -309,6 +311,7 @@ save_helper_scripts() {
cat <<-'EOF' > "${GIT_DIR}/crypt/textconv"
#!/usr/bin/env bash
+ PATH="$(transcrypt-depspathprefix 2>/dev/null)$PATH"
filename=$1
# ignore empty files
if [[ -s $filename ]]; then
@@ -351,7 +354,7 @@ save_configuration() {
git config merge.renormalize 'true'
# add a git alias for listing encrypted files
- git config alias.ls-crypt "!git ls-files | git check-attr --stdin filter | awk 'BEGIN { FS = \":\" }; /crypt$/{ print \$1 }'"
+ git config alias.ls-crypt "!PATH=\"\$(transcrypt-depspathprefix 2>/dev/null)\$PATH\"; git ls-files | git check-attr --stdin filter | awk 'BEGIN { FS = \":\" }; /crypt$/{ print \$1 }'"
}
# display the current configuration settings

View File

@ -59,7 +59,7 @@ let self = rec {
extraRuntimeDependencies = [ ];
installPhase = ''
${if isNull sourceDir then "" else "cd $src/$sourceDir"}
${if sourceDir == null then "" else "cd $src/$sourceDir"}
d=$out${pluginDir}/${namespace}
mkdir -p $d
sauce="."

View File

@ -31,7 +31,7 @@ in
import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
ename =
if isNull(ename)
if ename == null
then pname
else ename;

View File

@ -0,0 +1,26 @@
{ lib, fetchurl }:
let
version = "0.0.4.7";
in fetchurl {
name = "cnstrokeorder-${version}";
url = "http://rtega.be/chmn/CNstrokeorder-${version}.ttf";
recursiveHash = true;
downloadToTemp = true;
postFetch = ''
install -D $downloadedFile $out/share/fonts/truetype/CNstrokeorder-${version}.ttf
'';
sha256 = "0cizgfdgbq9av5c8234mysr2q54iw9pkxrmq5ga8gv32hxhl5bx4";
meta = with lib; {
description = "Chinese font that shows stroke order for HSK 1-4";
homepage = "http://rtega.be/chmn/index.php?subpage=68";
license = [ licenses.arphicpl ];
maintainers = with maintainers; [ johnazoidberg ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,26 @@
{ stdenv, fetchzip }:
let
version = "4.002";
in fetchzip {
name = "kanji-stroke-order-font-${version}";
url = "https://sites.google.com/site/nihilistorguk/KanjiStrokeOrders_v${version}.zip?attredirects=0";
postFetch = ''
mkdir -p $out/share/fonts/kanji-stroke-order $out/share/doc/kanji-stroke-order
unzip -j $downloadedFile \*.ttf -d $out/share/fonts/kanji-stroke-order
unzip -j $downloadedFile \*.txt -d $out/share/doc/kanji-stroke-order
'';
sha256 = "194ylkx5p7r1461wnnd3hisv5dz1xl07fyxmg8gv47zcwvdmwkc0";
meta = with stdenv.lib; {
description = "Font containing stroke order diagrams for over 6500 kanji, 180 kana and other characters";
homepage = "https://sites.google.com/site/nihilistorguk/";
license = [ licenses.bsd3 ];
maintainers = with maintainers; [ ptrhlm ];
platforms = platforms.all;
};
}

View File

@ -1,27 +1,60 @@
{ stdenv, fetchurl, pkgconfig, gnome3, gtk3, wrapGAppsHook, gobject-introspection
, itstool, libxml2, python3Packages, at-spi2-core
, dbus, gettext, libwnck3 }:
{ stdenv
, fetchurl
, pkgconfig
, gnome3
, gtk3
, glib
, wrapGAppsHook
, gobject-introspection
, itstool
, libxml2
, python3
, at-spi2-core
, dbus
, gettext
, libwnck3
, adwaita-icon-theme
}:
stdenv.mkDerivation rec {
python3.pkgs.buildPythonApplication rec {
name = "accerciser-${version}";
version = "3.32.1";
version = "3.32.2";
format = "other";
src = fetchurl {
url = "mirror://gnome/sources/accerciser/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0afzhbig5yw87zyfmid61368jj8l6i7k8gs29x0hv65fz4yiv4h4";
sha256 = "05ssj8whzhf98lpcaca7m45h03g0wx0i8jlsrh3yn943mshzidy8";
};
nativeBuildInputs = [
pkgconfig wrapGAppsHook itstool gettext
gettext
gobject-introspection # For setup hook
];
buildInputs = [
gtk3 libxml2 python3Packages.python python3Packages.pyatspi
python3Packages.pygobject3 python3Packages.ipython
at-spi2-core dbus libwnck3 gnome3.adwaita-icon-theme
itstool
libxml2
pkgconfig
dbus
wrapGAppsHook
];
wrapPrefixVariables = [ "PYTHONPATH" ];
buildInputs = [
adwaita-icon-theme
at-spi2-core
gtk3
libwnck3
];
propagatedBuildInputs = with python3.pkgs; [
ipython
pyatspi
pycairo
pygobject3
xlib
];
# Strict deps breaks accerciser
# and https://github.com/NixOS/nixpkgs/issues/56943
strictDeps = false;
passthru = {
updateScript = gnome3.updateScript {

View File

@ -7,13 +7,13 @@
, libcanberra-gtk3, bogofilter, gst_all_1, procps, p11-kit, openldap }:
let
version = "3.32.1";
version = "3.32.2";
in stdenv.mkDerivation rec {
name = "evolution-${version}";
src = fetchurl {
url = "mirror://gnome/sources/evolution/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0ns76w6vwv5k1nxpaqrizp1pnm89xzfgs60i6cwwfs35zqlmb7iq";
sha256 = "1sb60zhdawza33zlp0n3hbd7mq43a4y09jmkphpnxdifypfkar55";
};
propagatedUserEnvPkgs = [ evolution-data-server ];

View File

@ -6,11 +6,11 @@
stdenv.mkDerivation rec {
name = "gedit-${version}";
version = "3.32.0";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gedit/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1lray9vvbcrnhjv5cr5fc4bqfd68km2x79cj50byyqn9cnlf5qn9";
sha256 = "1q2rk7fym542c7k3bn2wlnzgy384gxacbifsjny0spbg95gfybvl";
};
nativeBuildInputs = [

View File

@ -9,13 +9,13 @@
# TODO: ovirt (optional)
let
version = "3.32.0.2";
version = "3.32.1";
in stdenv.mkDerivation rec {
name = "gnome-boxes-${version}";
src = fetchurl {
url = "mirror://gnome/sources/gnome-boxes/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1239x1bbkn0gxxq82zpvjjr7srla2d5ghi5rqwxnhsab0c2ypswk";
sha256 = "159sxii3g4s5pjb4s4i3kc4q162w5vicp4g6wvk1y2yv68bgmcl4";
};
doCheck = true;

View File

@ -4,13 +4,13 @@
let
pname = "gnome-calendar";
version = "3.32.1";
version = "3.32.2";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1wip968nvp1yj34hbpc3wjbrmrgjm1f82ag5ngv90z38953vi9vl";
sha256 = "07p73cvzj8idr80npja5yiv9pjfyi6qqfhaz5jwcgqspqbnhnl7k";
};
passthru = {

View File

@ -5,13 +5,13 @@
let
pname = "gnome-maps";
version = "3.32.1";
version = "3.32.2";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1q15qsp0ca67y4l0x31518cfakrj85x9g0cbcm0wysnbddi1aik0";
sha256 = "1yvwzdfxjdgx4478l2i240ssvbr8hm5sg4krc1gw2ps08sgap7yx";
};
doCheck = true;

View File

@ -6,13 +6,13 @@
python3.pkgs.buildPythonApplication rec {
pname = "gnome-music";
version = "3.32.1";
version = "3.32.2";
format = "other";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "11fdij1jznjsph1q5rkkvdhikzdh2lls921lv2m2di9x7i2xn3h4";
sha256 = "0cn7l1d3ayima1w3bxpshijabd7ibhnvqxv2mpvffzizk04ln6hk";
};
nativeBuildInputs = [ meson ninja gettext itstool pkgconfig libxml2 wrapGAppsHook desktop-file-utils appstream-glib gobject-introspection ];

View File

@ -5,13 +5,13 @@
let
pname = "polari";
version = "3.32.1";
version = "3.32.2";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0z2dxj1hd798jn79y9a7lkb77lm8l7y5fsqh9g6lbr7pnmg559yk";
sha256 = "0h0w9j3y067l911gpj446b3a2w1i2vzr1w2a7cz7i5rhn6qkf2sp";
};
propagatedUserEnvPkgs = [ telepathy-idle telepathy-logger ];

View File

@ -6,11 +6,11 @@
stdenv.mkDerivation rec {
pname = "seahorse";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1nh2gahiixj661a3l008yhidx952q50fqgdckg8l0d237wnwp7f6";
sha256 = "0d8zdzmlz7fjv9xl20zl4ckidf465mvdjnbpxy3k08y9iw423q4x";
};
doCheck = true;

View File

@ -4,11 +4,11 @@
stdenv.mkDerivation rec {
name = "gjs-${version}";
version = "1.56.1";
version = "1.56.2";
src = fetchurl {
url = "mirror://gnome/sources/gjs/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0wylq6r0c0gf558hridlyly84vb03qzdrfph21z8dbqy8l7g2937";
sha256 = "1b5321krn89p3f7s2ik6gpfnc61apzljhlnbqky8c88f7n6832ac";
};
passthru = {

View File

@ -14,11 +14,11 @@ let
in stdenv.mkDerivation rec {
name = "gnome-shell-${version}";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gnome-shell/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1pb00af3w4wivdhcvdy59z2xlxasg90bcm5a9ck0p5lf97adwx08";
sha256 = "0anlkdnqsp5fqvmg95rqjpp1ifcx5xzsvwcrdsvb1cqzbh6inmp5";
};
LANG = "en_US.UTF-8";

View File

@ -5,11 +5,11 @@
stdenv.mkDerivation rec {
name = "gnome-software-${version}";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gnome-software/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0xxhvyqfwlcyvlqc36rpcili00dpwy8b5c5klaqccn5qrc87rl38";
sha256 = "12kw5vyg8jy0xiq1shfh4ksar2dpyzcdxbyx8lrp9494d606nrlx";
};
patches = [

View File

@ -4,11 +4,11 @@
stdenv.mkDerivation rec {
name = "gnome-terminal-${version}";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gnome-terminal/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0i613844gf5dmzpvwiy68lg8walhj4zr88scacp2qwpqs870si8x";
sha256 = "0shhpnagasyp1kxgjczfrivcxbgrrl3y8lzvp1z101m67h4jp6km";
};
buildInputs = [

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "gnome-user-docs-${version}";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gnome-user-docs/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "09g6fi9b1xpk0fnp6wgh350v1x318mrf20j4bfarww25vrj6irrw";
sha256 = "1ny7cwkyskrykzsrabjnlc9jsdl4kdk73smwxas6ddmca02hpm7c";
};
passthru = {

View File

@ -11,11 +11,11 @@
stdenv.mkDerivation rec {
pname = "mutter";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/mutter/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1q74lrb08vy0ynxbssqyxvbzf9252xgf9l6jxr9g4q0gmvpq402j";
sha256 = "1h577i2ap7dpfy1jg101jvc6nzccc0csgvd55ahydlr8f94frcva";
};
mesonFlags = [

View File

@ -7,13 +7,13 @@
let
pname = "nautilus";
version = "3.32.0";
version = "3.32.1";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1pnh32fal7dkwadga5savg1nv0zqnbakhk0hxr5726087i6y6ii2";
sha256 = "0vmrvimv4183l3ij4kv0ir2c9rfzk7gh3xc2pa4wkqq9kn7h6m7s";
};
nativeBuildInputs = [

View File

@ -4,11 +4,11 @@
stdenv.mkDerivation rec {
name = "simple-scan-${version}";
version = "3.32.2";
version = "3.32.2.1";
src = fetchurl {
url = "mirror://gnome/sources/simple-scan/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "12r5hacwpf0gzca3p73xpmx3dksa1kx50nlj6w4nw8jfqzjlkq1k";
sha256 = "0xqb642bsd2hddsm4bd199vyq8jcipdlxm0br3mjlc5vjcxgkxyp";
};
buildInputs = [

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "yelp-tools-${version}";
version = "3.32.0";
version = "3.32.1";
src = fetchurl {
url = "mirror://gnome/sources/yelp-tools/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "037fd6xpy3zab7j5p7c0vfc6c3nk6qs0prvz1hbilzc31p8l1pdz";
sha256 = "1qrn8ss3wc601w8j0ziicgmgic0yh01az6611n3jgd7wll9c79wr";
};
passthru = {

View File

@ -5,11 +5,11 @@
stdenv.mkDerivation rec {
name = "yelp-${version}";
version = "3.32.1";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/yelp/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "159ayfyswn9yh7g5hjs6lphh510n6qkyd1cj47hnc3ynnab9hn4r";
sha256 = "0yrl96icmmrxvg7sxl519gzg9qb368cmzgrr9ddh181ignkxzx7f";
};
nativeBuildInputs = [ pkgconfig gettext itstool wrapGAppsHook ];

View File

@ -3,11 +3,11 @@
stdenv.mkDerivation rec {
name = "gnome-mines-${version}";
version = "3.32.0";
version = "3.32.2";
src = fetchurl {
url = "mirror://gnome/sources/gnome-mines/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "13ia8a7bmdnp1281lwp8nvdqqkclvg1n3pw4bbr2dgsrsswfkscj";
sha256 = "1nv966wkp2rqxzcdb76bwlbzpjqadcaqzrnkxpzwnvjjr167yx8g";
};
# gobject-introspection for finding vapi files

View File

@ -26,13 +26,13 @@
let
pname = "gnome-applets";
version = "3.30.0";
version = "3.32.0";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1cvl32486kqw301wy40l1a1sdhanra7bx4smq0a3lmnl3x01zg43";
sha256 = "10kd19ymxl2z65121g90mx96m6vcn2a8a50g6a56prrdjsgbgia1";
};
nativeBuildInputs = [
@ -68,7 +68,7 @@ in stdenv.mkDerivation rec {
doCheck = true;
configureFlags = [
"--with-libpanel-applet-dir=$(out)/share/gnome-panel/applets"
"--with-libpanel-applet-dir=${placeholder ''out''}/share/gnome-panel/applets"
];
passthru = {

View File

@ -1,7 +1,6 @@
{ stdenv
, autoreconfHook
, fetchurl
, fetchpatch
, gettext
, glib
, gnome-bluetooth
@ -29,25 +28,16 @@
let
pname = "gnome-flashback";
version = "3.30.0";
version = "3.32.0";
requiredComponents = wmName: "RequiredComponents=${wmName};gnome-flashback-init;gnome-flashback;gnome-panel;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Clipboard;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Mouse;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings;";
gnome-flashback = stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "18rwql2pi78155l9zp1i50xfi5z8xz2l08m9d81x6qqbfr1nyy57";
sha256 = "0jfzr7vdmnxpxqqa38ni1p3c508xhlnxqpmmqshk3rvrf0afqn62";
};
patches =[
# overrides do not respect gsettingsschemasdir
# https://gitlab.gnome.org/GNOME/gnome-flashback/issues/9
(fetchpatch {
url = https://gitlab.gnome.org/GNOME/gnome-flashback/commit/a55530f58ccd600414a5420b287868ab7d219705.patch;
sha256 = "1la94lhhb9zlw7bnbpl6hl26zv3kxbsvgx996mhph720wxg426mh";
})
];
# make .desktop Execs absolute
postPatch = ''
patch -p0 <<END_PATCH

View File

@ -1,7 +1,6 @@
{ stdenv
, fetchurl
, autoreconfHook
, fetchpatch
, dconf
, evolution-data-server
, gdm
@ -24,7 +23,7 @@
let
pname = "gnome-panel";
version = "3.30.0";
version = "3.32.0";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
@ -32,18 +31,9 @@ in stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "12q0l7wy6hzl46i7xpvv82ka3bn14z0jg6fhv5xhnk7j9mkbmgqw";
sha256 = "0a9zi1jb0b42zd6wx3251cnns9v1w0cbwasmrx9hsj1dsb9pjq3a";
};
patches = [
# https://github.com/NixOS/nixpkgs/issues/36468
# https://gitlab.gnome.org/GNOME/gnome-panel/issues/8
(fetchpatch {
url = https://gitlab.gnome.org/GNOME/gnome-panel/commit/77be9c3507bd1b5d70d97649b85ec9f47f6c359c.patch;
sha256 = "00b1ihnc6hp2g6x1v1njbc6mhsk44izl2wigviibmka2znfk03nv";
})
];
# make .desktop Exec absolute
postPatch = ''
patch -p0 <<END_PATCH

View File

@ -16,13 +16,13 @@
let
pname = "metacity";
version = "3.30.1";
version = "3.32.0";
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "12kr472gblx7jxh9rvnamy09bkg29ms2pgc0c3373piqmavi24qg";
sha256 = "177dmb1smizfgkddk49n2kr90graj9r6xw5hg3aq0y2qqg6v4rcg";
};
patches = [

View File

@ -1,60 +0,0 @@
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src }:
let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
self = stdenv.mkDerivation {
name = "clang-${version}";
unpackPhase = ''
unpackFile ${fetch "cfe" "0x065d0w9b51xvdjxwfzjxng0gzpbx45fgiaxpap45ragi61dqjn"}
mv cfe-${version}.src clang
sourceRoot=$PWD/clang
unpackFile ${clang-tools-extra_src}
mv clang-tools-extra-* $sourceRoot/tools/extra
'';
buildInputs = [ cmake libxml2 llvm ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
] ++
# Maybe with compiler-rt this won't be needed?
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
patches = [ ./purity.patch ];
postPatch = ''
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
'';
# Clang expects to find LLVMgold in its own prefix
# Clang expects to find sanitizer libraries in its own prefix
postInstall = ''
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
ln -sv $out/bin/clang $out/bin/cpp
'';
enableParallelBuilding = true;
passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc;
};
meta = {
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
};
in self

View File

@ -1,17 +0,0 @@
--- a/lib/Driver/Tools.cpp 2015-07-31 00:47:41.000000000 +0200
+++ b/lib/Driver/Tools.cpp 2015-09-11 21:30:50.057895565 +0200
@@ -8150,15 +8150,6 @@
CmdArgs.push_back("-shared");
}
- if (Arch == llvm::Triple::arm || Arch == llvm::Triple::armeb ||
- Arch == llvm::Triple::thumb || Arch == llvm::Triple::thumbeb ||
- (!Args.hasArg(options::OPT_static) &&
- !Args.hasArg(options::OPT_shared))) {
- CmdArgs.push_back("-dynamic-linker");
- CmdArgs.push_back(Args.MakeArgString(
- D.DyldPrefix + getLinuxDynamicLinker(Args, ToolChain)));
- }
-
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());

View File

@ -1,59 +0,0 @@
{ newScope, stdenv, libstdcxxHook, isl, fetchurl
, overrideCC, wrapCCWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
}:
let
version = "3.7.1";
fetch = fetch_v version;
fetch_v = ver: name: sha256: fetchurl {
url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
inherit sha256;
};
compiler-rt_src = fetch "compiler-rt" "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx";
clang-tools-extra_src = fetch "clang-tools-extra" "0sxw2l3q5msbrwxv1ck72arggdw6n5ysi929gi69ikniranfv4aa";
tools = stdenv.lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv isl version fetch; });
in {
llvm = callPackage ./llvm.nix {
inherit compiler-rt_src;
inherit (targetLlvmLibraries) libcxxabi;
};
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src;
};
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
libstdcxxClang = wrapCCWith {
cc = tools.clang-unwrapped;
extraPackages = [ libstdcxxHook ];
};
libcxxClang = wrapCCWith {
cc = tools.clang-unwrapped;
extraPackages = [ targetLlvmLibraries.libcxx targetLlvmLibraries.libcxxabi ];
};
lldb = callPackage ./lldb.nix {};
});
libraries = stdenv.lib.makeExtensible (libraries: let
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv isl version fetch; });
in {
stdenv = overrideCC stdenv buildLlvmTools.clang;
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
libcxx = callPackage ./libc++ {};
libcxxabi = callPackage ./libc++abi.nix {};
});
in { inherit tools libraries; } // libraries // tools

View File

@ -1,30 +0,0 @@
diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
--- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100
+++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200
@@ -56,7 +56,7 @@
"-compatibility_version 1"
"-current_version ${LIBCXX_VERSION}"
"-install_name /usr/lib/libc++.1.dylib"
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
"/usr/lib/libSystem.B.dylib")
else()
@@ -64,14 +64,14 @@
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
if (OSX_HAS_ARMV7)
set(OSX_RE_EXPORT_LINE
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
else()
set(OSX_RE_EXPORT_LINE
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
endif()
else()
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
endif()
list(APPEND link_flags

View File

@ -1,48 +0,0 @@
{ lib, stdenv, fetch, cmake, libcxxabi, fixDarwinDylibNames, version }:
stdenv.mkDerivation rec {
name = "libc++-${version}";
src = fetch "libcxx" "0i7iyzk024krda5spfpfi8jksh83yp3bxqkal0xp76ffi11bszrm";
postUnpack = ''
unpackFile ${libcxxabi.src}
'';
preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
'';
patches = [
./darwin.patch
./r242056.patch
# glibc 2.26 fix
./xlocale-glibc-2.26.patch
];
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
enableParallelBuilding = true;
linkCxxAbi = stdenv.isLinux;
setupHooks = [
../../../../../build-support/setup-hooks/role.bash
./setup-hook.sh
];
meta = {
homepage = http://libcxx.llvm.org/;
description = "A new implementation of the C++ standard library, targeting C++11";
license = with stdenv.lib.licenses; [ ncsa mit ];
platforms = stdenv.lib.platforms.unix;
badPlatforms = [ "x86_64-darwin" ];
};
}

View File

@ -1,16 +0,0 @@
--- a/include/string 2015/07/13 20:04:56 242056
+++ b/include/string 2015/07/18 20:40:46 242623
@@ -1936,7 +1936,12 @@
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
- : __r_(__a)
+#if _LIBCPP_STD_VER <= 14
+ _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
+#else
+ _NOEXCEPT
+#endif
+: __r_(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);

Some files were not shown because too many files have changed in this diff Show More