summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2018-08-31 17:32:48 +0200
committerRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2018-08-31 17:32:48 +0200
commit93550cbddfeacd4902bebbfaab2c9c3d337f5650 (patch)
treedf3259694e2c0ab3ae79449601880ce68e365f7e /pkgs/tools/misc
parenta9780a095bd05c5104c643f927a680194d040a92 (diff)
parentdde959a8965af69e19a4bf7b246095a97dc3dbc8 (diff)
downloadnixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar.gz
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar.bz2
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar.lz
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar.xz
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.tar.zst
nixlib-93550cbddfeacd4902bebbfaab2c9c3d337f5650.zip
Merge branch 'master' into staging-next
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/bandwidth/default.nix10
-rw-r--r--pkgs/tools/misc/coreutils/default.nix25
-rw-r--r--pkgs/tools/misc/execline/default.nix2
-rw-r--r--pkgs/tools/misc/findutils/default.nix9
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix12
-rw-r--r--pkgs/tools/misc/grub/pvgrub_image/default.nix8
-rw-r--r--pkgs/tools/misc/grub/trusted.nix4
-rw-r--r--pkgs/tools/misc/mongodb-compass/default.nix4
-rw-r--r--pkgs/tools/misc/mprime/default.nix14
-rw-r--r--pkgs/tools/misc/ocz-ssd-guru/default.nix2
-rw-r--r--pkgs/tools/misc/os-prober/default.nix2
-rw-r--r--pkgs/tools/misc/otfcc/default.nix4
-rw-r--r--pkgs/tools/misc/pspg/default.nix4
-rw-r--r--pkgs/tools/misc/s6-portable-utils/default.nix2
-rw-r--r--pkgs/tools/misc/staruml/default.nix2
-rw-r--r--pkgs/tools/misc/ttyrec/default.nix4
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix4
17 files changed, 55 insertions, 57 deletions
diff --git a/pkgs/tools/misc/bandwidth/default.nix b/pkgs/tools/misc/bandwidth/default.nix
index e8ea9117bc5a..e50faaca8995 100644
--- a/pkgs/tools/misc/bandwidth/default.nix
+++ b/pkgs/tools/misc/bandwidth/default.nix
@@ -2,11 +2,11 @@
 
 let
   arch =
