Skip to content

Commit

Permalink
change the thrift 0.14.1 to package download
Browse files Browse the repository at this point in the history
Signed-off-by: richardyu-ms <[email protected]>
  • Loading branch information
richardyu-ms committed Apr 14, 2022
1 parent 4f94d14 commit eabe38d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,3 @@
[submodule "src/sonic-p4rt/sonic-pins"]
path = src/sonic-p4rt/sonic-pins
url = https://github.com/Azure/sonic-pins.git
[submodule "src/thrift_0_14_1/thrift"]
path = src/thrift_0_14_1/thrift
url = https://github.com/apache/thrift.git
4 changes: 2 additions & 2 deletions rules/thrift_0_14_1.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ THRIFT_0_14_1_VERSION = 0.14.1
THRIFT_0_14_1_VERSION_FULL = $(THRIFT_0_14_1_VERSION)

LIBTHRIFT_0_14_1 = libthrift0_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBTHRIFT_0_14_1)_SRC_PATH = $(SRC_PATH)/thrift_0_14_1/thrift
SONIC_DPKG_DEBS += $(LIBTHRIFT_0_14_1)
$(LIBTHRIFT_0_14_1)_SRC_PATH = $(SRC_PATH)/thrift_0_14_1
SONIC_MAKE_DEBS += $(LIBTHRIFT_0_14_1)

LIBTHRIFT_0_14_1_DEV = libthrift-dev_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(LIBTHRIFT_0_14_1_DEV)))
Expand Down
31 changes: 31 additions & 0 deletions src/thrift_0_14_1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e -x

THRIFT_VERSION = 0.14.1

MAIN_TARGET = libthrift0_$(THRIFT_VERSION)_$(CONFIGURED_ARCH).deb
DERIVED_TARGETS = libthrift-dev_$(THRIFT_VERSION)_$(CONFIGURED_ARCH).deb \
python3-thrift_$(THRIFT_VERSION)_$(CONFIGURED_ARCH).deb \
thrift-compiler_$(THRIFT_VERSION)_$(CONFIGURED_ARCH).deb

THRIFT_LINK_PRE = https://archive.apache.org/dist/thrift

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf thrift-$(THRIFT_VERSION)

wget -O "thrift_$(THRIFT_VERSION).tar.gz" "$(THRIFT_LINK_PRE)/$(THRIFT_VERSION)/thrift-$(THRIFT_VERSION).tar.gz"

tar -xvzf ./thrift_$(THRIFT_VERSION).tar.gz
pushd thrift-$(THRIFT_VERSION)

# Disable php perl and few other packages as they need additional packages to be installed
patch -p1 < ../patch/0001-Remove-unneeded-packages.patch
patch -p1 < ../patch/0002-Fix-build-rules.patch
patch -p1 < ../patch/0003-Remove-minimist-packages.patch
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
popd

mv $(DERIVED_TARGETS) $* $(DEST)/

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
1 change: 0 additions & 1 deletion src/thrift_0_14_1/thrift
Submodule thrift deleted from f6fa17
3 changes: 0 additions & 3 deletions src/thrift_0_14_1/thrift.patch/series

This file was deleted.

0 comments on commit eabe38d

Please sign in to comment.