[11/23] rust-chrono: Required for update of python3-cryptography

Message ID 20220617094243.6422-11-adolf.belka@ipfire.org
State Accepted
Commit d6626067a7044c4a06df637fdf8cefc6adb3684c
Headers
Series [01/23] python3-cryptography: Update to version 36.0.2 |

Commit Message

Adolf Belka June 17, 2022, 9:42 a.m. UTC
  - lfs and rootfile created
- Patch created to remove requirement for winapi and related windows dependencies

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 config/rootfiles/common/rust-chrono           | 44 ++++++++++
 lfs/rust-chrono                               | 81 +++++++++++++++++++
 .../rust-chrono-0.4.19-fix-metadata.patch     | 23 ++++++
 3 files changed, 148 insertions(+)
 create mode 100644 config/rootfiles/common/rust-chrono
 create mode 100644 lfs/rust-chrono
 create mode 100644 src/patches/rust-chrono-0.4.19-fix-metadata.patch
  

Patch

diff --git a/config/rootfiles/common/rust-chrono b/config/rootfiles/common/rust-chrono
new file mode 100644
index 000000000..f30695b97
--- /dev/null
+++ b/config/rootfiles/common/rust-chrono
@@ -0,0 +1,44 @@ 
+#usr/share/cargo/registry/chrono-0.4.19
+#usr/share/cargo/registry/chrono-0.4.19/.cargo-checksum.json
+#usr/share/cargo/registry/chrono-0.4.19/AUTHORS.txt
+#usr/share/cargo/registry/chrono-0.4.19/CHANGELOG.md
+#usr/share/cargo/registry/chrono-0.4.19/Cargo.toml
+#usr/share/cargo/registry/chrono-0.4.19/Cargo.toml.deps
+#usr/share/cargo/registry/chrono-0.4.19/LICENSE.txt
+#usr/share/cargo/registry/chrono-0.4.19/README.md
+#usr/share/cargo/registry/chrono-0.4.19/benches
+#usr/share/cargo/registry/chrono-0.4.19/benches/chrono.rs
+#usr/share/cargo/registry/chrono-0.4.19/benches/serde.rs
+#usr/share/cargo/registry/chrono-0.4.19/rustfmt.toml
+#usr/share/cargo/registry/chrono-0.4.19/src
+#usr/share/cargo/registry/chrono-0.4.19/src/date.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/datetime.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/div.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format
+#usr/share/cargo/registry/chrono-0.4.19/src/format/locales.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format/mod.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format/parse.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format/parsed.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format/scan.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/format/strftime.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/lib.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/naive
+#usr/share/cargo/registry/chrono-0.4.19/src/naive/date.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/naive/datetime.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/naive/internals.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/naive/isoweek.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/naive/time.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/offset
+#usr/share/cargo/registry/chrono-0.4.19/src/offset/fixed.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/offset/local.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/offset/mod.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/offset/utc.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/oldtime.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/round.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/sys
+#usr/share/cargo/registry/chrono-0.4.19/src/sys.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/sys/stub.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/sys/unix.rs
+#usr/share/cargo/registry/chrono-0.4.19/src/sys/windows.rs
+#usr/share/cargo/registry/chrono-0.4.19/tests
+#usr/share/cargo/registry/chrono-0.4.19/tests/wasm.rs
diff --git a/lfs/rust-chrono b/lfs/rust-chrono
new file mode 100644
index 000000000..cac6a8033
--- /dev/null
+++ b/lfs/rust-chrono
@@ -0,0 +1,81 @@ 
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# 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 3 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/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 0.4.19
+
+THISAPP    = chrono-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_BLAKE2 = c92c273fb6475bbb2546dfb75eaa23321bc8f9a5fa8a7c652f527649b96ff8718fa932f52b500b02a4acae7837df5bdb14f69cb821d4962be2790dbd1d023a54
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+b2 : $(subst %,%_BLAKE2,$(objects))
+
+dist:
+	@$(PAK)
+
+###############################################################################
+# Downloading, checking, b2sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+	@$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+	@$(LOAD)
+
+$(subst %,%_BLAKE2,$(objects)) :
+	@$(B2SUM)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+	@$(PREBUILD)
+	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/rust-chrono-0.4.19-fix-metadata.patch
+	cd $(DIR_APP) && $(CARGO_PREPARE)
+	cd $(DIR_APP) && $(CARGO_BUILD)
+	cd $(DIR_APP) && $(CARGO_INSTALL)
+	@rm -rf $(DIR_APP)
+	@$(POSTBUILD)
diff --git a/src/patches/rust-chrono-0.4.19-fix-metadata.patch b/src/patches/rust-chrono-0.4.19-fix-metadata.patch
new file mode 100644
index 000000000..cf6861693
--- /dev/null
+++ b/src/patches/rust-chrono-0.4.19-fix-metadata.patch
@@ -0,0 +1,23 @@ 
+--- chrono-0.4.19/Cargo.toml.original	2020-09-30 17:06:24.000000000 +0200
++++ chrono-0.4.19/Cargo.toml	2022-06-16 17:27:21.440234723 +0200
+@@ -93,7 +93,7 @@
+ __doctest = []
+ __internal_bench = []
+ alloc = []
+-clock = ["libc", "std", "winapi"]
++clock = ["libc", "std"]
+ default = ["clock", "std", "oldtime"]
+ oldtime = ["time"]
+ std = []
+@@ -108,10 +108,7 @@
+ optional = true
+ [target."cfg(all(target_arch = \"wasm32\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))".dev-dependencies.wasm-bindgen-test]
+ version = "0.3"
+-[target."cfg(windows)".dependencies.winapi]
+-version = "0.3.0"
+-features = ["std", "minwinbase", "minwindef", "timezoneapi"]
+-optional = true
++
+ [badges.appveyor]
+ repository = "chronotope/chrono"
+