-    if      stdenv.system == "x86_64-linux" then "bandwidth64"
-    else if stdenv.system == "i686-linux" then "bandwidth32"
-    else if stdenv.system == "x86_64-darwin" then "bandwidth-mac64"
-    else if stdenv.system == "i686-darwin" then "bandwidth-mac32"
-    else if stdenv.system == "i686-cygwin" then "bandwidth-win32"
+    if      stdenv.hostPlatform.system == "x86_64-linux" then "bandwidth64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "bandwidth32"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "bandwidth-mac64"
+    else if stdenv.hostPlatform.system == "i686-darwin" then "bandwidth-mac32"
+    else if stdenv.hostPlatform.system == "i686-cygwin" then "bandwidth-win32"
     else throw "Unknown architecture";
 in
 stdenv.mkDerivation rec {
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 69d751a629ea..6ffdd3b5d47d 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -1,6 +1,5 @@
 { stdenv, lib, buildPackages
 , autoreconfHook, texinfo, fetchurl, perl, xz, libiconv, gmp ? null
-, hostPlatform, buildPlatform
 , aclSupport ? false, acl ? null
 , attrSupport ? false, attr ? null
 , selinuxSupport? false, libselinux ? null, libsepol ? null
@@ -21,10 +20,10 @@ stdenv.mkDerivation rec {
     sha256 = "0plm1zs9il6bb5mk881qvbghq4glc8ybbgakk2lfzb0w64fgml4j";
   };
 
-  patches = optional hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
+  patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
 
   # The test tends to fail on btrfs and maybe other unusual filesystems.
-  postPatch = optionalString (!hostPlatform.isDarwin) ''
+  postPatch = optionalString (!stdenv.hostPlatform.isDarwin) ''
     sed '2i echo Skipping dd sparse test && exit 0' -i ./tests/dd/sparse.sh
     sed '2i echo Skipping cp sparse test && exit 0' -i ./tests/cp/sparse.sh
     sed '2i echo Skipping rm deep-2 test && exit 0' -i ./tests/rm/deep-2.sh
@@ -40,9 +39,9 @@ stdenv.mkDerivation rec {
   configureFlags =
     optional (singleBinary != false)
       ("--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}")
-    ++ optional hostPlatform.isSunOS "ac_cv_func_inotify_init=no"
+    ++ optional stdenv.hostPlatform.isSunOS "ac_cv_func_inotify_init=no"
     ++ optional withPrefix "--program-prefix=g"
-    ++ optionals (hostPlatform != buildPlatform && hostPlatform.libc == "glibc") [
+    ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "glibc") [
       # TODO(19b98110126fde7cbb1127af7e3fe1568eacad3d): Needed for fstatfs() I
       # don't know why it is not properly detected cross building with glibc.
       "fu_cv_sys_stat_statfs2_bsize=yes"
@@ -52,37 +51,37 @@ stdenv.mkDerivation rec {
   buildInputs = [ gmp ]
     ++ optional aclSupport acl
     ++ optional attrSupport attr
-    ++ optionals hostPlatform.isCygwin [ autoreconfHook texinfo ]   # due to patch
+    ++ optionals stdenv.hostPlatform.isCygwin [ autoreconfHook texinfo ]   # due to patch
     ++ optionals selinuxSupport [ libselinux libsepol ]
        # TODO(@Ericson2314): Investigate whether Darwin could benefit too
-    ++ optional (hostPlatform != buildPlatform && hostPlatform.libc != "glibc") libiconv;
+    ++ optional (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc != "glibc") libiconv;
 
   # The tests are known broken on Cygwin
   # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
   # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
   # and {Open,Free}BSD.
   # With non-standard storeDir: https://github.com/NixOS/nix/issues/512
-  doCheck = hostPlatform == buildPlatform
-    && hostPlatform.libc == "glibc"
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform
+    && stdenv.hostPlatform.libc == "glibc"
     && builtins.storeDir == "/nix/store";
 
   # Prevents attempts of running 'help2man' on cross-built binaries.
-  PERL = if hostPlatform == buildPlatform then null else "missing";
+  PERL = if stdenv.hostPlatform == stdenv.buildPlatform then null else "missing";
 
   # Saw random failures like ‘help2man: can't get '--help' info from
   # man/sha512sum.td/sha512sum’.
   enableParallelBuilding = false;
 
   NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
-  FORCE_UNSAFE_CONFIGURE = optionalString hostPlatform.isSunOS "1";
+  FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
 
   # Works around a bug with 8.26:
   # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually).  Stop.
-  preInstall = optionalString (hostPlatform != buildPlatform) ''
+  preInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     sed -i Makefile -e 's|^INSTALL =.*|INSTALL = ${buildPackages.coreutils}/bin/install -c|'
   '';
 
-  postInstall = optionalString (hostPlatform != buildPlatform) ''
+  postInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     rm $out/share/man/man1/*
     cp ${buildPackages.coreutils}/share/man/man1/* $out/share/man/man1
   '';
diff --git a/pkgs/tools/misc/execline/default.nix b/pkgs/tools/misc/execline/default.nix
index 0b606882a5c3..360808f4280b 100644
--- a/pkgs/tools/misc/execline/default.nix
+++ b/pkgs/tools/misc/execline/default.nix
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
     "--with-dynlib=${skalibs.lib}/lib"
   ]
   ++ (if stdenv.isDarwin then [ "--disable-shared" ] else [ "--enable-shared" ])
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/execline
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 66b7ef4c2919..d6eca100411b 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -1,6 +1,5 @@
 { stdenv, fetchurl
 , coreutils
-, buildPlatform, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
@@ -17,10 +16,10 @@ stdenv.mkDerivation rec {
 
   # Since glibc-2.25 the i686 tests hang reliably right after test-sleep.
   doCheck
-    =  !hostPlatform.isDarwin
-    && !(hostPlatform.libc == "glibc" && hostPlatform.isi686)
-    && (hostPlatform.libc != "musl")
-    && hostPlatform == buildPlatform;
+    =  !stdenv.hostPlatform.isDarwin
+    && !(stdenv.hostPlatform.libc == "glibc" && stdenv.hostPlatform.isi686)
+    && (stdenv.hostPlatform.libc != "musl")
+    && stdenv.hostPlatform == stdenv.buildPlatform;
 
   outputs = [ "out" "info" ];
 
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index 63511782f00b..481a07ef491b 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -28,8 +28,8 @@ let
     "aarch64-linux".target = "arm64";
   };
 
-  canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild);
-  inPCSystems = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) pcSystems);
+  canEfi = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild);
+  inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems);
 
   version = "2.02";
 
@@ -86,14 +86,14 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-grub-mount" ] # dep of os-prober
     ++ optional zfsSupport "--enable-libzfs"
-    ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.system}.target}" "--program-prefix=" ]
-    ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.system}.target}"];
+    ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ]
+    ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}"];
 
   # save target that grub is compiled for
   grubTarget = if efiSupport
-               then "${efiSystemsInstall.${stdenv.system}.target}-efi"
+               then "${efiSystemsInstall.${stdenv.hostPlatform.system}.target}-efi"
                else if inPCSystems
-                    then "${pcSystems.${stdenv.system}.target}-pc"
+                    then "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"
                     else "";
 
   doCheck = false;
diff --git a/pkgs/tools/misc/grub/pvgrub_image/default.nix b/pkgs/tools/misc/grub/pvgrub_image/default.nix
index df5e3f15e95a..19d8afb18575 100644
--- a/pkgs/tools/misc/grub/pvgrub_image/default.nix
+++ b/pkgs/tools/misc/grub/pvgrub_image/default.nix
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
     tar -cf memdisk.tar grub.cfg
     # We include all modules except all_video.mod as otherwise grub will fail printing "no symbol table"
     # if we include it.
-    grub-mkimage -O "${efiSystemsBuild.${stdenv.system}.target}-xen" -c grub-bootstrap.cfg \
-      -m memdisk.tar -o "grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin" \
-      $(ls "${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.system}.target}-xen/" |grep 'mod''$'|grep -v '^all_video\.mod''$')
+    grub-mkimage -O "${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen" -c grub-bootstrap.cfg \
+      -m memdisk.tar -o "grub-${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen.bin" \
+      $(ls "${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen/" |grep 'mod''$'|grep -v '^all_video\.mod''$')
     mkdir -p "$out/lib/grub-xen"
-    cp "grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin" $out/lib/grub-xen/
+    cp "grub-${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen.bin" $out/lib/grub-xen/
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/misc/grub/trusted.nix b/pkgs/tools/misc/grub/trusted.nix
index 63a73658e0ac..0e867d7cffd0 100644
--- a/pkgs/tools/misc/grub/trusted.nix
+++ b/pkgs/tools/misc/grub/trusted.nix
@@ -10,7 +10,7 @@ let
     "x86_64-linux".target = "i386";
   };
 
-  inPCSystems = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) pcSystems);
+  inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems);
 
   version = if for_HP_laptop then "1.2.1" else "1.2.0";
 
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
 
   # save target that grub is compiled for
   grubTarget = if inPCSystems
-               then "${pcSystems.${stdenv.system}.target}-pc"
+               then "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"
                else "";
 
   doCheck = false;
diff --git a/pkgs/tools/misc/mongodb-compass/default.nix b/pkgs/tools/misc/mongodb-compass/default.nix
index f8475ee2e0e0..840d4eacd378 100644
--- a/pkgs/tools/misc/mongodb-compass/default.nix
+++ b/pkgs/tools/misc/mongodb-compass/default.nix
@@ -43,13 +43,13 @@ let
   ] + ":${stdenv.cc.cc.lib}/lib64";
 
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url = "https://downloads.mongodb.com/compass/mongodb-compass_${version}_amd64.deb";
         sha256 = "0x23jshnr0rafm5sn2vhq2y2gryg8mksahzyv5fszblgaxay234p";
       }
     else
-      throw "MongoDB compass is not supported on ${stdenv.system}";
+      throw "MongoDB compass is not supported on ${stdenv.hostPlatform.system}";
 
 in stdenv.mkDerivation {
   name = "mongodb-compass-${version}";
diff --git a/pkgs/tools/misc/mprime/default.nix b/pkgs/tools/misc/mprime/default.nix
index 850ed32998b4..e18e9020e1da 100644
--- a/pkgs/tools/misc/mprime/default.nix
+++ b/pkgs/tools/misc/mprime/default.nix
@@ -2,15 +2,15 @@
 
 let
   srcDir =
-    if stdenv.system == "x86_64-linux" then "linux64"
-    else if stdenv.system == "i686-linux" then "linux"
-    else if stdenv.system == "x86_64-darwin" then "macosx64"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "linux"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "macosx64"
     else throwSystem;
-  throwSystem = throw "Unsupported system: ${stdenv.system}";
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
   gwnum =
-    if stdenv.system == "x86_64-linux" then "make64"
-    else if stdenv.system == "i686-linux" then "makefile"
-    else if stdenv.system == "x86_64-darwin" then "makemac"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "make64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "makefile"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "makemac"
     else throwSystem;
 in
 
diff --git a/pkgs/tools/misc/ocz-ssd-guru/default.nix b/pkgs/tools/misc/ocz-ssd-guru/default.nix
index afe7a81ebac8..9ffb89aca6b1 100644
--- a/pkgs/tools/misc/ocz-ssd-guru/default.nix
+++ b/pkgs/tools/misc/ocz-ssd-guru/default.nix
@@ -1,7 +1,7 @@
 { fetchurl, stdenv, xorg, freetype, fontconfig, libGLU_combined, glibc, makeWrapper }:
 
 let
-  system = if stdenv.system == "x86_64-linux" then "linux64" else "linux32";
+  system = if stdenv.hostPlatform.system == "x86_64-linux" then "linux64" else "linux32";
 in
 stdenv.mkDerivation rec {
   name = "ocz-ssd-guru-${version}";
diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix
index 6211c863bd49..59a60e356b80 100644
--- a/pkgs/tools/misc/os-prober/default.nix
+++ b/pkgs/tools/misc/os-prober/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     install -Dt $out/share common.sh
 
     # probes
-    case "${stdenv.system}" in
+    case "${stdenv.hostPlatform.system}" in
         i686*|x86_64*) ARCH=x86;;
         powerpc*) ARCH=powerpc;;
         arm*) ARCH=arm;;
diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix
index 052999033a1e..acf46a58a6bf 100644
--- a/pkgs/tools/misc/otfcc/default.nix
+++ b/pkgs/tools/misc/otfcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, premake5, ninja, hostPlatform }:
+{ stdenv, fetchFromGitHub, premake5, ninja }:
 
 stdenv.mkDerivation rec {
   name = "otfcc-${version}";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     premake5 ninja
   '';
 
-  ninjaFlags = let x = if hostPlatform.isi686 then "x86" else "x64"; in
+  ninjaFlags = let x = if stdenv.hostPlatform.isi686 then "x86" else "x64"; in
     [ "-C" "build/ninja" "otfccdump_release_${x}" "otfccbuild_release_${x}" ];
 
   installPhase = ''
diff --git a/pkgs/tools/misc/pspg/default.nix b/pkgs/tools/misc/pspg/default.nix
index a1492259e8c4..21d81507dee0 100644
--- a/pkgs/tools/misc/pspg/default.nix
+++ b/pkgs/tools/misc/pspg/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "pspg-${version}";
-  version = "1.3.0";
+  version = "1.4.2";
 
   src = fetchFromGitHub {
     owner = "okbob";
     repo = "pspg";
     rev = "${version}";
-    sha256 = "1m63bhhglrpc2g68i5bigrzlpvg98qs83jgvf2gsbc4gnx9hywk5";
+    sha256 = "0hmx9p5pbydnf8sil4vqpmly5mq2rvcj8a33s9fvfisnxxsqz73v";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/misc/s6-portable-utils/default.nix b/pkgs/tools/misc/s6-portable-utils/default.nix
index 014e000eabdb..5f56daf3a48d 100644
--- a/pkgs/tools/misc/s6-portable-utils/default.nix
+++ b/pkgs/tools/misc/s6-portable-utils/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   # Explicitly setting target ensures code can be compiled against a skalibs
   # binary built on a different version of darwin.
   # http://www.skarnet.org/cgi-bin/archive.cgi?1:mss:623:heiodchokfjdkonfhdph
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6-portable-utils/
diff --git a/pkgs/tools/misc/staruml/default.nix b/pkgs/tools/misc/staruml/default.nix
index 2a06400b411f..486634452ae9 100644
--- a/pkgs/tools/misc/staruml/default.nix
+++ b/pkgs/tools/misc/staruml/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   name = "staruml-${version}";
 
   src =
-    if stdenv.system == "i686-linux" then fetchurl {
+    if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
       url = "http://staruml.io/download/release/v${version}/StarUML-v${version}-32-bit.deb";
       sha256 = "0vb3k9m3l6pmsid4shlk0xdjsriq3gxzm8q7l04didsppg0vvq1n";
     } else fetchurl {
diff --git a/pkgs/tools/misc/ttyrec/default.nix b/pkgs/tools/misc/ttyrec/default.nix
index c7cd71ffb6d7..ca6651718117 100644
--- a/pkgs/tools/misc/ttyrec/default.nix
+++ b/pkgs/tools/misc/ttyrec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildPlatform }:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "ttyrec-${version}";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./clang-fixes.patch ];
 
-  makeFlags = stdenv.lib.optional buildPlatform.isLinux "CFLAGS=-DSVR4"
+  makeFlags = stdenv.lib.optional stdenv.buildPlatform.isLinux "CFLAGS=-DSVR4"
     ++ stdenv.lib.optional stdenv.cc.isClang "CC=clang";
 
   installPhase = ''
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index ebdd08b23a84..7ed8f3bfd71b 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -15,11 +15,11 @@
 buildPythonPackage rec {
 
   pname = "youtube-dl";
-  version = "2018.08.04";
+  version = "2018.08.28";
 
   src = fetchurl {
     url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1hcx99qbbyigc8k98c8bcc6a2wnhq6493fmrkl7rysc8krlxr0pm";
+    sha256 = "1swdp4czvm0752psbi8a4qw5i9x18s7nhivh7iw92274pmqxq9wi";
   };
 
   nativeBuildInputs = [ makeWrapper ];