From f2a142727cc0fbc92a9b420567418df9dd36e568 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Mon, 19 Feb 2024 20:17:42 +0000 Subject: [PATCH] gnatPackages: Add scope for all ada packages Ada depencencies musst be build with the same gnat version as the project. Use a namespace as preperation to build with different gnat versions. gprbuild and gnatprove are still globaly visable. --- .../emacs/elisp-packages/elpa-packages.nix | 2 +- pkgs/build-support/cc-wrapper/default.nix | 2 +- .../ada => ada-modules}/gnatcoll/bindings.nix | 0 .../ada => ada-modules}/gnatcoll/core.nix | 0 .../ada => ada-modules}/gnatcoll/db.nix | 0 .../ada => ada-modules}/gnatprove/default.nix | 0 .../gprbuild/boot.nix | 0 .../gprbuild/default.nix | 0 .../gprbuild/gpr-project-darwin-rpath-hook.sh | 0 .../gprbuild/gpr-project-path-hook.sh | 0 .../gprbuild/gprbuild-relocatable-build.patch | 0 .../gprbuild/nixpkgs-gnat.xml | 0 .../ada => ada-modules}/xmlada/default.nix | 0 pkgs/top-level/ada-packages.nix | 45 +++++++++++++++++++ pkgs/top-level/aliases.nix | 18 +++++++- pkgs/top-level/all-packages.nix | 42 ++--------------- 16 files changed, 68 insertions(+), 41 deletions(-) rename pkgs/development/{libraries/ada => ada-modules}/gnatcoll/bindings.nix (100%) rename pkgs/development/{libraries/ada => ada-modules}/gnatcoll/core.nix (100%) rename pkgs/development/{libraries/ada => ada-modules}/gnatcoll/db.nix (100%) rename pkgs/development/{libraries/ada => ada-modules}/gnatprove/default.nix (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/boot.nix (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/default.nix (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/gpr-project-darwin-rpath-hook.sh (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/gpr-project-path-hook.sh (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/gprbuild-relocatable-build.patch (100%) rename pkgs/development/{tools/build-managers => ada-modules}/gprbuild/nixpkgs-gnat.xml (100%) rename pkgs/development/{libraries/ada => ada-modules}/xmlada/default.nix (100%) create mode 100644 pkgs/top-level/ada-packages.nix diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix index 112445453abb..0b142281559a 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix @@ -88,7 +88,7 @@ self: let ]; buildInputs = [ - pkgs.gnatcoll-xref + pkgs.gnatPackages.gnatcoll-xref ]; buildPhase = '' diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 693c6e6fcfd4..9ff560b2286a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -377,7 +377,7 @@ stdenv.mkDerivation { # this symlink points to the unwrapped gnat's output "out". It is used by # our custom gprconfig compiler description to find GNAT's ada runtime. See - # ../../development/tools/build-managers/gprbuild/{boot.nix, nixpkgs-gnat.xml} + # ../../development/ada-modules/gprbuild/{boot.nix, nixpkgs-gnat.xml} ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped '' diff --git a/pkgs/development/libraries/ada/gnatcoll/bindings.nix b/pkgs/development/ada-modules/gnatcoll/bindings.nix similarity index 100% rename from pkgs/development/libraries/ada/gnatcoll/bindings.nix rename to pkgs/development/ada-modules/gnatcoll/bindings.nix diff --git a/pkgs/development/libraries/ada/gnatcoll/core.nix b/pkgs/development/ada-modules/gnatcoll/core.nix similarity index 100% rename from pkgs/development/libraries/ada/gnatcoll/core.nix rename to pkgs/development/ada-modules/gnatcoll/core.nix diff --git a/pkgs/development/libraries/ada/gnatcoll/db.nix b/pkgs/development/ada-modules/gnatcoll/db.nix similarity index 100% rename from pkgs/development/libraries/ada/gnatcoll/db.nix rename to pkgs/development/ada-modules/gnatcoll/db.nix diff --git a/pkgs/development/libraries/ada/gnatprove/default.nix b/pkgs/development/ada-modules/gnatprove/default.nix similarity index 100% rename from pkgs/development/libraries/ada/gnatprove/default.nix rename to pkgs/development/ada-modules/gnatprove/default.nix diff --git a/pkgs/development/tools/build-managers/gprbuild/boot.nix b/pkgs/development/ada-modules/gprbuild/boot.nix similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/boot.nix rename to pkgs/development/ada-modules/gprbuild/boot.nix diff --git a/pkgs/development/tools/build-managers/gprbuild/default.nix b/pkgs/development/ada-modules/gprbuild/default.nix similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/default.nix rename to pkgs/development/ada-modules/gprbuild/default.nix diff --git a/pkgs/development/tools/build-managers/gprbuild/gpr-project-darwin-rpath-hook.sh b/pkgs/development/ada-modules/gprbuild/gpr-project-darwin-rpath-hook.sh similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/gpr-project-darwin-rpath-hook.sh rename to pkgs/development/ada-modules/gprbuild/gpr-project-darwin-rpath-hook.sh diff --git a/pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh b/pkgs/development/ada-modules/gprbuild/gpr-project-path-hook.sh similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh rename to pkgs/development/ada-modules/gprbuild/gpr-project-path-hook.sh diff --git a/pkgs/development/tools/build-managers/gprbuild/gprbuild-relocatable-build.patch b/pkgs/development/ada-modules/gprbuild/gprbuild-relocatable-build.patch similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/gprbuild-relocatable-build.patch rename to pkgs/development/ada-modules/gprbuild/gprbuild-relocatable-build.patch diff --git a/pkgs/development/tools/build-managers/gprbuild/nixpkgs-gnat.xml b/pkgs/development/ada-modules/gprbuild/nixpkgs-gnat.xml similarity index 100% rename from pkgs/development/tools/build-managers/gprbuild/nixpkgs-gnat.xml rename to pkgs/development/ada-modules/gprbuild/nixpkgs-gnat.xml diff --git a/pkgs/development/libraries/ada/xmlada/default.nix b/pkgs/development/ada-modules/xmlada/default.nix similarity index 100% rename from pkgs/development/libraries/ada/xmlada/default.nix rename to pkgs/development/ada-modules/xmlada/default.nix diff --git a/pkgs/top-level/ada-packages.nix b/pkgs/top-level/ada-packages.nix new file mode 100644 index 000000000000..2d3d0c4dc3fa --- /dev/null +++ b/pkgs/top-level/ada-packages.nix @@ -0,0 +1,45 @@ +{ lib +, pkgs +, makeScopeWithSplicing' +, generateSplicesForMkScope +, gnat +}: +let + gnat_version = lib.versions.major gnat.version; +in +makeScopeWithSplicing' { + otherSplices = generateSplicesForMkScope ("gnat" + gnat_version + "Packages"); + f = (self: { + inherit gnat; + + gprbuild-boot = self.callPackage ../development/ada-modules/gprbuild/boot.nix { }; + gprbuild = self.callPackage ../development/ada-modules/gprbuild { }; + + xmlada = self.callPackage ../development/ada-modules/xmlada { }; + + gnatprove = self.callPackage ../development/ada-modules/gnatprove { + ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_14; + }; + + gnatcoll-core = self.callPackage ../development/ada-modules/gnatcoll/core.nix { }; + + # gnatcoll-bindings repository + 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"; }; + 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-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"; }; + + # gnatcoll-db repository + gnatcoll-postgres = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "postgres"; }; + gnatcoll-sql = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "sql"; }; + gnatcoll-sqlite = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "sqlite"; }; + gnatcoll-xref = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "xref"; }; + gnatcoll-db2ada = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "gnatcoll_db2ada"; }; + gnatinspect = self.callPackage ../development/ada-modules/gnatcoll/db.nix { component = "gnatinspect"; }; + }); +} + diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 445659c7e560..67933403e2f5 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -349,6 +349,21 @@ mapAliases ({ gnatboot11 = gnat-bootstrap11; gnatboot12 = gnat-bootstrap12; gnatboot = gnat-bootstrap; + gnatcoll-core = gnatPackages.gnatcoll-core; # Added 2024-02-25 + gnatcoll-gmp = gnatPackages.gnatcoll-gmp; # Added 2024-02-25 + gnatcoll-iconv = gnatPackages.gnatcoll-iconv; # Added 2024-02-25 + gnatcoll-lzma = gnatPackages.gnatcoll-lzma; # Added 2024-02-25 + gnatcoll-omp = gnatPackages.gnatcoll-omp; # Added 2024-02-25 + gnatcoll-python3 = gnatPackages.gnatcoll-python3; # Added 2024-02-25 + gnatcoll-readline = gnatPackages.gnatcoll-readline; # Added 2024-02-25 + gnatcoll-syslog = gnatPackages.gnatcoll-syslog; # Added 2024-02-25 + gnatcoll-zlib = gnatPackages.gnatcoll-zlib; # Added 2024-02-25 + gnatcoll-postgres = gnatPackages.gnatcoll-postgres; # Added 2024-02-25 + gnatcoll-sql = gnatPackages.gnatcoll-sql; # Added 2024-02-25 + gnatcoll-sqlite = gnatPackages.gnatcoll-sqlite; # Added 2024-02-25 + gnatcoll-xref = gnatPackages.gnatcoll-xref; # Added 2024-02-25 + gnatcoll-db2ada = gnatPackages.gnatcoll-db2ada; # Added 2024-02-25 + gnatinspect = gnatPackages.gnatinspect; # Added 2024-02-25 gnome-firmware-updater = gnome-firmware; # added 2022-04-14 gnome-passwordsafe = gnome-secrets; # added 2022-01-30 gnome-mpv = throw "'gnome-mpv' has been renamed to/replaced by 'celluloid'"; # Converted to throw 2023-09-10 @@ -393,7 +408,7 @@ mapAliases ({ gocode = throw "'gocode' has been removed as the upstream project was archived. 'gopls' is suggested as replacement"; # Added 2023-12-26 govendor = throw "'govendor' has been removed as it is no longer maintained upstream, please use Go modules instead"; # Added 2023-12-26 gometer = throw "gometer has been removed from nixpkgs because goLance stopped offering Linux support"; # Added 2023-02-10 - + gprbuild-boot = gnatPackages.gprbuild-boot; # Added 2024-02-25; graalvm11-ce = throw "graalvm11-ce has been removed because upstream dropped support to different JDK versions for each GraalVM release. Please use graalvm-ce instead"; # Added 2023-09-26 graalvm17-ce = throw "graalvm17-ce has been removed because upstream dropped support to different JDK versions for each GraalVM release. Please use graalvm-ce instead"; # Added 2023-09-26 graalvm19-ce = throw "graalvm19-ce has been removed because upstream dropped support to different JDK versions for each GraalVM release. Please use graalvm-ce instead"; # Added 2023-09-26 @@ -1174,6 +1189,7 @@ mapAliases ({ xdg_utils = xdg-utils; # Added 2021-02-01 xineLib = xine-lib; # Added 2021-04-27 xineUI = xine-ui; # Added 2021-04-27 + xmlada = gnatPackages.xmlada; # Added 2024-02-25 xonsh-unwrapped = throw "'xonsh-unwrapped' was incorporated into xonsh code; call xonsh directly instead."; # Added 2024-01-20 xtrt = throw "xtrt has been removed due to being abandoned"; # Added 2023-05-25 xulrunner = firefox-unwrapped; # Added 2023-11-03 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05c3088fa5db..531f29a4ac0d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16075,9 +16075,10 @@ with pkgs; bintools = bintoolsDualAs; }); - gnatprove = callPackage ../development/libraries/ada/gnatprove { - ocamlPackages = ocaml-ng.ocamlPackages_4_14; - }; + gnatPackages = recurseIntoAttrs (callPackage ./ada-packages.nix { gnat = buildPackages.gnat; }); + inherit (gnatPackages) + gprbuild + gnatprove; gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { }; @@ -19117,14 +19118,6 @@ with pkgs; global = callPackage ../development/tools/misc/global { }; - gnatcoll-db2ada = callPackage ../development/libraries/ada/gnatcoll/db.nix { - component = "gnatcoll_db2ada"; - }; - - gnatinspect = callPackage ../development/libraries/ada/gnatcoll/db.nix { - component = "gnatinspect"; - }; - gnome-doc-utils = callPackage ../development/tools/documentation/gnome-doc-utils { }; gnome-desktop-testing = callPackage ../development/tools/gnome-desktop-testing { }; @@ -19169,10 +19162,6 @@ with pkgs; gotty = callPackage ../servers/gotty { }; - gprbuild-boot = callPackage ../development/tools/build-managers/gprbuild/boot.nix { }; - - gprbuild = callPackage ../development/tools/build-managers/gprbuild { }; - gputils = callPackage ../development/embedded/gputils { }; gpuvis = callPackage ../development/tools/misc/gpuvis { }; @@ -21578,27 +21567,6 @@ with pkgs; gl3w = callPackage ../development/libraries/gl3w { }; - gnatcoll-core = callPackage ../development/libraries/ada/gnatcoll/core.nix { }; - - # gnatcoll-bindings repository - gnatcoll-gmp = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "gmp"; }; - gnatcoll-iconv = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "iconv"; }; - gnatcoll-lzma = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "lzma"; }; - gnatcoll-omp = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "omp"; }; - gnatcoll-python3 = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { - component = "python3"; - python3 = python39; - }; - gnatcoll-readline = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "readline"; }; - gnatcoll-syslog = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "syslog"; }; - gnatcoll-zlib = callPackage ../development/libraries/ada/gnatcoll/bindings.nix { component = "zlib"; }; - - # gnatcoll-db repository - gnatcoll-postgres = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "postgres"; }; - gnatcoll-sql = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "sql"; }; - gnatcoll-sqlite = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "sqlite"; }; - gnatcoll-xref = callPackage ../development/libraries/ada/gnatcoll/db.nix { component = "xref"; }; - gns3Packages = dontRecurseIntoAttrs (callPackage ../applications/networking/gns3 { }); gns3-gui = gns3Packages.guiStable; gns3-server = gns3Packages.serverStable; @@ -25494,8 +25462,6 @@ with pkgs; xmake-core-sv = callPackage ../development/libraries/xmake-core-sv { }; - xmlada = callPackage ../development/libraries/ada/xmlada { }; - xmlrpc_c = callPackage ../development/libraries/xmlrpc-c { }; xmlsec = callPackage ../development/libraries/xmlsec { };