From a81f13db8d3e24f66e97724645833a178ddc3357 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 25 Oct 2024 02:33:05 +0000 Subject: [PATCH 1/7] gnatPackages.xmlada: 24.0.0 -> 25.0.0 --- pkgs/development/ada-modules/xmlada/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ada-modules/xmlada/default.nix b/pkgs/development/ada-modules/xmlada/default.nix index 77e8094277a71..d3429606c6da2 100644 --- a/pkgs/development/ada-modules/xmlada/default.nix +++ b/pkgs/development/ada-modules/xmlada/default.nix @@ -9,14 +9,14 @@ stdenv.mkDerivation rec { pname = "xmlada"; - version = "24.0.0"; + version = "25.0.0"; src = fetchFromGitHub { name = "xmlada-${version}-src"; owner = "AdaCore"; repo = "xmlada"; rev = "v${version}"; - sha256 = "sha256-vvM7bdf3dAa3zKgxbGeAGlBT6fvafzmleimJHyRdlvc="; + sha256 = "sha256-UMJiXSHMS8+X5gyV1nmC29gF71BFnz7LNPQnwUMD3Yg="; }; nativeBuildInputs = [ From 967325133f8155825a00f169791814624aefd844 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 26 Oct 2024 02:29:37 +0200 Subject: [PATCH 2/7] gnatPackages.gprbuild: 24.0.0 -> 25.0.0 --- pkgs/development/ada-modules/gprbuild/boot.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ada-modules/gprbuild/boot.nix b/pkgs/development/ada-modules/gprbuild/boot.nix index 4207b3649594f..0fd3f3c5e8e92 100644 --- a/pkgs/development/ada-modules/gprbuild/boot.nix +++ b/pkgs/development/ada-modules/gprbuild/boot.nix @@ -7,14 +7,14 @@ }: let - version = "24.0.0"; + version = "25.0.0"; gprConfigKbSrc = fetchFromGitHub { name = "gprconfig-kb-${version}-src"; owner = "AdaCore"; repo = "gprconfig_kb"; rev = "v${version}"; - sha256 = "1vnjv2q63l8nq2w4wya75m40isvs78j5ss9b5ga3zx3cpdx3xh09"; + sha256 = "09x1njq0i0z7fbwg0mg39r5ghy7369avbqvdycfj67lpmw17gb1r"; }; in @@ -27,7 +27,7 @@ stdenv.mkDerivation { owner = "AdaCore"; repo = "gprbuild"; rev = "v${version}"; - sha256 = "096a43453z2xknn6x4hyk2ldp2wh0qhfdfmzsrks50zqcvmkq4v7"; + sha256 = "1mqsmc0q5bzg8223ls18kbvaz6mhzjz7ik8d3sqhhn24c0j6wjaw"; }; nativeBuildInputs = [ From b5db2a401a22bf1e8fa1798187351aa863c83a4c Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 13:59:44 +0100 Subject: [PATCH 3/7] gnatPackages.gnatcoll-core: 24.0.0 -> 25.0.0 gnatcoll-core now ships up to four gpr files: - gnatcoll (for backwards compat) - gnatcoll_minimal - gnatcoll_core - gnatcoll_projects Unfortunately, you can't freely choose which to build, so this package hasn't been split up into two to three packages. --- .../development/ada-modules/gnatcoll/core.nix | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ada-modules/gnatcoll/core.nix b/pkgs/development/ada-modules/gnatcoll/core.nix index 0180558e1b967..a121eec212eb8 100644 --- a/pkgs/development/ada-modules/gnatcoll/core.nix +++ b/pkgs/development/ada-modules/gnatcoll/core.nix @@ -3,39 +3,80 @@ , gnat , gprbuild , fetchFromGitHub +, fetchpatch2 , which +, python3 +, rsync +, enableGnatcollCore ? true + # TODO(@sternenseemann): figure out a way to split this up into three packages +, enableGnatcollProjects ? true + # for tests +, gnatcoll-core }: +# gnatcoll-projects depends on gnatcoll-core +assert enableGnatcollProjects -> enableGnatcollCore; + stdenv.mkDerivation rec { pname = "gnatcoll-core"; - version = "24.0.0"; + version = "25.0.0"; src = fetchFromGitHub { owner = "AdaCore"; repo = "gnatcoll-core"; rev = "v${version}"; - sha256 = "1cks2w0inj9hvamsdxjriwxnx1igmx2khhr6kwxshsl30rs8nzvb"; + sha256 = "1srnh7vhs46c2zy4hcy4pg0a0prghfzlpv7c82k0jan384yz1g6g"; }; + patches = [ + # Fix compilation with GNAT 12 https://github.com/AdaCore/gnatcoll-core/issues/88 + (fetchpatch2 { + name = "gnatcoll-core-gnat-12.patch"; + url = "https://github.com/AdaCore/gnatcoll-core/commit/515db1c9f1eea8095f2d9ff9570159a78c981ec6.patch"; + sha256 = "1ghnkhp5fncb7qcmf59kyqvy0sd0pzf1phnr2z7b4ljwlkbmcp36"; + }) + ]; + + postPatch = '' + patchShebangs */*.gpr.py + ''; + nativeBuildInputs = [ gprbuild which gnat + python3 + rsync ]; # propagate since gprbuild needs to find # referenced GPR project definitions - propagatedBuildInputs = [ + propagatedBuildInputs = lib.optionals enableGnatcollProjects [ gprbuild # libgpr ]; + strictDeps = true; + makeFlags = [ "prefix=${placeholder "out"}" "PROCESSORS=$(NIX_BUILD_CORES)" # confusingly, for gprbuild --target is autoconf --host "TARGET=${stdenv.hostPlatform.config}" + "GNATCOLL_MINIMAL_ONLY=${if !enableGnatcollCore then "yes" else "no"}" + "GNATCOLL_PROJECTS=${if enableGnatcollProjects then "yes" else "no"}" ]; + passthru.tests = { + minimalOnly = gnatcoll-core.override { + enableGnatcollProjects = false; + enableGnatcollCore = false; + }; + noProjects = gnatcoll-core.override { + enableGnatcollProjects = false; + enableGnatcollCore = true; + }; + }; + meta = with lib; { homepage = "https://github.com/AdaCore/gnatcoll-core"; description = "GNAT Components Collection - Core packages"; From 8bc7bcca4d6587e12302e76195ee8e72cb135d09 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 15:33:57 +0100 Subject: [PATCH 4/7] gnatPackages.gnatcoll-*(bindings): 24.0.0 -> 25.0.0 --- pkgs/development/ada-modules/gnatcoll/bindings.nix | 6 +++--- pkgs/top-level/ada-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ada-modules/gnatcoll/bindings.nix b/pkgs/development/ada-modules/gnatcoll/bindings.nix index 32d490c1e1bac..8a23f1447d7ff 100644 --- a/pkgs/development/ada-modules/gnatcoll/bindings.nix +++ b/pkgs/development/ada-modules/gnatcoll/bindings.nix @@ -33,13 +33,13 @@ in stdenv.mkDerivation rec { pname = "gnatcoll-${component}"; - version = "24.0.0"; + version = "25.0.0"; src = fetchFromGitHub { owner = "AdaCore"; repo = "gnatcoll-bindings"; rev = "v${version}"; - sha256 = "00aakpmr67r72l1h3jpkaw83p1a2mjjvfk635yy5c1nss3ji1qjm"; + sha256 = "0ayc7zvv8w90v0xzhrjk2x88zrsk62xxcm27ya9crlp6affn5idk"; }; nativeBuildInputs = [ @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { gnatcoll-core ] ++ libsFor."${component}" or []; - # explicit flag for GPL acceptance because upstreams + # explicit flag for GPL acceptance because upstream # allows a gcc runtime exception for all bindings # except for readline (since it is GPL w/o exceptions) buildFlags = lib.optionals (component == "readline") [ diff --git a/pkgs/top-level/ada-packages.nix b/pkgs/top-level/ada-packages.nix index ad29103deb226..267aba9bc55b5 100644 --- a/pkgs/top-level/ada-packages.nix +++ b/pkgs/top-level/ada-packages.nix @@ -30,7 +30,7 @@ makeScopeWithSplicing' { gnatcoll-iconv = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "iconv"; }; gnatcoll-lzma = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "lzma"; }; gnatcoll-omp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "omp"; }; - gnatcoll-python3 = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "python3"; python3 = pkgs.python39; }; + gnatcoll-python3 = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "python3"; python3 = pkgs.python312; }; gnatcoll-readline = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "readline"; }; gnatcoll-syslog = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "syslog"; }; gnatcoll-zlib = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "zlib"; }; From 0ccec7f0558bde4aa5cc1f42401afc9dcb7cf603 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 15:33:27 +0100 Subject: [PATCH 5/7] gnatPackages.gpr2: 24.0.0 -> 25.0.0 --- .../ada-modules/gnatprove/default.nix | 5 ++- pkgs/development/ada-modules/gpr2/default.nix | 40 ++++++++++++++----- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/pkgs/development/ada-modules/gnatprove/default.nix b/pkgs/development/ada-modules/gnatprove/default.nix index 6e0eda57e8dba..e08461a44c41d 100644 --- a/pkgs/development/ada-modules/gnatprove/default.nix +++ b/pkgs/development/ada-modules/gnatprove/default.nix @@ -13,7 +13,10 @@ let gnat_version = lib.versions.major gnat.version; # gnatprove fsf-14 requires gpr2 from a special branch - gpr2_24_2_next = gpr2.overrideAttrs(old: rec { + gpr2_24_2_next = (gpr2.override { + # pregenerated kb db is not included + gpr2kbdir = "${gprbuild}/share/gprconfig"; + }).overrideAttrs(old: rec { version = "24.2.0-next"; src = fetchFromGitHub { owner = "AdaCore"; diff --git a/pkgs/development/ada-modules/gpr2/default.nix b/pkgs/development/ada-modules/gpr2/default.nix index 1ad58b125db42..db7fd76264cb0 100644 --- a/pkgs/development/ada-modules/gpr2/default.nix +++ b/pkgs/development/ada-modules/gpr2/default.nix @@ -5,19 +5,22 @@ gprbuild, which, gnat, + xmlada, gnatcoll-core, gnatcoll-iconv, gnatcoll-gmp, enableShared ? !stdenv.hostPlatform.isStatic, + # kb database source, if null assume it is pregenerated + gpr2kbdir ? null, }: stdenv.mkDerivation rec { pname = "gpr2"; - version = "24.0.0"; + version = "25.0.0"; src = fetchurl { - url = "https://github.com/AdaCore/gpr/releases/download/v${version}/gpr2-with-lkparser-${lib.versions.majorMinor version}.tgz"; - sha256 = "1g90689k94q3ma7q76gnjipfblgfvcq6ldwbzcf0l5hx6n8vbly8"; + url = "https://github.com/AdaCore/gpr/releases/download/v${version}/gpr2-with-gprconfig_kb-${lib.versions.majorMinor version}.tgz"; + sha512 = "70fe0fcf541f6d3d90a34cab1638bbc0283dcd765c000406e0cfb73bae1817b30ddfe73f3672247a97c6b6bfc41900bc96a4440ca0c660f9c2f7b9d3cc8f8dcf"; }; nativeBuildInputs = [ @@ -26,15 +29,30 @@ stdenv.mkDerivation rec { gprbuild ]; - makeFlags = [ - "prefix=$(out)" - "GPR2KBDIR=${gprbuild}/share/gprconfig" - "PROCESSORS=$(NIX_BUILD_CORES)" - "ENABLE_SHARED=${if enableShared then "yes" else "no"}" - ]; + makeFlags = + [ + "prefix=$(out)" + "PROCESSORS=$(NIX_BUILD_CORES)" + "ENABLE_SHARED=${if enableShared then "yes" else "no"}" + "GPR2_BUILD=release" + ] + ++ lib.optionals (gpr2kbdir != null) [ + "GPR2KBDIR=${gpr2kbdir}" + ]; + + configurePhase = '' + runHook preConfigure + make setup "''${makeFlagsArray[@]}" $makeFlags + runHook postConfigure + ''; + + # fool make into thinking pregenerated targets are up to date + preBuild = lib.optionalString (gpr2kbdir == null) '' + touch .build/kb/{*.adb,*.ads,collect_kb} + ''; propagatedBuildInputs = [ - gprbuild + xmlada gnatcoll-gmp gnatcoll-core gnatcoll-iconv @@ -49,5 +67,7 @@ stdenv.mkDerivation rec { ]; maintainers = with maintainers; [ heijligen ]; platforms = platforms.all; + # TODO(@sternenseemann): investigate failure with gnat 13 + broken = lib.versionOlder gnat.version "14"; }; } From b2020771fc7184cca03ac17d5e48f0dcac7325ce Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 16:05:29 +0100 Subject: [PATCH 6/7] gnatPackages.gnatcoll-cpp: init at 25.0.0 gnatcoll_cpp adds bindings to C++ strings: https://github.com/AdaCore/gnatcoll-bindings/commit/f24b27680af56214f35c5ad69229f3d44e100394 --- pkgs/development/ada-modules/gnatcoll/bindings.nix | 1 + pkgs/top-level/ada-packages.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/development/ada-modules/gnatcoll/bindings.nix b/pkgs/development/ada-modules/gnatcoll/bindings.nix index 8a23f1447d7ff..b5ca0bead755b 100644 --- a/pkgs/development/ada-modules/gnatcoll/bindings.nix +++ b/pkgs/development/ada-modules/gnatcoll/bindings.nix @@ -27,6 +27,7 @@ let python3 = [ python3 ncurses ]; syslog = [ ]; zlib = [ zlib ]; + cpp = [ ]; }; in diff --git a/pkgs/top-level/ada-packages.nix b/pkgs/top-level/ada-packages.nix index 267aba9bc55b5..d2f86c0c1301e 100644 --- a/pkgs/top-level/ada-packages.nix +++ b/pkgs/top-level/ada-packages.nix @@ -26,6 +26,7 @@ makeScopeWithSplicing' { gnatcoll-core = self.callPackage ../development/ada-modules/gnatcoll/core.nix { }; # gnatcoll-bindings repository + gnatcoll-cpp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "cpp"; }; gnatcoll-gmp = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "gmp"; }; gnatcoll-iconv = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "iconv"; }; gnatcoll-lzma = self.callPackage ../development/ada-modules/gnatcoll/bindings.nix { component = "lzma"; }; From 3fd273a58ce56b104c39d5b8526576c58d713163 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 1 Nov 2024 16:08:05 +0100 Subject: [PATCH 7/7] gnatPackages.gnatcoll-*(db): 24.0.0 -> 25.0.0 --- pkgs/development/ada-modules/gnatcoll/db.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ada-modules/gnatcoll/db.nix b/pkgs/development/ada-modules/gnatcoll/db.nix index 017a51e2fb750..1a670b5abf60e 100644 --- a/pkgs/development/ada-modules/gnatcoll/db.nix +++ b/pkgs/development/ada-modules/gnatcoll/db.nix @@ -54,13 +54,13 @@ stdenv.mkDerivation rec { if onlyExecutable then builtins.replaceStrings [ "_" ] [ "-" ] component else "gnatcoll-${component}"; - version = "24.0.0"; + version = "25.0.0"; src = fetchFromGitHub { owner = "AdaCore"; repo = "gnatcoll-db"; rev = "v${version}"; - sha256 = "0jq76s4s7q2x93jh8la6r0i3jkpvgsfj12vbbaqabh410xccyr3p"; + sha256 = "0q35ii0aa4hh59v768l5cilg1b30a4ckcvlbfy0lkcbp3rcfnbz3"; }; # Link executables dynamically unless specified by the platform,