]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
rust-getrandom: New package.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 30 Jan 2022 18:35:12 +0000 (19:35 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Feb 2022 19:43:24 +0000 (19:43 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/common/rust-getrandom [new file with mode: 0644]
lfs/rust-getrandom [new file with mode: 0644]
make.sh
src/patches/rust-getrandom-0.2.4-fix-metadata.patch [new file with mode: 0644]

diff --git a/config/rootfiles/common/rust-getrandom b/config/rootfiles/common/rust-getrandom
new file mode 100644 (file)
index 0000000..1f74e64
--- /dev/null
@@ -0,0 +1,38 @@
+#usr/share/cargo/registry/getrandom-0.2.4
+#usr/share/cargo/registry/getrandom-0.2.4/.cargo-checksum.json
+#usr/share/cargo/registry/getrandom-0.2.4/CHANGELOG.md
+#usr/share/cargo/registry/getrandom-0.2.4/Cargo.toml
+#usr/share/cargo/registry/getrandom-0.2.4/Cargo.toml.deps
+#usr/share/cargo/registry/getrandom-0.2.4/LICENSE-APACHE
+#usr/share/cargo/registry/getrandom-0.2.4/LICENSE-MIT
+#usr/share/cargo/registry/getrandom-0.2.4/README.md
+#usr/share/cargo/registry/getrandom-0.2.4/benches
+#usr/share/cargo/registry/getrandom-0.2.4/benches/mod.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src
+#usr/share/cargo/registry/getrandom-0.2.4/src/bsd_arandom.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/custom.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/dragonfly.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/error.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/error_impls.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/fuchsia.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/ios.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/js.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/lib.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/linux_android.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/macos.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/openbsd.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/rdrand.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/solaris_illumos.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/solid.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/use_file.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/util.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/util_libc.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/vxworks.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/wasi.rs
+#usr/share/cargo/registry/getrandom-0.2.4/src/windows.rs
+#usr/share/cargo/registry/getrandom-0.2.4/tests
+#usr/share/cargo/registry/getrandom-0.2.4/tests/common
+#usr/share/cargo/registry/getrandom-0.2.4/tests/common/mod.rs
+#usr/share/cargo/registry/getrandom-0.2.4/tests/custom.rs
+#usr/share/cargo/registry/getrandom-0.2.4/tests/normal.rs
+#usr/share/cargo/registry/getrandom-0.2.4/tests/rdrand.rs
diff --git a/lfs/rust-getrandom b/lfs/rust-getrandom
new file mode 100644 (file)
index 0000000..80021a4
--- /dev/null
@@ -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.2.4
+
+THISAPP    = getrandom-$(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)_MD5 = 451eb77431ccd2ff10b2d70b71c3b00b
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# 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-getrandom-0.2.4-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/make.sh b/make.sh
index 6f02cf68e40776bf9fdf06c97c28a3344c35e887..6258bf2a13750445fa1e08d1d968110ad1476b21 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1219,6 +1219,7 @@ buildipfire() {
   lfsmake2 rust-dissimilar
   lfsmake2 rust-cfg-if
   lfsmake2 rust-libc
+  lfsmake2 rust-getrandom
   lfsmake2 gdb
   lfsmake2 grub
   lfsmake2 efivar
diff --git a/src/patches/rust-getrandom-0.2.4-fix-metadata.patch b/src/patches/rust-getrandom-0.2.4-fix-metadata.patch
new file mode 100644 (file)
index 0000000..083b6d6
--- /dev/null
@@ -0,0 +1,36 @@
+--- getrandom-0.2.4/Cargo.toml.orig    2022-01-27 18:43:09.339254197 +0000
++++ getrandom-0.2.4/Cargo.toml 2022-01-27 18:44:42.583701271 +0000
+@@ -20,33 +20,13 @@
+ [target.'cfg(unix)'.dependencies]
+ libc = { version = "0.2.64", default-features = false }
+-[target.'cfg(target_os = "wasi")'.dependencies]
+-wasi = "0.10"
+-
+-[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
+-wasm-bindgen = { version = "0.2.62", default-features = false, optional = true }
+-js-sys = { version = "0.3", optional = true }
+-[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
+-wasm-bindgen-test = "0.3.18"
+-
+ [features]
+ # Implement std-only traits for getrandom::Error
+ std = []
+ # Feature to enable fallback RDRAND-based implementation on x86/x86_64
+ rdrand = []
+-# Feature to enable JavaScript bindings on wasm32-unknown-unknown
+-js = ["wasm-bindgen", "js-sys"]
+ # Feature to enable custom RNG implementations
+ custom = []
+-# Unstable feature to support being a libstd dependency
+-rustc-dep-of-std = [
+-  "compiler_builtins",
+-  "core",
+-  "libc/rustc-dep-of-std",
+-  "wasi/rustc-dep-of-std",
+-]
+-# Unstable/test-only feature to run wasm-bindgen tests in a browser
+-test-in-browser = []
+ [package.metadata.docs.rs]
+ features = ["std", "custom"]