File: windows

package info (click to toggle)
libgpg-error 1.59-4
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 6,744 kB
  • sloc: ansic: 29,735; sh: 5,638; makefile: 493; awk: 333; lisp: 138; sed: 53
file content (62 lines) | stat: -rwxr-xr-x 1,611 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash

set -e

ARCH="$1"

MULTIARCHPATH=/usr/lib/$(dpkg-architecture  -q DEB_BUILD_MULTIARCH)

if test -f ${MULTIARCHPATH}/wine/wine ; then
    # wine >= 10
    WINE=${MULTIARCHPATH}/wine/wine
    export WINESERVER=${MULTIARCHPATH}/wine/wineserver
else
    if [ "$ARCH" = x86_64 ]; then
        WINE=/usr/lib/wine/wine64
        export WINESERVER=/usr/lib/wine/wineserver64
    elif [ "$ARCH" = i686 ]; then
        WINE=/usr/lib/wine/wine
        export WINESERVER=/usr/lib/wine/wineserver32
    fi
fi

case $ARCH in
    x86_64)
    ;;
    i686)
    ;;
    *)
    printf >&2 'Unknown Architecture: %s\n' "$ARCH"
    exit 1
    ;;
esac

GCC="${ARCH}-w64-mingw32-gcc"

WIN_GPG_ERROR=/usr/"${ARCH}"-w64-mingw32/bin/gpg-error.exe

# get wine initialized, which normally spews logs to stderr
# (autopkgtest doesn't want stderr)
"$WINE" hostname 2>&1

# just make sure that gpg-error.exe works

"$WINE" "$WIN_GPG_ERROR" --version

# just compare the first 200 error messages (not all of them, because
# some errors have no available strings on windows):
for x in $(seq 0 200); do
    diff -u <(gpg-error $x) \
         <("$WINE" "$WIN_GPG_ERROR" $x | sed 's/\r$//' )
done

export PKG_CONFIG_PATH="/usr/${ARCH}-w64-mingw32/lib/pkgconfig"

# see https://dev.gnupg.org/T4623 for why extra_libs is necessary as
# of gpg-error 1.36:
extra_libs=(-lws2_32)

# build a static windows binary around libgpg-error and run it:
"$GCC" -pedantic -Wall -Werror -static -o test-run.exe debian/tests/simple-build.c $(pkg-config --cflags --static --libs gpg-error) "${extra_libs[@]}"
"$WINE" ./test-run.exe
rm -f ./test-run.exe