Package: openblas
Severity: wishlist
Tags: patch

Please apply the attached patch to enable openblas to provide pkgconfig files
for blas, lapack.

This patch uses alternatives to alias blas-openblas.pc and lapack-openblas.pc
to blas.pc and lapack.pc respectively, enabling you to link either with
openBLAS either 'generically' or expliclity.

While I plan to get these patches into upstream, both Gentoo and Fedora have
already got blas.pc and lapack.pc and this functionality would be very
convenient.

-- System Information:
Debian Release: 7.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.32-5-powerpc
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to ga_IE.UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -urN debian.orig/blas-openblas.pc debian/blas-openblas.pc
--- debian.orig/blas-openblas.pc	1970-01-01 01:00:00.000000000 +0100
+++ debian/blas-openblas.pc	2014-10-08 12:42:05.072354184 +0100
@@ -0,0 +1,10 @@
+    prefix=/usr
+    libdir=${prefix}/lib/openblas-base
+    includedir=${prefix}/include/openblas
+    Name: blas-openblas
+    Description:  Optimized BLAS (linear algebra) library based on GotoBLAS2
+    Version: 0.2.11
+    URL: https://github.com/xianyi/OpenBLAS
+    Libs: -L${libdir} -lblas
+    Libs.private: -L${libdir} -lblas -lm
+    Cflags: -I${includedir}
diff -urN debian.orig/changelog debian/changelog
--- debian.orig/changelog	2014-09-27 19:25:40.000000000 +0100
+++ debian/changelog	2014-10-08 12:14:26.233650002 +0100
@@ -1,3 +1,11 @@
+openblas (0.2.11-2.1) UNRELEASED; urgency=medium
+
+  [ Alastair McKinstry ]
+  * Non-maintainer upload.
+  * Add blas-openblas.pc file, and blas.pc symlink via update-alternatives
+
+ -- Alastair McKinstry <mckins...@debian.org>  Wed, 08 Oct 2014 12:13:24 +0100
+
 openblas (0.2.11-2) unstable; urgency=medium
 
   * libopenblas-base: add dependency on libblas-common.
diff -urN debian.orig/lapack-openblas.pc debian/lapack-openblas.pc
--- debian.orig/lapack-openblas.pc	1970-01-01 01:00:00.000000000 +0100
+++ debian/lapack-openblas.pc	2014-10-08 12:42:40.849185631 +0100
@@ -0,0 +1,10 @@
+    prefix=/usr
+    libdir=${prefix}/lib/openblas-base
+    includedir=${prefix}/include/openblas
+    Name: lapack-openblas
+    Description:  Optimized BLAS (linear algebra) library, LAPACK
+    Version: 0.2.11
+    URL: https://github.com/xianyi/OpenBLAS
+    Libs: -L${libdir} -llapack
+    Libs.private: -L${libdir} -llapack -lm
+    Cflags: -I${includedir}
diff -urN debian.orig/libopenblas-dev.install debian/libopenblas-dev.install
--- debian.orig/libopenblas-dev.install	2014-07-29 20:05:20.000000000 +0100
+++ debian/libopenblas-dev.install	2014-10-08 14:37:29.657787545 +0100
@@ -1,3 +1,4 @@
 usr/lib/libopenblas*.a
 usr/lib/libopenblas.so
 usr/include/*   /usr/include/openblas/
+debian/*.pc     /usr/lib/pkgconfig
diff -urN debian.orig/libopenblas-dev.postinst debian/libopenblas-dev.postinst
--- debian.orig/libopenblas-dev.postinst	2014-08-05 14:56:13.000000000 +0100
+++ debian/libopenblas-dev.postinst	2014-10-08 14:35:15.942669963 +0100
@@ -5,12 +5,16 @@
 update-alternatives --install /usr/lib/libblas.so libblas.so \
 	/usr/lib/openblas-base/libblas.so 40 \
     --slave /usr/lib/libblas.a libblas.a \
-    /usr/lib/openblas-base/libblas.a
+    /usr/lib/openblas-base/libblas.a \
+    --slave /usr/lib/pkgconfig/blas.pc blas.pc \
+    /usr/lib/pkgconfig/blas-openblas.pc
 
 update-alternatives --install /usr/lib/liblapack.so liblapack.so \
 	/usr/lib/openblas-base/liblapack.so 40 \
     --slave /usr/lib/liblapack.a liblapack.a \
-    /usr/lib/openblas-base/liblapack.a
+    /usr/lib/openblas-base/liblapack.a \
+    --slave /usr/lib/pkgconfig/lapack.pc lapack.pc \
+    /usr/lib/pkgconfig/lapack-openblas.pc
 
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
-- 
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to