summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorczk2015-10-09 23:04:53 +0200
committerczk2015-10-09 23:04:53 +0200
commit3633263819c9c7d2c8f00488af8e9186d84f7068 (patch)
treeb5797eb5724039d5f426bcb698a5711b771fad67
parentb30ac6ac2e9f57ee75232aa72bca04dc17cec337 (diff)
downloadaur-3633263819c9c7d2c8f00488af8e9186d84f7068.tar.gz
Cosmetics, a minor typo corrected, Python issues explained better.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD49
2 files changed, 35 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6c3f9655acfe..67d24a46d92e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = grass6
pkgdesc = GRASS GIS 6.4.5: geospatial data management and analysis, image processing, graphics/maps production, spatial modeling and visualization.
pkgver = 6.4.5
- pkgrel = 1
+ pkgrel = 2
url = https://grass.osgeo.org
arch = i686
arch = x86_64
diff --git a/PKGBUILD b/PKGBUILD
index 6d54a044685a..ea3d2ed59807 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname='grass6'
pkgver='6.4.5'
-pkgrel='1'
+pkgrel='2'
pkgdesc="GRASS GIS ${pkgver}: geospatial data management and analysis, image \
processing, graphics/maps production, spatial modeling and visualization."
arch=('i686' 'x86_64')
@@ -29,21 +29,23 @@ optdepends=('r: R language interface; see http://grasswiki.osgeo.org/wiki/R_stat
source=("https://grass.osgeo.org/grass64/source/grass-${pkgver}.tar.gz")
md5sums=('c58ab8db635ebd06cfd93dce7b70b6cb')
-
prepare() {
cd "${srcdir}/grass-${pkgver}"
msg 'Patching source...'
- # Link python2 as python in the source directory, for build time:
+ # Link python2 as python in the source directory, for build time.
+ # "make PYTHON=`which python2`" should normally suffice, but it doesn't for
+ # lib/python/ctypes.
ln -sf "`which python2`" "${srcdir}/grass-${pkgver}/python"
- # INSTDIR is partly hardcoded in `configure'. Let's fix it, so that INST_DIR, which is derived from it, is set as needed.
- # Debian packagers are doing a similar thing (see eg. https://anonscm.debian.org/cgit/pkg-grass/grass.git/tree/debian/patches/instdir).
+ # INSTDIR is partly hardcoded in `configure'. Let's fix it, so that INST_DIR,
+ # which is derived from it, is set as needed. Debian packagers are doing a
+ # similar thing (see eg. https://anonscm.debian.org/cgit/pkg-grass/grass.git/tree/debian/patches/instdir).
sed -i "s,INSTDIR='\${prefix}'\"/grass-\${GRASS_VERSION_MAJOR}\.\${GRASS_VERSION_MINOR}\.\${GRASS_VERSION_RELEASE}\",INSTDIR='\${prefix}/${pkgname}'," configure
# Custom desktop file:
- sed -i -e "s,^Name=GRASS GIS 6\$,Name=GRASS GIS ${pgkver}," \
+ sed -i -e "s,^Name=GRASS GIS 6\$,Name=GRASS GIS ${pkgver}," \
-e "s,^Exec=grass64\$,Exec=${pkgname}," \
-e "s,^Icon=grass\$,Icon=/usr/share/icons/${pkgname}-64x64.png," \
"${srcdir}/grass-${pkgver}/gui/icons/grass.desktop"
@@ -56,6 +58,8 @@ build() {
# Tweak PATH for build time so that it advertised a python2->python link as
# python. No patching to deal with the python/python2/3 issue needed.
+ # "make PYTHON=`which python2`" should normally suffice, but it doesn't for
+ # lib/python/ctypes.
PATH="${srcdir}/grass-${pkgver}:$PATH"
export PATH
@@ -63,7 +67,9 @@ build() {
# usefull ones, only DWG, MySQL, FFMPEG and Motif are left disabled. LAPACK
# and BLAS are not used for anything in GRASS anyway.
- # GRASS build dystem can't cope with current Arch's /etc/makepkg.conf default CPPFLAGS="-D_FORTIFY_SOURCE=2".
+ # GRASS build dystem can't cope with current Arch's /etc/makepkg.conf default
+ # CPPFLAGS="-D_FORTIFY_SOURCE=2".
+ #
# At configure it throws:
#
# checking for curses.h... no
@@ -77,7 +83,8 @@ build() {
# # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
# ^
#
- # I don't have a better idea than removing any -D_FORTIFY_SOURCE occurences from CPPFLAGS.
+ # I don't have a better idea than removing any -D_FORTIFY_SOURCE occurences
+ # from CPPFLAGS.
CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_FORTIFY_SOURCE=.//g'` CFLAGS="$CFLAGS -Wall" CXXFLAGS="$CXXFLAGS -Wall" ./configure \
--prefix=/opt \
@@ -108,17 +115,17 @@ build() {
# CFLAGS="-O0 -ggdb -Wall -Werror-implicit-function-declaration -fexceptions"
# CXXFLAGS="-O0 -ggdb -Wall -Werror-implicit-function-declaration -fexceptions"
# options=(!strip)
- # Not sure if -Werror-implicit-function-declaration -fexceptions should really go to CXXFLAGS.
- # Let me know if you know.
+ #
+ # Not sure if -Werror-implicit-function-declaration -fexceptions should really
+ # go to CXXFLAGS. Let me know if you know.
msg 'Building...'
- make
+ make PYTHON="`which python2`"
}
package() {
cd "${srcdir}/grass-${pkgver}"
- echo pkgdir: $pkgdir
# Install GRASS in $pkgir of makepkg's fakeroot env:
make prefix="${pkgdir}/opt" exec_prefix="${pkgdir}/opt/${pkgname}" install
@@ -133,13 +140,25 @@ package() {
"${pkgdir}/opt/${pkgname}/bin/grass64"
# Link GRASS exec script and gem binary in /usr/bin under a custom name.
- # This allows e.g. grass64 and grass64-svn be co-installed:
+ # This allows e.g. grass6 and grass6-svn be co-installed:
mkdir -p "${pkgdir}/usr/bin"
ln -sf "/opt/${pkgname}/bin/grass64" "${pkgdir}/usr/bin/${pkgname}"
ln -sf "/opt/${pkgname}/bin/gem64" "${pkgdir}/usr/bin/gem6"
- # Instead of patching GRASS Python scripts to use `python2' and messing with
- # GRASS_PYTHON, link to a correct interpreter from $GISBASE.
+ # https://grasswiki.osgeo.org/wiki/GRASS_and_Python#Using_a_version_of_Python_different_from_the_default_installation:
+ # - "On Unix, GRASS_PYTHON is only used for components which use wxPython"
+ # - "Scripts rely upon the "#!/usr/bin/env python" line"
+ # - "You can control the interpreter used by scripts by creating a directory
+ # containing a symlink named "python" (...) and placing that directory at the
+ # front of $PATH."
+ #
+ # GRASS_PYTHON is `python' by default.
+ #
+ # So let's link to a correct interpreter from $GISBASE/bin, which is normally
+ # already in PATH in a GRASS session. That's better than patching GRASS Python
+ # scripts to use `python2' and tweaking the GRASS_PYTHON var; Python add-ons
+ # will be happy too.
+
ln -sf "`which python2`" "${pkgdir}/opt/${pkgname}/bin/python"
# Install dynamic linker run-time bindings conf for GRASS libs.