File: build-win64

package info (click to toggle)
libcaca 0.99.beta19-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,312 kB
  • sloc: ansic: 22,346; python: 2,316; cs: 1,213; cpp: 1,114; java: 916; objc: 836; makefile: 606; sh: 457; ruby: 193; asm: 65
file content (53 lines) | stat: -rwxr-xr-x 1,617 bytes parent folder | download | duplicates (3)
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
#! /bin/sh

##  Win32 cross-compilation for libcaca -- Sam Hocevar <sam@hocevar.net>

set -x
set -e

# Clean up our working directory
SRCDIR="`pwd`"
DIRNAME="libcaca-win64-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
INSTALLDIR="`pwd`/${DIRNAME}"
BUILDDIR="${INSTALLDIR}/build"
rm -Rf "${INSTALLDIR}"
rm -f "${INSTALLDIR}.zip"
mkdir "${INSTALLDIR}"
mkdir "${BUILDDIR}"

make distclean || true

cd "${BUILDDIR}"
# Build for win64
"${SRCDIR}/configure" --host=x86_64-w64-mingw32 --build=none --prefix=/ --bindir=/bin --libdir=/lib --disable-imlib2 --disable-java --disable-doc "$@"
make -j4 pkglibdir=/lib pkgdatadir=/data bindir=/bin
# Install into our private directory
make -j4 install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
cd "${SRCDIR}"
rm -Rf "${BUILDDIR}"

mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
rmdir "${INSTALLDIR}/bin"
mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
for f in caca caca++; do
   mv "${INSTALLDIR}/lib${f}.a" "${INSTALLDIR}/lib/${f}.lib"
done
rm -f "${INSTALLDIR}/caca-config.exe" # Just in case. *sigh*.
x86_64-w64-mingw32-strip "${INSTALLDIR}/"*.exe || true
x86_64-w64-mingw32-strip "${INSTALLDIR}/"*.dll || true

mkdir "${INSTALLDIR}/doc"
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
   sed -e 's/$/
/' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
done
rm -Rf "${INSTALLDIR}/share"
rm -Rf "${INSTALLDIR}/man"
rm -Rf "${INSTALLDIR}/pkgconfig"
rm -f "${INSTALLDIR}/caca-config"
rm -f "${INSTALLDIR}/"*.a
rm -f "${INSTALLDIR}/"*.la

# Pack the directory
zip "${DIRNAME}.zip" `find "${DIRNAME}"`
rm -Rf "${INSTALLDIR}"