diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 16 | ||||
-rw-r--r-- | paths.patch | 62 |
3 files changed, 77 insertions, 9 deletions
@@ -1,7 +1,9 @@ +# Generated by mksrcinfo v8 +# Mon Apr 25 19:33:13 UTC 2016 pkgbase = ffc-git pkgdesc = A compiler for finite element variational forms. - pkgver = 20150925 - pkgrel = 2 + pkgver = 20160405 + pkgrel = 1 url = https://bitbucket.org/fenics-project/ffc arch = i686 arch = x86_64 @@ -21,7 +23,9 @@ pkgbase = ffc-git conflicts = ffc options = !emptydirs source = ffc::git+https://bitbucket.org/fenics-project/ffc.git#branch=master + source = paths.patch md5sums = SKIP + md5sums = d008f41c6a03f0dd40a36d648d171dd2 pkgname = ffc-git @@ -1,7 +1,7 @@ # Maintainer: Myles English <myles at rockhead dot biz> pkgname=ffc-git -pkgver=20150925 -pkgrel=2 +pkgver=20160405 +pkgrel=1 pkgdesc="A compiler for finite element variational forms." _branch=master arch=('i686' 'x86_64') @@ -14,8 +14,10 @@ makedepends=('git' 'python2' 'sed') provides=('ffc') conflicts=('ffc') options=(!emptydirs) -source=("ffc::git+https://bitbucket.org/fenics-project/ffc.git#branch=${_branch}") -md5sums=('SKIP') +source=("ffc::git+https://bitbucket.org/fenics-project/ffc.git#branch=${_branch}" + "paths.patch") +md5sums=('SKIP' + 'd008f41c6a03f0dd40a36d648d171dd2') pkgver() { cd ffc @@ -24,8 +26,9 @@ pkgver() { prepare() { cd ffc + patch -p1 < ../paths.patch find ./ -name "*" -type f -exec \ - sed -i 's|^#!.*python$|#!/usr/bin/python2|' {} \; + sed -i 's|^#!.*python$|#!/usr/bin/python2|' {} \; } build() { @@ -36,8 +39,7 @@ build() { package() { cd ffc python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 - - # surely the setup.py should handle this? sed -i 's#'"${pkgdir}"'#/usr#g' "${pkgdir}/usr/lib/pkgconfig/ufc-1.pc" + sed -i 's#'"${pkgdir}"'#/usr#g' "${pkgdir}/usr/lib/python2.7/site-packages/ffc/ufc_include.py" sed -i 's#'"${pkgdir}"'#/usr#g' "${pkgdir}/usr/share/ufc/UFCConfig.cmake" } diff --git a/paths.patch b/paths.patch new file mode 100644 index 000000000000..a30f07bb5913 --- /dev/null +++ b/paths.patch @@ -0,0 +1,62 @@ +diff --git a/setup.py b/setup.py +index c92dcae..7e08857 100755 +--- a/setup.py ++++ b/setup.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python2 + + import os, sys, platform, re, subprocess, string, tempfile, shutil, hashlib + +@@ -47,15 +47,21 @@ Topic :: Software Development :: Libraries + def get_installation_prefix(): + "Get installation prefix" + prefix = sys.prefix ++ print("prefix is {}".format(prefix)) + for arg in sys.argv[1:]: + if "--user" in arg: ++ print("1111 prefix is {}".format(prefix)) + import site + prefix = site.USER_BASE + elif arg in ("--prefix", "--home", "--root", "--install-base"): ++ print("2222 prefix is {}".format(prefix)) + prefix = sys.argv[sys.argv.index(arg)+1] + elif "--prefix=" in arg or "--home=" in arg or \ + "--root=" in arg or "--install-base=" in arg: ++ print("3333 prefix is {} arg is {}".format(prefix,arg)) + prefix = arg.split("=")[1] ++ print("get_installation_prefix: prefix is {} path is {}".format(prefix,os.path.abspath(os.path.expanduser(prefix)))) ++ #raise Exception + return os.path.abspath(os.path.expanduser(prefix)) + + +@@ -292,7 +298,7 @@ def run_install(): + # Generate ufc_include.py + write_config_file(os.path.join("ffc", "ufc_include.py.in"), + os.path.join("ffc", "ufc_include.py"), +- variables=dict(INSTALL_PREFIX=get_installation_prefix())) ++ variables=dict(INSTALL_PREFIX='/usr')) + + # distutils uses old-style classes, so no super() + install.run(self) +@@ -305,17 +311,17 @@ def run_install(): + # installs into the Python package directory, not --prefix). This + # can be fixed when Swig, etc are removed from FFC). + INSTALL_PREFIX = get_installation_prefix() +- data_files_ufc = [(os.path.join(INSTALL_PREFIX, "include"), ++ data_files_ufc = [(os.path.join("include"), + [os.path.join("ufc", "ufc.h"), + os.path.join("ufc", "ufc_geometry.h")]), +- (os.path.join(INSTALL_PREFIX, "share", "ufc"), ++ (os.path.join("share", "ufc"), + [os.path.join("cmake", "templates", \ + "UFCConfig.cmake"), + os.path.join("cmake", "templates", \ + "UFCConfigVersion.cmake"), + os.path.join("cmake", "templates", \ + "UseUFC.cmake")]), +- (os.path.join(INSTALL_PREFIX, "lib", "pkgconfig"), ++ (os.path.join("lib", "pkgconfig"), + [os.path.join("cmake", "templates", "ufc-1.pc")])] + + data_files = data_files + data_files_ufc |