Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gcc-7
Browse files Browse the repository at this point in the history
  • Loading branch information
fpletz committed Jan 28, 2018
2 parents 3d24ae9 + f596aa0 commit e2c1c76
Show file tree
Hide file tree
Showing 194 changed files with 1,767 additions and 757 deletions.
13 changes: 12 additions & 1 deletion doc/cross-compilation.xml
Expand Up @@ -253,8 +253,19 @@
or also with <varname>crossSystem</varname>, in which case packages run on the latter, but all building happens on the former.
Both parameters take the same schema as the 3 (build, host, and target) platforms defined in the previous section.
As mentioned above, <literal>lib.systems.examples</literal> has some platforms which are used as arguments for these parameters in practice.
You can use them programmatically, or on the command line like <command>nix-build &lt;nixpkgs&gt; --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz'</command>.
You can use them programmatically, or on the command line: <programlisting>
nix-build &lt;nixpkgs&gt; --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz' -A whatever</programlisting>
</para>
<note>
<para>
Eventually we would like to make these platform examples an unnecessary convenience so that <programlisting>
nix-build &lt;nixpkgs&gt; --arg crossSystem.config '&lt;arch&gt;-&lt;os&gt;-&lt;vendor&gt;-&lt;abi&gt;' -A whatever</programlisting>
works in the vast majority of cases.
The problem today is dependencies on other sorts of configuration which aren't given proper defaults.
We rely on the examples to crudely to set those configuration parameters in some vaguely sane manner on the users behalf.
Issue <link xlink:href="https://github.com/NixOS/nixpkgs/issues/34274">#34274</link> tracks this inconvenience along with its root cause in crufty configuration options.
</para>
</note>
<para>
While one is free to pass both parameters in full, there's a lot of logic to fill in missing fields.
As discussed in the previous section, only one of <varname>system</varname>, <varname>config</varname>, and <varname>parsed</varname> is needed to infer the other two.
Expand Down
3 changes: 3 additions & 0 deletions lib/maintainers.nix
Expand Up @@ -610,6 +610,7 @@
schmitthenner = "Fabian Schmitthenner <development@schmitthenner.eu>";
schneefux = "schneefux <schneefux+nixos_pkg@schneefux.xyz>";
schristo = "Scott Christopher <schristopher@konputa.com>";
scode = "Peter Schuller <peter.schuller@infidyne.com>";
scolobb = "Sergiu Ivanov <sivanov@colimite.fr>";
sdll = "Sasha Illarionov <sasha.delly@gmail.com>";
SeanZicari = "Sean Zicari <sean.zicari@gmail.com>";
Expand Down Expand Up @@ -679,6 +680,7 @@
ThomasMader = "Thomas Mader <thomas.mader@gmail.com>";
thoughtpolice = "Austin Seipp <aseipp@pobox.com>";
thpham = "Thomas Pham <thomas.pham@ithings.ch>";
tilpner = "Till Höppner <till@hoeppner.ws>";
timbertson = "Tim Cuthbertson <tim@gfxmonk.net>";
timokau = "Timo Kaufmann <timokau@zoho.com>";
tiramiseb = "Sébastien Maccagnoni <sebastien@maccagnoni.eu>";
Expand All @@ -698,6 +700,7 @@
tvorog = "Marsel Zaripov <marszaripov@gmail.com>";
tweber = "Thorsten Weber <tw+nixpkgs@360vier.de>";
twey = "James ‘Twey’ Kay <twey@twey.co.uk>";
unode = "Renato Alves <alves.rjc@gmail.com>";
uralbash = "Svintsov Dmitry <root@uralbash.ru>";
utdemir = "Utku Demir <me@utdemir.com>";
#urkud = "Yury G. Kudryashov <urkud+nix@ya.ru>"; inactive since 2012
Expand Down
21 changes: 1 addition & 20 deletions lib/systems/examples.nix
Expand Up @@ -11,44 +11,33 @@ rec {

sheevaplug = rec {
config = "armv5tel-unknown-linux-gnueabi";
bigEndian = false;
arch = "armv5tel";
float = "soft";
withTLS = true;
libc = "glibc";
platform = platforms.sheevaplug;
openssl.system = "linux-generic32";
};

raspberryPi = rec {
config = "armv6l-unknown-linux-gnueabihf";
bigEndian = false;
arch = "armv6l";
float = "hard";
fpu = "vfp";
withTLS = true;
libc = "glibc";
platform = platforms.raspberrypi;
openssl.system = "linux-generic32";
};

armv7l-hf-multiplatform = rec {
config = "arm-unknown-linux-gnueabihf";
bigEndian = false;
arch = "armv7-a";
float = "hard";
fpu = "vfpv3-d16";
withTLS = true;
libc = "glibc";
platform = platforms.armv7l-hf-multiplatform;
openssl.system = "linux-generic32";
};

aarch64-multiplatform = rec {
config = "aarch64-unknown-linux-gnu";
bigEndian = false;
arch = "aarch64";
withTLS = true;
libc = "glibc";
platform = platforms.aarch64-multiplatform;
};
Expand All @@ -62,24 +51,16 @@ rec {
arch = "armv5tel";
config = "armv5tel-unknown-linux-gnueabi";
float = "soft";

platform = platforms.pogoplug4;

libc = "glibc";

withTLS = true;
openssl.system = "linux-generic32";
platform = platforms.pogoplug4;
};

fuloongminipc = rec {
config = "mips64el-unknown-linux-gnu";
bigEndian = false;
arch = "mips";
float = "hard";
withTLS = true;
libc = "glibc";
platform = platforms.fuloong2f_n32;
openssl.system = "linux-generic32";
};

#
Expand Down
7 changes: 5 additions & 2 deletions lib/systems/inspect.nix
Expand Up @@ -5,15 +5,18 @@ with lib.lists;

rec {
patterns = rec {
"32bit" = { cpu = { bits = 32; }; };
"64bit" = { cpu = { bits = 64; }; };
i686 = { cpu = cpuTypes.i686; };
x86_64 = { cpu = cpuTypes.x86_64; };
PowerPC = { cpu = cpuTypes.powerpc; };
x86 = { cpu = { family = "x86"; }; };
Arm = { cpu = { family = "arm"; }; };
Aarch64 = { cpu = { family = "aarch64"; }; };
Mips = { cpu = { family = "mips"; }; };
RiscV = { cpu = { family = "riscv"; }; };
Wasm = { cpu = { family = "wasm"; }; };

"32bit" = { cpu = { bits = 32; }; };
"64bit" = { cpu = { bits = 64; }; };
BigEndian = { cpu = { significantByte = significantBytes.bigEndian; }; };
LittleEndian = { cpu = { significantByte = significantBytes.littleEndian; }; };

Expand Down
4 changes: 4 additions & 0 deletions lib/systems/parse.nix
Expand Up @@ -44,6 +44,10 @@ rec {
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; };
mips64el = { bits = 32; significantByte = littleEndian; family = "mips"; };
powerpc = { bits = 32; significantByte = bigEndian; family = "power"; };
riscv32 = { bits = 32; significantByte = littleEndian; family = "riscv"; };
riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
wasm32 = { bits = 32; significantByte = littleEndian; family = "wasm"; };
wasm64 = { bits = 64; significantByte = littleEndian; family = "wasm"; };
};

isVendor = isType "vendor";
Expand Down
3 changes: 0 additions & 3 deletions nixos/modules/config/power-management.nix
Expand Up @@ -69,9 +69,6 @@ in

config = mkIf cfg.enable {

# Leftover for old setups, should be set by nixos-generate-config now
powerManagement.cpuFreqGovernor = mkDefault "ondemand";

systemd.targets.post-resume = {
description = "Post-Resume Actions";
requires = [ "post-resume.service" ];
Expand Down
13 changes: 8 additions & 5 deletions nixos/modules/services/network-filesystems/samba.nix
Expand Up @@ -54,10 +54,12 @@ let
};

serviceConfig = {
ExecStart = "${samba}/sbin/${appName} ${args}";
ExecStart = "${samba}/sbin/${appName} --foreground --no-process-group ${args}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
LimitNOFILE = 16384;
PIDFile = "/run/${appName}.pid";
Type = "notify";
NotifyAccess = "all"; #may not do anything...
};

restartTriggers = [ configFile ];
Expand Down Expand Up @@ -231,11 +233,12 @@ in
after = [ "samba-setup.service" "network.target" ];
wantedBy = [ "multi-user.target" ];
};

# Refer to https://github.com/samba-team/samba/tree/master/packaging/systemd
# for correct use with systemd
services = {
"samba-smbd" = daemonService "smbd" "-F";
"samba-nmbd" = mkIf cfg.enableNmbd (daemonService "nmbd" "-F");
"samba-winbindd" = mkIf cfg.enableWinbindd (daemonService "winbindd" "-F");
"samba-smbd" = daemonService "smbd" "";
"samba-nmbd" = mkIf cfg.enableNmbd (daemonService "nmbd" "");
"samba-winbindd" = mkIf cfg.enableWinbindd (daemonService "winbindd" "");
"samba-setup" = {
description = "Samba Setup Task";
script = setupScript;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/container-config.nix
Expand Up @@ -11,7 +11,7 @@ with lib;
services.udisks2.enable = mkDefault false;
powerManagement.enable = mkDefault false;

networking.useHostResolvConf = true;
networking.useHostResolvConf = mkDefault true;

# Containers should be light-weight, so start sshd on demand.
services.openssh.startWhenNeeded = mkDefault true;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/statsd.nix
@@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, lib }:
import ./make-test.nix ({ pkgs, lib, ... }:

with lib;

Expand Down
89 changes: 89 additions & 0 deletions pkgs/applications/altcoins/monero-gui/default.nix
@@ -0,0 +1,89 @@
{ stdenv, fetchFromGitHub
, makeWrapper, makeDesktopItem
, qtbase, qmake, qtmultimedia, qttools
, qtgraphicaleffects, qtdeclarative
, qtlocation, qtquickcontrols, qtwebchannel
, qtwebengine, qtx11extras, qtxmlpatterns
, monero, unbound, readline, boost, libunwind
}:

with stdenv.lib;

stdenv.mkDerivation rec {
name = "monero-gui-${version}";
version = "0.11.1.0";

src = fetchFromGitHub {
owner = "monero-project";
repo = "monero-gui";
rev = "v${version}";
sha256 = "01d7apwrv8j8bh7plvvhlnll3ransaha3n6rx19nkgvfn319hswq";
};

nativeBuildInputs = [ qmake ];

buildInputs = [
qtbase qtmultimedia qtgraphicaleffects
qtdeclarative qtlocation qtquickcontrols
qtwebchannel qtwebengine qtx11extras
qtxmlpatterns monero unbound readline
boost libunwind makeWrapper
];

patches = [
./move-log-file.patch
./move-translations-dir.patch
];

postPatch = ''
echo '
var GUI_VERSION = "${version}";
var GUI_MONERO_VERSION = "${getVersion monero}";
' > version.js
substituteInPlace monero-wallet-gui.pro \
--replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease'
substituteInPlace src/daemon/DaemonManager.cpp \
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
'';

makeFlags = [ "INSTALL_ROOT=$(out)" ];

preBuild = ''
sed -i s#/opt/monero-wallet-gui##g Makefile
make -C src/zxcvbn-c
'';

desktopItem = makeDesktopItem {
name = "monero-wallet-gui";
exec = "monero-wallet-gui";
icon = "monero";
desktopName = "Monero Wallet";
genericName = "Wallet";
categories = "Application;Network;Utility;";
};

postInstall = ''
# install desktop entry
mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications
# install translations
cp -r release/bin/translations $out/share/
# install icons
for n in 16 24 32 48 64 96 128 256; do
size=$n"x"$n
mkdir -p $out/share/icons/hicolor/$size/apps
cp $src/images/appicons/$size.png \
$out/share/icons/hicolor/$size/apps/monero.png
done;
'';

meta = {
description = "Private, secure, untraceable currency";
homepage = https://getmonero.org/;
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ rnhmjoj ];
};
}
42 changes: 42 additions & 0 deletions pkgs/applications/altcoins/monero-gui/move-log-file.patch
@@ -0,0 +1,42 @@
diff --git a/main.cpp b/main.cpp
index 1a9a979..2316929 100644
--- a/main.cpp
+++ b/main.cpp
@@ -74,10 +74,6 @@ int main(int argc, char *argv[])
// qDebug() << "High DPI auto scaling - enabled";
//#endif

- // Log settings
- Monero::Wallet::init(argv[0], "monero-wallet-gui");
-// qInstallMessageHandler(messageHandler);
-
MainApp app(argc, argv);

qDebug() << "app startd";
@@ -86,6 +82,13 @@ int main(int argc, char *argv[])
app.setOrganizationDomain("getmonero.org");
app.setOrganizationName("monero-project");

+ // Log settings
+ QString logfile =
+ QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+ + "/monero-wallet-gui.log";
+ Monero::Wallet::init(argv[0], logfile.toUtf8().constData());
+
+
filter *eventFilter = new filter;
app.installEventFilter(eventFilter);

diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index 8525bf3..6967b24 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -613,7 +613,7 @@ QString Wallet::getDaemonLogPath() const

QString Wallet::getWalletLogPath() const
{
- return QCoreApplication::applicationDirPath() + "/monero-wallet-gui.log";
+ return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/monero-wallet-gui.log";
}

Wallet::Wallet(Monero::Wallet *w, QObject *parent)
14 changes: 14 additions & 0 deletions pkgs/applications/altcoins/monero-gui/move-translations-dir.patch
@@ -0,0 +1,14 @@
diff --git a/TranslationManager.cpp b/TranslationManager.cpp
index fa39d35..5a410f7 100644
--- a/TranslationManager.cpp
+++ b/TranslationManager.cpp
@@ -29,7 +29,7 @@ bool TranslationManager::setLanguage(const QString &language)
#ifdef Q_OS_MACX
QString dir = qApp->applicationDirPath() + "/../Resources/translations";
#else
- QString dir = qApp->applicationDirPath() + "/translations";
+ QString dir = qApp->applicationDirPath() + "/../share/translations";
#endif

QString filename = "monero-core_" + language;

0 comments on commit e2c1c76

Please sign in to comment.