Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0657426ad90f
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ebffadfda39d
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 24, 2020

  1. virtualbox: add update script

    (cherry picked from commit 93e8f5d)
    B4dM4n authored and winterdeaf committed Apr 24, 2020
    Copy the full SHA
    e0c113d View commit details
  2. virtualbox: 6.1.4 -> 6.1.6

    (cherry picked from commit 0481e09)
    B4dM4n authored and winterdeaf committed Apr 24, 2020
    Copy the full SHA
    e5bea8e View commit details
  3. Merge pull request #85971 from m-scr/vbox-6.1.6-20.03

    [20.03] virtualbox: 6.1.4 -> 6.1.6
    flokli authored Apr 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ebffadf View commit details
14 changes: 9 additions & 5 deletions pkgs/applications/virtualization/virtualbox/default.nix
Original file line number Diff line number Diff line change
@@ -19,10 +19,9 @@ with stdenv.lib;
let
python = python3;
buildType = "release";
# Remember to change the extpackRev and version in extpack.nix and
# guest-additions/default.nix as well.
main = "59f8f5774473f593e3eb5940e2a337e0674bcd9854164b2578fd43f896260c99";
version = "6.1.4";
# 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.
version = "6.1.6";

iasl' = iasl.overrideAttrs (old: rec {
inherit (old) pname;
@@ -39,7 +38,7 @@ in stdenv.mkDerivation {

src = fetchurl {
url = "https://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
sha256 = main;
sha256 = "b031c30d770f28c5f884071ad933e8c1f83e65b93aaba03a4012077c1d90a54f";
};

outputs = [ "out" "modsrc" ];
@@ -108,6 +107,10 @@ in stdenv.mkDerivation {
postPatch = ''
sed -i -e 's|/sbin/ifconfig|${nettools}/bin/ifconfig|' \
src/VBox/HostDrivers/adpctl/VBoxNetAdpCtl.cpp
'' + optionalString headless ''
# Fix compile error in version 6.1.6
substituteInPlace src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp \
--replace PSHCLFORMATDATA PSHCLFORMATS
'';

# first line: ugly hack, and it isn't yet clear why it's a problem
@@ -216,6 +219,7 @@ in stdenv.mkDerivation {
passthru = {
inherit version; # for guest additions
inherit extensionPack; # for inclusion in profile to prevent gc
updateScript = ./update.sh;
};

meta = {
2 changes: 1 addition & 1 deletion pkgs/applications/virtualization/virtualbox/extpack.nix
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ fetchurl rec {
# Manually sha256sum the extensionPack file, must be hex!
# Thus do not use `nix-prefetch-url` but instead plain old `sha256sum`.
# Checksums can also be found at https://www.virtualbox.org/download/hashes/${version}/SHA256SUMS
let value = "3b73798d776ff223ea8025b1a45001762f8d4e5bcd1ea61449773c1249935800";
let value = "80b96b4b51a502141f6a8981f1493ade08a00762622c39e48319e5b122119bf3";
in assert (builtins.stringLength value) == 64; value;

meta = {
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {

src = fetchurl {
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
sha256 = "e2846a7576cce1b92a7c0744f41eaac750248d6e31dfca5c45d5766648b394c7";
sha256 = "bcde4691dea7de93b65a10a43dda2b8f52e570f820992ad281c9bb5c8dede181";
};

KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
85 changes: 0 additions & 85 deletions pkgs/applications/virtualization/virtualbox/update.py

This file was deleted.

44 changes: 44 additions & 0 deletions pkgs/applications/virtualization/virtualbox/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts nix-prefetch-scripts jq

set -xeuo pipefail

nixpkgs="$(git rev-parse --show-toplevel)"

attr=virtualbox
oldVersion="$(nix-instantiate --eval -E "with import $nixpkgs {}; $attr.version or (builtins.parseDrvName $attr.name).version" | tr -d '"')"
latestVersion="$(curl -sS https://download.virtualbox.org/virtualbox/LATEST.TXT)"

function fileShaSum() {
echo "$1" | grep -w $2 | cut -f1 -d' '
}
function oldHash() {
nix-instantiate --eval --strict -A "$1.drvAttrs.outputHash" | tr -d '"'
}
function nixFile() {
nix-instantiate --eval --strict -A "${1}.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/'
}

if [ ! "$oldVersion" = "$latestVersion" ]; then
shaSums=$(curl -sS https://download.virtualbox.org/virtualbox/$latestVersion/SHA256SUMS)

virtualBoxShaSum=$(fileShaSum "$shaSums" "VirtualBox-$latestVersion.tar.bz2")
extpackShaSum=$(fileShaSum "$shaSums" "Oracle_VM_VirtualBox_Extension_Pack-$latestVersion.vbox-extpack")
guestAdditionsShaSum=$(fileShaSum "$shaSums" "*VBoxGuestAdditions_$latestVersion.iso")

virtualboxNixFile=$(nixFile ${attr})
extpackNixFile=$(nixFile ${attr}Extpack)
guestAdditionsNixFile=$(nixFile linuxPackages.${attr}GuestAdditions)

extpackOldShaSum=$(oldHash ${attr}Extpack)
guestAdditionsOldShaSum=$(oldHash linuxPackages.${attr}GuestAdditions.src)

update-source-version $attr $latestVersion $virtualBoxShaSum
sed -i -e 's|value = "'$extpackOldShaSum'"|value = "'$extpackShaSum'"|' $extpackNixFile
sed -i -e 's|sha256 = "'$guestAdditionsOldShaSum'"|sha256 = "'$guestAdditionsShaSum'"|' $guestAdditionsNixFile

git add $virtualboxNixFile $extpackNixFile $guestAdditionsNixFile
git commit -m "$attr: ${oldVersion} -> ${latestVersion}"
else
echo "$attr is already up-to-date"
fi