Skip to content

Commit

Permalink
Update protobuf to 3.23.0, add abseil cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw committed May 13, 2023
1 parent 921e26c commit 61519a6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions gvsbuild/projects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# flake8: noqa

from gvsbuild.projects.adwaita_icon_theme import AdwaitaIconTheme
from gvsbuild.projects.abseil import AbseilCpp
from gvsbuild.projects.atk import Atk
from gvsbuild.projects.boringssl import BoringSSL
from gvsbuild.projects.cairo import Cairo
Expand Down
43 changes: 43 additions & 0 deletions gvsbuild/projects/abseil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (C) 2016 - Yevgen Muntyan
# Copyright (C) 2016 - Ignacio Casal Quinteiro
# Copyright (C) 2016 - Arnavion
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

from gvsbuild.utils.base_builders import CmakeProject
from gvsbuild.utils.base_expanders import Tarball
from gvsbuild.utils.base_project import Project, project_add


@project_add
class AbseilCpp(Tarball, CmakeProject):
def __init__(self):
Project.__init__(
self,
"abseil-cpp",
version="20230125.3",
archive_url="https://github.com/abseil/abseil-cpp/archive/refs/tags/{version}.tar.gz",
archive_file_name="abseil-cpp-{version}.tar.gz",
hash="5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36",
dependencies=["cmake", "ninja"],
)

def build(self, **kwargs):
CmakeProject.build(
self,
use_ninja=True,
cmake_params=r"-DABSL_PROPAGATE_CXX_STD=ON -DABSL_BUILD_DLL=ON",
)

self.install(r".\LICENSE share\doc\abseil-cpp")
13 changes: 9 additions & 4 deletions gvsbuild/projects/protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.


from gvsbuild.utils.base_builders import CmakeProject
from gvsbuild.utils.base_expanders import Tarball
from gvsbuild.utils.base_project import Project, project_add
Expand All @@ -26,22 +27,26 @@ def __init__(self):
Project.__init__(
self,
"protobuf",
version="3.21.12",
version="3.23.0",
lastversion_major=3,
archive_url="https://github.com/protocolbuffers/protobuf/releases/download/v{minor}.{micro}/protobuf-cpp-{version}.tar.gz",
hash="4eab9b524aa5913c6fffb20b2a8abf5ef7f95a80bc0701f3a6dbb4c607f73460",
archive_url="https://github.com/protocolbuffers/protobuf/releases/download/v{minor}.{micro}/protobuf-{minor}.{micro}.tar.gz",
hash="b29fc5fc13926f347b7a8b676ae1e63f7ccdb92c2fc8ca326bc3a883dcc168ac",
dependencies=[
"cmake",
"zlib",
"ninja",
"abseil-cpp",
],
)

def build(self):
# We need to compile with STATIC_RUNTIME off since protobuf-c also compiles with it OFF
CmakeProject.build(
self,
cmake_params=r'-DBUILD_SHARED_LIBS=ON -Dprotobuf_DEBUG_POSTFIX="" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_WITH_ZLIB=ON -Dprotobuf_MSVC_STATIC_RUNTIME=OFF',
cmake_params=r'-DBUILD_SHARED_LIBS=ON -Dprotobuf_DEBUG_POSTFIX="" -Dprotobuf_BUILD_TESTS=OFF '
r"-Dprotobuf_WITH_ZLIB=ON -Dprotobuf_MSVC_STATIC_RUNTIME=OFF "
r'-Dprotobuf_ABSL_PROVIDER=package -DCMAKE_PREFIX_PATH="%(pkg_dir)s\lib" '
r'-Dabsl_DIR="%(pkg_dir)s\lib\cmake\absl"',
use_ninja=True,
)

Expand Down

0 comments on commit 61519a6

Please sign in to comment.