Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Blumentrath committed Sep 24, 2021
1 parent 355aa0e commit 3e8c9a8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
8 changes: 1 addition & 7 deletions src/grass-dev/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export BUILDDEPENDS="gdal-devel pdal-devel proj-devel geos-devel netcdf-devel li
branch=main

if [ "$CI" ] ; then
cd "$OSGEO4W_REP"
cd "$PACKAGE_SRC"
fi

source ../../../scripts/build-helpers
Expand Down Expand Up @@ -81,12 +81,6 @@ msysarch=msys2-base-x86_64-20210604.tar.xz

cd ../$P-$V

if [ "$CI" ] ; then
P=$(cygpath -ua "C:/Program Files (x86)\Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/")
sed -i "3 a export PATH=\"$P:$PATH\"" mswindows/osgeo4w/mklibs.sh
sed -i "s/dumpbin -exports/dumpbin \/EXPORTS/" mswindows/osgeo4w/mklibs.sh
fi

cmd.exe /c "$(cygpath -aw $OSGEO4W_PWD/msys64/usr/bin/bash) $xtrace mswindows/osgeo4w/package.sh"
)

Expand Down
35 changes: 24 additions & 11 deletions src/grass-dev/osgeo4w/patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ index 157d622b3..6f3441b70 100644
set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

diff --git a/mswindows/osgeo4w/mklibs.sh b/mswindows/osgeo4w/mklibs.sh
index 00a597afa..b7aaa57ee 100755
index 00a597afa..dafc2e0fe 100755
--- a/mswindows/osgeo4w/mklibs.sh
+++ b/mswindows/osgeo4w/mklibs.sh
@@ -1,31 +1,14 @@
@@ -1,31 +1,24 @@
#!/bin/sh

set -e
Expand All @@ -50,14 +50,17 @@ index 00a597afa..b7aaa57ee 100755
-if [ -z "$OSGEO4W_POSTFIX" ]; then
- OSGEO4W_POSTFIX=""
-fi
+[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc

-
-if [ "$OSGEO4W_POSTFIX" != "64" ]; then
- MACHINE=x86
-else
+if [ "$CI" ] ; then
+ DUMPBIN_PATH=$(cygpath -ua "C:/Program Files (x86)\Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/")
+ export PATH="${DUMPBIN_PATH}:$PATH"
+ # dumpbin in GH actions does not support options starting with "-"
+ DUMPBIN_EXPORT="/EXPORTS"
else
- MACHINE=x64
+if [ -n "$VCPATH" ]; then
+ PATH=$PATH:$VCPATH
+ DUMPBIN_EXPORT="-exports"
fi

-PROGRAMFILES="/c/Program Files (x86)"
Expand All @@ -71,13 +74,23 @@ index 00a597afa..b7aaa57ee 100755
-PATH="$VSDIR/Common7/Tools:$PATH"
-PATH="$PATH:/c/OSGeo4W${OSGEO4W_POSTFIX}/bin"
-export PATH
-
-[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc
-

[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc

+if [ -n "$VCPATH" ]; then
+ PATH=$PATH:$VCPATH
+fi
+
for dllfile in "$@"; do
dlldir=${dllfile%/*}
dllfile=${dllfile##*/}
@@ -43,6 +26,7 @@ for dllfile in "$@"; do
@@ -38,11 +31,12 @@ for dllfile in "$@"; do

echo "$dllfile => $dllname"

- (cd $dlldir; dumpbin -exports $dllfile) |
+ (cd $dlldir; dumpbin "$DUMPBIN_EXPORT" $dllfile) |
sed -nf mswindows/osgeo4w/mklibs.sed |
egrep -v "^[ ]*(_+IMPORT_DESCRIPTOR_.*|_+NULL_IMPORT_DESCRIPTOR)$" >mswindows/osgeo4w/vc/${defname%$VERSION}

(cd mswindows/osgeo4w/vc ;
Expand Down

0 comments on commit 3e8c9a8

Please sign in to comment.