Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fnm: add ppc64 support #90

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-util/fnm/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ DIST regex-syntax-0.6.28.crate 299288 BLAKE2B 8554370e269e888e603c403089aa6eb4a0
DIST remove_dir_all-0.5.3.crate 9184 BLAKE2B ab7ef94e0230ddc9b363f038254a180881bbc20eb04a254f97e6f71ed491c99ba1c88f5e85632d450243882a4a0df63f3b8b183bc1fbca9caf30ec23d577b1d7 SHA512 50417d6d8a33912193a1ed37eb72b47431b12ae65d2780cdb7080c3d141e63819da13751c3fb737685cea322f70b36d413389c3dc01aa12b4dce615aefed0e2c
DIST reqwest-0.11.13.crate 144263 BLAKE2B b5391b87f751ad38a29879d0d6d746eb50dbebf07155a7f9af11ff2a5f7db438ae0e7c987150da0d708c0c299ae012b1fa328d979d60090d2f11ffd28be3a806 SHA512 8648ab7581efd412ce5b728fc456ad2a99feaf0d41c1345c89a65731ed762cfce1dd667a220e5f30f24266ddf78303bc167265588dd3cf6c6adb715e5e15e166
DIST ring-0.16.20.crate 5082615 BLAKE2B 6011eb7148c2d2ab410e564a06604f4350e07ea030e4d7dcb30574b977f0b0c7e53e09f6e6dbb2d068cdf110262876c48dfaeeef1b691932a056fe149916d934 SHA512 d97d1b08eb796d4c107426ff2c015ab1f221612500c8a57fca8e3f064e8c0f5ae2a5e6071d013313cd9f4be8fed4ba03beae84bd446f56b2b2ca5d483c328191
DIST ring-3f8f04a1057e286f3b8c5b9e39c9f795b15743cc.gh.tar.gz 5066374 BLAKE2B 825a7968d807a42284002b79475cc1e6eac3253c311a8f318ca841371ef00a30ba93d2cd30f4d242a82df903591e00fba0fa6bef9222b9a1c41ba7214ffc92d8 SHA512 c39c4a1997e7952b85ed26fef2fb70ae6198b96bf22623d248313d2a3dbd19ec773d6f1a3290ca8dfce9e7303299c966fb13665f58a41a2fd49024dd444af5c7
DIST rustc_version-0.4.0.crate 12175 BLAKE2B 6fda2ce03eab45d7193fa0d70175cc7ffb56b7be85fb1314092bdcfd3948ea145420569ace3a47218a4a2a6e44a818862cea6dd8cfb945475496f63b591c29da SHA512 f66da7c6efe431db06cd01180d84ba67fcd38f8cd6ef693762957c00ccc2211f23c08079d7f184776e08f28d2d6ca3bdb5f5016f7de245c6193d4722891ba1db
DIST rustls-0.20.6.crate 259289 BLAKE2B 36359bc14e87853752fe55a327bcd15a26cdb053b6e7b5d5a1e83ef940d1c2cf4c2acc899eeec35d01b9360a8814396938f2a1faacdf44bf38ce137ffd3238a5 SHA512 04a7922b3456b53d88904af925bbc3b4cc6f0b45256af46e1ebaac2446b73e2645f3b6a3a40ea9ff783acedfa2cc5ab94feaf3513a337d4e06564ab9008d2178
DIST rustls-0.20.7.crate 268469 BLAKE2B 54e00ce191500788a769ec7bd98a1fa31b3b369ca709eef1f38f4ce11b17524d22864250c24d9438aa7f6e5b4b7035a2807996dc5090b1337a6e204391706e5a SHA512 19a983563756b111a2a9f6ffe430690a0ed37ddd2b305f2a5a070b726797944237fc599460302476cda2bc9319c815e86a9b25e0976dc272d4cdb74f2ad821a7
Expand Down
25 changes: 25 additions & 0 deletions dev-util/fnm/files/fnm-ppc64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/Cargo.lock b/Cargo.lock
index da1325d..5808e01 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1393,8 +1393,7 @@ dependencies = [
[[package]]
name = "ring"
version = "0.16.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
+source = "git+https://github.com/IBM/ring.git?branch=ppc-0.16.20#3f8f04a1057e286f3b8c5b9e39c9f795b15743cc"
dependencies = [
"cc",
"libc",
diff --git a/Cargo.toml b/Cargo.toml
index 11f72c9..c41017f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,3 +45,6 @@ csv = "1.1.6"
junction = "0.2.0"

[features]
+
+[patch.crates-io]
+ring = { git = 'https://github.com/IBM/ring.git', branch = 'ppc-0.16.20' }
Binary file added dev-util/fnm/files/ring-git.tar.gz
Binary file not shown.
31 changes: 30 additions & 1 deletion dev-util/fnm/fnm-1.33.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ CRATES="
regex-syntax-0.6.28
remove_dir_all-0.5.3
reqwest-0.11.13
ring-0.16.20
rustc_version-0.4.0
rustls-0.20.7
rustls-native-certs-0.6.2
Expand Down Expand Up @@ -243,6 +242,10 @@ CRATES="
zstd-sys-2.0.1+zstd.1.5.2
"

declare -A GIT_CRATES=(
[ring]="https://github.com/IBM/ring;3f8f04a1057e286f3b8c5b9e39c9f795b15743cc"
)

inherit cargo bash-completion-r1 flag-o-matic

DESCRIPTION="Fast and simple Node.js version manager"
Expand Down Expand Up @@ -277,6 +280,32 @@ src_prepare() {
# Skip testing against PowerShell and WinCmd
eapply "${FILESDIR}/${PN}-1.32.0-skip-windows-related-tests.patch"
eapply "${FILESDIR}/${P}-remove-deprecated-time-dependency.patch"
eapply "${FILESDIR}/${PN}-ppc64.patch"

local crate crate_uri commit crate_dir sedexpr ifs
for crate in "${!GIT_CRATES[@]}"; do
IFS=';' read -r crate_uri commit crate_dir <<< "${GIT_CRATES[${crate}]}"
: "${crate_dir:=${crate}-%commit%}"

# replace git patch for crates.io
sedexpr+="s@^(${crate}[[:space:]]*=[[:space:]]*[{][[:space:]]*.*)[[:space:]]*git[[:space:]]*=[[:space:]]*[\"'][[:graph:]]+[\"'](,|)(.*[[:space:]]*[}])@\\1path = \"${WORKDIR}/${crate_dir//%commit%/${commit}}\",\\3 @;"

# get rid of the rev=
sedexpr+="s@^(${crate}[[:space:]]*=[[:space:]]*[{][[:space:]]*.*)[[:space:]]*rev[[:space:]]*=[[:space:]]*[\"'][[:alnum:]]+[\"'](,|[[:space:]]*)(.*[[:space:]]*[}])@\\1\\3@;"

# get rid of the branch=
sedexpr+="s@^(${crate}[[:space:]]*=[[:space:]]*[{][[:space:]]*.*)[[:space:]]*branch[[:space:]]*=[[:space:]]*[\"'][[:graph:]]+[\"'](,|[[:space:]]*)(.*[[:space:]]*[}])@\\1\\3@;"

# make sure we don't have a trailing comma
sedexpr+="s@^(${crate}[[:space:]]*=[[:space:]]*[{][[:space:]]*.*),([[:space:]]*[}])@\\1\\2@;"
done

sed -r -e "${sedexpr}" -i Cargo.toml || die

pushd ../ring* >/dev/null || die
# Somehow it fails to compile without the .git directory: https://pastebin.com/cRGzVsHE
unpack "${FILESDIR}/ring-git.tar.gz"
popd >/dev/null || die

default
}
Expand Down