diff --git a/pkgs/by-name/gr/graphest/Cargo.lock b/pkgs/by-name/gr/graphest/Cargo.lock
new file mode 100644
index 00000000000000..c89fde689092f7
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/Cargo.lock
@@ -0,0 +1,553 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
+[[package]]
+name = "aho-corasick"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "anstyle"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "az"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973"
+
+[[package]]
+name = "bindgen"
+version = "0.72.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
+dependencies = [
+ "bitflags 2.4.0",
+ "cexpr",
+ "clang-sys",
+ "itertools",
+ "log",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash",
+ "shlex",
+ "syn",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
+
+[[package]]
+name = "bytemuck"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea"
+
+[[package]]
+name = "byteorder"
+version = "1.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+
+[[package]]
+name = "cexpr"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
+dependencies = [
+ "nom",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clang-sys"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f"
+dependencies = [
+ "glob",
+ "libc",
+ "libloading",
+]
+
+[[package]]
+name = "clap"
+version = "4.3.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03aef18ddf7d879c15ce20f04826ef8418101c7e528014c3eeea13321047dca3"
+dependencies = [
+ "clap_builder",
+]
+
+[[package]]
+name = "clap_builder"
+version = "4.3.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8ce6fffb678c9b80a70b6b6de0aad31df727623a70fd9a842c30cd573e2fa98"
+dependencies = [
+ "anstyle",
+ "clap_lex",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
+
+[[package]]
+name = "color_quant"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+
+[[package]]
+name = "crc32fast"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "either"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
+
+[[package]]
+name = "fdeflate"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10"
+dependencies = [
+ "simd-adler32",
+]
+
+[[package]]
+name = "flate2"
+version = "1.0.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "forward_ref"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e"
+
+[[package]]
+name = "glob"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+
+[[package]]
+name = "gmp-mpfr-sys"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87010f41b33d28887e0379114e7b065ad39f34e2589a8e8e0fe02c8559c68466"
+dependencies = [
+ "libc",
+ "windows-sys",
+]
+
+[[package]]
+name = "graphest"
+version = "1.3.3"
+dependencies = [
+ "bitflags 2.4.0",
+ "clap",
+ "gmp-mpfr-sys",
+ "graphest-arb-sys",
+ "graphest-fftw-sys",
+ "image",
+ "inari",
+ "itertools",
+ "nom",
+ "rug",
+ "smallvec",
+ "uuid",
+]
+
+[[package]]
+name = "graphest-arb-sys"
+version = "0.6.0"
+dependencies = [
+ "bindgen",
+ "gmp-mpfr-sys",
+]
+
+[[package]]
+name = "graphest-fftw-sys"
+version = "0.1.0"
+dependencies = [
+ "bindgen",
+]
+
+[[package]]
+name = "image"
+version = "0.24.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711"
+dependencies = [
+ "bytemuck",
+ "byteorder",
+ "color_quant",
+ "num-rational",
+ "num-traits",
+ "png",
+]
+
+[[package]]
+name = "inari"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80fb42e74226ad088e256b85d2c98849edadeef8774a19e2a564ad9e51f0e141"
+dependencies = [
+ "cfg-if",
+ "forward_ref",
+ "gmp-mpfr-sys",
+ "nom",
+ "rug",
+]
+
+[[package]]
+name = "itertools"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.147"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
+
+[[package]]
+name = "libloading"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
+dependencies = [
+ "cfg-if",
+ "winapi",
+]
+
+[[package]]
+name = "log"
+version = "0.4.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
+
+[[package]]
+name = "memchr"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
+
+[[package]]
+name = "minimal-lexical"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
+dependencies = [
+ "adler",
+ "simd-adler32",
+]
+
+[[package]]
+name = "nom"
+version = "7.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
+dependencies = [
+ "memchr",
+ "minimal-lexical",
+]
+
+[[package]]
+name = "num-integer"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "png"
+version = "0.17.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64"
+dependencies = [
+ "bitflags 1.3.2",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "prettyplease"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62"
+dependencies = [
+ "proc-macro2",
+ "syn",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.101"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "regex"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
+
+[[package]]
+name = "rug"
+version = "1.20.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240ad7cbc5fc7cea4592203f8f6100835e8ad083196491b8a9c84ce84711ff68"
+dependencies = [
+ "az",
+ "gmp-mpfr-sys",
+ "libc",
+]
+
+[[package]]
+name = "rustc-hash"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
+
+[[package]]
+name = "shlex"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
+
+[[package]]
+name = "simd-adler32"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
+
+[[package]]
+name = "smallvec"
+version = "1.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
+
+[[package]]
+name = "syn"
+version = "2.0.29"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
+
+[[package]]
+name = "uuid"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-sys"
+version = "0.42.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.42.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
diff --git a/pkgs/by-name/gr/graphest/Info.plist b/pkgs/by-name/gr/graphest/Info.plist
new file mode 100644
index 00000000000000..e9e22e981145e9
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/Info.plist
@@ -0,0 +1,141 @@
+
+
+
+
+ CFBundleDisplayName
+ Graphest
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeRole
+ Editor
+ LSHandlerRank
+ Owner
+ LSItemContentTypes
+
+ io.github.unageek.graphest.document
+
+
+
+ CFBundleExecutable
+ Graphest
+ CFBundleIconFile
+ icon.icns
+ CFBundleIdentifier
+ io.github.unageek.graphest
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Graphest
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ @version@
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLName
+ Graphest
+ CFBundleURLSchemes
+
+ graphest
+
+
+
+ CFBundleVersion
+ @version@
+ LSApplicationCategoryType
+ public.app-category.utilities
+ LSEnvironment
+
+ MallocNanoZone
+ 0
+
+ LSMinimumSystemVersion
+ 10.13
+ NSAppTransportSecurity
+
+ NSAllowsArbitraryLoads
+
+ NSAllowsLocalNetworking
+
+ NSExceptionDomains
+
+ 127.0.0.1
+
+ NSIncludesSubdomains
+
+ NSTemporaryExceptionAllowsInsecureHTTPLoads
+
+ NSTemporaryExceptionAllowsInsecureHTTPSLoads
+
+ NSTemporaryExceptionMinimumTLSVersion
+ 1.0
+ NSTemporaryExceptionRequiresForwardSecrecy
+
+
+ localhost
+
+ NSIncludesSubdomains
+
+ NSTemporaryExceptionAllowsInsecureHTTPLoads
+
+ NSTemporaryExceptionAllowsInsecureHTTPSLoads
+
+ NSTemporaryExceptionMinimumTLSVersion
+ 1.0
+ NSTemporaryExceptionRequiresForwardSecrecy
+
+
+
+
+ NSBluetoothAlwaysUsageDescription
+ This app needs access to Bluetooth
+ NSBluetoothPeripheralUsageDescription
+ This app needs access to Bluetooth
+ NSCameraUsageDescription
+ This app needs access to the camera
+ NSHighResolutionCapable
+
+ NSHumanReadableCopyright
+ Copyright © 2023 Masashi Mizuno
+ NSMainNibFile
+ MainMenu
+ NSMicrophoneUsageDescription
+ This app needs access to the microphone
+ NSPrincipalClass
+ AtomApplication
+ NSQuitAlwaysKeepsWindows
+
+ NSRequiresAquaSystemAppearance
+
+ NSSupportsAutomaticGraphicsSwitching
+
+ UTExportedTypeDeclarations
+
+
+ UTTypeConformsTo
+
+ public.content
+ public.data
+
+ UTTypeDescription
+ Graphest Document
+ UTTypeIcons
+
+ UTTypeIconText
+ graph
+
+ UTTypeIdentifier
+ io.github.unageek.graphest.document
+ UTTypeTagSpecification
+
+ public.filename-extension
+ graphest
+
+
+
+
+
diff --git a/pkgs/by-name/gr/graphest/dependencies.patch b/pkgs/by-name/gr/graphest/dependencies.patch
new file mode 100644
index 00000000000000..7c99e9132e3818
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/dependencies.patch
@@ -0,0 +1,25 @@
+diff --git a/rust/graphest-arb-sys/build.rs b/rust/graphest-arb-sys/build.rs
+index 9527ffe..94c6d60 100644
+--- a/rust/graphest-arb-sys/build.rs
++++ b/rust/graphest-arb-sys/build.rs
+@@ -50,6 +50,7 @@ fn load_cache(env: &Environment) {
+ }
+
+ fn build_flint(env: &Environment) {
++ let _ = copy_dir_all("@flint@", env.out_dir.clone());
+ if env.lib_dir.join("libflint.a").exists() {
+ return;
+ }
+diff --git a/rust/graphest-fftw-sys/build.rs b/rust/graphest-fftw-sys/build.rs
+index 2e3247d..a4ac573 100644
+--- a/rust/graphest-fftw-sys/build.rs
++++ b/rust/graphest-fftw-sys/build.rs
+@@ -53,6 +53,8 @@ fn load_cache(env: &Environment) {
+ }
+
+ fn build(env: &Environment) {
++ let _ = copy_dir_all("@fftwLib@", env.out_dir.clone());
++ let _ = copy_dir_all("@fftwDev@", env.out_dir.clone());
+ if env.lib_dir.join("libfftw3f.a").exists() {
+ return;
+ }
diff --git a/pkgs/by-name/gr/graphest/disable-auto-update.patch b/pkgs/by-name/gr/graphest/disable-auto-update.patch
new file mode 100644
index 00000000000000..2a3fbfdc44981b
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/disable-auto-update.patch
@@ -0,0 +1,12 @@
+diff --git a/src/main/main.ts b/src/main/main.ts
+index d9413cc..b49e641 100644
+--- a/src/main/main.ts
++++ b/src/main/main.ts
+@@ -280,7 +280,6 @@ app.whenReady().then(async () => {
+ }
+
+ createMainWindow();
+- autoUpdater.checkForUpdatesAndNotify();
+ });
+
+ app.on("open-file", (_, path) => {
diff --git a/pkgs/by-name/gr/graphest/mime.xml b/pkgs/by-name/gr/graphest/mime.xml
new file mode 100644
index 00000000000000..18bdd8ea21dda5
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/mime.xml
@@ -0,0 +1,7 @@
+
+
+
+ Graphest Document
+
+
+
diff --git a/pkgs/by-name/gr/graphest/package.nix b/pkgs/by-name/gr/graphest/package.nix
new file mode 100644
index 00000000000000..9f8c5f546614b3
--- /dev/null
+++ b/pkgs/by-name/gr/graphest/package.nix
@@ -0,0 +1,216 @@
+{
+ lib,
+ stdenv,
+ rustPlatform,
+ buildNpmPackage,
+ fetchFromGitHub,
+ fetchpatch,
+ fetchurl,
+ replaceVars,
+ copyDesktopItems,
+ makeDesktopItem,
+ makeBinaryWrapper,
+ nix-update-script,
+ electron,
+ gnum4,
+ fftwFloat,
+ flint,
+ blas,
+ openblas,
+ darwin,
+}:
+
+let
+ # The dependencies of graphest-fftw-sys and graphest-arb-sys need to be static.
+ # Use this instead of pkgsStatic because pkgsStatic.flint build fails.
+ static =
+ p:
+ p.overrideAttrs (oldAttrs: {
+ configureFlags = oldAttrs.configureFlags ++ [ "--enable-static" ];
+ });
+ fftwFloatStatic = static fftwFloat;
+ # Graphest was developed with Flint 2, so let's hope there are no breaking changes
+ flintStatic = (static flint).override {
+ inherit blas openblas;
+ withBlas = true; # Some functions used by Graphest require BLAS
+ };
+
+ version = "1.3.3-unstable-2024-08-30"; # 1.3.3 build fails because Rust removed default_free_fn
+ src = fetchFromGitHub {
+ owner = "unageek";
+ repo = "graphest";
+ rev = "e9730220349a6da9816f930b5a37c2a75b74bf9c"; # tag = "v${version}";
+ hash = "sha256-s9dVApPjFJGR0lP+a2pi6P+GDs4JIAz5gpW+cx9XGzw=";
+ };
+
+ meta = {
+ description = "Graphing calculator that can faithfully plot arbitrary mathematical relations";
+ homepage = "https://github.com/unageek/graphest";
+ changelog = "https://github.com/unageek/graphest/releases/tag/v1.3.3"; # https://github.com/unageek/graphest/releases/${src.tag}
+ downloadPage = "https://github.com/unageek/graphest/releases";
+ license = lib.licenses.mit;
+ maintainers = with lib.maintainers; [ ulysseszhan ];
+ };
+
+ graph = rustPlatform.buildRustPackage (finalAttrs: {
+ pname = "graphest-graph";
+ inherit version src;
+
+ patches = [
+ # Update bindgen; use Flint 3; fix compilation warnings (https://github.com/unageek/graphest/pull/999)
+ (fetchpatch {
+ name = "flint3";
+ url = "https://github.com/unageek/graphest/commit/65ffea93c934f2df100c18f799afdf9870d611ff.patch";
+ hash = "sha256-aysdGhVu54M3F+A0e38WwlLUdf2pTw73Vs117Vfi8O8=";
+ })
+
+ # Use libraries from nixpkgs instead of trying to download them
+ (replaceVars ./dependencies.patch {
+ fftwLib = fftwFloatStatic.out;
+ fftwDev = fftwFloatStatic.dev;
+ flint = flintStatic.out;
+ })
+ ];
+
+ nativeBuildInputs = [
+ gnum4 # used by build script of gmp-mpfr-sys
+ rustPlatform.bindgenHook # used by build script of graphest-fftw-sys and graphest-arb-sys even on linux
+ ];
+
+ buildInputs = [
+ fftwFloatStatic
+ flintStatic
+ blas # needed here because -lblas is added to RUSTFLAGS
+ ];
+ strictDeps = true;
+
+ # vendored from unageek/graphest#999 to update bindgen; replace with cargoHash once it is merged
+ cargoLock.lockFile = ./Cargo.lock;
+
+ env = {
+ RUSTC_BOOTSTRAP = 1; # smallvec: error[E0554]: `#![feature]` may not be used on the stable release channel
+ RUSTFLAGS =
+ "-lblas" # add -lblas to fix linking error regarding the function cblas_dgemm (bug of flint maybe???)
+ # inari: error: RUSTFLAGS='-Ctarget-cpu=haswell' or later is required.
+ + lib.optionalString stdenv.hostPlatform.isx86 " -Ctarget-cpu=haswell";
+ };
+
+ preCheck = ''
+ # see rust/tests/graph.rs; executable path is hardcoded to be in target/release
+ ln -s ../${stdenv.targetPlatform.rust.rustcTargetSpec}/release/graph -t target/release
+ '';
+ # These two tests fails probably because of Flint 3
+ checkFlags = [
+ "--skip"
+ "graph_tests::examples::t_8c9209237ba04e67a715382c7bcbf5e0"
+ "--skip"
+ "graph_tests::examples::t_d2a0e9e88c41406a80a266d78f6dc7a5"
+ ];
+
+ meta = meta // {
+ broken = stdenv.hostPlatform.isMsvc; # https://github.com/unageek/inari
+ mainProgram = "graph";
+ };
+ });
+
+in
+buildNpmPackage (finalAttrs: {
+ pname = "graphest";
+ inherit version src;
+
+ patches = [
+ # specify what files should be installed in package.json (https://github.com/unageek/graphest/pull/1000)
+ (fetchpatch {
+ name = "npm-files";
+ url = "https://github.com/unageek/graphest/commit/1d1b8ee610a55bf9465a630499c6b0f6e9a66689.patch";
+ hash = "sha256-5PU9iPy6gfesl40piRTw9+QMNf4GSGASYs8ZTLedS7o=";
+ })
+
+ # support opening file or url from command line (https://github.com/unageek/graphest/pull/1002)
+ # otherwise the desktop entry is basically useless
+ (fetchpatch {
+ name = "open-file";
+ url = "https://github.com/unageek/graphest/commit/d53a6ad9667695b37a53b32024ec7ad15479f9ed.patch";
+ hash = "sha256-nRtwfSr1TNnJ22Hk9kb6NT7xs42jbjWw5P7nOitNZxo=";
+ })
+
+ ./disable-auto-update.patch
+ ];
+
+ nativeBuildInputs = [
+ copyDesktopItems
+ makeBinaryWrapper
+ ]
+ ++ lib.optional stdenv.hostPlatform.isDarwin darwin.autoSignDarwinBinariesHook;
+
+ buildInputs = [
+ electron
+ graph
+ ];
+
+ npmDepsHash = "sha256-J/IZ7d3LaYZLik7SxXSrH9dfxpxsa/Dn87160ba7wjs=";
+ env.ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
+
+ preBuild = ''
+ export NODE_ENV=production # do not set this in env because it must not be present in the configure phase
+ '';
+ npmBuildScript = "build:app";
+
+ checkPhase = ''
+ runHook preCheck
+
+ npm test
+
+ runHook postCheck
+ '';
+
+ postInstall = ''
+ ln -s ${graph}/bin/* -t $out/lib/node_modules/graphest/dist
+
+ makeWrapper ${lib.getExe electron} $out/bin/Graphest \
+ --add-flags $out/lib/node_modules/graphest \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
+ --inherit-argv0
+
+ install -Dm444 build/icon.png $out/share/icons/hicolor/1024x1024/apps/graphest.png
+ install -Dm444 ${./mime.xml} $out/share/mime/packages/graphest.xml
+ ''
+ + lib.optionalString stdenv.hostPlatform.isDarwin ''
+ mkdir -p $out/Applications/Graphest.app/Contents/MacOS
+ ln -s $out/bin/Graphest $out/Applications/Graphest.app/Contents/MacOS/Graphest
+ install -Dm444 build/icon.icns $out/Applications/Graphest.app/Contents/Resources/icon.icns
+ install -Dm444 ${
+ # This is adapted from the extracted contents of the dmg package.
+ # It should be generated from electron-builder.json,
+ # but apparently electron-builder does not have a functionality for just generating Info.plist instead of everything.
+ replaceVars ./Info.plist { version = builtins.elemAt (builtins.match "([^\\-]+).*" version) 0; }
+ } $out/Applications/Graphest.app/Contents/Info.plist
+ '';
+
+ desktopItems = [
+ (makeDesktopItem {
+ name = "graphest";
+ desktopName = "Graphest";
+ exec = "Graphest %u";
+ icon = "graphest";
+ categories = [
+ "Science"
+ "Math"
+ ];
+ comment = meta.description;
+ mimeTypes = [
+ "x-scheme-handler/graphest"
+ "application/x-graphest"
+ ];
+ })
+ ];
+
+ passthru = {
+ inherit graph;
+ updateScript = nix-update-script { };
+ };
+
+ meta = meta // {
+ mainProgram = "Graphest";
+ };
+})