diff --git a/pkgs/by-name/vc/vcv-rack/package.nix b/pkgs/by-name/vc/vcv-rack/package.nix index d7dcbe4c22ca..97f4e51cab15 100644 --- a/pkgs/by-name/vc/vcv-rack/package.nix +++ b/pkgs/by-name/vc/vcv-rack/package.nix @@ -31,6 +31,7 @@ stdenv, wrapGAppsHook3, zstd, + versionCheckHook, }: let @@ -208,6 +209,10 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail \ "LightButton>" \ "struct rack::componentlibrary::LightButton>" + + # Set RACK_VERSION to avoid git describe, which fails in the Nix build sandbox. + substituteInPlace Makefile \ + --replace-fail 'RACK_VERSION ?= $' 'RACK_VERSION ?= ${finalAttrs.version}#$' '' + lib.optionalString stdenv.hostPlatform.isLinux '' # Fix reference to zenity @@ -218,7 +223,6 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail '__yield();' 'asm volatile("yield");' '' + lib.optionalString stdenv.hostPlatform.isDarwin '' - # * Set VERSION from finalAttrs to avoid build using git to determine version # * Darwin needs to build the dist target, which builds the .app container, # yet we want to exclude the documentation from dist target. # * Skip stripping the binary to avoid "unsupported load command" error, which @@ -226,7 +230,6 @@ stdenv.mkDerivation (finalAttrs: { # * Replace path to Fundamental module with path to produced build artifact # to avoid downloading a pre-compiled version substituteInPlace Makefile \ - --replace-fail 'VERSION ?= $' 'VERSION ?= ${finalAttrs.version}#$' \ --replace-fail 'DIST_HTML :=' '#DIST_HTML :=' \ --replace-fail '$(STRIP)' '#$(STRIP)' \ --replace-fail 'FUNDAMENTAL_FILENAME := Fundamental' 'FUNDAMENTAL_FILENAME := plugins/Fundamental/dist/Fundamental' @@ -306,7 +309,7 @@ stdenv.mkDerivation (finalAttrs: { install -D -m755 -t $out/lib libRack.so mkdir -p $out/share/vcv-rack - cp -r res cacert.pem Core.json template.vcv LICENSE-GPLv3.txt $out/share/vcv-rack + cp -r res translations cacert.pem Core.json template.vcv LICENSE-GPLv3.txt $out/share/vcv-rack cp -r plugins/Fundamental/dist/Fundamental-*.vcvplugin $out/share/vcv-rack/Fundamental.vcvplugin # Extract pngs from the Apple icon image and create @@ -348,6 +351,9 @@ stdenv.mkDerivation (finalAttrs: { --add-flags "-s $out/Applications/'VCV Rack ${lib.versions.major finalAttrs.version} Free.app'/Contents/Resources" ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + meta = { description = "Open-source virtual modular synthesizer"; homepage = "https://vcvrack.com/";