diff -Nru dh-ada-library-6.20/ada_library.pm dh-ada-library-7.3/ada_library.pm --- dh-ada-library-6.20/ada_library.pm 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/ada_library.pm 2020-12-10 23:02:19.000000000 +0000 @@ -17,7 +17,6 @@ use strict; use Debian::Debhelper::Dh_Lib; -# See WHEN section of /usr/share/doc/dh-ada-library/README. insert_after("dh_lintian", "dh_ada_library"); 1; diff -Nru dh-ada-library-6.20/debian/changelog dh-ada-library-7.3/debian/changelog --- dh-ada-library-6.20/debian/changelog 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/debian/changelog 2020-12-11 21:02:01.000000000 +0000 @@ -1,3 +1,35 @@ +dh-ada-library (7.3) unstable; urgency=medium + + * Reupload to unstable for gnat-10 transition. + * Add myself to Uploaders. + + -- Ludovic Brenta Fri, 11 Dec 2020 22:02:01 +0100 + +dh-ada-library (7.2) experimental; urgency=medium + + * Build-Depend: libgnatprj with a strict version, replacing the ALI + version which does not change in experimental. + + -- Nicolas Boulenguez Sun, 15 Nov 2020 17:48:26 +0000 + +dh-ada-library (7.1) experimental; urgency=medium + + * Rebuild against libgnatprj/21.0.0-1. + * Typo in manual page. + + -- Nicolas Boulenguez Fri, 23 Oct 2020 18:44:24 +0000 + +dh-ada-library (7.0) experimental; urgency=medium + + * Generate linker options for installed projects from Linker'Linker_Options + instead of (Leading_)Library_Options. + Add related -dev packages to ada:Depends. + * Build with gnat-10 and updated dependencies. + * Fix name in default configuration project. + * Update and gather documentation and copyrights. + + -- Nicolas Boulenguez Thu, 21 May 2020 17:30:32 +0000 + dh-ada-library (6.20) unstable; urgency=medium * Strip unreproducible -f*-prefix-map= options from installed .ali files. diff -Nru dh-ada-library-6.20/debian/control dh-ada-library-7.3/debian/control --- dh-ada-library-6.20/debian/control 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/debian/control 2020-12-11 21:01:37.000000000 +0000 @@ -1,13 +1,18 @@ Source: dh-ada-library Maintainer: Nicolas Boulenguez +Uploaders: Ludovic Brenta Section: devel Priority: optional Standards-Version: 4.5.0 Rules-Requires-Root: no Build-Depends: debhelper-compat (= 13), - gnat-9, - libgnatprj7-dev, + gnat-10, +# The following line has its role during the gnat-10 transition in +# experimental, but we keep the one without version so that the +# test can go on and extract the ALI version. + libgnatprj8-dev (>= 2021.0.0.0778b109-2), + libgnatprj8-dev, # The same versions must be updated manually in tests/control. # The test script extracts the gnatprj version from here. Vcs-Browser: https://salsa.debian.org/debian/dh_ada_library diff -Nru dh-ada-library-6.20/debian/dh-ada-library.docs dh-ada-library-7.3/debian/dh-ada-library.docs --- dh-ada-library-6.20/debian/dh-ada-library.docs 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/debian/dh-ada-library.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/README diff -Nru dh-ada-library-6.20/debian/dh-ada-library.install dh-ada-library-7.3/debian/dh-ada-library.install --- dh-ada-library-6.20/debian/dh-ada-library.install 2018-04-24 12:34:50.000000000 +0000 +++ dh-ada-library-7.3/debian/dh-ada-library.install 2020-12-10 23:02:19.000000000 +0000 @@ -1,3 +1,3 @@ ada_library.pm usr/share/perl5/Debian/Debhelper/Sequence obj/dh_ada_library usr/bin -default_cgpr usr/share/dh_ada_library +default.cgpr usr/share/dh_ada_library diff -Nru dh-ada-library-6.20/debian/README dh-ada-library-7.3/debian/README --- dh-ada-library-6.20/debian/README 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/debian/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -WHEN - -Dh_ada_library appends lintian override to existing files, while -dh_lintian blindly overwrites them, so it is better to run -dh_ada_library after dh_lintian. - -As most of the job is installing files, good logic says that we should -come before dh_link/dh_compress/dh_fixperms. - -BUILD - -Version numbering: X.Y, where X only increases when source changes are -needed in reverse dependencies. diff -Nru dh-ada-library-6.20/debian/tests/control dh-ada-library-7.3/debian/tests/control --- dh-ada-library-6.20/debian/tests/control 2020-04-22 00:24:38.000000000 +0000 +++ dh-ada-library-7.3/debian/tests/control 2020-12-10 23:02:19.000000000 +0000 @@ -1,7 +1,9 @@ Test-Command: sh tests/regression Depends: @, gprbuild, gnat, gcc, fakeroot, make, debhelper, dpkg-dev, libfile-fcntllock-perl, - gnat-9, libgnatprj7-dev + zlib1g-dev, + gnat-10, libgnatprj8-dev # If libfile-fcntllock-perl is not installed, # dpkg-gencontrol complains on standard error. +# The test builds a package depending on libz. diff -Nru dh-ada-library-6.20/debian/TODO dh-ada-library-7.3/debian/TODO --- dh-ada-library-6.20/debian/TODO 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/debian/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -Changes affecting dependencies (new major number) - -Abort the build if the .ali files changed with the same debian -aliversion (which is in the -dev package name). -Discuss the idea with users first. -See TODO.check_aliversion. Only keep checksums, timestamps should be -ignored (because of SOURCE_DATE_EPOCH for example). - - -More simple and consistant handling of library options: - The \fILinker\fR package of the new project - inherits any --.B \-l --or --.B \-L --linker options from \fILeading_Library_Options\fR --and \fILibrary_Options\fR attributes of the build project file. -+Linker package of the build project file. -The documentation should also recall the difference between the three -fields. - -Include checks that lintian cannot do as it cannot -detect Ada packages. Examples: -source: Build-Depends on gnat -source: Build-Depends on gnat-X (would make the call to gnatgcc - --version unneeded in the Makefile snippet). --dev: Depends on gnat --dev: Depends on gnat-X or includes ada:Depends --doc/-bin if available Suggests: gnat - --- -Prospective - -See if library_symbol_policy in the project can be used to generate a -list of symbol versions in the Debian way. - -Upload Debian tags for libraries with debtags --upload? Some tags can -be automatically deduced. - -Once directories.gpr is correctly defined, parse it the -to know were things must be installed. -The real problem will be to detect arch-dependent sources/projects. - -Ignoring Library_Version has its counterparts (gtkada upstream uses a -unusual soname). - -See if the gnatcoll API is more stable than the libgpr API. diff -Nru dh-ada-library-6.20/default_cgpr dh-ada-library-7.3/default_cgpr --- dh-ada-library-6.20/default_cgpr 2018-03-01 12:29:43.000000000 +0000 +++ dh-ada-library-7.3/default_cgpr 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ --- Configuration for the gnat project driver. - --- It does not have the .cpgr extension because gnat tools tend to --- blindly and silently use any .cgpr file lying around. - --- The configuration generated on the fly in the absence of any .cpgr --- only recognizes Ada sources, and does not handle separate bodies --- correctly. - --- Only Ada and C have received decent support/testing. - --- To add a language, or find a missing default, install gprbuild --- then run --- gprconfig --batch -o default_cgpr --config=language - --- Without gprbuild, you may also set "Prj.Current_Verbosity := Prj.High;", --- replace "Config_File_Name => Default_Cgpr" with "Config_File_Name => "", --- On_Load_Config => Prj.Conf.Add_Default_GNAT_Naming_Scheme'Access" --- in src/projects.adb, then look the default project. - -configuration project Default is - for Library_Support use "full"; - for Shared_Library_Prefix use "lib"; - for Symbolic_Link_Supported use "true"; - for Library_Major_Minor_Id_Supported use "true"; - for Shared_Library_Suffix use ".so"; - for Library_Auto_Init_Supported use "true"; - for Default_Language use "Ada"; - package Compiler is - for Driver ("Ada") use "/usr/bin/gnatgcc"; - for Language_Kind ("Ada") use "unit_based"; - for Dependency_kind ("Ada") use "ali_file"; - for Mapping_File_Switches ("Ada") use ("-gnatem="); - for Mapping_Spec_Suffix ("Ada") use "%s"; - for Mapping_Body_Suffix ("Ada") use "%b"; - for Config_File_Switches ("Ada") use ("-gnatec="); - for Multi_Unit_Switches ("Ada") use ("-gnateI"); - for Multi_Unit_Object_Separator ("Ada") use "~"; - for Config_Body_File_Name ("Ada") use - "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");"; - for Config_Spec_File_Name ("Ada") use - "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");"; - for Config_Body_File_Name_Index ("Ada") use - "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);"; - for Config_Spec_File_Name_Index ("Ada") use - "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);"; - for Config_Body_File_Name_Pattern ("Ada") use - "pragma Source_File_Name_Project " & - " (Body_File_Name => ""*%b""," & - " Casing => %c," & - " Dot_Replacement => ""%d"");"; - for Config_Spec_File_Name_Pattern ("Ada") use - "pragma Source_File_Name_Project " & - " (Spec_File_Name => ""*%s""," & - " Casing => %c," & - " Dot_Replacement => ""%d"");"; - for Config_File_Unique ("Ada") use "False"; - - for Driver ("C") use "/usr/bin/gnatgcc"; - end Compiler; - package Naming is - for Casing use "lowercase"; - for Dot_Replacement use "-"; - - for Body_Suffix ("ada") use ".adb"; - for Spec_Suffix ("ada") use ".ads"; - - for Body_Suffix ("asm") use ".s"; - for Body_Suffix ("asm2") use ".asm"; - for Body_Suffix ("asm_cpp") use ".S"; - - for Body_Suffix ("c") use ".c"; - for Spec_Suffix ("c") use ".h"; - - for Spec_Suffix ("c++") use ".hh"; - for Body_Suffix ("c++") use ".cpp"; - - for Body_Suffix ("fortran") use ".f"; - end Naming; -end Default; diff -Nru dh-ada-library-6.20/default.cgpr dh-ada-library-7.3/default.cgpr --- dh-ada-library-6.20/default.cgpr 1970-01-01 00:00:00.000000000 +0000 +++ dh-ada-library-7.3/default.cgpr 2020-12-10 23:02:19.000000000 +0000 @@ -0,0 +1,77 @@ +-- Configuration for the gnat project driver. + +-- The configuration generated on the fly in the absence of any .cpgr +-- only recognizes Ada sources, and does not handle separate bodies +-- correctly. + +-- Only Ada and C have received decent support/testing. + +-- To add a language, or find a missing default, install gprbuild +-- then run +-- gprconfig --batch -o default.cgpr --config=language + +-- Without gprbuild, you may also set "Prj.Current_Verbosity := Prj.High;", +-- replace "Config_File_Name => Default_Cgpr" with "Config_File_Name => "", +-- On_Load_Config => Prj.Conf.Add_Default_GNAT_Naming_Scheme'Access" +-- in src/projects.adb, then look the default project. + +configuration project Default is + for Library_Support use "full"; + for Shared_Library_Prefix use "lib"; + for Symbolic_Link_Supported use "true"; + for Library_Major_Minor_Id_Supported use "true"; + for Shared_Library_Suffix use ".so"; + for Library_Auto_Init_Supported use "true"; + for Default_Language use "Ada"; + package Compiler is + for Driver ("Ada") use "/usr/bin/gnatgcc"; + for Language_Kind ("Ada") use "unit_based"; + for Dependency_kind ("Ada") use "ali_file"; + for Mapping_File_Switches ("Ada") use ("-gnatem="); + for Mapping_Spec_Suffix ("Ada") use "%s"; + for Mapping_Body_Suffix ("Ada") use "%b"; + for Config_File_Switches ("Ada") use ("-gnatec="); + for Multi_Unit_Switches ("Ada") use ("-gnateI"); + for Multi_Unit_Object_Separator ("Ada") use "~"; + for Config_Body_File_Name ("Ada") use + "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");"; + for Config_Spec_File_Name ("Ada") use + "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");"; + for Config_Body_File_Name_Index ("Ada") use + "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);"; + for Config_Spec_File_Name_Index ("Ada") use + "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);"; + for Config_Body_File_Name_Pattern ("Ada") use + "pragma Source_File_Name_Project " & + " (Body_File_Name => ""*%b""," & + " Casing => %c," & + " Dot_Replacement => ""%d"");"; + for Config_Spec_File_Name_Pattern ("Ada") use + "pragma Source_File_Name_Project " & + " (Spec_File_Name => ""*%s""," & + " Casing => %c," & + " Dot_Replacement => ""%d"");"; + for Config_File_Unique ("Ada") use "False"; + + for Driver ("C") use "/usr/bin/gnatgcc"; + end Compiler; + package Naming is + for Casing use "lowercase"; + for Dot_Replacement use "-"; + + for Body_Suffix ("ada") use ".adb"; + for Spec_Suffix ("ada") use ".ads"; + + for Body_Suffix ("asm") use ".s"; + for Body_Suffix ("asm2") use ".asm"; + for Body_Suffix ("asm_cpp") use ".S"; + + for Body_Suffix ("c") use ".c"; + for Spec_Suffix ("c") use ".h"; + + for Spec_Suffix ("c++") use ".hh"; + for Body_Suffix ("c++") use ".cpp"; + + for Body_Suffix ("fortran") use ".f"; + end Naming; +end Default; diff -Nru dh-ada-library-6.20/man/dh_ada_library.1 dh-ada-library-7.3/man/dh_ada_library.1 --- dh-ada-library-6.20/man/dh_ada_library.1 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/man/dh_ada_library.1 2020-12-10 23:02:19.000000000 +0000 @@ -43,7 +43,7 @@ source directories, library directory, object directory (containing ALI files) -and linker options (both \fILeading_Library_Options\fR and \fILibrary_Options\fR). +and linker options (\fILinker'Linker_Options\fR). .\" Then it parses .I debian/control @@ -53,17 +53,6 @@ ALI files version (\fIaliversion\fR)) and the shared library version (\fIsoversion\fR). .\"---------------------------------------------------------------------- -.SS Important change in version 7 -Previous versions were deducing linker options for the installed -project from \fILeading_Library_Options\fR and \fILibrary_Options\fR -attributes in the build project. -.\" -Next versions, more consistently with other GNAT tools, will read -\fILinker'Linker_Options\fR instead. -.\" -Unfortunately, integration tests (like \fIautopkgtests\fR) seem to be -the only reliable way to detect problems caused by this change. -.\"---------------------------------------------------------------------- .SS Runtime library package \fBdh_ada_library\fR installs the shared library into this package. .PP @@ -98,15 +87,8 @@ .PP A second project file, intended for use by programs linking against the library, is generated and installed into the \-dev package, -copying the renaming exceptions. -.\" -The \fILinker\fR package of the new project -inherits any -.B \-l -or -.B \-L -linker options from \fILeading_Library_Options\fR -and \fILibrary_Options\fR attributes of the build project file. +copying the renaming exceptions and \fILinker'Linker_Options\fR +attribute of the original project (see below). .PP The .I ada:Depends @@ -125,6 +107,11 @@ For already processed project within the same source package, the dependency mandates an exact \fIbinary:Version\fR, ensuring that all static libraries are compiled with compatible options. +.\" +For each option like \fB\-l\fIFOO\fR in \fILinker'Linker_Options\fR, a +matching \fIlibFOO.so\fR is searched in the default library directory, +and the -dev package responsible for its installation is added to +\fIada:Depends\fR. .\"---------------------------------------------------------------------- .SH DEBHELPER INTEGRATION Most packages only need to add \fIdh\-sequence\-ada\-library\fR to @@ -182,6 +169,29 @@ .I Multi-Arch: same as the content of the project (and maybe of generated sources) will vary across architectures. +.PP +The \fILinker'Linker_Options\fR attribute should rarely be needed. +.\" +A dependency written in Ada should be described by an imported +project, also handling \fI.ali\fR files. +.\" +A dependency written in C should be listed in \fILibrary_Options\fR +when building a shared library, and in \fILinker'Linker_Options\fR +when using a static archive, but is not always required in +\fILinker'Linker_Options\fR for shared libraries. +.\" +Until now, such options have only proved useful to light bindings +importing C symbols from a specification or an inlined procedure. +.\" +In a \fIfoo.pc\fR file as read by \fIpkg\-config\fR, they are named +\fILibs\fR, excluding \fI\-lfoo\fR and \fILibs.private\fR. +.\" +.PP +Versions prior to 7 were reading \fILeading_Library_Options\fR and +\fILibrary_Options\fR instead of \fILinker'Linker_Options\fR. +.\" +Unfortunately, integration tests (like \fIautopkgtests\fR) seem to be +the only way to detect packages relying on this behaviour. .\"---------------------------------------------------------------------- .SH FILES .TP @@ -203,6 +213,16 @@ .SH EXAMPLES dh_ada_library 'DIRS=src gen' SOVERSION=ignored foo.gpr \-\-verbose \-\-no\-act .\"---------------------------------------------------------------------- +.SH VERSIONS +The version is composed of two numbers separated by a dot. +.\" +The second one increases during a normal update, which supposedly +fixes bugs, introduces compatible evolutions, or remove stuff unused +since \fIoldoldstable\fR. +.\" +A change in the first one announces an incompatibility requiring some +users to modify their source package. +.\"---------------------------------------------------------------------- .SH SEE ALSO .BR debhelper (7), .BR dh_installdocs (1), diff -Nru dh-ada-library-6.20/man/dh_ada_library.fr.1 dh-ada-library-7.3/man/dh_ada_library.fr.1 --- dh-ada-library-6.20/man/dh_ada_library.fr.1 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/man/dh_ada_library.fr.1 2020-12-10 23:02:19.000000000 +0000 @@ -48,7 +48,7 @@ celui contenant les fichiers ALI (\fIObject_Dir\fR), et les options de l’éditeur de liens -(\fILeading_Library_Options\fR et \fILibrary_Options\fR). +(\fILinker'Linker_Options\fR). .\" Ensuite, il parcourt .I debian/control @@ -59,18 +59,6 @@ (\fIaliversion\fR) et de la bibliothèque partagée (\fIsoversion\fR). .\"---------------------------------------------------------------------- -.SS Changement important avec la version 7 -Les versions précédentes déduisaient les options de l’éditeur de liens -dans le projet installé des attributs \fILeading_Library_Options\fR et -\fILibrary_Options\fR du projet de construction. -.\" -Les version suivantes, d’une manière plus cohérente avec les autres -outils GNAT, liront plutôt \fILinker'Linker_Options\fR. -.\" -Malheureusement, les tests d’intégration (comme \fIautopkgtests\fR) -semblent le seul moyen fiable de détecter les problèmes dus à ce -changement. -.\"---------------------------------------------------------------------- .SS Paquet fournissant la bibliothèque dynamique \fBdh\-ada\-library\fR installe la bibliothèque partagée dans ce paquet. .PP @@ -112,19 +100,8 @@ paquet \-dev, qui copie les exceptions de renommage du projet d’origine. .\" -Le paquet \fILinker\fR du nouveau projet hérite des options destinées -à l’éditeur de liens -.B \-l -ou -.B \-L -mentionnées dans les attributs \fILeading_Library_Options\fR -ou \fILibrary_Options\fR du projet de -compilation. -.PP -\fBdh_ada_library\fR exécute -.B dh_strip -avant d’installer la bibliothèque statique afin que celle\-ci conserve -ses informations de déboguage. +Il copie également les options \fILinker'Linker_Switches\fR de +l’éditeur de lien (voir plus loin). .PP La variable de substitution .I ada:Depends @@ -145,6 +122,13 @@ la dépendance exige exactement la même \fIbinary:Version\fR, afin de garantir que toutes les archives statiques sont compilées avec des options compatibles. +.\" +Lorsqu’une option dans la liste \fILinker'Linker_Options\fR du projet +de construction, est de la forme \fB\-l\fIFOO\fR, le lien +\fIlibFOO.so\fR est recherché dans le répertoire contenant les +bibliothèques de ce système, et le paquet responsable de son +installation est ajouté à la variable de substitution +\fIada:Depends\fR. .\"---------------------------------------------------------------------- .SH INTÉGRATION DANS DEBHELPER La plupart des paquets n’ont besoin que d’ajouter @@ -205,6 +189,33 @@ .I Multi-Arch: same puisque le contenu du projet (et le cas échéant de sources générées) sera différent selon l’architecture. +.PP +L’attribut \fILinker'Linker_Options\fR devrait rarement être utile. +.\" +Une dépendance écrite en Ada gagne à être décrite dans un projet +importé, qui tiendra également compte des fichiers \fI.ali\fR. +.\" +UNe dépendance écrite en C doit figurer dans \fILibrary_Options\fR +lors de la construction d’une bibliothèque partagée, et dans +\fILinker'Linker_Options\fR lors de l’utilisation d’une bibliothèque +statique, mais n’est pas toujours utile dans +\fILinker'Linker_Options\fR pour une bibliothèque partagée. +.\" +Jusqu’à présent, ces options ne se sont avérées utiles que lorsqu’un +\fIbinding\fR léger importe des symbolse C dans une spécification ou +une procédure \fIinlinées\fR. +.\" +Dans un fichier \fIfoo.pc\fR utilisé par \fIpkg\-config\fR, il +s’agirait des \fILibs\fR, à l’exclusion de \fI\-lfoo\fR et des +\fILibs.private\fR. +.\" +Les versions antérieures à 7.0 trouvaient ces informations dans +\fILeading_Library_Options\fR ou \fILibrary_Options\fR, au lieu de +\fILinker'Linker_Options\fB. +.\" +Malheureusement, les tests d’intégration (comme \fIautopkgtests\fR) +semblent le seul moyen de détecter les paquets nécessitant encore ce +comportement. .\"---------------------------------------------------------------------- .SH FICHIERS .TP @@ -226,6 +237,17 @@ .SH EXEMPLES dh_ada_library 'DIRS=src gen' SOVERSION=sans_effet toto.gpr \-\-verbose \-\-no\-act .\"---------------------------------------------------------------------- +.SH VERSIONS +La version comporte deux nombres séparés par un point. +.\" +Le second varie lors d’une mise à jour normale, qui est censée +corriger des bugs, introduire des évolutions compatibles ou supprimer +des services antérieurs à \fIoldoldstable\fR. +.\" +Une variation du premier annonce une incompatibilité obligeant +certains utilisateurs à modifier leur paquet source. +.\" +.\"---------------------------------------------------------------------- .SH VOIR AUSSI .BR debhelper (7), .BR dh_installdocs (1), diff -Nru dh-ada-library-6.20/src/dh_ada_library.adb dh-ada-library-7.3/src/dh_ada_library.adb --- dh-ada-library-6.20/src/dh_ada_library.adb 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/src/dh_ada_library.adb 2020-12-10 23:02:19.000000000 +0000 @@ -130,7 +130,8 @@ -- where it comes from. If the name matches an already processed -- library name, add a Depends. Else, use dpkg to find -- the Debian -dev package providing it. Else, output a warning. - -- Each renaming exception is transmitted. + -- Copy renaming exceptions and Linker'linker_Options. + -- Extend ada:Depends for -l options. procedure Append_Trampoline_Lintian_Override (Lib_Pkg : in String; @@ -241,8 +242,8 @@ Put_Line (F, "# allowing this file to be installed in /usr/share."); -- Note the star, because this file resides in /usr/share and -- its content should not vary across architectures. - Put_Line (F, Lib_Pkg & " binary: shlib-with-executable-stack usr/lib/*/" - & Soname); + Put_Line (F, Lib_Pkg + & " binary: executable-stack-in-shared-library usr/lib/*/" & Soname); Close (F); exception when others => @@ -386,9 +387,27 @@ Copy_Linker_Options : declare procedure Process (Option : in String); procedure Process (Option : in String) is - H : constant String := Ada.Strings.Fixed.Head (Option, 2); begin - if H = "-l" or H = "-L" then + if 2 <= Option'Length + and then Option (Option'First .. Option'First + 1) = "-l" + then + declare + Link : constant String := "lib" & + Option (Option'First + 2 .. Option'Last) & ".so"; + Path : aliased String := '/' & Lib_Install_Dir & Link; + Dev : constant String + := Package_Containing (Path'Unchecked_Access); + begin + if Dev = "" then + Dh_Lib.Warning ("Linker'Linker_Options in .gpr for " + & Projects.Library_Name & " contain """ & Option + & """ but dpkg does not find " & Path); + else + Dh_Lib.Addsubstvar (Dev_Pkg, "ada:Depends", Dev); + end if; + end; + end if; + if Option /= "-L/" & Lib_Install_Dir then if Col (F) = 1 then -- first option Put_Line (F, " package Linker is"); Put (F, " for Linker_Options use ("); @@ -403,7 +422,7 @@ end if; end Process; begin - Projects.Iterate_On_Library_Options (Process'Access); + Projects.Iterate_On_Linker_Options (Process'Access); if Col (F) /= 1 then -- at least a library option Put_Line (F, ");"); Put_Line (F, " end Linker;"); @@ -590,7 +609,7 @@ Misc.Capture_Output ("/usr/bin/dpkg-query", (Search'Unchecked_Access, Pattern), Temp_File, Return_Code); - if Return_Code = 1 then -- No match, or failure. + if Return_Code /= 0 then -- No match, or failure. Ada.Directories.Delete_File (Temp_File.all); Free (Temp_File); return ""; @@ -606,8 +625,10 @@ if Many_Lines then return ""; else + -- package(:architecture)?: path + -- If no colon is found, return "". return Buffer (Buffer'First - .. Ada.Strings.Fixed.Index (Buffer, ": ") - 1); + .. Ada.Strings.Fixed.Index (Buffer, ":") - 1); end if; end; exception diff -Nru dh-ada-library-6.20/src/misc.adb dh-ada-library-7.3/src/misc.adb --- dh-ada-library-6.20/src/misc.adb 2019-11-29 20:20:53.000000000 +0000 +++ dh-ada-library-7.3/src/misc.adb 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2013 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as diff -Nru dh-ada-library-6.20/src/misc.ads dh-ada-library-7.3/src/misc.ads --- dh-ada-library-6.20/src/misc.ads 2020-04-28 01:55:13.000000000 +0000 +++ dh-ada-library-7.3/src/misc.ads 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2013 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as diff -Nru dh-ada-library-6.20/src/projects.adb dh-ada-library-7.3/src/projects.adb --- dh-ada-library-6.20/src/projects.adb 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/src/projects.adb 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2016 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as @@ -25,9 +25,8 @@ package body Projects is - Default_Cgpr : constant String := "/usr/share/dh_ada_library/default_cgpr"; + Default_Cgpr : constant String := "/usr/share/dh_ada_library/default.cgpr"; - use type GNAT.OS_Lib.String_Access; use type GPR.Name_Id; use type GPR.Lib_Kind; use type GPR.Naming_Exception_Type; @@ -36,7 +35,7 @@ use type GPR.Source_Kind; use type GPR.Source_Id; use type GPR.String_List_Id; - use type GPR.Variable_Kind; + use type GPR.Variable_Value; Project_Tree_Data : aliased GPR.Project_Tree_Data; Project_Node_Tree_Data : aliased GPR.Project_Node_Tree_Data; @@ -121,38 +120,33 @@ end loop; end Iterate_On_Imported_Projects; - procedure Iterate_On_Library_Options + procedure Iterate_On_Linker_Options (Process : not null access procedure (Option : in String)) is - Lib_Opts_Attrs : constant array (Positive range <>) of GPR.Name_Id - := (GPR.Snames.Name_Leading_Library_Options, - GPR.Snames.Name_Library_Options); - Variable_Value : GPR.Variable_Value; - String_List_Id : GPR.String_List_Id; Shared : constant GPR.Shared_Project_Tree_Data_Access := Project_Tree_Data.Shared; - begin - for Attribute_Name of Lib_Opts_Attrs loop - Variable_Value := GPR.Util.Value_Of - (Variable_Name => Attribute_Name, - In_Variables => Project_Id.all.Decl.Attributes, - Shared => Shared); - if not Variable_Value.Default then - pragma Assert (Variable_Value.Kind = GPR.List); - String_List_Id := Variable_Value.Values; - while String_List_Id /= GPR.Nil_String loop - declare - String_Element : constant GPR.String_Element - := Shared.all.String_Elements.Table.all (String_List_Id); - begin - Process.all - (GPR.Names.Get_Name_String (String_Element.Value)); - String_List_Id := String_Element.Next; - end; - end loop; - end if; - end loop; - end Iterate_On_Library_Options; + Linker_Package : constant GPR.Package_Id := GPR.Util.Value_Of + (Name => GPR.Snames.Name_Linker, + In_Packages => Project_Id.all.Decl.Packages, + Shared => Shared); + Linker_Options : constant GPR.Variable_Value := GPR.Util.Value_Of + (Name => GPR.Snames.Name_Ada, + Index => 0, + Attribute_Or_Array_Name => GPR.Snames.Name_Linker_Options, + In_Package => Linker_Package, + Shared => Shared); + Position : GPR.String_List_Id; + begin + if Linker_Options /= GPR.Nil_Variable_Value then + Position := Linker_Options.Values; + while Position /= GPR.Nil_String loop + GPR.Names.Get_Name_String + (Shared.all.String_Elements.Table.all (Position).Value); + Process.all (GPR.Names.Name_Buffer (1 .. GPR.Names.Name_Len)); + Position := Shared.all.String_Elements.Table.all (Position).Next; + end loop; + end if; + end Iterate_On_Linker_Options; procedure Iterate_On_Naming_Exceptions (Process : not null access procedure (Unit : in String; diff -Nru dh-ada-library-6.20/src/projects.ads dh-ada-library-7.3/src/projects.ads --- dh-ada-library-6.20/src/projects.ads 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/src/projects.ads 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2016 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as @@ -68,10 +68,10 @@ (Process : not null access procedure (Path : in String)) with Pre => Initialized; - procedure Iterate_On_Library_Options + procedure Iterate_On_Linker_Options (Process : not null access procedure (Option : in String)) with Pre => Initialized; - -- Leading_Library_options are processed first, if any. + -- Non-recursive list of Linker'Linker_Options for this project. procedure Iterate_On_Naming_Exceptions (Process : not null access procedure (Unit : in String; diff -Nru dh-ada-library-6.20/src/string_sets.ads dh-ada-library-7.3/src/string_sets.ads --- dh-ada-library-6.20/src/string_sets.ads 2019-11-29 20:20:53.000000000 +0000 +++ dh-ada-library-7.3/src/string_sets.ads 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2013 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as diff -Nru dh-ada-library-6.20/src/string_vectors.ads dh-ada-library-7.3/src/string_vectors.ads --- dh-ada-library-6.20/src/string_vectors.ads 2019-11-29 20:20:53.000000000 +0000 +++ dh-ada-library-7.3/src/string_vectors.ads 2020-12-10 23:02:19.000000000 +0000 @@ -1,6 +1,6 @@ -- dh_ada_library, helper for Ada libraries Debian maintainers -- --- Copyright (C) 2012-2013 Nicolas Boulenguez +-- Copyright (C) 2012-2020 Nicolas Boulenguez -- -- This program is free software: you can redistribute it and/or -- modify it under the terms of the GNU General Public License as diff -Nru dh-ada-library-6.20/tests/libfoo/debian/control.sed dh-ada-library-7.3/tests/libfoo/debian/control.sed --- dh-ada-library-6.20/tests/libfoo/debian/control.sed 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/tests/libfoo/debian/control.sed 2020-12-10 23:02:19.000000000 +0000 @@ -8,6 +8,7 @@ gnat, @GNAT_PKG@, @GPR_DEV_PKG@, + zlib1g-dev, Standards-Version: 4.5.0 Homepage: https://nowhere.org diff -Nru dh-ada-library-6.20/tests/libfoo/foo.gpr dh-ada-library-7.3/tests/libfoo/foo.gpr --- dh-ada-library-6.20/tests/libfoo/foo.gpr 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/tests/libfoo/foo.gpr 2020-12-10 23:02:19.000000000 +0000 @@ -24,4 +24,7 @@ for Specification ("Replaced") use "replacement.ads"; end Naming; + package Linker is + for Linker_Options use ("-lz"); + end Linker; end Foo; diff -Nru dh-ada-library-6.20/tests/regression dh-ada-library-7.3/tests/regression --- dh-ada-library-6.20/tests/regression 2020-05-05 21:49:54.000000000 +0000 +++ dh-ada-library-7.3/tests/regression 2020-12-10 23:02:19.000000000 +0000 @@ -91,7 +91,7 @@ find $f_l_lib -type f | sort | diff expected4 - cat > expected5 <