diff --git a/.gitmodules b/.gitmodules index b2d76bd66b20..9194c8f4b7a2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/rules/thrift_0_14_1.mk b/rules/thrift_0_14_1.mk index b986e0a4dceb..6fc0d05c14bc 100644 --- a/rules/thrift_0_14_1.mk +++ b/rules/thrift_0_14_1.mk @@ -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))) diff --git a/src/thrift_0_14_1/Makefile b/src/thrift_0_14_1/Makefile new file mode 100644 index 000000000000..e5cbcb44c3c4 --- /dev/null +++ b/src/thrift_0_14_1/Makefile @@ -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) diff --git a/src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch b/src/thrift_0_14_1/patch/0001-Remove-unneeded-packages.patch similarity index 100% rename from src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch rename to src/thrift_0_14_1/patch/0001-Remove-unneeded-packages.patch diff --git a/src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch b/src/thrift_0_14_1/patch/0002-Fix-build-rules.patch similarity index 100% rename from src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch rename to src/thrift_0_14_1/patch/0002-Fix-build-rules.patch diff --git a/src/thrift_0_14_1/thrift.patch/0003-Remove-minimist-packages.patch b/src/thrift_0_14_1/patch/0003-Remove-minimist-packages.patch similarity index 100% rename from src/thrift_0_14_1/thrift.patch/0003-Remove-minimist-packages.patch rename to src/thrift_0_14_1/patch/0003-Remove-minimist-packages.patch diff --git a/src/thrift_0_14_1/thrift b/src/thrift_0_14_1/thrift deleted file mode 160000 index f6fa1794539e..000000000000 --- a/src/thrift_0_14_1/thrift +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f6fa1794539e68ac294038ac388d6bde40a6c237 diff --git a/src/thrift_0_14_1/thrift.patch/series b/src/thrift_0_14_1/thrift.patch/series deleted file mode 100644 index 0193b04536d5..000000000000 --- a/src/thrift_0_14_1/thrift.patch/series +++ /dev/null @@ -1,3 +0,0 @@ -0001-Remove-unneeded-packages.patch -0002-Fix-build-rules.patch -0003-Remove-minimist-packages.patch \ No newline at end of file