From 98b9f3a4bda072c55d8f94fcf17fc3357fce5b15 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler Date: Sat, 3 Dec 2022 09:13:50 +0100 Subject: gnu: openscenegraph: Add output for plugins. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it so that other packages can find plugins via pkg-config and link to them in the usual manner. * gnu/packages/graphics.scm (openscenegraph)[outputs]: Add “pluginlib”. [properties]: Add output synopsis for “pluginlib”. [arguments]<#:modules>: Use (ice-9 regex). <#:phases>: Add ‘copy-plugins’. Signed-off-by: Liliana Marie Prikler --- gnu/packages/graphics.scm | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 90e9259540..6f117f69a2 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -1351,8 +1351,10 @@ visual effects work for film.") (base32 "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1")) (file-name (git-file-name name version)))) (properties - `((upstream-name . "OpenSceneGraph"))) + `((upstream-name . "OpenSceneGraph") + (output-synopsis "pluginlib" "Plugins as shared libraries"))) (build-system cmake-build-system) + (outputs (list "out" "pluginlib")) (arguments (list #:tests? #f ; no test target available @@ -1362,7 +1364,40 @@ visual effects work for film.") #:configure-flags #~(list (string-append "-DCMAKE_INSTALL_RPATH=" #$output "/lib:" - #$output "/lib64")))) + #$output "/lib64")) + #:modules `((guix build cmake-build-system) + (guix build utils) + (ice-9 regex)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'copy-plugins + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (pluginlib (assoc-ref outputs "pluginlib"))) + (mkdir-p (string-append pluginlib "/lib/pkgconfig")) + (with-directory-excursion (string-append out "/lib/osgPlugins-" + #$version) + (for-each + (lambda (lib) + (let ((blib (basename lib)) + (m (string-match "([^/]*)\\.so$" lib))) + (symlink (canonicalize-path lib) + (string-append pluginlib "/lib/lib" blib)) + (call-with-output-file (string-append + pluginlib + "/lib/pkgconfig/" + (match:substring m 1) ".pc") + (lambda (port) + (format port "libdir=~a/lib~%" pluginlib) + (newline port) + (format port "Name: ~a~%" (match:substring m 1)) + (format port "Version: ~a~%" #$version) + (display "Description: A plugin for openscenegraph\n" + port) + (display "Requires: openscenegraph\n" port) + (format port "Libs: -L${libdir} -l~a~%" + (match:substring m 1)))))) + (find-files "." "\\.so"))))))))) (native-inputs (list pkg-config unzip)) (inputs -- cgit v1.2.3 locations....* tests/texlive.scm ("texlive->guix-package"): Correct order of locations. Ricardo Wurmus 2021-11-18tests: Replace texlive importer tests....* tests/texlive.scm (xml, sxml): Remove variables. ("fetch-sxml: returns SXML for valid XML", "sxml->package"): Remove tests. ("texlive->guix-package"): Add new test. Ricardo Wurmus 2021-03-06tests: do not hard code HTTP ports...Previously, test cases could fail if some process was listening at a hard-coded port. This patch eliminates most of these potential failures, by automatically assigning an unbound port. This should allow for building multiple guix trees in parallel outside a build container, though this is currently untested. The test "home-page: Connection refused" in tests/lint.scm still hardcodes port 9999, however. * guix/tests/http.scm (http-server-can-listen?): remove now unused procedure. (%http-server-port): default to port 0, meaning the OS will automatically choose a port. (open-http-server-socket): remove the false statement claiming this procedure is exported and also return the allocated port number. (%local-url): raise an error if the port is obviously unbound. (call-with-http-server): set %http-server-port to the allocated port while the thunk is called. * tests/derivations.scm: adjust test cases to use automatically assign a port. As there is no risk of a port conflict now, do not make any tests conditional upon 'http-server-can-listen?' anymore. * tests/elpa.scm: likewise. * tests/lint.scm: likewise, and add a TODO comment about a port that is still hard-coded. * tests/texlive.scm: likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Maxime Devos