diff --git a/nodejs-iconv-lite-0.4.18.tar.gz b/nodejs-iconv-lite-0.4.18.tar.gz new file mode 100644 index 0000000..3c09ddc Binary files /dev/null and b/nodejs-iconv-lite-0.4.18.tar.gz differ diff --git a/nodejs-iconv-lite-node10.patch b/nodejs-iconv-lite-node10.patch new file mode 100644 index 0000000..6d3ad35 --- /dev/null +++ b/nodejs-iconv-lite-node10.patch @@ -0,0 +1,31 @@ +commit 55f9047c9da3edccf0bc7d80a09bcc2d92166da1 +Author: Douglas Wilson +Date: Sat May 5 19:18:29 2018 -0400 + + Use older semver style for old Node.js 0.10 npm versions (#182) + + * Use older semver style for old Node.js 0.10 npm versions + * Fix test for changes Node.js 10 behavior + +diff --git a/test/streams-test.js b/test/streams-test.js +index e1accff..3f7823f 100644 +--- a/test/streams-test.js ++++ b/test/streams-test.js +@@ -214,13 +214,14 @@ describe("Streaming mode", function() { + input: [[0x3D], [0xD8, 0x3B], [0xDE]], // U+1F63B, 😻, SMILING CAT FACE WITH HEART-SHAPED EYES + outputType: false, // Don't concat + checkOutput: function(res) { +- if (semver.lt(process.version, "v6.2.1")) { +- assert.deepEqual(res, ["\uD83D\uDE3B"]); // We should have only 1 chunk. +- } else { ++ if (semver.satisfies(process.version, '>= 6.2.1 < 10.0.0')) { + // After a string_decoder rewrite in https://github.com/nodejs/node/pull/6777, which + // was merged in Node v6.2.1, we don't merge chunks anymore. + // Not really correct, but it seems we cannot do anything with it. ++ // Though it has been fixed again in Node v10.0.0 + assert.deepEqual(res, ["\uD83D", "\uDE3B"]); ++ } else { ++ assert.deepEqual(res, ["\uD83D\uDE3B"]); // We should have only 1 chunk. + } + }, + })); diff --git a/nodejs-iconv-lite.spec b/nodejs-iconv-lite.spec new file mode 100644 index 0000000..d6a7816 --- /dev/null +++ b/nodejs-iconv-lite.spec @@ -0,0 +1,40 @@ +Name: nodejs-iconv-lite +Version: 0.4.18 +Release: 1 +Summary: Convert character encodings in pure JavaScript +License: MIT +URL: https://github.com/ashtuchkin/iconv-lite +Source0: https://github.com/ashtuchkin/iconv-lite/archive/v%{version}/nodejs-iconv-lite-%{version}.tar.gz +Patch0: nodejs-iconv-lite-node10.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +BuildRequires: npm(iconv) npm(mocha) npm(semver) +%description +%{summary}. + +%prep +%autosetup -p1 -n iconv-lite-%{version} + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/iconv-lite +cp -pr package.json encodings/ lib/ \ + %{buildroot}%{nodejs_sitelib}/iconv-lite +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +rm test/dbcs-test.js +rm test/sbcs-test.js +mocha --reporter spec --grep . + +%files +%doc README.md Changelog.md +%license LICENSE +%{nodejs_sitelib}/iconv-lite + +%changelog +* Thu Aug 20 2020 yaokai - 0.4.18-1 +- Package init diff --git a/nodejs-iconv-lite.yaml b/nodejs-iconv-lite.yaml new file mode 100644 index 0000000..89179d5 --- /dev/null +++ b/nodejs-iconv-lite.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: ashtuchkin/iconv-lite +tag_pattern: "^v" +seperator: "."