Message ID | b263e51d16f1c5b4e1e8fe344f88c149435e2a60.1693860853.git.ludo@gnu.org |
---|---|
State | New |
Headers | show |
Series | [bug#65745] gnu: yelp: Provide dependencies to display "man:" URIs. | expand |
Hello, Ludovic Courtès <ludo@gnu.org> writes: [...] > diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm > index 3b80692e90..894d77d7ba 100644 > --- a/gnu/packages/gnome.scm > +++ b/gnu/packages/gnome.scm > @@ -7336,6 +7336,31 @@ (define-public yelp > (base32 > "0h9vf4fx056imjf8ibmn03wg1c3hniipy1nsm2jqi62lp1m19c95")))) > (build-system glib-or-gtk-build-system) > + (arguments > + (list #:phases > + #~(modify-phases %standard-phases > + (add-after 'unpack 'set-man-file-name > + (lambda* (#:key inputs outputs #:allow-other-keys) > + ;; Create a wrapper for 'man' that knows where to find > + ;; 'groff' and 'gunzip'. > + (define libexecdir > + (string-append #$output "/libexec/yelp")) > + (define wrapper > + (string-append libexecdir "/man")) > + > + (mkdir-p libexecdir) > + (symlink (search-input-file inputs "bin/man") wrapper) > + (wrap-program wrapper > + `("PATH" ":" = > + ,(map (lambda (program) > + (dirname (search-input-file inputs program))) > + '("bin/groff" "bin/gunzip")))) > + > + ;; Have Yelp use that 'man' wrapper instead of searching > + ;; for 'man' in $PATH. > + (substitute* "libyelp/yelp-man-parser.c" > + (("\"man\"") > + (string-append "\"" wrapper "\"")))))))) Couldn't we more simply wrap the yelp command with the 'man', 'groff' and 'gunzip' command locations added to PATH?
Hi, Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: >> + ;; Create a wrapper for 'man' that knows where to find >> + ;; 'groff' and 'gunzip'. >> + (define libexecdir >> + (string-append #$output "/libexec/yelp")) >> + (define wrapper >> + (string-append libexecdir "/man")) >> + >> + (mkdir-p libexecdir) >> + (symlink (search-input-file inputs "bin/man") wrapper) >> + (wrap-program wrapper >> + `("PATH" ":" = >> + ,(map (lambda (program) >> + (dirname (search-input-file inputs program))) >> + '("bin/groff" "bin/gunzip")))) >> + >> + ;; Have Yelp use that 'man' wrapper instead of searching >> + ;; for 'man' in $PATH. >> + (substitute* "libyelp/yelp-man-parser.c" >> + (("\"man\"") >> + (string-append "\"" wrapper "\"")))))))) > > Couldn't we more simply wrap the yelp command with the 'man', 'groff' and > 'gunzip' command locations added to PATH? Yeah it’s convoluted; the idea was that the wrapper for ‘man’ is something that should be fixed in ‘man-db’ proper but that we cannot fix in ‘master’ because ‘man-db’ has too many dependents. Maybe I should start with it though… Ludo’.
Am Samstag, dem 09.09.2023 um 18:45 +0200 schrieb Ludovic Courtès: > Hi, > > Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > > > > + ;; Create a wrapper for 'man' that knows > > > where to find > > > + ;; 'groff' and 'gunzip'. > > > + (define libexecdir > > > + (string-append #$output "/libexec/yelp")) > > > + (define wrapper > > > + (string-append libexecdir "/man")) > > > + > > > + (mkdir-p libexecdir) > > > + (symlink (search-input-file inputs "bin/man") > > > wrapper) > > > + (wrap-program wrapper > > > + `("PATH" ":" = > > > + ,(map (lambda (program) > > > + (dirname (search-input-file > > > inputs program))) > > > + '("bin/groff" "bin/gunzip")))) > > > + > > > + ;; Have Yelp use that 'man' wrapper instead > > > of searching > > > + ;; for 'man' in $PATH. > > > + (substitute* "libyelp/yelp-man-parser.c" > > > + (("\"man\"") > > > + (string-append "\"" wrapper "\"")))))))) > > > > Couldn't we more simply wrap the yelp command with the 'man', > > 'groff' and > > 'gunzip' command locations added to PATH? > > Yeah it’s convoluted; the idea was that the wrapper for ‘man’ is > something that should be fixed in ‘man-db’ proper but that we cannot > fix > in ‘master’ because ‘man-db’ has too many dependents. > > Maybe I should start with it though… Can we graft our man-db to get the same effect?
Hi, Liliana Marie Prikler <liliana.prikler@gmail.com> writes: > Am Samstag, dem 09.09.2023 um 18:45 +0200 schrieb Ludovic Courtès: >> Hi, >> >> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: >> >> > > + ;; Create a wrapper for 'man' that knows >> > > where to find >> > > + ;; 'groff' and 'gunzip'. >> > > + (define libexecdir >> > > + (string-append #$output "/libexec/yelp")) >> > > + (define wrapper >> > > + (string-append libexecdir "/man")) >> > > + >> > > + (mkdir-p libexecdir) >> > > + (symlink (search-input-file inputs "bin/man") >> > > wrapper) >> > > + (wrap-program wrapper >> > > + `("PATH" ":" = >> > > + ,(map (lambda (program) >> > > + (dirname (search-input-file >> > > inputs program))) >> > > + '("bin/groff" "bin/gunzip")))) >> > > + >> > > + ;; Have Yelp use that 'man' wrapper instead >> > > of searching >> > > + ;; for 'man' in $PATH. >> > > + (substitute* "libyelp/yelp-man-parser.c" >> > > + (("\"man\"") >> > > + (string-append "\"" wrapper "\"")))))))) >> > >> > Couldn't we more simply wrap the yelp command with the 'man', >> > 'groff' and >> > 'gunzip' command locations added to PATH? >> >> Yeah it’s convoluted; the idea was that the wrapper for ‘man’ is >> something that should be fixed in ‘man-db’ proper but that we cannot >> fix >> in ‘master’ because ‘man-db’ has too many dependents. >> >> Maybe I should start with it though… > Can we graft our man-db to get the same effect? We also have a core-updates branch; it could go there and we could merge it with the docbook stuff that's going to go there. I'd prefer this than convoluted solutions I don't understand :-). -- Thanks, Maxim
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 3b80692e90..894d77d7ba 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -7336,6 +7336,31 @@ (define-public yelp (base32 "0h9vf4fx056imjf8ibmn03wg1c3hniipy1nsm2jqi62lp1m19c95")))) (build-system glib-or-gtk-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-man-file-name + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Create a wrapper for 'man' that knows where to find + ;; 'groff' and 'gunzip'. + (define libexecdir + (string-append #$output "/libexec/yelp")) + (define wrapper + (string-append libexecdir "/man")) + + (mkdir-p libexecdir) + (symlink (search-input-file inputs "bin/man") wrapper) + (wrap-program wrapper + `("PATH" ":" = + ,(map (lambda (program) + (dirname (search-input-file inputs program))) + '("bin/groff" "bin/gunzip")))) + + ;; Have Yelp use that 'man' wrapper instead of searching + ;; for 'man' in $PATH. + (substitute* "libyelp/yelp-man-parser.c" + (("\"man\"") + (string-append "\"" wrapper "\"")))))))) (native-inputs (list `(,glib "bin") ; for glib-genmarshal, etc. intltool @@ -7347,6 +7372,8 @@ (define-public yelp (list gsettings-desktop-schemas libhandy libxslt + man-db ;for URIs like "man:ls" + (lookup-package-input man-db "groff-minimal") ;ditto sqlite webkitgtk yelp-xsl))