diff --git a/pkgs/quartus/quartus-unwrapped.nix b/pkgs/quartus/quartus-unwrapped.nix index ad530da..0ea1201 100644 --- a/pkgs/quartus/quartus-unwrapped.nix +++ b/pkgs/quartus/quartus-unwrapped.nix @@ -1,11 +1,11 @@ { - mkDerivation, lib, - fetchurl, + mkDerivation, + quartusOptions, + quartusSource, + requireFile, unstick, unzip, - quartusSource, - quartusOptions, }: let @@ -43,9 +43,9 @@ let download = { name, hash }: - fetchurl { + requireFile { inherit name hash; - url = "${quartusSource.baseUrl}/${name}"; + url = quartusSource.loginUrl; }; installers = map ( @@ -122,11 +122,11 @@ mkDerivation { echo "setting up patcher..." ${copyExecutable { path = patcher; - name = builtins.baseNameOf patcher; + name = baseNameOf patcher; }} echo "executing patcher..." - unstick $TEMP/${builtins.baseNameOf patcher} \ + unstick $TEMP/${baseNameOf patcher} \ --mode unattended --installdir $out --accept_eula 1 --patch_to quartus ''; in diff --git a/pkgs/quartus/sources/helpers.nix b/pkgs/quartus/sources/helpers.nix index ac9c4eb..5247c4f 100644 --- a/pkgs/quartus/sources/helpers.nix +++ b/pkgs/quartus/sources/helpers.nix @@ -1,4 +1,4 @@ -rec { +lib: rec { toSemVer = version: builtins.concatStringsSep "" (builtins.match "^([0-9]+\.[0-9]+)[std]*(\.[0-9]+).*" version); @@ -12,7 +12,7 @@ rec { byVersion = sources: builtins.listToAttrs ( - builtins.map (x: { + map (x: { name = x.version; value = x; }) sources @@ -20,7 +20,24 @@ rec { getLatestWithDevices = sources: devices: (getLatest (builtins.filter (x: hasDevices x devices) sources)) // { defaultDevices = devices; }; - mkVariants = variant: builtins.map (x: (x // { inherit variant; })); + mkVariants = + variant: + map ( + x: + ( + x + // { + inherit variant; + loginUrl = + let + versionString = builtins.concatStringsSep "-" ( + builtins.filter (v: v != "0") (lib.take 3 (builtins.splitVersion (toSemVer x.version))) + ); + in + "https://www.altera.com/downloads/fpga-development-tools/quartus-prime-${variant}-edition-design-software-version-${versionString}-linux"; + } + ) + ); setupSources = sources: diff --git a/pkgs/quartus/sources/lite.nix b/pkgs/quartus/sources/lite.nix index c07d843..8068251 100644 --- a/pkgs/quartus/sources/lite.nix +++ b/pkgs/quartus/sources/lite.nix @@ -1,10 +1,9 @@ { fetchzip, lib }: let - helpers = import ./helpers.nix; + helpers = import ./helpers.nix lib; sources = helpers.mkVariants "lite" [ { version = "23.1std.1.993"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/23.1std.1/993/ib_installers"; quartusInstaller = "QuartusLiteSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclonev" ]; @@ -23,7 +22,6 @@ let } { version = "24.1std.0.1077"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/24.1std/1077/ib_installers"; quartusInstaller = "QuartusLiteSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclonev" ]; @@ -42,7 +40,6 @@ let } { version = "25.1std.0.1129"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/25.1std/1129/ib_installers"; quartusInstaller = "QuartusLiteSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclonev" ]; diff --git a/pkgs/quartus/sources/pro.nix b/pkgs/quartus/sources/pro.nix index efe767e..f551b72 100644 --- a/pkgs/quartus/sources/pro.nix +++ b/pkgs/quartus/sources/pro.nix @@ -4,7 +4,7 @@ lib, }: let - helpers = import ./helpers.nix; + helpers = import ./helpers.nix lib; # https://community.altera.com/kb/knowledge-base/why-do-i-unexpectedly-observe-intermittent-ddm-errors/349714 mkDDMErrorPatch = @@ -21,7 +21,6 @@ let sources = helpers.mkVariants "pro" [ { version = "23.4.0.79"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/23.4/79/ib_installers"; quartusInstaller = "QuartusProSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclone10gx" ]; @@ -41,7 +40,6 @@ let } { version = "24.3.0.212"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/24.3/212/ib_installers"; quartusInstaller = "QuartusProSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclone10gx" ]; @@ -72,7 +70,6 @@ let } { version = "25.1.0.129"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/25.1/129/ib_installers"; quartusInstaller = "QuartusProSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclone10gx" ]; @@ -107,7 +104,6 @@ let } { version = "25.3.0.109"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/25.3/109/ib_installers"; quartusInstaller = "QuartusProSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclone10gx" ]; # The only device family that doesn't need a paid license diff --git a/pkgs/quartus/sources/standard.nix b/pkgs/quartus/sources/standard.nix index 8493240..7204346 100644 --- a/pkgs/quartus/sources/standard.nix +++ b/pkgs/quartus/sources/standard.nix @@ -1,10 +1,9 @@ { fetchzip, lib }: let - helpers = import ./helpers.nix; + helpers = import ./helpers.nix lib; sources = helpers.mkVariants "standard" [ { version = "23.1std.1.993"; - baseUrl = "https://downloads.intel.com/akdlm/software/acdsinst/23.1std.1/993/ib_installers"; quartusInstaller = "QuartusSetup"; defaultInstalls = [ ]; defaultDevices = [ "cyclonev" ];