diff options
Diffstat (limited to 'user/protobuf')
-rw-r--r-- | user/protobuf/APKBUILD | 45 | ||||
-rw-r--r-- | user/protobuf/musl-fix.patch | 22 | ||||
-rw-r--r-- | user/protobuf/trim-rakefile.patch | 72 |
3 files changed, 28 insertions, 111 deletions
diff --git a/user/protobuf/APKBUILD b/user/protobuf/APKBUILD index f8ff737a6..ea147080d 100644 --- a/user/protobuf/APKBUILD +++ b/user/protobuf/APKBUILD @@ -1,10 +1,9 @@ # Contributor: Kiyoshi Aman <kiyoshi.aman@gmail.com> # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Dan Theisen <djt@hxx.in> -# TODO: Build Python module, and clean up Ruby build process pkgname=protobuf _gemname=google-protobuf -pkgver=3.6.1 +pkgver=3.7.1 _tstver=1.8.0 pkgrel=0 pkgdesc="Library for extensible, efficient structure packing" @@ -12,13 +11,12 @@ url="https://github.com/google/protobuf" arch="all" license="BSD-3-Clause" depends_dev="zlib-dev" -makedepends="$depends_dev autoconf automake libtool ruby ruby-dev ruby-rake" -subpackages="ruby-$_gemname:_ruby $pkgname-dev $pkgname-vim::noarch" +makedepends="$depends_dev autoconf automake libtool ruby ruby-dev ruby-rake + ruby-rake-compiler python3 python3-dev" +checkdepends="ruby-json ruby-test-unit" +subpackages="ruby-$_gemname:_ruby py3-$pkgname:_python $pkgname-dev $pkgname-vim::noarch" source="$pkgname-$pkgver.tar.gz::https://github.com/google/$pkgname/archive/v$pkgver.tar.gz - googletest-$_tstver.tar.gz::https://github.com/google/googletest/archive/release-$_tstver.tar.gz - musl-fix.patch - trim-rakefile.patch" -builddir="$srcdir/$pkgname-$pkgver" + googletest-$_tstver.tar.gz::https://github.com/google/googletest/archive/release-$_tstver.tar.gz" prepare() { default_prepare @@ -33,8 +31,8 @@ prepare() { } build() { + # Build Protobuf cd "$builddir" - CXXFLAGS="$CXXFLAGS -fno-delete-null-pointer-checks" LDFLAGS="$LDFLAGS -latomic" \ ./configure --prefix=/usr \ --sysconfdir=/etc \ @@ -43,11 +41,10 @@ build() { --localstatedir=/var make + # Build for Ruby cd "$builddir"/ruby - # Generate proto files for built-in protocols. rake genproto - gem build $_gemname.gemspec gem install --local \ --install-dir dist \ @@ -56,7 +53,12 @@ build() { --verbose \ $_gemname - # build test-suite + # Build for Python 3 + cd "$builddir"/python + export LD_LIBRARY_PATH=${builddir}/src/.libs + python3 setup.py build --cpp_implementation + + # Build test-suite local test; for test in googletest googlemock; do cd "$builddir/third_party/googletest/$test" autoreconf -vfi @@ -65,10 +67,13 @@ build() { done } -# TODO: Run tests for ruby gem. check() { cd "$builddir" make check + cd "$builddir"/ruby + rake test + cd "$builddir"/python + python3 setup.py test --cpp_implementation } package() { @@ -93,6 +98,14 @@ _ruby() { rm -r ext/ tests/ } +_python() { + pkgdesc="Python bindings to Google's data interchange format" + + cd "$builddir"/python + python3 setup.py install --prefix=/usr --root="$subpkgdir" \ + --cpp_implementation +} + vim() { pkgdesc="Vim syntax for $pkgname" depends="" @@ -102,7 +115,5 @@ vim() { "$subpkgdir"/usr/share/vim/vimfiles/syntax/proto.vim } -sha512sums="1bc175d24b49de1b1e41eaf39598194e583afffb924c86c8d2e569d935af21874be76b2cbd4d9655a1d38bac3d4cd811de88bc2c72d81bad79115e69e5b0d839 protobuf-3.6.1.tar.gz -1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d googletest-1.8.0.tar.gz -875592bc5dc5efe9087ea1b340673f54c984ecd5aa3b110a2da136bdc28009af7ce1a9c57f4747ff809fc02eb6c39a0209c277177172af467a54172d9700188a musl-fix.patch -d1d11fe76d2a1ae92f47f9eb1e0d94c67b7192a9dc4a382b6c0835f4fe4dbc2f98ca1b3c5095ad5b4e368581072330f943209c0decea02ebb47938588543fdb1 trim-rakefile.patch" +sha512sums="7d4cfabd4bd55926336a3baafa0bc1f1f15380b1b2af945f70a2bb3ba24c6ac6567f49c492326d6d1c43a488166bff178f9266377758a05d8541d8b242f4f80f protobuf-3.7.1.tar.gz +1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d googletest-1.8.0.tar.gz" diff --git a/user/protobuf/musl-fix.patch b/user/protobuf/musl-fix.patch deleted file mode 100644 index 442ca20ed..000000000 --- a/user/protobuf/musl-fix.patch +++ /dev/null @@ -1,22 +0,0 @@ -seems like both musl libc and android has byteswap.h - ---- a/src/google/protobuf/stubs/port.h -+++ b/src/google/protobuf/stubs/port.h -@@ -94,7 +94,7 @@ - #include <intrin.h> - #elif defined(__APPLE__) - #include <libkern/OSByteOrder.h> --#elif defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__) -+#elif defined(__linux__) || defined(__BIONIC__) || defined(__CYGWIN__) - #include <byteswap.h> // IWYU pragma: export - #endif - -@@ -380,7 +380,7 @@ inline void GOOGLE_UNALIGNED_STORE64(voi - #define bswap_32(x) OSSwapInt32(x) - #define bswap_64(x) OSSwapInt64(x) - --#elif !defined(__GLIBC__) && !defined(__BIONIC__) && !defined(__CYGWIN__) -+#elif !defined(__linux__) && !defined(__BIONIC__) && !defined(__CYGWIN__) - - static inline uint16 bswap_16(uint16 x) { - return static_cast<uint16>(((x & 0xFF) << 8) | ((x & 0xFF00) >> 8)); diff --git a/user/protobuf/trim-rakefile.patch b/user/protobuf/trim-rakefile.patch deleted file mode 100644 index 7f53d7099..000000000 --- a/user/protobuf/trim-rakefile.patch +++ /dev/null @@ -1,72 +0,0 @@ -Remove code that we don't use to avoid installing additional dependencies. ---- a/ruby/Rakefile -+++ b/ruby/Rakefile -@@ -1,6 +1,4 @@ - require "rubygems" --require "rubygems/package_task" --require "rake/extensiontask" unless RUBY_PLATFORM == "java" - require "rake/testtask" - - spec = Gem::Specification.load("google-protobuf.gemspec") -@@ -39,51 +37,6 @@ - end - end - --if RUBY_PLATFORM == "java" -- if `which mvn` == '' -- raise ArgumentError, "maven needs to be installed" -- end -- task :clean do -- system("mvn --batch-mode clean") -- end -- -- task :compile do -- system("mvn --batch-mode package") -- end --else -- Rake::ExtensionTask.new("protobuf_c", spec) do |ext| -- unless RUBY_PLATFORM =~ /darwin/ -- # TODO: also set "no_native to true" for mac if possible. As is, -- # "no_native" can only be set if the RUBY_PLATFORM doing -- # cross-compilation is contained in the "ext.cross_platform" array. -- ext.no_native = true -- end -- ext.ext_dir = "ext/google/protobuf_c" -- ext.lib_dir = "lib/google" -- ext.cross_compile = true -- ext.cross_platform = [ -- 'x86-mingw32', 'x64-mingw32', -- 'x86_64-linux', 'x86-linux', -- 'universal-darwin' -- ] -- end -- -- task 'gem:windows' do -- require 'rake_compiler_dock' -- RakeCompilerDock.sh "bundle && IN_DOCKER=true rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0" -- end -- -- if RUBY_PLATFORM =~ /darwin/ -- task 'gem:native' do -- system "rake genproto" -- system "rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0:2.2.2:2.1.6:2.0.0" -- end -- else -- task 'gem:native' => [:genproto, 'gem:windows'] -- end --end -- -- - # Proto for tests. - genproto_output << "tests/generated_code.rb" - genproto_output << "tests/test_import.rb" -@@ -104,9 +57,6 @@ - - task :clean do - sh "rm -f #{genproto_output.join(' ')}" --end -- --Gem::PackageTask.new(spec) do |pkg| - end - - Rake::TestTask.new(:test => :build) do |t| |