From dffa42c30412c43d640fcef661fdf2d89bf94af4 Mon Sep 17 00:00:00 2001 From: randogoth Date: Tue, 6 Oct 2026 08:46:04 +0300 Subject: [PATCH] build: package with Nix and publish a static release artifact packages.default builds natively and runs the suite: 357 tests pass in the sandbox, including the 60 socket integration tests, which settles the open question of whether they can bind in a Nix build. The sandbox's private network namespace has loopback up and the tests take port 0, so there is nothing to collide with. packages.static is the published artifact, fully static against musl, so a consumer needs neither autoPatchelfHook nor a matching glibc. There is no C dependency anywhere in the tree, not even a TLS library, so unlike bunshin's sqlite there is nothing to cross-provide. 2.3 MB stripped. nixpkgs is pinned to unstable and deliberately not followed from a consumer: every crate here declares rust-version 1.97 and nixos-25.11 ships 1.91.1, so bucur's nixpkgs could not build this. It does not need to, since it fetches the release asset. wml is built in. It is opt-in upstream, and the bundled itsybitsy.toml names it, so a default build refuses to boot the config shipped beside it. apps.release-static publishes to Forgejo tagged by short rev, following bunshin's. Note the asymmetry that bit bunshin: assets upload to /releases//assets but download from /releases/download//. THIRD_PARTY_NOTICES.md covers the static link closure, 73 crates across five license families, plus the two vendored FIGlet fonts, which carry their terms in the FIGfont comment header and which no crate scan can see. They are behind the non-default figlet feature and so are not in this binary, but they are redistributed with the source. Co-Authored-By: Claude Opus 5 --- THIRD_PARTY_NOTICES.md | 502 +++++++++++++++++++++++++++++++++++++++++ flake.lock | 61 +++++ flake.nix | 120 ++++++++++ 3 files changed, 683 insertions(+) create mode 100644 THIRD_PARTY_NOTICES.md create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..a9c0859 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,502 @@ +# Third-Party Notices + +itsybitsy incorporates the third-party components listed below. Components are grouped by license, each with the copyright notice that applies to it, followed by the full license text. A component listed under several licenses is multi-licensed under those options; any one of them may be chosen. All components are redistributed unmodified from their published sources. + +The Rust crates listed are all crates resolved by `Cargo.lock`, including transitive dependencies, which are statically linked into the itsybitsy binary. + +## Apache License 2.0 + +- anstream 1.0.0 - Copyright (c) Individual contributors +- anstyle 1.0.14 - Copyright (c) Individual contributors +- anstyle-parse 1.0.0 - Copyright (c) Individual contributors +- anstyle-query 1.1.5 - Copyright (c) Individual contributors +- anstyle-wincon 3.0.11 - Copyright (c) Individual contributors +- anyhow 1.0.104 - David Tolnay +- bitflags 1.3.2 - Copyright (c) 2014 The Rust Project Developers +- bitflags 2.13.2 - Copyright (c) 2014 The Rust Project Developers +- cfg-if 1.0.5 - Copyright (c) 2014 Alex Crichton +- clap 4.6.7 - Copyright Individual contributors +- clap_builder 4.6.7 - Copyright Individual contributors +- clap_derive 4.6.7 - Copyright Individual contributors +- clap_lex 1.1.1 - Copyright Individual contributors +- colorchoice 1.0.5 - Copyright (c) Individual contributors +- defmt 1.1.1 - Copyright (c) Ferrous Systems +- defmt-macros 1.1.1 - Copyright (c) Ferrous Systems +- defmt-parser 1.0.0 - The Knurling-rs developers +- env_filter 2.0.0 - Copyright (c) Individual contributors +- env_logger 0.11.11 - Copyright (c) Individual contributors +- equivalent 1.0.2 - Copyright (c) 2016--2023 +- errno 0.3.14 - Copyright (c) 2014 Chris Wong +- fastrand 2.5.0 - Stjepan Glavina +- getrandom 0.4.3 - Copyright (c) 2018-2026 The rust-random Project Developers Copyright (c) 2014 The Rust Project Developers +- hashbrown 0.17.1 - Copyright (c) 2016 Amanieu d'Antras +- heck 0.5.0 - Copyright (c) 2015 The Rust Project Developers +- hyphenation 0.8.4 - Copyright (c) 2016 tapeinosyne +- hyphenation_commons 0.8.4 - Andrew +- indexmap 2.14.2 - Copyright (c) 2016--2017 +- is_terminal_polyfill 1.70.2 - Copyright (c) Individual contributors +- libc 0.2.190 - Copyright (c) The Rust Project Developers +- linux-raw-sys 0.12.1 - Dan Gohman +- log 0.4.34 - Copyright (c) 2014 The Rust Project Developers +- once_cell 1.21.4 - Aleksey Kladov +- once_cell_polyfill 1.70.2 - Copyright (c) Individual contributors +- portable-atomic 1.15.0 - The portable-atomic developers +- portable-atomic-util 0.2.8 - The portable-atomic-util developers +- proc-macro2 1.0.107 - David Tolnay , Alex Crichton +- quote 1.0.47 - David Tolnay +- r-efi 6.0.0 - The r-efi developers +- regex 1.13.1 - Copyright (c) 2014 The Rust Project Developers +- regex-automata 0.4.18 - Copyright (c) 2014 The Rust Project Developers +- regex-syntax 0.8.11 - Copyright (c) 2014 The Rust Project Developers +- rustix 1.1.5 - Dan Gohman , Jakub Konka +- serde 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_core 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_derive 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_spanned 1.1.1 - Copyright (c) Individual contributors +- syn 2.0.119 - David Tolnay +- syn 3.0.6 - David Tolnay +- tempfile 3.27.0 - Copyright (c) 2015 Steven Allen +- thiserror 2.0.21 - David Tolnay +- thiserror-impl 2.0.21 - David Tolnay +- toml 1.1.6+spec-1.1.0 - Copyright (c) Individual contributors +- toml_datetime 1.1.1+spec-1.1.0 - Copyright (c) Individual contributors +- toml_parser 1.1.3+spec-1.1.0 - Copyright (c) Individual contributors +- toml_writer 1.1.2+spec-1.1.0 - Copyright (c) Individual contributors +- unicase 2.9.0 - Copyright (c) 2014-2026 Sean McArthur +- unicode-ident 1.0.26 - David Tolnay +- unicode-width 0.2.2 - Copyright (c) 2015 The Rust Project Developers +- utf8parse 0.2.2 - Copyright (c) 2016 Joe Wilm +- windows-link 0.2.1 - The windows-link developers +- windows-sys 0.61.2 - The windows-sys developers + +``` +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` + +## MIT License + +- aho-corasick 1.1.5 - Copyright (c) 2015 Andrew Gallant +- anstream 1.0.0 - Copyright (c) Individual contributors +- anstyle 1.0.14 - Copyright (c) Individual contributors +- anstyle-parse 1.0.0 - Copyright (c) Individual contributors +- anstyle-query 1.1.5 - Copyright (c) Individual contributors +- anstyle-wincon 3.0.11 - Copyright (c) Individual contributors +- anyhow 1.0.104 - David Tolnay +- bincode 1.3.3 - Ty Overby , Francesco Mazzoli , David Tolnay , Zoey Riordan +- bitflags 1.3.2 - Copyright (c) 2014 The Rust Project Developers +- bitflags 2.13.2 - Copyright (c) 2014 The Rust Project Developers +- cfg-if 1.0.5 - Copyright (c) 2014 Alex Crichton +- clap 4.6.7 - Copyright (c) Individual contributors +- clap_builder 4.6.7 - Copyright (c) Individual contributors +- clap_derive 4.6.7 - Copyright (c) Individual contributors +- clap_lex 1.1.1 - Copyright (c) Individual contributors +- colorchoice 1.0.5 - Copyright (c) Individual contributors +- defmt 1.1.1 - Copyright (c) Ferrous Systems +- defmt-macros 1.1.1 - Copyright (c) Ferrous Systems +- defmt-parser 1.0.0 - The Knurling-rs developers +- env_filter 2.0.0 - Copyright (c) Individual contributors +- env_logger 0.11.11 - Copyright (c) Individual contributors +- equivalent 1.0.2 - Copyright (c) 2016--2023 +- errno 0.3.14 - Copyright (c) 2014 Chris Wong +- fastrand 2.5.0 - Stjepan Glavina +- fst 0.4.7 - Copyright (c) 2015 Andrew Gallant +- getrandom 0.4.3 - Copyright (c) 2018-2026 The rust-random Project Developers Copyright (c) 2014 The Rust Project Developers +- hashbrown 0.17.1 - Copyright (c) 2016 Amanieu d'Antras +- heck 0.5.0 - Copyright (c) 2015 The Rust Project Developers +- hyphenation 0.8.4 - Copyright (c) 2016 tapeinosyne +- hyphenation_commons 0.8.4 - Andrew +- indexmap 2.14.2 - Copyright (c) 2016--2017 +- is_terminal_polyfill 1.70.2 - Copyright (c) Individual contributors +- jiff 0.2.37 - Copyright (c) 2015 Andrew Gallant +- jiff-core 0.1.1 - Copyright (c) 2015 Andrew Gallant +- jiff-static 0.2.37 - Copyright (c) 2015 Andrew Gallant +- libc 0.2.190 - Copyright (c) The Rust Project Developers +- linux-raw-sys 0.12.1 - Dan Gohman +- log 0.4.34 - Copyright (c) 2014 The Rust Project Developers +- memchr 2.8.3 - Copyright (c) 2015 Andrew Gallant +- once_cell 1.21.4 - Aleksey Kladov +- once_cell_polyfill 1.70.2 - Copyright (c) Individual contributors +- pocket-resources 0.3.2 - Pierre Krieger +- portable-atomic 1.15.0 - The portable-atomic developers +- portable-atomic-util 0.2.8 - The portable-atomic-util developers +- proc-macro2 1.0.107 - David Tolnay , Alex Crichton +- pulldown-cmark 0.13.4 - Copyright 2015 Google Inc. All rights reserved. +- quote 1.0.47 - David Tolnay +- r-efi 6.0.0 - The r-efi developers +- regex 1.13.1 - Copyright (c) 2014 The Rust Project Developers +- regex-automata 0.4.18 - Copyright (c) 2014 The Rust Project Developers +- regex-syntax 0.8.11 - Copyright (c) 2014 The Rust Project Developers +- rustix 1.1.5 - Dan Gohman , Jakub Konka +- serde 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_core 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_derive 1.0.229 - Erick Tryzelaar , David Tolnay +- serde_spanned 1.1.1 - Copyright (c) Individual contributors +- strsim 0.11.1 - Copyright (c) 2015 Danny Guo Copyright (c) 2016 Titus Wormer Copyright (c) 2018 Akash Kurdekar +- syn 2.0.119 - David Tolnay +- syn 3.0.6 - David Tolnay +- tempfile 3.27.0 - Copyright (c) 2015 Steven Allen +- thiserror 2.0.21 - David Tolnay +- thiserror-impl 2.0.21 - David Tolnay +- toml 1.1.6+spec-1.1.0 - Copyright (c) Individual contributors +- toml_datetime 1.1.1+spec-1.1.0 - Copyright (c) Individual contributors +- toml_parser 1.1.3+spec-1.1.0 - Copyright (c) Individual contributors +- toml_writer 1.1.2+spec-1.1.0 - Copyright (c) Individual contributors +- unicase 2.9.0 - Copyright (c) 2014-2026 Sean McArthur +- unicode-ident 1.0.26 - David Tolnay +- unicode-width 0.2.2 - Copyright (c) 2015 The Rust Project Developers +- utf8parse 0.2.2 - Copyright (c) 2016 Joe Wilm +- windows-link 0.2.1 - The windows-link developers +- windows-sys 0.61.2 - The windows-sys developers +- winnow 1.0.4 - The winnow developers + +``` +The MIT License (MIT) + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +``` + +## The Unlicense + +- aho-corasick 1.1.5 - Andrew Gallant +- fst 0.4.7 - Andrew Gallant +- jiff 0.2.37 - Andrew Gallant +- jiff-core 0.1.1 - Andrew Gallant +- jiff-static 0.2.37 - Andrew Gallant +- memchr 2.8.3 - Andrew Gallant , bluss + +``` +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +``` + +## Unicode License v3 + +- unicode-ident 1.0.26 (Unicode license applies in addition to MIT OR Apache-2.0) - Copyright © 1991-2023 Unicode, Inc. + +``` +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. +``` + +## LLVM Exception (to the Apache License 2.0) + +The component above may additionally be used under Apache-2.0 or MIT; when used under Apache-2.0, the license text above is modified by the following exception: + +- linux-raw-sys 0.12.1 (when used under Apache-2.0) - Dan Gohman +- rustix 1.1.5 (when used under Apache-2.0) - Dan Gohman , Jakub Konka + +``` +---- LLVM Exceptions to the Apache 2.0 License ---- + + As an exception, if, as a result of your compiling your source code, portions + of this Software are embedded into an Object form of such source code, you + may redistribute such embedded portions in such Object form without complying + with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + + In addition, if you combine or link compiled forms of this Software with + software that is licensed under the GPLv2 ("Combined Software") and if a + court of competent jurisdiction determines that the patent provision (Section + 3), the indemnity provision (Section 9) or other Section of the License + conflicts with the conditions of the GPLv2, you may retroactively and + prospectively choose to deem waived or otherwise exclude such Section(s) of + the License, but only in their entirety and only with respect to the Combined + Software. +``` + +## FIGlet fonts + +Two FIGlet fonts are vendored under `text/fonts/` and compiled in with +`include_str!` when the non-default `figlet` cargo feature is enabled. They are +**not** present in a binary built without that feature, which includes the +released static build; they are listed here because they are redistributed with +the source. + +- Small (`small.flf`) - Small by Glenn Chappell 4/93 -- based on Standard; figlet release 2.1 -- 12 Aug 1994; modified by Paul Burton 12/96 +- Standard (`standard.flf`) - Standard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig; figlet release 2.1 -- 12 Aug 1994; modified for figlet 2.2 by John Cowan + +Both are distributed with FIGlet itself and carry their permission notice in the +comment header the FIGfont format reserves for it: + +``` +Permission is hereby given to modify this font, as long as the +modifier's name is placed on a comment line. +``` + +The notices are preserved verbatim in the vendored files; the parser skips the +header rather than stripping it, so the terms travel with the font. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cbff2ca --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1791179034, + "narHash": "sha256-Ni0LBydzaCi8oek12r4mVreuFHqYlM1eTD6SfiENKfw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "494ce7fd23ff6a5dff39e1fb11e9b6f2ac74bf25", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..497e861 --- /dev/null +++ b/flake.nix @@ -0,0 +1,120 @@ +{ + description = "itsybitsy - serve folders of Markdown over HTTP, Gemini, Spartan, Nex and Gopher"; + + inputs = { + # Pinned independently of any consumer, and deliberately not `follows`-ed. + # Every crate here declares rust-version = "1.97"; nixos-25.11 ships 1.91.1, + # so a consumer's nixpkgs cannot build this. Nothing needs to: bucur fetches + # the release asset that `apps.release-static` publishes. + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + common = { + pname = "itsybitsy"; + version = "0.1.0"; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + + # The workspace root is virtual, and cargo refuses `--features` there + # without a package selector, so name the binary crate outright. + cargoBuildFlags = [ "--package" "itsybitsy" ]; + + # WML is opt-in upstream and the bundled itsybitsy.toml lists it, so a + # default build refuses to boot that config at all. The deployment + # wants it too: WAP handsets are the only client that asks for it, and + # they are exactly the audience a WML face exists for. + buildFeatures = [ "wml" ]; + + meta = { + description = "Serve folders of Markdown to several domains"; + license = pkgs.lib.licenses.asl20; + mainProgram = "itsybitsy"; + }; + }; + in + { + # Native build, and where the test suite runs. The integration tests + # bind 127.0.0.1 on port 0, which the Nix sandbox allows: it has its own + # network namespace with loopback up, so there is nothing to collide + # with and no fixed port to claim. + packages.default = pkgs.rustPlatform.buildRustPackage ( + common // { cargoTestFlags = [ "--workspace" ]; } + ); + + # The published artifact. Fully static against musl, so the consumer + # needs neither autoPatchelfHook nor a matching glibc: there is no C + # dependency anywhere in the tree, not even a TLS library, so unlike + # bunshin's sqlite there is nothing to cross-provide. + packages.static = pkgs.pkgsStatic.rustPlatform.buildRustPackage ( + common // { doCheck = false; } + ); + + apps.default = flake-utils.lib.mkApp { + drv = self.packages.${system}.default; + name = "itsybitsy"; + }; + + # Builds packages.static and publishes it as a Forgejo release tagged by + # short commit hash, creating the release if absent and replacing the + # asset if present. Needs FORGEJO_TOKEN (write:repository) in the + # environment or in .env. Same shape as bunshin's. + # + # Note the asymmetry that bit bunshin: assets are *uploaded* to + # /releases//assets but *downloaded* from /releases/download// + # . The generic package-registry path 404s; the consumer must use + # the download form. + apps.release-static = flake-utils.lib.mkApp { + drv = pkgs.writeShellApplication { + name = "itsybitsy-release-static"; + runtimeInputs = [ pkgs.nix pkgs.curl pkgs.git pkgs.jq ]; + text = '' + if [ -f .env ]; then + set -a + # shellcheck disable=SC1091 + . ./.env + set +a + fi + : "''${FORGEJO_TOKEN:?set FORGEJO_TOKEN (env or .env) to a Forgejo token with write:repository scope}" + + rev=$(git rev-parse --short HEAD) + sha=$(git rev-parse HEAD) + out=$(nix build .#static --no-link --print-out-paths) + bin="$out/bin/itsybitsy" + + api="https://code.randogoth.com/api/v1/repos/randogoth/itsybitsy" + auth=(-H "Authorization: token ''${FORGEJO_TOKEN}") + + release_id=$(curl -sS "''${auth[@]}" "$api/releases/tags/$rev" | jq -r '.id // empty') + if [ -z "$release_id" ]; then + release_id=$(curl -sSf "''${auth[@]}" -H "Content-Type: application/json" \ + -d "$(jq -n --arg tag "$rev" --arg sha "$sha" \ + '{tag_name:$tag, target_commitish:$sha, name:$tag, body:"Static musl build.", draft:false, prerelease:false}')" \ + "$api/releases" | jq -r '.id') + fi + + asset_id=$(curl -sSf "''${auth[@]}" "$api/releases/$release_id/assets" | jq -r '.[] | select(.name=="itsybitsy") | .id' | head -1) + if [ -n "$asset_id" ]; then + curl -sSf -X DELETE "''${auth[@]}" "$api/releases/$release_id/assets/$asset_id" >/dev/null + fi + curl -sSf "''${auth[@]}" -F "attachment=@$bin;filename=itsybitsy" "$api/releases/$release_id/assets?name=itsybitsy" >/dev/null + + echo "released: https://code.randogoth.com/randogoth/itsybitsy/releases/tag/$rev" + echo "fetch at: https://code.randogoth.com/randogoth/itsybitsy/releases/download/$rev/itsybitsy" + ''; + }; + }; + + devShells.default = pkgs.mkShell { + packages = with pkgs; [ cargo rustc rustfmt clippy ]; + }; + } + ); +}