Merge master into staging-next

This commit is contained in:
Frederik Rietdijk 2019-03-05 08:32:52 +01:00
commit 5d7ab31949
179 changed files with 3679 additions and 447 deletions

View file

@ -1,7 +1,6 @@
ansicolors,
argparse,
basexx,
cqueues
dkjson
fifo
inspect

1 ansicolors,
2 argparse,
3 basexx,
cqueues
4 dkjson
5 fifo
6 inspect

View file

@ -36,8 +36,25 @@
</para>
<para>
If you are using WPA2 the <command>wpa_passphrase</command> tool might be
useful to generate the <literal>wpa_supplicant.conf</literal>.
If you are using WPA2 you can generate pskRaw key using
<command>wpa_passphrase</command>:
<screen>
$ wpa_passphrase ESSID PSK
network={
ssid="echelon"
#psk="abcdefgh"
psk=dca6d6ed41f4ab5a984c9f55f6f66d4efdc720ebf66959810f4329bb391c5435
}
</screen>
<programlisting>
<xref linkend="opt-networking.wireless.networks"/> = {
echelon = {
pskRaw = "dca6d6ed41f4ab5a984c9f55f6f66d4efdc720ebf66959810f4329bb391c5435";
};
}
</programlisting>
or you can use it to directly generate the
<literal>wpa_supplicant.conf</literal>:
<screen>
# wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf</screen>
After you have edited the <literal>wpa_supplicant.conf</literal>, you need to

View file

@ -377,6 +377,10 @@
option can be set to <literal>true</literal> to automatically add them to
the grub menu.
</para>
<para>
If you need to configure networking for your machine the configuration
options are described in <xref linkend="sec-networking"/>.
</para>
<para>
Another critical option is <option>fileSystems</option>, specifying the
file systems that need to be mounted by NixOS. However, you typically

View file

@ -677,6 +677,9 @@
This may break some older applications that still rely on those symbols.
An upgrade guide can be found <link xlink:href="https://www.open-mpi.org/faq/?category=mpi-removed">here</link>.
</para>
<para>
The nginx package now relies on OpenSSL 1.1 and supports TLS 1.3 by default. You can set the protocols used by the nginx service using <xref linkend="opt-services.nginx.sslProtocols"/>.
</para>
</listitem>
<listitem>
<para>

View file

@ -189,6 +189,7 @@
./services/backup/duplicati.nix
./services/backup/crashplan.nix
./services/backup/crashplan-small-business.nix
./services/backup/duplicity.nix
./services/backup/mysql-backup.nix
./services/backup/postgresql-backup.nix
./services/backup/restic.nix

View file

@ -0,0 +1,141 @@
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.duplicity;
stateDirectory = "/var/lib/duplicity";
localTarget = if hasPrefix "file://" cfg.targetUrl
then removePrefix "file://" cfg.targetUrl else null;
in {
options.services.duplicity = {
enable = mkEnableOption "backups with duplicity";
root = mkOption {
type = types.path;
default = "/";
description = ''
Root directory to backup.
'';
};
include = mkOption {
type = types.listOf types.str;
default = [];
example = [ "/home" ];
description = ''
List of paths to include into the backups. See the FILE SELECTION
section in <citerefentry><refentrytitle>duplicity</refentrytitle>
<manvolnum>1</manvolnum></citerefentry> for details on the syntax.
'';
};
exclude = mkOption {
type = types.listOf types.str;
default = [];
description = ''
List of paths to exclude from backups. See the FILE SELECTION section in
<citerefentry><refentrytitle>duplicity</refentrytitle>
<manvolnum>1</manvolnum></citerefentry> for details on the syntax.
'';
};
targetUrl = mkOption {
type = types.str;
example = "s3://host:port/prefix";
description = ''
Target url to backup to. See the URL FORMAT section in
<citerefentry><refentrytitle>duplicity</refentrytitle>
<manvolnum>1</manvolnum></citerefentry> for supported urls.
'';
};
secretFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Path of a file containing secrets (gpg passphrase, access key...) in
the format of EnvironmentFile as described by
<citerefentry><refentrytitle>systemd.exec</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>. For example:
<programlisting>
PASSPHRASE=<replaceable>...</replaceable>
AWS_ACCESS_KEY_ID=<replaceable>...</replaceable>
AWS_SECRET_ACCESS_KEY=<replaceable>...</replaceable>
</programlisting>
'';
};
frequency = mkOption {
type = types.nullOr types.str;
default = "daily";
description = ''
Run duplicity with the given frequency (see
<citerefentry><refentrytitle>systemd.time</refentrytitle>
<manvolnum>7</manvolnum></citerefentry> for the format).
If null, do not run automatically.
'';
};
extraFlags = mkOption {
type = types.listOf types.str;
default = [];
example = [ "--full-if-older-than" "1M" ];
description = ''
Extra command-line flags passed to duplicity. See
<citerefentry><refentrytitle>duplicity</refentrytitle>
<manvolnum>1</manvolnum></citerefentry>.
'';
};
};
config = mkIf cfg.enable {
systemd = {
services.duplicity = {
description = "backup files with duplicity";
environment.HOME = stateDirectory;
serviceConfig = {
ExecStart = ''
${pkgs.duplicity}/bin/duplicity ${escapeShellArgs (
[
cfg.root
cfg.targetUrl
"--archive-dir" stateDirectory
]
++ concatMap (p: [ "--include" p ]) cfg.include
++ concatMap (p: [ "--exclude" p ]) cfg.exclude
++ cfg.extraFlags)}
'';
PrivateTmp = true;
ProtectSystem = "strict";
ProtectHome = "read-only";
StateDirectory = baseNameOf stateDirectory;
} // optionalAttrs (localTarget != null) {
ReadWritePaths = localTarget;
} // optionalAttrs (cfg.secretFile != null) {
EnvironmentFile = cfg.secretFile;
};
} // optionalAttrs (cfg.frequency != null) {
startAt = cfg.frequency;
};
tmpfiles.rules = optional (localTarget != null) "d ${localTarget} 0700 root root -";
};
assertions = singleton {
# Duplicity will fail if the last file selection option is an include. It
# is not always possible to detect but this simple case can be caught.
assertion = cfg.include != [] -> cfg.exclude != [] || cfg.extraFlags != [];
message = ''
Duplicity will fail if you only specify included paths ("Because the
default is to include all files, the expression is redundant. Exiting
because this probably isn't what you meant.")
'';
};
};
}

View file

