summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO13
-rw-r--r--0001-cmake-static-libs.patch87
-rw-r--r--0002-cmake-no-exe.patch23
-rw-r--r--PKGBUILD50
4 files changed, 148 insertions, 25 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6e3374381d14..2c49a38ef26c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,23 @@
-pkgbase = mingw-w64-brotli
+pkgbase = mingw-w64-brotli-static
pkgdesc = Brotli compression library (mingw-w64)
pkgver = 1.0.9
- pkgrel = 3
+ pkgrel = 1
url = https://github.com/google/brotli
arch = any
license = MIT
makedepends = mingw-w64-cmake
makedepends = git
depends = mingw-w64-gcc
+ provides = mingw-w64-brotli=1.0.9
+ conflicts = mingw-w64-brotli
options = !buildflags
options = !strip
options = staticlibs
source = brotli::git+https://github.com/google/brotli#commit=e61745a6b7add50d380cfd7d3883dd6c62fc2c71
+ source = 0001-cmake-static-libs.patch
+ source = 0002-cmake-no-exe.patch
sha512sums = SKIP
+ sha512sums = 23d807f6563fc33720af074cc0996e332da9ee7aa7b45c958ec94e75da34b1947bff0ec05b8db8613d413e344f00b694c983d6a0578dc11dc722cb2feda7d2df
+ sha512sums = 8b340ec3a6fc3e88e8a338cc3f2358f100e22ceda70207d511660fd5e7a68fe9502e3a15bfa6ed6197281f7f8d830c5737159f1323a2660a0536c6085f60ea59
-pkgname = mingw-w64-brotli
-
+pkgname = mingw-w64-brotli-static
diff --git a/0001-cmake-static-libs.patch b/0001-cmake-static-libs.patch
new file mode 100644
index 000000000000..6fb918e6649e
--- /dev/null
+++ b/0001-cmake-static-libs.patch
@@ -0,0 +1,87 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4ff3401..a2420f1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -137,10 +137,6 @@ set(BROTLI_LIBRARIES_CORE brotlienc brotlidec brotlicommon)
+ set(BROTLI_LIBRARIES ${BROTLI_LIBRARIES_CORE} ${LIBM_LIBRARY})
+ mark_as_advanced(BROTLI_LIBRARIES)
+
+-set(BROTLI_LIBRARIES_CORE_STATIC brotlienc-static brotlidec-static brotlicommon-static)
+-set(BROTLI_LIBRARIES_STATIC ${BROTLI_LIBRARIES_CORE_STATIC} ${LIBM_LIBRARY})
+-mark_as_advanced(BROTLI_LIBRARIES_STATIC)
+-
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ add_definitions(-DOS_LINUX)
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+@@ -160,30 +156,14 @@ endfunction()
+ transform_sources_list("scripts/sources.lst" "${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake")
+ include("${CMAKE_CURRENT_BINARY_DIR}/sources.lst.cmake")
+
+-if(BROTLI_EMSCRIPTEN)
+- set(BROTLI_SHARED_LIBS "")
+-else()
+- set(BROTLI_SHARED_LIBS brotlicommon brotlidec brotlienc)
+- add_library(brotlicommon SHARED ${BROTLI_COMMON_C})
+- add_library(brotlidec SHARED ${BROTLI_DEC_C})
+- add_library(brotlienc SHARED ${BROTLI_ENC_C})
+-endif()
+-
+-set(BROTLI_STATIC_LIBS brotlicommon-static brotlidec-static brotlienc-static)
+-add_library(brotlicommon-static STATIC ${BROTLI_COMMON_C})
+-add_library(brotlidec-static STATIC ${BROTLI_DEC_C})
+-add_library(brotlienc-static STATIC ${BROTLI_ENC_C})
++add_library(brotlicommon STATIC ${BROTLI_COMMON_C})
++add_library(brotlidec STATIC ${BROTLI_DEC_C})
++add_library(brotlienc STATIC ${BROTLI_ENC_C})
+
+ # Older CMake versions does not understand INCLUDE_DIRECTORIES property.
+ include_directories(${BROTLI_INCLUDE_DIRS})
+
+-foreach(lib IN LISTS BROTLI_SHARED_LIBS)
+- target_compile_definitions(${lib} PUBLIC "BROTLI_SHARED_COMPILATION" )
+- string(TOUPPER "${lib}" LIB)
+- set_target_properties (${lib} PROPERTIES DEFINE_SYMBOL "${LIB}_SHARED_COMPILATION")
+-endforeach()
+-
+-foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
++foreach(lib IN LISTS BROTLI_LIBRARIES_CORE)
+ target_link_libraries(${lib} ${LIBM_LIBRARY})
+ set_property(TARGET ${lib} APPEND PROPERTY INCLUDE_DIRECTORIES ${BROTLI_INCLUDE_DIRS})
+ set_target_properties(${lib} PROPERTIES
+@@ -195,13 +175,8 @@ foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
+ set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}")
+ endforeach()
+
+-if(NOT BROTLI_EMSCRIPTEN)
+ target_link_libraries(brotlidec brotlicommon)
+ target_link_libraries(brotlienc brotlicommon)
+-endif()
+-
+-target_link_libraries(brotlidec-static brotlicommon-static)
+-target_link_libraries(brotlienc-static brotlicommon-static)
+
+ # For projects stuck on older versions of CMake, this will set the
+ # BROTLI_INCLUDE_DIRS and BROTLI_LIBRARIES variables so they still
+@@ -216,7 +191,7 @@ endif()
+
+ # Build the brotli executable
+ add_executable(brotli ${BROTLI_CLI_C})
+-target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC})
++target_link_libraries(brotli ${BROTLI_LIBRARIES_CORE})
+
+ # Installation
+ if(NOT BROTLI_EMSCRIPTEN)
+@@ -233,13 +208,6 @@ if(NOT BROTLI_BUNDLED_MODE)
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ )
+
+- install(
+- TARGETS ${BROTLI_LIBRARIES_CORE_STATIC}
+- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+- )
+-
+ install(
+ DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
diff --git a/0002-cmake-no-exe.patch b/0002-cmake-no-exe.patch
new file mode 100644
index 000000000000..e436c529b5af
--- /dev/null
+++ b/0002-cmake-no-exe.patch
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a2420f1..00ed7fe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -189,18 +189,9 @@ if(BROTLI_PARENT_DIRECTORY)
+ set(BROTLI_LIBRARIES "${BROTLI_LIBRARIES}" PARENT_SCOPE)
+ endif()
+
+-# Build the brotli executable
+-add_executable(brotli ${BROTLI_CLI_C})
+-target_link_libraries(brotli ${BROTLI_LIBRARIES_CORE})
+-
+ # Installation
+ if(NOT BROTLI_EMSCRIPTEN)
+ if(NOT BROTLI_BUNDLED_MODE)
+- install(
+- TARGETS brotli
+- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+- )
+-
+ install(
+ TARGETS ${BROTLI_LIBRARIES_CORE}
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
diff --git a/PKGBUILD b/PKGBUILD
index 51be030d2707..39d5e4bea29e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,50 +1,58 @@
-# Maintainer: drakkan <nicola.murino at gmail dot com>
-pkgname=mingw-w64-brotli
+# -*- mode: Shell-script; eval: (setq tab-width 2); eval: (setq indent-tabs-mode nil) -*-
+# Maintainer: Dominic Meiser <git at msrd0 dot de>
+# Contributor: drakkan <nicola.murino at gmail dot com>
+pkgname=mingw-w64-brotli-static
_pkgname=brotli
_gitcommit=e61745a6b7add50d380cfd7d3883dd6c62fc2c71
pkgver=1.0.9
-pkgrel=3
+pkgrel=1
pkgdesc='Brotli compression library (mingw-w64)'
arch=('any')
license=('MIT')
url='https://github.com/google/brotli'
depends=('mingw-w64-gcc')
makedepends=('mingw-w64-cmake' 'git')
+provides=("mingw-w64-brotli=$pkgver")
+conflicts=("mingw-w64-brotli")
options=('!buildflags' '!strip' 'staticlibs')
-source=(${_pkgname}::"git+${url}#commit=${_gitcommit}")
-sha512sums=('SKIP')
+source=(${_pkgname}::"git+${url}#commit=${_gitcommit}"
+ '0001-cmake-static-libs.patch'
+ '0002-cmake-no-exe.patch')
+sha512sums=('SKIP'
+ '23d807f6563fc33720af074cc0996e332da9ee7aa7b45c958ec94e75da34b1947bff0ec05b8db8613d413e344f00b694c983d6a0578dc11dc722cb2feda7d2df'
+ '8b340ec3a6fc3e88e8a338cc3f2358f100e22ceda70207d511660fd5e7a68fe9502e3a15bfa6ed6197281f7f8d830c5737159f1323a2660a0536c6085f60ea59')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
pkgver() {
- cd ${_pkgname}
+ cd "$srcdir/$_pkgname"
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
+prepare() {
+ cd "$srcdir/$_pkgname"
+ patch -Np1 -i "$srcdir/0001-cmake-static-libs.patch"
+ patch -Np1 -i "$srcdir/0002-cmake-no-exe.patch"
+}
+
build() {
- for _arch in ${_architectures}; do
- cd "$srcdir"/${_pkgname}
- mkdir -p build-${_arch} && pushd build-${_arch}
- ${_arch}-cmake ..
+ for _arch in $_architectures; do
+ cd "$srcdir/$_pkgname"
+ mkdir -p build-$_arch
+ pushd build-$_arch
+ $_arch-cmake -DBROTLI_DISABLE_TESTS=ON ..
make
popd
done
}
package() {
- for _arch in ${_architectures}; do
- cd "${srcdir}/${_pkgname}/build-${_arch}"
- make DESTDIR="${pkgdir}" install
- find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec ${_arch}-strip --strip-all {} \;
- ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
- ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
- if [[ $NO_EXECUTABLES ]]; then
- find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
- fi
+ for _arch in $_architectures; do
+ cd "$srcdir/$_pkgname/build-$_arch"
+ make DESTDIR="$pkgdir" install
+ $_arch-strip -g "$pkgdir"/usr/$_arch/lib/*.a
done
for file in "${pkgdir}"/usr/*/lib/pkgconfig/*.pc; do
sed -i 's| -R${libdir}||g' "$file"
done
}
-
-# vim: ts=2 sw=2 et: