antioxidant-packages.scm 188 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670
  1. ;;; Antioxidant --- Building Rust without cargo
  2. ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
  3. ;;;
  4. ;;; This file is part of Antioxidant.
  5. ;;;
  6. ;;; Antioxidant is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; Antioxidant is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (antioxidant-packages)
  19. #:export (vitaminate/auto public-test-package))
  20. (use-modules (guix packages) (guix build-system) (guix gexp) (guix utils) (guix modules)
  21. ((guix build-system gnu) #:select (%gnu-build-system-modules))
  22. (gnu packages compression) (gnu packages python) (gnu packages python-build)
  23. (gnu packages guile) (ice-9 match) (srfi srfi-1) (srfi srfi-71)
  24. (gnu packages rust-apps) (guix utils) (srfi srfi-26)
  25. (guix git-download) (ice-9 optargs) ((guix licenses) #:prefix license:)
  26. (guix search-paths) (gnu packages rust) (gnu packages base))
  27. (define (target-environment-variables target)
  28. ;; TODO gnueabihf?
  29. `(("CARGO_CFG_TARGET_ENV" .
  30. ,(if (or (target-linux? target) (target-hurd? target))
  31. "gnu"
  32. (unrecognised)))
  33. ("CARGO_CFG_TARGET_VENDOR" . "unknown") ; TODO: or pc?
  34. ("CARGO_CFG_TARGET_ENDIAN" . "little") ; TODO: big-endian
  35. ("CARGO_CFG_TARGET_ARCH" .
  36. ,(cond ((target-x86-64? target) "x86_64")
  37. ((target-aarch64? target) "aarch64")
  38. ((target-riscv64? target) "riscv64")
  39. (#true (unrecognised))))
  40. ("CARGO_CFG_TARGET_OS" .
  41. ,(cond ((target-linux? target) "linux")
  42. ((target-hurd? target) "hurd") ; TODO: or gnu?
  43. (#true (unrecognised))))
  44. ("CARGO_CFG_TARGET_FAMILY" .
  45. ,(cond ((target-linux? target) "unix")
  46. ((target-hurd? target) "unix") ; TODO: or gnu?
  47. (#true (unrecognised))))
  48. ("CARGO_CFG_TARGET_POINTER_WIDTH" .
  49. ,(cond ((target-64bit? target) "64")
  50. (#true "32")))
  51. ;; These CPU features are set by default, but antioxidant needs to know
  52. ;; these as well to set the appropriate environment variables expected by,
  53. ;; e.g., rust-sleef-sys. TODO: CPU tuning.
  54. ,@(if (target-x86-64? target)
  55. '(("CARGO_CFG_TARGET_FEATURE" . "sse,sse2"))
  56. '())))
  57. ;; TODO: move to antioxidant.scm
  58. (define generate-cbindgen-metadata-phase
  59. #~(lambda _
  60. ;; Generate the metadata as expected by cbindgen.
  61. ;; Not all fields are set, only the ones that seem to be required
  62. ;; are set and even then sometimes a dummy value suffices for now.
  63. (define package ((@@ (antioxidant) manifest-package) *manifest*))
  64. (define json-as-s-expression
  65. `(("packages" .
  66. #((("name" . ,((@@ (antioxidant) package-name) package))
  67. ("version" . ,((@@ (antioxidant) package-version) package))
  68. ("id" . "the package we are building")
  69. ("source" . null)
  70. ("dependencies" . #())
  71. ("targets" . #((("kind" . #("lib"))
  72. ("crate_types" . #("lib"))
  73. ("name" . ,((@@ (antioxidant) package-name) package))
  74. ("src_path" . "src/lib.rs")))) ; TODO not true in general but sufficient for now
  75. ("features")
  76. ("manifest_path" . ,(in-vicinity (getcwd) "Cargo.toml")))))
  77. ("workspace_members" . #("the package we are building"))
  78. ("target_directory" . ,(getcwd)) ; TODO investigate proper valu
  79. ("version" . ,1)
  80. ("workspace_root" . ,(getcwd))))
  81. (call-with-output-file ".cbindgen-metadata.json"
  82. ((@ (srfi srfi-26) cut)
  83. (@ (json builder) scm->json) json-as-s-expression <>
  84. #:pretty #true); #:pretty: might help with debugging and doesn't cost much
  85. #:encoding "UTF-8")
  86. (setenv "ANTIOXIDANT_CBINDGEN_METADATA" (in-vicinity (getcwd) ".cbindgen-metadata.json"))
  87. #;(copy-file #$(local-file "md.js") (getenv "ANTIOXIDANT_CBINDGEN_METADATA"))))
  88. (define %custom-phases
  89. ;; TODO home page is incorrect
  90. `(("rust-servo-fontconfig-sys"
  91. ,#~((add-after 'unpack 'unbundle
  92. (lambda _
  93. (for-each ((@ (srfi srfi-26) cut) delete-file-recursively <>)
  94. '("doc" "test" "src" "missing" "m4" "fonts.dtd" "fonts.conf.in"
  95. "fontconfig.spec" "fontconfig.spec.in" "fontconfig.pc.in"
  96. "fontconfig-zip.in" "fontconfig" "fc-validate"
  97. "fc-scan" "fc-query" "fc-pattern" "fc-match" "fc-list"
  98. "fc-lang" "fc-glyphname" "fc-cat" "fc-case"
  99. "depcomp" "configure.ac" "configure" "config.sub" "config.h.in"
  100. "config.guess" "config-fixups.h" "conf.d" "compile" "aclocal.m4"
  101. "Tools.mk" "Makefile.in"
  102. "README" "NEWS" "INSTALL" "ChangeLog" "AUTHORS" ; these are for freetype, not rust-servo-freetype-sys
  103. "COPYING" ; this is for freetype, not rust-servo-freetype-sys which is MPL
  104. ))))))
  105. ("rust-libgit2-sys" ; @0.12.25 bundles libgit2
  106. ,#~((add-after 'unpack 'unbundle-libgit2
  107. (lambda _
  108. (delete-file-recursively "libgit2"))))) ; TODO: move to snippet (see 56020)
  109. ("rust-mysqlclient-sys" ; the pkg-config file is named mariadb.pc, not mysqclient.pc
  110. ,#~((add-after 'unpack 'fix-pkg-config-use
  111. (lambda _
  112. (substitute* "build.rs"
  113. ;; the mariadb.pc uses -lz without adding an appropriate -L
  114. ;; (TODO). Using the libmariadb.pc instead seems to work.
  115. (("\"mysqlclient\"") "\"libmariadb\""))))))
  116. ("rust-libsqlite3-sys"
  117. ,#~((add-after 'unpack 'unbundle
  118. (lambda _
  119. (delete-file-recursively "sqlcipher")
  120. (delete-file-recursively "sqlite3")))))
  121. ("rust-mesalink" ,#~((delete 'bootstrap))) ; build.rs is sufficient
  122. ;; Make sure the headers will be installed in a proper location.
  123. ;; TODO: make sure dependencies actually find the result (newsboat-ffi).
  124. ;; TODO: set RUST_CXX_BUILD_OUTPUT in antioxidant.scm.
  125. ("rust-cxx-build"
  126. ,#~((add-after 'unpack 'avoid-scratch
  127. ;; not sure if .clone is required
  128. (lambda _
  129. (substitute* "src/target.rs"
  130. (("fn find_target_dir\\(out_dir: &Path) -> TargetDir \\{" line)
  131. (string-append line "
  132. let mut out = out_dir.to_path_buf().clone();
  133. out.push(\".debugging\");
  134. return TargetDir::Path(out);
  135. }
  136. fn _find_target_dir_unused(out_dir: &Path) -> TargetDir {"
  137. #;"return TargetDir::Path(out_dir.clone().push(\".debugging\"));}fn _find_target_dir_unused(out_dir: &Path) -> TargetDir {")))
  138. (substitute* "src/lib.rs"
  139. (("scratch::path\\(\"cxxbridge\"\\)")
  140. "panic!(\"rust-scratch is incompatible with the antioxidant compilation model without shenanigans, please set the output directory!\")")
  141. (("paths::out_dir\\(\\)\\?")
  142. "Path::new(&env::var_os(\"RUST_CXX_BUILD_OUTPUT\").expect(\"RUST_CXX_BUILD_OUTPUT should be set\")).to_path_buf()"))))))
  143. ("rust-cxx"
  144. ,#~((add-after 'unpack 'do-not-install-headers-in-/tmp
  145. (lambda _
  146. ;; By default, this header is located in the unpacked source
  147. ;; and rust-cxx will (when used by dependencies in their build.rs)
  148. ;; try to refer to that location, in /tmp/guix-build-rust-cxx...,
  149. ;; which cannot work, so properly install the header instead.
  150. (install-file "include/cxx.h"
  151. (string-append #$output "/include/rust-cxx"))
  152. (substitute* "build.rs"
  153. (("cxx_h.to_string_lossy\\(\\)")
  154. (string-append "\"" #$output "/include/rust-cxx/cxx.h\"")))))))
  155. ("rust-backtrace-sys"
  156. ,#~((add-after 'unpack 'break-cycle
  157. (lambda _
  158. ;; only needed for Android targets,
  159. ;; by removing it we avoid depending
  160. ;; on crate-cc, breaking a cycle
  161. (delete-file "build.rs")
  162. (substitute* "Cargo.toml"
  163. (("^build =(.*)$") ""))))))
  164. ("rust-blakeout"
  165. ,#~((add-after 'unpack 'update-blake2
  166. ;; Resolve build failure.
  167. ;; Submitted upstream at
  168. ;; <https://github.com/Revertron/Blakeout/pull/1>
  169. (lambda _
  170. (substitute* "src/lib.rs"
  171. (("use digest::Digest;") ; suggested by compiler
  172. "use digest::{Update,VariableOutput};")
  173. (("Blake2s") "Blake2sVar")
  174. (("Blake2sVar::default\\(\\)") "Blake2sVar::new(DEFAULT_HASH_SIZE).expect(\"incorrect output size\")")
  175. (("let buf = Digest::finalize\\(digest\\);")
  176. "digest.finalize_variable(slice).expect(\"incorrect output size\");")
  177. ((" slice.copy_from_slice\\(&buf\\[..\\]\\);") ""))))))
  178. ("rust-libssh2-sys"
  179. ;; Otherwise, build.rs fails to find libssh2, causing
  180. ;; a build failure.
  181. ,#~((add-after 'unpack 'find-ssh2
  182. (lambda _
  183. (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "don't use the bundled copy in the git submodule")))))
  184. ("rust-freetype-sys"
  185. ,#~((add-after 'unpack 'unbundle
  186. (lambda _ ; TODO: move to origin snippet (& upstream Guix?)
  187. (delete-file-recursively "freetype2")))))
  188. ("rust-ed25519-dalek"
  189. ;; TODO: upstream
  190. ,#~((add-after 'unpack 'fix-uses
  191. (lambda _
  192. (substitute* "src/secret.rs"
  193. (("use curve25519_dalek::digest::Digest;")
  194. "use curve25519_dalek::digest::{Digest,Update};")
  195. ;; Resolve the resulting ambiguity
  196. (("h\\.update\\(secret_key\\.as_bytes\\(\\)\\)")
  197. "Digest::update(&mut h, secret_key.as_bytes())")
  198. (("h\\.update\\(&self.nonce\\)")
  199. "Digest::update(&mut h, &self.nonce)")
  200. (("h\\.update\\(&message\\)")
  201. "Digest::update(&mut h, &self.nonce)")
  202. (("h\\.update\\(R\\.as_bytes\\(\\)\\)")
  203. "Digest::update(&mut h, R.as_bytes())")
  204. (("h\\.update\\(public_key\\.as_bytes\\(\\)\\)")
  205. "Digest::update(&mut h, public_key.as_bytes())"))))))
  206. ;; TODO: in upstream Guix, replace
  207. ;; (delete-file-recursively "jemalloc")
  208. ;; by (delete-file-recursively "rep")
  209. ;; TODO: why a static library?
  210. ("rust-jemalloc-sys"
  211. ,#~((add-after 'unpack 'unbundle
  212. (lambda _
  213. (delete-file-recursively "rep")))
  214. ;; keep upstream phase
  215. (add-before 'configure 'find-jemalloc
  216. (lambda* (#:key inputs #:allow-other-keys)
  217. (setenv "JEMALLOC_OVERRIDE"
  218. (search-input-file inputs "lib/libjemalloc.so.2"))))))
  219. ;; TODO: upstream / update
  220. ("rust-x509-parser"
  221. ,#~((add-after 'unpack 'use-nondeprecated
  222. (lambda _
  223. (substitute* "src/time.rs"
  224. (("use std::time::Duration;")
  225. "use std::time::Duration;use std::convert::TryInto;")
  226. (("\\.to_std\\(\\)") ".try_into()"))))))
  227. ;; Preserve this phase from (gnu packages crates-io)
  228. ("rust-pkg-config"
  229. ,#~((add-after 'unpack 'hardcode-pkg-config-loation
  230. (lambda* (#:key inputs #:allow-other-keys)
  231. (substitute* "src/lib.rs"
  232. (("\"pkg-config\"")
  233. (string-append "\"" (assoc-ref inputs "pkg-config")
  234. "/bin/pkg-config\"")))))))
  235. ;; TODO: Upstream/update
  236. ("rust-structopt-derive"
  237. ,#~((add-after 'unpack 'use-existing
  238. (lambda _
  239. (substitute* "src/attrs.rs"
  240. (("CamelCase, KebabCase, MixedCase, ShoutySnakeCase, SnakeCase")
  241. ;; ?? CamelCase, MixedCase
  242. "ToUpperCamelCase, ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase")
  243. (("to_camel_case") "to_upper_camel_case")
  244. (("to_mixed_case") "to_lower_camel_case"))))))
  245. ;; TODO: upstream
  246. ("rust-argh-derive"
  247. ,#~((add-after 'unpack 'new-heck-compatibility
  248. (lambda _
  249. (substitute* "src/lib.rs"
  250. (("heck::KebabCase::to_kebab_case") "heck::ToKebabCase::to_kebab_case"))))))
  251. ;; TODO: Upstream/update
  252. ("rust-cbindgen"
  253. ,#~((add-after 'unpack 'use-existing
  254. (lambda _
  255. (substitute* "src/bindgen/rename.rs"
  256. (("to_camel_case") "to_upper_camel_case")
  257. (("to_mixed_case") "to_lower_camel_case"))))))
  258. ;; TODO: update
  259. ("rust-glib-macros"
  260. ,#~((add-after 'unpack 'use-existing
  261. (lambda _
  262. (substitute* '("src/genum_derive.rs" "src/gflags_attribute.rs")
  263. (("CamelCase, KebabCase") "ToUpperCamelCase, ToKebabCase")
  264. (("to_camel_case") "to_upper_camel_case"))))))
  265. ;; TODO: add rust-peg-macros to native-inputs for
  266. ;; cross-compilation reasons.
  267. ;;
  268. ;; There appears to be a bootstrapping cycle here:
  269. ;; IIUC, rust-peg/rust-peg-macros accepts a PEG grammar.
  270. ;; This grammar is parsed & compiled into Rust code.
  271. ;; The parser (of the grammar of the PEG grammar) is
  272. ;; generated with rust-peg/rust-peg-macros.
  273. ;;
  274. ;; The solution to the cycle appears to be:
  275. ;;
  276. ;; * peg-macros ships a pre-generated parser
  277. ;; * the generated code is sufficiently short
  278. ;; for there not to be any opportunity for
  279. ;; hiding anything malicious
  280. ;; * peg (in its bootstrap.sh) regenerates
  281. ;; the parser and check that its a fixpoint.
  282. ("rust-peg"
  283. ,#~((replace 'bootstrap
  284. (lambda* (#:key native-inputs #:allow-other-keys)
  285. (with-output-to-file "new-grammar.rs"
  286. (lambda ()
  287. (invoke "rust-peg"
  288. (search-input-file native-inputs
  289. "share/rust-peg-macros/grammar.rustpeg"))))
  290. ;; TODO: the fixpoint test fails!
  291. #;(invoke "diff" "-s" "--ignore-space-change" "new-grammar.rs"
  292. (search-input-file native-inputs
  293. "share/rust-peg-macros/grammar.rs"))
  294. (delete-file "new-grammar.rs")))))
  295. ("rust-peg-macros"
  296. ,#~((add-after 'install 'install-grammar
  297. (lambda _
  298. (install-file "grammar.rustpeg" (string-append #$output "/share/rust-peg-macros"))
  299. (install-file "grammar.rs" (string-append #$output "/share/rust-peg-macros"))))))
  300. ("rust-chrono"
  301. ,#~((add-after 'unpack 'use-nondeprecated-names
  302. (lambda _
  303. ;; TODO: upstream
  304. (substitute* '("src/naive/date.rs" "src/naive/time.rs" "src/round.rs")
  305. (("num_days\\(\\)") "whole_days()")
  306. (("num_weeks\\(\\)") "whole_weeks()")
  307. (("num_seconds\\(\\)") "whole_seconds()")
  308. ;; XXX this is not exactly the same behaviour,
  309. ;; as a panic has been replaced by a truncation.
  310. (("rhs.num_nanoseconds\\(\\)\\.unwrap\\(\\)") "(rhs.whole_nanoseconds() as i64)")
  311. (("\\(rhs - OldDuration::seconds\\(rhssecs\\)\\)\\.num_nanoseconds\\(\\)\\.unwrap\\(\\)")
  312. "((rhs - OldDuration::seconds(rhssecs)).whole_nanoseconds() as i64)")
  313. (("duration\\.num_nanoseconds\\(\\)")
  314. "Some(duration.whole_nanoseconds() as i64)"))))))
  315. ("rust-arrow2"
  316. ;; TODO: upstream/update
  317. ,#~((add-after 'unpack 'use-nondeprecated-names
  318. (lambda _
  319. (substitute* "src/temporal_conversions.rs"
  320. (("\\bnum_days\\(\\)") "whole_days()"))))))
  321. ("rust-timer"
  322. ;; There's another patch available upstream:
  323. ;; <https://github.com/Yoric/timer.rs/pull/21>
  324. ;; but doesn't apply cleanly. Do something simpler
  325. ;; for now.
  326. ,#~((add-after 'unpack 'use-nondeprecated-names
  327. (lambda _
  328. (substitute* "src/lib.rs"
  329. (("\\bnum_seconds\\(\\)") "whole_seconds()")
  330. (("\\bnum_nanoseconds\\(\\)\\.unwrap\\(\\)") ; this replacement technically has different semantics, but in this context, the result is the same.
  331. "subsec_nanoseconds()"))))))
  332. ("rust-chrono-humanize"
  333. ;; TODO: upstream/update
  334. ,#~((add-after 'unpack 'use-new-names
  335. (lambda _
  336. ;; TODO: upstream
  337. (substitute* "src/humantime.rs"
  338. (("use crate::Humanize;") "use crate::Humanize; use std::convert::TryInto;")
  339. (("Duration::zero\\(\\)") "Duration::ZERO")
  340. (("num_days\\(\\)") "whole_days()")
  341. (("num_weeks\\(\\)") "whole_weeks()")
  342. (("num_hours\\(\\)") "whole_hours()")
  343. (("num_seconds\\(\\)") "whole_seconds()")
  344. (("num_nanoseconds\\(\\)\\.unwrap_or_default\\(\\)")
  345. "whole_nanoseconds().try_into().unwrap_or_default()")
  346. (("num_microseconds\\(\\)\\.unwrap_or_default\\(\\)")
  347. "whole_microseconds().try_into().unwrap_or_default()")
  348. (("num_minutes\\(\\)") "whole_minutes()")
  349. (("self\\.0\\.num_milliseconds\\(\\)")
  350. "self.0.whole_milliseconds().try_into().expect(\"milliseconds overflow\")")))))) ; TODO?
  351. ("rust-pkcs1"
  352. ,#~((add-after 'unpack 'fix-typing
  353. (lambda _
  354. ;; Already upstream: <https://github.com/RustCrypto/formats/blob/fbf4334be7717e1f393c3f7b9b4c85c584ce8395/pkcs1/src/lib.rs#L49>, but not yet in any release.
  355. (substitute* "src/lib.rs"
  356. (("ObjectIdentifier::new") "ObjectIdentifier::new_unwrap"))))))
  357. ("rust-markup5ever" ; for rust-markup5ever@0.9, not needed by newever versions
  358. ,#~((add-after 'unpack 'new-phf-compatibility
  359. (lambda _
  360. (substitute* "build.rs"
  361. (("phf_map\\.build\\(&mut file\\)\\.unwrap\\(\\)")
  362. "write!(&mut file, \"{}\", phf_map.build())"))))))
  363. ("rust-mio-extras"
  364. ,#~((add-after 'unpack 'mio@0.6.21-compatibility
  365. (lambda _
  366. (substitute* '("src/channel.rs" "src/timer.rs")
  367. (("::\\{Evented,") "::{event::Evented,"))))))
  368. ("rust-num-format" ;; TODO: upstream
  369. ,#~((add-after 'unpack 'rust-arrayvec@0.7-compatibility
  370. (lambda _
  371. (substitute* "src/strings.rs"
  372. (("ArrayString<\\[u8; \\$max_len\\]>")
  373. "ArrayString<$max_len>"))))))
  374. ;; TODO: change in Guix upstream.
  375. ;; TODO: adjust README.md? Make sure LICENSE-APACHE
  376. ;; is installed?
  377. ("rust-cmake"
  378. ,#~((add-after 'unpack 'absolute-cmake
  379. (lambda* (#:key inputs #:allow-other-keys)
  380. (substitute* "src/lib.rs"
  381. (("\"cmake\"") (format #f "\"~a\"" (search-input-file inputs "bin/cmake"))))))))
  382. ("rust-clang-sys"
  383. ;; TODO: are there some paths that need to be
  384. ;; absolutised?
  385. ,#~((add-after 'unpack 'set-libclang-path
  386. (lambda* (#:key inputs #:allow-other-keys)
  387. (setenv "LIBCLANG_PATH"
  388. (dirname (search-input-file inputs "lib/libclang.so")))))))
  389. ("rust-multipart"
  390. ,#~((add-after 'unpack 'remove-uncompilable-example
  391. (lambda _
  392. (delete-file "src/bin/read_file.rs")))))
  393. ("rust-cpp-demangle"
  394. ,#~((add-after 'unpack 'delete-bin
  395. (lambda _
  396. (delete-file "src/bin/afl_runner.rs")))))
  397. ("rust-tokio-sync"
  398. ,#~((add-after 'unpack 'unpreview
  399. (lambda _
  400. (substitute* "Cargo.toml"
  401. (("-preview\\]") "]"))))))
  402. ("dutree"
  403. ;; See <https://github.com/nachoparker/dutree/pull/40>
  404. ,#~((add-after 'unpack 'update-to-new-signal-hookversion
  405. (lambda _
  406. (substitute* "src/main.rs"
  407. (("signal_hook::register") "signal_hook::low_level::register"))
  408. (substitute* "src/main.rs"
  409. (("signal_hook::SIGPIPE") "signal_hook::consts::signal::SIGPIPE"))))))
  410. ("rust-tectonic-bridge-core"
  411. ;; Required to invoke 'cbindgen' later.
  412. ,#~((add-after 'load-manifest 'generate-cbindgen-metadata
  413. #$generate-cbindgen-metadata-phase)
  414. ;; Build a generated file from source, using the instructions
  415. ;; mentioned in the README.
  416. (add-after 'generate-cbindgen-metadata-phase 'regenerate-cbindgen-things
  417. (lambda _
  418. (delete-file "support/tectonic_bridge_core_generated.h")
  419. (invoke "cbindgen" "--output" "support/tectonic_bridge_core_generated.h")))
  420. ;; Actually install the headers somewhere where they can be found
  421. ;; by dependencies.
  422. (add-after 'unpack 'fixup-headers-locations
  423. (lambda _
  424. (substitute* "build.rs"
  425. (("main_header_src\\.display\\(\\)")
  426. (string-append "\"" #$output "/include\""))
  427. (("env::var\\(\"OUT_DIR\"\\).unwrap\\(\\)") ; TODO: maybe set OUT_DIR to somewhere in the store, then this wouldn't be necessary
  428. (string-append "\"" #$output "/include\"")))))
  429. (add-after 'install 'install-header
  430. (lambda _
  431. (install-file "support/tectonic_bridge_core_generated.h"
  432. (string-append #$output "/include"))
  433. (install-file "support/tectonic_bridge_core.h"
  434. (string-append #$output "/include"))))))
  435. ("rust-tectonic-bridge-flate"
  436. ;; required to make rust-cbindgen produce building C code.
  437. ,#~((add-after 'load-manifest 'generate-cbindgen-metadata
  438. #$generate-cbindgen-metadata-phase)
  439. (add-after 'unpack 'fixup-headers-locations ; see rust-tectonic-bridge-core
  440. (lambda _
  441. (substitute* "build.rs"
  442. (("env::var\\(\"OUT_DIR\"\\).unwrap\\(\\)") ; TODO: maybe set OUT_DIR to somewhere in the store, then this wouldn't be necessary
  443. (string-append "\"" #$output "/include\"")))))))
  444. ("rust-tectonic-pdf-io"
  445. ;; Put headers somewhere where they can be found by dependencies.
  446. ,#~((add-after 'unpack 'fixup-headers-location
  447. (lambda _
  448. (copy-recursively "pdf_io" (in-vicinity #$output "include"))
  449. (for-each delete-file (find-files (in-vicinity #$output "include")
  450. "\\.c$"))
  451. (substitute* "build.rs"
  452. (("main_header_src\\.display\\(\\)")
  453. (object->string (in-vicinity #$output "include"))))))))
  454. ("rust-tectonic-xetex-layout"
  455. ;; Put headers somewhere where they can be found by dependencies.
  456. ;; TODO: OUT_DIR.
  457. ,#~((add-after 'unpack 'fixup-headers-location
  458. (lambda _
  459. (define destination (in-vicinity #$output "include"))
  460. (mkdir-p destination)
  461. (substitute* "build.rs"
  462. (("\\benv::var\\(\"OUT_DIR\"\\)\\.unwrap\\(\\)")
  463. (object->string destination)))))))
  464. ("rust-tectonic-engine-xetex"
  465. ,#~((add-after 'unpack 'find-fontconfig ; TODO: what causes <fontconfig/fontconfig.h> not to be found even though it is in C_INCLUDE_PATH?
  466. (lambda* (#:key inputs #:allow-other-keys)
  467. (substitute* "xetex/xetex-core.h"
  468. (("\\bfontconfig/fontconfig\\.h\\b")
  469. (search-input-file inputs "include/fontconfig/fontconfig.h"))
  470. (("<harfbuzz\\b") ; XXX: -I points to subdirectory yet parent directory is used
  471. (string-append
  472. "<"
  473. (search-input-directory inputs "include/harfbuzz"))))))))
  474. ("rust-tectonic-engine-bibtex"
  475. ;; required to use rust-cbindgen.
  476. ,#~((add-after 'load-manifest 'generate-cbindgen-metadata
  477. #$generate-cbindgen-metadata-phase)))
  478. ("rust-tectonic-engine-xdvipdfmx"
  479. ;; required to use rust-cbindgen.
  480. ,#~((add-after 'load-manifest 'generate-cbindgen-metadata
  481. #$generate-cbindgen-metadata-phase)))
  482. ("tectonic" ; TODO: binary is compiled thrice
  483. ;; TODO: bug in implementation in 'autobins'?
  484. ,#~((add-after 'unpack 'fix-found-binaries
  485. (lambda _
  486. (substitute* "Cargo.toml"
  487. (("^(repository = .*)$" line)
  488. (string-append line "autobins = false\n[[bin]]\nname = \"tectonic\"\npath=\"src/bin/tectonic/main.rs\"\n")))))))
  489. ;; TODO: likewise
  490. ("bat"
  491. ;; TODO: bug in implementation in 'autobins'?
  492. ,#~((add-after 'unpack 'fix-found-binaries
  493. (lambda _
  494. (substitute* "Cargo.toml"
  495. (("^(repository = .*)$" line)
  496. (string-append line "autobins = false\n[[bin]]\nname = \"bat\"\npath=\"src/bin/bat/main.rs\"\n")))))))
  497. ("rust-tuikit"
  498. ;; TODO: upstream
  499. ,#~((add-after 'unpack 'fix-unresolved+deprecated
  500. (lambda _
  501. (substitute* "src/raw.rs"
  502. (("use nix::Error::Sys;") "")
  503. (("match err \\{") "{")
  504. (("nix::Error::from_errno\\(ENOTTY\\)") "ENOTTY")
  505. (("Sys\\((.*)") "err.into()")
  506. (("_ => (.*)$") ""))))))
  507. ;; 'cc' and 'c++' don't exist
  508. ("rust-gcc"
  509. ,#~((add-after 'unpack 'fix-cc
  510. (lambda _
  511. (substitute* "src/lib.rs"
  512. (("\"cc\"") "\"gcc\"")
  513. (("\"c++\"") "\"g++\""))))))
  514. ("rust-dashmap"
  515. ,#~((add-after 'unpack 'unstable-rust
  516. ;; Required to use std::thread::available_parallelism
  517. (lambda _
  518. (setenv "RUSTC_BOOTSTRAP" "1")
  519. (substitute* "src/lib.rs"
  520. (("#!\\[allow\\(clippy::type_complexity\\)]" line)
  521. (string-append "#![feature(available_parallelism)]\n" line)))))))
  522. ("rust-nu-protocol"
  523. ,#~((add-after 'unpack 'new-chrono-compatibility
  524. (lambda _
  525. ;; TODO: upstream
  526. (substitute* "src/value/primitive.rs"
  527. (("&chrono::Duration::nanoseconds")
  528. "chrono::Duration::nanoseconds")
  529. (("&chrono::Duration::seconds")
  530. "chrono::Duration::seconds")
  531. (("\\bnum_seconds\\(\\)") "whole_seconds()")
  532. (("\\bnum_nanoseconds\\(\\)") "whole_nanoseconds()") ; technically has a different semantics but in this context the result is the same
  533. (("\\.expect\\(\"Unexpected overflow\"\\) as u32") "as u32"))))))
  534. ("rust-cc"
  535. ,#~((add-after 'unpack 'fix-cc
  536. (lambda _
  537. (substitute* "src/lib.rs"
  538. (("\"cc\"") "\"gcc\"")
  539. (("\"c++\"") "\"g++\""))))))))
  540. (define (custom-phases name)
  541. (define (drop-version name)
  542. (let ((name _ (package-name->name+version name #\-)))
  543. name))
  544. (let ((name
  545. (match name
  546. ((? (cut string-prefix? "antioxidated-" <>) name)
  547. (drop-version (string-drop name (string-length "antioxidated-"))))
  548. ;; name+version is confused by the -alpha suffix
  549. ((? (cut string-prefix? "rust-tokio-sync-0.2.0-alpha" <>) name)
  550. "rust-tokio-sync")
  551. ;; likewise
  552. ((? (cut string-prefix? "rust-mesalink-1.1.0-cratesio" <>) name)
  553. "rust-mesalink")
  554. (_ (drop-version name)))))
  555. (match (assoc name %custom-phases)
  556. ((_ phases) phases)
  557. (#false #~()))))
  558. (define* (antioxidant-build name inputs #:key
  559. (phases #~%standard-antioxidant-phases)
  560. (rust-dynamic-library-arguments #false)
  561. modules ; what to do about 'modules'
  562. install-source? ; not used by antioxidant-build-system
  563. system target source search-paths outputs
  564. (rust-metadata "")
  565. ;; TODO: consider optimisations (what does cargo-build-system
  566. ;; do?)
  567. (optimisation-level 0)
  568. (features #~'("default"))
  569. (cargo-target-directory #false)
  570. (rust-crate-type #false)
  571. (cargo-env-variables
  572. #~'#$(target-environment-variables
  573. (or target
  574. (nix-system->gnu-triplet system)))))
  575. (define builder
  576. (with-extensions (list guile-json-4)
  577. (with-imported-modules
  578. (cons '(antioxidant)
  579. (source-module-closure '((guix build utils) (guix build gnu-build-system)
  580. (antioxidant))))
  581. #~(begin
  582. (use-modules (guix build utils) (guix build gnu-build-system)
  583. (srfi srfi-1) (ice-9 match) (antioxidant))
  584. (gnu-build #:name #$name
  585. #:source #+source
  586. #:system #+(nix-system->gnu-triplet system)
  587. #:build #+(nix-system->gnu-triplet system)
  588. ;; used even when building natively
  589. #:target #$(or target
  590. (nix-system->gnu-triplet system))
  591. #:outputs #$(outputs->gexp outputs)
  592. #:inputs #$(input-tuples->gexp inputs)
  593. #:native-inputs #$(input-tuples->gexp inputs)
  594. #:search-paths '#$(map search-path-specification->sexp
  595. search-paths)
  596. #:features #$features
  597. #:optimisation-level '#$optimisation-level
  598. #:cargo-env-variables #$cargo-env-variables
  599. #:cargo-target-directory #$cargo-target-directory ; <-- TODO: unused, maybe remove?
  600. #:rust-crate-type #$rust-crate-type
  601. #:rust-metadata #$rust-metadata
  602. #:rust-dynamic-library-arguments #$rust-dynamic-library-arguments
  603. #:strip-binaries? #false ; TODO exported symbols are removed
  604. #:phases (modify-phases #$phases
  605. #$@(custom-phases name)))))))
  606. ;; TODO graft stuff, package->derivation guile-for-build
  607. (gexp->derivation name builder #:system system #:target target #:graft? #f))
  608. (define* (lower name #:key system source inputs native-inputs outputs target
  609. (features #~'("default"))
  610. (rust-metadata #~"")
  611. #:allow-other-keys
  612. #:rest arguments)
  613. (define private-keywords
  614. '(#:inputs #:native-inputs #:outputs))
  615. (bag
  616. (name name)
  617. (system system)
  618. (target target)
  619. (build-inputs `(("source" ,source)
  620. ("rust" ,rust)
  621. ("python" ,python)
  622. ("python-toml" ,python-toml) ; for convert-toml->json
  623. ;; CARGO_PKG_AUTHORS can contain non-ASCII characters,
  624. ;; make sure 'setenv' won't fail by including glibc
  625. ;; and glibc-utf8-locales
  626. ,@(@ (gnu packages commencement) %final-inputs)
  627. ,@native-inputs))
  628. (host-inputs inputs)
  629. (build (if target antioxidant-cross-build antioxidant-build))
  630. (arguments (strip-keyword-arguments private-keywords arguments))))
  631. (define-public antioxidant-build-system
  632. (build-system
  633. (name 'antioxidant)
  634. (description "Build software written in Rust, without cargo")
  635. (lower lower)))
  636. ;; Convert from cargo-build-system to antioxidant-build-system,
  637. ;; for now leaving inputs intact.
  638. (define*-public (vitaminate-library/no-inputs crate-package
  639. #:key (features #~'("default")))
  640. (package
  641. (inherit crate-package)
  642. (build-system antioxidant-build-system)
  643. (arguments (list #:features features))))
  644. (define (is-cargo-toml-phases? phases)
  645. ;; This probably just relaxes versions, so no need to keep this phase
  646. ;; anymore.
  647. (match (if (gexp? phases) (gexp->approximate-sexp phases) phases)
  648. (('modify-phases '%standard-phases _
  649. (_ _ _ (_ _ ('substitute* "Cargo.toml" . _))))
  650. #t)
  651. (_ #false)))
  652. (define-syntax p
  653. (syntax-rules ()
  654. ((_ foo) (@ (gnu packages crates-io) foo))))
  655. (use-modules (guix download))
  656. (define crate-uri (@ (guix build-system cargo) crate-uri))
  657. (define* (package-with-rust-features base new-features #:key (name (package-name base))
  658. (rust-metadata #false))
  659. "Return a variant of BASE with name NAME build with the features FEATURES.
  660. To distinguish this variant from other variants, RUST-METADATA can be set to
  661. an unique string, which can be useful for resolving symbol conflicts. By default,
  662. the metadata will be set based on the major version (or the minor version, if the major
  663. version is 0), if it is in %automatic-metadata.."
  664. (package
  665. (inherit base)
  666. (name name)
  667. (arguments
  668. (ensure-keyword-arguments
  669. (package-arguments base)
  670. (list #:features new-features #:rust-metadata rust-metadata)))))
  671. ;; Use an updated set of rust-futures-... crates to avoid build failures
  672. ;; caused by uses of unstable rust things. (and because they will need to
  673. ;; be updated anyway eventually). TODO: verify for malware?
  674. (define rust-futures-0.3
  675. (package
  676. (inherit (@ (gnu packages crates-io) rust-futures-0.3))
  677. (name "rust-futures")
  678. (version "0.3.21")
  679. (source
  680. (origin
  681. (method url-fetch)
  682. (uri (crate-uri "futures" version))
  683. (file-name (string-append name "-" version ".tar.gz"))
  684. (sha256
  685. (base32 "17id2zvn2acny759indn6yj2acfa6lhkwzaidxr2pqfiaigycgzp"))))
  686. (arguments
  687. `(#:cargo-inputs
  688. (("rust-futures-core" ,rust-futures-core-0.3)
  689. ("rust-futures-channel" ,rust-futures-channel-0.3)
  690. ("rust-futures-io" ,rust-futures-io-0.3)
  691. ("rust-futures-sink" ,rust-futures-sink-0.3)
  692. ("rust-futures-executor" ,rust-futures-executor-0.3)
  693. ("rust-futures-util" ,rust-futures-util-0.3))))))
  694. (define rust-futures-task-0.3
  695. (package
  696. (inherit (@ (gnu packages crates-io) rust-futures-task-0.3))
  697. (version "0.3.21")
  698. (source
  699. (origin
  700. (method (@ (guix download) url-fetch))
  701. (uri ((@ (guix build-system cargo) crate-uri) "futures-task" "0.3.21"))
  702. (file-name (string-append "rust-futures-task" "-" "0.3.21" ".tar.gz"))
  703. (sha256
  704. (base32 "0skpiz2ljisywajv79p70yapfwhkqhb39wxy3f09v47mdfbnmijp"))))))
  705. (define rust-futures-util-0.3
  706. (package
  707. (inherit (@ (gnu packages crates-io) rust-futures-util-0.3))
  708. (version "0.3.21")
  709. (source
  710. (origin
  711. (method (@ (guix download) url-fetch))
  712. (uri ((@ (guix build-system cargo) crate-uri) "futures-util" "0.3.21"))
  713. (file-name (string-append "rust-futures-util" "-" "0.3.21" ".tar.gz"))
  714. (sha256
  715. (base32 "0sh3wqi8p36csjffy0irq8nlx9shqxp7z4dsih6bknarsvaspdyq"))))
  716. (arguments
  717. ;; TODO: upstream includes rust-futures
  718. `(#:cargo-inputs
  719. (("rust-futures-core" ,rust-futures-core-0.3)
  720. ("rust-futures-task" ,rust-futures-task-0.3)
  721. ("rust-futures-macro" ,rust-futures-macro-0.3)
  722. ("rust-futures-sink" ,rust-futures-sink-0.3)
  723. ("rust-futures-io" ,rust-futures-io-0.3)
  724. ("rust-futures-channel" ,rust-futures-channel-0.3)
  725. ("rust-memchr" ,(p rust-memchr-2))
  726. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))
  727. ("rust-pin-utils" ,(p rust-pin-utils-0.1))
  728. ("rust-slab" ,(p rust-slab-0.4)))))))
  729. (define rust-futures-channel-0.3
  730. (package
  731. (inherit (@ (gnu packages crates-io) rust-futures-channel-0.3))
  732. (version "0.3.21")
  733. (source
  734. (origin
  735. (method (@ (guix download) url-fetch))
  736. (uri ((@ (guix build-system cargo) crate-uri) "futures-channel" "0.3.21"))
  737. (file-name (string-append "rust-futures-channel" "-" "0.3.21" ".tar.gz"))
  738. (sha256
  739. (base32 "0420lz2fmxa356ax1rp2sqi7b27ykfhvq4w9f1sla4hlp7j3q263"))))))
  740. (define rust-futures-core-0.3
  741. (package
  742. (inherit (@ (gnu packages crates-io) rust-futures-core-0.3))
  743. (version "0.3.21")
  744. (source
  745. (origin
  746. (method (@ (guix download) url-fetch))
  747. (uri ((@ (guix build-system cargo) crate-uri) "futures-core" "0.3.21"))
  748. (file-name (string-append "rust-futures-core" "-" "0.3.21" ".tar.gz"))
  749. (sha256
  750. (base32 "1lqhc6mqklh5bmkpr77p42lqwjj8gaskk5ba2p3kl1z4nw2gs28c"))))))
  751. (define rust-futures-sink-0.3
  752. (package
  753. (inherit (@ (gnu packages crates-io) rust-futures-sink-0.3))
  754. (version "0.3.21")
  755. (source
  756. (origin
  757. (method (@ (guix download) url-fetch))
  758. (uri ((@ (guix build-system cargo) crate-uri) "futures-sink" "0.3.21"))
  759. (file-name (string-append "rust-futures-sink" "-" "0.3.21" ".tar.gz"))
  760. (sha256
  761. (base32 "0s58gx5yw1a21xviw2qgc0wzk225vgn4kbzddrp141m3kw9kw5i1"))))))
  762. (define rust-futures-io-0.3
  763. (package
  764. (inherit (@ (gnu packages crates-io) rust-futures-io-0.3))
  765. (version "0.3.21")
  766. (source
  767. (origin
  768. (method (@ (guix download) url-fetch))
  769. (uri ((@ (guix build-system cargo) crate-uri) "futures-io" "0.3.21"))
  770. (file-name (string-append "rust-futures-io" "-" "0.3.21" ".tar.gz"))
  771. (sha256
  772. (base32 "0swn29fysas36ikk5aw55104fi98117amvgxw9g96pjs5ab4ah7w"))))))
  773. (define rust-futures-macro-0.3
  774. (package
  775. (inherit (@ (gnu packages crates-io) rust-futures-macro-0.3))
  776. (version "0.3.21")
  777. (source
  778. (origin
  779. (method (@ (guix download) url-fetch))
  780. (uri ((@ (guix build-system cargo) crate-uri) "futures-macro" "0.3.21"))
  781. (file-name (string-append "rust-futures-macro" "-" "0.3.21" ".tar.gz"))
  782. (sha256
  783. (base32 "04pmj5xfk5rdhlj69wc7w3zvdg3xardg8srig96lszrk00wf3h9k"))))))
  784. (define rust-futures-executor-0.3
  785. (package
  786. (inherit (@ (gnu packages crates-io) rust-futures-executor-0.3))
  787. (version "0.3.21")
  788. (source
  789. (origin
  790. (method (@ (guix download) url-fetch))
  791. (uri ((@ (guix build-system cargo) crate-uri) "futures-executor" "0.3.21"))
  792. (file-name (string-append "rust-futures-executor" "-" "0.3.21" ".tar.gz"))
  793. (sha256
  794. (base32 "19mq96kwgf06axgdc2fbrjhqzdnxww9vw6cz8b82gqr9z86bj84l"))))))
  795. (define-public rust-futures-intrusive
  796. (package
  797. (inherit (p rust-futures-intrusive-0.3)) ; 0.3 doesn't build because of a type error
  798. (name "rust-futures-intrusive")
  799. (version "0.4.0")
  800. (source
  801. (origin
  802. (method url-fetch)
  803. (uri (crate-uri "futures-intrusive" version))
  804. (file-name (string-append name "-" version ".tar.gz"))
  805. (sha256
  806. (base32 "0gmnn86ifc2ngmwf3mpiw00kmxm8m2wxxxqnchmpraj6mj97a032"))))))
  807. (define rust-atomic-take ; required by new rust-watchexec
  808. (package
  809. (name "rust-atomic-take")
  810. (version "1.0.0")
  811. (source (origin
  812. (method url-fetch)
  813. (uri (crate-uri "atomic-take" version))
  814. (file-name (string-append name "-" version ".tar.gz"))
  815. (sha256
  816. (base32
  817. "0zmn2pay3p94kcg9b8qz2kd26flzchlg1lcq685sixjznd7mxxpr"))))
  818. (build-system (@ (guix build-system cargo) cargo-build-system))
  819. (arguments
  820. `(#:cargo-development-inputs (("rust-futures" ,rust-futures-0.3))))
  821. (home-page "https://github.com/Darksonn/atomic-take")
  822. (synopsis "Atomically take a value out of a container once.")
  823. (description "Atomically take a value out of a container once.")
  824. (license license:expat)))
  825. (define rust-mio ; new rust-tokio is incompatible with rust-mio@0.8.0
  826. (package
  827. (inherit (p rust-mio-0.8))
  828. (name "rust-mio")
  829. (version "0.8.3")
  830. (source
  831. (origin
  832. (method url-fetch)
  833. (uri (crate-uri "mio" version))
  834. (file-name (string-append name "-" version ".tar.gz"))
  835. (sha256
  836. (base32 "168pqd9v7llhhal1jy5l1k0k8qp0g8hsddv6w1s93n24kc6magbi"))))))
  837. (define rust-signal-hook-mio ; @0.2.1 doesn't suppport rust-mio@0.8
  838. (package
  839. (inherit (p rust-signal-hook-mio-0.2))
  840. (name "rust-signal-hook-mio")
  841. (version "0.2.3")
  842. (source (origin
  843. (method url-fetch)
  844. (uri (crate-uri "signal-hook-mio" version))
  845. (file-name (string-append name "-" version ".tar.gz"))
  846. (sha256
  847. (base32
  848. "1bwrrbd0lhwzlf63708vyzlh20693s5bg5s0ak6adjbyycajxb99"))))))
  849. ;; The old tokio doesn't build against recent rust-futures
  850. #; ; currently removed
  851. (define rust-tokio-io-0.2
  852. (package
  853. (inherit (@ (gnu packages crates-io) rust-tokio-io-0.1))
  854. (version "0.2.0-alpha.6")
  855. (source
  856. (origin
  857. (method (@ (guix download) url-fetch))
  858. (uri ((@ (guix build-system cargo) crate-uri) "tokio-io" version))
  859. (file-name (string-append "rust-tokio-io" "-" version ".tar.gz"))
  860. (sha256
  861. (base32 "1i92ichh2m7i23vdr51gnf5hxngv7d1clwjan1h0dwrxakaq89qi"))))))
  862. (define rust-tokio-codec-0.2
  863. (package
  864. (inherit (@ (gnu packages crates-io) rust-tokio-codec-0.1))
  865. (version "0.2.0-alpha.6")
  866. (source
  867. (origin
  868. (method (@ (guix download) url-fetch))
  869. (uri ((@ (guix build-system cargo) crate-uri) "tokio-codec" version))
  870. (file-name (string-append "rust-tokio-codec" "-" version ".tar.gz"))
  871. (sha256
  872. (base32 "0ykqx22rmw0k49y5302wshsaxjnpnwf4j4w8s92l1gc43vyj4pcz"))))))
  873. (define rust-tokio-util-0.7
  874. (package
  875. (inherit (@ (gnu packages crates-io) rust-tokio-util-0.6))
  876. (version "0.7.1")
  877. (source
  878. (origin
  879. (method (@ (guix download) url-fetch))
  880. (uri ((@ (guix build-system cargo) crate-uri) "tokio-util" version))
  881. (file-name (string-append "rust-tokio-util" "-" version ".tar.gz"))
  882. (sha256
  883. (base32 "0r0p83nisf732qydg23qvmdd6gbrvyr1qvfs8hhbl7a1cyqdxpqf"))))))
  884. (define rust-tokio-postgres ; @0.7.2 doesn't build against new rust-phf
  885. (package
  886. (inherit (p rust-tokio-postgres-0.7))
  887. (name "rust-tokio-postgres")
  888. (version "0.7.6")
  889. (source (origin
  890. (method url-fetch)
  891. (uri (crate-uri "tokio-postgres" version))
  892. (file-name (string-append name "-" version ".tar.gz"))
  893. (sha256
  894. (base32
  895. "1bn8f466n1s5q674hr7yq7fybiszpa7v73yjxk4jsp9wl93qmj0r"))))))
  896. ;; Old combinations of rust-rustls & rust-tokio-rustls fail to build
  897. (define rust-rustls-0.20
  898. (package
  899. (inherit (@ (gnu packages crates-io) rust-rustls-0.20))
  900. (name "rust-rustls")
  901. (version "0.20.4")
  902. (source
  903. (origin
  904. (method url-fetch)
  905. (uri (crate-uri "rustls" version))
  906. (file-name (string-append name "-" version ".tar.gz"))
  907. (sha256
  908. (base32 "08b941jj4kk1bfg82zrr5b2ifa4ip155g9cpqmmp116v1n6ypgsg"))))))
  909. (define rust-rust-decimal ; @1.14.3 incompatible with new rust-arrayvec
  910. (package
  911. (inherit (p rust-rust-decimal-1))
  912. (name "rust-rust-decimal")
  913. (version "1.25.0")
  914. (source (origin
  915. (method url-fetch)
  916. (uri (crate-uri "rust-decimal" version))
  917. (file-name (string-append name "-" version ".tar.gz"))
  918. (sha256
  919. (base32
  920. "0z78vwr4apw2h8c6iijv8xvvsvjq9c87ky8v36mz2cskx1cbp8rl"))))))
  921. (define rust-tokio-rustls-0.23
  922. (package
  923. (inherit (@ (gnu packages crates-io) rust-tokio-rustls-0.22))
  924. (name "rust-tokio-rustls")
  925. (version "0.23.3")
  926. (source
  927. (origin
  928. (method url-fetch)
  929. (uri (crate-uri "tokio-rustls" version))
  930. (file-name (string-append name "-" version ".tar.gz"))
  931. (sha256
  932. (base32 "17iqy9a8x0d8ydl5r28w8z9akhnwp74wyjxks055b617ryhgsla1"))))))
  933. (define rust-tokio ; old tokio doesn't build against new rust-mio
  934. (package
  935. (inherit (p rust-tokio-1))
  936. (name "rust-tokio")
  937. (version "1.18.2")
  938. (source
  939. (origin
  940. (method url-fetch)
  941. (uri (crate-uri "tokio" version))
  942. (file-name (string-append name "-" version ".tar.gz"))
  943. (sha256
  944. (base32 "158klcakw40y37kgbafg9z1y12vgflh35ad6bbfxss6g4w2by0s9"))))))
  945. ;; rust-tokio-util needs a slab with 'compact'
  946. (define rust-slab
  947. (package
  948. (inherit (@ (gnu packages crates-io) rust-slab-0.4))
  949. (name "rust-slab")
  950. (version "0.4.6")
  951. (source
  952. (origin
  953. (method url-fetch)
  954. (uri (crate-uri "slab" version))
  955. (file-name (string-append name "-" version ".tar.gz"))
  956. (sha256
  957. (base32 "0cmvcy9ppsh3dz8mi6jljx7bxyknvgpas4aid2ayxk1vjpz3qw7b"))))))
  958. (define rust-hyper-rustls
  959. (package
  960. (inherit (@ (gnu packages crates-io) rust-hyper-rustls-0.22))
  961. (name "rust-hyper-rustls")
  962. (version "0.23.0")
  963. (source
  964. (origin
  965. (method url-fetch)
  966. (uri (crate-uri "hyper-rustls" version))
  967. (file-name (string-append name "-" version ".tar.gz"))
  968. (sha256
  969. (base32 "1b2wi75qrmwfpw3pqwcg1xjndl4z0aris15296wf7i8d5v04hz6q"))))
  970. (inputs (modify-inputs (package-inputs (p rust-hyper-rustls-0.22))
  971. (prepend (p rust-http-0.2))))))
  972. (define rust-http ; new rust-actix-http doesn't compile against old rust-http
  973. (package
  974. (inherit (p rust-http-0.2))
  975. (name "rust-http")
  976. (version "0.2.7")
  977. (source
  978. (origin
  979. (method url-fetch)
  980. (uri (crate-uri "http" version))
  981. (file-name (string-append name "-" version ".tar.gz"))
  982. (sha256
  983. (base32 "1fxzyvspr6g8znc6i0kif0bhpih8ibhy7xc6k984j8pm19bp11pz"))))))
  984. ;; Old versions don't support the new rustls
  985. (define rust-boxxy
  986. (package
  987. (inherit (@ (gnu packages crates-io) rust-boxxy-0.11))
  988. (name "rust-boxxy")
  989. (version "0.12.1")
  990. (source
  991. (origin
  992. (method url-fetch)
  993. (uri (crate-uri "boxxy" version))
  994. (file-name (string-append name "-" version ".tar.gz"))
  995. (sha256
  996. (base32 "1q0wpz955y3iwd35bqk3pbx2vx904fhyj75j7d6mrb7ib5fs5kxg"))))))
  997. ;; Old versions don't support the new nom
  998. (define rust-pktparse
  999. (package
  1000. (inherit (@ (gnu packages crates-io) rust-pktparse-0.5))
  1001. (name "rust-pktparse")
  1002. (version "0.7.1")
  1003. (source
  1004. (origin
  1005. (method url-fetch)
  1006. (uri (crate-uri "pktparse" version))
  1007. (file-name (string-append name "-" version ".tar.gz"))
  1008. (sha256
  1009. (base32 "06sy7lwnhwmkyqfdbi4cs11z55rihipxafbdspnd5zg76pnbgbm8"))))))
  1010. ;; Old versions don't support the new nom
  1011. (define rust-pure-rust-locales
  1012. (package
  1013. (inherit (@ (gnu packages crates-io) rust-pure-rust-locales-0.5))
  1014. (name "rust-pure-rust-locales")
  1015. (version "0.5.6")
  1016. (source
  1017. (origin
  1018. (method url-fetch)
  1019. (uri (crate-uri "pure-rust-locales" version))
  1020. (file-name (string-append name "-" version ".tar.gz"))
  1021. (sha256
  1022. (base32 "1n1jqy8g7ph9lvzncc8vy5jaqq2dljryp1agcnp5pwwi9zy4jp5l"))))))
  1023. ;; Old version doesn't build
  1024. (define sniffglue
  1025. (package
  1026. (inherit (@ (gnu packages rust-apps) sniffglue))
  1027. (name "sniffglue")
  1028. (version "0.15.0")
  1029. (source
  1030. (origin
  1031. (method url-fetch)
  1032. (uri (crate-uri "sniffglue" version))
  1033. (file-name (string-append name "-" version ".tar.gz"))
  1034. (sha256
  1035. (base32 "038wcjiiay825wc8inmn62flklc1adxskg5fmjhmxqnhwmj1k5gn"))))))
  1036. ;; old rust-test-case@1 is incompatible with new rust-syn
  1037. (define rust-test-case-2
  1038. (package
  1039. (inherit (@ (gnu packages crates-io) rust-test-case-1))
  1040. (name "rust-test-case")
  1041. (version "2.0.2")
  1042. (source
  1043. (origin
  1044. (method url-fetch)
  1045. (uri (crate-uri "test-case" version))
  1046. (file-name (string-append name "-" version ".tar.gz"))
  1047. (sha256
  1048. (base32 "07xgb68pfwb9j132wr3b78kzcbfapsy4scg8lipiv5ykk6d5hi33"))))
  1049. (arguments
  1050. `(#:cargo-inputs
  1051. (("rust-cfg-if" ,(p rust-cfg-if-1))
  1052. ("rust-proc-macro-error" ,(p rust-proc-macro-error-1))
  1053. ("rust-proc-macro2" ,(p rust-proc-macro2-1))
  1054. ("rust-quote" ,(p rust-quote-1))
  1055. ("rust-syn" ,(p rust-syn-1)))
  1056. #:cargo-development-inputs
  1057. (("rust-indexmap" ,(p rust-indexmap-1))
  1058. ("rust-insta" ,(p rust-insta-1))
  1059. ("rust-itertools" ,(p rust-itertools-0.10))
  1060. ("rust-lazy-static" ,(p rust-lazy-static-1)))))))
  1061. ;; needed for rcgen
  1062. (define rust-yasna
  1063. (package
  1064. (name "rust-yasna")
  1065. (version "0.5.0")
  1066. (source
  1067. (origin
  1068. (method url-fetch)
  1069. (uri (crate-uri "yasna" version))
  1070. (file-name (string-append name "-" version ".tar.gz"))
  1071. (sha256
  1072. (base32 "0k1gk11hq4rwlppv9f50bz8bnmgr73r66idpp7rybly96si38v9l"))))
  1073. (build-system (@ (guix build-system cargo) cargo-build-system))
  1074. (arguments
  1075. `(#:cargo-inputs
  1076. (("rust-bit-vec" ,(@ (gnu packages crates-io) rust-bit-vec-0.6))
  1077. ("rust-num-bigint" ,(@ (gnu packages crates-io) rust-num-bigint-0.4))
  1078. ("rust-time" ,(@ (gnu packages crates-io) rust-time-0.3)))
  1079. #:cargo-development-inputs
  1080. (("rust-num-traits" ,(@ (gnu packages crates-io) rust-num-traits-0.2)))))
  1081. (home-page "https://github.com/qnighy/yasna.rs")
  1082. (synopsis "ASN.1 library for Rust")
  1083. (description "ASN.1 library for Rust")
  1084. (license (list license:expat license:asl2.0))))
  1085. ;; rust-tokio-openssl@0.6.3 needs a recent rust-openssl
  1086. (define rust-openssl-macros
  1087. (package
  1088. (name "rust-openssl-macros")
  1089. (version "0.1.0")
  1090. (source
  1091. (origin
  1092. (method url-fetch)
  1093. (uri (crate-uri "openssl-macros" version))
  1094. (file-name (string-append name "-" version ".tar.gz"))
  1095. (sha256
  1096. (base32 "0v3kgnzbadrf9c06q4cqmbjas53av73n5w7wwz3n0nb6257y80dm"))))
  1097. (build-system (@ (guix build-system cargo) cargo-build-system))
  1098. (arguments
  1099. `(#:cargo-inputs
  1100. (("rust-proc-macro2" ,(p rust-proc-macro2-1))
  1101. ("rust-quote" ,(p rust-quote-1))
  1102. ("rust-syn" ,(p rust-syn-1)))))
  1103. (home-page "")
  1104. (synopsis "Internal macros used by the openssl crate.")
  1105. (description "Internal macros used by the openssl crate.")
  1106. (license (list license:expat license:asl2.0))))
  1107. (define-public rust-openssl-sys
  1108. (package
  1109. (inherit (p rust-openssl-sys-0.9))
  1110. (name "rust-openssl-sys")
  1111. (version "0.9.73")
  1112. (source
  1113. (origin
  1114. (method url-fetch)
  1115. (uri (crate-uri "openssl-sys" version))
  1116. (file-name (string-append name "-" version ".tar.gz"))
  1117. (sha256
  1118. (base32 "1h0bv7cwrbbwdnpj96mb2b0p0gkajwc5g4rl3qf1ka70nfgx2pwx"))))))
  1119. (define-public rust-openssl
  1120. (package
  1121. (inherit (p rust-openssl-0.10))
  1122. (name "rust-openssl")
  1123. (version "0.10.39")
  1124. (source
  1125. (origin
  1126. (method url-fetch)
  1127. (uri (crate-uri "openssl" version))
  1128. (file-name (string-append name "-" version ".tar.gz"))
  1129. (sha256
  1130. (base32 "0hi72bwh6ipfj3cj7dlzk6n8aixiswj2fzbv5nk17n6r8rnr3wr8"))))
  1131. (inputs ; TODO: or native-inputs? Where to put macros?
  1132. (modify-inputs (package-inputs (p rust-openssl-0.10))
  1133. (prepend (p rust-once-cell-1)
  1134. rust-openssl-macros)))))
  1135. ;; not yet in Guix, but needed for updated agate
  1136. (define rust-rcgen
  1137. (package
  1138. (name "rust-rcgen")
  1139. (version "0.9.2")
  1140. (source
  1141. (origin
  1142. (method url-fetch)
  1143. (uri (crate-uri "rcgen" version))
  1144. (file-name (string-append name "-" version ".tar.gz"))
  1145. (sha256
  1146. (base32 "0ppwfl9g504x2qwk7m7mag8c3l70w9mcfha93013nlzqdlw2vynp"))))
  1147. (build-system (@ (guix build-system cargo) cargo-build-system))
  1148. (arguments
  1149. `(#:tests? #false ;; some test dependencies removed
  1150. #:cargo-inputs
  1151. (("rust-pem" ,(@ (gnu packages crates-io) rust-pem-1))
  1152. ("rust-ring" ,(@ (gnu packages crates-io) rust-ring-0.16))
  1153. ("rust-time" ,(@ (gnu packages crates-io) rust-time-0.3))
  1154. ;; TODO: 0.13
  1155. ("rust-x509-parser" ,(@ (gnu packages crates-io) rust-x509-parser-0.12))
  1156. ("rust-yasna" ,rust-yasna)
  1157. ("rust-zeroize" ,(@ (gnu packages crates-io) rust-zeroize-1)))
  1158. #:cargo-development-inputs
  1159. (#;("rust-botan" ,(@ (gnu packages crates-io) rust-botan-0.8))
  1160. ("rust-openssl" ,(@ (gnu packages crates-io) rust-openssl-0.10))
  1161. ("rust-rand" ,(@ (gnu packages crates-io) rust-rand-0.8))
  1162. ("rust-rsa" ,rust-rsa)
  1163. ("rust-webpki" ,(@ (gnu packages crates-io) rust-webpki-0.22))
  1164. ("rust-x509-parser" ,(@ (gnu packages crates-io) rust-x509-parser-0.12)))))
  1165. (home-page "https://github.com/est31/rcgen")
  1166. (synopsis "Rust X.509 certificate generator")
  1167. (description "Rust X.509 certificate generator") ;; TODO
  1168. (license (list license:expat license:asl2.0))))
  1169. ;; Old pkcs5 doesn't build
  1170. (define rust-pkcs5
  1171. (package
  1172. (inherit (@ (gnu packages crates-io) rust-pkcs5-0.3))
  1173. (name "rust-pkcs5")
  1174. (version "0.5.0-pre.1")
  1175. (source
  1176. (origin
  1177. (method url-fetch)
  1178. (uri (crate-uri "pkcs5" version))
  1179. (file-name (string-append name "-" version ".tar.gz"))
  1180. (sha256
  1181. (base32 "1n605kk594vif1rzrc09739nw6fky41mz6jpz9czs7lagq75jkvs"))))))
  1182. (define rust-pkcs8 ;; old pkcs8 doesn't build against new rust-der
  1183. (package
  1184. (inherit (p rust-pkcs8-0.7))
  1185. (name "rust-pkcs8")
  1186. (version "0.9.0-pre.1")
  1187. (source
  1188. (origin
  1189. (method url-fetch)
  1190. (uri (crate-uri "pkcs8" version))
  1191. (file-name (string-append name "-" version ".tar.gz"))
  1192. (sha256
  1193. (base32 "0257q8i3xqar8lb9lg6hvd17aykf5f3n1v3v7p7r4g1wsrncm7pk"))))))
  1194. (define-public rust-der
  1195. (package
  1196. (inherit (@ (gnu packages crates-io) rust-der-0.4))
  1197. (name "rust-der")
  1198. (version "0.6.0-pre.3")
  1199. (source
  1200. (origin
  1201. (method url-fetch)
  1202. (uri (crate-uri "der" version))
  1203. (file-name (string-append name "-" version ".tar.gz"))
  1204. (sha256
  1205. (base32 "1qag0zb2n7fj8qv7a83pmm9rqqz0zxvx5zpyzfy05a1rxxz73vdk"))))))
  1206. (define-public rust-pkcs1 ; old doesn't build against new rust-der
  1207. (package
  1208. (inherit (@ (gnu packages crates-io) rust-pkcs1-0.2))
  1209. (name "rust-pkcs1")
  1210. (version "0.3.3")
  1211. (source
  1212. (origin
  1213. (method url-fetch)
  1214. (uri (crate-uri "pkcs1" version))
  1215. (file-name (string-append name "-" version ".tar.gz"))
  1216. (sha256
  1217. (base32 "0813szfx13n4xl6l19m3lwj7pqgljqwc6ipxhr2dv0yc9k06d3x7"))))))
  1218. (define-public rust-spki ; old doesn't build against new rust-der
  1219. (package
  1220. (inherit (@ (gnu packages crates-io) rust-spki-0.4))
  1221. (name "rust-spki")
  1222. (version "0.6.0-pre.2")
  1223. (source
  1224. (origin
  1225. (method url-fetch)
  1226. (uri (crate-uri "spki" version))
  1227. (file-name (string-append name "-" version ".tar.gz"))
  1228. (sha256
  1229. (base32 "1cbdffcfp1zivxw4hiqj681api2gqxcgcqf64rq2wbvrk10jffq9"))))))
  1230. ;; Required by rust-pkcs5' cbc feature
  1231. (define rust-cbc
  1232. (package
  1233. (name "rust-cbc")
  1234. (version "0.1.2")
  1235. (source
  1236. (origin
  1237. (method url-fetch)
  1238. (uri (crate-uri "cbc" version))
  1239. (file-name (string-append name "-" version ".tar.gz"))
  1240. (sha256
  1241. (base32 "19l9y9ccv1ffg6876hshd123f2f8v7zbkc4nkckqycxf8fajmd96"))))
  1242. (build-system (@ (guix build-system cargo) cargo-build-system))
  1243. (arguments
  1244. `(#:cargo-inputs
  1245. (("rust-cipher" ,rust-cipher))
  1246. #:cargo-development-inputs
  1247. (("rust-aes" ,rust-aes)
  1248. ("rust-cipher" ,rust-cipher)
  1249. ("rust-hex-literal" ,(p rust-hex-literal-0.3)))))
  1250. (home-page "https://github.com/RustCrypto/block-modes")
  1251. (synopsis "Cipher Block Chaining (CBC) block cipher mode of operation")
  1252. (description "Cipher Block Chaining (CBC) block cipher mode of operation")
  1253. (license (list license:expat license:asl2.0))))
  1254. ;; Old vesion incompatible with new rust-hmac
  1255. (define rust-cookie
  1256. (package
  1257. (inherit (p rust-cookie-0.15))
  1258. (name "rust-cookie")
  1259. (version "0.16.0")
  1260. (source
  1261. (origin
  1262. (method url-fetch)
  1263. (uri (crate-uri "cookie" version))
  1264. (file-name (string-append name "-" version ".tar.gz"))
  1265. (sha256
  1266. (base32 "01fa6z8sqqg19ya0l9ifh8vn05l5hpxdzkbh489mpymhw5np1m4l"))))))
  1267. (define-public rust-cookie-store ; old version incompatible with new rust-time
  1268. (package
  1269. (inherit (p rust-cookie-store-0.15))
  1270. (name "rust-cookie-store")
  1271. (version "0.16.0")
  1272. (source
  1273. (origin
  1274. (method url-fetch)
  1275. (uri (crate-uri "cookie-store" version))
  1276. (file-name (string-append name "-" version ".tar.gz"))
  1277. (sha256
  1278. (base32 "0idrphkllykjmvx1vnjyihi3w76lphwbj6k0vqzpiib4lqvgsfzq"))))))
  1279. (define rust-partial-io
  1280. (package
  1281. (inherit (p rust-partial-io-0.3)) ; @0.3.1 requires old rust-futures
  1282. (name "rust-partial-io")
  1283. (version "0.5.0")
  1284. (source
  1285. (origin
  1286. (method url-fetch)
  1287. (uri (crate-uri "partial-io" version))
  1288. (file-name (string-append name "-" version ".tar.gz"))
  1289. (sha256
  1290. (base32 "17q39vnwas6f4l5wiiqzlxh8la21rzpiy010mb95d9f0bj5ik056"))))
  1291. (inputs
  1292. (modify-inputs (package-inputs (p rust-partial-io-0.3))
  1293. (prepend (p rust-tokio-1)
  1294. (p rust-rand-0.8)
  1295. (p rust-pin-project-1))))))
  1296. ;; Old agate doesn't build
  1297. (define agate
  1298. (package
  1299. (inherit (@ (gnu packages rust-apps) agate))
  1300. (name "agate")
  1301. (version "3.2.3")
  1302. (source
  1303. (origin
  1304. (method url-fetch)
  1305. (uri (crate-uri "agate" version))
  1306. (file-name (string-append name "-" version ".tar.gz"))
  1307. (sha256
  1308. (base32 "1bxar93jh80jv5xvr6rnlc6gcsvzlf673m9874jzhjp78mhdbmwx"))))
  1309. (inputs
  1310. (modify-inputs (package-inputs (@ (gnu packages rust-apps) agate))
  1311. (append rust-rcgen rust-futures-util-0.3)))))
  1312. ;; Old castor doesn't build against new rust-gtk
  1313. (define castor
  1314. (package
  1315. (inherit (@ (gnu packages web) castor))
  1316. (name "castor")
  1317. (version "0.9.0")
  1318. (source
  1319. (origin
  1320. (inherit (package-source (@ (gnu packages web) castor)))
  1321. (method git-fetch)
  1322. (uri (git-reference
  1323. (url "https://git.sr.ht/~julienxx/castor")
  1324. (commit version)))
  1325. (file-name (git-file-name name version))
  1326. (sha256
  1327. (base32 "1gda77ya2qbmjxfbw3yfr64inm8xw8243iwnfsgwwiwl35pw70n9"))
  1328. (modules '((guix build utils)))
  1329. ;; Submitted upstream at <https://lists.sr.ht/~julienxx/castor/patches/32444>
  1330. (patches (list (local-file "0001-Update-to-new-GTK-version-and-new-version-of-depende.patch")))))))
  1331. (define rust-enum-as-inner ; old version doesn't build against new rust-heck
  1332. (package
  1333. (inherit (@ (gnu packages crates-io) rust-enum-as-inner-0.3))
  1334. (name "rust-enum-as-inner")
  1335. (version "0.4.0")
  1336. (source
  1337. (origin
  1338. (method url-fetch)
  1339. (uri (crate-uri "enum-as-inner" version))
  1340. (file-name (string-append name "-" version ".tar.gz"))
  1341. (sha256
  1342. (base32 "0wwvjmy2bvqqc3pyylsmlqpkswxrzsg40xva7z27szva8j0svk91"))))))
  1343. ;; Old version doesn't have the block_buffer required by rust-sha3
  1344. (define rust-block-buffer
  1345. (package
  1346. (inherit (@ (gnu packages crates-io) rust-block-buffer-0.10))
  1347. (name "rust-block-buffer")
  1348. (version "0.10.2")
  1349. (source
  1350. (origin
  1351. (method url-fetch)
  1352. (uri (crate-uri "block-buffer" version))
  1353. (file-name (string-append name "-" version ".tar.gz"))
  1354. (sha256
  1355. (base32 "097k9xkd8gqrl03qg4fwhjvanp3ac0pq4drg8pynk9cyhi8zxxqb"))))))
  1356. ;; Doesn't build against new block-buffer
  1357. (define rust-md-5
  1358. (package
  1359. (inherit (@ (gnu packages crates-io) rust-md-5-0.9))
  1360. (name "rust-md-5")
  1361. (version "0.10.1")
  1362. (source
  1363. (origin
  1364. (method url-fetch)
  1365. (uri (crate-uri "md-5" version))
  1366. (file-name (string-append name "-" version ".tar.gz"))
  1367. (sha256
  1368. (base32 "10h5kna43cpggp9hy1hz4zb1qpixdl4anf3hdj3gfwhb3sr4d1k5"))))))
  1369. (define rust-digest
  1370. (package
  1371. (inherit (@ (gnu packages crates-io) rust-digest-0.10))
  1372. (name "rust-digest")
  1373. (version "0.10.3")
  1374. (source
  1375. (origin
  1376. (method url-fetch)
  1377. (uri (crate-uri "digest" version))
  1378. (file-name (string-append name "-" version ".tar.gz"))
  1379. (sha256
  1380. (base32 "01nmj9cci5qdm4q4wlmz104rzr68d5m823kdzd95bypslq68dyzj"))))))
  1381. (define rust-crypto-common
  1382. (package
  1383. (inherit (@ (gnu packages crates-io) rust-crypto-common-0.1))
  1384. (name "rust-crypto-common")
  1385. (version "0.1.3")
  1386. (source
  1387. (origin
  1388. (method url-fetch)
  1389. (uri (crate-uri "crypto-common" version))
  1390. (file-name (string-append name "-" version ".tar.gz"))
  1391. (sha256
  1392. (base32 "1s1wpm88qlrp079mzh3dlxm9vbqs4ch016yp9pzhcdjygfi2r5ap"))))))
  1393. (define rust-sha3
  1394. (package
  1395. (inherit (@ (gnu packages crates-io) rust-sha3-0.9))
  1396. (name "rust-sha3")
  1397. (version "0.10.1")
  1398. (source
  1399. (origin
  1400. (method url-fetch)
  1401. (uri (crate-uri "sha3" version))
  1402. (file-name (string-append name "-" version ".tar.gz"))
  1403. (sha256
  1404. (base32 "11hclx8ijnlx82dyd0bh9hi629zb3vqjfsyaqlgk1dl7dhazh6w8"))))))
  1405. ;; Old things don't build?
  1406. (define rust-scrypt
  1407. (package
  1408. (inherit (@ (gnu packages crates-io) rust-scrypt-0.8))
  1409. (name "rust-scrypt")
  1410. (version "0.10.0")
  1411. (source
  1412. (origin
  1413. (method url-fetch)
  1414. (uri (crate-uri "scrypt" version))
  1415. (file-name (string-append name "-" version ".tar.gz"))
  1416. (sha256
  1417. (base32 "0pglmppcl8mdzfxdv2x9dsjrwxhc1bm9zvxjibnlv59jnv9297lz"))))))
  1418. ;; rust-scrypt@0.8 doesn't build against rust-password-hash@0.3
  1419. (define rust-password-hash
  1420. (package
  1421. (inherit (@ (gnu packages crates-io) rust-password-hash-0.3))
  1422. (name "rust-password-hash")
  1423. (version "0.4.1")
  1424. (source
  1425. (origin
  1426. (method url-fetch)
  1427. (uri (crate-uri "password-hash" version))
  1428. (file-name (string-append name "-" version ".tar.gz"))
  1429. (sha256
  1430. (base32 "1552dd98v6yd4l5myz4g1r2hzln8dfng22638590dc4gpi5fjag0"))))))
  1431. ;; rust-pbkkdf2@0.10 doesn't build
  1432. (define rust-pbkdf2
  1433. (package
  1434. (inherit (@ (gnu packages crates-io) rust-pbkdf2-0.10))
  1435. (name "rust-pbkdf2")
  1436. (version "0.11.0")
  1437. (source
  1438. (origin
  1439. (method url-fetch)
  1440. (uri (crate-uri "pbkdf2" version))
  1441. (file-name (string-append name "-" version ".tar.gz"))
  1442. (sha256
  1443. (base32 "05q9wqjvfrs4dvw03yn3bvcs4zghz0a7ycfa53pz2k2fqhp6k843"))))))
  1444. (define rust-salsa20
  1445. (package
  1446. (inherit (@ (gnu packages crates-io) rust-salsa20-0.9))
  1447. (name "rust-salsa20")
  1448. (version "0.10.2")
  1449. (source
  1450. (origin
  1451. (method url-fetch)
  1452. (uri (crate-uri "salsa20" version))
  1453. (file-name (string-append name "-" version ".tar.gz"))
  1454. (sha256
  1455. (base32 "04w211x17xzny53f83p8f7cj7k2hi8zck282q5aajwqzydd2z8lp"))))))
  1456. (define rust-cipher;; TODO WIP
  1457. (package
  1458. (inherit (@ (gnu packages crates-io) rust-cipher-0.3))
  1459. (name "rust-cipher")
  1460. (version "0.4.3")
  1461. (source
  1462. (origin
  1463. (method url-fetch)
  1464. (uri (crate-uri "cipher" version))
  1465. (file-name (string-append name "-" version ".tar.gz"))
  1466. (sha256
  1467. (base32 "17mmmqaalirdx7bpdhrgzp1sd392zm08mjrr24cjr57pz1q351yi"))))
  1468. (inputs
  1469. (modify-inputs (package-inputs (@ (gnu packages crates-io) rust-cipher-0.3))
  1470. (append rust-crypto-common rust-inout
  1471. (@ (gnu packages crates-io) rust-zeroize-1))))))
  1472. (define-public rust-block-padding ; 0.3.2 required by rust-cipher
  1473. (package
  1474. (inherit (@ (gnu packages crates-io) rust-block-padding-0.2))
  1475. (name "rust-block-padding")
  1476. (version "0.3.2")
  1477. (source
  1478. (origin
  1479. (method url-fetch)
  1480. (uri (crate-uri "block-padding" version))
  1481. (file-name (string-append name "-" version ".tar.gz"))
  1482. (sha256
  1483. (base32 "0y5v92alqzn9ikmyqfl3a4j6va87j967ii2n3jh2h330z4nyr40a"))))
  1484. (inputs
  1485. (modify-inputs (package-inputs (@ (gnu packages crates-io) rust-block-padding-0.2))
  1486. (append (@ (gnu packages crates-io) rust-generic-array-0.14))))))
  1487. (define rust-chacha20poly1305 ; @0.9 doesn't build against rust-cipher@0.4
  1488. (package
  1489. (inherit (p rust-chacha20poly1305-0.9))
  1490. (name "rust-chacha20poly1305")
  1491. (version "0.10.0-pre")
  1492. (source
  1493. (origin
  1494. (method url-fetch)
  1495. (uri (crate-uri "chacha20poly1305" version))
  1496. (file-name (string-append name "-" version ".tar.gz"))
  1497. (sha256
  1498. (base32 "1skr6v12mlaccsxd1hjgr1bvk1hs9d412g29rymnjr76f47l6v3l"))))))
  1499. (define rust-block-modes ; 0.8.1 uses removed NewBlockCipher
  1500. (package
  1501. (inherit (@ (gnu packages crates-io) rust-block-modes-0.8))
  1502. (name "rust-block-modes")
  1503. (version "0.9.1")
  1504. (source
  1505. (origin
  1506. (method url-fetch)
  1507. (uri (crate-uri "block-modes" version))
  1508. (file-name (string-append name "-" version ".tar.gz"))
  1509. (sha256
  1510. (base32 "07pjna64v0ng30j8ss9w7rv7k7l7gsii37yxm011a1kzh6q128ly"))))))
  1511. (define rust-aes ; 0.7.1 uses removed NewBlockCipher
  1512. (package
  1513. (inherit (@ (gnu packages crates-io) rust-aes-0.7))
  1514. (name "rust-aes")
  1515. (version "0.8.1")
  1516. (source
  1517. (origin
  1518. (method url-fetch)
  1519. (uri (crate-uri "aes" version))
  1520. (file-name (string-append name "-" version ".tar.gz"))
  1521. (sha256
  1522. (base32 "1fj03mqa45nf2scxcd7mvg1xcbavrkqlmkfzwcgnx660g0si7q5z"))))))
  1523. (define rust-des ; 0.7.0 uses removed NewBlockCipher
  1524. (package
  1525. (inherit (@ (gnu packages crates-io) rust-des-0.7))
  1526. (name "rust-des")
  1527. (version "0.8.1")
  1528. (source
  1529. (origin
  1530. (method url-fetch)
  1531. (uri (crate-uri "des" version))
  1532. (file-name (string-append name "-" version ".tar.gz"))
  1533. (sha256
  1534. (base32 "07kshslxanmg0g6007scvglfhg6mli2a8qzhx4kxx4z9ik781pgz"))))))
  1535. (define rust-ctr ; 0.8.1 uses private ciphererrors:LoopError
  1536. (package
  1537. (inherit (@ (gnu packages crates-io) rust-ctr-0.8))
  1538. (name "rust-ctr")
  1539. (version "0.9.1")
  1540. (source
  1541. (origin
  1542. (method url-fetch)
  1543. (uri (crate-uri "ctr" version))
  1544. (file-name (string-append name "-" version ".tar.gz"))
  1545. (sha256
  1546. (base32 "18222kdhghd2j5vc5lm7bqy6glk5wbvzz1sydghd1xdsrwlz650d"))))))
  1547. ;; rust-cipher expects a rust-typenum that has 'static' lifetimes in some places,
  1548. ;; see <https://github.com/RustCrypto/traits/pull/937>.
  1549. (define rust-typenum
  1550. (package
  1551. (inherit (@ (gnu packages crates-io) rust-typenum-1))
  1552. (name "rust-typenum")
  1553. (version "1.15.0")
  1554. (source
  1555. (origin
  1556. (method url-fetch)
  1557. (uri (crate-uri "typenum" version))
  1558. (file-name (string-append name "-" version ".tar.gz"))
  1559. (sha256
  1560. (base32 "11yrvz1vd43gqv738yw1v75rzngjbs7iwcgzjy3cq5ywkv2imy6w"))))))
  1561. ;; Some packages require new_unwrap, which is not present in old versions
  1562. (define rust-const-oid
  1563. (package
  1564. (inherit (@ (gnu packages crates-io) rust-const-oid-0.6))
  1565. (name "rust-const-oid")
  1566. (version "0.9.0")
  1567. (source
  1568. (origin
  1569. (method url-fetch)
  1570. (uri (crate-uri "const-oid" version))
  1571. (file-name (string-append name "-" version ".tar.gz"))
  1572. (sha256
  1573. (base32 "0q8n1zsa73130hxa2w88qw36g8nprz21j52abpva3khm59a26bkj"))))))
  1574. ;; Old rust-sha1 doesn't implement CoreProxy while required by rust-pkcs5.
  1575. ;; To avoid a collision with rust-sha-1, give it a different name.
  1576. (define rust-sha1
  1577. (package
  1578. (inherit (@ (gnu packages crates-io) rust-sha1-0.6))
  1579. (name "rust-sha1")
  1580. (version "0.10.1")
  1581. (source
  1582. (origin
  1583. (method url-fetch)
  1584. (uri (crate-uri "sha1" version))
  1585. (file-name (string-append name "-" version ".tar.gz"))
  1586. (sha256
  1587. (base32 "0bw56hxajrgb3pjg0cr5xrvmx0jna39564iw2p14ama5cmzlwzy7"))))
  1588. (arguments (append (list #:rust-metadata "guix-variant=rust-sha1")
  1589. (package-arguments (p rust-sha1-0.6))))))
  1590. (define rust-rsa ;; rust-rsa@0.5 doesn't build against new rust-pkcs1
  1591. (package
  1592. (inherit (@ (gnu packages crates-io) rust-rsa-0.5))
  1593. (name "rust-rsa")
  1594. (version "0.6.1")
  1595. (source
  1596. (origin
  1597. (method url-fetch)
  1598. (uri (crate-uri "rsa" version))
  1599. (file-name (string-append name "-" version ".tar.gz"))
  1600. (sha256
  1601. (base32 "02viiiylxpk2hx5h5qrpm4lcd8ildvafbw0rn6rx44wnqia2gwjc"))))
  1602. (inputs
  1603. (modify-inputs (package-inputs (p rust-rsa-0.5))
  1604. (prepend (p rust-rand-core-0.6))))))
  1605. (define rust-backtrace ;; old rust-backtrace doesn't build against new rust-object
  1606. (package
  1607. (inherit (p rust-backtrace-0.3))
  1608. (name "rust-backtrace")
  1609. (version "0.3.65")
  1610. (source
  1611. (origin
  1612. (method url-fetch)
  1613. (uri (crate-uri "backtrace" version))
  1614. (file-name (string-append name "-" version ".tar.gz"))
  1615. (sha256
  1616. (base32 "0qggp0d8pbw5vfnpm0r7lrn6wmh5yjiz4yc4bzynb8l26i2pv88i"))))))
  1617. (define rust-bytestring ; rust-actix-http@3 requires into_bytes
  1618. (package
  1619. (inherit (p rust-bytestring-0.1))
  1620. (name "rust-bytestring")
  1621. (version "1.0.0")
  1622. (source
  1623. (origin
  1624. (method url-fetch)
  1625. (uri (crate-uri "bytestring" version))
  1626. (file-name (string-append name "-" version ".tar.gz"))
  1627. (sha256
  1628. (base32 "0ka9gkn2rrxms0d5s32ckpchh06qmgidbh4xw630gfcpkshnnw4h"))))))
  1629. (define rust-gimli ;; new rust-backtrace doesn't build against old rust-gimli
  1630. (package
  1631. (inherit (p rust-gimli-0.23))
  1632. (name "rust-giml")
  1633. (version "0.26.1")
  1634. (source
  1635. (origin
  1636. (method url-fetch)
  1637. (uri (crate-uri "gimli" version))
  1638. (file-name (string-append name "-" version ".tar.gz"))
  1639. (sha256
  1640. (base32 "1m0vi36ypv4gx9gzcw6y456yqnlypizhwlcqrmg6vkwd0lnkgk3q"))))))
  1641. (define rust-addr2line ;; new rust-addr2line doesn't build against old rust-gimli
  1642. (package
  1643. (inherit (p rust-addr2line-0.14))
  1644. (name "rust-addr2line")
  1645. (version "0.17.0")
  1646. (source
  1647. (origin
  1648. (method url-fetch)
  1649. (uri (crate-uri "addr2line" version))
  1650. (file-name (string-append name "-" version ".tar.gz"))
  1651. (sha256
  1652. (base32 "0sw16zqy6w0ar633z69m7lw6gb0k1y7xj3387a8wly43ij5div5r"))))))
  1653. (define rust-instant
  1654. (package
  1655. (inherit (p rust-instant-0.1))
  1656. (name "rust-instant")
  1657. (version "0.1.12")
  1658. (source
  1659. (origin
  1660. (method url-fetch)
  1661. (uri (crate-uri "instant" version))
  1662. (file-name (string-append name "-" version ".tar.gz"))
  1663. (sha256
  1664. (base32 "0b2bx5qdlwayriidhrag8vhy10kdfimfhmb3jnjmsz2h9j1bwnvs"))))
  1665. ;;TODO: add upstream Guix
  1666. (inputs (modify-inputs (package-inputs (p rust-instant-0.1))
  1667. (append (p rust-cfg-if-1))))))
  1668. (define-public rust-syscallz ; @0.15 doesn't build
  1669. (package
  1670. (inherit (p rust-syscallz-0.15))
  1671. (name "rust-syscallz")
  1672. (version "0.16.1")
  1673. (source
  1674. (origin
  1675. (method url-fetch)
  1676. (uri (crate-uri "syscallz" version))
  1677. (file-name (string-append name "-" version ".tar.gz"))
  1678. (sha256
  1679. (base32 "05ws3w0lfbcazx2ay5nkfhgbs4kb6nvk230kbvql44ykjrjm0jnr"))))))
  1680. (define-public rust-strum-macros ; needed by rust-syscallz
  1681. (package
  1682. (inherit (p rust-strum-macros-0.21))
  1683. (name "rust-strum-macros")
  1684. (version "0.24.0")
  1685. (source
  1686. (origin
  1687. (method url-fetch)
  1688. (uri (crate-uri "strum-macros" version))
  1689. (file-name (string-append name "-" version ".tar.gz"))
  1690. (sha256
  1691. (base32 "1vyh8m1skr8h4f2lnhnq1r7v3mah545bp4k1p8z4svj42ydhfy38"))))
  1692. (inputs
  1693. (modify-inputs (package-inputs (p rust-strum-macros-0.21))
  1694. (append (p rust-rustversion-1))))))
  1695. (define rust-strum ; needed by rust-syscallz
  1696. (package
  1697. (inherit (p rust-strum-0.21))
  1698. (name "rust-strum")
  1699. (version "0.24.0")
  1700. (source
  1701. (origin
  1702. (method url-fetch)
  1703. (uri (crate-uri "strum" version))
  1704. (file-name (string-append name "-" version ".tar.gz"))
  1705. (sha256
  1706. (base32 "1y77vshrhm1grlgcfmnm0nxpsv0pb5zcb97zy6rbh106nz0wysp9"))))))
  1707. (define rust-actix-derive ; old one doesn't build against new rust-syn
  1708. (package
  1709. (inherit (p rust-actix-derive-0.5))
  1710. (name "rust-actix-derive")
  1711. (version "0.6.0")
  1712. (source
  1713. (origin
  1714. (method url-fetch)
  1715. (uri (crate-uri "actix-derive" version))
  1716. (file-name (string-append name "-" version ".tar.gz"))
  1717. (sha256
  1718. (base32 "19rp2xcwqf5p4q5h6xxzb44xsfgpvvnnsis3l0dngnffw7zbhi3d"))))))
  1719. (define rust-actix-codec ; @0.3 doesn't build against new rust-bytes@1
  1720. (package
  1721. (inherit (p rust-actix-codec-0.3))
  1722. (name "rust-actix-codec")
  1723. (version "0.5.0")
  1724. (source
  1725. (origin
  1726. (method url-fetch)
  1727. (uri (crate-uri "actix-codec" version))
  1728. (file-name (string-append name "-" version ".tar.gz"))
  1729. (sha256
  1730. (base32 "1zm7nk8irjgkf08a6x632niwd9iprq43rdda4wqmgwx70ja5b9sp"))))))
  1731. (define rust-actix-tls
  1732. (package
  1733. (inherit (p rust-actix-tls-2))
  1734. (name "rust-actix-tls")
  1735. (version "3.0.3")
  1736. (source
  1737. (origin
  1738. (method url-fetch)
  1739. (uri (crate-uri "actix-tls" version))
  1740. (file-name (string-append name "-" version ".tar.gz"))
  1741. (sha256
  1742. (base32 "15rj6gn83fzv5w2b2y0s690q80awsjhbjg40f3qcgkgpjbr0rplz"))))))
  1743. (define rust-actix-utils ; @2 doesn't build against new rust-actix-rt
  1744. (package
  1745. (inherit (p rust-actix-utils-2))
  1746. (name "rust-actix-utils")
  1747. (version "3.0.0")
  1748. (source
  1749. (origin
  1750. (method url-fetch)
  1751. (uri (crate-uri "actix-utils" version))
  1752. (file-name (string-append name "-" version ".tar.gz"))
  1753. (sha256
  1754. (base32 "155aj87z8634mfmggfixyqy3pqhpyf7g97zrzy6piz77qamcp4g4"))))))
  1755. (define rust-actix-http ; @2 has non-building dependency rust-actix-connect@2
  1756. (package
  1757. (inherit (p rust-actix-http-2))
  1758. (name "rust-actix-http")
  1759. (version "3.0.4")
  1760. (source
  1761. (origin
  1762. (method url-fetch)
  1763. (uri (crate-uri "actix-http" version))
  1764. (file-name (string-append name "-" version ".tar.gz"))
  1765. (sha256
  1766. (base32 "0ykrwybs3ssi9ifn5p2gddi4909adjxs3gk450r0sk8d3aw5r255"))))))
  1767. (define rust-actix-web ; @3 doesn't build against updated actix dependencies
  1768. (package
  1769. (inherit (p rust-actix-web-3))
  1770. (name "rust-actix-web")
  1771. (version "4.0.1")
  1772. (source
  1773. (origin
  1774. (method url-fetch)
  1775. (uri (crate-uri "actix-web" version))
  1776. (file-name (string-append name "-" version ".tar.gz"))
  1777. (sha256
  1778. (base32 "0cadlzb6syha1jwx0pghasj0qd47jkjy03dfldbdyl0xspzyprgl"))))))
  1779. (define rust-actix-web-codegen ; rust-actix-web@4 is incompatible with rust-actix-web-codegen@0.4
  1780. (package
  1781. (inherit (p rust-actix-web-codegen-0.4))
  1782. (name "rust-actix-web-codegen")
  1783. (version "4.0.0")
  1784. (source
  1785. (origin
  1786. (method url-fetch)
  1787. (uri (crate-uri "actix-web-codegen" version))
  1788. (file-name (string-append name "-" version ".tar.gz"))
  1789. (sha256
  1790. (base32 "1g4imsr56b82lp76k2krg0vzfv92x7kxg24y8qfvnjkhakgvw9bm"))))))
  1791. (define rust-actix-router
  1792. (package
  1793. (inherit (p rust-actix-router-0.2)) ; new rust-actix-web doesn't build against old @0.2
  1794. (name "rust-actix-router")
  1795. (version "0.5.0")
  1796. (source
  1797. (origin
  1798. (method url-fetch)
  1799. (uri (crate-uri "actix-router" version))
  1800. (file-name (string-append name "-" version ".tar.gz"))
  1801. (sha256
  1802. (base32 "107s475ghxl1sliqcjdji7272hi71a491k2n9bqg4661a9mq8q7b"))))))
  1803. (define rust-awc ; @2 doesn't build
  1804. ;; TODO: some build failures remain
  1805. (package
  1806. (inherit (p rust-awc-2))
  1807. (name "rust-awc")
  1808. (version "3.0.0")
  1809. (source
  1810. (origin
  1811. (method url-fetch)
  1812. (uri (crate-uri "awc" version))
  1813. (file-name (string-append name "-" version ".tar.gz"))
  1814. (sha256
  1815. (base32 "16l8zvzx522vnhvn9cgfqhrvf4z50vbrfsz8cpiwxj7kzd20rik5"))))))
  1816. (define rust-local-waker
  1817. (package
  1818. (name "rust-local-waker")
  1819. (version "0.1.3")
  1820. (source
  1821. (origin
  1822. (method url-fetch)
  1823. (uri (crate-uri "local-waker" version))
  1824. (file-name (string-append name "-" version ".tar.gz"))
  1825. (sha256
  1826. (base32 "1w9zqlh18mymvb82ya0sailiy5d3wsjamaakgl70x50i6vmpckz3"))))
  1827. (build-system (@ (guix build-system cargo) cargo-build-system))
  1828. (home-page "https://github.com/actix/actix-net.git")
  1829. (synopsis "A synchronization primitive for thread-local task wakeup")
  1830. (description
  1831. "This package provides a synchronization primitive for thread-local task wakeup")
  1832. (license (list license:expat license:asl2.0))))
  1833. ;;Not yet inGuix,requiredby rust-cipher
  1834. (define rust-inout
  1835. (package
  1836. (name "rust-inout")
  1837. (version "0.1.3")
  1838. (source
  1839. (origin
  1840. (method url-fetch)
  1841. (uri (crate-uri "inout" version))
  1842. (file-name (string-append name "-" version ".tar.gz"))
  1843. (sha256
  1844. (base32 "1xf9gf09nc7y1a261xlfqsf66yn6mb81ahlzzyyd1934sr9hbhd0"))))
  1845. (build-system (@ (guix build-system cargo) cargo-build-system))
  1846. (arguments
  1847. `(#:cargo-inputs
  1848. (("rust-block-padding" ,(@ (gnu packages crates-io) rust-block-padding-0.2)) ;; XXX 0.3
  1849. ("rust-generic-array" ,(@ (gnu packages crates-io) rust-generic-array-0.14)))))
  1850. (home-page "https://github.com/RustCrypto/utils")
  1851. (synopsis
  1852. "Custom reference types for code generic over in-place and buffer-to-buffer modes of operation.")
  1853. (description
  1854. "Custom reference types for code generic over in-place and buffer-to-buffer modes
  1855. of operation.")
  1856. (license (list license:expat license:asl2.0))))
  1857. ;; devise-core@0.2 requires unstable
  1858. (define rust-devise-core
  1859. (package
  1860. (inherit (p rust-devise-core-0.2))
  1861. (name "rust-devise-core")
  1862. (version "0.3.1")
  1863. (source
  1864. (origin
  1865. (method url-fetch)
  1866. (uri (crate-uri "devise-core" version))
  1867. (file-name (string-append name "-" version ".tar.gz"))
  1868. (sha256
  1869. (base32 "1l00qiih4z14ai0c3s16nlvw0kv4p07ygi6a0ms0knc78xpz87l4"))))
  1870. (inputs
  1871. (modify-inputs (package-inputs (p rust-devise-core-0.2))
  1872. (append rust-proc-macro2-diagnostics)))))
  1873. (define rust-devise-codegen ;; 0.2 doesn't build against new rust-quote / rust-devise-core.
  1874. (package
  1875. (inherit (p rust-devise-codegen-0.2))
  1876. (name "rust-devise-codegen")
  1877. (version "0.3.1")
  1878. (source
  1879. (origin
  1880. (method url-fetch)
  1881. (uri (crate-uri "devise-codegen" version))
  1882. (file-name (string-append name "-" version ".tar.gz"))
  1883. (sha256
  1884. (base32 "1cp7nnfwvjp6wfq11n0ffjjrwfa1wbsb58g1bz3ha6z5lvkp6g0j"))))))
  1885. (define rust-proc-macro2-diagnostics ; not yet in Guix but required by rust-devise-core
  1886. (package
  1887. (name "rust-proc-macro2-diagnostics")
  1888. (version "0.9.1")
  1889. (source
  1890. (origin
  1891. (method url-fetch)
  1892. (uri (crate-uri "proc-macro2-diagnostics" version))
  1893. (file-name (string-append name "-" version ".tar.gz"))
  1894. (sha256
  1895. (base32 "1nmazlb1dkznjds7qwms7yxhi33ajc3isji2lsgx8r3lsqk9gwjb"))))
  1896. (build-system (@ (guix build-system cargo) cargo-build-system))
  1897. (arguments
  1898. `(#:cargo-inputs
  1899. (("rust-proc-macro2" ,(p rust-proc-macro2-1))
  1900. ("rust-quote" ,(p rust-quote-1))
  1901. ("rust-syn" ,(p rust-syn-1))
  1902. ("rust-version-check" ,(p rust-version-check-0.9))
  1903. ("rust-yansi" ,(p rust-yansi-0.5)))
  1904. #:cargo-development-inputs
  1905. (("rust-trybuild" ,(p rust-trybuild-1)))))
  1906. (home-page "")
  1907. (synopsis "Diagnostics for proc-macro2.")
  1908. (description "Diagnostics for proc-macro2.")
  1909. (license (list license:expat license:asl2.0))))
  1910. (define rust-hash32-derive ; @0.1.0 doesn't build gainst new rust-quote and friends
  1911. (package
  1912. (inherit (p rust-hash32-derive-0.1))
  1913. (name "rust-hash32-derive")
  1914. (version "0.1.1")
  1915. (source
  1916. (origin
  1917. (method url-fetch)
  1918. (uri (crate-uri "hash32-derive" version))
  1919. (file-name (string-append name "-" version ".tar.gz"))
  1920. (sha256
  1921. (base32 "1zy60cdqrccd9kc8w4hvk1q584b4gjr4d48n3dff42xn6alapljr"))))))
  1922. (define rust-warp ; @0.2 doesn't build
  1923. (package
  1924. (inherit (p rust-warp-0.2))
  1925. (name "rust-warp")
  1926. (version "0.3.2")
  1927. (source
  1928. (origin
  1929. (method url-fetch)
  1930. (uri (crate-uri "warp" version))
  1931. (file-name (string-append name "-" version ".tar.gz"))
  1932. (sha256
  1933. (base32 "0zjqbg2j1fdpqq74bi80hmvyakf1f771d7vrmkqvg90lj4g4xvrw"))
  1934. (patches (list (local-file "warp-Update-tokio-rustls-to-v0.23.patch")
  1935. (local-file "warp-Update-tungstenite-to-0.17.2.patch")))
  1936. (snippet #~(begin
  1937. (delete-file "Cargo.toml")
  1938. (rename-file "Cargo.toml.orig" "Cargo.toml")))))))
  1939. (define rust-wayland-commons
  1940. (package ; for compatibility with new rust-nix
  1941. (inherit (@ (gnu packages crates-graphics) rust-wayland-commons-0.28))
  1942. (name "rust-wayland-commons")
  1943. (version "0.29.4")
  1944. (source (origin
  1945. (method url-fetch)
  1946. (uri (crate-uri "wayland-commons" version))
  1947. (file-name (string-append name "-" version ".tar.gz"))
  1948. (sha256
  1949. (base32
  1950. "0gnk4a771i3g1k4fbzx54xnganpc9j68jrx8xj839hfp83iybxll"))))))
  1951. (define rust-as-slice ; 0.1 uses multiple generic-array version which antioxidant doesn't support (TODO?)
  1952. (package
  1953. (name "rust-as-slice")
  1954. (version "0.2.1")
  1955. (source
  1956. (origin
  1957. (method url-fetch)
  1958. (uri (crate-uri "as-slice" version))
  1959. (file-name (string-append name "-" version ".tar.gz"))
  1960. (sha256
  1961. (base32 "05j52y1ws8kir5zjxnl48ann0if79sb56p9nm76hvma01r7nnssi"))))
  1962. (build-system (@ (guix build-system cargo) cargo-build-system))
  1963. (arguments
  1964. `(#:cargo-inputs
  1965. (("rust-stable-deref-trait" ,(p rust-stable-deref-trait-1)))))
  1966. (home-page "https://github.com/japaric/as-slice")
  1967. (synopsis "`AsSlice` and `AsMutSlice` traits")
  1968. (description "`AsSlice` and `AsMutSlice` traits")
  1969. (license (list license:expat license:asl2.0))))
  1970. (define rust-blake2 ; 0.9 doesn't build against new rust-digest.
  1971. (package
  1972. (inherit (p rust-blake2-0.9))
  1973. (name "rust-blake2")
  1974. (version "0.10.4")
  1975. (source
  1976. (origin
  1977. (method url-fetch)
  1978. (uri (crate-uri "blake2" version))
  1979. (file-name (string-append name "-" version ".tar.gz"))
  1980. (sha256
  1981. (base32 "121k5yj3c8fr826pbh0gf0b3jly2ivzrfvz3lpxyabjvw2g89kxr"))))))
  1982. (define rust-hkdf ; 0.11 doesn't build against new rust-digest
  1983. (package
  1984. (inherit (p rust-hkdf-0.11))
  1985. (name "rust-hkdf")
  1986. (version "0.12.3")
  1987. (source
  1988. (origin
  1989. (method url-fetch)
  1990. (uri (crate-uri "hkdf" version))
  1991. (file-name (string-append name "-" version ".tar.gz"))
  1992. (sha256
  1993. (base32 "0dyl16cf15hka32hv3l7dwgr3xj3brpfr27iyrbpdhlzdfgh46kr"))))))
  1994. (define rust-chacha20 ; @0.8 doesn't build against old rust-cipher
  1995. (package
  1996. (inherit (p rust-chacha20-0.8))
  1997. (name "rust-chacha20")
  1998. (version "0.9.0")
  1999. (source
  2000. (origin
  2001. (method url-fetch)
  2002. (uri (crate-uri "chacha20" version))
  2003. (file-name (string-append name "-" version ".tar.gz"))
  2004. (sha256
  2005. (base32 "021g1917r0jzpvgah76667nzk0p3p9kj7ka5zqns1rxrqp3qkz67"))))))
  2006. (define rust-aes-gcm ; @0.8 doesn't build against old rust-cipher
  2007. (package
  2008. (inherit (p rust-aes-gcm-0.8))
  2009. (name "rust-aes-gcm")
  2010. (version "0.10.0-pre")
  2011. (source
  2012. (origin
  2013. (method url-fetch)
  2014. (uri (crate-uri "aes-gcm" version))
  2015. (file-name (string-append name "-" version ".tar.gz"))
  2016. (sha256
  2017. (base32 "0krsrhji8j5smi35rdg0r31adx1nrpnb1fkpzwl5xipj7yrfh140"))))))
  2018. (define rust-enum-to-u8-slice-derive ; 0.1.0 doesn't build against new rust-syn
  2019. (package
  2020. (inherit (p rust-enum-to-u8-slice-derive-0.1))
  2021. (name "rust-enum-to-u8-slice-derive")
  2022. (version "0.2.0")
  2023. (source
  2024. (origin
  2025. (method url-fetch)
  2026. (uri (crate-uri "enum-to-u8-slice-derive" version))
  2027. (file-name (string-append name "-" version ".tar.gz"))
  2028. (sha256
  2029. (base32 "1ab19saqm5vdhz15gshpj5xj2p6j9i3708mya25vdgyrmb7y1kpc"))))
  2030. (inputs
  2031. ;; TODO: do macro inputs go in native-inputs or inputs?
  2032. (modify-inputs (package-inputs (p rust-enum-to-u8-slice-derive-0.1))
  2033. (prepend (p rust-proc-macro2-1))))))
  2034. (define rust-input-buffer
  2035. (package
  2036. (inherit (p rust-input-buffer-0.3)) ; @0.3 doesn't build against rust-bytes@1
  2037. (name "rust-input-buffer")
  2038. (version "0.5.0")
  2039. (source
  2040. (origin
  2041. (method url-fetch)
  2042. (uri (crate-uri "input-buffer" version))
  2043. (file-name (string-append name "-" version ".tar.gz"))
  2044. (sha256
  2045. (base32 "044qxqdkcq6mv07bsvm35hl7hy3rmf87lrxjyz8zaq57i0xngvmc"))))))
  2046. (define rust-system-deps ; @3 doesn't build against new rust-heck
  2047. (package
  2048. (inherit (p rust-system-deps-3))
  2049. (name "rust-system-deps")
  2050. (version "6.0.2")
  2051. (source
  2052. (origin
  2053. (method url-fetch)
  2054. (uri (crate-uri "system-deps" version))
  2055. (file-name (string-append name "-" version ".tar.gz"))
  2056. (sha256
  2057. (base32 "02g750rlhh7ynqa3p4a3qm7jrkjp3d0jlzrl29z225ch9hf5m951"))))))
  2058. (define rust-version-compare ; rust-system-deps needs new version
  2059. (package
  2060. (inherit (p rust-version-compare-0.0.11))
  2061. (name "rust-version-compare")
  2062. (version "0.1.0")
  2063. (source
  2064. (origin
  2065. (method url-fetch)
  2066. (uri (crate-uri "version-compare" version))
  2067. (file-name (string-append name "-" version ".tar.gz"))
  2068. (sha256
  2069. (base32 "0wyasmnqqngvm54x0gsxbwpxznvn747jkp0dx1nnppy1j9xj927y"))))))
  2070. (define rust-ansi-parser ; old version doesn't build against new rust-nom
  2071. (package
  2072. (inherit (p rust-ansi-parser-0.6))
  2073. (name "rust-ansi-parser")
  2074. (version "0.6.0") ; TODO: 0.6.0/0.7.0/0.8.0?
  2075. (source
  2076. ;; For nom 0.7 compatibility, submitted upstream at
  2077. ;; <https://gitlab.com/davidbittner/ansi-parser/-/merge_requests/11>
  2078. (origin
  2079. (method git-fetch)
  2080. (uri (git-reference
  2081. (url "https://gitlab.com/emixa-d/ansi-parser")
  2082. (commit "bcf3d534e38d6afaca9e898cef1af7fa3e0ecdb3")))
  2083. (sha256
  2084. (base32 "0jhsd8vhz0z0x8p3k5gaf8wwyn253n5fjvf27sdvv4nkh4b1cp2d"))
  2085. (file-name (git-file-name name version))))))
  2086. (define-public rust-async-process ; @1.0.1 is not compatible with new rust-signal-hook
  2087. (package
  2088. (inherit (p rust-async-process-1))
  2089. (name "rust-async-process")
  2090. (version "1.4.0")
  2091. (source
  2092. (origin
  2093. (method url-fetch)
  2094. (uri (crate-uri "async-process" version))
  2095. (file-name (string-append name "-" version ".tar.gz"))
  2096. (sha256
  2097. (base32 "037ns7dazk1z0vdpnzh2bvrnxxzd604pzl47765cgs141bihcb6g"))))
  2098. (inputs
  2099. (modify-inputs (package-inputs (p rust-async-process-1))
  2100. (prepend (p rust-libc-0.2)))))) ; new dependency
  2101. (define-public rust-trust-dns-proto ; requires by rust-trust-dns-openssl@0.21
  2102. (package
  2103. (inherit (p rust-trust-dns-proto-0.20))
  2104. (name "rust-trust-dns-proto")
  2105. (version "0.21.2")
  2106. (source
  2107. (origin
  2108. (method url-fetch)
  2109. (uri (crate-uri "trust-dns-proto" version))
  2110. (file-name (string-append name "-" version ".tar.gz"))
  2111. (sha256
  2112. (base32 "0p95ig8dfp30ga6gz01m683zy33abbna0givpgac6xwqym0g4ccw"))))
  2113. (inputs (modify-inputs (package-inputs (p rust-trust-dns-proto-0.20))
  2114. (prepend (p rust-tinyvec-1)
  2115. (p rust-tokio-native-tls-0.3)
  2116. (p rust-native-tls-0.2)
  2117. (p rust-rustls-0.20)
  2118. (p rust-tokio-rustls-0.22)
  2119. (p rust-rustls-pemfile-0.2)
  2120. (p rust-tokio-openssl-0.6)
  2121. (p rust-http-0.2)
  2122. (p rust-h2-0.3)
  2123. (p rust-bytes-1))))))
  2124. (define-public rust-trust-dns-openssl ; @0.20 doesn't build
  2125. (package
  2126. (inherit (p rust-trust-dns-openssl-0.20))
  2127. (name "rust-trust-dns-openssl")
  2128. (version "0.21.1")
  2129. (source
  2130. (origin
  2131. (method url-fetch)
  2132. (uri (crate-uri "trust-dns-openssl" version))
  2133. (file-name (string-append name "-" version ".tar.gz"))
  2134. (sha256
  2135. (base32 "0r8z7l757lf5yvsdxkb9324f663i3kyqkjjj3g3whilby5fz36z1"))))))
  2136. (define-public rust-trust-dns-native-tls ; likewise
  2137. (package
  2138. (inherit (p rust-trust-dns-native-tls-0.20))
  2139. (name "rust-trust-dns-native-tls")
  2140. (version "0.21.1")
  2141. (source
  2142. (origin
  2143. (method url-fetch)
  2144. (uri (crate-uri "trust-dns-native-tls" version))
  2145. (file-name (string-append name "-" version ".tar.gz"))
  2146. (sha256
  2147. (base32 "18yjln9h49rj2gxy79a8pipp3wl66g7cnjqkpa7azv955mkwcw97"))))))
  2148. (define-public rust-trust-dns-rustls ; likewise
  2149. (package
  2150. (inherit (p rust-trust-dns-rustls-0.20))
  2151. (name "rust-trust-dns-rustls")
  2152. (version "0.21.1")
  2153. (source
  2154. (origin
  2155. (method url-fetch)
  2156. (uri (crate-uri "trust-dns-rustls" version))
  2157. (file-name (string-append name "-" version ".tar.gz"))
  2158. (sha256
  2159. (base32 "1vsyy6zn0jv30nfyzs4y5rl6rnb4dm0m502gawk3klm2xq4dr5jx"))))))
  2160. (define-public rust-trust-dns-https ; @0.20 incompatible with rust-trust-dns-proto@0.21
  2161. (package
  2162. (inherit (p rust-trust-dns-https-0.20))
  2163. (name "rust-trust-dns-https")
  2164. (version "0.21.1")
  2165. (source
  2166. (origin
  2167. (method url-fetch)
  2168. (uri (crate-uri "trust-dns-https" version))
  2169. (file-name (string-append name "-" version ".tar.gz"))
  2170. (sha256
  2171. (base32 "0002375rn8hlakrvi0r0d7xm4kvcykxi93hrn2hz3hlx69gq814b"))))))
  2172. (define-public rust-trust-dns-resolver ; likewise
  2173. (package
  2174. (inherit (p rust-trust-dns-resolver-0.20))
  2175. (name "rust-trust-dns-resolver")
  2176. (version "0.21.2")
  2177. (source
  2178. (origin
  2179. (method url-fetch)
  2180. (uri (crate-uri "trust-dns-resolver" version))
  2181. (file-name (string-append name "-" version ".tar.gz"))
  2182. (sha256
  2183. (base32 "0n6m9yvhaip8dml5247d6qqdzf8bcrn4rvzwr685clc4xb175fp4"))))))
  2184. (define-public rust-askama-shared ; @0.11 doesn't build against new rust-nom
  2185. (package
  2186. (inherit (p rust-askama-shared-0.11))
  2187. (name "rust-askama-shared")
  2188. (version "0.12.2")
  2189. (source
  2190. (origin
  2191. (method url-fetch)
  2192. (uri (crate-uri "askama-shared" version))
  2193. (file-name (string-append name "-" version ".tar.gz"))
  2194. (sha256
  2195. (base32 "1l4fycmw65zyvfabf672sj2pc0ilfcj0y6a0csygq1wa26a2nwmz"))))
  2196. (inputs
  2197. (modify-inputs (package-inputs (p rust-askama-shared-0.11))
  2198. (prepend (p rust-mime-0.3)
  2199. (p rust-mime-guess-2))))))
  2200. (define-public rust-askama-derive
  2201. (package
  2202. (inherit (p rust-askama-derive-0.10))
  2203. (name "rust-askama-derive")
  2204. (version "0.11.2")
  2205. (source
  2206. (origin
  2207. (method url-fetch)
  2208. (uri (crate-uri "askama-derive" version))
  2209. (file-name (string-append name "-" version ".tar.gz"))
  2210. (sha256
  2211. (base32 "0wbb5l1x1bx8x8vvz4ayw196l9y64mi3vrmxm7pn8wmlx3k8ggw7"))))))
  2212. (define-public rust-clap-derive ; 3.0.0-beta.2 doesn't build against new rust-heck
  2213. (package
  2214. (inherit (p rust-clap-derive-3))
  2215. (name "rust-clap-derive")
  2216. (version "3.1.18")
  2217. (source
  2218. (origin
  2219. (method url-fetch)
  2220. (uri (crate-uri "clap-derive" version))
  2221. (file-name (string-append name "-" version ".tar.gz"))
  2222. (sha256
  2223. (base32 "0g53w6qkqcc122bqh51jzfg51147il643idvq1czxkr2x5306ci5"))))))
  2224. (define rust-proptest-derive
  2225. (package
  2226. (inherit (p rust-proptest-derive-0.1))
  2227. (name "rust-proptest-derive")
  2228. (version "0.3.0")
  2229. (source
  2230. (origin
  2231. (method url-fetch)
  2232. (uri (crate-uri "proptest-derive" version))
  2233. (file-name (string-append name "-" version ".tar.gz"))
  2234. (sha256
  2235. (base32
  2236. "1p4x6k1zxq9lrpk46npdnzj6894mjx5bpwkwrdk63ird72an5d4h"))
  2237. (modules '((guix build utils)))
  2238. (patches (list (local-file "rust-proptest-derive-upgrade-to-stable-proc-macro-ecosyst.patch")))))))
  2239. (define-public rust-syslog ; @0.4 doesn't build against new rust-time
  2240. (package
  2241. (inherit (p rust-syslog-4))
  2242. (name "rust-syslog")
  2243. (version "6.0.1")
  2244. (source
  2245. (origin
  2246. (method url-fetch)
  2247. (uri (crate-uri "syslog" version))
  2248. (file-name (string-append name "-" version ".tar.gz"))
  2249. (sha256
  2250. (base32 "1k0snk06c3gzq8g6kkqvpbbh5zg64nkzdjc303jda2hmd364904p"))))))
  2251. (define rust-ivf ; @0.1.0 doesn't build against new rust-bitstream-io@1
  2252. (package
  2253. (inherit (p rust-ivf-0.1))
  2254. (name "rust-ivf")
  2255. (version "0.1.1")
  2256. (source
  2257. (origin
  2258. (method url-fetch)
  2259. (uri (crate-uri "ivf" version))
  2260. (file-name (string-append name "-" version ".tar.gz"))
  2261. (sha256
  2262. (base32 "1qmpqnwlcvp7xpi1f6l63icaafpsak6hv7s326snffhs6rj1rc0g"))))))
  2263. (define rust-actix ; @0.10 doesn't build
  2264. (package
  2265. (inherit (p rust-actix-0.10))
  2266. (name "rust-actix")
  2267. (version "0.13.0")
  2268. (source
  2269. (origin
  2270. (method url-fetch)
  2271. (uri (crate-uri "actix" version))
  2272. (file-name (string-append name "-" version ".tar.gz"))
  2273. (sha256
  2274. (base32 "1mdy5i7f1px5kfyv3s5li985xry9zby4zc2bpy2qac8wr950ca7p"))))))
  2275. (define rust-actix-rt ; @1.1.1 doesn't build against new rust-tokio
  2276. (package
  2277. (inherit (p rust-actix-rt-1))
  2278. (name "rust-actix-rt")
  2279. (version "2.7.0")
  2280. (source
  2281. (origin
  2282. (method url-fetch)
  2283. (uri (crate-uri "actix-rt" version))
  2284. (file-name (string-append name "-" version ".tar.gz"))
  2285. (sha256
  2286. (base32 "000hxsbaxgd8jdmnw4dnlff4xdhggprnw2lk67pmiscqa4lnr8by"))))))
  2287. (define rust-actix-server
  2288. (package
  2289. (inherit (p rust-actix-server-1)) ; @1 doesn't build against new rust-actix-rt
  2290. (name "rust-actix-server")
  2291. (version "2.1.1")
  2292. (source
  2293. (origin
  2294. (method url-fetch)
  2295. (uri (crate-uri "actix-server" version))
  2296. (file-name (string-append name "-" version ".tar.gz"))
  2297. (sha256
  2298. (base32 "096q1hj88kgzfk6zv251sn57dlswh65r8ds6pdvv18cycn74z8qd"))))))
  2299. (define rust-actix-service ; new rust-actix-service doesn't build @1
  2300. (package
  2301. (inherit (p rust-actix-service-1))
  2302. (name "rust-actix-service")
  2303. (version "2.0.2")
  2304. (source
  2305. (origin
  2306. (method url-fetch)
  2307. (uri (crate-uri "actix-service" version))
  2308. (file-name (string-append name "-" version ".tar.gz"))
  2309. (sha256
  2310. (base32 "0fipjcc5kma7j47jfrw55qm09dakgvx617jbriydrkqqz10lk29v"))))))
  2311. (define rust-avif-serialize ; @0.6 doesn't build against new rust-arrayvec
  2312. (package
  2313. (inherit (@ (gnu packages crates-graphics) rust-avif-serialize-0.6))
  2314. (name "rust-avif-serialize")
  2315. (version "0.7.6")
  2316. (source
  2317. (origin
  2318. (method url-fetch)
  2319. (uri (crate-uri "avif-serialize" version))
  2320. (file-name (string-append name "-" version ".tar.gz"))
  2321. (sha256
  2322. (base32 "1fb9ld4iq8d5q5i9nr60hsdvdpjw4zb65kagv7xp08gphycwqy0f"))))))
  2323. (define rust-btoi ; required by rust-git-actor
  2324. (package
  2325. (name "rust-btoi")
  2326. (version "0.4.2")
  2327. (source (origin
  2328. (method url-fetch)
  2329. (uri (crate-uri "btoi" version))
  2330. (file-name (string-append name "-" version ".tar.gz"))
  2331. (sha256
  2332. (base32
  2333. "04ba4j96icaan10c613s2rwpn2kdbl8728qhz2xzi0dakyd8dh4p"))))
  2334. (build-system (@ (guix build-system cargo) cargo-build-system))
  2335. (arguments
  2336. `(#:cargo-inputs (("rust-num-traits" ,(p rust-num-traits-0.2)))
  2337. #:cargo-development-inputs
  2338. (("rust-bencher" ,(p rust-bencher-0.1))
  2339. ("rust-quickcheck" ,(p rust-quickcheck-0.9)))))
  2340. (home-page "https://github.com/niklasf/rust-btoi")
  2341. (synopsis "Parse integers directly from ASCII byte slices")
  2342. (description "Parse integers directly from ASCII byte slices")
  2343. (license (list license:expat license:asl2.0))))
  2344. (define rust-h2
  2345. (package
  2346. (inherit (p rust-h2-0.3)) ; new version required by new rust-reqwest
  2347. (name "rust-h2")
  2348. (version "0.3.13")
  2349. (source (origin
  2350. (method url-fetch)
  2351. (uri (crate-uri "h2" version))
  2352. (file-name (string-append name "-" version ".tar.gz"))
  2353. (sha256
  2354. (base32
  2355. "0msasdyv0n7avs5i1csjrs0rvdsp4k5z3fwl8rd53jbzcdnjra1p"))))))
  2356. (define rust-nasm-rs ; likewise
  2357. (package
  2358. (inherit (p rust-nasm-rs-0.2))
  2359. (name "rust-nasm-rs")
  2360. (version "0.2.4")
  2361. (source
  2362. (origin
  2363. (method url-fetch)
  2364. (uri (crate-uri "nasm-rs" version))
  2365. (file-name (string-append name "-" version ".tar.gz"))
  2366. (sha256
  2367. (base32 "10zl67i9gr7qarmnnnd8538mydw0yr6jlpbsvb5kxap9mr15h2ff"))))))
  2368. (define rust-miniz-oxide ; new rust-png incompatible with old rust-miniz-oxide (probably?)
  2369. (package
  2370. (inherit (p rust-miniz-oxide-0.4))
  2371. (name "rust-miniz-oxide")
  2372. (version "0.5.1")
  2373. (source
  2374. (origin
  2375. (method url-fetch)
  2376. (uri (crate-uri "miniz-oxide" version))
  2377. (file-name (string-append name "-" version ".tar.gz"))
  2378. (sha256
  2379. (base32 "10phz3ppw4p8pz4rwniy3qkw95wiq64kbvpb0l8kjcrzpka9pcnj"))))))
  2380. (define rust-dashmap ; rust-git-tempfile@2.0.1 requires new dashmap
  2381. (package
  2382. (inherit (p rust-dashmap-4))
  2383. (name "rust-dashmap")
  2384. (version "5.3.4")
  2385. (source (origin
  2386. (method url-fetch)
  2387. (uri (crate-uri "dashmap" version))
  2388. (file-name (string-append name "-" version ".tar.gz"))
  2389. (sha256
  2390. (base32
  2391. "13s4rdgb2rkavsgzjks23zb0zviz7x2g8fb4jwc2xkqwkhn9359l"))))))
  2392. (define rust-deflate ; maybe required for new rust-png
  2393. (package
  2394. (inherit (p rust-deflate-0.9))
  2395. (name "rust-deflate")
  2396. (version "1.0.0")
  2397. (source
  2398. (origin
  2399. (method url-fetch)
  2400. (uri (crate-uri "deflate" version))
  2401. (file-name (string-append name "-" version ".tar.gz"))
  2402. (sha256
  2403. (base32 "0bs319wa9wl7pn9j6jrrxg1gaqbak581rkx210cbix0qyljpwvy8"))))))
  2404. (define rust-png ; old version doesn't build against certain new crates
  2405. (package
  2406. (inherit (@ (gnu packages crates-graphics) rust-png-0.16))
  2407. (name "rust-png")
  2408. (version "0.17.5")
  2409. (source
  2410. (origin
  2411. (method url-fetch)
  2412. (uri (crate-uri "png" version))
  2413. (file-name (string-append name "-" version ".tar.gz"))
  2414. (sha256
  2415. (base32 "1fp3vnaxmjdv71dcakc21k07ir5s31dlx1mrazfqddzgaynw0f6w"))))))
  2416. (define rust-lebe ; required by new rust-exr
  2417. (package
  2418. (name "rust-lebe")
  2419. (version "0.5.1")
  2420. (source
  2421. (origin
  2422. (method url-fetch)
  2423. (uri (crate-uri "lebe" version))
  2424. (file-name (string-append name "-" version ".tar.gz"))
  2425. (sha256
  2426. (base32 "1zr6g3d35h349j0dsx6722lrjws00x2d8z0sy5p9wxdhimlivzby"))))
  2427. (build-system (@ (guix build-system cargo) cargo-build-system))
  2428. (arguments
  2429. `(#:cargo-development-inputs
  2430. (("rust-bencher" ,(p rust-bencher-0.1))
  2431. ("rust-byteorder" ,(p rust-byteorder-1)))))
  2432. (home-page "https://github.com/johannesvollmer/lebe")
  2433. (synopsis
  2434. "Tiny, dead simple, high performance endianness conversions with a generic API")
  2435. (description
  2436. "Tiny, dead simple, high performance endianness conversions with a generic API")
  2437. (license '(list license:bsd-3)))) ;; FIXME: Validate
  2438. (define rust-exr ; maybe required by new rust-image
  2439. (package
  2440. (name "rust-exr")
  2441. (version "1.4.2")
  2442. (source
  2443. (origin
  2444. (method url-fetch)
  2445. (uri (crate-uri "exr" version))
  2446. (file-name (string-append name "-" version ".tar.gz"))
  2447. (sha256
  2448. (base32 "05f269cpxvnyiwvdbijilwdcmfn9zs1a7wxdpvbfarszzc30xk0l"))))
  2449. (build-system (@ (guix build-system cargo) cargo-build-system))
  2450. (arguments
  2451. `(#:cargo-inputs
  2452. (("rust-bit-field" ,(p rust-bit-field-0.10))
  2453. ("rust-deflate" ,rust-deflate)
  2454. ("rust-flume" ,(p rust-flume-0.10))
  2455. ("rust-half" ,(p rust-half-1))
  2456. ("rust-inflate" ,(p rust-inflate-0.4))
  2457. ("rust-lebe" ,rust-lebe)
  2458. ("rust-smallvec" ,(p rust-smallvec-1))
  2459. ("rust-threadpool" ,(p rust-threadpool-1)))
  2460. #:cargo-development-inputs
  2461. (("rust-bencher" ,(p rust-bencher-0.1))
  2462. ;;("rust-image" ,(p rust-image-0.23)) ;; cycle
  2463. ("rust-rand" ,(p rust-rand-0.8))
  2464. ("rust-rayon" ,(p rust-rayon-1))
  2465. ("rust-walkdir" ,(p rust-walkdir-2)))))
  2466. (home-page "https://github.com/johannesvollmer/exrs")
  2467. (synopsis "Read and write OpenEXR files without any unsafe code")
  2468. (description "Read and write OpenEXR files without any unsafe code")
  2469. (license '(list license:bsd-3))))
  2470. (define rust-jpeg-decoder ; required by new rust-tiff
  2471. (package
  2472. (inherit (@ (gnu packages crates-graphics) rust-jpeg-decoder-0.1))
  2473. (name "rust-jpeg-decoder")
  2474. (version "0.2.6")
  2475. (source
  2476. (origin
  2477. (method url-fetch)
  2478. (uri (crate-uri "jpeg-decoder" version))
  2479. (file-name (string-append name "-" version ".tar.gz"))
  2480. (sha256
  2481. (base32 "0fsv9hns5yfm900h8f02agxiazfdwn5rq43milcjhx9yyw8aly4l"))))))
  2482. (define rust-tiff ; required by new rust-image
  2483. (package
  2484. (inherit (@ (gnu packages crates-graphics) rust-tiff-0.6))
  2485. (name "rust-tiff")
  2486. (version "0.7.2")
  2487. (source
  2488. (origin
  2489. (method url-fetch)
  2490. (uri (crate-uri "tiff" version))
  2491. (file-name (string-append name "-" version ".tar.gz"))
  2492. (sha256
  2493. (base32 "11i2smxqa35a921pqs3x5xl7kf3cav3fhqd4xiqafiplhq4xmykw"))))
  2494. (arguments
  2495. `(#:cargo-inputs
  2496. (("rust-flate2" ,(p rust-flate2-1))
  2497. ("rust-jpeg-decoder" ,rust-jpeg-decoder)
  2498. ("rust-weezl" ,(p rust-weezl-0.1)))
  2499. #:cargo-development-inputs
  2500. (("rust-criterion" ,(p rust-criterion-0.3)))))))
  2501. (define rust-image ; old rust-image doesn't build
  2502. (package
  2503. (inherit (@ (gnu packages crates-graphics) rust-image-0.23))
  2504. (name "rust-image")
  2505. (version "0.24.2")
  2506. (source
  2507. (origin
  2508. (method url-fetch)
  2509. (uri (crate-uri "image" version))
  2510. (file-name (string-append name "-" version ".tar.gz"))
  2511. (sha256
  2512. (base32 "04hjf319s6hswfmy0llv3c0bfc6yidic0nij5r8f4sr5pkbxkv98"))))))
  2513. (define rust-miette ; required by new rust-watchexec
  2514. (package
  2515. (name "rust-miette")
  2516. (version "4.7.1")
  2517. (source (origin
  2518. (method url-fetch)
  2519. (uri (crate-uri "miette" version))
  2520. (file-name (string-append name "-" version ".tar.gz"))
  2521. (sha256
  2522. (base32
  2523. "1365xpl8l66lsvn6bk4mhbpxf5gciiazj4apyiaqn87r8jg3540w"))))
  2524. (build-system (@ (guix build-system cargo) cargo-build-system))
  2525. (arguments
  2526. `(#:cargo-inputs (("rust-atty" ,(p rust-atty-0.2))
  2527. ("rust-backtrace" ,(p rust-backtrace-0.3))
  2528. ("rust-miette-derive" ,rust-miette-derive)
  2529. ("rust-once-cell" ,(p rust-once-cell-1))
  2530. ;; ("rust-owo-colors" ,(p rust-owo-colors-3)) ; TODO
  2531. ;; ("rust-supports-color" ,(p rust-supports-color-1)) ; TODO
  2532. ;; ("rust-supports-hyperlinks" ,(p rust-supports-hyperlinks-1)) ; TODO
  2533. ;; ("rust-supports-unicode" ,(p rust-supports-unicode-1)) ; TODO
  2534. ("rust-terminal-size" ,(p rust-terminal-size-0.1))
  2535. ("rust-textwrap" ,(p rust-textwrap-0.12)) ; TODO: requires @0.15 in Cargo.toml
  2536. ("rust-thiserror" ,(p rust-thiserror-1))
  2537. ("rust-unicode-width" ,(p rust-unicode-width-0.1)))
  2538. #:cargo-development-inputs
  2539. (("rust-futures" ,(p rust-futures-0.3))
  2540. ("rust-indenter" ,(p rust-indenter-0.3))
  2541. ("rust-rustversion" ,(p rust-rustversion-1))
  2542. ("rust-semver" ,(p rust-semver-1))
  2543. ("rust-syn" ,(p rust-syn-1))
  2544. ("rust-trybuild" ,(p rust-trybuild-1)))))
  2545. (home-page "https://github.com/zkat/miette")
  2546. (synopsis
  2547. "Fancy diagnostic reporting library and protocol for us mere mortals who aren't compiler hackers.")
  2548. (description
  2549. "Fancy diagnostic reporting library and protocol for us mere mortals who aren't
  2550. compiler hackers.")
  2551. (license license:asl2.0)))
  2552. (define rust-miette-derive ; required by rust-miette
  2553. (package
  2554. (name "rust-miette-derive")
  2555. (version "4.7.1")
  2556. (source (origin
  2557. (method url-fetch)
  2558. (uri (crate-uri "miette-derive" version))
  2559. (file-name (string-append name "-" version ".tar.gz"))
  2560. (sha256
  2561. (base32
  2562. "0k0ph38lxzqamaabind8463j2k5qjg6jhhbcdrg1pkqvfrdw8nvb"))))
  2563. (build-system (@ (guix build-system cargo) cargo-build-system))
  2564. (arguments
  2565. `(#:cargo-inputs (("rust-proc-macro2" ,(p rust-proc-macro2-1))
  2566. ("rust-quote" ,(p rust-quote-1))
  2567. ("rust-syn" ,(p rust-syn-1)))))
  2568. (home-page "https://github.com/zkat/miette")
  2569. (synopsis "Derive macros for miette. Like `thiserror` for Diagnostics.")
  2570. (description
  2571. "Derive macros for miette. Like `thiserror` for Diagnostics.")
  2572. (license license:asl2.0)))
  2573. (define rust-pico-args
  2574. (package
  2575. (name "rust-pico-args")
  2576. (version "0.4.2")
  2577. (source
  2578. (origin
  2579. (method url-fetch)
  2580. (uri (crate-uri "pico-args" version))
  2581. (file-name (string-append name "-" version ".tar.gz"))
  2582. (sha256
  2583. (base32 "0s646i0pbcck300rqldb21m151zxp66m3mdskha063blrfbcv2yv"))))
  2584. (build-system (@ (guix build-system cargo) cargo-build-system))
  2585. (home-page "https://github.com/RazrFalcon/pico-args")
  2586. (synopsis "An ultra simple CLI arguments parser.")
  2587. (description "An ultra simple CLI arguments parser.")
  2588. (license '(list license:expat))))
  2589. (define rust-pwd
  2590. (package
  2591. (name "rust-pwd")
  2592. (version "1.3.1")
  2593. (source (origin
  2594. (method url-fetch)
  2595. (uri (crate-uri "pwd" version))
  2596. (file-name (string-append name "-" version ".tar.gz"))
  2597. (sha256
  2598. (base32
  2599. "0yxhkkkqi1ckln37vdz6gc16aykw88h02548rafi153mhl207jpr"))))
  2600. (build-system (@ (guix build-system cargo) cargo-build-system))
  2601. (arguments
  2602. `(#:cargo-inputs
  2603. (("rust-failure" ,(p rust-failure-0.1))
  2604. ("rust-libc" ,(p rust-libc-0.2)))))
  2605. (home-page "https://gitlab.com/pwoolcoc/pwd.git")
  2606. (synopsis "Safe interface to pwd.h
  2607. ")
  2608. (description "Safe interface to pwd.h")
  2609. (license 'unknown-license!)));; TODO: https://gitlab.com/pwoolcoc/pwd/-/issues/1
  2610. (define rust-lalrpop-util
  2611. (package
  2612. (inherit (p rust-lalrpop-util-0.19))
  2613. (name "rust-lalrpop-util")
  2614. (version "0.19.8")
  2615. (source
  2616. (origin
  2617. (method url-fetch)
  2618. (uri (crate-uri "lalrpop-util" version))
  2619. (file-name (string-append name "-" version ".tar.gz"))
  2620. (sha256
  2621. (base32 "1i1dbp489pjzsmxqhnsc47p37akkjbfawk2g861xkd79g34rdxxw"))))))
  2622. (define rust-lalrpop ; old lalrpop doesn't build
  2623. (package
  2624. (inherit (p rust-lalrpop-0.19))
  2625. (name "rust-lalrpop")
  2626. (version "0.19.8")
  2627. (source
  2628. (origin
  2629. (method url-fetch)
  2630. (uri (crate-uri "lalrpop" version))
  2631. (file-name (string-append name "-" version ".tar.gz"))
  2632. (sha256
  2633. (base32
  2634. "08yqsp93vijrhskarrlxb16bbbyyakzhlm34z9vg460f3cs5a15k"))))))
  2635. (define rust-local-waker ; used by rust-local-channel, which is used by rust-actix-http
  2636. (package
  2637. (name "rust-local-waker")
  2638. (version "0.1.3")
  2639. (source
  2640. (origin
  2641. (method url-fetch)
  2642. (uri (crate-uri "local-waker" version))
  2643. (file-name (string-append name "-" version ".tar.gz"))
  2644. (sha256
  2645. (base32 "1w9zqlh18mymvb82ya0sailiy5d3wsjamaakgl70x50i6vmpckz3"))))
  2646. (build-system (@ (guix build-system cargo) cargo-build-system))
  2647. (home-page "https://github.com/actix/actix-net.git")
  2648. (synopsis "A synchronization primitive for thread-local task wakeup")
  2649. (description
  2650. "This package provides a synchronization primitive for thread-local task wakeup")
  2651. (license (list license:expat license:asl2.0))))
  2652. (define rust-local-channel
  2653. (package
  2654. (name "rust-local-channel")
  2655. (version "0.1.3")
  2656. (source
  2657. (origin
  2658. (method url-fetch)
  2659. (uri (crate-uri "local-channel" version))
  2660. (file-name (string-append name "-" version ".tar.gz"))
  2661. (sha256
  2662. (base32 "177wqgadrlw6m7r6xxafkj58asgpgbpv1ww4gx258v2cx703wc3z"))))
  2663. (build-system (@ (guix build-system cargo) cargo-build-system))
  2664. (arguments
  2665. `(#:cargo-inputs
  2666. (("rust-futures-core" ,rust-futures-core-0.3)
  2667. ("rust-futures-sink" ,rust-futures-sink-0.3)
  2668. ("rust-futures-util" ,rust-futures-util-0.3)
  2669. ("rust-local-waker" ,rust-local-waker))))
  2670. (home-page "https://github.com/actix/actix-net.git")
  2671. (synopsis
  2672. "A non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue")
  2673. (description
  2674. "This package provides a non-threadsafe multi-producer, single-consumer,
  2675. futures-aware, FIFO queue")
  2676. (license (list license:expat license:asl2.0))))
  2677. (define rust-nettle-7 ; old rust-nettle doesn't build
  2678. (package
  2679. (inherit (p rust-nettle-7))
  2680. (name "rust-nettle")
  2681. (version "7.2.0")
  2682. (source
  2683. (origin
  2684. (method url-fetch)
  2685. (uri (crate-uri "nettle" version))
  2686. (file-name (string-append name "-" version ".tar.gz"))
  2687. (sha256
  2688. (base32
  2689. "0da0d5kv2w93zjy7acsxvmg969ybi05bqibfs72nj0ri16l97lgm"))))))
  2690. (define rust-nettle-sys-2 ; for new rust-nettle
  2691. (package
  2692. (inherit (p rust-nettle-sys-2))
  2693. (name "rust-nettle-sys")
  2694. (version "2.1.0")
  2695. (source
  2696. (origin
  2697. (method url-fetch)
  2698. (uri (crate-uri "nettle-sys" version))
  2699. (file-name (string-append name "-" version ".tar.gz"))
  2700. (sha256
  2701. (base32
  2702. "05rdwqzkv83wvrby2x1xwjn3gv2795cwxwycjqhs7qw3g1f6hfxi"))))
  2703. (arguments
  2704. `(#:cargo-inputs
  2705. (("rust-bindgen" ,(p rust-bindgen-0.57))
  2706. ("rust-cc" ,(p rust-cc-1))
  2707. ("rust-libc" ,(p rust-libc-0.2))
  2708. ("rust-pkg-config" ,(p rust-pkg-config-0.3))
  2709. ("rust-tempfile" ,(p rust-tempfile-3))
  2710. ("rust-vcpkg" ,(p rust-vcpkg-0.2)))))))
  2711. (define rust-firestorm ; not yet in Guix, required by new rust-actix-router
  2712. (package
  2713. (name "rust-firestorm")
  2714. (version "0.5.1")
  2715. (source
  2716. (origin
  2717. (method url-fetch)
  2718. (uri (crate-uri "firestorm" version))
  2719. (file-name (string-append name "-" version ".tar.gz"))
  2720. (sha256
  2721. (base32 "162zjw9skavhmcfsjzsywwa6yj492i98ljx8m8m7x99djhn6qprc"))))
  2722. (build-system (@ (guix build-system cargo) cargo-build-system))
  2723. (home-page "https://github.com/That3Percent/firestorm")
  2724. (synopsis "A low overhead intrusive flamegraph profiler.")
  2725. (description
  2726. "This package provides a low overhead intrusive flamegraph profiler.")
  2727. (license license:expat)))
  2728. ;; TODO: lots of rust-git-... crates, maybe (gnu packages gitoxide)?
  2729. (define rust-hdrhistogram ; old hdrhistogram doesn't build against new rust-nom
  2730. (package
  2731. (inherit (p rust-hdrhistogram-6))
  2732. (name "rust-hdrhistogram")
  2733. (version "7.5.0")
  2734. (source (origin
  2735. (method url-fetch)
  2736. (uri (crate-uri "hdrhistogram" version))
  2737. (file-name (string-append name "-" version ".tar.gz"))
  2738. (sha256
  2739. (base32
  2740. "1h0905yk0pxgxfk4kzlfmnglm6ky1ssbrpf4ars4yb5y25q2nrri"))))))
  2741. (define rust-headers ; @0.3.3 doesn't build against new rust-time
  2742. (package
  2743. (inherit (p rust-headers-0.3))
  2744. (name "rust-headers")
  2745. (version "0.3.7")
  2746. (source
  2747. (origin
  2748. (method url-fetch)
  2749. (uri (crate-uri "headers" version))
  2750. (file-name (string-append name "-" version ".tar.gz"))
  2751. (sha256
  2752. (base32 "0pd5i8aywnmx9q7wfzn9bs0jq2fm5rmk0kdhcnmy1qcbg3jpizsc"))))))
  2753. (define rust-iso8601 ; required for compatibility with new rust-nom
  2754. (package
  2755. (inherit (p rust-iso8601-0.1))
  2756. (name "rust-iso8601")
  2757. (version "0.4.2")
  2758. (source (origin
  2759. (method url-fetch)
  2760. (uri (crate-uri "iso8601" version))
  2761. (file-name (string-append name "-" version ".tar.gz"))
  2762. (sha256
  2763. (base32
  2764. "15nfg6d4qlniw4gk7039s5y07lzgr1dp9snsw63lsxarnyz4zfg5"))))))
  2765. (define rust-s3handler ; @.7 doesn't build against new rust-hmac
  2766. (package
  2767. (inherit (p rust-s3handler-0.7))
  2768. (name "rust-s3handler")
  2769. (version "0.8.0")
  2770. (source (origin
  2771. (method url-fetch)
  2772. (uri (crate-uri "s3handler" version))
  2773. (file-name (string-append name "-" version ".tar.gz"))
  2774. (sha256
  2775. (base32
  2776. "0142vqnkknc9ibv8wn3nc0pqhxqgngrrily7v46zzjwyc01pmg4z"))))))
  2777. (define rust-postgres-protocol ; old version doesn't build against new rust-hmac
  2778. (package
  2779. (inherit (p rust-postgres-protocol-0.6))
  2780. (name "rust-postgres-protocol")
  2781. (version "0.6.4")
  2782. (source (origin
  2783. (method url-fetch)
  2784. (uri (crate-uri "postgres-protocol" version))
  2785. (file-name (string-append name "-" version ".tar.gz"))
  2786. (sha256
  2787. (base32
  2788. "0365asqd8v2iij8sl0282rrc0ixzkixl0jr0m2day0vfjnznr347"))))))
  2789. (define rust-postgres-types ; old version doesn't build against new rust-time
  2790. (package
  2791. (inherit (p rust-postgres-types-0.2))
  2792. (name "rust-postgres-types")
  2793. (version "0.2.3")
  2794. (source (origin
  2795. (method url-fetch)
  2796. (uri (crate-uri "postgres-types" version))
  2797. (file-name (string-append name "-" version ".tar.gz"))
  2798. (sha256
  2799. (base32
  2800. "129xn3q32r92ylwggrlg5l0z2w8hfx6d56z8j291cwws32vyimpb"))))))
  2801. (define rust-reqwest ; @0.11.4 fails to build and uses deprecated functions from cookie_store
  2802. (package
  2803. (inherit (p rust-reqwest-0.11))
  2804. (name "rust-reqwest")
  2805. (version "0.11.10")
  2806. (source (origin
  2807. (method url-fetch)
  2808. (uri (crate-uri "reqwest" version))
  2809. (file-name (string-append name "-" version ".tar.gz"))
  2810. (sha256
  2811. (base32
  2812. "1ss1ijakw48dgpxaj5a38pk0r3vmzhdgaj842ssfir9m9ymgg8a6"))))))
  2813. (define rust-zip ; @0.5.13 doesn't compile against new rust-time
  2814. (package
  2815. (inherit (p rust-zip-0.5))
  2816. (name "rust-zip")
  2817. (version "0.6.2")
  2818. (source (origin
  2819. (method url-fetch)
  2820. (uri (crate-uri "zip" version))
  2821. (file-name (string-append name "-" version ".tar.gz"))
  2822. (sha256
  2823. (base32
  2824. "138brxnsknbvdh7h5h4rysfpcgvspp3pa177jsscnlmvfg7mn8mz"))))))
  2825. (define rust-tungstenite ; @0.11 doesn't build
  2826. (package
  2827. (inherit (p rust-tungstenite-0.11))
  2828. (name "rust-tungstenite")
  2829. (version "0.17.2")
  2830. (source
  2831. (origin
  2832. (method url-fetch)
  2833. (uri (crate-uri "tungstenite" version))
  2834. (file-name (string-append name "-" version ".tar.gz"))
  2835. (sha256
  2836. (base32 "1x848392ihy5mh098sns0lcmb5rdwkxpmdcfya108mz783m2ssnr"))))))
  2837. (define rust-tokio-tungstenite ; @0.11 doesn't build
  2838. (package
  2839. (inherit (p rust-tokio-tungstenite-0.11))
  2840. (name "rust-tokio-tungstenite")
  2841. (version "0.17.1")
  2842. (source
  2843. (origin
  2844. (method url-fetch)
  2845. (uri (crate-uri "tokio-tungstenite" version))
  2846. (file-name (string-append name "-" version ".tar.gz"))
  2847. (sha256
  2848. (base32 "1bi1z1l8392v20mg24gryw5jrm0166wxa155z138qma958is3k86"))))))
  2849. (define rust-totp-lite ; @1.0 doesn't build against new rust-digest
  2850. (package
  2851. (inherit (p rust-totp-lite-1))
  2852. (name "rust-totp-lite")
  2853. (version "2.0.0")
  2854. (source (origin
  2855. (method url-fetch)
  2856. (uri (crate-uri "totp-lite" version))
  2857. (file-name (string-append name "-" version ".tar.gz"))
  2858. (sha256
  2859. (base32
  2860. "1yi9s6firixay11rahqshdv07ih8i27fxqqrrshfk3wwbn3rdi2w"))))))
  2861. (define rust-unicode-bom ; required by rust-git-config
  2862. (package
  2863. (name "rust-unicode-bom")
  2864. (version "1.1.4")
  2865. (source (origin
  2866. (method url-fetch)
  2867. (uri (crate-uri "unicode-bom" version))
  2868. (file-name (string-append name "-" version ".tar.gz"))
  2869. (sha256
  2870. (base32
  2871. "0cpc54ssrlrwm3x8dm7z1dgwj9r9bxjls620ra1vfxfq87snkv33"))))
  2872. (build-system (@ (guix build-system cargo) cargo-build-system))
  2873. (home-page "https://gitlab.com/philbooth/unicode-bom")
  2874. (synopsis "Unicode byte-order mark detection for files and byte arrays.")
  2875. (description
  2876. "Unicode byte-order mark detection for files and byte arrays.")
  2877. (license license:asl2.0)))
  2878. (define rust-calloop ; old version doesn't build against new rust-nix
  2879. (package
  2880. (inherit (p rust-calloop-0.6))
  2881. (name "rust-calloop")
  2882. (version "0.10.0")
  2883. (source (origin
  2884. (method url-fetch)
  2885. (uri (crate-uri "calloop" version))
  2886. (file-name (string-append name "-" version ".tar.gz"))
  2887. (sha256
  2888. (base32
  2889. "0bp0h8d8k7r05ggp7ip3y26anwaspld134mgx46s9s1z913128l4"))))
  2890. (inputs
  2891. (modify-inputs (package-inputs (p rust-calloop-0.6))
  2892. (prepend
  2893. (p rust-thiserror-1) ; TODO: where to put macros (native/non-native)?
  2894. (p rust-vec-map-0.8) rust-futures-util-0.3 rust-slotmap)))))
  2895. (define rust-command-group
  2896. (package
  2897. (name "rust-command-group")
  2898. (version "1.0.8")
  2899. (source (origin
  2900. (method url-fetch)
  2901. (uri (crate-uri "command-group" version))
  2902. (file-name (string-append name "-" version ".tar.gz"))
  2903. (sha256
  2904. (base32
  2905. "0b7d9gy9dhw4jqx5x8njzmaifgxqw0nywjry7bgmjjlv81psia7p"))))
  2906. (build-system (@ (guix build-system cargo) cargo-build-system))
  2907. (arguments
  2908. `(#:cargo-inputs (("rust-async-trait" ,(p rust-async-trait-0.1))
  2909. ("rust-nix" ,(p rust-nix-0.22))
  2910. ("rust-tokio" ,(p rust-tokio-1)))
  2911. #:cargo-development-inputs
  2912. (("rust-tokio" ,(p rust-tokio-1)))))
  2913. (home-page "https://github.com/watchexec/command-group")
  2914. (synopsis "Extension to Command to spawn in a process group")
  2915. (description "Extension to Command to spawn in a process group")
  2916. (license (list license:asl2.0 license:expat))))
  2917. (define rust-config ; @0.11 doesn't build against new rust-nom
  2918. (package
  2919. (inherit (p rust-config-0.11))
  2920. (name "rust-config")
  2921. (version "0.13.1")
  2922. (source (origin
  2923. (method url-fetch)
  2924. (uri (crate-uri "config" version))
  2925. (file-name (string-append name "-" version ".tar.gz"))
  2926. (sha256
  2927. (base32
  2928. "06xk2846zsa239h2jr34jbnz9d8hyz4d6m9v9q1bbpvf9fviga9y"))))))
  2929. (define rust-crossterm
  2930. (package
  2931. (inherit (p rust-crossterm-0.20)) ; @0.19 and @0.20 and don't build against new dependencies
  2932. (name "rust-crossterm")
  2933. (version "0.23.2")
  2934. (source (origin
  2935. (method url-fetch)
  2936. (uri (crate-uri "crossterm" version))
  2937. (file-name (string-append name "-" version ".tar.gz"))
  2938. (sha256
  2939. (base32
  2940. "05ygjddfp70961ij7cbvrrwz88r09hghdpcqbf50z4c1yyj2w452"))))))
  2941. (define rust-ctrlc ; for compatibility with new rust-nix
  2942. (package
  2943. (inherit (p rust-ctrlc-3))
  2944. (name "rust-ctrlc")
  2945. (version "3.2.2")
  2946. (source (origin
  2947. (method url-fetch)
  2948. (uri (crate-uri "ctrlc" version))
  2949. (file-name (string-append name "-" version ".tar.gz"))
  2950. (sha256
  2951. (base32
  2952. "0r88w8l4hxc64w43xlwjk5f60vg57vdahnjy3w5f0qb89slflzxk"))))))
  2953. (define rust-slotmap ; required by new rust-calloop
  2954. (package
  2955. (name "rust-slotmap")
  2956. (version "1.0.6")
  2957. (source (origin
  2958. (method url-fetch)
  2959. (uri (crate-uri "slotmap" version))
  2960. (file-name (string-append name "-" version ".tar.gz"))
  2961. (sha256
  2962. (base32
  2963. "0hhkvsc3x79c7fh97b3padjhssd19hzdyyiv291mr3qf3lk8xq71"))))
  2964. (build-system (@ (guix build-system cargo) cargo-build-system))
  2965. (arguments
  2966. `(#:cargo-inputs (("rust-serde" ,(p rust-serde-1))
  2967. ("rust-version-check" ,(p rust-version-check-0.9)))
  2968. #:cargo-development-inputs
  2969. (("rust-fxhash" ,(p rust-fxhash-0.2))
  2970. ("rust-quickcheck" ,(p rust-quickcheck-0.9))
  2971. ("rust-serde" ,(p rust-serde-1))
  2972. ("rust-serde-derive" ,(p rust-serde-derive-1))
  2973. ("rust-serde-json" ,(p rust-serde-json-1)))))
  2974. (home-page "https://github.com/orlp/slotmap")
  2975. (synopsis "Slotmap data structure")
  2976. (description "Slotmap data structure")
  2977. (license license:zlib)))
  2978. (define rust-xml5ever
  2979. (package
  2980. (inherit (p rust-xml5ever-0.16)) ; @0.16 doesn't build against new rust-time
  2981. (name "rust-xml5ever")
  2982. (version "0.17.0")
  2983. (source (origin
  2984. (method url-fetch)
  2985. (uri (crate-uri "xml5ever" version))
  2986. (file-name (string-append name "-" version ".tar.gz"))
  2987. (sha256
  2988. (base32
  2989. "0l76v0c228c92sskiflpsy19c0bgc8q7flhlfanm32zrbb8f2d20"))))))
  2990. ;; Some of these are only used for tests, cause cycles, ???,
  2991. ;; so remove them. (TODO: some of them can probably now be removed.)
  2992. ;; TODO: write a "guix style" thing for doing this.
  2993. ;;
  2994. ;; "rust-foo": remove all dependencies named "rust-foo"
  2995. ;; ("rust-foo" -> "rust-bar"): remove the dependency "rust-bar" when used by rust-foo
  2996. ;; ("rust-foo" #:for-dependent ,p): remove the dependency "rust-foo when used by a package for which the predicate p returns 'true'
  2997. (define %removed-dependencies
  2998. ;; Unconditional dependencies
  2999. `("rust-derive-error-chain" ; doesn't build (even when updated) and unmaintained, avoid it for now
  3000. "rust-crypto-tests" ; test dependency doesn't build against new rust-digest, avoid for now
  3001. "rust-objc" "rust-objc-exception" "rust-objc-foundation" "rust-objc-id" "rust-objc-test-utils" ; requires gcc-objc, but gcc-objc doesn't seem to be used by any Rust crate, so it looks like these objc crates have never worked in the first place in Guix.
  3002. "rust-avro-rs" ; doesn't compile against new rust-digest and longer maintained, replace by apache-avro, let's see if we can avoid it ...
  3003. ("rust-quickcheck"
  3004. ;; Usually only required for tests.
  3005. ;; Avoid (quickcheck env-logger humantime chrono bincode) cycle.
  3006. ;; Apparently sequoia-sq requires rust-quickcheck.
  3007. #:for-dependent
  3008. ,(lambda (dependent)
  3009. (not (string=? (package-name dependent) "sequoia-sq"))))
  3010. "rust-pear" "rust-pear-codegen" ; current version in Guix requires non-stable
  3011. "rust-mesalink" ; doesn't build against recent rust-rustls
  3012. "rust-defmt" ; accidentally requires unstable-test?
  3013. "rust-heapsize-plugin" ; makes use of removed features
  3014. "rust-rustc-test" ; doesn't build against recent rust-time
  3015. "rust-serde-hjson" ; doesn't build against new rust-serde
  3016. "rust-mio-uds" ; doesn't build against new rust-mio, now included in new rust-mio
  3017. "rust-speculate" ; @0.1.2 doesn't build against recent rust-syn
  3018. "rust-skeptic" ; @0.13.4 doesn't build
  3019. "rust-termbox-sys" ; downloads the library it wraps at compile time, cannot have work in Guix in the first place.
  3020. "rust-boxxy" ; doesn't build and not supposed to be used ‘in production’
  3021. "rust-macrotest"
  3022. ("rust-mio-extras" ; doesn't build against new rust-mio, so avoid it where possible. Don't remove it unconditionally, because it's required by rust-notify@4 and rust-notify@4 is required by rust-watchexec
  3023. #:for-dependent
  3024. ,(lambda (dependent)
  3025. (not (and (string=? "rust-notify" (package-name dependent))
  3026. (string-prefix? "4." (package-version dependent))))))
  3027. "rust-tokio-tls" ; @0.3.1 doesn't build
  3028. "rust-rust-hawktracer-sys" ; only for tracing (debugging-only), so maybe the build failure can be avoided?
  3029. "rust-ntest" "rust-ntest-test-cases" ; test-only, and @0.3.4 tries using non-exported syn::export
  3030. "rust-afl" ; TODO: move to 'native-inputs'/development-inputs
  3031. "rust-js-sys" ; TODO: guix doesn't support those targets (yet)
  3032. "rust-cortex-m" ; ARM targets not yet supported for Rust in Guix
  3033. ;;"rust-cc" ;; todo: build.rs, hence move to 'native-inputs'?
  3034. "rust-stdweb" "rust-web-sys" ;; web, js, wasm?
  3035. "rust-gloo-timers" ; web-only crate
  3036. "rust-bencher" ; FTB
  3037. "rust-criterion" "rust-criterion-cycles-per-byte" ;; fails to build because rust-async-log-attributes fails to build
  3038. "rust-femme" ; some dependencies fail to build
  3039. ("rust-ptree" -> "rust-config") ; only required by disabled "config" feature
  3040. ("rust-ptree" -> "rust-directories") ; likewise
  3041. "rust-proptest" "rust-proptest-derive"
  3042. "rust-futures-util-preview" ; futures-util has been updated?
  3043. "rust-iron" ; its dependency rust-hyper-native-tls fails to build
  3044. "rust-rocket" ; its dependency rust-hyper-sync-rustls fails to build
  3045. "rust-nickel" ; fails to build
  3046. "rust-kqueue-sys" "rust-kqueue" "rust-errno-dragonfly" ;; TODO: BSD not supported
  3047. "rust-pdcurses-sys" ; bundles pdcurses, maybe actually unused?, see #56031
  3048. ;; TODO: how do the three following crates even work?
  3049. "rust-rustc-std-workspace-std"
  3050. "rust-rustc-std-workspace-core"
  3051. "rust-rustc-std-workspace-alloc"
  3052. "rust-runtime" ; deprecated and doesn't build
  3053. ;; rust-structopt-derive doesn't build and upstream recommends
  3054. ;; migrating to 'clap'
  3055. #;"rust-structopt" #;"rust-structopt-derive"
  3056. "rust-compiler-builtins"
  3057. "rust-compiletest-rs" ;; TODO: rustc-dev?
  3058. "rust-winapi" "rust-winapi-wsapoll" "rust-kernel32-sys" "rust-user32-sys" "rust-winreg" "rust-wepoll-sys" "rust-wepoll-sys-stjepang" "rust-ipconfig" "rust-windows" "rust-windows-x86-64-msvc" "rust-windows-x86-64-gnu" "rust-windows-i686-msvc" "rust-windows-i686-gnu" "rust-windows-aarch64-msvc" "rust-windows-sys" "rust-windows-gen" "rust-windows-macros" ; skip Windows support for now
  3059. "rust-nodrop-union" ; required unstable, and deprecated
  3060. "rust-sleef-sys" ; requires unstable
  3061. "rust-packed-simd" "rust-packed-simd-2" ; requires unstable (TODO: rust-packed-simd-2?)
  3062. "rust-security-framework" "rust-cocoa" "rust-cocoa-foundation" "rust-core-foundation" "rust-core-foundation-sys" "rust-core-text" "rust-fsevent" "rust-fsevent-sys" "rust-core-video-sys" "rust-core-graphics" "rust-core-graphics-types" "rust-objc-foundation" "rust-security-framework-sys" "rust-readkey" ; non-Linux, non-Hurd things,
  3063. "rust-ndk" "rust-ndk-glue" "rust-ndk-sys" "rust-ndk-macro" "rust-android-logger" "rust-android-glue" "rust-android-log-sys" ; Android userspace is not yet supported
  3064. "rust-redox-syscall" "rust-redox-termios" "rust-redox-users" ; Redox is not a supported target of Guix
  3065. "rust-mach" ; skip Mach (used by Hurd and others) support for now.
  3066. "rust-ws2-32-sys"
  3067. "rust-winapi-util" "rust-winapi-build"
  3068. "rust-fuchsia-zircon" "rust-fuchsia-zircon-sys" "rust-fuchsia-cprng" ; fuchsia not supported by Guix
  3069. "rust-dwrote" ; Windows-only, skip for now, cross-compilation can be implemented later
  3070. "rust-core-arch" ; doesn't build, nowadays part of Rust itself?
  3071. "rust-hermit-abi"
  3072. "rust-model" ;; doesn't build, avoid for now
  3073. "rust-scratch" ; appears to be incompatible with antioxidant's compilation model without shenanigans
  3074. "rust-tokio-core" ;; doesn't exist in recent tokios
  3075. "rust-tokio-process" ;; doesn't exist in recent tokios
  3076. "rust-tokio-executor" ;; doesn't exist in recent tokios, I think?
  3077. "rust-tokio-io" ;; doesn't exist in recent tokios, I think?
  3078. #;"rust-lazy-static"
  3079. "rust-version-sync"
  3080. "rust-trybuild"
  3081. "rust-clang-ast-test-suite" ; empty, doesn't build
  3082. "rust-cxx-test-suite" ; likewise
  3083. "rust-clippy"
  3084. "rust-cargo" "rust-cargo-c" ; rust-cargo doesn't build even when updated to @0.62
  3085. "rust-tokio-mock-task" ; doesn't build
  3086. "rust-tokio-test"
  3087. "rust-rand-xorshift"
  3088. "rust-serde-test"
  3089. "rust-actix-testing" ; doesn't build
  3090. "rust-actix-connect" ; doesn't build and no update available
  3091. ("rust-xml5ever" -> "rust-time") ; new version doesn't use rust-time anymore
  3092. "rust-wasm-bindgen" "rust-wasi"
  3093. "rust-wasm-bindgen-futures" ; ECMAScript-only and doesn't build
  3094. "rust-wasm-bindgen-test"
  3095. ("rust-average" -> "rust-rand-distr") ; test cycle?
  3096. ("rust-cxxbridge-macro" -> "rust-cxx") ; test cycle?
  3097. ;; Maybe a test or example cycle?
  3098. ("rust-bytemuck-derive" -> "rust-bytemuck")
  3099. ("rust-nasm-rs" -> "rust-arrayvec") ; not required anymore due to package update
  3100. ("rust-diesel-derives" -> "rust-diesel")
  3101. ("rust-colored" -> "rust-rspec")
  3102. ;; Not a dependency anymore, resolve cycle.
  3103. ("rust-pkcs8" -> "rust-pkcs1")
  3104. ;; Break cycle (test or something like that?)
  3105. ("rust-quote" -> "rust-rustversion")
  3106. ("rust-multipart" -> "rust-hyper") ; incompatible with hyper>0.10
  3107. ;; Break cycle.
  3108. ("rust-async-attributes" -> "rust-async-std")
  3109. ("rust-async-channel" -> "rust-blocking")
  3110. ("rust-async-io" -> "rust-async-net")
  3111. ;; Optional dependency cycle
  3112. ("rust-async-std" -> "rust-surf")
  3113. ;; Optional dependency cycle
  3114. ("rust-ravif" -> "rust-image")
  3115. ("rav1e" -> "rust-image")
  3116. ; ravif not used by default image features
  3117. ("rust-image" -> "rust-ravif")
  3118. ;; TODO: rust-rav1e and rav1e
  3119. ;; rust-futures-cpupool isn't updated anymore and doesn't
  3120. ;; build anymore?
  3121. ("rust-serde-derive" -> "rust-serde")
  3122. ;; (Test?) cycle
  3123. ("rust-actix-web-codegen" -> "rust-actix-web")
  3124. ("rust-actix-macros" -> "rust-actix-rt")
  3125. ;; Test cycle (rust-paw <-> rust-paw-structopt).
  3126. ("rust-paw" -> "rust-paw-structopt")
  3127. ("rust-paw" -> "rust-structopt")
  3128. ("rust-anyhow" -> "rust-thiserror")
  3129. ("rust-proc-macro-hack" -> "rust-demo-hack")
  3130. ("rust-proc-macro-hack" -> "rust-demo-hack-impl")
  3131. ("rust-nom" -> "rust-jemallocator")
  3132. ("rust-serde-bytes" -> "rust-bincode")
  3133. ("rust-failure-derive" -> "rust-failure")
  3134. ("rust-serde-bytes" -> "rust-bincode")
  3135. ("rust-serde-json" -> "rust-serde-stacker")
  3136. ("rust-erased-serde" -> "rust-serde-json")
  3137. ("rust-proc-macro2" -> "rust-quote")
  3138. ("rust-indexmap" -> "rust-itertools")
  3139. ("rust-tracing-attributes" -> "rust-tracing")
  3140. ("rust-tracing-attributes" -> "rust-async-trait")
  3141. ("rust-tracing-attributes" -> "rust-tracing-futures")
  3142. ("rust-tracing" -> "rust-tokio")
  3143. ("rust-headers" -> "rust-time") ; dependency removed in new version
  3144. ("rust-hashbrown" -> "rust-bumpalo") ; todo: remove from #:cargo-inputs?, unused?
  3145. ("rust-fastrand" -> "rust-getrandom")
  3146. ("rust-fastrand" -> "rust-instant")
  3147. ("rust-fastrand" -> "rust-wyhash")
  3148. ;; ("rust-tokio-io" -> "rust-tokio-current-thread") ; rust-tokio-io currently removed
  3149. ;; ("rust-tokio-core" -> "rust-flate2") ; likewise
  3150. ;; ("rust-tokio-core" -> "rust-httparse")
  3151. ;; ("rust-tokio-process" -> "rust-failure") ;; otherwise cc needs to be removed from rust-cloudflare-zlib-sys ;; likewise, rust-tokio-process is currently removed
  3152. ;; ("rust-tokio" -> "rust-tokio-executor") ; similar
  3153. ;; Remove unused dependencies
  3154. ("rust-flate2" -> "rust-cloudflare-zlib-sys")
  3155. ("rust-flate2" -> "rust-miniz-sys")
  3156. ("rust-flate2" -> "rust-miniz-oxide")
  3157. ("rust-tokio" -> "rust-httparse")
  3158. ("rust-tokio" -> "rust-async-stream") ;; test
  3159. ("rust-tokio" -> "rust-nix") ;; test
  3160. ("rust-tokio" -> "rust-tokio-current-thread")
  3161. ("rust-tokio" -> "rust-tokio-fs")
  3162. ("rust-tokio" -> "rust-tokio-reactor")
  3163. ("rust-tokio" -> "rust-tokio-sync")
  3164. ("rust-tokio" -> "rust-tokio-stream")
  3165. ("rust-tokio-sync" -> "rust-loom")
  3166. ("rust-tokio" -> "rust-tokio-tcp")
  3167. ("rust-tokio" -> "rust-tokio-timer")
  3168. ("rust-tokio" -> "rust-tokio-threadpool")
  3169. ("rust-tokio" -> "rust-tokio-udp")
  3170. ("rust-tokio" -> "rust-tokio-uds")
  3171. ("rust-tokio-macros" -> "rust-tokio")
  3172. ("rust-parking-lot-core" -> "rust-backtrace")
  3173. ;; See %features
  3174. ("rust-parking-lot-core" -> "rust-petgraph")
  3175. ;; TODO: can be removed by relaxing versions in rust-signal-hook@0.1
  3176. ("rust-signal-hook-registry" -> "rust-signal-hook")
  3177. ;; TODO why benchmark?
  3178. ("rust-unicode-bidi" -> "rust-flame")
  3179. ("rust-unicode-bidi" -> "rust-flamer")
  3180. ("rust-odds" -> "rust-lazy-static")
  3181. ;; TODO
  3182. #;("rust-boxxy" -> "rust-ctrlc") ; TODO currently useless because boxxy is in %removed-dependencies, revisit when tests are supported
  3183. ("rust-flate2" -> "rust-tokio-tcp")
  3184. ("rust-flate2" -> "rust-tokio-threadpool")
  3185. ("rust-tokio" -> "rust-flate2") ;; TODO remove old tokios
  3186. ("rust-semver" -> "rust-crates-index") ;; TODO why????
  3187. ("rust-semver-parser" -> "rust-pest-generator")
  3188. ("rust-spmc" -> "rust-loom")
  3189. ;; ("rust-tokio-test" -> "rust-tokio") ; currently rust-tokio-test is removed
  3190. ;; Break dev-dependencies cycle
  3191. ("rust-regex-automata" -> "rust-bstr")
  3192. ;; TODO: quickcheck with an exception for sequoia-pg
  3193. ))
  3194. (define (remove-dependency? dependent dependency)
  3195. "Should DEPENDENCY be removed from the dependencies of DEPENDENT (both are package objects)?"
  3196. (unless (package? dependent)
  3197. (error "first argument must be a package"))
  3198. (unless (package? dependency)
  3199. (error "second argument must be a package"))
  3200. (define dependent* (package-name dependent))
  3201. (define dependency* (package-name dependency))
  3202. (define remove-dependency*?
  3203. (match-lambda
  3204. ((? string? unconditional-removal) (string=? dependency* unconditional-removal))
  3205. (((? string? context) '-> (? string? conditional-removal))
  3206. (and (string=? dependent* context)
  3207. (string=? dependency* conditional-removal)))
  3208. (((? string? conditional-removal?) '#:for-dependent (? procedure? context?))
  3209. (and (string=? dependency* conditional-removal?)
  3210. (context? dependent)))
  3211. (a (pk 'a a) (error "bogus entry in %removed-dependencies"))))
  3212. (any remove-dependency*? %removed-dependencies))
  3213. (define %crate-types ; resolve multiple crate types inside the Cargo.toml.
  3214. `(("rust-hyper" ,#~"rlib")
  3215. ("rust-jsonpath-lib" ,#~"rlib")
  3216. ("rust-neso" ,#~"rlib")))
  3217. ;; Try keeping things sorted, to avoid rebase/merge conflicts.
  3218. (define %features
  3219. `(("rust-arrow2" ,#~'("default" "compute" "io_csv" "io_ipc" "io_parquet" "io_json")) ; compute is required by rust-polars-core; "io_csv", "io_ipc", "io_parquet", "io_json" and by rust-polars-io
  3220. ("rust-arrow-format" ,#~'("default" "ipc")) ; "ipc" required by "ipc" feature of "rust-arrow2"
  3221. ;; rust-swayipcs requires 'spawn_blocking' which is only
  3222. ;; public if "unstable" is enabled.
  3223. ("rust-async-std" ,#~'("default" "unstable"))
  3224. ("rust-actix-tls" ,#~'("default" "uri")) ; rust-awc@3.0.0 requires non-default "uri" feature
  3225. ("rust-actix-http" ,#~'("default" "ws" "http2" "compress-gzip" "compress-zstd")) ; ws, http2, compress-gzip, compress-zstd: required by rust-awc
  3226. ("rust-awc" ,#~'("compress-gzip" "compress-zstd" "cookies")) ; default "compress-brotli" feature requires the "compress-brotli" feature in rust-actix-http but that doesn't build
  3227. ;; The "dox" feature requires non-stable.
  3228. ("rust-atk" ,#~'("v2_34"))
  3229. ("rust-atk-sys" ,#~'("v2_34"))
  3230. ;; Do _not_ include 'runtime', as dlopen isn't used,
  3231. ;; linking happens at compile time (and at program
  3232. ;; startup).
  3233. ("rust-bindgen" ,#~'("logging" "clap" "which-rustfmt"))
  3234. ;; The feature "alloc" is not set by default, causing the
  3235. ;; build to fail (TODO: maybe report upstream?)
  3236. ("rust-bitvec"
  3237. ,#~'("std" "atomic" "alloc"))
  3238. ("rust-bigdecimal" ,#~'("serde")) ; "serde" required by rust-nu-protocol
  3239. ("rust-bstr" ,#~'("default" "serde1")) ; serde1: required by rust-git-glob
  3240. ;; the default "generic-simd" feature required rust-packed-simd
  3241. ;; which is currently uncompilable.
  3242. ("rust-bytecount" ,#~'())
  3243. ("rust-bzip2" ,#~'("futures")) ; "tokio" requires old tokio-io
  3244. ;; "alloc" is required by some crates. serde is required by alfis
  3245. ("rust-chrono" ,#~'("default" "alloc" "serde"))
  3246. ("rust-chrono-tz" ,#~'("default" "case-insensitive")) ; doesn't build without "case-insensitive"
  3247. ;; zeroize required by rust-ctr
  3248. ("rust-cipher" ,#~'("alloc" "std" "block-padding" "rand_core" "dev" "zeroize"))
  3249. ;; Don't just support libclang 3.5, also include
  3250. ;; bindings for later versions which rust-bindgen might
  3251. ;; need. Don't include the "runtime" feature, because
  3252. ;; then libclang.so needs to be in LD_LIBRARY_PATH or such
  3253. ;; to be found. Don't include the "static" feature for
  3254. ;; the standard reasons against static linking in Guix.
  3255. ("rust-clang-sys" ,#~'("clang_10_0")) ; Guix by default does dynamic linking, not static linking, which would use the "static" feature IIUC
  3256. ("rust-command-group" ,#~'("default" "with-tokio")) ;; with-tokio required by rust-watchexec
  3257. ("rust-config" ,#~'("toml" "json" "yaml" "ini" "ron")) ; default json5 feature required pcackage not in Guix.
  3258. ;; This addresses the build failure
  3259. ;; ‘could not find `collector` in the crate root’
  3260. ;; and ‘cannot find function `pin` in crate `epoch`’
  3261. ("rust-crossbeam-epoch"
  3262. ,#~'("std" "alloc"))
  3263. ;; rust-cipher requires non-default rand_core
  3264. ("rust-crypto-common" ,#~'("std" "rand_core"))
  3265. ("rust-cssparser" ,#~'()) ; don't enable the non-stable "bench" feature
  3266. ("rust-darling-core" ,#~'("strsim")) ; don't enable the unstable "diagnostics" feature
  3267. ;; Don't accidentally enable multiple encoding features, even
  3268. ;; though rust-fmt only supports one at the time. An encoding
  3269. ;; will automatically be chosen.
  3270. ("rust-defmt" ,#~'("alloc"))
  3271. ;; rust-pkcs1 requires "pem"
  3272. ("rust-der" ,#~'("std" "alloc" "oid" "pem"))
  3273. ;; rust-x509-parser requires bigint
  3274. ("rust-der-parser" ,#~'("default" "bigint"))
  3275. ;; Required by hmac.
  3276. ("rust-digest" ,#~'("default" "std" "mac"))
  3277. ("rust-doc-comment" ,#~'()) ; no_core requires unstable, and old_macros is detected by build.rs
  3278. ("rust-ena" ,#~'()) ;; disable "bench", which fails for stable build
  3279. ("rust-encoding-rs" ,#~'()) ; "simd-accel" requires unstable "packed_simd"
  3280. ("rust-fern" ,#~'("syslog-6")) ; avoid having to include multiple versions of syslog
  3281. ("rust-firestorm" ,#~'()) ; avoid optional dependencies for probably unused profiling for now
  3282. ;; Avoid extra dependencies by using the C library that
  3283. ;; is used elsewhere anyway.
  3284. ("rust-flate2" ,#~'("zlib"))
  3285. ("rust-futures-core"
  3286. ,#~'("std" "alloc"))
  3287. ("rust-futures-channel"
  3288. ,#~'("std" "alloc" "sink")) ; sink is required by rust-warp@0.3
  3289. ;; Enable some features such that "rust-futures" actually builds.
  3290. ("rust-futures-task"
  3291. ,#~'("std" "alloc"))
  3292. ("rust-futures-util"
  3293. ,#~'("std" "alloc" "sink"
  3294. "io" "async-await"
  3295. "async-await-macro"
  3296. "channel"))
  3297. ;; The default "benchmarks" feature requires unstable.
  3298. ("rust-galil-seiferas" ,#~'())
  3299. ("rust-gdk-pixbuf" ,#~'("v2_40")) ; "dox" requires non-stable
  3300. ("rust-gdk-pixbuf-sys" ,#~'("v2_40")) ; likewise (for dox)
  3301. ("rust-gdk-sys" ,#~'("v3_24")) ; likewise (for dox) (look in the .pc for the version)
  3302. ("rust-gdk" ,#~'("v3_24")) ; likewise (for dox) (look in the .pc for the version)
  3303. ;; Required by rust-rand-core.
  3304. ("rust-getrandom" ,#~'("std"))
  3305. ("rust-gio" ,#~'("v2_66")) ; likewise
  3306. ("rust-gio-sys" ,#~'("v2_66")) ; likewise
  3307. ;; serde1 failure requires undeclared ‘Glob’ dependency
  3308. ("rust-globset" ,#~'())
  3309. ;; The "dox" feature requires non-stable.
  3310. ("rust-glib" ,#~'("log" "log_macros" "v2_68")) ; likewise
  3311. ("rust-glib-sys" ,#~'("v2_68"))
  3312. ("rust-gobject-sys" ,#~'("v2_68")) ; likewise
  3313. ("rust-gtk" ,#~'("v3_24_9")) ; likewise (for dox)
  3314. ("rust-gtk-sys" ,#~'("v3_24_11")) ; likewise (for dox)
  3315. ("rust-integer-encoding" ,#~'("futures_async")) ; the features are mutually exclusive, so enable only the futures_async feature required by rust-parquet-format-async-temp.
  3316. ;; Avoid "use-intrisics", which requires unstable.
  3317. ("rust-half" ,#~'("alloc" "serialize" "std"))
  3318. ;; TODO: move into Guix proper?
  3319. ("rust-hashbrown" ,#~'("default" "raw")) ; default "ahash" is required by rust-lru@0.7
  3320. ("rust-hyper" ,#~'("full"))
  3321. ;; TODO: investigate build_dictionaries, and maybe not embedding libraries.
  3322. ;; TODO: cannot choose multiple normalization forms, is this important?
  3323. ("rust-hyphenation" ,#~'("embed_all"))
  3324. ("rust-im-rc" ,#~'()) ; "pool" feature doesn't build and "debug" probably makess things less efficient
  3325. ;; Require rust-cipher.
  3326. ("rust-inout" ,#~'("std" "block-padding"))
  3327. ("rust-itoa" ,#~'("std"))
  3328. ;; "pattern" and "benchmarks" require non-stable (rust-jetscii@0.5)
  3329. ("rust-jetscii" ,#~'())
  3330. ;; Avoid removed feature(custom_derive)
  3331. ("rust-language-tags" ,#~'())
  3332. ("rust-lazycell" ,#~'()) ;; avoid nightly things
  3333. ("rust-lexical-util" ,#~'("default" "parse-integers" "write-integers" "floats")) ;; enable features required by various rust-lexical-... crates
  3334. ;; extra-traits is required by rust-nix
  3335. ("rust-libc" ,#~'("std" "extra_traits"))
  3336. ("rust-libnghttp2-sys" ,#~'()) ; don't enable the "vendored" feature
  3337. ;; Required by rust-env-logger.
  3338. ;; kv_unstable is required by rust-kv-log-macro.
  3339. ("rust-log" ,#~'("std" "kv_unstable"))
  3340. ("rust-lzma-sys" ,#~'()) ; don't enable "static" (TODO: add it to the list in antioxidant?)
  3341. ;; Required by rust-tokio
  3342. ;; TODO remove os-poll, as implied features are implemented.
  3343. ("rust-mio"
  3344. ,(lambda (original-package)
  3345. ;; set of available features depends on the version
  3346. (if (string-prefix? "0.6." (package-version original-package))
  3347. #~'("default")
  3348. #~'("net" "os-ext" "os-poll"))))
  3349. ("rust-multipart"
  3350. ;; default "iron" feature requires rust-iron which currently fails to build.
  3351. ;; Likewise for "nickel".
  3352. ;; The "hyper" feature is incompatible with rust-hyper>0.11
  3353. ,#~'("client" "mock" "server" "tiny_http"))
  3354. ;; The non-default feature "alloc" is required by rust-pure-rust-locales.
  3355. ("rust-nom"
  3356. ,#~'("std" "lexical" "alloc"))
  3357. ("rust-numtoa" ,#~'("std"))
  3358. ;; rust-rsa requires "prime" and "zeroize"
  3359. ("rust-num-bigint-dig" ,#~'("default" "prime" "zeroize"))
  3360. ("rust-num-bigint" ,#~'("default" "serde")) ; "serde" is required by rust-nu-protocol
  3361. ("rust-num-rational" ,#~'("default" "serde")) ; 'serde' is required by rust-mp4@0.9.2
  3362. ;; rust-x509-parser required 'crypto' and 'x509'
  3363. ("rust-oid-registry" ,#~'("default" "crypto" "x509"))
  3364. ("rust-once-cell" ,#~'("default" "race")) ; "race" is required by rust-git-tempfile@2.0.1
  3365. ("rust-openssl-sys" ,#~'()) ;; avoid the 'vendored' feature
  3366. ("rust-os-str-bytes" ,#~'("raw"))
  3367. ("rust-pango" ,#~'("v1_46")) ; "dox" feature requires non-stable
  3368. ("rust-pango-sys" ,#~'("v1_46")) ; likewise
  3369. ;; The 'backtrace' and 'petgraph' dependency has been removed.
  3370. ;; (including petgraph causes a cycle between rust-ahash and rust-hashbrown,
  3371. ;; but it's ‘only’ required for deadlock detection).
  3372. ("rust-parking-lot-core" ,#~'())
  3373. ;; "quickcheck" features requires removed crate "quickcheck"
  3374. ("rust-partial-io" ,#~'("futures03" "tokio1"))
  3375. ("rust-polars-core" ,#~'("default" "dtype-time" "dtype-date" "dtype-datetime" ; "dtype-time", "dtype-datetime" and "dtype-date" are required by rust-polars-io's csv support
  3376. "performant" ; requested by rust-nu-protocol via rust-polars, and the downside (panic in case of incorrect usage) seems mild
  3377. "pivot" "downsample" "is_in" "rolling_window" #;"random" ; required by rust-nu-command (TODO: "random" doesn't build)
  3378. "object" "checked_arithmetic" ; indirectly required by rust-nu-protocol
  3379. "serde" "strings" ; required by rust-nu-protocol
  3380. "lazy" "private" "zip_with")) ; required by rust-polars-lazy
  3381. ("rust-phf-shared" ,#~'("default" "uncased")) ; uncased required by rust-phf's uncased feature
  3382. ("rust-phf" ,#~'("default" "macros" "uncased")) ; "macros" is required by rust-cssparser@0.28, "uncased" is required by a dependency of "tokei"
  3383. ;; Required by 'sniffglue'
  3384. ("rust-pktparse" ,#~'("serde"))
  3385. ("rust-plotters-svg" ,#~'()) ; "debug" feature causes a build failure
  3386. ("rust-postgres-types" ,#~'("derive" "with-time-0_3" "with-uuid-0_8" "geo-types-0_7")) ; not all dependencies of all features have been packaged yet.
  3387. ("rust-proc-macro2"
  3388. ;; span-locations is required by rust-cxx-gen@0.7.49
  3389. ,#~'("default" "span-locations"))
  3390. ("rust-ptree"
  3391. ,#~'("petgraph" "ansi" "value")) ; default "config" feature doesn't build
  3392. ("rust-quick-xml" ,#~'("default" "encoding")) ; calamine requires the "encoding" feature
  3393. ;; Without "getrandom" or "alloc", it fails to build (TODO upstream?).
  3394. ;; small_rngs is required by rust-phf-generator.
  3395. ("rust-rand"
  3396. ,#~'("std" "std_rng" "getrandom"
  3397. "alloc" "small_rng"))
  3398. ("rust-raw-window-handle" ,#~'()) ; don't enable nightly "nightly-docs"
  3399. ("rust-reqwest" ,#~'("default" "blocking" "cookies" "json")) ; tealdeer@1.4.1 requires "blocking" to build, drill requires cookies, rbw requires json
  3400. ;; The 'inline-asm' feature requires non-stable
  3401. ("rust-riscv" ,#~'())
  3402. ("rust-rusqlite" ,#~'()) ; some features are only for bundling or require extra configure flags(?) for sqlite. For now, don't enable anything.
  3403. ;; Some features required rust-rand when using the getrandom feature,
  3404. ;; serde for rust-rand-isaac@0.3.0 ... (now building with all features)
  3405. ;; ("rust-rand-core" #~'("std" "getrandom"))
  3406. ("rust-rust-hawktracer-normal-macro" ,#~'()) ; for now, don't enable the profiling feature which requires a currently non-building package rust-hawktracer-sys (which also bundles things!)
  3407. ("rust-rust-hawktracer-proc-macro" ,#~'()) ; likewise!
  3408. ;; asm! syntax not supported anymore, and "capture"
  3409. ;; requires non-existent io::set_panic
  3410. ("rust-rustc-test" ,#~'())
  3411. ;; rust-cargo-metadata requires the serialisation
  3412. ;; / deserialisation traits.
  3413. ("rust-semver" ,#~'("default" "serde"))
  3414. ;; 'derive' is needed by rust-ron
  3415. ("rust-serde" ,#~'("std" "alloc" "derive"
  3416. "rc")) ; rc: required by rust-nu-protocol
  3417. ("rust-servo-fontconfig-sys" ,#~'("force_system_lib")) ; be extra sure the bundled copy isn't used
  3418. ;; Avoid "digest_trait" which requires old rust-digest@0.9.0
  3419. ("rust-sha1collisiondetection" ,#~'("std" "structopt"))
  3420. ("rust-signal-hook-mio" ,#~'("support-v0_8")) ; othef features require an old rust-mio
  3421. ("rust-similar" ,#~'("default" "text" "inline"))
  3422. ("rust-derive-builder" ,#~'()) ; for now don't build the non-building test features
  3423. ("rust-selectors" ,#~'()) ; "bench" feature requires non-stable
  3424. ;; "nested-values" is required by the "nested-values" feature of rust-slog-term
  3425. ("rust-slog" ,#~'("default" "nested-values"))
  3426. ("rust-smallvec" ,#~'("serde" "write")) ; "serde", "serde": required by rust-git-object
  3427. ;; Default serde1_lib requires unpackaged rust-serde1-lib
  3428. ("rust-sval" ,#~'("alloc" "arbitrary-depth" "derive" "fmt" "std"))
  3429. ;; "paw" required by sniffglue
  3430. ("rust-structopt" ,#~'("default" "paw"))
  3431. ;; TODO: use default features from Cargo.toml
  3432. ;; rust-serde-bytes requires the 'parsing' feature.
  3433. ;; visit is required by rust-synstructure.
  3434. ;; visit-mut is used by rust-tracing-attributes.
  3435. ("rust-syn"
  3436. ,#~'("derive" "parsing" "printing"
  3437. "clone-impls"
  3438. "proc-macro" "full"
  3439. "visit" "visit-mut"
  3440. "fold" ; used by rust-diesel-derives
  3441. ;; Used by rust-strum-macros
  3442. "extra-traits"))
  3443. ("rust-tower" ,#~'("default"
  3444. ;; features used by rust-tonic
  3445. "balance" "buffer" "discover" "limit" "load" "make" "timeout" "util"))
  3446. ("rust-tinyvec" ,#~'("alloc"))
  3447. ("rust-tiny-keccak"
  3448. ;; By default nothing is build, which seems rather useless.
  3449. ;; Let's enable everything.
  3450. ,#~'("cshake" "fips202" "k12" "keccak" "kmac" "parallel_hash" "sha3" "shake" "sp800" "tuple_hash"))
  3451. ;; rust-cookie requires the non-default "parsing" and "macros" feature. Might as well enable
  3452. ;; "formatting" as well.
  3453. ("rust-time" ,#~'("default" "macros" "formatting" "parsing" "local-offset"))
  3454. ;; By default zero features are enabled, which is rather
  3455. ;; minimalistic and often not sufficient. TODO: teach
  3456. ;; antioxidant about ‘implied’ features.
  3457. ("rust-tokio"
  3458. ,#~'("full" "io-util" "io-std"
  3459. ;;"feature=\"macros\"" ;; TODO
  3460. "net"
  3461. "parking_lot"
  3462. "process"
  3463. "rt"
  3464. "rt-multi-thread"
  3465. "signal"
  3466. "sync"
  3467. "time"))
  3468. ("rust-tokio-util" ,#~'("full" "codec"))
  3469. ;; early-data is required by rust-trust-dns-proto
  3470. ("rust-tokio-rustls" ,#~'("default" "early-data"))
  3471. ;; dns-over-openssl is required by rust-trust-dns-openssl.
  3472. ;; dns-over-native-tls is required by rust-trust-dns-native-tls.
  3473. ;; dns-over-rustls is required by rust-trust-dns-rustls.
  3474. ;; dns-over-https is required by rust-trust-dns-https.
  3475. ("rust-trust-dns-proto"
  3476. ,#~'("default" "dns-over-openssl" "dns-over-native-tls" "dns-over-rustls"
  3477. "dns-over-https"))
  3478. ("rust-tui" ,#~'("default" "crossterm")) ; required by rust-nu-plugin-chart
  3479. ;; For now avoid optional dependencies
  3480. ("rust-typenum" ,#~'())
  3481. ("rust-uuid" ,#~'("default" "serde" "v4")) ; v4,serde required by alfis
  3482. ("rust-value-bag" ,#~'("std"))
  3483. ("rust-v-frame" ,#~'("serialize")) ; wasm doesn't build, tracing seems unnecessary
  3484. ("rust-webpki" ,#~'("std" "alloc"))
  3485. ("rust-xcb" ,#~'("thread" "xfixes")) ; not all features build, for now only enable features required by rust-x11-clipboard.
  3486. ("rust-xz2" ,#~'("futures")) ; ???
  3487. ;; rust-rcgen requires "time". While at it, enable other
  3488. ;; features as well.
  3489. ("rust-yasna" ,#~'("default" "time" "bit-vec" "bigint" "std"))
  3490. ;; rust-num-bigint-dig's zeroize feature requires the "derive"
  3491. ;; feature of rust-zeroize
  3492. ("rust-zeroize" ,#~'("default" "derive"))
  3493. ("rust-zip" ,#~'("bzip2" "deflate" "time" "zstd")) ; avoid default "aes-crypto" feature, which requiers an old rust-aes (and encrypted zips aren't used often anyways)
  3494. ("rust-zstd-safe" ,#~'("default" "std")))) ; std is reaquired by rust-zstd@0.9.0
  3495. (define %replacements
  3496. `(("rust-atk-sys" ,(@ (gnu packages crates-gtk) rust-atk-sys-0.14)) ; @0.10 doesn't build
  3497. ("rust-aho-corasick" ,(p rust-aho-corasick-0.7)) ; avoid version conflict
  3498. ("rust-average" ,(p rust-average-0.13)) ; avoid complication due to multiple versions
  3499. ("rust-calloop" ,rust-calloop)
  3500. ("rust-cbindgen" ,(package-with-extra-patches
  3501. rust-cbindgen-0.19
  3502. ;; Replace Cargo-specific assumptions by antioxidant-specific
  3503. ;; assumptions (we cannot run "cargo metadata"!).
  3504. ;;
  3505. ;; rust-cbindgen tries to run "cargo metadata" to generate a JSON
  3506. ;; file with some information on the package and its dependencies,
  3507. ;; but fails, resulting in an unclear error message.
  3508. ;;
  3509. ;; As antioxidant isn't cargo, we have to replace this logic by
  3510. ;; some other logic, generating the metadata ourselves. TODO:
  3511. ;; actually implement that generate-cbindgen-metadata phase.
  3512. (list (local-file "rust-cbindgen-0.19-antioxidant-compatibility.patch"))))
  3513. ("rust-comfy-table" ,(p rust-comfy-table-4)) ; @1 doesn't build against new dependencies
  3514. ("rust-config" ,rust-config)
  3515. ("rust-crossterm" ,rust-crossterm) ; @0.19 doesn't build against new rust-signal-hook
  3516. ("rust-ctrlc" ,rust-ctrlc)
  3517. ("rust-darling-core" ,(p rust-darling-core-0.13)) ; @0.9 incompatible with new rust-syn
  3518. ("rust-derive-builder" ,(p rust-derive-builder-0.10) ; @0.7.2 has failing dependencies
  3519. #:for-dependent
  3520. ,(lambda (dependent)
  3521. (not (member (package-name dependent) '("skim"))))) ; needs @0.9
  3522. ("rust-derive-builder" ,(p rust-derive-builder-0.9)
  3523. #:for-dependent
  3524. ,(lambda (dependent)
  3525. (member (package-name dependent) '("skim")))) ; needs @0.9
  3526. ("rust-dirs" ,(p rust-dirs-3)) ; avoid version conflict in tectonic
  3527. ("rust-gtk-sys" ,(@ (gnu packages crates-gtk) rust-gtk-sys-0.14)) ; @0.10 doesn't build
  3528. ("rust-getrandom" ,(p rust-getrandom-0.2)) ; avoid multiple versions
  3529. ("rust-hdrhistogram" ,rust-hdrhistogram)
  3530. ("rust-hmac-sha1" ,(package-with-extra-patches
  3531. (p rust-hmac-sha1-0.1)
  3532. (list (local-file "rust-hmac-sha1-update-dependencies.patch")))) ; compatibility with new dependencies
  3533. ("rust-h2" ,rust-h2)
  3534. ("rust-rand-core" ,(p rust-rand-core-0.6)) ; avoid multiple versions
  3535. ("rust-blake2" ,rust-blake2)
  3536. ("rust-actix" ,rust-actix)
  3537. ("rust-actix-codec" ,rust-actix-codec)
  3538. ("rust-actix-http" ,rust-actix-http)
  3539. ("rust-actix-utils" ,rust-actix-utils)
  3540. ("rust-actix-router" ,rust-actix-router)
  3541. ("rust-actix-service" ,rust-actix-service)
  3542. ("rust-awc" ,rust-awc)
  3543. ("rust-chacha20poly1305" ,rust-chacha20poly1305)
  3544. ("rust-libsqlite3-sys" ,(p rust-libsqlite3-sys-0.23)) ; custom phase assumes != @0.20
  3545. ("rust-libgit2-sys" ,(p rust-libgit2-sys-0.12)) ; old version doesn't build.
  3546. ("rust-markup5ever" ,(p rust-markup5ever-0.9)) ; @0.9 doesn't build against new rust-phf-... without patches, but we still need it because monolith doesn't support the new rust-markup5ever@0.10 yet
  3547. ("rust-meval" ,(package-with-extra-patches
  3548. (package
  3549. (inherit (p rust-meval-0.2))
  3550. ;; Update to latest git such that the patch applies.
  3551. (source
  3552. (origin
  3553. (method git-fetch)
  3554. (uri
  3555. (git-reference
  3556. (url "https://github.com/rekka/meval-rs")
  3557. (commit "ac9586fb19e1d6fb505425dbbc9598f372122130")))
  3558. (sha256 "18554xrhdl0lyga408l01yjhilh69qxkjyyss6mlpxypdwy6cf7w"))))
  3559. (list (local-file "rust-meval-update-dependencies.patch"))))
  3560. ("rust-miniz-oxide" ,(p rust-miniz-oxide-0.4)) ; avoid multiple versions
  3561. ("rust-num-bigint" ,(p rust-num-bigint-0.4)) ; avoid multiple versions
  3562. ("rust-num" ,(p rust-num-0.4)) ; avoid multiple versions (TODO: let the CI test if it doesn't cause build failures)
  3563. ("rust-num-complex" ,(p rust-num-complex-0.4)) ; avoid multiple versions (TODO: let the CI test if it doesn't cause build failures)
  3564. ("rust-arrayvec" ,(p rust-arrayvec-0.7) ; avoid multiple versions
  3565. #:for-dependent
  3566. ,(lambda (dependent)
  3567. (not (string=? (package-name dependent) "rust-vte"))))
  3568. ("rust-arrayvec" ,(package-with-rust-features (p rust-arrayvec-0.5)
  3569. #~'("default"))
  3570. #:for-dependent
  3571. ,(lambda (dependent)
  3572. (string=? (package-name dependent) "rust-vte"))) ; still required old rust-arrayvec
  3573. ("rust-bitstream-io" ,(p rust-bitstream-io-1)) ; avoid multiple versions
  3574. ("rust-bytestring" ,rust-bytestring)
  3575. ("rust-avif-serialize" ,rust-avif-serialize)
  3576. ("rust-nasm-rs" ,rust-nasm-rs)
  3577. ("rust-notify" ,(p rust-notify-5) ; use new version where possible, and the old where still required
  3578. #:for-dependent
  3579. ,(lambda (dependent)
  3580. (not (string=? (package-name dependent) "rust-watchexec"))))
  3581. ("rust-notify" ,(p rust-notify-4)
  3582. #:for-dependent
  3583. ,(lambda (dependent)
  3584. (string=? (package-name dependent) "rust-watchexec")))
  3585. ("rust-num-rational" ,(p rust-num-rational-0.4)) ; @0.1 doesn't build when "serde" is enabled
  3586. ("rust-ivf" ,rust-ivf)
  3587. ("rust-idna" ,(p rust-idna-0.2)) ; avoid multiple versions
  3588. ("rust-siphasher" ,(p rust-siphasher-0.3)) ; avoid multiple versions
  3589. ("rust-syslog" ,rust-syslog)
  3590. ("rust-clap-derive" ,rust-clap-derive)
  3591. ("rust-askama-shared" ,rust-askama-shared)
  3592. ("rust-askama-derive" ,rust-askama-derive)
  3593. ("rust-zstd" ,(p rust-zstd-0.9)) ; @0.6 doesn't build a dependency failing to build
  3594. ("rust-rand-distr" ,(p rust-rand-distr-0.4)) ; avoid complications due to multiple versions
  3595. ("rust-reqwest" ,rust-reqwest) ; @0.10 has
  3596. ("rust-s3handler" ,rust-s3handler)
  3597. ("rust-cookie-store" ,rust-cookie-store) ; fix failing build by updating
  3598. ("rust-cookie-store-15" ,rust-cookie-store)
  3599. ("rust-structopt" ,(p rust-structopt-0.3))
  3600. ("rust-structopt-derive" ,(p rust-structopt-derive-0.4)) ; @0.2.18 doesn't build
  3601. ("rust-tectonic-bridge-core" ,(p rust-tectonic-bridge-core-0.3)) ; to keep custom phases simple, only use a single version
  3602. ("rust-tectonic-status-base" ,(p rust-tectonic-status-base-0.2)) ; resolve version conflict
  3603. ("rust-tectonic-errors" ,(p rust-tectonic-errors-0.2)) ; resolve version conflict
  3604. ("rust-tectonic-io-base" ,(p rust-tectonic-io-base-0.4)) ; resolve version conflict
  3605. ("rust-totp-lite" ,rust-totp-lite)
  3606. ("rust-trust-dns-proto" ,rust-trust-dns-proto)
  3607. ("rust-trust-dns-openssl" ,rust-trust-dns-openssl)
  3608. ("rust-trust-dns-native-tls" ,rust-trust-dns-native-tls)
  3609. ("rust-trust-dns-rustls" ,rust-trust-dns-rustls)
  3610. ("rust-trust-dns-https" ,rust-trust-dns-https)
  3611. ("rust-trust-dns-resolver" ,rust-trust-dns-resolver)
  3612. ("rust-tungstenite" ,rust-tungstenite)
  3613. ("rust-pulse" ,(package-with-extra-patches
  3614. (p rust-pulse-0.5)
  3615. ;; For compatibility with new rust-time
  3616. (list (local-file "0001-use-std-time-bump-to-0.5.4.patch"))))
  3617. ("rust-partial-io" ,rust-partial-io)
  3618. ("rust-postgres-protocol" ,rust-postgres-protocol)
  3619. ("rust-postgres-types" ,rust-postgres-types)
  3620. ("rust-regex" ,(p rust-regex-1)) ; old version doesn't build against new rust-aho-corasick
  3621. ("rust-regex-syntax" ,(p rust-regex-syntax-0.6)) ; multiple version
  3622. ;; swayhide requires non-async to build
  3623. ("rust-swayipc" ,(package-with-rust-features (p rust-swayipc-2)
  3624. #~'()
  3625. #:name "rust-swayipc+sync"
  3626. #:rust-metadata "guix-variant=sync")
  3627. #:for-dependent
  3628. ,(lambda (dependent)
  3629. (string=? "swayhide" (package-name dependent))))
  3630. ;; Use the newest version of rust-mio where possible,
  3631. ;; except for packages that still require an old rust-mio
  3632. ;; and where updating the package is difficult for now.
  3633. ("rust-mio" ,rust-mio
  3634. #:for-dependent
  3635. ,(lambda (dependent)
  3636. (not (or (string=? (package-name dependent) "rust-mio-extras")
  3637. (and (string=? (package-name dependent) "rust-notify")
  3638. (string-prefix? "4." (package-version dependent)))))))
  3639. ("rust-mio" ,(package-with-rust-features (p rust-mio-0.6)
  3640. #~'("default")) ; not used, see %features
  3641. #:for-dependent
  3642. ,(lambda (dependent)
  3643. (or (string=? (package-name dependent) "rust-mio-extras")
  3644. (and (string=? (package-name dependent) "rust-notify")
  3645. (string-prefix? "4." (package-version dependent))))))
  3646. ("rust-signal-hook-mio" ,rust-signal-hook-mio)
  3647. ("rust-smol" ,(p rust-smol-1)) ; @0.1 or its dependencies don't build
  3648. ("rust-actix-rt" ,rust-actix-rt)
  3649. ("rust-actix-tls" ,rust-actix-tls)
  3650. ("rust-async-process" ,rust-async-process) ; @1.0.1 doesn't build against new rust-signal-hookx
  3651. ("rust-blocking" ,(p rust-blocking-1)) ; @0.4 doesn't build
  3652. ("rust-inotify" ,(p rust-inotify-0.9)) ; @0.8 doesn't build
  3653. ("rust-futures-intrusive" ,rust-futures-intrusive)
  3654. ("rust-multipart" ,(p rust-multipart-0.18)) ; @0.17 doesn't build
  3655. ("rust-memoffset" ,(p rust-memoffset-0.6)) ; @0.5 doesn't build
  3656. ("rust-signal-hook" ,(p rust-signal-hook-0.3)) ; @0.1 doesn't build
  3657. ("rust-semver" ,(p rust-semver-1))
  3658. ("rust-rustc-version" ,(p rust-rustc-version-0.4)) ; @0.2.3 doesn't build against rust-semver@1
  3659. ("rust-dotenv" ,(p rust-dotenv-0.15)) ; @0.10 doesn't build
  3660. ("rust-quickcheck-macros" ,(p rust-quickcheck-macros-1)) ; 0.9 doesn't build against rust-syn@1
  3661. ("rust-quick-xml" ,(p rust-quick-xml-0.22)) ; resolve version conflict
  3662. ("rust-glib-sys" ,(@ (gnu packages crates-gtk) rust-glib-sys-0.14)) ; @0.10 doesn't build
  3663. ("rust-glib" ,(@ (gnu packages crates-gtk) rust-glib-0.14)) ; @0.9 doesn't build
  3664. ("rust-gobject-sys" ,(@ (gnu packages crates-gtk) rust-gobject-sys-0.14)) ; @0.10 doesn't build
  3665. ("rust-gio-sys" ,(@ (gnu packages crates-gtk) rust-gio-sys-0.14)) ; @0.10 doesn't build
  3666. ("rust-gdk-pixbuf-sys" ,(@ (gnu packages crates-gtk) rust-gdk-pixbuf-sys-0.14)) ; @0.10 doesn't build
  3667. ("rust-gdk-sys" ,(@ (gnu packages crates-gtk) rust-gdk-sys-0.14)) ; no need for old versions
  3668. ("rust-gdk" ,(@ (gnu packages crates-gtk) rust-gdk-0.14)) ; no need for old versions
  3669. ("rust-cairo-sys-rs" ,(@ (gnu packages crates-gtk) rust-cairo-sys-rs-0.14)) ; avoid version conflicts
  3670. ("rust-pango-sys" ,(@ (gnu packages crates-gtk) rust-pango-sys-0.14)) ; likewise
  3671. ("rust-gtk" ,(@ (gnu packages crates-gtk) rust-gtk-0.14)) ; avoid potential problems
  3672. ("rust-ansi-parser" ,rust-ansi-parser)
  3673. ("rust-system-deps" ,rust-system-deps)
  3674. ("rust-version-compare" ,rust-version-compare)
  3675. ("rust-input-buffer" ,rust-input-buffer)
  3676. ("rust-iso8601" ,rust-iso8601)
  3677. ("rust-enum-to-u8-slice-derive" ,rust-enum-to-u8-slice-derive)
  3678. ("rust-cookie" ,rust-cookie)
  3679. ("rust-aead" ,(p rust-aead-0.4)) ; resolve ‘found two different crates with name `aead`’ errors
  3680. ("rust-aead-4" ,(p rust-aead-0.4)) ; likewise
  3681. ("rust-actix-threadpool" ,(p rust-actix-threadpool-0.3)) ; old rust-actix-threadpool requires old rust-futures
  3682. ("rust-aes-gcm" ,rust-aes-gcm)
  3683. ("rust-chacha20" ,rust-chacha20)
  3684. ("rust-unicase" ,(p rust-unicase-2)) ; @1 doesn't build because of removed features
  3685. ("rust-url" ,(p rust-url-2)) ; @1 doesn't build
  3686. ("rust-hkdf" ,rust-hkdf)
  3687. ("rust-as-slice" ,rust-as-slice)
  3688. ("rust-jetscii" ,(p rust-jetscii-0.5)) ; use recent version of jetscii that actually builds
  3689. ("rust-hash32-derive" ,rust-hash32-derive)
  3690. ("rust-hash32" ,(p rust-hash32-0.2)) ; @0.1 doesn't build
  3691. ("rust-derive-more" ,(p rust-derive-more-0.99)) ; avoid non-building @0.15
  3692. ("rust-devise-core" ,rust-devise-core)
  3693. ("rust-devise-codegen" ,rust-devise-codegen)
  3694. ("rust-openssl" ,rust-openssl)
  3695. ("rust-openssl-sys" ,rust-openssl-sys)
  3696. ;; The old rust-tokio-openssl@0.4 doesn't build
  3697. ("rust-tokio-openssl" ,(p rust-tokio-openssl-0.6))
  3698. ("rust-tokio-native-tls" ,(p rust-tokio-native-tls-0.3)) ; @0.1 doesn't build
  3699. ("rust-tokio" ,rust-tokio) ; rust-tokio@1 in Guix doesn't build against new rust-mio
  3700. ("rust-tokio-postgres" ,rust-tokio-postgres) ; @0.7.2 doesn't build against new rust-phf
  3701. ("rust-tokio-tungstenite" ,rust-tokio-tungstenite) ; @0.11 doesn't build
  3702. ("rust-bindgen"
  3703. ;; In the old version 'runtime' cannot be
  3704. ;; disabled.
  3705. ,(p rust-bindgen-0.59))
  3706. ("rust-headers" ,rust-headers)
  3707. ("rust-heck" ,(p rust-heck-0.4)) ; 0.3 too old for rust-strum-macros@0.24
  3708. ("rust-peg" ,(p rust-peg-0.6)) ; 0.5 misses dependency information
  3709. ("rust-actix-web-codegen" ,rust-actix-web-codegen)
  3710. ("rust-actix-web" ,rust-actix-web) ; @0.3 doesn't build
  3711. ;; rust-atcix-derive@0.4.0,0.5.0 don't build against new
  3712. ;; rust-syn@1.0.82 (Literal has been renamed to Lit)
  3713. ("rust-actix-derive" ,rust-actix-derive)
  3714. ("rust-actix-server" ,rust-actix-server)
  3715. ("rust-typenum" ,rust-typenum)
  3716. ("rust-syscallz" ,rust-syscallz)
  3717. ("rust-strum" ,rust-strum)
  3718. ("rust-strum-macros" ,rust-strum-macros)
  3719. ("rust-actix" ,rust-actix) ; @0.10 doesn't build
  3720. ("rust-backtrace" ,rust-backtrace) ; old backtrace doesn't build with the new rust-object
  3721. ("rust-gimli" ,rust-gimli)
  3722. ;; rust-pkcs5@0.5.0-pre.1 requires new_unwrap
  3723. ("rust-const-oid" ,rust-const-oid)
  3724. ("rust-aes" ,rust-aes)
  3725. ("rust-des" ,rust-des)
  3726. ("rust-pkcs8" ,rust-pkcs8)
  3727. ("rust-pkcs5" ,rust-pkcs5)
  3728. ("rust-pkcs1" ,rust-pkcs1)
  3729. ("rust-spki" ,rust-spki)
  3730. ("rust-der" ,rust-der)
  3731. ("rust-sha-1" ,(p rust-sha-1-0.10))
  3732. ("rust-sha2" ,(p rust-sha2-0.10))
  3733. ("rust-string-cache-codegen" ,(p rust-string-cache-codegen-0.5)) ; @0.4 doesn't build against new rust-phf-... crates.
  3734. ("rust-string-cache" ,(p rust-string-cache-0.8)) ; old version doesn't build against new rust-string-cache-codegen
  3735. ("rust-time" ; resolve version conflict
  3736. ,(p rust-time-0.3))
  3737. ("rust-instant" ; 0.1.4 doesn't build against rust-time@0.3
  3738. ,rust-instant)
  3739. ;; 0.3 requires unstable
  3740. ("rust-hex" ,(p rust-hex-0.4))
  3741. ("rust-sha3" ,rust-sha3)
  3742. ("rust-h2" ,(p rust-h2-0.3)) ; @0.2 doesn't build
  3743. ("rust-scrypt" ,rust-scrypt)
  3744. ("rust-password-hash" ,rust-password-hash)
  3745. ("rust-phf" ,(p rust-phf-0.10)) ; a dependency of @0.7 fails to build against new rust-syn
  3746. ("rust-phf-shared" ,(p rust-phf-shared-0.10)) ; avoid multiple conflicting versions
  3747. ("rust-phf-generator" ,(p rust-phf-generator-0.10)) ; avoid multiple conflicting versions
  3748. ("rust-phf-codegen" ,(p rust-phf-codegen-0.10)) ; avoid build failure in dependency
  3749. ("rust-block-modes" ,rust-block-modes)
  3750. ("rust-ctr" ,rust-ctr)
  3751. ("rust-salsa20" ,rust-salsa20)
  3752. ("rust-cipher" ,rust-cipher)
  3753. ("rust-block-padding" ,rust-block-padding)
  3754. ("rust-streebog" ,(p rust-streebog-0.10))
  3755. ("rust-pbkdf2" ,rust-pbkdf2)
  3756. ("rust-hmac" ,(p rust-hmac-0.12))
  3757. ; ("rust-boxxy" ,rust-boxxy) ; TODO: currently useless because in %removed-dependencies, revisit when tests are supported
  3758. ("rust-block-buffer" ,rust-block-buffer)
  3759. ("rust-enum-as-inner" ,rust-enum-as-inner)
  3760. ("rust-md-5" ,rust-md-5)
  3761. ; TODO version conflict -- AUTOMATE?
  3762. ("rust-syn" ,(p rust-syn-1))
  3763. ("rust-object" ,(p rust-object-0.28))
  3764. ("rust-addr2line" ,rust-addr2line)
  3765. ("rust-generic-array" ,(p rust-generic-array-0.14))
  3766. ("rust-digest" ,rust-digest)
  3767. ("rust-crypto-common" ,rust-crypto-common)
  3768. ("rust-rustyline" ,(p rust-rustyline-9))
  3769. ("rust-base64" ,(p rust-base64-0.13))
  3770. ("rust-test-case" ,rust-test-case-2)
  3771. ("rust-slab" ,rust-slab)
  3772. ("rust-socket2" ,(p rust-socket2-0.4))
  3773. ("rust-insta" ,(p rust-insta-1))
  3774. ("rust-nom" ; avoid version conflicts
  3775. ,(p rust-nom-7)
  3776. #:for-dependent
  3777. ,(lambda (p)
  3778. (not (member (package-name p) '("rust-terminfo"))))) ; needs old rust-nom@5 and no update available
  3779. ("rust-nom" ,(p rust-nom-5)
  3780. #:for-dependent
  3781. ,(lambda (p)
  3782. (member (package-name p) '("rust-terminfo")))) ; needs old rust-nom@5 and no update available
  3783. ;; rust-pktparse@0.5 doesn't build against nom@7
  3784. ("rust-pktparse" ,rust-pktparse)
  3785. ("rust-rusticata-macros" ; old version doesn't build against nom@7
  3786. ,(p rust-rusticata-macros-4))
  3787. ("rust-pure-rust-locales" ; old version doesn't build against nom@7
  3788. ,rust-pure-rust-locales)
  3789. ("rust-itoa" ,(p rust-itoa-1))
  3790. ("rust-sct" ,(p rust-sct-0.7))
  3791. ("rust-quote" ,(p rust-quote-1))
  3792. ("rust-lexical-core" ,(p rust-lexical-core-0.8)) ; @0.7 doesn't build
  3793. ;; 0.3.0 fails to build against new rust-serde
  3794. ("rust-linked-hash-map"
  3795. ,(p rust-linked-hash-map-0.5))
  3796. ("rust-rust-decimal" ,rust-rust-decimal) ; old rust-decimal incompatible with new rust-arrayvec
  3797. ("rust-rustls-native-certs"
  3798. ;; Old versio incompatible with new rustls
  3799. ,(p rust-rustls-native-certs-0.6))
  3800. ("rust-ron"
  3801. ,(p rust-ron-0.6)) ; old versions don't build
  3802. ("rust-serde"
  3803. ,(p rust-serde-1)) ; old versions don't build
  3804. ("rust-sha1" ,rust-sha1)
  3805. ("rust-rsa" ,rust-rsa)
  3806. ("rust-hashbrown" ,(p rust-hashbrown-0.11))
  3807. ("rust-scopeguard" ,(p rust-scopeguard-1))
  3808. ("rust-webpki" ,(p rust-webpki-0.22))
  3809. ;; Old versions don't build (because rust-tokio-io disappeared)
  3810. ("rust-hyper-rustls" ,rust-hyper-rustls)
  3811. ("rust-rustls"
  3812. ;; Remove old (not-building) and potentially unsecure versions
  3813. ;; Also, rust-tokio-rustls requires a newer rust-rustls.
  3814. ,rust-rustls-0.20)
  3815. ("rust-tokio-rustls" ;0.10.3 doesn't build
  3816. ,rust-tokio-rustls-0.23)
  3817. ("rust-warp" ,rust-warp)
  3818. ;; TODO: respect SSL_CERT_DIR instead of hardcoding trusting
  3819. ;; whoever Mozilla trusts.
  3820. ;; TODO: build from source
  3821. ;; TODO: remove certificates with restrictions
  3822. ("rust-webpki-roots"
  3823. ;; 0.17.0 doesn't build
  3824. ,(p rust-webpki-roots-0.22))
  3825. ("rust-nix" ,(p rust-nix-0.23))
  3826. ("rust-autocfg" ,(p rust-autocfg-1))
  3827. ("rust-bytes" ,(p rust-bytes-1))
  3828. ;; ("rust-tokio-io" ,rust-tokio-io-0.2) ; tokio-io currently removed
  3829. ; ("rust-tokio-codec" ,rust-tokio-io-0.2) ; looks like an error in retrospect
  3830. ("rust-tokio-util" ,rust-tokio-util-0.7)
  3831. ("rust-tokio" ,(p rust-tokio-1.8))
  3832. ("rust-futures" ,rust-futures-0.3)
  3833. ("rust-futures-channel" ,rust-futures-channel-0.3)
  3834. ("rust-futures-core" ,rust-futures-core-0.3)
  3835. ("rust-futures-executor" ,rust-futures-executor-0.3)
  3836. ("rust-futures-io" ,rust-futures-io-0.3)
  3837. ("rust-futures-sink" ,rust-futures-sink-0.3)
  3838. ("rust-futures-task" ,rust-futures-task-0.3)
  3839. ("rust-futures-util" ,rust-futures-util-0.3)
  3840. ("rust-http" ; 0.1 doesn't build and @0.2.1 doesn't have a const HeaderValue from_static
  3841. ,rust-http)
  3842. ;; rust-http-body@0.1.0's dependency rust-tokio-buf doesn't
  3843. ;; build anymore. (TODO remove from Guix)
  3844. ("rust-http-body" ,(p rust-http-body-0.4))
  3845. ("rust-crossbeam-channel"
  3846. ;; avoid old version that don't build
  3847. ,(p rust-crossbeam-channel-0.5))
  3848. ("rust-crossbeam-utils" ; avoid errors by multiple versions of the same crate
  3849. ,(p rust-crossbeam-utils-0.8))
  3850. ;; Likewise.
  3851. ("rust-hyper"
  3852. ,(p rust-hyper-0.14))
  3853. ("rust-nb"
  3854. ;; Avoid E0519, caused by multiple versions of the same crate
  3855. ;; being used. TODO: bump version in 'sniffglue'
  3856. ,(p rust-nb-1))
  3857. ("rust-num-traits" ,(p rust-num-traits-0.2))
  3858. ("rust-cfg-if" ,(p rust-cfg-if-1))
  3859. ("rust-env-logger" ; old versions don't build
  3860. ,(p rust-env-logger-0.9))
  3861. ("rust-lazy-static"
  3862. ,(p rust-lazy-static-1))
  3863. ("rust-rand"
  3864. ,(p rust-rand-0.8))
  3865. ("rust-lock-api" ; 0.3, 0.2, 0.1
  3866. ,(p rust-lock-api-0.4))
  3867. ("rust-sysctl" ; 0.1 does not compile (type errors)
  3868. ,(p rust-sysctl-0.4))
  3869. ;; The (now deprecated) rust-tempdir doesn't build
  3870. ;; against current rust-rand, use the new rust-tempfile
  3871. ;; instead as upstream recommends.
  3872. ("rust-tempdir"
  3873. ,(p rust-tempfile-3))
  3874. ("rust-bare-metal"
  3875. ,(p rust-bare-metal-1))
  3876. ;; The old parking-lot doesn't build against
  3877. ;; the new lock api.
  3878. ("rust-parking-lot"
  3879. ;; TODO: inherit?
  3880. ,(p rust-parking-lot-0.11))
  3881. ("rust-proptest-derive" ,rust-proptest-derive)
  3882. ("rust-arc-swap" ,(p rust-arc-swap-1))
  3883. ("rust-gif" ,(p rust-gif-0.11)) ;; @0.11.2 - crates-graphics @0.11.3 doesn't build ATM
  3884. ("rust-miniz-oxide" ,rust-miniz-oxide)
  3885. ("rust-deflate" ,rust-deflate)
  3886. ("rust-png" ,rust-png)
  3887. ("rust-tiff" ,rust-tiff)
  3888. ("rust-jpeg-decoder" ,rust-jpeg-decoder)
  3889. ("rust-image" ,rust-image)
  3890. ("rust-lebe" ,rust-lebe)
  3891. ("rust-exr" ,rust-exr)
  3892. ("rust-lalrpop" ,rust-lalrpop)
  3893. ("rust-lalrpop-util" ,rust-lalrpop-util)
  3894. ("rust-nettle-sys" ,rust-nettle-sys-2)
  3895. ("rust-nettle" ,rust-nettle-7)
  3896. ;; 0.4.30 fails to build.
  3897. ("rust-proc-macro2" ,(p rust-proc-macro2-1))
  3898. ("rust-log" ,(p rust-log-0.4))
  3899. ("rust-uuid" ,(p rust-uuid-0.8)) ; @0.5.1 doesn't build
  3900. ("rust-watchexec"
  3901. ,(package-with-extra-patches
  3902. (p rust-watchexec-1)
  3903. (list (local-file "rust-watchexec-nix-compatibility.patch")))) ; for compatibiliy with new rust-nix
  3904. ("rust-wayland-commons" ,rust-wayland-commons) ; for compatibility with new rust-nix
  3905. ("rust-xml5ever" ,rust-xml5ever)
  3906. ("rust-zip" ,rust-zip)))
  3907. ;; Needed to support multiple versions of the same crate in the same result.
  3908. (define %automatic-metadata ; TODO: make automatic metadata the default!
  3909. '("rust-arrayvec"
  3910. "rust-mio"
  3911. "rust-nom"
  3912. "rust-percent-encoding"
  3913. "rust-derive-builder"))
  3914. ;; TODO: add these (upstream) or teach "guix style" to add them
  3915. (define %extra-inputs
  3916. `(("rust-structopt" ; for paw feature
  3917. (("rust-paw" ,(p rust-paw-1))))
  3918. ("rust-aom-sys"
  3919. (("rust-system-deps" ,(p rust-system-deps-3)))) ; missing input (TODO: native-input)
  3920. ("rust-servo-fontconfig-sys"
  3921. (("fontconfig" ,(@ (gnu packages fontutils) fontconfig))))
  3922. ("rust-swayipc"
  3923. (("rust-futures-core" ,rust-futures-core-0.3)
  3924. ("rust-failure" ,(p rust-failure-0.1))))
  3925. ("rust-syslog"
  3926. (("rust-hostname" ,(p rust-hostname-0.3)))) ; new dependency of new version of rust-syslog
  3927. ("rust-swayipc+sync"
  3928. (("rust-futures-core" ,rust-futures-core-0.3)
  3929. ("rust-failure" ,(p rust-failure-0.1))))
  3930. ("castor" ;; TODO: add them in upstream Guix
  3931. (("rust-gio" ,(@ (gnu packages crates-gtk) rust-gio-0.14))
  3932. ("rust-glib" ,(@ (gnu packages crates-gtk) rust-glib-0.14))
  3933. ("rust-gdk-pixbuf" ,(@ (gnu packages crates-gtk) rust-gdk-pixbuf-0.14))
  3934. ("rust-pango-sys" ,(@ (gnu packages crates-gtk) rust-pango-sys-0.14))
  3935. ("rust-pango" ,(@ (gnu packages crates-gtk) rust-pango-0.14))
  3936. ("rust-lazy-static" ,(p rust-lazy-static-1))
  3937. ("rust-serde" ,(p rust-serde-1))
  3938. ("rust-serde-derive" ,(p rust-serde-derive-1))
  3939. ("rust-toml" ,(p rust-toml-0.5))
  3940. ("rust-tempfile" ,(p rust-tempfile-3))
  3941. ("rust-openssl" ,(p rust-openssl-0.10))
  3942. ("rust-regex" ,(p rust-regex-1))
  3943. ("rust-textwrap" ,(p rust-textwrap-0.12))))
  3944. ("rust-actix-codec" ; new inputs of new version
  3945. (("rust-memchr" ,(p rust-memchr-2))
  3946. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))))
  3947. ("rust-actix-http"
  3948. (("rust-ahash" ,(p rust-ahash-0.7))
  3949. ("rust-zstd" ,(p rust-zstd-0.9))
  3950. ("rust-bytestring" ,(p rust-bytestring-0.1))
  3951. ("rust-local-channel" ,rust-local-channel) ; for ws feature
  3952. ("rust-futures-core" ,rust-futures-core-0.3) ; for ws feature
  3953. ("rust-httpdate" ,(p rust-httpdate-1))
  3954. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))
  3955. ("rust-smallvec" ,(p rust-smallvec-1))))
  3956. ("rust-actix-rt" ;new dependencies for new version
  3957. (("rust-futures-core" ,(p rust-futures-core-0.3))))
  3958. ("rust-actix-utils" ;new dependencies for new version
  3959. (("rust-local-waker" ,rust-local-waker)
  3960. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))))
  3961. ("rust-actix-server" ;new dependencies for new version
  3962. (("rust-mio" ,rust-mio)
  3963. ("rust-tokio" ,rust-tokio)
  3964. ("rust-futures-core" ,rust-futures-core-0.3)
  3965. ("rust-futures-util" ,rust-futures-util-0.3)
  3966. ("rust-tracing" ,(p rust-tracing-0.1))))
  3967. ("rust-actix-service" ;likewise
  3968. (("rust-futures-core" ,rust-futures-core-0.3)
  3969. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))
  3970. ("rust-paste" ,(p rust-paste-1))))
  3971. ("rust-actix-tls" ;likewise
  3972. (("rust-futures-core" ,rust-futures-core-0.3)
  3973. ("rust-http" ,rust-http) ; for "uri" feature
  3974. ("rust-actix-rt" ,rust-actix-rt)
  3975. ("rust-log" ,(p rust-log-0.4))
  3976. ("rust-tokio-util" ,(p rust-tokio-util-0.3))))
  3977. ("rust-actix-router" ; likewise
  3978. (("rust-firestorm" ,rust-firestorm)))
  3979. ("rust-actix-web" ;likewise (TODO doesn't build yet)
  3980. (("rust-actix-router" ,(p rust-actix-router-0.2))
  3981. ("rust-bytestring" ,(p rust-bytestring-0.1))
  3982. ("rust-smallvec" ,(p rust-smallvec-1))
  3983. ("rust-actix-web-codegen" ,rust-actix-web-codegen)
  3984. ("rust-cfg-if" ,(p rust-cfg-if-1))
  3985. ("rust-itoa" ,(p rust-itoa-1))
  3986. ("rust-language-tags" ,(p rust-language-tags-0.2))
  3987. ("rust-once-cell" ,(p rust-once-cell-1))
  3988. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))
  3989. ("rust-cookie" ,(p rust-cookie-0.15))
  3990. ("rust-ahash" ,(p rust-ahash-0.7))))
  3991. ("rust-actix-web-codegen" ; likewise
  3992. (("rust-actix-router" ,(p rust-actix-router-0.2))))
  3993. ("rust-actix" ; likewise
  3994. (("rust-futures-core" ,rust-futures-core-0.3)
  3995. ("rust-futures-sink" ,rust-futures-sink-0.3)
  3996. ("rust-futures-task" ,rust-futures-task-0.3)
  3997. ("rust-futures-util" ,rust-futures-util-0.3)
  3998. ("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))))
  3999. ("rust-awc" ; new dependencies for new version
  4000. (("rust-pin-project-lite" ,(p rust-pin-project-lite-0.2))
  4001. ("rust-actix-tls" ,rust-actix-tls)
  4002. ("rust-actix-utils" ,rust-actix-utils)
  4003. ("rust-ahash" ,(p rust-ahash-0.7))
  4004. ("rust-cookie" ,(p rust-cookie-0.15))
  4005. ("rust-futures-util" ,rust-futures-util-0.3)
  4006. ("rust-h2" ,(p rust-h2-0.3))
  4007. ("rust-itoa" ,(p rust-itoa-1))
  4008. ("rust-http" ,(p rust-http-0.2))
  4009. ("rust-tokio" ,rust-tokio)))
  4010. ("rust-enquote" ; missing input
  4011. (("rust-thiserror" ,(p rust-thiserror-1))))
  4012. ("rust-freetype-sys"
  4013. (("freetype" ,(@ (gnu packages fontutils) freetype))))
  4014. ;; No need to avoid Rust dependencies.
  4015. ("rust-flate2"
  4016. ,(list (list "zlib" (@ (gnu packages compression) zlib))))
  4017. ("rust-chrono-tz" ; missing input
  4018. (("rust-uncased" ,(p rust-uncased-0.9))))
  4019. ("rust-cmake"
  4020. ,(list (list "cmake" (@ (gnu packages cmake) cmake-minimal))))
  4021. ("rust-clang-sys"
  4022. ;; TODO needs more work for
  4023. ,(list (list "clang" (@ (gnu packages llvm) clang-13))))
  4024. ("rust-config" ; new inputs for new verison
  4025. (("rust-async-trait" ,(p rust-async-trait-0.1))
  4026. ("rust-ron" ,(p rust-ron-0.6))
  4027. ("rust-pathdiff" ,(p rust-pathdiff-0.2))))
  4028. ("rust-dashmap" ; new inputs forn new version
  4029. (("rust-hashbrown" ,(p rust-hashbrown-0.11))
  4030. ("rust-parking-lot-core" ,(p rust-parking-lot-core-0.8))
  4031. ("rust-lock-api" ,(p rust-lock-api-0.4))))
  4032. ;; for "pem" feature
  4033. ("rust-der"
  4034. (("rust-pem-rfc7468" ,(@ (gnu packages crates-io) rust-pem-rfc7468-0.2))))
  4035. ("rust-embed-resource"
  4036. (("rust-cc" ,(p rust-cc-1)))) ;; TODO: native-input
  4037. ;; for "pem" and "alloc" feature
  4038. ("rust-pkcs1"
  4039. (("rust-pkcs8" ,(@ (gnu packages crates-io) rust-pkcs8-0.7))))
  4040. ;; for "cbc" feature
  4041. ("rust-pkcs5"
  4042. (("rust-cbc" ,rust-cbc)
  4043. ("rust-sha1" ,rust-sha1))) ; missing dep (for pbes2)
  4044. ("rust-reqwest" ; new inputs for new version
  4045. (("rust-h2" ,rust-h2)))
  4046. ("rust-sha1" (("rust-digest" ,rust-digest)
  4047. ("rust-cfg-if" ,(p rust-cfg-if-1)) ;missing dep
  4048. ("rust-cpufeatures" ,(p rust-cpufeatures-0.2))))
  4049. ;; for "sha1" and "sha2" features
  4050. ("rust-spki" (("rust-sha1" ,rust-sha1)
  4051. ("rust-base64ct" ,(p rust-base64ct-1)) ; missing dep
  4052. ("rust-sha2" ,(@ (gnu packages crates-io) rust-sha2-0.10))))
  4053. ("rust-image" (("rust-exr" ,rust-exr)))
  4054. ("rust-libsqlite3-sys" (("sqlite" ,(@ (gnu packages sqlite) sqlite)))) ; missing dependencies (the old versions of rust-libsqlite3-sys acurately add this dependency!),see #56032
  4055. ;; contains pkg-config files
  4056. ("rust-mysqlclient-sys" (("mariadb:dev" ,(@ (gnu packages databases) mariadb) "dev")))
  4057. ;; possibly only required by new version
  4058. #;("rust-boxxy" (("rust-anyhow" ,(@ (gnu packages crates-io) rust-anyhow-1)))) ; TODO: currently useless because in %removed-dependencies, revisit when tests are supported
  4059. ("rust-petgraph" (("rust-indexmap" ,(@ (gnu packages crates-io) rust-indexmap-1))))
  4060. ("sniffglue" (("rust-bstr" ,(@ (gnu packages crates-io) rust-bstr-0.2))))
  4061. ("rust-lalrpop" (("rust-tiny-keccak" ,(p rust-tiny-keccak-2))
  4062. ("rust-pico-args" ,rust-pico-args)))
  4063. ("rust-ncurses" (("ncurses" ,(@ (gnu packages ncurses) ncurses)))) ; missing input
  4064. ;; TODO: is this sufficient?
  4065. ("rust-futures-core-preview"
  4066. (("rust-futures-core" ,rust-futures-core-0.3)))
  4067. ("rust-http-body" ; at least for 0.4
  4068. (("rust-pin-project-lite" ,(@ (gnu packages crates-io) rust-pin-project-lite-0.2))))
  4069. ("rust-headers"
  4070. (("rust-httpdate" ,(p rust-httpdate-1)))) ; new dependency
  4071. ("rust-s3handler" ; new dependency for new version
  4072. (("rust-thiserror" ,(p rust-thiserror-1))))
  4073. ("rust-tectonic-bridge-core"
  4074. ;; TODO: native-input
  4075. ;; Required in rust-tectonic-bridge-core@0.3 for extra 'regenerate-cbindgen-things'
  4076. ;; phase.
  4077. (("rust-cbindgen" ,rust-cbindgen-0.19)))
  4078. ("rust-tectonic-bridge-freetype2"
  4079. (("freetype" ,(@ (gnu packages fontutils) freetype))))
  4080. ("rust-tectonic-bridge-graphite2"
  4081. (("graphite2" ,(@ (gnu packages fontutils) graphite2))))
  4082. ("rust-tectonic-bridge-harfbuzz"
  4083. (("freetype" ,(@ (gnu packages fontutils) freetype))
  4084. ("harfbuzz" ,(@ (gnu packages gtk) harfbuzz))))
  4085. ("rust-tectonic-bridge-icu"
  4086. (("icu4c" ,(@ (gnu packages icu4c) icu4c))))
  4087. ("rust-tectonic-xetex-layout" ; missing input
  4088. (("fontconfig" ,(@ (gnu packages fontutils) fontconfig))
  4089. ("harfbuzz" ,(@ (gnu packages gtk) harfbuzz)))) ; missing input, .pc points to a subdirectory while it shouldn't or #include <harfbuzz/hb.h> needs to be replaced by #include <harfbuzz/hb.h>
  4090. ("rust-tectonic-engine-xetex" ; missing input (TODO: maybe detect (upstream) in rust-tectonic-xetex-layout to add to the list?)
  4091. (("fontconfig" ,(@ (gnu packages fontutils) fontconfig))
  4092. ("harfbuzz" ,(@ (gnu packages gtk) harfbuzz-3.0))))
  4093. ("rust-tungstenite"
  4094. (("rust-thiserror" ,(p rust-thiserror-1))))
  4095. ("rust-tokio" ; new dependency for new version
  4096. (("rust-socket2" ,(p rust-socket2-0.4))))
  4097. ("rust-tokio-sync"
  4098. ;; TODO: remove 'preview' dependencies?
  4099. (("rust-futures-core" ,rust-futures-core-0.3)
  4100. ("rust-futures-sink" ,rust-futures-sink-0.3)
  4101. ("rust-futures-util" ,rust-futures-util-0.3)))
  4102. ("rust-tokio-util"
  4103. (("rust-tracing" ,(p rust-tracing-0.1)))) ; missing dependency
  4104. ("rust-warp" ; new dependencies for new version
  4105. (("rust-futures-channel" ,(p rust-futures-channel-0.3))
  4106. ("rust-futures-util" ,(p rust-futures-util-0.3))
  4107. ("rust-tokio-util" ,rust-tokio-util-0.7)
  4108. ("rust-rustls-pemfile" ,(p rust-rustls-pemfile-0.2))
  4109. ("rust-percent-encoding" ,(p rust-percent-encoding-2))))
  4110. ("rust-zip" ; new inputs for new version
  4111. (("rust-zstd" ,(p rust-zstd-0.9))))))
  4112. (define (find-replacement dependent dependency)
  4113. (define test-replacement
  4114. (match-lambda
  4115. ((key new) (and (equal? key (package-name dependency)) new))
  4116. ((key new #:for-dependent dependent-match?)
  4117. (and (equal? key (package-name dependency))
  4118. (dependent-match? dependent)
  4119. new))
  4120. (stuff (pk 'oops stuff)
  4121. (error "bogus entry in %replacments"))))
  4122. (any test-replacement %replacements))
  4123. ;; todo: ‘stub‘ rust-rustc-version to reduce deps?
  4124. ;; grrr rust-backtrace
  4125. (define (vitaminate/auto* pack)
  4126. (if (eq? (package-build-system pack) (@ (guix build-system cargo) cargo-build-system))
  4127. (apply
  4128. (lambda* (#:key (cargo-development-inputs '()) (cargo-inputs '())
  4129. (phases '%standard-phases)
  4130. ;; TODO: cargo test flags
  4131. skip-build? cargo-test-flags tests?
  4132. cargo-build-flags ; TODO: investigate later
  4133. vendor-dir ; not needed in antioxidant
  4134. (rust-metadata #false) ; #false: automatically determine
  4135. modules ; TODO: handle #:modules
  4136. install-source? ; not used by antioxidant-build-system
  4137. (features #~'("default")))
  4138. (unless (or (eq? phases '%standard-phases)
  4139. (not (is-cargo-toml-phases? phases)))
  4140. (error "phases?"))
  4141. (define fix-input
  4142. (match-lambda
  4143. ((label dependency . maybe-output)
  4144. (and (not (remove-dependency? pack dependency))
  4145. ;; These are actually test inputs! (TODO guix)
  4146. ;; (TODO: this isn't build from source)
  4147. ;;(not (equal? (package-name pack) "rust-pure-rust-locales"))
  4148. #;(pk 'p pack dependency)
  4149. (cons* label (vitaminate/auto
  4150. ;; Resolve version conflicts, choose newer versions,
  4151. ;; etc.
  4152. (or (find-replacement pack dependency) dependency))
  4153. maybe-output)))))
  4154. ;; Detect cycles early by unthunking
  4155. (define i
  4156. (filter-map fix-input
  4157. (append (match (assoc-ref %extra-inputs (package-name pack))
  4158. ((association-list) association-list)
  4159. (#false '())) ; no extra inputs
  4160. cargo-inputs
  4161. (package-inputs pack))))
  4162. (define n-i (filter-map fix-input
  4163. (append cargo-development-inputs
  4164. ;; TODO: move zlib of rust-libz-sys-1 from
  4165. ;; native-inputs to inputs.
  4166. (package-native-inputs pack)
  4167. (match (package-name pack)
  4168. ("rust-backtrace"
  4169. `(("rust-cc" ,(p rust-cc-1)))) ; missing dep
  4170. (_ '())))))
  4171. (define p-i (filter-map fix-input (package-propagated-inputs pack)))
  4172. (package
  4173. (inherit (vitaminate-library/no-inputs pack))
  4174. (source
  4175. (match (package-name pack)
  4176. ("rust-libnghttp2-sys"
  4177. (origin
  4178. (inherit (package-source pack))
  4179. ;; original unbundling code doesn't work for antioxidant
  4180. ;; (the library directory -L is not recorded, only -l was).
  4181. (patches (list (local-file "rust-libnghttp2-unbundle.patch")))
  4182. (snippet #~(begin
  4183. (delete-file-recursively "nghttp2")
  4184. (rename-file "Cargo.toml.orig" "Cargo.toml")))))
  4185. ("rust-itoa"
  4186. (origin
  4187. (inherit (package-source pack))
  4188. ;; TODO: for compatibility with rust-http
  4189. (patches (list (local-file "rust-itoa-Reintroduce-fmt.patch")))))
  4190. (_ (package-source pack))))
  4191. (arguments (list #:rust-metadata ; the same crate can be linked to multiple times with different versions as long a the metadata is different. (it's not simply set to X.Y.Z, to allow for grafting later)
  4192. (cond (rust-metadata rust-metadata)
  4193. ((member (package-name pack) %automatic-metadata)
  4194. ;; TODO: maybe make this the default (in antioxidant.scm?)
  4195. (string-append "version="
  4196. (if (string-prefix? "0." (package-version pack))
  4197. (version-major+minor (package-version pack))
  4198. (version-major (package-version pack)))))
  4199. (#true ""))
  4200. #:rust-crate-type
  4201. (match (assoc (package-name pack) %crate-types)
  4202. ((_ value) value)
  4203. (#false #~#false)) ; use Cargo.toml
  4204. #:features
  4205. ;; TODO: can some now be removed now that default features
  4206. ;; are enabled by default? And maybe the features can be moved
  4207. ;; to Guix upstream?
  4208. (match (assoc (package-name pack) %features)
  4209. ((_ value)
  4210. (match value
  4211. ((? procedure? procedure) (procedure pack))
  4212. ((? gexp? value) value)))
  4213. (#false (match features
  4214. ((? gexp? f) f)
  4215. (('quote l)
  4216. ;; TODO: escapes, less ad-hoc
  4217. #~'#$l))))))
  4218. (inputs i)
  4219. (native-inputs n-i)
  4220. (propagated-inputs p-i)
  4221. (search-paths
  4222. (append
  4223. (match (package-name pack)
  4224. ;; Make sure that PKG_CONFIG_PATH is available to build.rs.
  4225. ;; rust-system-deps uses rust-pkg-config, so it needs the
  4226. ;; search paths too -- needed for compiling rust-glib-sys@0.14.0.
  4227. ;; TODO: upstream Guix
  4228. ((or "rust-pkg-config"
  4229. "rust-system-deps"
  4230. "rust-tectonic-dep-support")
  4231. (package-search-paths (@ (gnu packages pkg-config) pkg-config)))
  4232. (_ '()))
  4233. (package-search-paths pack)))
  4234. (native-search-paths
  4235. (append
  4236. (match (package-name pack)
  4237. ;; Make sure that PKG_CONFIG_PATH is available to build.rs.
  4238. ((or "rust-pkg-config"
  4239. "rust-system-deps"
  4240. "rust-tectonic-dep-support")
  4241. (package-native-search-paths (@ (gnu packages pkg-config) pkg-config)))
  4242. (_ '()))
  4243. (package-native-search-paths pack)))))
  4244. (package-arguments pack))
  4245. pack))
  4246. (define vitamination-stack ; only for cycle detection
  4247. (make-parameter '()))
  4248. (define vitaminate/auto
  4249. ((@ (guix memoization) mlambda) (pack)
  4250. (when (member pack (vitamination-stack))
  4251. (call-with-values
  4252. (lambda ()
  4253. (break (lambda (x) (eq? x pack)) (vitamination-stack)))
  4254. (lambda (cycle before)
  4255. (pk 'cyclic-vitamines)
  4256. (pk #:begin (reverse (map package-name before)))
  4257. (pk #:cycle (reverse (cons '... (map package-name (cons pack cycle)))))))
  4258. (pk "oops, a cycle?")
  4259. (throw 'antioxidant-cycle)) ; caught in antioxidant-ci.scm
  4260. (parameterize ((vitamination-stack (cons pack (vitamination-stack))))
  4261. (vitaminate/auto* pack))))
  4262. ;; Self-checks
  4263. (define (check-removed-extra-inputs)
  4264. "Verify that %extra-inputs is not in contradiction with
  4265. %removed-dependencies"
  4266. ;; List packages in %removed-dependencies which have an entry in
  4267. ;; %extra-inputs defined (useless, unless it's a leaf package)
  4268. (define (check-removed-dependency entry)
  4269. (match entry
  4270. ((? string? name)
  4271. (when (assoc name %extra-inputs)
  4272. (pk name "in %removed-dependencies and %extra-inputs (probably useless)")
  4273. (throw 'oops)))
  4274. (((? string? left) '-> (? string? right))
  4275. (when (member right %removed-dependencies)
  4276. (pk right "(a -> b) entry in %removed-dependencies and b in %removed-dependencies (redundant)")
  4277. (throw 'oops))
  4278. (when (member left %removed-dependencies)
  4279. (pk left "(a -> b) entry in %removed-dependencies and a in %removed-dependencies (useless)")
  4280. (throw 'oops)))
  4281. (((? string? dependency-name) #:for-dependent context?)
  4282. (when (member dependency-name %removed-dependencies)
  4283. (pk dependency-name "a #:for-dependent context? entry in %removed-dependencies and a in %removed-dependencies (redundant")
  4284. (throw 'oops)))
  4285. (a (pk 'a a)
  4286. (error "bogus entry in %removed-dependencies"))))
  4287. ;; list names listed as an extra-input for some package and also in
  4288. ;; %removed-dependencies (confusing, because they would have to be both
  4289. ;; added and removed).
  4290. (define check-extra-input
  4291. (match-lambda
  4292. (((? string? name) (? list? dependencies))
  4293. (let ((check-dependency
  4294. (match-lambda ((dependency-name _ . rest)
  4295. (when (member dependency-name %removed-dependencies)
  4296. (pk "extra-input " dependency-name " of " name "in %removed-dependencies (contradictory)")
  4297. (throw 'oops))
  4298. (when (member (list name '-> dependency-name) %removed-dependencies)
  4299. (pk name "->" dependency-name "both in %removed-dependencies and %extra-inputs (contradictory)")
  4300. (throw 'oops))))))
  4301. (for-each check-dependency dependencies)))))
  4302. (for-each check-removed-dependency %removed-dependencies)
  4303. (for-each check-extra-input %extra-inputs))
  4304. (check-removed-extra-inputs)
  4305. ;; todo: cycle between rust-demo-hack and rust-demo-hack-impl
  4306. ;; Make some functioning packages available to "guix install ANTIOXIDATED-FOO"
  4307. ;; when using channels.
  4308. (define (public-test-package base)
  4309. (package
  4310. (inherit base)
  4311. (name (string-append "antioxidated-" (package-name base))))) ; don't shadow the cargo package to avoid ambiguity
  4312. (define-public antioxidated-rust-bindgen
  4313. (public-test-package (vitaminate/auto (p rust-bindgen-0.59)))) ; fragile w.r.t. changes to code for linking to C libraries, avoid breaking it
  4314. (define-public antioxidated-agate
  4315. (public-test-package (vitaminate/auto agate)))
  4316. (define-public antioxidated-alfis
  4317. (public-test-package (vitaminate/auto alfis)))
  4318. (define-public antioxidated-castor
  4319. (public-test-package (vitaminate/auto castor)))
  4320. (define-public antioxidated-diffr
  4321. (public-test-package (vitaminate/auto (@ (gnu packages rust-apps) diffr))))
  4322. (define-public antioxidated-drill
  4323. (package
  4324. (inherit (public-test-package (vitaminate/auto drill)))
  4325. (source
  4326. (origin
  4327. (inherit (package-source drill))
  4328. (patches (list (local-file "drill-update-dependencies.patch")))
  4329. (snippet #~(rename-file "Cargo.toml.orig" "Cargo.toml"))))))
  4330. (define-public antioxidated-dutree
  4331. (public-test-package (vitaminate/auto dutree)))
  4332. (define-public antioxidated-git-absorb
  4333. (public-test-package (vitaminate/auto git-absorb)))
  4334. (define-public antioxidated-hex
  4335. (public-test-package (vitaminate/auto hex)))
  4336. (define-public antioxidated-hexyl
  4337. (public-test-package (vitaminate/auto (@ (gnu packages rust-apps) hexyl))))
  4338. (define-public antioxidated-ripgrep
  4339. (public-test-package (vitaminate/auto ripgrep)))
  4340. (define-public antioxidated-rtss
  4341. (public-test-package (vitaminate/auto rtss)))
  4342. (define-public antioxidated-sniffglue
  4343. (public-test-package (vitaminate/auto sniffglue)))
  4344. (define-public antioxidated-swayhide
  4345. (public-test-package (vitaminate/auto swayhide)))
  4346. (define-public antioxidated-tealdeer
  4347. (public-test-package (vitaminate/auto tealdeer)))
  4348. (define-public antioxidated-newsboat
  4349. ;; "newsboat" has a Makefile that uses Cargo and Cargo workspaces,
  4350. ;; which is currently unsupported by antioxidant.
  4351. (let* ((base (@ (gnu packages syndication) newsboat))
  4352. (base/antioxidant (vitaminate/auto base))
  4353. (base/internal ;; TODO: hidden
  4354. (package
  4355. (inherit base/antioxidant)
  4356. (synopsis "Internal library of newsboat")
  4357. (description "This is an internal library of newsboat")
  4358. (properties '((hidden? . #t)))))
  4359. (arguments/chdir
  4360. (lambda (dir)
  4361. (list #:phases
  4362. #~(modify-phases %standard-antioxidant-phases
  4363. (add-after 'unpack 'goto-rust-code
  4364. (lambda _
  4365. (chdir #$dir))))))))
  4366. (define rust-newsboat-regex-rs
  4367. (package
  4368. (inherit base/internal)
  4369. (name "rust-newsboat-regex-rs")
  4370. (arguments (arguments/chdir "rust/regex-rs"))
  4371. (inputs (modify-inputs
  4372. (package-inputs base/antioxidant)
  4373. (prepend rust-newsboat-strprintf)))))
  4374. (define rust-newsboat-strprintf
  4375. (package
  4376. (inherit base/internal)
  4377. (name "rust-strprintf")
  4378. (arguments (arguments/chdir "rust/strprintf"))))
  4379. ;; TODO: gettext-system feature of the gettext crate
  4380. ;; TODO: building this as a static library is sufficient even once antioxidant
  4381. ;; supports shared libraries
  4382. (define rust-libnewsboat
  4383. (package
  4384. (inherit base/internal)
  4385. (name "rust-libnewsboat")
  4386. (arguments (arguments/chdir "rust/libnewsboat"))
  4387. (inputs (modify-inputs
  4388. (package-inputs base/antioxidant)
  4389. (prepend rust-newsboat-regex-rs rust-newsboat-strprintf)))))
  4390. (define rust-libnewsboat-ffi
  4391. (package
  4392. (inherit base/internal)
  4393. (name "rust-libnewsboat-ffi")
  4394. (arguments (append
  4395. (list #:rust-crate-type "staticlib") ; TODO: non-static, for grafts. Also huge (77.4 MiB)! Is there a mechanism for static libraries that _doesn't_ include copies of the dependencies?
  4396. ;; TODO: investigate contents
  4397. (substitute-keyword-arguments (arguments/chdir "rust/libnewsboat-ffi")
  4398. ((#:phases old-phases)
  4399. #~(modify-phases #$(pk 'o old-phases)
  4400. (add-before 'unpack 'set-rust-cxx-output
  4401. (lambda _
  4402. (mkdir-p (string-append #$output "/lib/newsboat-ffi-things"))
  4403. (setenv "RUST_CXX_BUILD_OUTPUT" (string-append #$output "/lib/newsboat-ffi-things")))))))))
  4404. (inputs (modify-inputs
  4405. (package-inputs base/antioxidant)
  4406. (prepend rust-libnewsboat)))))
  4407. (public-test-package ; TODO solve build failures (cannot find -lnghttp2)
  4408. (package
  4409. (inherit base/antioxidant)
  4410. (build-system (@ (guix build-system gnu) gnu-build-system))
  4411. (arguments
  4412. (list #:make-flags #~(list (string-append "prefix=" #$output)
  4413. (string-append "CARGO=echo 'do not use cargo for:'"))
  4414. #:imported-modules (cons '(antioxidant) %gnu-build-system-modules)
  4415. #:modules
  4416. '((guix build gnu-build-system)
  4417. (antioxidant)
  4418. (guix build utils))
  4419. #:tests? #false ;; fails with ‘Error opening terminal: unknown’. Also, the unantixidated variant did not run tests’ --> TODO: what
  4420. #:phases
  4421. #~(modify-phases %standard-phases
  4422. ;; required by (antioxidant)
  4423. #$@(with-extensions (list guile-json-4) #~())
  4424. (delete 'configure)
  4425. ;; TODO: maybe create a symlink forest of the generated
  4426. ;; headers by default (in 'target', where the Makefile
  4427. ;; expects it?)
  4428. (add-after 'unpack 'find-ffi-things
  4429. (lambda* (#:key inputs #:allow-other-keys)
  4430. (substitute* "Makefile"
  4431. (("\\$\\(relative_cargo_target_dir\\)/cxxbridge")
  4432. (search-input-directory inputs "lib/newsboat-ffi-things/cxxbridge/include"))
  4433. ;; todo: find dependency -lzlib etc. (--> now solved? to be verified)
  4434. (("\\$\\(CARGO_TARGET_DIR\\)/\\$\\(BUILD_TYPE\\)/libnewsboat.a")
  4435. (search-input-file inputs "lib/guixcrate/libnewsboat.a"))
  4436. (("-L\\$\\(CARGO_TARGET_DIR\\)/\\$\\(BUILD_TYPE\\)")
  4437. (let ((crates (find-directly-available-crates inputs))
  4438. (required (list (make-crate-mapping "libnewsboat-ffi" "libnewsboat-ffi"))))
  4439. (string-append "-L"
  4440. (dirname (search-input-file inputs "lib/guixcrate/libnewsboat.a"))
  4441. " "
  4442. (string-join (linker-arguments/non-rustc crates required))))))))
  4443. (add-after 'unpack 'replace-cargo
  4444. (lambda _ ; TODO: finish
  4445. (substitute* "config.sh"
  4446. (("fail \"cargo\"") ":")))))))
  4447. (inputs (modify-inputs (package-inputs base/antioxidant)
  4448. (append rust-libnewsboat-ffi)))))))
  4449. ;; Make a shared library and link to it
  4450. (define-public test-lib
  4451. (package
  4452. (source (local-file "shared-lib" #:recursive? #true))
  4453. (name "test-sharedlib")
  4454. (version "0.0")
  4455. (build-system antioxidant-build-system)
  4456. (home-page #f)
  4457. (synopsis "Basic example of C-style shared libraries implemented in Rust")
  4458. (arguments
  4459. (list #:rust-dynamic-library-arguments
  4460. #~'("-C" "link-args=-rdynamic")
  4461. #:phases
  4462. #~(modify-phases %standard-antioxidant-phases
  4463. (replace 'build-binaries
  4464. (lambda _
  4465. (mkdir (string-append #$output "/bin"))
  4466. (invoke "gcc" "-L" (string-append #$output "/lib")
  4467. "-lsharedlib"
  4468. "example.c"
  4469. "-o" (string-append #$output "/bin/test")))))))
  4470. ;; /gnu/store/[...]/bin/test || echo $? ---> 42
  4471. (description #f)
  4472. (license #f)))
  4473. ;; For local development
  4474. (list antioxidated-rust-bindgen
  4475. antioxidated-agate
  4476. antioxidated-castor
  4477. antioxidated-dutree
  4478. antioxidated-diffr
  4479. antioxidated-git-absorb
  4480. antioxidated-hex
  4481. antioxidated-hexyl
  4482. antioxidated-ripgrep
  4483. antioxidated-rtss
  4484. antioxidated-sniffglue
  4485. antioxidated-swayhide
  4486. antioxidated-tealdeer
  4487. test-lib)