@ -234,10 +234,33 @@ in
environment.systemPackages = [ cfg.package ];
# create symlinks for the basic directory layout the redmine package expects
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/cache' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/config' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/files' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/plugins' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/public' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/public/plugin_assets' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/public/themes' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/tmp' 0750 ${cfg.user} ${cfg.group} - -"
"d /run/redmine - - - - -"
"d /run/redmine/public - - - - -"
"L+ /run/redmine/config - - - - ${cfg.stateDir}/config"
"L+ /run/redmine/files - - - - ${cfg.stateDir}/files"
"L+ /run/redmine/log - - - - ${cfg.stateDir}/log"
"L+ /run/redmine/plugins - - - - ${cfg.stateDir}/plugins"
"L+ /run/redmine/public/plugin_assets - - - - ${cfg.stateDir}/public/plugin_assets"
"L+ /run/redmine/public/themes - - - - ${cfg.stateDir}/public/themes"
"L+ /run/redmine/tmp - - - - ${cfg.stateDir}/tmp"
];
systemd.services.redmine = {
after = [ "network.target" (if cfg.database.type == "mysql2" then "mysql.service" else "postgresql.service") ];
wantedBy = [ "multi-user.target" ];
environment.HOME = "${cfg.package}/share/redmine";
environment.RAILS_ENV = "production";
environment.RAILS_CACHE = "${cfg.stateDir}/cache";
environment.REDMINE_LANG = "en";
@ -252,28 +275,16 @@ in
subversion
];
preStart = ''
# ensure cache directory exists for db:migrate command
mkdir -p "${cfg.stateDir}/cache"
# create the basic directory layout the redmine package expects
mkdir -p /run/redmine/public
for i in config files log plugins tmp; do
mkdir -p "${cfg.stateDir}/$i"
ln -fs "${cfg.stateDir}/$i" /run/redmine/
done
for i in plugin_assets themes; do
mkdir -p "${cfg.stateDir}/public/$i"
ln -fs "${cfg.stateDir}/public/$i" /run/redmine/public/
done
rm -rf "${cfg.stateDir}/plugins/"*
rm -rf "${cfg.stateDir}/public/themes/"*
# start with a fresh config directory
# the config directory is copied instead of linked as some mutable data is stored in there
rm -rf "${cfg.stateDir}/config/"*
find "${cfg.stateDir}/config" ! -name "secret_token.rb" -type f -exec rm -f {} +
cp -r ${cfg.package}/share/redmine/config.dist/* "${cfg.stateDir}/config/"
chmod -R u+w "${cfg.stateDir}/config"
# link in the application configuration
ln -fs ${configurationYml} "${cfg.stateDir}/config/configuration.yml"
@ -282,7 +293,6 @@ in
# link in all user specified themes
rm -rf "${cfg.stateDir}/public/themes/"*
for theme in ${concatStringsSep " " (mapAttrsToList unpackTheme cfg.themes)}; do
ln -fs $theme/* "${cfg.stateDir}/public/themes"
done
@ -292,16 +302,11 @@ in
# link in all user specified plugins
rm -rf "${cfg.stateDir}/plugins/"*
for plugin in ${concatStringsSep " " (mapAttrsToList unpackPlugin cfg.plugins)}; do
ln -fs $plugin/* "${cfg.stateDir}/plugins/''${plugin##*-redmine-plugin-}"
done
# ensure correct permissions for most files
chmod -R ug+rwX,o-rwx+x "${cfg.stateDir}/"
# handle database.passwordFile & permissions
DBPASS=$(head -n1 ${cfg.database.passwordFile})
cp -f ${databaseYml} "${cfg.stateDir}/config/database.yml"
@ -315,25 +320,13 @@ in
chmod 440 "${cfg.stateDir}/config/initializers/secret_token.rb"
fi
# ensure everything is owned by ${cfg.user}
chown -R ${cfg.user}:${cfg.group} "${cfg.stateDir}"
# execute redmine required commands prior to starting the application
# NOTE: su required in case using mysql socket authentication
/run/wrappers/bin/su -s ${pkgs.bash}/bin/bash -m -l redmine -c '${bundle} exec rake db:migrate'
/run/wrappers/bin/su -s ${pkgs.bash}/bin/bash -m -l redmine -c '${bundle} exec rake redmine:plugins:migrate'
/run/wrappers/bin/su -s ${pkgs.bash}/bin/bash -m -l redmine -c '${bundle} exec rake redmine:load_default_data'
# log files don't exist until after first command has been executed
# correct ownership of files generated by calling exec rake ...
chown -R ${cfg.user}:${cfg.group} "${cfg.stateDir}/log"
${bundle} exec rake db:migrate
${bundle} exec rake redmine:plugins:migrate
${bundle} exec rake redmine:load_default_data
'';
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
Type = "simple";
User = cfg.user;
Group = cfg.group;
@ -348,7 +341,6 @@ in
{ name = "redmine";
group = cfg.group;
home = cfg.stateDir;
createHome = true;
uid = config.ids.uids.redmine;
});

View file

@ -17,7 +17,6 @@ let
'';
mosquittoConf = pkgs.writeText "mosquitto.conf" ''
pid_file /run/mosquitto/pid
acl_file ${aclFile}
persistence true
allow_anonymous ${boolToString cfg.allowAnonymous}
@ -196,15 +195,15 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "forking";
Type = "notify";
NotifyAccess = "main";
User = "mosquitto";
Group = "mosquitto";
RuntimeDirectory = "mosquitto";
WorkingDirectory = cfg.dataDir;
Restart = "on-failure";
ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${mosquittoConf} -d";
ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${mosquittoConf}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
PIDFile = "/run/mosquitto/pid";
};
preStart = ''
rm -f ${cfg.dataDir}/passwd
@ -214,7 +213,7 @@ in
if c.hashedPassword != null then
"echo '${n}:${c.hashedPassword}' >> ${cfg.dataDir}/passwd"
else optionalString (c.password != null)
"${pkgs.mosquitto}/bin/mosquitto_passwd -b ${cfg.dataDir}/passwd ${n} ${c.password}"
"${pkgs.mosquitto}/bin/mosquitto_passwd -b ${cfg.dataDir}/passwd ${n} '${c.password}'"
) cfg.users);
};

View file

@ -491,8 +491,8 @@ in
sslProtocols = mkOption {
type = types.str;
default = "TLSv1.2";
example = "TLSv1 TLSv1.1 TLSv1.2";
default = "TLSv1.2 TLSv1.3";
example = "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3";
description = "Allowed TLS protocol versions.";
};

View file

@ -61,7 +61,9 @@ let
'';
description = ''
Extra lines to append to the <literal>Monitor</literal> section
verbatim.
verbatim. Available options are documented in the MONITOR section in
<citerefentry><refentrytitle>xorg.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>.
'';
};
};
@ -633,7 +635,7 @@ in
environment.pathsToLink = [ "/share/X11" ];
xdg = {
xdg = {
autostart.enable = true;
menus.enable = true;
mime.enable = true;

View file

@ -1,37 +1,37 @@
{ stdenv, python3, pkgconfig, which, libtool, autoconf, automake,
autogen, sqlite, gmp, zlib, fetchzip }:
autogen, sqlite, gmp, zlib, fetchurl, unzip, fetchpatch }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "clightning-${version}";
version = "0.6.3";
version = "0.7.0";
src = fetchzip {
#
# NOTE 0.6.3 release zip was bugged, this zip is a fix provided by the team
# https://github.com/ElementsProject/lightning/issues/2254#issuecomment-453791475
#
# replace url with:
# https://github.com/ElementsProject/lightning/releases/download/v${version}/clightning-v${version}.zip
# for future relases
#
url = "https://github.com/ElementsProject/lightning/files/2752675/clightning-v0.6.3.zip";
sha256 = "0k5pwimwn69pcakiq4a7qnjyf4i8w1jlacwrjazm1sfivr6nfiv6";
src = fetchurl {
url = "https://github.com/ElementsProject/lightning/releases/download/v${version}/clightning-v${version}.zip";
sha256 = "448022c2433cbf19bbd0f726344b0500c0c21ee5cc2291edf6b622f094cb3a15";
};
enableParallelBuilding = true;
nativeBuildInputs = [ autoconf autogen automake libtool pkgconfig which ];
nativeBuildInputs = [ autoconf autogen automake libtool pkgconfig which unzip ];
buildInputs = [ sqlite gmp zlib python3 ];
makeFlags = [ "prefix=$(out) VERSION=v${version}" ];
patches = [
# remove after 0.7.0
(fetchpatch {
name = "fix-0.7.0-build.patch";
url = "https://github.com/ElementsProject/lightning/commit/ffc03d2bc84dc42f745959fbb6c8007cf0a6f701.patch";
sha256 = "1m5fiz3m8k3nk09nldii8ij94bg6fqllqgdbiwj3sy12vihs8c4v";
})
];
configurePhase = ''
./configure --prefix=$out --disable-developer --disable-valgrind
'';
postPatch = ''
echo "" > tools/refresh-submodules.sh
patchShebangs tools/generate-wire.py
'';

View file

@ -11,12 +11,12 @@ with stdenv.lib;
stdenv.mkDerivation rec {
name = "wownero-${version}";
version = "0.5.0.0";
version = "0.5.0.2";
src = fetchFromGitHub {
owner = "wownero";
repo = "wownero";
rev = "v${version}";
sha256 = "1dy9ycabva2z0896al1k2avl9xppkxvm1p2jwmg509ahjl98k3sy";
sha256 = "120cfkl2q8qgl3ajxfkkri9bxlnvmr1mhb1wvcigch1lqyflff1w";
};
nativeBuildInputs = [ cmake pkgconfig git ];

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "bs1770gain-${version}";
version = "0.5.1";
version = "0.5.2";
src = fetchurl {
url = "mirror://sourceforge/bs1770gain/${name}.tar.gz";
sha256 = "0r4fbajgfmnwgl63hcm56f1j8m5f135q6j5jkzdvrrhpcj39yx06";
sha256 = "1p6yz5q7czyf9ard65sp4kawdlkg40cfscr3b24znymmhs3p7rbk";
};
buildInputs = [ ffmpeg sox ];

View file

@ -8,9 +8,9 @@ let
inherit (gnome2) GConf gnome_vfs;
};
stableVersion = {
version = "3.3.1.0"; # "Android Studio 3.3.1"
build = "182.5264788";
sha256Hash = "0fghqkc8pkb7waxclm0qq4nlnsvmv9d3fcj5nnvgbfkjyw032q42";
version = "3.3.2.0"; # "Android Studio 3.3.2"
build = "182.5314842";
sha256Hash = "0smh3d3v8n0isxg7fkls20622gp52f58i2b6wa4a0g8wnvmd6mw2";
};
betaVersion = {
version = "3.4.0.14"; # "Android Studio 3.4 Beta 5"

View file

@ -10,6 +10,7 @@
, withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null
, withCsrc ? true
, srcRepo ? false, autoconf ? null, automake ? null, texinfo ? null
, siteStart ? ./site-start.el
}:
assert (libXft != null) -> libpng != null; # probably a bug
@ -100,7 +101,7 @@ stdenv.mkDerivation rec {
postInstall = ''
mkdir -p $out/share/emacs/site-lisp
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
cp ${siteStart} $out/share/emacs/site-lisp/site-start.el
$out/bin/emacs --batch -f batch-byte-compile $out/share/emacs/site-lisp/site-start.el
rm -rf $out/var

View file

@ -3,13 +3,13 @@
with qt5;
stdenv.mkDerivation rec {
version = "0.9.2";
version = "0.9.4";
name = "featherpad-${version}";
src = fetchFromGitHub {
owner = "tsujan";
repo = "FeatherPad";
rev = "V${version}";
sha256 = "1kpv8x3m4hiz7q9k7qadgbrys5nyzm7v5mhjyk22hawnp98m9x4q";
sha256 = "18zna6rx2qyiplr44wrkvr4avk9yy2l1s23fy3d7ql9f1fq12z3w";
};
nativeBuildInputs = [ qmake pkgconfig qttools ];
buildInputs = [ qtbase qtsvg qtx11extras ];

View file

@ -4,11 +4,11 @@ with stdenv.lib;
stdenv.mkDerivation rec {
name = "cherrytree-${version}";
version = "0.38.7";
version = "0.38.8";
src = fetchurl {
url = "https://www.giuspen.com/software/${name}.tar.xz";
sha256 = "1ls7vz993hj5gd99imlrzahxznfg6fa4n77ikkj79va4csw9b892";
sha256 = "1ns87xl2sgrf3nha4xkhp0xcxlycqszlp6xdrn95lg6vzm0fa8dg";
};
buildInputs = with pythonPackages;

View file

@ -0,0 +1,23 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "filet";
version = "0.1.0";
src = fetchFromGitHub {
owner = "buffet";
repo = "filet";
rev = version;
sha256 = "0f73c4ipc13c7f4xzi3z103kvxpsw9chdfbvk0ahc60clkxy21k3";
};
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
description = "A fucking fucking fast file fucker (afffff)";
homepage = https://github.com/buffet/filet;
license = licenses.mpl20;
platforms = platforms.all;
maintainers = with maintainers; [ buffet ];
};
}

View file

@ -11,11 +11,11 @@ let
];
in
stdenv.mkDerivation rec {
version = "2.1.1";
version = "2.1.2";
name = "hyper-${version}";
src = fetchurl {
url = "https://github.com/zeit/hyper/releases/download/${version}/hyper_${version}_amd64.deb";
sha256 = "1vr4j2vb2wpn8qzgq30l8kfck2an03jwchwywyx4zsl2vz3qp70x";
sha256 = "1n4qlbk7q9zkhhg72mdks95g15xgyrc6ixf882ghvrqghd4zxplm";
};
buildInputs = [ dpkg ];
unpackPhase = ''

View file

@ -1,14 +1,11 @@
{ stdenv, fetchFromGitHub, asciidoc-full, gettext
, gobject-introspection, gtk3, hicolor-icon-theme, libappindicator-gtk3, libnotify, librsvg
, udisks2, wrapGAppsHook
, buildPythonApplication
, docopt
, pygobject3
, pyyaml
, python3Packages
}:
buildPythonApplication rec {
name = "udiskie-${version}";
python3Packages.buildPythonApplication rec {
pname = "udiskie";
version = "1.7.7";
src = fetchFromGitHub {
@ -18,16 +15,27 @@ buildPythonApplication rec {
sha256 = "1j17z26vy44il2s9zgchvhq280vq8ag64ddi35f35b444wz2azlb";
};
buildInputs = [
nativeBuildInputs = [
gettext
asciidoc-full # For building man page.
hicolor-icon-theme
gobject-introspection
wrapGAppsHook
librsvg # required for loading svg icons (udiskie uses svg icons)
];
propagatedBuildInputs = [
gettext gobject-introspection gtk3 libnotify docopt
pygobject3 pyyaml udisks2 libappindicator-gtk3
buildInputs = [
hicolor-icon-theme
librsvg # required for loading svg icons (udiskie uses svg icons)
gobject-introspection
libnotify
gtk3
udisks2
libappindicator-gtk3
];
propagatedBuildInputs = with python3Packages; [
docopt
pygobject3
pyyaml
];
postBuild = "make -C doc";
@ -37,8 +45,14 @@ buildPythonApplication rec {
cp -v doc/udiskie.8 $out/share/man/man8/
'';
# tests require dbusmock
doCheck = false;
checkInputs = with python3Packages; [
nose
keyutils
];
checkPhase = ''
nosetests
'';
meta = with stdenv.lib; {
description = "Removable disk automounter for udisks";

View file

@ -13,10 +13,9 @@ stdenv.mkDerivation rec {
buildInputs = [ removeReferencesTo go ];
GOCACHE = "off";
buildPhase = ''
patchShebangs build.sh
export "GOCACHE=$TMPDIR/go-cache"
./build.sh
'';

View file

@ -97,8 +97,8 @@ in rec {
terraform_0_11-full = terraform_0_11.full;
terraform_0_12 = pluggable (generic {
version = "0.12.0-alpha4";
sha256 = "16cwqxxb19m91d7rx7awri1awz7d8cfnrv0rbql9rbg5qjyqxcp9";
version = "0.12.0-beta1";
sha256 = "0djakf2agbhpfqis4x0lf2i8s1ahvrdyfkcgr6lzp0nsks652rcm";
patches = [ ./provider-path.patch ];
passthru = { inherit plugins; };
});

View file

@ -1,26 +1,42 @@
{ stdenv, fetchgit
, pkgconfig
, pkgconfig, makeWrapper
, qmake, qtbase, qtquickcontrols2, qtmultimedia
, libpulseaudio
# Not mentioned but seems needed
, qtgraphicaleffects
# Unsure but needed by similar
, qtdeclarative, qtsvg
, qtdeclarative
}:
stdenv.mkDerivation rec {
name = "spectral-${version}";
version = "2018-09-24";
let
# Following "borrowed" from yubikey-manager-qt
qmlPath = qmlLib: "${qmlLib}/${qtbase.qtQmlPrefix}";
inherit (stdenv) lib;
qml2ImportPath = lib.concatMapStringsSep ":" qmlPath [
qtbase.bin qtdeclarative.bin qtquickcontrols2.bin qtgraphicaleffects qtmultimedia
];
in stdenv.mkDerivation rec {
pname = "spectral";
version = "2019-03-03";
src = fetchgit {
url = "https://gitlab.com/b0/spectral.git";
rev = "c9d1d6887722860a52b597a0f74d0ce39c8622e1";
sha256 = "1ym8jlqls4lcq5rd81vxw1dni79fc6ph00ip8nsydl6i16fngl4c";
rev = "0473f25d38a064ee4e18203ec16eeae84fea4866";
sha256 = "1n09ginw6g0p42xj3zgxm52dvyyvj5psllv70vx21i50lvkbh9rw";
fetchSubmodules = true;
};
nativeBuildInputs = [ pkgconfig qmake ];
buildInputs = [ qtbase qtquickcontrols2 qtmultimedia qtgraphicaleffects qtdeclarative qtsvg ]
qmakeFlags = [ "CONFIG+=qtquickcompiler" "BUNDLE_FONT=true" ];
postInstall = ''
wrapProgram $out/bin/spectral \
--set QML2_IMPORT_PATH "${qml2ImportPath}"
'';
nativeBuildInputs = [ pkgconfig qmake makeWrapper ];
buildInputs = [ qtbase qtquickcontrols2 qtmultimedia qtgraphicaleffects qtdeclarative ]
++ stdenv.lib.optional stdenv.hostPlatform.isLinux libpulseaudio;
meta = with stdenv.lib; {

View file

@ -2,25 +2,25 @@
buildGoPackage rec {
name = "ipget-${version}";
version = "0.2.5";
version = "0.3.2";
rev = "v${version}";
goPackagePath = "github.com/ipfs/ipget";
extraSrcPaths = [
(fetchgx {
inherit name src;
sha256 = "1d4w8zl5mcppn3d4bl7qdkiqlf8gi3z2a62nygx17bqpa3da8cf3";
sha256 = "07l9hpkhk5phr95zp1l5wd3ii38bw91hy4dlw2rsfbzcsc8bq4s8";
})
];
goDeps = ../../../tools/package-management/gx/deps.nix;
src = fetchFromGitHub {
owner = "ipfs";
repo = "ipget";
inherit rev;
sha256 = "0a8yxqhl469ipiznrgkp3yi1xz3xzcbpx60wabqppq8hccrdiybk";
sha256 = "1ljf5ddvc1p5swmgn4m1ivfj74fykk56myk2r9c4grdjzksf4a15";
};
meta = with stdenv.lib; {

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkgconfig
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, makeWrapper, pkgconfig
, qt4, qmake4Hook, qt5, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
, alsaLib, python
, jackSupport ? false, libjack2 ? null
@ -154,5 +154,12 @@ in {
murmur = server stableSource;
murmur_git = (server gitSource).overrideAttrs (old: {
meta = old.meta // { broken = iceSupport; };
nativeBuildInputs = old.nativeBuildInputs or [] ++ [ makeWrapper ];
installPhase = old.installPhase or "" + ''
wrapProgram $out/bin/murmurd --suffix QT_PLUGIN_PATH : \
${getBin qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}
'';
});
}

View file

@ -2,12 +2,12 @@
libsamplerate, libpulseaudio, libXinerama, gettext, pkgconfig, alsaLib }:
stdenv.mkDerivation rec {
version = "4.1.00";
version = "4.1.01";
pname = "fldigi";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
sha256 = "1hm2n4p3pdd029kizgzwf3zzgsy1m6z83z7rr2kyjhrq2vp5gf0s";
sha256 = "1pznq18rv8q7qflpnnk6wvbwfqvhvyx1a77jlp3kzjh19pjaqldy";
};
buildInputs = [ libXinerama gettext hamlib fltk13 libjpeg libpng portaudio

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "igv-${version}";
version = "2.4.17";
version = "2.4.19";
src = fetchurl {
url = "https://data.broadinstitute.org/igv/projects/downloads/2.4/IGV_${version}.zip";
sha256 = "02zl0r1yhyllh000cad6pjk0ic0xm6l05jzkglsf8wdz17nh15nr";
sha256 = "048dgrhxcb854d24kyjkqz12bw04bsv49i5jawb75yzkswwfkb0z";
};
buildInputs = [ unzip jre ];

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "star-${version}";
version = "2.7.0a";
version = "2.7.0c";
src = fetchFromGitHub {
repo = "STAR";
owner = "alexdobin";
rev = version;
sha256 = "1yx28gra6gqdx1ps5y8mpdinsn8r0dhsc2m3gcvjfrk71i9yhd6l";
sha256 = "0r5jcckr45f71jwhz8xazi1w6kfhszq3y6r7f6zl9963ms1q1gfv";
};
sourceRoot = "source/source";

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "gtkwave-${version}";
version = "3.3.98";
version = "3.3.99";
src = fetchurl {
url = "mirror://sourceforge/gtkwave/${name}.tar.gz";
sha256 = "1xi2b9yck8fagnjhnhhwrhz5rfvrs2h2m6m64m210m5xnfzbp9pg";
sha256 = "0lc4y2vizrbxldjk5yw2i4y7pyprjdjqx3iafzjfnin694zp2630";
};
nativeBuildInputs = [ pkgconfig ];

View file

@ -1,13 +1,13 @@
{ stdenv, fetchurl, gmp, zlib }:
stdenv.mkDerivation rec {
version = "4.2.0";
version = "4.2.1";
name = "form-${version}";
# This tarball is released by author, it is not downloaded from tag, so can't use fetchFromGitHub
src = fetchurl {
url = "https://github.com/vermaseren/form/releases/download/v4.2.0/form-4.2.0.tar.gz";
sha256 = "19528aphn4hvm151lyyhd7wz0bp2s3rla8jv6s7d8jwfp5ljzysm";
url = "https://github.com/vermaseren/form/releases/download/v4.2.1/form-4.2.1.tar.gz";
sha256 = "0a0smc10gm85vxd85942n5azy88w5qs5avbqrw0lw0yb9injswpj";
};
buildInputs = [ gmp zlib ];

View file

@ -0,0 +1,22 @@
diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py
index 689e5a23b9..4e16fe3a8d 100644
--- a/src/sage/misc/package.py
+++ b/src/sage/misc/package.py
@@ -142,9 +142,14 @@ def pip_installed_packages():
sage: d['beautifulsoup'] # optional - beautifulsoup
u'...'
"""
- proc = subprocess.Popen(["pip", "list", "--no-index", "--format", "json"], stdout=subprocess.PIPE)
- stdout = proc.communicate()[0].decode()
- return {package['name'].lower():package['version'] for package in json.loads(stdout)}
+ with open(os.devnull, 'w') as devnull:
+ proc = subprocess.Popen(
+ ["pip", "list", "--no-index", "--format", "json"],
+ stdout=subprocess.PIPE,
+ stderr=devnull,
+ )
+ stdout = proc.communicate()[0].decode()
+ return {package['name'].lower():package['version'] for package in json.loads(stdout)}
def list_packages(*pkg_types, **opts):
r"""

View file

@ -112,6 +112,9 @@ stdenv.mkDerivation rec {
url = "https://git.sagemath.org/sage.git/patch?id=a05b6b038e1571ab15464e98f76d1927c0c3fd12";
sha256 = "05yq97pq84xi60wb1p9skrad5h5x770gq98ll4frr7hvvmlwsf58";
})
# https://trac.sagemath.org/ticket/27405
./patches/ignore-pip-deprecation.patch
];
patches = nixPatches ++ packageUpgradePatches;

View file

@ -65,11 +65,13 @@ buildPythonPackage rec {
perl
jupyter_core
pkg-config
pip # needed to query installed packages
];
buildInputs = [
gd
readline
iml
];
propagatedBuildInputs = [

View file

@ -104,7 +104,7 @@ stdenv.mkDerivation rec {
scheduling on distributed computing platforms ranging from simple
network of workstations to Computational Grids.
'';
homepage = http://simgrid.gforge.inria.fr/;
homepage = https://simgrid.org/;
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ mickours ];
platforms = ["x86_64-linux"];

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "git-secrets-${version}";
version = "1.2.1";
version = "1.3.0";
src = fetchFromGitHub {
owner = "awslabs";
repo = "git-secrets";
rev = "${version}";
sha256 = "14jsm4ks3k5d9iq3jr23829izw040pqpmv7dz8fhmvx6qz8fybzg";
sha256 = "10lnxg0q855zi3d6804ivlrn6dc817kilzdh05mmz8a0ccvm2qc7";
};
nativeBuildInputs = [ makeWrapper ];

View file

@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
buildInputs = [ ruby bundler go ];
GOCACHE="$TMPDIR/go-cache";
patches = [ ./remove-hardcoded-locations.patch ];
installPhase = ''

View file

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
buildInputs = [ git go ];
makeFlags = [ "PREFIX=$(out)" "VERSION=${version}" ];
makeFlags = [ "PREFIX=$(out)" "VERSION=${version}" "GOCACHE=$(TMPDIR)/go-cache" ];
meta = with stdenv.lib; {
homepage = http://www.gitlab.com/;

View file

@ -7,13 +7,13 @@ with stdenv.lib;
buildGoPackage rec {
name = "gogs-${version}";
version = "0.11.66";
version = "0.11.86";
src = fetchFromGitHub {
owner = "gogs";
repo = "gogs";
rev = "v${version}";
sha256 = "1b9ilk4xlsllsj5pzmxwsz4a1zvgd06a8mi9ni9hbvmfl3w8xf28";
sha256 = "0l8mwy0cyy3cdxqinf8ydb35kf7c8pj09xrhpr7rr7lldnvczabw";
};
patches = [ ./static-root-path.patch ];

View file

@ -100,6 +100,7 @@ rec {
export AUTO_GOPATH=1
export DOCKER_GITCOMMIT="${rev}"
export VERSION="${version}"
export GOCACHE="$TMPDIR/go-cache"
./hack/make.sh dynbinary
cd -
'') + ''

View file

@ -48,6 +48,7 @@ in stdenv.mkDerivation rec {
preBuild = ''
export BUILDDIR
export GOCACHE="$TMPDIR/go-cache"
'';
installPhase = ''

View file

@ -1,12 +1,12 @@
{ stdenv, fetchFromGitHub, makeWrapper, nx-libs, xorg }:
stdenv.mkDerivation rec {
name = "x11docker-${version}";
version = "5.4.1";
version = "5.4.4";
src = fetchFromGitHub {
owner = "mviereck";
repo = "x11docker";
rev = "v${version}";
sha256 = "0fcdr8i3crf4cina41h030q2jf5zvafll97iff129dl3sb27jnvi";
sha256 = "1p45dyd1zfjxlawsy190q71hwl083f90ryaslslhxsadsi9m64dq";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ nx-libs xorg.xhost xorg.xinit ];

View file

@ -10,13 +10,13 @@
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "sway";
version = "1.0-rc4";
version = "1.0-rc5";
src = fetchFromGitHub {
owner = "swaywm";
repo = "sway";
rev = version;
sha256 = "1f0mvf48dvsivdd850r1gd2h90cbn62qflwiff6x2addn868bvxa";
sha256 = "1jkacibmxy9rpq5mxnq7bkwcy0c592zk4vf20j5qbbljp9h7c87i";
};
postPatch = ''

View file

@ -121,21 +121,25 @@ stdenv.mkDerivation {
siteStart="$out/share/emacs/site-lisp/site-start.el"
siteStartByteCompiled="$siteStart"c
subdirs="$out/share/emacs/site-lisp/subdirs.el"
subdirsByteCompiled="$subdirs"c
# A dependency may have brought the original siteStart, delete it and
# create our own
# A dependency may have brought the original siteStart or subdirs, delete
# it and create our own
# Begin the new site-start.el by loading the original, which sets some
# NixOS-specific paths. Paths are searched in the reverse of the order
# they are specified in, so user and system profile paths are searched last.
rm -f $siteStart $siteStartByteCompiled
rm -f $siteStart $siteStartByteCompiled $subdirs $subdirsByteCompiled
cat >"$siteStart" <<EOF
(load-file "$emacs/share/emacs/site-lisp/site-start.el")
(add-to-list 'load-path "$out/share/emacs/site-lisp")
(add-to-list 'exec-path "$out/bin")
EOF
# Link subdirs.el from the emacs distribution
ln -s $emacs/share/emacs/site-lisp/subdirs.el -T $subdirs
# Byte-compiling improves start-up time only slightly, but costs nothing.
$emacs/bin/emacs --batch -f batch-byte-compile "$siteStart"
$emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs"
'';
phases = [ "installPhase" ];

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "emojione-${version}";
version = "1.3";
version = "1.4";
src = fetchFromGitHub {
owner = "eosrei";
repo = "emojione-color-font";
rev = "v${version}";
sha256 = "0hgs661g1j91lkafhrfx5ix7ymarh5bzcx34r2id6jl7dc3j41l3";
sha256 = "1781kxfbhnvylypbkwxc3mx6hi0gcjisfjr9cf0jdz4d1zkf09b3";
};
preBuild = ''

View file

@ -1,15 +1,15 @@
{ stdenv, fetchzip }:
let
version = "10.0.06";
version = "11.0.03";
in fetchzip rec {
name = "unifont_upper-${version}";
url = "http://unifoundry.com/pub/unifont-${version}/font-builds/${name}.ttf";
url = "mirror://gnu/unifont/unifont-${version}/${name}.ttf";
postFetch = "install -Dm644 $downloadedFile $out/share/fonts/truetype/unifont_upper.ttf";
sha256 = "13x5z8iyh9xz5fllcy89yinnz1iy16a2pjf3vip66nz10sq8crlr";
sha256 = "1gfjv3n9pxwzla4pil518a80ihn5wz0c7d4mhfw0dj2n5fwgpdmr";
meta = with stdenv.lib; {
description = "Unicode font for glyphs above the Unicode Basic Multilingual Plane";

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "zafiro-icons";
version = "0.8.4";
version = "0.8.7";
src = fetchFromGitHub {
owner = "zayronxio";
repo = pname;
rev = "v${version}";
sha256 = "1jdijiccazn2g42x1w1m4hl94ach9b2kl3rwb0mpy7ykdzmj6vj0";
sha256 = "09zdaly9g11k6p36xdd7skgl78s6j78hn3gy1jnpsxh0136md89h";
};
nativeBuildInputs = [ gtk3 ];

View file

@ -44,6 +44,7 @@ buildGoPackage rec {
'';
buildPhase = ''
export GOCACHE="$TMPDIR/go-cache";
make -C go/src/${goPackagePath}
'';

View file

@ -1,13 +1,19 @@
{ pkgs, makeScope, libsForQt5 }:
{ pkgs, makeScope, libsForQt5, go_1_11 }:
let
packages = self: with self; {
updateScript = callPackage ./update.nix { };
dbus-factory = callPackage ./dbus-factory { };
dde-api = callPackage ./dde-api { };
dde-api = callPackage ./dde-api {
# XXX: the build is finding references to Go when compiled with go v1.12
go = go_1_11;
};
dde-calendar = callPackage ./dde-calendar { };
dde-daemon = callPackage ./dde-daemon { };
dde-daemon = callPackage ./dde-daemon {
# XXX: the build is finding references to Go when compiled with go v1.12
go = go_1_11;
};
dde-qt-dbus-factory = callPackage ./dde-qt-dbus-factory { };
dde-session-ui = callPackage ./dde-session-ui { };
deepin-desktop-base = callPackage ./deepin-desktop-base { };

View file

@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
makeFlags = [
"PREFIX=$(out)"
"GOCACHE=off"
"GOCACHE=$TMPDIR/go-cache"
];
passthru.updateScript = deepin.updateScript { inherit name; };

View file

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
makeFlags = [
"PREFIX=$(out)"
"GOCACHE=off"
"GOCACHE=$TMPDIR/go-cache"
];
passthru.updateScript = deepin.updateScript { inherit name; };

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "gnome-shell-dash-to-dock-${version}";
version = "64";
version = "65";
src = fetchFromGitHub {
owner = "micheleg";
repo = "dash-to-dock";
rev = "extensions.gnome.org-v" + version;
sha256 = "1cfkdi4raim50wif47fly4c0lzyamysv40qd5ppr1h824bamzxcm";
sha256 = "0ln49l9s0yfl30pi77pz7xlmh63l9vjppi863kry5lay10dsvz47";
};
nativeBuildInputs = [

View file

@ -0,0 +1,28 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-sound-output-device-chooser";
version = "unstable-2018-12-30";
src = fetchFromGitHub {
owner = "kgshank";
repo = "gse-sound-output-device-chooser";
rev = "3ec8aded413034e7943eb36ee509405873ccc575";
sha256 = "1svc3d3pr2j7fr0660a0zj2n320vld8zkkddf5iphbdwivmkrh3n";
};
dontBuild = true;
uuid = "sound-output-device-chooser@kgshank.net";
installPhase = ''
mkdir -p $out/share/gnome-shell/extensions
cp -r ${uuid} $out/share/gnome-shell/extensions
'';
meta = with stdenv.lib; {
description = "GNOME Shell extension adding audio device chooser to panel";
license = licenses.gpl3;
maintainers = with maintainers; [ jtojnar ];
homepage = https://github.com/kgshank/gse-sound-output-device-chooser;
};
}

View file

@ -0,0 +1,28 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "gnome-shell-extension-window-corner-preview";
version = "unstable-2019-02-27";
src = fetchFromGitHub {
owner = "medenagan";
repo = "window-corner-preview";
rev = "9c1e97c7f7ecd530abac572050f6ec89c1ac7571";
sha256 = "12yx3zfnqkpy9g8mhniw02q61axgb14aqiyj6pdfcdmd6hrgsmz6";
};
dontBuild = true;
uuid = "window-corner-preview@fabiomereu.it";
installPhase = ''
mkdir -p $out/share/gnome-shell/extensions
cp -r ${uuid} $out/share/gnome-shell/extensions
'';
meta = with stdenv.lib; {
description = "GNOME Shell extension showing a video preview on the corner of the screen";
license = licenses.mit;
maintainers = with maintainers; [ jtojnar ];
homepage = https://github.com/medenagan/window-corner-preview;
};
}

View file

@ -6,7 +6,7 @@
stdenv.mkDerivation rec {
pname = "calendar";
version = "4.2.3";
version = "5.0";
name = "elementary-${pname}-${version}";
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "100wy8lkp4nrxj57ywyx44ckm3k7n8h5l6av92hr5pyx8fxn9m48";
sha256 = "0yiis5ig98gjw4s2qh8lppkdmv1cgi6qchxqncsjdki7yxyyni35";
};
passthru = {

View file

@ -2,7 +2,7 @@
stdenv.mkDerivation rec {
pname = "stylesheet";
version = "5.2.1";
version = "5.2.2";
name = "elementary-gtk-theme-${version}";
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "03l8m87f7z25svxk0hhcqnn4qnnqvasr5qwzq3s87lx25gwjml29";
sha256 = "10b44dz7ndrckvq25pdxav59rzjcjbcpxb64z4nz62rfshvnrn8q";
};
passthru = {

View file

@ -3,11 +3,11 @@
stdenvNoCC.mkDerivation rec {
name = "fasm-bin-${version}";
version = "1.73.08";
version = "1.73.09";
src = fetchurl {
url = "https://flatassembler.net/fasm-${version}.tgz";
sha256 = "1l4my3fran06h5jiygswx4fsj53dvpfgg9ksfbdzsdg20r672997";
sha256 = "197bcj9aa5wpkvrlaafc1smxjss0fwdspq5fwhwgyy9cc7z5g0ym";
};
installPhase = ''

View file

@ -0,0 +1,244 @@
{ stdenv, fetchurl, tzdata, iana-etc, go_bootstrap, runCommand, writeScriptBin
, perl, which, pkgconfig, patch, procps, pcre, cacert, llvm, Security, Foundation
, mailcap, runtimeShell
, buildPackages, targetPackages }:
let
inherit (stdenv.lib) optionals optionalString;
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out
cp -rf ${buildPackages.go_bootstrap}/* $out/
chmod -R u+w $out
find $out -name "*.c" -delete
cp -rf $out/bin/* $out/share/go/bin/
'';
goarch = platform: {
"i686" = "386";
"x86_64" = "amd64";
"aarch64" = "arm64";
"arm" = "arm";
"armv5tel" = "arm";
"armv6l" = "arm";
"armv7l" = "arm";
}.${platform.parsed.cpu.name} or (throw "Unsupported system");
in
stdenv.mkDerivation rec {
name = "go-${version}";
version = "1.12";
src = fetchurl {
url = "https://dl.google.com/go/go${version}.src.tar.gz";
sha256 = "1wl8kq21fbzmv4plnaza5acz8dhbaaq6smjzk3r6cf3l6qrkvi09";
};
# perl is used for testing go vet
nativeBuildInputs = [ perl which pkgconfig patch procps ];
buildInputs = [ cacert pcre ]
++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];
hardeningDisable = [ "all" ];
prePatch = ''
patchShebangs ./ # replace /bin/bash
# This source produces shell script at run time,
# and thus it is not corrected by patchShebangs.
substituteInPlace misc/cgo/testcarchive/carchive_test.go \
--replace '#!/usr/bin/env bash' '#!${runtimeShell}'
# Patch the mimetype database location which is missing on NixOS.
substituteInPlace src/mime/type_unix.go \
--replace '/etc/mime.types' '${mailcap}/etc/mime.types'
# Disabling the 'os/http/net' tests (they want files not available in
# chroot builds)
rm src/net/{listen,parse}_test.go
rm src/syscall/exec_linux_test.go
# !!! substituteInPlace does not seems to be effective.
# The os test wants to read files in an existing path. Just don't let it be /usr/bin.
sed -i 's,/usr/bin,'"`pwd`", src/os/os_test.go
sed -i 's,/bin/pwd,'"`type -P pwd`", src/os/os_test.go
# Disable the unix socket test
sed -i '/TestShutdownUnix/areturn' src/net/net_test.go
# Disable the hostname test
sed -i '/TestHostname/areturn' src/os/os_test.go
# ParseInLocation fails the test
sed -i '/TestParseInSydney/areturn' src/time/format_test.go
# Remove the api check as it never worked
sed -i '/src\/cmd\/api\/run.go/ireturn nil' src/cmd/dist/test.go
# Remove the coverage test as we have removed this utility
sed -i '/TestCoverageWithCgo/areturn' src/cmd/go/go_test.go
# Remove the timezone naming test
sed -i '/TestLoadFixed/areturn' src/time/time_test.go
# Remove disable setgid test
sed -i '/TestRespectSetgidDir/areturn' src/cmd/go/internal/work/build_test.go
# Remove cert tests that conflict with NixOS's cert resolution
sed -i '/TestEnvVars/areturn' src/crypto/x509/root_unix_test.go
# TestWritevError hangs sometimes
sed -i '/TestWritevError/areturn' src/net/writev_test.go
# TestVariousDeadlines fails sometimes
sed -i '/TestVariousDeadlines/areturn' src/net/timeout_test.go
sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
sed -i 's,/etc/services,${iana-etc}/etc/services,' src/net/port_unix.go
# Disable cgo lookup tests not works, they depend on resolver
rm src/net/cgo_unix_test.go
'' + optionalString stdenv.isLinux ''
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go
'' + optionalString stdenv.isAarch32 ''
echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash
'' + optionalString stdenv.isDarwin ''
substituteInPlace src/race.bash --replace \
"sysctl machdep.cpu.extfeatures | grep -qv EM64T" true
sed -i 's,strings.Contains(.*sysctl.*,true {,' src/cmd/dist/util.go
sed -i 's,"/etc","'"$TMPDIR"'",' src/os/os_test.go
sed -i 's,/_go_os_test,'"$TMPDIR"'/_go_os_test,' src/os/path_test.go
sed -i '/TestChdirAndGetwd/areturn' src/os/os_test.go
sed -i '/TestCredentialNoSetGroups/areturn' src/os/exec/exec_posix_test.go
sed -i '/TestRead0/areturn' src/os/os_test.go
sed -i '/TestSystemRoots/areturn' src/crypto/x509/root_darwin_test.go
sed -i '/TestGoInstallRebuildsStalePackagesInOtherGOPATH/areturn' src/cmd/go/go_test.go
sed -i '/TestBuildDashIInstallsDependencies/areturn' src/cmd/go/go_test.go
sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
# TestCurrent fails because Current is not implemented on Darwin
sed -i 's/TestCurrent/testCurrent/g' src/os/user/user_test.go
sed -i 's/TestLookup/testLookup/g' src/os/user/user_test.go
touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
'';
patches = [
./remove-tools-1.11.patch
./remove-test-pie.patch
./creds-test.patch
./go-1.9-skip-flaky-19608.patch
./go-1.9-skip-flaky-20072.patch
./skip-external-network-tests.patch
./skip-nohup-tests.patch
# breaks under load: https://github.com/golang/go/issues/25628
./skip-test-extra-files-on-386.patch
];
postPatch = ''
find . -name '*.orig' -exec rm {} ';'
'' + optionalString stdenv.isDarwin ''
echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
'';
GOOS = stdenv.targetPlatform.parsed.kernel.name;
GOARCH = goarch stdenv.targetPlatform;
# GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
# Go will nevertheless build a for host system that we will copy over in
# the install phase.
GOHOSTOS = stdenv.buildPlatform.parsed.kernel.name;
GOHOSTARCH = goarch stdenv.buildPlatform;
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
# to be different from CC/CXX
CC_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then
"${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc"
else if (stdenv.buildPlatform != stdenv.targetPlatform) then
"${stdenv.cc.targetPrefix}cc"
else
null;
CXX_FOR_TARGET = if (stdenv.hostPlatform != stdenv.targetPlatform) then
"${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++"
else if (stdenv.buildPlatform != stdenv.targetPlatform) then
"${stdenv.cc.targetPrefix}c++"
else
null;
GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
GO386 = 387; # from Arch: don't assume sse2 on i686
CGO_ENABLED = 1;
# Hopefully avoids test timeouts on Hydra
GO_TEST_TIMEOUT_SCALE = 3;
# Indicate that we are running on build infrastructure
# Some tests assume things like home directories and users exists
GO_BUILDER_NAME = "nix";
GOROOT_BOOTSTRAP="${goBootstrap}/share/go";
postConfigure = ''
export GOCACHE=$TMPDIR/go-cache
# this is compiled into the binary
export GOROOT_FINAL=$out/share/go
export PATH=$(pwd)/bin:$PATH
# Independent from host/target, CC should produce code for the building system.
export CC=${buildPackages.stdenv.cc}/bin/cc
ulimit -a
'';
postBuild = ''
(cd src && ./make.bash)
'';
doCheck = stdenv.hostPlatform == stdenv.targetPlatform;
checkPhase = ''
runHook preCheck
(cd src && HOME=$TMPDIR GOCACHE=$TMPDIR/go-cache ./run.bash --no-rebuild)
runHook postCheck
'';
preInstall = ''
rm -r pkg/{bootstrap,obj}
# Contains the wrong perl shebang when cross compiling,
# since it is not used for anything we can deleted as well.
rm src/regexp/syntax/make_perl_groups.pl
'' + (if (stdenv.buildPlatform != stdenv.hostPlatform) then ''
mv bin/*_*/* bin
rmdir bin/*_*
${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
rm -rf pkg/${GOHOSTOS}_${GOHOSTARCH} pkg/tool/${GOHOSTOS}_${GOHOSTARCH}
''}
'' else if (stdenv.hostPlatform != stdenv.targetPlatform) then ''
rm -rf bin/*_*
${optionalString (!(GOHOSTARCH == GOARCH && GOOS == GOHOSTOS)) ''
rm -rf pkg/${GOOS}_${GOARCH} pkg/tool/${GOOS}_${GOARCH}
''}
'' else "");
installPhase = ''
runHook preInstall
mkdir -p $GOROOT_FINAL
cp -a bin pkg src lib misc api doc $GOROOT_FINAL
ln -s $GOROOT_FINAL/bin $out/bin
runHook postInstall
'';
setupHook = ./setup-hook.sh;
disallowedReferences = [ goBootstrap ];
meta = with stdenv.lib; {
branch = "1.12";
homepage = http://golang.org/;
description = "The Go Programming language";
license = licenses.bsd3;
maintainers = with maintainers; [ cstrahan orivej velovix mic92 ];
platforms = platforms.linux ++ platforms.darwin;
};
}

View file

@ -0,0 +1,19 @@
{ runCommand, stdenv, llvm, lld, version }:
let
prefix =
if stdenv.hostPlatform != stdenv.targetPlatform
then "${stdenv.targetPlatform.config}-"
else "";
in runCommand "llvm-binutils-${version}" { preferLocalBuild = true; } ''
mkdir -p $out/bin
for prog in ${lld}/bin/*; do
ln -s $prog $out/bin/${prefix}$(basename $prog)
done
for prog in ${llvm}/bin/*; do
ln -s $prog $out/bin/${prefix}$(echo $(basename $prog) | sed -e "s|llvm-||")
ln -sf $prog $out/bin/${prefix}$(basename $prog)
done
rm -f $out/bin/${prefix}cat
ln -s ${lld}/bin/lld $out/bin/${prefix}ld
''

View file

@ -0,0 +1,112 @@
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python
, fixDarwinDylibNames
, enableManpages ? false
, enablePolly ? false # TODO: get this info from llvm (passthru?)
}:
let
self = stdenv.mkDerivation ({
name = "clang-${version}";
unpackPhase = ''
unpackFile ${fetch "cfe" "0z5si83w0i3l445c7624204mxsv82naps96icnv7v20s6njbsbsi"}
mv cfe-${version}* clang
sourceRoot=$PWD/clang
unpackFile ${clang-tools-extra_src}
mv clang-tools-extra-* $sourceRoot/tools/extra
'';
nativeBuildInputs = [ cmake python ]
++ stdenv.lib.optional enableManpages python.pkgs.sphinx;
buildInputs = [ libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"
] ++ stdenv.lib.optionals enableManpages [
"-DCLANG_INCLUDE_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ stdenv.lib.optionals enablePolly [
"-DWITH_POLLY=ON"
"-DLINK_POLLY_INTO_TOOLS=ON"
];
patches = [ ./purity.patch ];
postPatch = ''
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
lib/Driver/ToolChains/*.cpp
# Patch for standalone doc building
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
'' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace tools/extra/clangd/CMakeLists.txt \
--replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
'';
outputs = [ "out" "lib" "python" ];
# Clang expects to find LLVMgold in its own prefix
postInstall = ''
if [ -e ${llvm}/lib/LLVMgold.so ]; then
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
fi
ln -sv $out/bin/clang $out/bin/cpp
# Move libclang to 'lib' output
moveToOutput "lib/libclang.*" "$lib"
substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
--replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang."
mkdir -p $python/bin $python/share/clang/
mv $out/bin/{git-clang-format,scan-view} $python/bin
if [ -e $out/bin/set-xcode-analyzer ]; then
mv $out/bin/set-xcode-analyzer $python/bin
fi
mv $out/share/clang/*.py $python/share/clang
rm $out/bin/c-index-test
'';
enableParallelBuilding = true;
passthru = {
isClang = true;
inherit llvm;
} // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) {
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.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;
};
} // stdenv.lib.optionalAttrs enableManpages {
name = "clang-manpages-${version}";
buildPhase = ''
make docs-clang-man
'';
installPhase = ''
mkdir -p $out/share/man/man1
# Manually install clang manpage
cp docs/man/*.1 $out/share/man/man1/
'';
outputs = [ "out" ];
doCheck = false;
meta.description = "man page for Clang ${version}";
});
in self

View file

@ -0,0 +1,30 @@
From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Thu, 18 May 2017 11:56:12 -0500
Subject: [PATCH] "purity" patch for 5.0
---
lib/Driver/ToolChains/Gnu.cpp | 7 -------
1 file changed, 7 deletions(-)
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
index fe3c0191bb..c6a482bece 100644
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -494,13 +494,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (!Args.hasArg(options::OPT_static)) {
if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back("-export-dynamic");
-
- if (!Args.hasArg(options::OPT_shared)) {
- const std::string Loader =
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
- CmdArgs.push_back("-dynamic-linker");
- CmdArgs.push_back(Args.MakeArgString(Loader));
- }
}
CmdArgs.push_back("-o");
--
2.11.0

View file

@ -0,0 +1,74 @@
commit f00c7bccf7955b7dfbb4859fd9019e9eb3349f2d
Author: Tobias Mayer <tobim@fastmail.fm>
Date: Wed Feb 13 12:44:17 2019 +0100
Provide clock_gettime for xray on macos < 10.12
diff --git a/lib/xray/xray_basic_logging.cc b/lib/xray/xray_basic_logging.cc
index a46c151af..38aea6932 100644
--- a/lib/xray/xray_basic_logging.cc
+++ b/lib/xray/xray_basic_logging.cc
@@ -36,6 +36,29 @@
#include "xray_tsc.h"
#include "xray_utils.h"
+#if __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+enum clockid_t {
+ CLOCK_MONOTONIC = REALTIME_CLOCK,
+ CLOCK_REALTIME = REALTIME_CLOCK
+};
+
+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
+ if (ts != NULL) {
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), clock_id, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+ return 0;
+ }
+ return -1;
+}
+#endif
+
namespace __xray {
SpinMutex LogMutex;
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
index 4b308b27f..1d044c8fd 100644
--- a/lib/xray/xray_fdr_logging.cc
+++ b/lib/xray/xray_fdr_logging.cc
@@ -38,6 +38,29 @@
#include "xray_tsc.h"
#include "xray_utils.h"
+#if __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+enum clockid_t {
+ CLOCK_MONOTONIC = REALTIME_CLOCK,
+ CLOCK_REALTIME = REALTIME_CLOCK
+};
+
+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
+ if (ts != NULL) {
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), clock_id, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+ return 0;
+ }
+ return -1;
+}
+#endif
+
namespace __xray {
atomic_sint32_t LoggingStatus = {XRayLogInitStatus::XRAY_LOG_UNINITIALIZED};

View file

@ -0,0 +1,33 @@
From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Tue, 19 Sep 2017 13:13:06 -0500
Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
needs it
---
cmake/Modules/AddCompilerRT.cmake | 8 ------
test/asan/CMakeLists.txt | 52 ---------------------------------------
test/tsan/CMakeLists.txt | 47 -----------------------------------
3 files changed, 107 deletions(-)
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index bc5fb9ff7..b64eb4246 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type)
set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
endif()
- if(APPLE)
- # Ad-hoc sign the dylibs
- add_custom_command(TARGET ${libname}
- POST_BUILD
- COMMAND codesign --sign - $<TARGET_FILE:${libname}>
- WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
- )
- endif()
endif()
install(TARGETS ${libname}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
2.14.1

View file

@ -0,0 +1,61 @@
{ stdenv, version, fetch, cmake, python, llvm, libcxxabi }:
stdenv.mkDerivation rec {
name = "compiler-rt-${version}";
inherit version;
src = fetch "compiler-rt" "1rxa1rcn7r3yfn9cj0sx5gd90kslbd13q080rdyqb6jr9a9i1avb";
nativeBuildInputs = [ cmake python llvm ];
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
cmakeFlags = [
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DCMAKE_C_FLAGS=-nodefaultlibs"
"-DCMAKE_CXX_COMPILER_WORKS=ON"
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
"-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
"-DCOMPILER_RT_BUILD_PROFILE=OFF"
"-DCOMPILER_RT_BAREMETAL_BUILD=ON"
"-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
];
outputs = [ "out" "dev" ];
patches = [
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin ./compiler-rt-clock_gettime.patch;
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
'' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
substituteInPlace lib/builtins/int_util.c \
--replace "#include <stdlib.h>" ""
substituteInPlace lib/builtins/clear_cache.c \
--replace "#include <assert.h>" ""
substituteInPlace lib/builtins/cpu_model.c \
--replace "#include <assert.h>" ""
'';
# Hack around weird upsream RPATH bug
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
ln -s "$out/lib"/*/* "$out/lib"
'' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
ln -s $out/lib/*/cclang_rt.crtend-*.o $out/lib/crtend.o
ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
'';
enableParallelBuilding = true;
}

View file

@ -0,0 +1,595 @@
Get crtbegin and crtend without compiler GCC! PR is at https://reviews.llvm.org/D28791
Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -29,6 +29,8 @@
option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON)
mark_as_advanced(COMPILER_RT_BUILD_BUILTINS)
+option(COMPILER_RT_BUILD_CRT "Build crtbegin.o/crtend.o" ON)
+mark_as_advanced(COMPILER_RT_BUILD_CRT)
option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON)
mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS)
option(COMPILER_RT_BUILD_XRAY "Build xray" ON)
Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake
===================================================================
--- compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -132,7 +132,7 @@
# Adds static or shared runtime for a list of architectures and operating
# systems and puts it in the proper directory in the build and install trees.
# add_compiler_rt_runtime(<name>
-# {STATIC|SHARED}
+# {OBJECT|STATIC|SHARED}
# ARCHS <architectures>
# OS <os list>
# SOURCES <source files>
@@ -144,8 +144,8 @@
# PARENT_TARGET <convenience parent target>
# ADDITIONAL_HEADERS <header files>)
function(add_compiler_rt_runtime name type)
- if(NOT type MATCHES "^(STATIC|SHARED)$")
- message(FATAL_ERROR "type argument must be STATIC or SHARED")
+ if(NOT type MATCHES "^(OBJECT|STATIC|SHARED)$")
+ message(FATAL_ERROR "type argument must be OBJECT, STATIC or SHARED")
return()
endif()
cmake_parse_arguments(LIB
@@ -204,7 +204,10 @@
message(FATAL_ERROR "Architecture ${arch} can't be targeted")
return()
endif()
- if(type STREQUAL "STATIC")
+ if(type STREQUAL "OBJECT")
+ set(libname "${name}-${arch}")
+ set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX})
+ elseif(type STREQUAL "STATIC")
set(libname "${name}-${arch}")
set_output_name(output_name_${libname} ${name} ${arch})
else()
@@ -270,12 +273,34 @@
set(COMPONENT_OPTION COMPONENT ${libname})
endif()
- add_library(${libname} ${type} ${sources_${libname}})
- set_target_compile_flags(${libname} ${extra_cflags_${libname}})
- set_target_link_flags(${libname} ${extra_link_flags_${libname}})
- set_property(TARGET ${libname} APPEND PROPERTY
- COMPILE_DEFINITIONS ${LIB_DEFS})
- set_target_output_directories(${libname} ${output_dir_${libname}})
+ if(type STREQUAL "OBJECT")
+ string(TOUPPER ${CMAKE_BUILD_TYPE} config)
+ get_property(cflags SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS)
+ separate_arguments(cflags)
+ add_custom_command(
+ OUTPUT ${output_dir_${libname}}/${libname}.o
+ COMMAND ${CMAKE_C_COMPILER} ${sources_${libname}} ${cflags} ${extra_cflags_${libname}} -c -o ${output_dir_${libname}}/${libname}.o
+ DEPENDS ${sources_${libname}}
+ COMMENT "Building C object ${libname}.o")
+ add_custom_target(${libname} DEPENDS ${output_dir_${libname}}/${libname}.o)
+ install(FILES ${output_dir_${libname}}/${libname}.o
+ DESTINATION ${install_dir_${libname}}
+ ${COMPONENT_OPTION})
+ else()
+ add_library(${libname} ${type} ${sources_${libname}})
+ set_target_compile_flags(${libname} ${extra_cflags_${libname}})
+ set_target_link_flags(${libname} ${extra_link_flags_${libname}})
+ set_property(TARGET ${libname} APPEND PROPERTY
+ COMPILE_DEFINITIONS ${LIB_DEFS})
+ set_target_output_directories(${libname} ${output_dir_${libname}})
+ install(TARGETS ${libname}
+ ARCHIVE DESTINATION ${install_dir_${libname}}
+ ${COMPONENT_OPTION}
+ LIBRARY DESTINATION ${install_dir_${libname}}
+ ${COMPONENT_OPTION}
+ RUNTIME DESTINATION ${install_dir_${libname}}
+ ${COMPONENT_OPTION})
+ endif()
set_target_properties(${libname} PROPERTIES
OUTPUT_NAME ${output_name_${libname}})
set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime")
@@ -299,13 +324,6 @@
)
endif()
endif()
- install(TARGETS ${libname}
- ARCHIVE DESTINATION ${install_dir_${libname}}
- ${COMPONENT_OPTION}
- LIBRARY DESTINATION ${install_dir_${libname}}
- ${COMPONENT_OPTION}
- RUNTIME DESTINATION ${install_dir_${libname}}
- ${COMPONENT_OPTION})
# We only want to generate per-library install targets if you aren't using
# an IDE because the extra targets get cluttered in IDEs.
Index: compiler-rt/cmake/config-ix.cmake
===================================================================
--- compiler-rt/cmake/config-ix.cmake
+++ compiler-rt/cmake/config-ix.cmake
@@ -227,6 +227,7 @@
${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X})
set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
${MIPS32} ${MIPS64} ${PPC64} ${S390X})
+set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64})
set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64})
@@ -474,6 +475,7 @@
SANITIZER_COMMON_SUPPORTED_ARCH)
else()
+ filter_available_targets(CRT_SUPPORTED_ARCH ${ALL_CRT_SUPPORTED_ARCH})
# Architectures supported by compiler-rt libraries.
filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
${ALL_SANITIZER_COMMON_SUPPORTED_ARCH})
@@ -563,6 +565,12 @@
# TODO: Add builtins support.
+if (CRT_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux")
+ set(COMPILER_RT_HAS_CRT TRUE)
+else()
+ set(COMPILER_RT_HAS_CRT FALSE)
+endif()
+
if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Linux")
set(COMPILER_RT_HAS_DFSAN TRUE)
Index: compiler-rt/lib/CMakeLists.txt
===================================================================
--- compiler-rt/lib/CMakeLists.txt
+++ compiler-rt/lib/CMakeLists.txt
@@ -17,6 +17,10 @@
add_subdirectory(builtins)
endif()
+if(COMPILER_RT_BUILD_CRT)
+ add_subdirectory(crt)
+endif()
+
function(compiler_rt_build_runtime runtime)
string(TOUPPER ${runtime} runtime_uppercase)
if(COMPILER_RT_HAS_${runtime_uppercase})
Index: compiler-rt/lib/crt/CMakeLists.txt
===================================================================
--- /dev/null
+++ compiler-rt/lib/crt/CMakeLists.txt
@@ -0,0 +1,101 @@
+add_compiler_rt_component(crt)
+
+function(check_cxx_section_exists section output)
+ cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN})
+ if(NOT ARG_SOURCE)
+ set(ARG_SOURCE "int main() { return 0; }\n")
+ endif()
+
+ string(RANDOM TARGET_NAME)
+ set(TARGET_NAME "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cmTC_${TARGET_NAME}.dir")
+ file(MAKE_DIRECTORY ${TARGET_NAME})
+
+ file(WRITE "${TARGET_NAME}/CheckSectionExists.c" "${ARG_SOURCE}\n")
+
+ string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
+ ${CMAKE_C_COMPILE_OBJECT})
+
+ set(try_compile_flags "${ARG_FLAGS}")
+ if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
+ list(APPEND try_compile_flags "-target ${CMAKE_C_COMPILER_TARGET}")
+ endif()
+
+ string(REPLACE ";" " " extra_flags "${try_compile_flags}")
+
+ set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}")
+ foreach(substitution ${substitutions})
+ if(substitution STREQUAL "<CMAKE_C_COMPILER>")
+ string(REPLACE "<CMAKE_C_COMPILER>"
+ "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command})
+ elseif(substitution STREQUAL "<OBJECT>")
+ string(REPLACE "<OBJECT>" "${TARGET_NAME}/CheckSectionExists.o"
+ test_compile_command ${test_compile_command})
+ elseif(substitution STREQUAL "<SOURCE>")
+ string(REPLACE "<SOURCE>" "${TARGET_NAME}/CheckSectionExists.c"
+ test_compile_command ${test_compile_command})
+ elseif(substitution STREQUAL "<FLAGS>")
+ string(REPLACE "<FLAGS>" "${CMAKE_C_FLAGS} ${extra_flags}"
+ test_compile_command ${test_compile_command})
+ else()
+ string(REPLACE "${substitution}" "" test_compile_command
+ ${test_compile_command})
+ endif()
+ endforeach()
+
+ string(REPLACE " " ";" test_compile_command "${test_compile_command}")
+
+ execute_process(
+ COMMAND ${test_compile_command}
+ RESULT_VARIABLE TEST_RESULT
+ OUTPUT_VARIABLE TEST_OUTPUT
+ ERROR_VARIABLE TEST_ERROR
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_OBJDUMP} -h "${TARGET_NAME}/CheckSectionExists.o"
+ RESULT_VARIABLE CHECK_RESULT
+ OUTPUT_VARIABLE CHECK_OUTPUT
+ ERROR_VARIABLE CHECK_ERROR
+ )
+ string(FIND ${CHECK_OUTPUT} ${section} SECTION_FOUND)
+
+ if(NOT SECTION_FOUND EQUAL -1)
+ set(${output} TRUE PARENT_SCOPE)
+ else()
+ set(${output} FALSE PARENT_SCOPE)
+ endif()
+
+ file(REMOVE_RECURSE ${TARGET_NAME})
+endfunction()
+
+check_cxx_section_exists(".init_array" COMPILER_RT_HAS_INITFINI_ARRAY
+ SOURCE "__attribute__((constructor)) void f() {}\nint main() { return 0; }\n")
+
+append_list_if(COMPILER_RT_HAS_INITFINI_ARRAY -DCRT_HAS_INITFINI_ARRAY CRT_CFLAGS)
+
+foreach(arch ${CRT_SUPPORTED_ARCH})
+ add_compiler_rt_runtime(clang_rt.crtbegin
+ OBJECT
+ ARCHS ${arch}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c
+ CFLAGS ${CRT_CFLAGS}
+ PARENT_TARGET crt)
+ add_compiler_rt_runtime(clang_rt.crtbegin_shared
+ OBJECT
+ ARCHS ${arch}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtbegin.c
+ CFLAGS ${CRT_CFLAGS} -DCRT_SHARED -fPIC
+ PARENT_TARGET crt)
+ add_compiler_rt_runtime(clang_rt.crtend
+ OBJECT
+ ARCHS ${arch}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c
+ CFLAGS ${CRT_CFLAGS}
+ PARENT_TARGET crt)
+ add_compiler_rt_runtime(clang_rt.crtend_shared
+ OBJECT
+ ARCHS ${arch}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/crtend.c
+ CFLAGS ${CRT_CFLAGS} -DCRT_SHARED -fPIC
+ PARENT_TARGET crt)
+endforeach()
Index: compiler-rt/lib/crt/crtbegin.c
===================================================================
--- /dev/null
+++ compiler-rt/lib/crt/crtbegin.c
@@ -0,0 +1,110 @@
+/* ===-- crtbegin.c - Start of constructors and destructors ----------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#include <stddef.h>
+
+__attribute__((visibility("hidden")))
+#ifdef CRT_SHARED
+void *__dso_handle = &__dso_handle;
+#else
+void *__dso_handle = (void *)0;
+#endif
+
+static long __EH_FRAME_LIST__[] __attribute__((
+ section(".eh_frame"), aligned(sizeof(void *)), visibility("hidden"))) = {};
+
+extern void __register_frame_info(const void *, void *) __attribute__((weak));
+extern void *__deregister_frame_info(const void *) __attribute__((weak));
+
+#ifndef CRT_HAS_INITFINI_ARRAY
+typedef void (*fp)(void);
+
+static fp __CTOR_LIST__[]
+ __attribute__((section(".ctors"), aligned(sizeof(fp)), visibility("hidden"),
+ used)) = {(fp)-1};
+extern fp __CTOR_LIST_END__[] __attribute__((visibility("hidden")));
+#endif
+
+#ifdef CRT_SHARED
+extern void __cxa_finalize(void *) __attribute__((weak));
+#endif
+
+static void __attribute__((used)) __do_init() {
+ static _Bool __initialized;
+ if (__builtin_expect(__initialized, 0))
+ return;
+ __initialized = 1;
+
+ static struct { void *p[8]; } __object;
+ if (__register_frame_info)
+ __register_frame_info(__EH_FRAME_LIST__, &__object);
+
+#ifndef CRT_HAS_INITFINI_ARRAY
+ const size_t n = __CTOR_LIST_END__ - __CTOR_LIST__ - 1;
+ for (size_t i = n; i >= 1; i--) __CTOR_LIST__[i]();
+#endif
+}
+
+#ifdef CRT_HAS_INITFINI_ARRAY
+__attribute__((section(".init_array"),
+ used)) static void (*__init)(void) = __do_init;
+#else // CRT_HAS_INITFINI_ARRAY
+#if defined(__i386__) || defined(__x86_64__)
+asm(".pushsection .init,\"ax\",@progbits\n\t"
+ "call " __USER_LABEL_PREFIX__ "__do_init\n\t"
+ ".popsection");
+#elif defined(__arm__)
+asm(".pushsection .init,\"ax\",%progbits\n\t"
+ "bl " __USER_LABEL_PREFIX__ "__do_init\n\t"
+ ".popsection");
+#endif // CRT_HAS_INITFINI_ARRAY
+#endif
+
+#ifndef CRT_HAS_INITFINI_ARRAY
+static fp __DTOR_LIST__[]
+ __attribute__((section(".dtors"), aligned(sizeof(fp)), visibility("hidden"),
+ used)) = {(fp)-1};
+extern fp __DTOR_LIST_END__[] __attribute__((visibility("hidden")));
+#endif
+
+static void __attribute__((used)) __do_fini() {
+ static _Bool __finalized;
+ if (__builtin_expect(__finalized, 0))
+ return;
+ __finalized = 1;
+
+#ifdef CRT_SHARED
+ if (__cxa_finalize)
+ __cxa_finalize(__dso_handle);
+#endif
+
+#ifndef CRT_HAS_INITFINI_ARRAY
+ if (__deregister_frame_info)
+ __deregister_frame_info(__EH_FRAME_LIST__);
+
+ const size_t n = __DTOR_LIST_END__ - __DTOR_LIST__ - 1;
+ for (size_t i = 1; i < n; i++) __DTOR_LIST__[i]();
+#endif
+}
+
+#ifdef CRT_HAS_INITFINI_ARRAY
+__attribute__((section(".fini_array"),
+ used)) static void (*__fini)(void) = __do_fini;
+#else // CRT_HAS_INITFINI_ARRAY
+#if defined(__i386__) || defined(__x86_64__)
+asm(".pushsection .fini,\"ax\",@progbits\n\t"
+ "call " __USER_LABEL_PREFIX__ "__do_fini\n\t"
+ ".popsection");
+#elif defined(__arm__)
+asm(".pushsection .fini,\"ax\",%progbits\n\t"
+ "bl " __USER_LABEL_PREFIX__ "__do_fini\n\t"
+ ".popsection");
+#endif
+#endif // CRT_HAS_INIT_FINI_ARRAY
Index: compiler-rt/lib/crt/crtend.c
===================================================================
--- /dev/null
+++ compiler-rt/lib/crt/crtend.c
@@ -0,0 +1,23 @@
+/* ===-- crtend.c - End of constructors and destructors --------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#include <stdint.h>
+
+// Put 4-byte zero which is the length field in FDE at the end as a terminator.
+const int32_t __EH_FRAME_LIST_END__[]
+ __attribute__((section(".eh_frame"), aligned(sizeof(int32_t)), used)) = {0};
+
+#ifndef CRT_HAS_INITFINI_ARRAY
+typedef void (*fp)(void);
+fp __CTOR_LIST_END__[]
+ __attribute__((section(".ctors"), visibility("hidden"), used)) = {0};
+fp __DTOR_LIST_END__[]
+ __attribute__((section(".dtors"), visibility("hidden"), used)) = {0};
+#endif
Index: compiler-rt/test/CMakeLists.txt
===================================================================
--- compiler-rt/test/CMakeLists.txt
+++ compiler-rt/test/CMakeLists.txt
@@ -73,6 +73,9 @@
if(COMPILER_RT_BUILD_XRAY)
compiler_rt_test_runtime(xray)
endif()
+ if(COMPILER_RT_HAS_CRT)
+ add_subdirectory(crt)
+ endif()
# ShadowCallStack does not yet provide a runtime with compiler-rt, the tests
# include their own minimal runtime
add_subdirectory(shadowcallstack)
Index: compiler-rt/test/crt/CMakeLists.txt
===================================================================
--- /dev/null
+++ compiler-rt/test/crt/CMakeLists.txt
@@ -0,0 +1,31 @@
+set(CRT_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(CRT_TESTSUITES)
+
+set(CRT_TEST_DEPS "")
+
+if(NOT COMPILER_RT_STANDALONE_BUILD AND COMPILER_RT_BUILD_CRT AND
+ COMPILER_RT_HAS_CRT)
+ list(APPEND CRT_TEST_DEPS crt)
+endif()
+
+set(CRT_TEST_ARCH ${CRT_SUPPORTED_ARCH})
+if (COMPILER_RT_BUILD_CRT AND COMPILER_RT_HAS_CRT)
+ foreach(arch ${CRT_TEST_ARCH})
+ set(CRT_TEST_TARGET_ARCH ${arch})
+ string(TOLOWER "-${arch}-${OS_NAME}" CRT_TEST_CONFIG_SUFFIX)
+ get_test_cc_for_arch(${arch} CRT_TEST_TARGET_CC CRT_TEST_TARGET_CFLAGS)
+ string(TOUPPER ${arch} ARCH_UPPER_CASE)
+ set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
+
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg)
+ list(APPEND CRT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
+ endforeach()
+endif()
+
+add_lit_testsuite(check-crt "Running the CRT tests"
+ ${CRT_TESTSUITES}
+ DEPENDS ${CRT_TEST_DEPS})
+set_target_properties(check-crt PROPERTIES FOLDER "Compiler-RT Misc")
Index: compiler-rt/test/crt/dso_handle.cpp
===================================================================
--- /dev/null
+++ compiler-rt/test/crt/dso_handle.cpp
@@ -0,0 +1,33 @@
+// RUN: %clangxx -g -DCRT_SHARED -c %s -fPIC -o %tshared.o
+// RUN: %clangxx -g -c %s -fPIC -o %t.o
+// RUN: %clangxx -g -shared -o %t.so -nostdlib %crti %shared_crtbegin %tshared.o %libstdcxx -lc -lm -lgcc_s %shared_crtend %crtn
+// RUN: %clangxx -g -o %t -nostdlib %crt1 %crti %crtbegin %t.o %libstdcxx -lc -lm %libgcc %t.so %crtend %crtn
+// RUN: %run %t 2>&1 | FileCheck %s
+
+#include <stdio.h>
+
+// CHECK: 1
+// CHECK-NEXT: ~A()
+
+#ifdef CRT_SHARED
+bool G;
+void C() {
+ printf("%d\n", G);
+}
+
+struct A {
+ A() { G = true; }
+ ~A() {
+ printf("~A()\n");
+ }
+};
+
+A a;
+#else
+void C();
+
+int main() {
+ C();
+ return 0;
+}
+#endif
Index: compiler-rt/test/crt/lit.cfg
===================================================================
--- /dev/null
+++ compiler-rt/test/crt/lit.cfg
@@ -0,0 +1,80 @@
+# -*- Python -*-
+
+import os
+import subprocess
+
+# Setup config name.
+config.name = 'CRT' + config.name_suffix
+
+# Setup source root.
+config.test_source_root = os.path.dirname(__file__)
+
+
+def get_library_path(file):
+ cmd = subprocess.Popen([config.clang.strip(),
+ config.target_cflags.strip(),
+ '-print-file-name=%s' % file],
+ stdout=subprocess.PIPE,
+ env=config.environment)
+ if not cmd.stdout:
+ lit_config.fatal("Couldn't find the library path for '%s'" % file)
+ dir = cmd.stdout.read().strip()
+ if sys.platform in ['win32'] and execute_external:
+ # Don't pass dosish path separator to msys bash.exe.
+ dir = dir.replace('\\', '/')
+ # Ensure the result is an ascii string, across Python2.5+ - Python3.
+ return str(dir.decode('ascii'))
+
+
+def get_libgcc_file_name():
+ cmd = subprocess.Popen([config.clang.strip(),
+ config.target_cflags.strip(),
+ '-print-libgcc-file-name'],
+ stdout=subprocess.PIPE,
+ env=config.environment)
+ if not cmd.stdout:
+ lit_config.fatal("Couldn't find the library path for '%s'" % file)
+ dir = cmd.stdout.read().strip()
+ if sys.platform in ['win32'] and execute_external:
+ # Don't pass dosish path separator to msys bash.exe.
+ dir = dir.replace('\\', '/')
+ # Ensure the result is an ascii string, across Python2.5+ - Python3.
+ return str(dir.decode('ascii'))
+
+
+def build_invocation(compile_flags):
+ return ' ' + ' '.join([config.clang] + compile_flags) + ' '
+
+
+# Setup substitutions.
+config.substitutions.append(
+ ('%clang ', build_invocation([config.target_cflags])))
+config.substitutions.append(
+ ('%clangxx ',
+ build_invocation(config.cxx_mode_flags + [config.target_cflags])))
+
+base_lib = os.path.join(
+ config.compiler_rt_libdir, "clang_rt.%%s-%s.o" % config.target_arch)
+config.substitutions.append(('%crtbegin', base_lib % "crtbegin"))
+config.substitutions.append(('%shared_crtbegin', base_lib % "crtbegin_shared"))
+config.substitutions.append(('%crtend', base_lib % "crtend"))
+config.substitutions.append(('%shared_crtend', base_lib % "crtend_shared"))
+
+config.substitutions.append(
+ ('%crt1', get_library_path('crt1.o')))
+config.substitutions.append(
+ ('%crti', get_library_path('crti.o')))
+config.substitutions.append(
+ ('%crtn', get_library_path('crtn.o')))
+
+config.substitutions.append(
+ ('%libgcc', get_libgcc_file_name()))
+
+config.substitutions.append(
+ ('%libstdcxx', '-l' + config.sanitizer_cxx_lib.lstrip('lib')))
+
+# Default test suffixes.
+config.suffixes = ['.c', '.cc', '.cpp']
+
+if config.host_os not in ['Linux']:
+ config.unsupported = True
Index: compiler-rt/test/crt/lit.site.cfg.in
===================================================================
--- /dev/null
+++ compiler-rt/test/crt/lit.site.cfg.in
@@ -0,0 +1,14 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+# Tool-specific config options.
+config.name_suffix = "@CRT_TEST_CONFIG_SUFFIX@"
+config.crt_lit_source_dir = "@CRT_LIT_SOURCE_DIR@"
+config.target_cflags = "@CRT_TEST_TARGET_CFLAGS@"
+config.target_arch = "@CRT_TEST_TARGET_ARCH@"
+config.sanitizer_cxx_lib = "@SANITIZER_TEST_CXX_LIBNAME@"
+
+# Load common config for all compiler-rt lit tests
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
+
+# Load tool-specific config that would do the real work.
+lit_config.load_config(config, "@CRT_LIT_SOURCE_DIR@/lit.cfg")

View file

@ -0,0 +1,149 @@
{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook
, libxml2, python, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
, buildLlvmTools # tools, but from the previous stage, for cross
, targetLlvmLibraries # libraries, but from the next stage, for cross
}:
let
release_version = "8.0.0";
version = release_version + "rc2"; # differentiating these is important for rc's
fetch = name: sha256: fetchurl {
url = "https://prereleases.llvm.org/${release_version}/rc2/${name}-${version}.src.tar.xz";
inherit sha256;
};
clang-tools-extra_src = fetch "clang-tools-extra" "1ypzbk7lf9dzkqh4p37dlr1bggjdrixr5gwb71jk9gh98grr2m5g";
tools = stdenv.lib.makeExtensible (tools: let
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python isl release_version version fetch; });
mkExtraBuildCommands = cc: ''
rsrc="$out/resource-root"
mkdir "$rsrc"
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && tools.clang-unwrapped ? gcc) ''
echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags
'';
in {
llvm = callPackage ./llvm.nix { };
llvm-polly = callPackage ./llvm.nix { enablePolly = true; };
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src;
};
clang-polly-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src;
llvm = tools.llvm-polly;
enablePolly = true;
};
llvm-manpages = lowPrio (tools.llvm.override {
enableManpages = true;
python = pkgs.python; # don't use python-boot
});
clang-manpages = lowPrio (tools.clang-unwrapped.override {
enableManpages = true;
python = pkgs.python; # don't use python-boot
});
libclang = tools.clang-unwrapped.lib;
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
libstdcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
extraPackages = [
libstdcxxHook
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
};
libcxxClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
libcxx = targetLlvmLibraries.libcxx;
extraPackages = [
targetLlvmLibraries.libcxx
targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = mkExtraBuildCommands cc;
};
lld = callPackage ./lld.nix {};
lldb = callPackage ./lldb.nix {};
bintools = callPackage ./bintools.nix {};
lldClang = wrapCCWith rec {
cc = tools.clang-unwrapped;
bintools = wrapBintoolsWith {
inherit (tools) bintools;
};
extraPackages = [
# targetLlvmLibraries.libcxx
# targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
echo "-target ${stdenv.targetPlatform.config} -rtlib=compiler-rt" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};
lldClangNoLibc = wrapCCWith rec {
cc = tools.clang-unwrapped;
bintools = wrapBintoolsWith {
inherit (tools) bintools;
libc = null;
};
extraPackages = [
# targetLlvmLibraries.libcxx
# targetLlvmLibraries.libcxxabi
targetLlvmLibraries.compiler-rt
];
extraBuildCommands = ''
echo "-target ${stdenv.targetPlatform.config} -rtlib=compiler-rt" >> $out/nix-support/cc-cflags
'' + mkExtraBuildCommands cc;
};
lldClangNoCompilerRt = wrapCCWith rec {
cc = tools.clang-unwrapped;
bintools = wrapBintoolsWith {
inherit (tools) bintools;
libc = null;
};
extraPackages = [ ];
extraBuildCommands = ''
echo "-nostartfiles -target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
'';
};
});
libraries = stdenv.lib.makeExtensible (libraries: let
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python isl release_version version fetch; });
in {
compiler-rt = callPackage ./compiler-rt.nix {
stdenv = if stdenv.hostPlatform.useLLVM or false
then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt
else stdenv;
};
stdenv = overrideCC stdenv buildLlvmTools.clang;
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
libcxx = callPackage ./libc++ {};
libcxxabi = callPackage ./libc++abi.nix {};
openmp = callPackage ./openmp.nix {};
});
in { inherit tools libraries; } // libraries // tools

View file

@ -0,0 +1,50 @@
{ lib, stdenv, fetch, cmake, python, libcxxabi, fixDarwinDylibNames, version }:
stdenv.mkDerivation rec {
name = "libc++-${version}";
src = fetch "libcxx" "1c8idvlqm4ik62q0llsndk9449yrgkj8hv5lz411hnbqjs09q9qq";
postUnpack = ''
unpackFile ${libcxxabi.src}
export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
'';
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
prePatch = ''
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
'';
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="$LIBCXXABI_INCLUDE_DIR")
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
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;
};
}

View file

@ -0,0 +1,6 @@
# See pkgs/build-support/setup-hooks/role.bash
getHostRole
linkCxxAbi="@linkCxxAbi@"
export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"

View file

@ -0,0 +1,50 @@
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
stdenv.mkDerivation {
name = "libc++abi-${version}";
src = fetch "libcxxabi" "0hdg7xw8vazw85i675qld7i6wqx502srny84cp0w6wi6pk44xiqr";
nativeBuildInputs = [ cmake ];
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
postUnpack = ''
unpackFile ${libcxx.src}
unpackFile ${llvm.src}
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
'';
installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# http://www.cmake.org/Wiki/CMake_RPATH_handling
install_name_tool -id $out/$file $file
done
make install
install -d 755 $out/include
install -m 644 ../include/*.h $out/include
''
else ''
install -d -m 755 $out/include $out/lib
install -m 644 lib/libc++abi.a $out/lib
install -m 644 lib/libc++abi.so.1.0 $out/lib
install -m 644 ../include/cxxabi.h $out/include
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
'';
meta = {
homepage = http://libcxxabi.llvm.org/;
description = "A new implementation of low level support for a standard C++ library";
license = with stdenv.lib.licenses; [ ncsa mit ];
maintainers = with stdenv.lib.maintainers; [ vlstill ];
platforms = stdenv.lib.platforms.unix;
};
}

View file

@ -0,0 +1,32 @@
{ stdenv
, fetch
, cmake
, libxml2
, llvm
, version
}:
stdenv.mkDerivation {
name = "lld-${version}";
src = fetch "lld" "14nganpwr5y111zhwws95p6ikp8kfiybfdr2yfz5cmhb3zkcgk4h";
nativeBuildInputs = [ cmake ];
buildInputs = [ llvm libxml2 ];
outputs = [ "out" "dev" ];
enableParallelBuilding = true;
postInstall = ''
moveToOutput include "$dev"
moveToOutput lib "$dev"
'';
meta = {
description = "The LLVM Linker";
homepage = http://lld.llvm.org/;
license = stdenv.lib.licenses.ncsa;
platforms = stdenv.lib.platforms.all;
};
}

View file

@ -0,0 +1,56 @@
{ stdenv
, fetch
, cmake
, zlib
, ncurses
, swig
, which
, libedit
, libxml2
, llvm
, clang-unwrapped
, python
, version
, darwin
}:
stdenv.mkDerivation {
name = "lldb-${version}";
src = fetch "lldb" "0r364w49m0l0808wm06g777qd14gwxnz0z267dbnwqkw6zc361lc";
postPatch = ''
# Fix up various paths that assume llvm and clang are installed in the same place
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
cmake/modules/LLDBStandalone.cmake
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
cmake/modules/LLDBStandalone.cmake
'';
nativeBuildInputs = [ cmake python which swig ];
buildInputs = [ ncurses zlib libedit libxml2 llvm ]
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.cf-private ];
CXXFLAGS = "-fno-rtti";
hardeningDisable = [ "format" ];
cmakeFlags = [
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
];
enableParallelBuilding = true;
postInstall = ''
mkdir -p $out/share/man/man1
cp ../docs/lldb.1 $out/share/man/man1/
'';
meta = with stdenv.lib; {
description = "A next-generation high-performance debugger";
homepage = http://llvm.org/;
license = licenses.ncsa;
platforms = platforms.all;
};
}

View file

@ -0,0 +1,26 @@
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 94d426b..37f7794 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -333,6 +333,21 @@ int main(int argc, char **argv) {
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared
+ if (!IsInDevelopmentTree) {
+ bool WantShared = true;
+ for (int i = 1; i < argc; ++i) {
+ StringRef Arg = argv[i];
+ if (Arg == "--link-shared")
+ WantShared = true;
+ else if (Arg == "--link-static")
+ WantShared = false; // the last one wins
+ }
+
+ if (WantShared)
+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX;
+ }
+
/// We only use `shared library` mode in cases where the static library form
/// of the components provided are not available; note however that this is
/// skipped if we're run from within the build dir. However, once installed,

View file

@ -0,0 +1,172 @@
{ stdenv
, fetch
, fetchpatch
, cmake
, python
, libffi
, libbfd
, libpfm
, libxml2
, ncurses
, version
, release_version
, zlib
, buildPackages
, debugVersion ? false
, enableManpages ? false
, enableSharedLibraries ? true
, enablePFM ? !stdenv.isDarwin
, enablePolly ? false
}:
let
inherit (stdenv.lib) optional optionals optionalString;
src = fetch "llvm" "1h9zqgf968si0nzdmsa9rz634zrmz6mprvz2ifw6ky0h7va5rcvq";
polly_src = fetch "polly" "1wwnn0cxnrmiqb6kg577myz6kb8sm18jwc020lf0b1k5as7aw2kq";
# Used when creating a version-suffixed symlink of libLLVM.dylib
shortVersion = with stdenv.lib;
concatStringsSep "." (take 1 (splitString "." release_version));
in stdenv.mkDerivation (rec {
name = "llvm-${version}";
unpackPhase = ''
unpackFile ${src}
mv llvm-${version}* llvm
sourceRoot=$PWD/llvm
'' + optionalString enablePolly ''
unpackFile ${polly_src}
mv polly-* $sourceRoot/tools/polly
'';
outputs = [ "out" "python" ]
++ optional enableSharedLibraries "lib";
nativeBuildInputs = [ cmake python ]
++ optionals enableManpages [ python.pkgs.sphinx python.pkgs.recommonmark ];
buildInputs = [ libxml2 libffi ]
++ optional enablePFM libpfm; # exegesis
propagatedBuildInputs = [ ncurses zlib ];
postPatch = optionalString stdenv.isDarwin ''
substituteInPlace cmake/modules/AddLLVM.cmake \
--replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
--replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
''
# Patch llvm-config to return correct library path based on --link-{shared,static}.
+ optionalString (enableSharedLibraries) ''
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
patch -p1 < ./llvm-outputs.patch
'' + ''
# FileSystem permissions tests fail with various special bits
substituteInPlace unittests/Support/CMakeLists.txt \
--replace "Path.cpp" ""
rm unittests/Support/Path.cpp
'' + optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -i ${../TLI-musl.patch}
substituteInPlace unittests/Support/CMakeLists.txt \
--replace "add_subdirectory(DynamicLibrary)" ""
rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
'' + ''
patchShebangs test/BugPoint/compile-custom.ll.py
'';
# hacky fix: created binaries need to be run before installation
preBuild = ''
mkdir -p $out/
ln -sv $PWD/lib $out
'';
cmakeFlags = with stdenv; [
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
"-DLLVM_BUILD_TESTS=ON"
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_ENABLE_DUMP=ON"
] ++ optionals enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"
] ++ optionals enableManpages [
"-DLLVM_BUILD_DOCS=ON"
"-DLLVM_ENABLE_SPHINX=ON"
"-DSPHINX_OUTPUT_MAN=ON"
"-DSPHINX_OUTPUT_HTML=OFF"
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
] ++ optionals (!isDarwin) [
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
] ++ optionals (isDarwin) [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DCAN_TARGET_i386=false"
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DCMAKE_CROSSCOMPILING=True"
"-DLLVM_TABLEGEN=${buildPackages.llvm_7}/bin/llvm-tblgen"
];
postBuild = ''
rm -fR $out
'';
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
'';
postInstall = ''
mkdir -p $python/share
mv $out/share/opt-viewer $python/share/opt-viewer
''
+ optionalString enableSharedLibraries ''
moveToOutput "lib/libLLVM-*" "$lib"
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
''
+ optionalString (stdenv.isDarwin && enableSharedLibraries) ''
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
'';
doCheck = stdenv.isLinux && (!stdenv.isx86_32);
checkTarget = "check-all";
enableParallelBuilding = true;
passthru.src = src;
meta = {
description = "Collection of modular and reusable compiler and toolchain technologies";
homepage = http://llvm.org/;
license = stdenv.lib.licenses.ncsa;
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
platforms = stdenv.lib.platforms.all;
};
} // stdenv.lib.optionalAttrs enableManpages {
name = "llvm-manpages-${version}";
buildPhase = ''
make docs-llvm-man
'';
propagatedBuildInputs = [];
installPhase = ''
make -C docs install
'';
postPatch = null;
postInstall = null;
outputs = [ "out" ];
doCheck = false;
meta.description = "man pages for LLVM ${version}";
})

View file

@ -0,0 +1,25 @@
{ stdenv
, fetch
, cmake
, llvm
, perl
, version
}:
stdenv.mkDerivation {
name = "openmp-${version}";
src = fetch "openmp" "1xxxclzizcrfh0k870n4n3hh0khw14sv5i7s2kbdwl099k8b96cv";
nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];
enableParallelBuilding = true;
meta = {
description = "Components required to build an executable OpenMP program";
homepage = http://openmp.llvm.org/;
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.all;
};
}

View file

@ -0,0 +1,412 @@
From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Mon, 24 Sep 2018 11:17:25 -0500
Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project.
------
Ported to compiler-rt-sanitizers-5.0.0. Taken from
https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch
Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
Taken from gentoo-musl project, with a few additional minor fixes.
---
lib/asan/asan_linux.cc | 4 +-
lib/interception/interception_linux.cc | 2 +-
lib/interception/interception_linux.h | 2 +-
lib/msan/msan_linux.cc | 2 +-
lib/sanitizer_common/sanitizer_allocator.cc | 2 +-
.../sanitizer_common_interceptors_ioctl.inc | 4 +-
.../sanitizer_common_syscalls.inc | 2 +-
lib/sanitizer_common/sanitizer_linux.cc | 8 +++-
.../sanitizer_linux_libcdep.cc | 10 ++---
lib/sanitizer_common/sanitizer_platform.h | 6 +++
.../sanitizer_platform_interceptors.h | 4 +-
.../sanitizer_platform_limits_posix.cc | 37 +++++++++++--------
lib/tsan/rtl/tsan_platform_linux.cc | 2 +-
13 files changed, 51 insertions(+), 34 deletions(-)
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
index 625f32d40..73cf77aca 100644
--- a/lib/asan/asan_linux.cc
+++ b/lib/asan/asan_linux.cc
@@ -46,7 +46,7 @@
#include <link.h>
#endif
-#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS
+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
#include <ucontext.h>
extern "C" void* _DYNAMIC;
#elif SANITIZER_NETBSD
@@ -139,7 +139,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
UNIMPLEMENTED();
}
-#if SANITIZER_ANDROID
+#if SANITIZER_ANDROID || SANITIZER_NONGNU
// FIXME: should we do anything for Android?
void AsanCheckDynamicRTPrereqs() {}
void AsanCheckIncompatibleRT() {}
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
index 26bfcd8f6..529b234f7 100644
--- a/lib/interception/interception_linux.cc
+++ b/lib/interception/interception_linux.cc
@@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
}
// Android and Solaris do not have dlvsym
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
void *GetFuncAddrVer(const char *func_name, const char *ver) {
return dlvsym(RTLD_NEXT, func_name, ver);
}
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h
index 942c25609..24a4d5080 100644
--- a/lib/interception/interception_linux.h
+++ b/lib/interception/interception_linux.h
@@ -36,7 +36,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
(::__interception::uptr) & WRAP(func))
// Android, Solaris and OpenBSD do not have dlvsym
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
(::__interception::real_##func = (func##_f)( \
unsigned long)::__interception::GetFuncAddrVer(#func, symver))
diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
index 385a650c4..6e30a8ce9 100644
--- a/lib/msan/msan_linux.cc
+++ b/lib/msan/msan_linux.cc
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
#include "sanitizer_common/sanitizer_platform.h"
-#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD
#include "msan.h"
#include "msan_report.h"
diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc
index 6bfd5e5ee..048f6154f 100644
--- a/lib/sanitizer_common/sanitizer_allocator.cc
+++ b/lib/sanitizer_common/sanitizer_allocator.cc
@@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator";
// ThreadSanitizer for Go uses libc malloc/free.
#if SANITIZER_GO || defined(SANITIZER_USE_MALLOC)
-# if SANITIZER_LINUX && !SANITIZER_ANDROID
+# if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
extern "C" void *__libc_malloc(uptr size);
# if !SANITIZER_GO
extern "C" void *__libc_memalign(uptr alignment, uptr size);
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 2d633c173..b6eb23116 100644
--- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -104,7 +104,7 @@ static void ioctl_table_fill() {
_(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
#endif
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
// Conflicting request ids.
// _(CDROMAUDIOBUFSIZ, NONE, 0);
// _(SNDCTL_TMR_CONTINUE, NONE, 0);
@@ -365,7 +365,7 @@ static void ioctl_table_fill() {
_(VT_WAITACTIVE, NONE, 0);
#endif
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
_(CYGETDEFTHRESH, WRITE, sizeof(int));
_(CYGETDEFTIMEOUT, WRITE, sizeof(int));
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
index 469c8eb7e..24f87867d 100644
--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
}
}
-#if !SANITIZER_ANDROID
+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
void *old_rlim) {
if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc
index 96d6c1eff..9e2b7fb9d 100644
--- a/lib/sanitizer_common/sanitizer_linux.cc
+++ b/lib/sanitizer_common/sanitizer_linux.cc
@@ -541,13 +541,13 @@ const char *GetEnv(const char *name) {
#endif
}
-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD
+#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
extern "C" {
SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end;
}
#endif
-#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \
+#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD && \
!SANITIZER_OPENBSD
static void ReadNullSepFileToArray(const char *path, char ***arr,
int arr_size) {
@@ -590,6 +590,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) {
#elif SANITIZER_NETBSD
*argv = __ps_strings->ps_argvstr;
*envp = __ps_strings->ps_envstr;
+#elif SANITIZER_NONGNU
+ static const int kMaxArgv = 2000, kMaxEnvp = 2000;
+ ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv);
+ ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
#else // SANITIZER_FREEBSD
#if !SANITIZER_GO
if (&__libc_stack_end) {
diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
index 4962ff832..438f94dbe 100644
--- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -179,7 +179,7 @@ __attribute__((unused)) static bool GetLibcVersion(int *major, int *minor,
}
#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \
- !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS
+ !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
static uptr g_tls_size;
#ifdef __i386__
@@ -261,7 +261,7 @@ void InitTlsSize() { }
#if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) || \
defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) || \
defined(__arm__)) && \
- SANITIZER_LINUX && !SANITIZER_ANDROID
+ SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
// sizeof(struct pthread) from glibc.
static atomic_uintptr_t thread_descriptor_size;
@@ -426,7 +426,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
#if !SANITIZER_GO
static void GetTls(uptr *addr, uptr *size) {
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
# if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
*addr = ThreadSelf();
*size = GetTlsSize();
@@ -470,7 +470,7 @@ static void GetTls(uptr *addr, uptr *size) {
#elif SANITIZER_OPENBSD
*addr = 0;
*size = 0;
-#elif SANITIZER_ANDROID
+#elif SANITIZER_ANDROID || SANITIZER_NONGNU
*addr = 0;
*size = 0;
#elif SANITIZER_SOLARIS
@@ -486,7 +486,7 @@ static void GetTls(uptr *addr, uptr *size) {
#if !SANITIZER_GO
uptr GetTlsSize() {
#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD || \
- SANITIZER_OPENBSD || SANITIZER_SOLARIS
+ SANITIZER_OPENBSD || SANITIZER_SOLARIS || SANITIZER_NONGNU
uptr addr, size;
GetTls(&addr, &size);
return size;
diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
index d81e25580..e10680ac8 100644
--- a/lib/sanitizer_common/sanitizer_platform.h
+++ b/lib/sanitizer_common/sanitizer_platform.h
@@ -208,6 +208,12 @@
# define SANITIZER_SOLARIS32 0
#endif
+#if defined(__linux__) && !defined(__GLIBC__)
+# define SANITIZER_NONGNU 1
+#else
+# define SANITIZER_NONGNU 0
+#endif
+
#if defined(__myriad2__)
# define SANITIZER_MYRIAD2 1
#else
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
index f95539a73..6c53b3415 100644
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -39,7 +39,7 @@
# include "sanitizer_platform_limits_solaris.h"
#endif
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
# define SI_LINUX_NOT_ANDROID 1
#else
# define SI_LINUX_NOT_ANDROID 0
@@ -322,7 +322,7 @@
#define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
#define SANITIZER_INTERCEPT_SHMCTL \
(SI_NETBSD || SI_OPENBSD || SI_SOLARIS || \
- ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \
+ ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \
SANITIZER_WORDSIZE == 64)) // NOLINT
#define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
index 54da635d7..2f6ff69c3 100644
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -14,6 +14,9 @@
#include "sanitizer_platform.h"
+// Workaround musl <--> linux conflicting definition of 'struct sysinfo'
+#define _LINUX_SYSINFO_H
+
#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC
// Tests in this file assume that off_t-dependent data structures match the
// libc ABI. For example, struct dirent here is what readdir() function (as
@@ -138,12 +141,14 @@ typedef struct user_fpregs elf_fpregset_t;
#if SANITIZER_LINUX && !SANITIZER_ANDROID
#include <glob.h>
-#include <obstack.h>
+# if !SANITIZER_NONGNU
+# include <obstack.h>
+# endif
#include <mqueue.h>
-#include <net/if_ppp.h>
-#include <netax25/ax25.h>
-#include <netipx/ipx.h>
-#include <netrom/netrom.h>
+#include <linux/if_ppp.h>
+#include <linux/ax25.h>
+#include <linux/ipx.h>
+#include <linux/netrom.h>
#if HAVE_RPC_XDR_H
# include <rpc/xdr.h>
#elif HAVE_TIRPC_RPC_XDR_H
@@ -251,7 +256,7 @@ namespace __sanitizer {
unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
// Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
// has been removed from glibc 2.28.
#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
@@ -322,7 +327,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
#endif
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
int glob_nomatch = GLOB_NOMATCH;
int glob_altdirfunc = GLOB_ALTDIRFUNC;
#endif
@@ -416,7 +421,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_termios_sz = sizeof(struct termios);
unsigned struct_winsize_sz = sizeof(struct winsize);
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
unsigned struct_arpreq_sz = sizeof(struct arpreq);
unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
@@ -466,7 +471,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
#if EV_VERSION > (0x010000)
@@ -834,7 +839,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
unsigned IOCTL_CYGETMON = CYGETMON;
@@ -989,7 +994,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
CHECK_TYPE_SIZE(glob_t);
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
@@ -1023,6 +1028,7 @@ CHECK_TYPE_SIZE(iovec);
CHECK_SIZE_AND_OFFSET(iovec, iov_base);
CHECK_SIZE_AND_OFFSET(iovec, iov_len);
+#if !SANITIZER_NONGNU
CHECK_TYPE_SIZE(msghdr);
CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
@@ -1036,6 +1042,7 @@ CHECK_TYPE_SIZE(cmsghdr);
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
+#endif
#ifndef __GLIBC_PREREQ
#define __GLIBC_PREREQ(x, y) 0
@@ -1145,7 +1152,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
CHECK_TYPE_SIZE(ether_addr);
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
CHECK_TYPE_SIZE(ipc_perm);
# if SANITIZER_FREEBSD
CHECK_SIZE_AND_OFFSET(ipc_perm, key);
@@ -1206,7 +1213,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
#endif
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
#endif
@@ -1256,7 +1263,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
#endif
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
CHECK_SIZE_AND_OFFSET(FILE, _flags);
CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
@@ -1275,7 +1282,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
CHECK_SIZE_AND_OFFSET(FILE, _fileno);
#endif
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
index de989b780..51a97b554 100644
--- a/lib/tsan/rtl/tsan_platform_linux.cc
+++ b/lib/tsan/rtl/tsan_platform_linux.cc
@@ -294,7 +294,7 @@ void InitializePlatform() {
// This is required to properly "close" the fds, because we do not see internal
// closes within glibc. The code is a pure hack.
int ExtractResolvFDs(void *state, int *fds, int nfd) {
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
int cnt = 0;
struct __res_state *statp = (struct __res_state*)state;
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
--
2.19.0

View file

@ -3,13 +3,13 @@
stdenv.mkDerivation ( rec {
name = "ponyc-${version}";
version = "0.26.0";
version = "0.27.0";
src = fetchFromGitHub {
owner = "ponylang";
repo = "ponyc";
rev = version;
sha256 = "1k1ysqk7j8kpysndps2ic9hprvp0z0d32d6jvqlapjrfccghy7dh";
sha256 = "11vdfvv9xirfi92y7zza9pqimfx33w74vw7rg5n7l60qqc8y2cla";
};
buildInputs = [ llvm makeWrapper which ];
@ -25,25 +25,15 @@ stdenv.mkDerivation ( rec {
substituteInPlace packages/process/_test.pony \
--replace '=/bin' "${coreutils}/bin"
# Fix llvm-ar check for darwin
substituteInPlace Makefile \
--replace "llvm-ar-3.8" "llvm-ar"
# Remove impure system refs
substituteInPlace src/libponyc/pkg/package.c \
--replace "/usr/local/lib" ""
substituteInPlace src/libponyc/pkg/package.c \
--replace "/usr/local/lib" "" \
--replace "/opt/local/lib" ""
for file in `grep -irl '/usr/local/opt/libressl/lib' ./*`; do
substituteInPlace $file --replace '/usr/local/opt/libressl/lib' "${stdenv.lib.getLib libressl}/lib"
done
# Fix ponypath issue
substituteInPlace Makefile \
--replace "PONYPATH=." "PONYPATH=.:\$(PONYPATH)"
export LLVM_CONFIG=${llvm}/bin/llvm-config
'' + stdenv.lib.optionalString ((!stdenv.isDarwin) && (!cc.isClang) && lto) ''
export LTO_PLUGIN=`find ${cc.cc}/ -name liblto_plugin.so`
@ -73,9 +63,7 @@ stdenv.mkDerivation ( rec {
wrapProgram $out/bin/ponyc \
--prefix PATH ":" "${stdenv.cc}/bin" \
--set-default CC "$CC" \
--prefix PONYPATH : "$out/lib" \
--prefix PONYPATH : "${stdenv.lib.getLib pcre2}/lib" \
--prefix PONYPATH : "${stdenv.lib.getLib libressl}/lib"
--prefix PONYPATH : "${stdenv.lib.makeLibraryPath [ pcre2 libressl (placeholder "out") ]}"
'';
# Stripping breaks linking for ponyc

View file

@ -2,20 +2,18 @@
stdenv.mkDerivation rec {
name = "pony-stable-${version}";
version = "0.1.6";
version = "0.2.0";
src = fetchFromGitHub {
owner = "ponylang";
repo = "pony-stable";
rev = version;
sha256 = "02lqba75psnxcxj2y8lm1fy1hmwa088nvxjghhpnlkqbwz7wa2sw";
sha256 = "0zzcq0vsl6kcrsxwqzd3s9mq7aq5sg8si5c83rxyi9n6a06gnbh7";
};
buildInputs = [ ponyc ];
installPhase = ''
make prefix=$out install
'';
installFlags = [ "prefix=${placeholder "out"}" "install" ];
meta = {
description = "A simple dependency manager for the Pony language.";

View file

@ -3,11 +3,12 @@
}:
assert z3Support -> z3 != null;
assert z3Support -> stdenv.lib.versionAtLeast z3.version "4.6.0";
let
version = "0.5.3";
rev = "10d17f245839f208ec5085309022a32cd2502f55";
sha256 = "1jq41pd3nj534cricy1nq6wgk4wlwg239387n785aswpwd705jbb";
version = "0.5.4";
rev = "9549d8fff7343908228c3e8bedc309d1b83fc204";
sha256 = "1r6wklp3ab2s1lrm70zv6p7blv9917ph1arjsb250j7b7bpjg5pq";
jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz;
jsoncpp = fetchzip {
url = jsoncppURL;

View file

@ -1075,6 +1075,9 @@ self: super: {
cborg = doJailbreak super.cborg;
serialise = doJailbreak (dontCheck super.serialise);
# https://github.com/haskell-hvr/netrc/pull/2#issuecomment-469526558
netrc = doJailbreak super.netrc;
# https://github.com/phadej/tree-diff/issues/19
tree-diff = doJailbreak super.tree-diff;

View file

@ -6,11 +6,11 @@ rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "3" "3" "";
jruby = stdenv.mkDerivation rec {
name = "jruby-${version}";
version = "9.2.5.0";
version = "9.2.6.0";
src = fetchurl {
url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz";
sha256 = "0jgkpp90x4v3izl58r53lg5ndf9pm6q6qgwqvxhkb9zcha00ibgl";
sha256 = "0g8fkv946icw82h7pmg5aqh5mrgiiz9izjcjx9ism2x92w7gz8bh";
};
buildInputs = [ makeWrapper ];

View file

@ -7,7 +7,7 @@ with pythonPackages;
stdenv.mkDerivation rec {
name = "renpy-${version}";
version = "7.1.3";
version = "7.2.0";
meta = with stdenv.lib; {
description = "Ren'Py Visual Novel Engine";
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://www.renpy.org/dl/${version}/renpy-${version}-source.tar.bz2";
sha256 = "0z6s1vzjb5jh0i79pv5kgynfrzqj1a1f3afrpmp2aaqbrljkidbn";
sha256 = "1pnzxmh37zzldvlyklk2wgc8xbh3hm3wwmbl70zdphybjrxvc7i5";
};
patches = [

View file

@ -16,6 +16,9 @@ rec {
"${patchSet}/patches/ruby/2.5/head/railsexpress/02-improve-gc-stats.patch"
"${patchSet}/patches/ruby/2.5/head/railsexpress/03-more-detailed-stacktrace.patch"
];
"2.6.1" = ops useRailsExpress [ # no Rails Express patchset yet (2019-01-30)
"2.6.1" = ops useRailsExpress [
"${patchSet}/patches/ruby/2.6/head/railsexpress/01-fix-broken-tests-caused-by-ad.patch"
"${patchSet}/patches/ruby/2.6/head/railsexpress/02-improve-gc-stats.patch"
"${patchSet}/patches/ruby/2.6/head/railsexpress/03-more-detailed-stacktrace.patch"
];
}

View file

@ -3,6 +3,6 @@
fetchFromGitHub {
owner = "skaes";
repo = "rvm-patchsets";
rev = "ba5a3c6f972e1b957b4b3fe28b5730ef0e27bff3";
sha256 = "0sjmhhb8hshxa58x062j44w0xdck8ykgpsg33wjr0wv9npwpkwrz";
rev = "bdb42b13dd8653afc64676c0feb350e0c1880119";
sha256 = "09fpx66cshyvrrmp3251d2pmqv0frjw940r421smsmpkny0dx613";
}

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libXpm, zlib, Foundation }:
{ stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libwebp, libXpm, zlib, Foundation }:
stdenv.mkDerivation rec {
name = "SDL2_image-${version}";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "1b6f7002bm007y3zpyxb5r6ag0lml51jyvx1pwpj9sq24jfc8kp7";
};
buildInputs = [ SDL2 libpng libjpeg libtiff libungif libXpm zlib ]
buildInputs = [ SDL2 libpng libjpeg libtiff libungif libwebp libXpm zlib ]
++ stdenv.lib.optional stdenv.isDarwin Foundation;

View file

@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = "-Wno-error";
GOCACHE="$TMPDIR/go-cache";
installPhase = ''
mkdir -p $out/bin $out/include $out/lib

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "ffms-${version}";
version = "2.22";
version = "2.23";
src = fetchFromGitHub {
owner = "FFMS";
repo = "ffms2";
rev = version;
sha256 = "1ywcx1f3q533qfrbck5qhik3l617qhm062l8zixv02gnla7w6rkm";
sha256 = "0dkz5b3gxq5p4xz0qqg6l2sigszrlsinz3skyf0ln4wf3zrvf8m5";
};
NIX_CFLAGS_COMPILE = "-fPIC";

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "gecode-${version}";
version = "6.1.0";
version = "6.1.1";
src = fetchFromGitHub {
owner = "Gecode";
repo = "gecode";
rev = "release-${version}";
sha256 = "1ijjy8ppx7djnkrkawsd00rmlf24qh1z13aap0h1azailw1pbrg4";
sha256 = "07jyx17qsfx3wmd2zlcs0rxax8h3cs2g9aapxkdjdcsmfxsldqb7";
};
enableParallelBuilding = true;

View file

@ -1,52 +1,69 @@
diff --git a/data/meson.build b/data/meson.build
index f826864..8b8a25e 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -7,7 +7,7 @@
@@ -7,7 +7,7 @@ if get_option('enable-backend')
conf.set('demo_agent', '')
endif
- conf_dir = join_paths(get_option('sysconfdir'), 'geoclue')
- conf_dir = join_paths(sysconfdir, 'geoclue')
+ conf_dir = join_paths(sysconfdir_install, 'geoclue')
configure_file(output: 'geoclue.conf',
input: 'geoclue.conf.in',
configuration: conf,
@@ -26,7 +26,7 @@
@@ -26,7 +26,7 @@ if get_option('enable-backend')
# DBus Service policy file
dbus_service_dir = get_option('dbus-sys-dir')
if dbus_service_dir == ''
- dbus_service_dir = join_paths(get_option('sysconfdir'), 'dbus-1', 'system.d')
if dbus_service_dir == ''
- dbus_service_dir = join_paths(sysconfdir, 'dbus-1', 'system.d')
+ dbus_service_dir = join_paths(sysconfdir_install, 'dbus-1', 'system.d')
endif
configure_file(output: 'org.freedesktop.GeoClue2.conf',
input: 'org.freedesktop.GeoClue2.conf.in',
diff --git a/demo/meson.build b/demo/meson.build
index 99c094f..a29ca96 100644
--- a/demo/meson.build
+++ b/demo/meson.build
@@ -56,8 +56,7 @@
@@ -56,7 +56,7 @@ if get_option('demo-agent')
install_dir: desktop_dir)
# Also install in the autostart directory.
- autostart_dir = join_paths(get_option('prefix'),
- get_option('sysconfdir'),
+ autostart_dir = join_paths(sysconfdir_install,
'xdg', 'autostart')
- autostart_dir = join_paths(sysconfdir, 'xdg', 'autostart')
+ autostart_dir = join_paths(sysconfdir_install, 'xdg', 'autostart')
meson.add_install_script('install-file.py',
desktop_file.full_path(),
autostart_dir)
diff --git a/meson.build b/meson.build
index d738ef6..c794a1d 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,11 @@
@@ -12,7 +12,11 @@ gclue_api_version='2.0'
datadir = join_paths(get_option('prefix'), get_option('datadir'))
conf.set_quoted('LOCALEDIR', datadir + '/locale')
conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
includedir = join_paths(get_option('prefix'), get_option('includedir'))
libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
-sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
+if get_option('sysconfdir_install') != ''
+ sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'))
+else
+ sysconfdir_install = get_option('sysconfdir')
+endif
localedir = join_paths(datadir, 'locale')
configure_file(output: 'config.h', configuration : conf)
configinc = include_directories('.')
header_dir = 'libgeoclue-' + gclue_api_version
@@ -29,7 +33,7 @@ conf.set_quoted('PACKAGE_URL', 'http://www.freedesktop.org/wiki/Software/GeoClue
conf.set_quoted('PACKAGE_BUGREPORT', 'http://bugs.freedesktop.org/enter_bug.cgi?product=GeoClue')
conf.set_quoted('TEST_SRCDIR', meson.source_root() + '/data/')
conf.set_quoted('LOCALEDIR', localedir)
-conf.set_quoted('SYSCONFDIR', sysconfdir)
+conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source'))
conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source'))
conf.set10('GCLUE_USE_MODEM_GPS_SOURCE', get_option('modem-gps-source'))
diff --git a/meson_options.txt b/meson_options.txt
index 83bc60e..b726329 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,3 +34,6 @@
@@ -34,3 +34,6 @@ option('systemd-system-unit-dir',
option('dbus-srv-user',
type: 'string', value: 'root',
description: 'The user (existing) as which the service will run')

View file

@ -6,15 +6,15 @@
with stdenv.lib;
stdenv.mkDerivation rec {
name = "geoclue-${version}";
version = "2.5.1";
pname = "geoclue";
version = "2.5.2";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "geoclue";
repo = "geoclue";
owner = pname;
repo = pname;
rev = version;
sha256 = "0vww6irijw5ss7vawkdi5z5wdpcgw4iqljn5vs3vbd4y3d0lzrbs";
sha256 = "1zk6n28q030a9v03whad928b9zwq16d30ch369qv2c0994axdr5p";
};
patches = [

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
name = "hpx-${version}";
version = "1.2.0";
version = "1.2.1";
src = fetchFromGitHub {
owner = "STEllAR-GROUP";
repo = "hpx";
rev = "${version}";
sha256 = "1rliv42glns60bpmmvmgrglgmii42p8bmji349r6mr68f48iv4dx";
sha256 = "18dk9413qcgljdlw2jfkk21lwi4iwc57s41yqnc3jp8vdj96w32s";
};
buildInputs = [ boost hwloc gperftools ];

View file

@ -1,12 +1,12 @@
{ stdenv, fetchurl, libtiff, libjpeg, proj, zlib}:
stdenv.mkDerivation rec {
version = "1.4.2";
version = "1.4.3";
name = "libgeotiff-${version}";
src = fetchurl {
url = "https://download.osgeo.org/geotiff/libgeotiff/${name}.tar.gz";
sha256 = "0vjy3bwfhljjx66p9w999i4mdhsf7vjshx29yc3pn5livf5091xd";
sha256 = "0rbjqixi4c8yz19larlzq6jda0px2gpmpp9c52cyhplbjsdhsldq";
};
configureFlags = [

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "libpqxx";
version = "6.3.1";
version = "6.3.3";
src = fetchFromGitHub {
owner = "jtv";
repo = pname;
rev = version;
sha256 = "15na6iq4mspfa5vgayqzs0wqkqq9nk23d05qwn6xc3gpna2kyqsv";
sha256 = "1gfi4ghnhzlkdza2ifvg6b2rk5qn0swq7ykphwmwalb166vj2wlx";
};
nativeBuildInputs = [ gnused python2 ];

View file

@ -3,11 +3,11 @@
stdenv.mkDerivation rec {
pname = "libsecret";
version = "0.18.7";
version = "0.18.8";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "11ylmcfx6ff7xd1gpi58i2nbma83lz2xg0g2dq23w6snqhgzwrhd";
sha256 = "058x64689k55wxfkdp4svhnwvv8jmqm7z5mrynybl38f4sfqiyiv";
};
postPatch = ''

View file

@ -2,15 +2,15 @@
stdenv.mkDerivation rec {
pname = "libusbmuxd";
version = "2018-07-23";
version = "2019-01-18";
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "libimobiledevice";
repo = pname;
rev = "78df9be5fc8222ed53846cb553de9b5d24c85c6c";
sha256 = "05hbn0mbmv5ln9hfsvnf7i1mnp6ncbyfnl5w331kg4fi12wjshc5";
rev = "c75605d862cd1c312494f6c715246febc26b2e05";
sha256 = "0467a045k4znmaz61i7a2s7yywj67q830ja6zn7z39k5pqcl2z4p";
};
nativeBuildInputs = [ autoreconfHook pkgconfig ];

View file

@ -4,8 +4,8 @@ with skawarePackages;
buildPackage {
pname = "nsss";
version = "0.0.1.0";
sha256 = "0f285bvpvhk40cqjpkc1jb36il0fkzzzjmc89gbbq3awl3w4r1i0";
version = "0.0.1.1";
sha256 = "14y1vl7n8vd5fh9bwiwwxxslisli8pz3a2f1sfv12l0p8ngpgm57";
description = "An implementation of a subset of the pwd.h, group.h and shadow.h family of functions.";

View file

@ -3,13 +3,13 @@
stdenv.mkDerivation rec {
pname = "pyotherside";
version = "1.5.3";
version = "1.5.4";
src = fetchFromGitHub {
owner = "thp";
repo = "pyotherside";
rev = version;
sha256 = "1xaw1aarj8gpgpm4z3lk8klbssadrsf3xdyzqx10zcwy16amka7k";
sha256 = "1cmmsmzmis4a463p2fjlzbkpw8r53wfvq3mldyfgmi14dkxr3ln3";
};
nativeBuildInputs = [ qmake ];

View file

@ -65,7 +65,11 @@ let
qtwebengine = [ ./qtwebengine-no-build-skip.patch ]
++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch
++ optional stdenv.isDarwin ./qtwebengine-darwin-sdk-10.10.patch;
qtwebkit = [ ./qtwebkit.patch ];
qtwebkit = [ ./qtwebkit.patch ]
++ optionals stdenv.isDarwin [
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
};
mkDerivation =

View file

@ -0,0 +1,11 @@
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
endif ()
if (APPLE)
- SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
endif ()
if (ENABLE_MATHML)

View file

@ -0,0 +1,45 @@
diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
--- a/Source/JavaScriptCore/shell/CMakeLists.txt
+++ b/Source/JavaScriptCore/shell/CMakeLists.txt
@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
)
if (WTF_OS_MAC_OS_X)
- list(APPEND JSC_LIBRARIES edit)
endif ()
if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -563,7 +563,6 @@
#if PLATFORM(IOS)
#define HAVE_NETWORK_EXTENSION 1
-#define HAVE_READLINE 1
#if USE(APPLE_INTERNAL_SDK)
#define USE_CFNETWORK 1
#endif
@@ -650,7 +649,6 @@
#define HAVE_MADV_DONTNEED 1
#define HAVE_MERGESORT 1
#define HAVE_PTHREAD_SETNAME_NP 1
-#define HAVE_READLINE 1
#define HAVE_SYS_TIMEB_H 1
#if !PLATFORM(GTK) && !PLATFORM(QT)
diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
--- a/Source/WTF/wtf/PlatformMac.cmake
+++ b/Source/WTF/wtf/PlatformMac.cmake
@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED)
find_library(COCOA_LIBRARY Cocoa)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
-find_library(READLINE_LIBRARY Readline)
list(APPEND WTF_LIBRARIES
${COREFOUNDATION_LIBRARY}
${COCOA_LIBRARY}
- ${READLINE_LIBRARY}
libicucore.dylib
)

View file

@ -61,7 +61,11 @@ let
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];
qtwebengine = [ ./qtwebengine-no-build-skip.patch ];
qtwebkit = [ ./qtwebkit.patch ];
qtwebkit = [ ./qtwebkit.patch ]
++ optionals stdenv.isDarwin [
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
};
mkDerivation =

View file

@ -0,0 +1,11 @@
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
endif ()
if (APPLE)
- SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
endif ()
if (ENABLE_MATHML)

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