···641641- [pypi2nix](https://github.com/garbas/pypi2nix) by Rok Garbas
642642- [pypi2nix](https://github.com/offlinehacker/pypi2nix) by Jaka Hudoklin
643643644644+### Deterministic builds
645645+646646+Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly.
647647+Minor modifications had to be made to the interpreters in order to generate
648648+deterministic bytecode. This has security implications and is relevant for
649649+those using Python in a `nix-shell`.
650650+651651+When the environment variable `DETERMINISTIC_BUILD` is set, all bytecode will have timestamp 1.
652652+The `buildPythonPackage` function sets `DETERMINISTIC_BUILD` as well as
653653+[PYTHONHASHSEED](https://docs.python.org/3.5/using/cmdline.html#envvar-PYTHONHASHSEED).
654654+Both are also exported in `nix-shell`.
655655+656656+644657## FAQ
645658646659### How can I install a working Python environment?
+10
nixos/doc/manual/release-notes/rl-1703.xml
···271271 </para>
272272 </listitem>
273273274274+ <listitem>
275275+ <para>
276276+ Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly.
277277+ Minor modifications had to be made to the interpreters in order to generate
278278+ deterministic bytecode. This has security implications and is relevant for
279279+ those using Python in a <literal>nix-shell</literal>. See the Nixpkgs manual
280280+ for details.
281281+ </para>
282282+ </listitem>
283283+274284</itemizedlist>
275285276286
···33compressManPages() {
44 local dir="$1"
5566- if [ ! -d "$dir/share/man" ]; then return; fi
77- echo "gzipping man pages in $dir"
66+ if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]
77+ then return
88+ fi
99+ echo "gzipping man pages under $dir/share/man/"
81099- GLOBIGNORE=.:..:*.gz:*.bz2
1010-1111- for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
1212- if [ -f "$f" -a ! -L "$f" ]; then
1313- if gzip -c -n "$f" > "$f".gz; then
1414- rm "$f"
1515- else
1616- rm "$f".gz
1717- fi
1111+ # Compress all uncompressed manpages. Don't follow symlinks, etc.
1212+ find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\)$' -print0 \
1313+ | while IFS= read -r -d $'\0' f
1414+ do
1515+ if gzip -c -n "$f" > "$f".gz; then
1616+ rm "$f"
1717+ else
1818+ rm "$f".gz
1819 fi
1920 done
20212121- for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
2222- if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then
2323- ln -sf `readlink "$f"`.gz "$f".gz && rm "$f"
2222+ # Point symlinks to compressed manpages.
2323+ find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\)$' -print0 \
2424+ | while IFS= read -r -d $'\0' f
2525+ do
2626+ local target
2727+ target="$(readlink -f "$f")"
2828+ if [ -f "$target".gz ]; then
2929+ ln -sf "$target".gz "$f".gz && rm "$f"
2430 fi
2531 done
2626-2727- unset GLOBIGNORE
2832}
···57575858 inherit pythonPath;
59596060- # patch python interpreter to write null timestamps when compiling python files
6161- # this way python doesn't try to update them when we freeze timestamps in nix store
6060+6161+ # Determinism: The interpreter is patched to write null timestamps when compiling python files.
6262+ # This way python doesn't try to update them when we freeze timestamps in nix store.
6263 DETERMINISTIC_BUILD=1;
6464+ # Determinism: We fix the hashes of str, bytes and datetime objects.
6565+ PYTHONHASHSEED = 0;
63666467 buildInputs = [ wrapPython ] ++ buildInputs ++ pythonPath
6568 ++ [ (ensureNewerSourcesHook { year = "1980"; }) ]
+11-1
pkgs/development/libraries/libevent/default.nix
···2323 | grep -v '^dh-autoreconf' | sed 's|^|debian/patches/|')"
2424 '';
25252626- outputs = [ "out" "dev" ];
2626+ # libevent_openssl is moved into its own output, so that openssl isn't present
2727+ # in the default closure.
2828+ outputs = [ "out" "dev" "openssl" ];
2729 outputBin = "dev";
3030+ propagatedBuildOutputs = [ "out" "openssl" ];
28312932 buildInputs = [ openssl ] ++ stdenv.lib.optional stdenv.isCygwin findutils;
3333+3434+ postInstall = ''
3535+ moveToOutput "lib/libevent_openssl*" "$openssl"
3636+ substituteInPlace "$dev/lib/pkgconfig/libevent_openssl.pc" \
3737+ --replace "$out" "$openssl"
3838+ sed "/^libdir=/s|$out|$openssl|" -i "$openssl"/lib/libevent_openssl.la
3939+ '';
30403141 meta = with stdenv.lib; {
3242 description = "Event notification library";
···15151616 patches = [ ./ploticus-install.patch ];
17171818+ # Make the symlink relative instead of absolute.
1919+ # Otherwise it breaks when auto-moved to $out/share.
2020+ preFixup = ''
2121+ ln -sf pl.1 "$out"/man/man1/ploticus.1
2222+ '';
2323+1824 meta = with stdenv.lib; {
1925 description = "A non-interactive software package for producing plots and charts";
2026 longDescription = ''Ploticus is a free, GPL'd, non-interactive