aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-05-03 19:17:03 +1000
committerfuzzard <fuzzard@kodi.tv>2022-05-06 11:32:39 +1000
commitad2d2e8fe1e66ff118bb284e1dbe13fa9944b67b (patch)
treee97460ae89cafc178b890573daad2903dc6fcd88
parent23f6ad9a069123438ceff7d096e5a524528b877b (diff)
[tools/depends][target] zlib build using cmake
-rw-r--r--tools/depends/target/zlib/01-all-disable_tests.patch16
-rw-r--r--tools/depends/target/zlib/02-all-static_only.patch11
-rw-r--r--tools/depends/target/zlib/Makefile34
-rw-r--r--tools/depends/target/zlib/ZLIB-VERSION5
-rw-r--r--tools/depends/target/zlib/remove_fixe_ar_osx.patch16
-rw-r--r--tools/depends/target/zlib/visibility.patch15
6 files changed, 46 insertions, 51 deletions
diff --git a/tools/depends/target/zlib/01-all-disable_tests.patch b/tools/depends/target/zlib/01-all-disable_tests.patch
new file mode 100644
index 0000000000..55de6a471d
--- /dev/null
+++ b/tools/depends/target/zlib/01-all-disable_tests.patch
@@ -0,0 +1,16 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -229,7 +229,7 @@
+ #============================================================================
+ # Example binaries
+ #============================================================================
+-
++if(ENABLE_TESTS)
+ add_executable(example test/example.c)
+ target_link_libraries(example zlib)
+ add_test(example example)
+@@ -247,3 +247,4 @@
+ target_link_libraries(minigzip64 zlib)
+ set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
+ endif()
++endif()
diff --git a/tools/depends/target/zlib/02-all-static_only.patch b/tools/depends/target/zlib/02-all-static_only.patch
new file mode 100644
index 0000000000..baef9bbb20
--- /dev/null
+++ b/tools/depends/target/zlib/02-all-static_only.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -211,7 +211,7 @@
+ endif()
+
+ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
+- install(TARGETS zlib zlibstatic
++ install(TARGETS zlibstatic
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
diff --git a/tools/depends/target/zlib/Makefile b/tools/depends/target/zlib/Makefile
index 9e0b5e7bb5..b7f6d41e6e 100644
--- a/tools/depends/target/zlib/Makefile
+++ b/tools/depends/target/zlib/Makefile
@@ -1,38 +1,32 @@
-include ../../Makefile.include
-DEPS = ../../Makefile.include Makefile visibility.patch remove_fixe_ar_osx.patch ../../download-files.include
-
-# lib name, version
-LIBNAME=zlib
-VERSION=1.2.11
-SOURCE=$(LIBNAME)-$(VERSION)
-ARCHIVE=$(SOURCE).tar.gz
-SHA512=73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae
-include ../../download-files.include
+include ../../Makefile.include ZLIB-VERSION ../../download-files.include
+DEPS = ../../Makefile.include Makefile ZLIB-VERSION ../../download-files.include \
+ 01-all-disable_tests.patch \
+ 02-all-static_only.patch
# configuration settings
-CONFIGURE= RANLIB="$(RANLIB)" LD="$(LD)" AR="$(AR)" CC="$(CC)" CFLAGS="$(CFLAGS)" ./configure --prefix=$(PREFIX) --static
+CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
+ -DINSTALL_PKGCONFIG_DIR=$(PREFIX)/lib/pkgconfig
-LIBDYLIB=$(PLATFORM)/$(LIBNAME).a
+LIBDYLIB=$(PLATFORM)/build/$(BYPRODUCT)
all: .installed-$(PLATFORM)
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) $(DEPS)
- rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
+ rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- cd $(PLATFORM); patch -p1 -i ../visibility.patch
- cd $(PLATFORM); patch -p1 -i ../remove_fixe_ar_osx.patch
- cd $(PLATFORM); $(CONFIGURE)
+ cd $(PLATFORM); patch -p1 -i ../01-all-disable_tests.patch
+ cd $(PLATFORM); patch -p1 -i ../02-all-static_only.patch
+ cd $(PLATFORM)/build; $(CMAKE) $(CMAKE_OPTIONS) ..
$(LIBDYLIB): $(PLATFORM)
- $(MAKE) -C $(PLATFORM)
+ $(MAKE) -C $(PLATFORM)/build
.installed-$(PLATFORM): $(LIBDYLIB)
- $(MAKE) -C $(PLATFORM) install
- touch $(LIBDYLIB)
+ $(MAKE) -C $(PLATFORM)/build install
touch $@
clean:
- $(MAKE) -C $(PLATFORM) clean
+ $(MAKE) -C $(PLATFORM)/build clean
rm -f .installed-$(PLATFORM)
distclean::
diff --git a/tools/depends/target/zlib/ZLIB-VERSION b/tools/depends/target/zlib/ZLIB-VERSION
new file mode 100644
index 0000000000..c609cbe9bb
--- /dev/null
+++ b/tools/depends/target/zlib/ZLIB-VERSION
@@ -0,0 +1,5 @@
+LIBNAME=zlib
+VERSION=1.2.12
+ARCHIVE=$(LIBNAME)-$(VERSION).tar.xz
+SHA512=12940e81e988f7661da52fa20bdc333314ae86a621fdb748804a20840b065a1d6d984430f2d41f3a057de0effc6ff9bcf42f9ee9510b88219085f59cbbd082bd
+BYPRODUCT=libz.a
diff --git a/tools/depends/target/zlib/remove_fixe_ar_osx.patch b/tools/depends/target/zlib/remove_fixe_ar_osx.patch
deleted file mode 100644
index 1eaabff3ba..0000000000
--- a/tools/depends/target/zlib/remove_fixe_ar_osx.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -241,12 +241,7 @@
- SHAREDLIBV=libz.$VER$shared_ext
- SHAREDLIBM=libz.$VER1$shared_ext
- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
-- if libtool -V 2>&1 | grep Apple > /dev/null; then
-- AR="libtool"
-- else
-- AR="/usr/bin/libtool"
-- fi
-- ARFLAGS="-o" ;;
-+ ;;
- *) LDSHARED=${LDSHARED-"$cc -shared"} ;;
- esac
- else
diff --git a/tools/depends/target/zlib/visibility.patch b/tools/depends/target/zlib/visibility.patch
deleted file mode 100644
index 3257f7fedb..0000000000
--- a/tools/depends/target/zlib/visibility.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/zconf.h.in
-+++ b/zconf.h.in
-@@ -374,7 +374,11 @@
- #endif
-
- #ifndef ZEXTERN
--# define ZEXTERN extern
-+# ifdef HAVE_HIDDEN
-+# define ZEXTERN extern __attribute__((visibility ("default")))
-+# else
-+# define ZEXTERN extern
-+# endif
- #endif
- #ifndef ZEXPORT
- # define ZEXPORT