Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/staging' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Jan 2, 2018
2 parents 63c1a54 + 4cc2a38 commit 804285f
Show file tree
Hide file tree
Showing 408 changed files with 3,405 additions and 2,484 deletions.
41 changes: 40 additions & 1 deletion doc/cross-compilation.xml
Expand Up @@ -187,7 +187,7 @@
How does this work in practice? Nixpkgs is now structured so that build-time dependencies are taken from <varname>buildPackages</varname>, whereas run-time dependencies are taken from the top level attribute set.
For example, <varname>buildPackages.gcc</varname> should be used at build time, while <varname>gcc</varname> should be used at run time.
Now, for most of Nixpkgs's history, there was no <varname>buildPackages</varname>, and most packages have not been refactored to use it explicitly.
Instead, one can use the four attributes used for specifying dependencies as documented in <xref linkend="ssec-stdenv-attributes"/>.
Instead, one can use the six (<emphasis>gasp</emphasis>) attributes used for specifying dependencies as documented in <xref linkend="ssec-stdenv-dependencies"/>.
We "splice" together the run-time and build-time package sets with <varname>callPackage</varname>, and then <varname>mkDerivation</varname> for each of four attributes pulls the right derivation out.
This splicing can be skipped when not cross compiling as the package sets are the same, but is a bit slow for cross compiling.
Because of this, a best-of-both-worlds solution is in the works with no splicing or explicit access of <varname>buildPackages</varname> needed.
Expand All @@ -200,6 +200,45 @@
</para></note>
</section>

<section>
<title>Cross packagaing cookbook</title>
<para>
Some frequently problems when packaging for cross compilation are good to just spell and answer.
Ideally the information above is exhaustive, so this section cannot provide any new information,
but its ludicrous and cruel to expect everyone to spend effort working through the interaction of many features just to figure out the same answer to the same common problem.
Feel free to add to this list!
</para>
<qandaset>
<qandaentry>
<question><para>
What if my package's build system needs to build a C program to be run under the build environment?
</para></question>
<answer><para>
<programlisting>depsBuildBuild = [ buildPackages.stdenv.cc ];</programlisting>
Add it to your <function>mkDerivation</function> invocation.
</para></answer>
</qandaentry>
<qandaentry>
<question><para>
My package fails to find <command>ar</command>.
</para></question>
<answer><para>
Many packages assume that an unprefixed <command>ar</command> is available, but Nix doesn't provide one.
It only provides a prefixed one, just as it only does for all the other binutils programs.
It may be necessary to patch the package to fix the build system to use a prefixed `ar`.
</para></answer>
</qandaentry>
<qandaentry>
<question><para>
My package's testsuite needs to run host platform code.
</para></question>
<answer><para>
<programlisting>doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom;</programlisting>
Add it to your <function>mkDerivation</function> invocation.
</para></answer>
</qandaentry>
</qandaset>
</section>
</section>

<!--============================================================-->
Expand Down
357 changes: 318 additions & 39 deletions doc/stdenv.xml

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions nixos/doc/manual/release-notes/rl-1803.xml
Expand Up @@ -20,6 +20,22 @@ has the following highlights: </para>
<itemizedlist>
<listitem>
<para>
MariaDB 10.2, updated from 10.1, is now the default MySQL implementation. While upgrading a few changes
have been made to the infrastructure involved:
<itemizedlist>
<listitem>
<para>
<literal>libmysql</literal> has been deprecated, please use <literal>mysql.connector-c</literal>
instead, a compatibility passthru has been added to the MySQL packages.
</para>
</listitem>
<listitem>
<para>
The <literal>mysql57</literal> package has a new <literal>static</literal> output containing
the static libraries including <literal>libmysqld.a</literal>
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
Expand Down Expand Up @@ -103,6 +119,18 @@ following incompatible changes:</para>
Other more obscure ones are just moved.
</para>
</listitem>
<listitem>
<para>
The propagation logic has been changed.
The new logic, along with new types of dependencies that go with, is thoroughly documented in the "Specifying dependencies" section of the "Standard Environment" chapter of the nixpkgs manual.
<!-- That's <xref linkend="ssec-stdenv-attributes"> were we to merge the manuals. -->
The old logic isn't but is easy to describe: dependencies were propagated as the same type of dependency no matter what.
In practice, that means that many <function>propagatedNativeBuildInputs</function> should instead be <function>propagatedBuildInputs</function>.
Thankfully, that was and is the least used type of dependency.
Also, it means that some <function>propagatedBuildInputs</function> should instead be <function>depsTargetTargetPropagated</function>.
Other types dependencies should be unaffected.
</para>
</listitem>
</itemizedlist>

