about summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-11-10 01:40:47 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-11-10 01:40:47 +0100
commitdf17da77298f13a3a92366056252ec703b6a9b35 (patch)
tree5a10035945b5d91075f96de1ba7cc3a7e42f1251 /pkgs/applications/virtualization
parent37bd69672dc8592fe56e87011de4dc6ceca720a8 (diff)
virtualbox: remove ? null from inputs, remove optional (), other minor cleanups
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix37
1 files changed, 18 insertions, 19 deletions
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 0dcebb71cc5f2..128753f26433f 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -5,12 +5,12 @@
 , alsa-lib, curl, libvpx, nettools, dbus, substituteAll, gsoap, zlib
 # If open-watcom-bin is not passed, VirtualBox will fall back to use
 # the shipped alternative sources (assembly).
-, open-watcom-bin ? null
+, open-watcom-bin
 , makeself, perl
-, javaBindings ? true, jdk ? null # Almost doesn't affect closure size
-, pythonBindings ? false, python3 ? null
-, extensionPack ? null, fakeroot ? null
-, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
+, javaBindings ? true, jdk # Almost doesn't affect closure size
+, pythonBindings ? false, python3
+, extensionPack ? null, fakeroot
+, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
 , enableHardening ? false
 , headless ? false
 , enable32bitGuests ? true
@@ -20,7 +20,6 @@
 with lib;
 
 let
-  python = python3;
   buildType = "release";
   # Use maintainers/scripts/update.nix to update the version and all related hashes or
   # change the hashes in extpack.nix and guest-additions/default.nix as well manually.
@@ -42,23 +41,23 @@ in stdenv.mkDerivation {
   # Wrap manually because we wrap just a small number of executables.
   dontWrapQtApps = true;
 
-  buildInputs =
-    [ acpica-tools dev86 libxslt libxml2 xorgproto libX11 libXext libXcursor libIDL
-      libcap glib lvm2 alsa-lib curl libvpx pam makeself perl
-      libXmu libpng libopus python ]
+  buildInputs = [
+    acpica-tools dev86 libxslt libxml2 xorgproto libX11 libXext libXcursor libIDL
+    libcap glib lvm2 alsa-lib curl libvpx pam makeself perl
+    libXmu libpng libopus python3 ]
     ++ optional javaBindings jdk
-    ++ optional pythonBindings python # Python is needed even when not building bindings
+    ++ optional pythonBindings python3 # Python is needed even when not building bindings
     ++ optional pulseSupport libpulseaudio
-    ++ optionals (headless) [ libXrandr libGL ]
+    ++ optionals headless [ libXrandr libGL ]
     ++ optionals (!headless) [ qtbase qtx11extras libXinerama SDL ]
-    ++ optionals (enableWebService) [ gsoap zlib ];
+    ++ optionals enableWebService [ gsoap zlib ];
 
   hardeningDisable = [ "format" "fortify" "pic" "stackprotector" ];
 
   prePatch = ''
     set -x
     sed -e 's@MKISOFS --version@MKISOFS -version@' \
-        -e 's@PYTHONDIR=.*@PYTHONDIR=${if pythonBindings then python else ""}@' \
+        -e 's@PYTHONDIR=.*@PYTHONDIR=${lib.optionalString pythonBindings python3}@' \
         -e 's@CXX_FLAGS="\(.*\)"@CXX_FLAGS="-std=c++11 \1"@' \
         ${optionalString (!headless) ''
         -e 's@TOOLQT5BIN=.*@TOOLQT5BIN="${getDev qtbase}/bin"@' \
@@ -135,7 +134,7 @@ in stdenv.mkDerivation {
     PATH_QT5_X11_EXTRAS_INC        := ${getDev qtx11extras}/include
     TOOL_QT5_LRC                   := ${getDev qttools}/bin/lrelease
     ''}
-    ${optionalString (enableWebService) ''
+    ${optionalString enableWebService ''
     # fix gsoap missing zlib include and produce errors with --as-needed
     VBOX_GSOAP_CXX_LIBS := gsoapssl++ z
     ''}
@@ -148,7 +147,7 @@ in stdenv.mkDerivation {
       ${optionalString (!pulseSupport) "--disable-pulse"} \
       ${optionalString (!enableHardening) "--disable-hardening"} \
       ${optionalString (!enable32bitGuests) "--disable-vmmraw"} \
-      ${optionalString (enableWebService) "--enable-webservice"} \
+      ${optionalString enableWebService "--enable-webservice"} \
       ${optionalString (open-watcom-bin != null) "--with-ow-dir=${open-watcom-bin}"} \
       --disable-kmods
     sed -e 's@PKG_CONFIG_PATH=.*@PKG_CONFIG_PATH=${libIDL}/lib/pkgconfig:${glib.dev}/lib/pkgconfig ${libIDL}/bin/libIDL-config-2@' \
@@ -175,7 +174,7 @@ in stdenv.mkDerivation {
       -name src -o -exec cp -avt "$libexec" {} +
 
     mkdir -p $out/bin
-    for file in ${optionalString (!headless) "VirtualBox VBoxSDL rdesktop-vrdp"} ${optionalString (enableWebService) "vboxwebsrv"} VBoxManage VBoxBalloonCtrl VBoxHeadless; do
+    for file in ${optionalString (!headless) "VirtualBox VBoxSDL rdesktop-vrdp"} ${optionalString enableWebService "vboxwebsrv"} VBoxManage VBoxBalloonCtrl VBoxHeadless; do
         echo "Linking $file to /bin"
         test -x "$libexec/$file"
         ln -s "$libexec/$file" $out/bin/$file
@@ -183,14 +182,14 @@ in stdenv.mkDerivation {
 
     ${optionalString (extensionPack != null) ''
       mkdir -p "$share"
-      "${fakeroot}/bin/fakeroot" "${stdenv.shell}" <<EXTHELPER
+      "${fakeroot}/bin/fakeroot" "${stdenv.shell}" <<EOF
       "$libexec/VBoxExtPackHelperApp" install \
         --base-dir "$share/ExtensionPacks" \
         --cert-dir "$share/ExtPackCertificates" \
         --name "Oracle VM VirtualBox Extension Pack" \
         --tarball "${extensionPack}" \
         --sha-256 "${extensionPack.outputHash}"
-      EXTHELPER
+      EOF
     ''}
 
     ${optionalString (!headless) ''