summaryrefslogtreecommitdiff
path: root/packaging/nacl/ports/zlib
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-13 21:50:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-13 21:50:07 +0300
commiteefb212caca31d46f1d36ce272d4bc6842c039f0 (patch)
treea7736bff39c0920e0522ce00813602bde4710c22 /packaging/nacl/ports/zlib
parent9406e61b5ee96e25b10fbf915725f69d6f6ceeb8 (diff)
downloadplus-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.gz
plus-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.bz2
plus-eefb212caca31d46f1d36ce272d4bc6842c039f0.tar.xz
plus-eefb212caca31d46f1d36ce272d4bc6842c039f0.zip
Add chrome ports patches for build manaplus on nacl.
Diffstat (limited to 'packaging/nacl/ports/zlib')
-rw-r--r--packaging/nacl/ports/zlib/build.sh76
-rw-r--r--packaging/nacl/ports/zlib/nacl.patch17
-rw-r--r--packaging/nacl/ports/zlib/pkg_info5
3 files changed, 98 insertions, 0 deletions
diff --git a/packaging/nacl/ports/zlib/build.sh b/packaging/nacl/ports/zlib/build.sh
new file mode 100644
index 000000000..96c860fd0
--- /dev/null
+++ b/packaging/nacl/ports/zlib/build.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# zlib doesn't support custom build directories so we have
+# to build directly in the source dir.
+BUILD_DIR=${SRC_DIR}
+EXECUTABLES="minigzip${NACL_EXEEXT} example${NACL_EXEEXT}"
+if [ "${NACL_SHARED}" = "1" ]; then
+ EXECUTABLES+=" libz.so.1"
+fi
+
+ConfigureStep() {
+ LogExecute rm -f libz.*
+ SetupCrossEnvironment
+ CHOST=${NACL_CROSS_PREFIX} LogExecute ./configure --prefix=${PREFIX}
+}
+
+
+RunMinigzip() {
+# export LD_LIBRARY_PATH=.
+# if echo "hello world" | ./minigzip | ./minigzip -d; then
+# echo ' *** minigzip test OK ***'
+# else
+# echo ' *** minigzip test FAILED ***'
+# exit 1
+# fi
+# unset LD_LIBRARY_PATH
+ return 0
+}
+
+
+RunExample() {
+ export LD_LIBRARY_PATH=.
+ # This second test does not yet work on nacl (gzopen fails)
+ #if ./example; then \
+ #echo ' *** zlib test OK ***'; \
+ #else \
+ #echo ' *** zlib test FAILED ***'; \
+ #exit 1
+ #fi
+ unset LD_LIBRARY_PATH
+}
+
+
+TestStep() {
+ if [ "${NACL_LIBC}" = "glibc" ]; then
+ # Tests do not currently run on GLIBC due to fdopen() not working
+ # TODO(sbc): Remove this once glibc is fixed:
+ # https://code.google.com/p/nativeclient/issues/detail?id=3362
+ return
+ fi
+
+ if [ "${NACL_ARCH}" = "pnacl" ]; then
+ local minigzip_pexe="minigzip${NACL_EXEEXT}"
+ local example_pexe="example${NACL_EXEEXT}"
+ local minigzip_script="minigzip"
+ local example_script="example"
+ TranslateAndWriteSelLdrScript ${minigzip_pexe} x86-32 \
+ minigzip.x86-32.nexe ${minigzip_script}
+ RunMinigzip
+ TranslateAndWriteSelLdrScript ${minigzip_pexe} x86-64 \
+ minigzip.x86-64.nexe ${minigzip_script}
+ RunMinigzip
+ TranslateAndWriteSelLdrScript ${example_pexe} x86-32 \
+ example.x86-32.nexe ${example_script}
+ RunExample
+ TranslateAndWriteSelLdrScript ${example_pexe} x86-64 \
+ example.x86-64.nexe ${example_script}
+ RunExample
+ else
+ RunMinigzip
+ RunExample
+ fi
+}
diff --git a/packaging/nacl/ports/zlib/nacl.patch b/packaging/nacl/ports/zlib/nacl.patch
new file mode 100644
index 000000000..176552330
--- /dev/null
+++ b/packaging/nacl/ports/zlib/nacl.patch
@@ -0,0 +1,17 @@
+diff --git a/configure b/configure
+index b77a8a8..e52609f 100755
+--- a/configure
++++ b/configure
+@@ -188,6 +188,12 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
+ *BSD | *bsd* | DragonFly)
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
+ LDCONFIG="ldconfig -m" ;;
++ pnacl)
++ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
++ EXE='.pexe' ;;
++ nacl)
++ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
++ EXE='.nexe' ;;
+ CYGWIN* | Cygwin* | cygwin* | OS/2*)
+ EXE='.exe' ;;
+ MINGW* | mingw*)
diff --git a/packaging/nacl/ports/zlib/pkg_info b/packaging/nacl/ports/zlib/pkg_info
new file mode 100644
index 000000000..22f1701e5
--- /dev/null
+++ b/packaging/nacl/ports/zlib/pkg_info
@@ -0,0 +1,5 @@
+NAME=zlib
+VERSION=1.2.8
+URL=http://www.zlib.net/zlib-1.2.8.tar.gz
+LICENSE=CUSTOM:README
+SHA1=a4d316c404ff54ca545ea71a27af7dbc29817088