</section>
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/misc/ids.nix
Expand Up @@ -65,7 +65,7 @@
foldingathome = 37;
sabnzbd = 38;
#kdm = 39; # dropped in 17.03
ghostone = 40;
#ghostone = 40; # dropped in 18.03
git = 41;
fourstore = 42;
fourstorehttp = 43;
Expand Down Expand Up @@ -348,7 +348,7 @@
#foldingathome = 37; # unused
#sabnzd = 38; # unused
#kdm = 39; # unused, even before 17.03
ghostone = 40;
#ghostone = 40; # dropped in 18.03
git = 41;
fourstore = 42;
fourstorehttp = 43;
Expand Down
1 change: 0 additions & 1 deletion nixos/modules/module-list.nix
Expand Up @@ -220,7 +220,6 @@
./services/editors/emacs.nix
./services/editors/infinoted.nix
./services/games/factorio.nix
./services/games/ghost-one.nix
./services/games/minecraft-server.nix
./services/games/minetest-server.nix
./services/games/terraria.nix
Expand Down
17 changes: 4 additions & 13 deletions nixos/modules/services/databases/mysql.nix
Expand Up @@ -7,14 +7,12 @@ let
cfg = config.services.mysql;

mysql = cfg.package;
isMariaDB =

isMariaDB =
let
pName = _p: (builtins.parseDrvName (_p.name)).name;
in pName mysql == pName pkgs.mariadb;

atLeast55 = versionAtLeast mysql.mysqlVersion "5.5";

pidFile = "${cfg.pidDir}/mysqld.pid";

mysqldOptions =
Expand All @@ -28,13 +26,6 @@ let
${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
${optionalString (cfg.replication.role == "slave" && !atLeast55)
''
master-host = ${cfg.replication.masterHost}
master-user = ${cfg.replication.masterUser}
master-password = ${cfg.replication.masterPassword}
master-port = ${toString cfg.replication.masterPort}
''}
${optionalString (cfg.ensureUsers != [])
''
plugin-load-add = auth_socket.so
Expand Down Expand Up @@ -315,7 +306,7 @@ in
fi
'') cfg.initialDatabases}
${optionalString (cfg.replication.role == "master" && atLeast55)
${optionalString (cfg.replication.role == "master")
''
# Set up the replication master
Expand All @@ -326,7 +317,7 @@ in
) | ${mysql}/bin/mysql -u root -N
''}
${optionalString (cfg.replication.role == "slave" && atLeast55)
${optionalString (cfg.replication.role == "slave")
''
# Set up the replication slave
Expand Down
105 changes: 0 additions & 105 deletions nixos/modules/services/games/ghost-one.nix

This file was deleted.

5 changes: 3 additions & 2 deletions pkgs/applications/audio/amarok/kf5.nix
Expand Up @@ -3,7 +3,7 @@
, qca-qt5, qjson, qtscript, qtwebkit
, kcmutils, kconfig, kdelibs4support, kdnssd, kinit, knewstuff, knotifyconfig, ktexteditor
, phonon, plasma-framework, threadweaver
, curl, ffmpeg, gdk_pixbuf, libaio, libmtp, loudmouth, lzo, lz4, mariadb, pcre, snappy, taglib, taglib_extras
, curl, ffmpeg, gdk_pixbuf, libaio, libmtp, loudmouth, lzo, lz4, mysql57, pcre, snappy, taglib, taglib_extras
}:

let
Expand All @@ -26,7 +26,8 @@ in mkDerivation {
qca-qt5 qjson qtscript qtwebkit
kcmutils kconfig kdelibs4support kdnssd kinit knewstuff knotifyconfig ktexteditor
phonon plasma-framework threadweaver
curl ffmpeg gdk_pixbuf libaio libmtp loudmouth lz4 lzo mariadb pcre snappy taglib taglib_extras
curl ffmpeg gdk_pixbuf libaio libmtp loudmouth lz4 lzo mysql57.server mysql57.server.static
pcre snappy taglib taglib_extras
];
enableParallelBuilding = true;

Expand Down
23 changes: 14 additions & 9 deletions pkgs/applications/gis/grass/default.nix
Expand Up @@ -4,15 +4,15 @@
}:

stdenv.mkDerivation {
name = "grass-7.0.2";
name = "grass-7.2.2";
src = fetchurl {
url = http://grass.osgeo.org/grass70/source/grass-7.0.2.tar.gz;
sha256 = "02qrdgn46gxr60amxwax4b8fkkmhmjxi6qh4yfvpbii6ai6diarf";
url = http://grass.osgeo.org/grass72/source/grass-7.2.2.tar.gz;
sha256 = "0yzljbrxlqp4wbw08n1dvmm4vmwkg8glf1ff4xyh589r5ryb7gxv";
};

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo
readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.client blas ]
readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.connector-c blas ]
++ (with python2Packages; [ python dateutil wxPython30 numpy ]);

configureFlags = [
Expand All @@ -22,9 +22,12 @@ stdenv.mkDerivation {
"--with-wxwidgets"
"--with-netcdf"
"--with-geos"
"--with-postgres" "--with-postgres-libs=${postgresql.lib}/lib/"
"--with-postgres"
"--with-postgres-libs=${postgresql.lib}/lib/"
# it complains about missing libmysqld but doesn't really seem to need it
"--with-mysql" "--with-mysql-includes=${stdenv.lib.getDev mysql.client}/include/mysql"
"--with-mysql"
"--with-mysql-includes=${mysql.connector-c}/include/mysql"
"--with-mysql-libs=${mysql.connector-c}/lib/mysql"
"--with-blas"
];

Expand All @@ -40,25 +43,28 @@ stdenv.mkDerivation {
scripts/r.pack/r.pack.py \
scripts/r.tileset/r.tileset.py \
scripts/r.unpack/r.unpack.py \
scripts/v.krige/v.krige.py \
scripts/v.rast.stats/v.rast.stats.py \
scripts/v.to.lines/v.to.lines.py \
scripts/v.what.strds/v.what.strds.py \
scripts/v.unpack/v.unpack.py \
scripts/wxpyimgview/*.py \
gui/wxpython/animation/g.gui.animation.py \
gui/wxpython/datacatalog/g.gui.datacatalog.py \
gui/wxpython/rlisetup/g.gui.rlisetup.py \
gui/wxpython/vdigit/g.gui.vdigit.py \
temporal/t.rast.accumulate/t.rast.accumulate.py \
temporal/t.rast.accdetect/t.rast.accdetect.py \
temporal/t.rast.algebra/t.rast.algebra.py \
temporal/t.rast3d.algebra/t.rast3d.algebra.py \
temporal/t.vect.algebra/t.vect.algebra.py \
temporal/t.select/t.select.py
for d in gui lib scripts temporal tools; do
patchShebangs $d
done
'';

postInstall = ''
wrapProgram $out/bin/grass70 \
wrapProgram $out/bin/grass72 \
--set PYTHONPATH $PYTHONPATH \
--set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \
--suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
Expand All @@ -72,6 +78,5 @@ stdenv.mkDerivation {
description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.all;
broken = true;
};
}
1 change: 0 additions & 1 deletion pkgs/applications/graphics/digikam/default.nix
Expand Up @@ -75,7 +75,6 @@ mkDerivation rec {
libqtav
libusb1
mesa
mysql
opencv3
pcre

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/kde/kmime.nix
Expand Up @@ -10,7 +10,7 @@ mkDerivation {
license = [ lib.licenses.lgpl21 ];
maintainers = kdepimTeam;
};
nativeBuildInputs = [ extra-cmake-modules ki18n ];
buildInputs = [ kcodecs qtbase ];
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ kcodecs ki18n qtbase ];
outputs = [ "out" "dev" ];
}
4 changes: 2 additions & 2 deletions pkgs/applications/kde/libkcddb.nix
Expand Up @@ -8,8 +8,8 @@ mkDerivation {
license = with licenses; [ gpl2 lgpl21 bsd3 ];
maintainers = with maintainers; [ peterhoeg ];
};
nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ qtbase kdoctools ];
nativeBuildInputs = [ extra-cmake-modules kdoctools ];
buildInputs = [ qtbase ];
propagatedBuildInputs = [
kcodecs ki18n kio kwidgetsaddons
libmusicbrainz5
Expand Down

5 comments on commit 804285f

@mdorman
Copy link
Contributor

@mdorman mdorman commented on 804285f Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhere in here you broke the emacsWithPackages expression.

I'm going to guess (since, IIRC, it's happened before) that it's @Ericson2314, but there's an awful lot of stuff from @FRidh, too.

I will attempt to bisect, but you're really making this stuff as hard as possible for others by doing these gigantic changes all at once.

@FRidh
Copy link
Member Author

@FRidh FRidh commented on 804285f Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My work includes only package updates as well as exporting an additional environment variable when python is part of a build. I suggest you open an issue and describe in more detail what is broken.

I will attempt to bisect, but you're really making this stuff as hard as possible for others by doing these gigantic changes all at once.

Well, they're not all at once really. It is just that Nixpkgs is changing all the time :)

@Ericson2314
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I broke that. Sorry forgot I did when I merged my big PR to staging.

@mdorman
Copy link
Contributor

@mdorman mdorman commented on 804285f Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The symptoms are the same as #27873

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented on 804285f Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is different, though. findInputs no longer accumulates in a given variable. It needs 6 and all this crazy indirection stuff, and it was just too cumbersome to make it take parameters. I'll hand-roll something to do what emacs needs (python has this sort of replacement too).

Please sign in to comment.