linux.scm 361 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
  4. ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
  5. ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
  6. ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
  7. ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  8. ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
  10. ;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  11. ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
  12. ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
  13. ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
  14. ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  15. ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
  16. ;;; Copyright © 2016 David Craven <david@craven.ch>
  17. ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
  18. ;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
  19. ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
  20. ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
  21. ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
  22. ;;; Copyright © 2017, 2018, 2020, 2021 Leo Famulari <leo@famulari.name>
  23. ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
  24. ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
  25. ;;; Copyright © 2017, 2019, 2021 Mathieu Othacehe <othacehe@gnu.org>
  26. ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
  27. ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
  28. ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
  29. ;;; Copyright © 2017 Dave Love <fx@gnu.org>
  30. ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
  31. ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
  32. ;;; Copyright © 2018 Manuel Graf <graf@init.at>
  33. ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
  34. ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
  35. ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
  36. ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  37. ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
  38. ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
  39. ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
  40. ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
  41. ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  42. ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
  43. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  44. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  45. ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
  46. ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
  47. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  48. ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
  49. ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
  50. ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
  51. ;;; Copyright © 2020 David Dashyan <mail@davie.li>
  52. ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
  53. ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
  54. ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
  55. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  56. ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
  57. ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
  58. ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
  59. ;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
  60. ;;;
  61. ;;; This file is part of GNU Guix.
  62. ;;;
  63. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  64. ;;; under the terms of the GNU General Public License as published by
  65. ;;; the Free Software Foundation; either version 3 of the License, or (at
  66. ;;; your option) any later version.
  67. ;;;
  68. ;;; GNU Guix is distributed in the hope that it will be useful, but
  69. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  70. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  71. ;;; GNU General Public License for more details.
  72. ;;;
  73. ;;; You should have received a copy of the GNU General Public License
  74. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  75. (define-module (gnu packages linux)
  76. #:use-module (gnu packages)
  77. #:use-module (gnu packages acl)
  78. #:use-module (gnu packages admin)
  79. #:use-module (gnu packages algebra)
  80. #:use-module (gnu packages audio)
  81. #:use-module (gnu packages autotools)
  82. #:use-module (gnu packages backup)
  83. #:use-module (gnu packages base)
  84. #:use-module (gnu packages bash)
  85. #:use-module (gnu packages bison)
  86. #:use-module (gnu packages boost)
  87. #:use-module (gnu packages calendar)
  88. #:use-module (gnu packages check)
  89. #:use-module (gnu packages cpio)
  90. #:use-module (gnu packages crypto)
  91. #:use-module (gnu packages cryptsetup)
  92. #:use-module (gnu packages compression)
  93. #:use-module (gnu packages dbm)
  94. #:use-module (gnu packages datastructures)
  95. #:use-module (gnu packages docbook)
  96. #:use-module (gnu packages documentation)
  97. #:use-module (gnu packages elf)
  98. #:use-module (gnu packages flex)
  99. #:use-module (gnu packages file)
  100. #:use-module (gnu packages freedesktop)
  101. #:use-module (gnu packages gawk)
  102. #:use-module (gnu packages gcc)
  103. #:use-module (gnu packages gettext)
  104. #:use-module (gnu packages glib)
  105. #:use-module (gnu packages gnupg)
  106. #:use-module (gnu packages golang)
  107. #:use-module (gnu packages gperf)
  108. #:use-module (gnu packages gstreamer)
  109. #:use-module (gnu packages gtk)
  110. #:use-module (gnu packages haskell-apps)
  111. #:use-module (gnu packages haskell-xyz)
  112. #:use-module (gnu packages libunwind)
  113. #:use-module (gnu packages libusb)
  114. #:use-module (gnu packages llvm)
  115. #:use-module (gnu packages lua)
  116. #:use-module (gnu packages man)
  117. #:use-module (gnu packages maths)
  118. #:use-module (gnu packages multiprecision)
  119. #:use-module (gnu packages ncurses)
  120. #:use-module (gnu packages netpbm)
  121. #:use-module (gnu packages networking)
  122. #:use-module (gnu packages ninja)
  123. #:use-module (gnu packages nss)
  124. #:use-module (gnu packages perl)
  125. #:use-module (gnu packages pciutils)
  126. #:use-module (gnu packages pkg-config)
  127. #:use-module (gnu packages popt)
  128. #:use-module (gnu packages pulseaudio)
  129. #:use-module (gnu packages python)
  130. #:use-module (gnu packages python-xyz)
  131. #:use-module (gnu packages readline)
  132. #:use-module (gnu packages rrdtool)
  133. #:use-module (gnu packages samba)
  134. #:use-module (gnu packages sdl)
  135. #:use-module (gnu packages serialization)
  136. #:use-module (gnu packages slang)
  137. #:use-module (gnu packages sqlite)
  138. #:use-module (gnu packages texinfo)
  139. #:use-module (gnu packages tls)
  140. #:use-module (gnu packages valgrind)
  141. #:use-module (gnu packages video)
  142. #:use-module (gnu packages vulkan)
  143. #:use-module (gnu packages web)
  144. #:use-module (gnu packages xiph)
  145. #:use-module (gnu packages xml)
  146. #:use-module (gnu packages xdisorg)
  147. #:use-module (gnu packages xorg)
  148. #:use-module (gnu packages groff)
  149. #:use-module (gnu packages selinux)
  150. #:use-module (gnu packages swig)
  151. #:use-module (guix build-system cmake)
  152. #:use-module (guix build-system copy)
  153. #:use-module (guix build-system gnu)
  154. #:use-module (guix build-system go)
  155. #:use-module (guix build-system meson)
  156. #:use-module (guix build-system python)
  157. #:use-module (guix build-system trivial)
  158. #:use-module (guix build-system linux-module)
  159. #:use-module (guix download)
  160. #:use-module (guix git-download)
  161. #:use-module ((guix licenses) #:prefix license:)
  162. #:use-module (guix packages)
  163. #:use-module (guix gexp)
  164. #:use-module (guix store)
  165. #:use-module (guix monads)
  166. #:use-module (guix utils)
  167. #:use-module (guix deprecation) ;for libcap/next
  168. #:use-module (srfi srfi-1)
  169. #:use-module (srfi srfi-2)
  170. #:use-module (srfi srfi-26)
  171. #:use-module (ice-9 match)
  172. #:use-module (ice-9 regex))
  173. (define-public (system->linux-architecture arch)
  174. "Return the Linux architecture name for ARCH, a Guix system name such as
  175. \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
  176. (let ((arch (car (string-split arch #\-))))
  177. (cond ((string=? arch "i686") "i386")
  178. ((string-prefix? "mips" arch) "mips")
  179. ((string-prefix? "arm" arch) "arm")
  180. ((string-prefix? "aarch64" arch) "arm64")
  181. ((string-prefix? "alpha" arch) "alpha")
  182. ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
  183. ((string-prefix? "s390" arch) "s390")
  184. ((string-prefix? "riscv" arch) "riscv")
  185. (else arch))))
  186. (define-public (system->defconfig system)
  187. "Some systems (notably powerpc-linux) require a special target for kernel
  188. defconfig. Return the appropriate make target if applicable, otherwise return
  189. \"defconfig\"."
  190. (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
  191. ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
  192. ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
  193. (else "defconfig")))
  194. ;;;
  195. ;;; Kernel source code deblobbing.
  196. ;;;
  197. (define (linux-libre-deblob-scripts version gnu-revision
  198. deblob-hash
  199. deblob-check-hash)
  200. (list (version-major+minor version)
  201. (origin
  202. (method url-fetch)
  203. (uri (string-append "https://linux-libre.fsfla.org"
  204. "/pub/linux-libre/releases/" version "-" gnu-revision "/"
  205. "deblob-" (version-major+minor version)))
  206. (file-name (string-append "linux-libre-deblob-"
  207. version "-" gnu-revision))
  208. (sha256 deblob-hash))
  209. (origin
  210. (method url-fetch)
  211. (uri (string-append "https://linux-libre.fsfla.org"
  212. "/pub/linux-libre/releases/" version "-" gnu-revision "/"
  213. "deblob-check"))
  214. (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
  215. (sha256 deblob-check-hash))))
  216. ;; XXXX: Workaround 'snippet' limitations
  217. (define computed-origin-method (@@ (guix packages) computed-origin-method))
  218. (define (make-linux-libre-source version
  219. upstream-source
  220. deblob-scripts)
  221. "Return a 'computed' origin that generates a Linux-libre tarball from the
  222. corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
  223. (match deblob-scripts
  224. ((deblob-version (? origin? deblob) (? origin? deblob-check))
  225. (unless (string=? deblob-version (version-major+minor version))
  226. ;; The deblob script cannot be expected to work properly on a
  227. ;; different version (major+minor) of Linux, even if no errors
  228. ;; are signaled during execution.
  229. (error "deblob major+minor version mismatch"))
  230. (origin
  231. (method computed-origin-method)
  232. (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
  233. (sha256 #f)
  234. (uri
  235. (delay
  236. (with-imported-modules '((guix build utils))
  237. #~(begin
  238. (use-modules (guix build utils)
  239. (srfi srfi-1)
  240. (ice-9 match)
  241. (ice-9 ftw))
  242. (setvbuf (current-output-port) 'line)
  243. (let ((dir (string-append "linux-" #$version)))
  244. (mkdir "/tmp/bin")
  245. (set-path-environment-variable
  246. "PATH" '("bin")
  247. (list "/tmp"
  248. #+(canonical-package bash)
  249. #+(canonical-package coreutils)
  250. #+(canonical-package diffutils)
  251. #+(canonical-package findutils)
  252. #+(canonical-package patch)
  253. #+(canonical-package xz)
  254. #+(canonical-package sed)
  255. #+(canonical-package grep)
  256. #+(canonical-package bzip2)
  257. #+(canonical-package gzip)
  258. #+(canonical-package tar)
  259. #+(canonical-package gawk)
  260. #+python-wrapper))
  261. (with-directory-excursion "/tmp/bin"
  262. (copy-file #+deblob "deblob")
  263. (chmod "deblob" #o755)
  264. (substitute* "deblob"
  265. (("/bin/sh") (which "sh")))
  266. (copy-file #+deblob-check "deblob-check")
  267. (chmod "deblob-check" #o755)
  268. (substitute* "deblob-check"
  269. (("/bin/sh") (which "sh"))
  270. (("/bin/sed") (which "sed"))
  271. (("/usr/bin/python") (which "python"))))
  272. (if (file-is-directory? #+upstream-source)
  273. (begin
  274. (format #t "Copying upstream linux source...~%")
  275. (invoke "cp" "--archive" #+upstream-source dir)
  276. (invoke "chmod" "--recursive" "u+w" dir))
  277. (begin
  278. (format #t "Unpacking upstream linux tarball...~%")
  279. (invoke "tar" "xf" #$upstream-source)
  280. (match (scandir "."
  281. (lambda (name)
  282. (and (not (member name '("." "..")))
  283. (file-is-directory? name))))
  284. ((unpacked-dir)
  285. (unless (string=? dir unpacked-dir)
  286. (rename-file unpacked-dir dir)))
  287. (dirs
  288. (error "multiple directories found" dirs)))))
  289. (with-directory-excursion dir
  290. (format #t "Running deblob script...~%")
  291. (invoke "/tmp/bin/deblob"))
  292. (format #t "~%Packing new Linux-libre tarball...~%")
  293. (invoke "tar" "cvfa" #$output
  294. ;; Avoid non-determinism in the archive.
  295. "--mtime=@0"
  296. "--owner=root:0"
  297. "--group=root:0"
  298. "--sort=name"
  299. "--hard-dereference"
  300. dir)
  301. (format #t "~%Scanning the generated tarball for blobs...~%")
  302. (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
  303. #$output))))))))))
  304. ;;;
  305. ;;; Kernel sources.
  306. ;;;
  307. (define (linux-libre-urls version gnu-revision)
  308. "Return a list of URLs for Linux-Libre VERSION."
  309. (list (string-append
  310. "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
  311. version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
  312. ;; XXX: Work around <http://bugs.gnu.org/14851>.
  313. (string-append
  314. "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
  315. version "-" gnu-revision ".tar.xz")
  316. ;; Maybe this URL will become valid eventually.
  317. (string-append
  318. "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
  319. version "-" gnu-revision ".tar.xz")))
  320. (define (%upstream-linux-source version hash)
  321. (origin
  322. (method url-fetch)
  323. (uri (string-append "mirror://kernel.org"
  324. "/linux/kernel/v" (version-major version) ".x/"
  325. "linux-" version ".tar.xz"))
  326. (sha256 hash)))
  327. ;; The current "stable" kernels. That is, the most recently released major
  328. ;; versions that are still supported upstream.
  329. (define-public linux-libre-5.14-version "5.14.12")
  330. (define-public linux-libre-5.14-gnu-revision "gnu")
  331. (define deblob-scripts-5.14
  332. (linux-libre-deblob-scripts
  333. linux-libre-5.14-version
  334. linux-libre-5.14-gnu-revision
  335. (base32 "00vv2a51cvw2nx8iazmiy9i4h3jj9gvvpwz9gxp2v1hcmrsxq935")
  336. (base32 "024rz0bp3n3r5nkwbib7byx10d72c2fh5cw9iv00diyzgnp819g7")))
  337. (define-public linux-libre-5.14-pristine-source
  338. (let ((version linux-libre-5.14-version)
  339. (hash (base32 "0dswxf1qk70lms5lph15i7nz3ybwiia58v8zzrmi71ajviwjc9wd")))
  340. (make-linux-libre-source version
  341. (%upstream-linux-source version hash)
  342. deblob-scripts-5.14)))
  343. ;; The "longterm" kernels — the older releases with long-term upstream support.
  344. ;; Here are the support timelines:
  345. ;; <https://www.kernel.org/category/releases.html>
  346. (define-public linux-libre-5.10-version "5.10.73")
  347. (define-public linux-libre-5.10-gnu-revision "gnu1")
  348. (define deblob-scripts-5.10
  349. (linux-libre-deblob-scripts
  350. linux-libre-5.10-version
  351. linux-libre-5.10-gnu-revision
  352. (base32 "19d1pdsilq1ycnx1zw3vhf9mwdxbi5nmgzm0g1kj1lkkf1y4i1mv")
  353. (base32 "024rz0bp3n3r5nkwbib7byx10d72c2fh5cw9iv00diyzgnp819g7")))
  354. (define-public linux-libre-5.10-pristine-source
  355. (let ((version linux-libre-5.10-version)
  356. (hash (base32 "0xhf0g5pra27hnavpy0y3mn05m5hqn5rd3d6fx0a3vr35c1jicpd")))
  357. (make-linux-libre-source version
  358. (%upstream-linux-source version hash)
  359. deblob-scripts-5.10)))
  360. (define-public linux-libre-5.4-version "5.4.153")
  361. (define-public linux-libre-5.4-gnu-revision "gnu1")
  362. (define deblob-scripts-5.4
  363. (linux-libre-deblob-scripts
  364. linux-libre-5.4-version
  365. linux-libre-5.4-gnu-revision
  366. (base32 "1cdxljvmivdwcy9v9fr5iv0x0d1884pf3876p9nzrly599lz2wnl")
  367. (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
  368. (define-public linux-libre-5.4-pristine-source
  369. (let ((version linux-libre-5.4-version)
  370. (hash (base32 "0jaz57sd51xqc7w8k3f43bfc5mdsh1413mdngqqsgr8isv4hg7vd")))
  371. (make-linux-libre-source version
  372. (%upstream-linux-source version hash)
  373. deblob-scripts-5.4)))
  374. (define-public linux-libre-4.19-version "4.19.211")
  375. (define-public linux-libre-4.19-gnu-revision "gnu1")
  376. (define deblob-scripts-4.19
  377. (linux-libre-deblob-scripts
  378. linux-libre-4.19-version
  379. linux-libre-4.19-gnu-revision
  380. (base32 "1hiaagdyfy6b0f9ivdy7zq0cd6akaj6v3c4nzikrgsk12vgc1a1q")
  381. (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
  382. (define-public linux-libre-4.19-pristine-source
  383. (let ((version linux-libre-4.19-version)
  384. (hash (base32 "1m3y5gsf5s8bb4jxkri20dlxi8aiqabzaijj2h1svz4r19ca8j7v")))
  385. (make-linux-libre-source version
  386. (%upstream-linux-source version hash)
  387. deblob-scripts-4.19)))
  388. (define-public linux-libre-4.14-version "4.14.250")
  389. (define-public linux-libre-4.14-gnu-revision "gnu1")
  390. (define deblob-scripts-4.14
  391. (linux-libre-deblob-scripts
  392. linux-libre-4.14-version
  393. linux-libre-4.14-gnu-revision
  394. (base32 "0cnax38650m9sxiwvc1xm5saymlsmx427j3jqpx34df2ah2rnrwf")
  395. (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
  396. (define-public linux-libre-4.14-pristine-source
  397. (let ((version linux-libre-4.14-version)
  398. (hash (base32 "0zbf6gxm8iwf7cra310gfd0zyj8l9ckdahky9w6wb9wlznwkvd54")))
  399. (make-linux-libre-source version
  400. (%upstream-linux-source version hash)
  401. deblob-scripts-4.14)))
  402. (define-public linux-libre-4.9-version "4.9.286")
  403. (define-public linux-libre-4.9-gnu-revision "gnu1")
  404. (define deblob-scripts-4.9
  405. (linux-libre-deblob-scripts
  406. linux-libre-4.9-version
  407. linux-libre-4.9-gnu-revision
  408. (base32 "1n74ddrifnw06hx7ih2sk8jaiqlm1jyyhswyjpxiyhrrcvjcilch")
  409. (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
  410. (define-public linux-libre-4.9-pristine-source
  411. (let ((version linux-libre-4.9-version)
  412. (hash (base32 "0id62p43dmkl9ir278p0dsfg3q7m1d8rlxv0c9qi1pzalkygv8p2")))
  413. (make-linux-libre-source version
  414. (%upstream-linux-source version hash)
  415. deblob-scripts-4.9)))
  416. (define-public linux-libre-4.4-version "4.4.288")
  417. (define-public linux-libre-4.4-gnu-revision "gnu1")
  418. (define deblob-scripts-4.4
  419. (linux-libre-deblob-scripts
  420. linux-libre-4.4-version
  421. linux-libre-4.4-gnu-revision
  422. (base32 "11397dgj6cdfv6anxrj7jwgvnqvwh5i0ci6c8mb85ry6h4fnfmq4")
  423. (base32 "1a0k9i8gnzkyvfr80f8xw2fnxfwddhz1pzicz9fh0y3jzzkzk45p")))
  424. (define-public linux-libre-4.4-pristine-source
  425. (let ((version linux-libre-4.4-version)
  426. (hash (base32 "028w3yzmzymy7l1nf3n1pfbg95hfi4ilphkyl00ddgj8sfm542c7")))
  427. (make-linux-libre-source version
  428. (%upstream-linux-source version hash)
  429. deblob-scripts-4.4)))
  430. (define %boot-logo-patch
  431. ;; Linux-Libre boot logo featuring Freedo and a gnu.
  432. (origin
  433. (method url-fetch)
  434. (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
  435. "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
  436. (sha256
  437. (base32
  438. "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
  439. (define %linux-libre-arm-export-__sync_icache_dcache-patch
  440. (origin
  441. (method url-fetch)
  442. (uri (string-append
  443. "https://salsa.debian.org/kernel-team/linux"
  444. "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
  445. "/debian/patches/bugfix/arm/"
  446. "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
  447. (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
  448. (sha256
  449. (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
  450. (define (source-with-patches source patches)
  451. (origin
  452. (inherit source)
  453. (patches (append (origin-patches source)
  454. patches))))
  455. (define-public linux-libre-5.14-source
  456. (source-with-patches linux-libre-5.14-pristine-source
  457. (list %boot-logo-patch
  458. %linux-libre-arm-export-__sync_icache_dcache-patch
  459. ;; Pinebook Pro patch to fix LCD display
  460. (search-patch
  461. "linux-libre-arm64-generic-pinebook-lcd.patch"))))
  462. (define-public linux-libre-5.10-source
  463. (source-with-patches linux-libre-5.10-pristine-source
  464. (list %boot-logo-patch
  465. %linux-libre-arm-export-__sync_icache_dcache-patch
  466. ;; Pinebook Pro patch to fix LCD display
  467. (search-patch
  468. "linux-libre-arm64-generic-pinebook-lcd.patch"))))
  469. (define-public linux-libre-5.4-source
  470. (source-with-patches linux-libre-5.4-pristine-source
  471. (list %boot-logo-patch
  472. %linux-libre-arm-export-__sync_icache_dcache-patch
  473. ;; Pinebook Pro patch from linux-next,
  474. ;; can be dropped for linux-libre 5.7
  475. (search-patch
  476. "linux-libre-support-for-Pinebook-Pro.patch"))))
  477. (define-public linux-libre-4.19-source
  478. (source-with-patches linux-libre-4.19-pristine-source
  479. (list %boot-logo-patch
  480. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  481. (define-public linux-libre-4.14-source
  482. (source-with-patches linux-libre-4.14-pristine-source
  483. (list %boot-logo-patch)))
  484. (define-public linux-libre-4.9-source
  485. (source-with-patches linux-libre-4.9-pristine-source
  486. (list %boot-logo-patch)))
  487. (define-public linux-libre-4.4-source
  488. (source-with-patches linux-libre-4.4-pristine-source
  489. (list %boot-logo-patch)))
  490. ;;;
  491. ;;; Kernel headers.
  492. ;;;
  493. (define (make-linux-libre-headers version gnu-revision hash-string)
  494. (make-linux-libre-headers* version gnu-revision
  495. (origin
  496. (method url-fetch)
  497. (uri (linux-libre-urls version gnu-revision))
  498. (sha256 (base32 hash-string)))))
  499. (define (make-linux-libre-headers* version gnu-revision source)
  500. (package
  501. (name "linux-libre-headers")
  502. (version version)
  503. (source source)
  504. (build-system gnu-build-system)
  505. (native-inputs `(("perl" ,perl)
  506. ,@(if (version>=? version "4.16")
  507. `(("flex" ,flex)
  508. ("bison" ,bison))
  509. '())))
  510. (arguments
  511. `(#:modules ((guix build gnu-build-system)
  512. (guix build utils)
  513. (srfi srfi-1)
  514. (ice-9 match))
  515. #:phases
  516. (modify-phases %standard-phases
  517. (delete 'configure)
  518. (replace 'build
  519. (lambda _
  520. (let ((arch ,(system->linux-architecture
  521. (or (%current-target-system)
  522. (%current-system))))
  523. (defconfig ,(system->defconfig
  524. (or (%current-target-system)
  525. (%current-system))))
  526. (make-target ,(if (version>=? version "5.3")
  527. "headers"
  528. "headers_check")))
  529. (setenv "ARCH" arch)
  530. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  531. (invoke "make" defconfig)
  532. (invoke "make" "mrproper" make-target))))
  533. (replace 'install
  534. (lambda* (#:key outputs #:allow-other-keys)
  535. (let ((out (assoc-ref outputs "out")))
  536. ;; Mimic the quiet_cmd_headers_install target to avoid a
  537. ;; dependency on rsync.
  538. (for-each (lambda (file)
  539. (let ((destination (string-append
  540. out "/include/"
  541. ;; Drop the 'usr/include' prefix.
  542. (match (string-split file #\/)
  543. ((_ _ path ...)
  544. (string-join path "/"))))))
  545. (format #t "`~a' -> `~a'~%" file destination)
  546. (install-file file (dirname destination))))
  547. (find-files "usr/include" "\\.h$"))
  548. (mkdir (string-append out "/include/config"))
  549. (call-with-output-file
  550. (string-append out
  551. "/include/config/kernel.release")
  552. (lambda (p)
  553. (format p "~a-default~%" ,version)))))))
  554. #:allowed-references ()
  555. #:tests? #f))
  556. (home-page "https://www.gnu.org/software/linux-libre/")
  557. (synopsis "GNU Linux-Libre kernel headers")
  558. (description "Headers of the Linux-Libre kernel.")
  559. (license license:gpl2)))
  560. (define-public linux-libre-headers-5.14
  561. (make-linux-libre-headers* linux-libre-5.14-version
  562. linux-libre-5.14-gnu-revision
  563. linux-libre-5.14-source))
  564. (define-public linux-libre-headers-5.10
  565. (make-linux-libre-headers* linux-libre-5.10-version
  566. linux-libre-5.10-gnu-revision
  567. linux-libre-5.10-source))
  568. (define-public linux-libre-headers-5.4
  569. (make-linux-libre-headers* linux-libre-5.4-version
  570. linux-libre-5.4-gnu-revision
  571. linux-libre-5.4-source))
  572. (define-public linux-libre-headers-4.19
  573. (make-linux-libre-headers* linux-libre-4.19-version
  574. linux-libre-4.19-gnu-revision
  575. linux-libre-4.19-source))
  576. (define-public linux-libre-headers-4.14
  577. (make-linux-libre-headers* linux-libre-4.14-version
  578. linux-libre-4.14-gnu-revision
  579. linux-libre-4.14-source))
  580. (define-public linux-libre-headers-4.9
  581. (make-linux-libre-headers* linux-libre-4.9-version
  582. linux-libre-4.9-gnu-revision
  583. linux-libre-4.9-source))
  584. (define-public linux-libre-headers-4.4
  585. (make-linux-libre-headers* linux-libre-4.4-version
  586. linux-libre-4.4-gnu-revision
  587. linux-libre-4.4-source))
  588. ;; The following package is used in the early bootstrap, and thus must be kept
  589. ;; stable and with minimal build requirements.
  590. (define-public linux-libre-headers-5.10.35
  591. (make-linux-libre-headers "5.10.35" "gnu"
  592. "0q2rnchad55d49f3rajrkazz0fcjv1irwrdb1hwjnl01fzm2gjk3"))
  593. (define-public linux-libre-headers linux-libre-headers-5.10.35)
  594. ;;;
  595. ;;; Kernel configurations.
  596. ;;;
  597. (define* (kernel-config arch #:key variant)
  598. "Return the absolute file name of the Linux-Libre build configuration file
  599. for ARCH and optionally VARIANT, or #f if there is no such configuration."
  600. (let* ((name (string-append (if variant (string-append variant "-") "")
  601. (if (string=? "i386" arch) "i686" arch) ".conf"))
  602. (file (string-append "linux-libre/" name)))
  603. (search-auxiliary-file file)))
  604. (define %default-extra-linux-options
  605. `(;; Some very mild hardening.
  606. ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
  607. ;; All kernels should have NAMESPACES options enabled
  608. ("CONFIG_NAMESPACES" . #t)
  609. ("CONFIG_UTS_NS" . #t)
  610. ("CONFIG_IPC_NS" . #t)
  611. ("CONFIG_USER_NS" . #t)
  612. ("CONFIG_PID_NS" . #t)
  613. ("CONFIG_NET_NS" . #t)
  614. ;; Various options needed for elogind service:
  615. ;; https://issues.guix.gnu.org/43078
  616. ("CONFIG_CGROUP_FREEZER" . #t)
  617. ("CONFIG_BLK_CGROUP" . #t)
  618. ("CONFIG_CGROUP_WRITEBACK" . #t)
  619. ("CONFIG_CGROUP_SCHED" . #t)
  620. ("CONFIG_CGROUP_PIDS" . #t)
  621. ("CONFIG_CGROUP_FREEZER" . #t)
  622. ("CONFIG_CGROUP_DEVICE" . #t)
  623. ("CONFIG_CGROUP_CPUACCT" . #t)
  624. ("CONFIG_CGROUP_PERF" . #t)
  625. ("CONFIG_SOCK_CGROUP_DATA" . #t)
  626. ("CONFIG_BLK_CGROUP_IOCOST" . #t)
  627. ("CONFIG_CGROUP_NET_PRIO" . #t)
  628. ("CONFIG_CGROUP_NET_CLASSID" . #t)
  629. ("CONFIG_MEMCG" . #t)
  630. ("CONFIG_MEMCG_SWAP" . #t)
  631. ("CONFIG_MEMCG_KMEM" . #t)
  632. ("CONFIG_CPUSETS" . #t)
  633. ("CONFIG_PROC_PID_CPUSET" . #t)
  634. ;; Allow disk encryption by default
  635. ("CONFIG_DM_CRYPT" . m)
  636. ;; Modules required for initrd:
  637. ("CONFIG_NET_9P" . m)
  638. ("CONFIG_NET_9P_VIRTIO" . m)
  639. ("CONFIG_VIRTIO_BLK" . m)
  640. ("CONFIG_VIRTIO_NET" . m)
  641. ("CONFIG_VIRTIO_PCI" . m)
  642. ("CONFIG_VIRTIO_BALLOON" . m)
  643. ("CONFIG_VIRTIO_MMIO" . m)
  644. ("CONFIG_FUSE_FS" . m)
  645. ("CONFIG_CIFS" . m)
  646. ("CONFIG_9P_FS" . m)))
  647. ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
  648. (define %bpf-extra-linux-options
  649. `(;; Needed for probes
  650. ("CONFIG_UPROBE_EVENTS" . #t)
  651. ("CONFIG_KPROBE_EVENTS" . #t)
  652. ;; kheaders module also helpful for tracing
  653. ("CONFIG_IKHEADERS" . #t)
  654. ("CONFIG_BPF" . #t)
  655. ("CONFIG_BPF_SYSCALL" . #t)
  656. ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
  657. ;; optional, for tc filters
  658. ("CONFIG_NET_CLS_BPF" . m)
  659. ;; optional, for tc actions
  660. ("CONFIG_NET_ACT_BPF" . m)
  661. ("CONFIG_BPF_JIT" . #t)
  662. ;; for Linux kernel versions 4.1 through 4.6
  663. ;; ("CONFIG_HAVE_BPF_JIT" . y)
  664. ;; for Linux kernel versions 4.7 and later
  665. ("CONFIG_HAVE_EBPF_JIT" . #t)
  666. ;; optional, for kprobes
  667. ("CONFIG_BPF_EVENTS" . #t)
  668. ;; kheaders module
  669. ("CONFIG_IKHEADERS" . #t)))
  670. (define (config->string options)
  671. (string-join (map (match-lambda
  672. ((option . 'm)
  673. (string-append option "=m"))
  674. ((option . #t)
  675. (string-append option "=y"))
  676. ((option . #f)
  677. (string-append option "=n")))
  678. options)
  679. "\n"))
  680. ;;;
  681. ;;; Kernel package utilities.
  682. ;;;
  683. (define* (make-linux-libre version gnu-revision hash-string supported-systems
  684. #:key
  685. (extra-version #f)
  686. ;; A function that takes an arch and a variant.
  687. ;; See kernel-config for an example.
  688. (configuration-file #f)
  689. (defconfig "defconfig")
  690. (extra-options %default-extra-linux-options)
  691. (patches (list %boot-logo-patch)))
  692. (make-linux-libre* version gnu-revision
  693. (origin
  694. (method url-fetch)
  695. (uri (linux-libre-urls version gnu-revision))
  696. (sha256 (base32 hash-string))
  697. (patches patches))
  698. supported-systems
  699. #:extra-version extra-version
  700. #:configuration-file configuration-file
  701. #:defconfig defconfig
  702. #:extra-options extra-options))
  703. (define* (make-linux-libre* version gnu-revision source supported-systems
  704. #:key
  705. (extra-version #f)
  706. ;; A function that takes an arch and a variant.
  707. ;; See kernel-config for an example.
  708. (configuration-file #f)
  709. (defconfig "defconfig")
  710. (extra-options %default-extra-linux-options))
  711. (package
  712. (name (if extra-version
  713. (string-append "linux-libre-" extra-version)
  714. "linux-libre"))
  715. (version version)
  716. (source source)
  717. (supported-systems supported-systems)
  718. (build-system gnu-build-system)
  719. (native-inputs
  720. `(("perl" ,perl)
  721. ("bc" ,bc)
  722. ("openssl" ,openssl)
  723. ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
  724. ("flex" ,flex)
  725. ("bison" ,bison)
  726. ;; These are needed to compile the GCC plugins.
  727. ("gmp" ,gmp)
  728. ("mpfr" ,mpfr)
  729. ("mpc" ,mpc)
  730. ,@(match (and configuration-file
  731. (configuration-file
  732. (system->linux-architecture
  733. (or (%current-target-system) (%current-system)))
  734. #:variant (version-major+minor version)))
  735. (#f ;no config for this platform
  736. '())
  737. ((? string? config)
  738. `(("kconfig" ,config))))))
  739. (arguments
  740. `(#:modules ((guix build gnu-build-system)
  741. (guix build utils)
  742. (srfi srfi-1)
  743. (srfi srfi-26)
  744. (ice-9 ftw)
  745. (ice-9 match))
  746. #:phases
  747. (modify-phases %standard-phases
  748. (add-after 'unpack 'patch-/bin/pwd
  749. (lambda _
  750. (substitute* (find-files "." "^Makefile(\\.include)?$")
  751. (("/bin/pwd") "pwd"))
  752. #t))
  753. (replace 'configure
  754. (lambda* (#:key inputs native-inputs target #:allow-other-keys)
  755. ;; Avoid introducing timestamps
  756. (setenv "KCONFIG_NOTIMESTAMP" "1")
  757. (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
  758. ;; Set ARCH and CROSS_COMPILE
  759. (let ((arch ,(system->linux-architecture
  760. (or (%current-target-system)
  761. (%current-system)))))
  762. (setenv "ARCH" arch)
  763. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  764. (when target
  765. (setenv "CROSS_COMPILE" (string-append target "-"))
  766. (format #t "`CROSS_COMPILE' set to `~a'~%"
  767. (getenv "CROSS_COMPILE"))))
  768. (setenv "EXTRAVERSION" ,(and extra-version
  769. (string-append "-" extra-version)))
  770. (let ((build (assoc-ref %standard-phases 'build))
  771. (config (assoc-ref (or native-inputs inputs) "kconfig")))
  772. ;; Use a custom kernel configuration file or a default
  773. ;; configuration file.
  774. (if config
  775. (begin
  776. (copy-file config ".config")
  777. (chmod ".config" #o666))
  778. (invoke "make" ,defconfig))
  779. ;; Appending works even when the option wasn't in the
  780. ;; file. The last one prevails if duplicated.
  781. (let ((port (open-file ".config" "a"))
  782. (extra-configuration ,(config->string extra-options)))
  783. (display extra-configuration port)
  784. (close-port port))
  785. (invoke "make" "oldconfig"))))
  786. (replace 'install
  787. (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
  788. (let* ((out (assoc-ref outputs "out"))
  789. (moddir (string-append out "/lib/modules"))
  790. (dtbdir (string-append out "/lib/dtbs")))
  791. ;; Install kernel image, kernel configuration and link map.
  792. (for-each (lambda (file) (install-file file out))
  793. (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
  794. ;; Install device tree files
  795. (unless (null? (find-files "." "\\.dtb$"))
  796. (mkdir-p dtbdir)
  797. (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
  798. "dtbs_install"))
  799. ;; Install kernel modules
  800. (mkdir-p moddir)
  801. (invoke "make"
  802. ;; Disable depmod because the Guix system's module directory
  803. ;; is an union of potentially multiple packages. It is not
  804. ;; possible to use depmod to usefully calculate a dependency
  805. ;; graph while building only one of those packages.
  806. "DEPMOD=true"
  807. (string-append "MODULE_DIR=" moddir)
  808. (string-append "INSTALL_PATH=" out)
  809. (string-append "INSTALL_MOD_PATH=" out)
  810. "INSTALL_MOD_STRIP=1"
  811. "modules_install")
  812. (let* ((versions (filter (lambda (name)
  813. (not (string-prefix? "." name)))
  814. (scandir moddir)))
  815. (version (match versions
  816. ((x) x))))
  817. ;; There are symlinks to the build and source directory,
  818. ;; both of which will point to target /tmp/guix-build*
  819. ;; and thus not be useful in a profile. Delete the symlinks.
  820. (false-if-file-not-found
  821. (delete-file (string-append moddir "/" version "/build")))
  822. (false-if-file-not-found
  823. (delete-file (string-append moddir "/" version "/source"))))
  824. #t))))
  825. #:tests? #f))
  826. (home-page "https://www.gnu.org/software/linux-libre/")
  827. (synopsis "100% free redistribution of a cleaned Linux kernel")
  828. (description
  829. "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
  830. It has been modified to remove all non-free binary blobs.")
  831. (license license:gpl2)
  832. (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
  833. ;;;
  834. ;;; Generic kernel packages.
  835. ;;;
  836. (define-public linux-libre-5.14
  837. (make-linux-libre* linux-libre-5.14-version
  838. linux-libre-5.14-gnu-revision
  839. linux-libre-5.14-source
  840. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  841. #:configuration-file kernel-config))
  842. (define-public linux-libre-version linux-libre-5.14-version)
  843. (define-public linux-libre-gnu-revision linux-libre-5.14-gnu-revision)
  844. (define-public linux-libre-pristine-source linux-libre-5.14-pristine-source)
  845. (define-public linux-libre-source linux-libre-5.14-source)
  846. (define-public linux-libre linux-libre-5.14)
  847. (define-public linux-libre-5.10
  848. (make-linux-libre* linux-libre-5.10-version
  849. linux-libre-5.10-gnu-revision
  850. linux-libre-5.10-source
  851. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  852. #:configuration-file kernel-config))
  853. (define-public linux-libre-5.4
  854. (make-linux-libre* linux-libre-5.4-version
  855. linux-libre-5.4-gnu-revision
  856. linux-libre-5.4-source
  857. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  858. #:configuration-file kernel-config))
  859. (define-public linux-libre-4.19
  860. (make-linux-libre* linux-libre-4.19-version
  861. linux-libre-4.19-gnu-revision
  862. linux-libre-4.19-source
  863. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
  864. #:configuration-file kernel-config))
  865. (define-public linux-libre-4.14
  866. (make-linux-libre* linux-libre-4.14-version
  867. linux-libre-4.14-gnu-revision
  868. linux-libre-4.14-source
  869. '("x86_64-linux" "i686-linux" "armhf-linux")
  870. #:configuration-file kernel-config))
  871. (define-public linux-libre-4.9
  872. (make-linux-libre* linux-libre-4.9-version
  873. linux-libre-4.9-gnu-revision
  874. linux-libre-4.9-source
  875. '("x86_64-linux" "i686-linux")
  876. #:configuration-file kernel-config))
  877. (define-public linux-libre-4.4
  878. (make-linux-libre* linux-libre-4.4-version
  879. linux-libre-4.4-gnu-revision
  880. linux-libre-4.4-source
  881. '("x86_64-linux" "i686-linux")
  882. #:configuration-file kernel-config
  883. #:extra-options
  884. (append
  885. `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
  886. ;; This option was removed upstream in version 4.7.
  887. ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
  888. %default-extra-linux-options)))
  889. ;; Linux-Libre-LTS points to the *newest* released long-term support version of
  890. ;; Linux-Libre.
  891. ;; Reference: https://jxself.org/linux-libre/
  892. (define-public linux-libre-lts-version linux-libre-5.10-version)
  893. (define-public linux-libre-lts-gnu-revision linux-libre-5.10-gnu-revision)
  894. (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
  895. (define-public linux-libre-lts-source linux-libre-5.10-source)
  896. (define-public linux-libre-lts linux-libre-5.10)
  897. ;;;
  898. ;;; Specialized kernel variants.
  899. ;;;
  900. (define-public linux-libre-arm-generic
  901. (make-linux-libre* linux-libre-version
  902. linux-libre-gnu-revision
  903. linux-libre-source
  904. '("armhf-linux")
  905. #:defconfig "multi_v7_defconfig"
  906. #:extra-version "arm-generic"
  907. #:extra-options
  908. (append
  909. `(;; needed to fix the RTC on rockchip platforms
  910. ("CONFIG_RTC_DRV_RK808" . #t))
  911. %default-extra-linux-options)))
  912. (define-public linux-libre-arm-veyron
  913. (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
  914. (define-public linux-libre-arm-generic-5.10
  915. (make-linux-libre* linux-libre-5.10-version
  916. linux-libre-5.10-gnu-revision
  917. linux-libre-5.10-source
  918. '("armhf-linux")
  919. #:defconfig "multi_v7_defconfig"
  920. #:extra-version "arm-generic"
  921. #:extra-options
  922. (append
  923. `(;; needed to fix the RTC on rockchip platforms
  924. ("CONFIG_RTC_DRV_RK808" . #t))
  925. %default-extra-linux-options)))
  926. (define-public linux-libre-arm-generic-5.4
  927. (make-linux-libre* linux-libre-5.4-version
  928. linux-libre-5.4-gnu-revision
  929. linux-libre-5.4-source
  930. '("armhf-linux")
  931. #:defconfig "multi_v7_defconfig"
  932. #:extra-version "arm-generic"
  933. #:extra-options
  934. (append
  935. `(;; needed to fix the RTC on rockchip platforms
  936. ("CONFIG_RTC_DRV_RK808" . #t))
  937. %default-extra-linux-options)))
  938. (define-public linux-libre-arm-generic-4.19
  939. (make-linux-libre* linux-libre-4.19-version
  940. linux-libre-4.19-gnu-revision
  941. linux-libre-4.19-source
  942. '("armhf-linux")
  943. #:defconfig "multi_v7_defconfig"
  944. #:extra-version "arm-generic"))
  945. (define-public linux-libre-arm-generic-4.14
  946. (make-linux-libre* linux-libre-4.14-version
  947. linux-libre-4.14-gnu-revision
  948. linux-libre-4.14-source
  949. '("armhf-linux")
  950. #:defconfig "multi_v7_defconfig"
  951. #:extra-version "arm-generic"))
  952. (define-public linux-libre-arm-omap2plus
  953. (make-linux-libre* linux-libre-version
  954. linux-libre-gnu-revision
  955. linux-libre-source
  956. '("armhf-linux")
  957. #:defconfig "omap2plus_defconfig"
  958. #:extra-version "arm-omap2plus"))
  959. (define-public linux-libre-arm-omap2plus-4.19
  960. (make-linux-libre* linux-libre-4.19-version
  961. linux-libre-4.19-gnu-revision
  962. linux-libre-4.19-source
  963. '("armhf-linux")
  964. #:defconfig "omap2plus_defconfig"
  965. #:extra-version "arm-omap2plus"))
  966. (define-public linux-libre-arm-omap2plus-4.14
  967. (make-linux-libre* linux-libre-4.14-version
  968. linux-libre-4.14-gnu-revision
  969. linux-libre-4.14-source
  970. '("armhf-linux")
  971. #:defconfig "omap2plus_defconfig"
  972. #:extra-version "arm-omap2plus"))
  973. (define-public linux-libre-arm64-generic
  974. (make-linux-libre* linux-libre-version
  975. linux-libre-gnu-revision
  976. linux-libre-source
  977. '("aarch64-linux")
  978. #:defconfig "defconfig"
  979. #:extra-version "arm64-generic"
  980. #:extra-options
  981. (append
  982. `(;; needed to fix the RTC on rockchip platforms
  983. ("CONFIG_RTC_DRV_RK808" . #t)
  984. ;; Pinebook display, battery, charger and usb
  985. ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
  986. ("CONFIG_CHARGER_AXP20X" . m)
  987. ("CONFIG_INPUT_AXP20X_PEK" . m)
  988. ("CONFIG_CHARGER_AXP20X" . m)
  989. ("CONFIG_BATTERY_AXP20X" . m)
  990. ("CONFIG_PINCTRL_AXP209" . m)
  991. ("CONFIG_AXP20X_POWER" . m)
  992. ("CONFIG_AXP20X_ADC" . m)
  993. ;; Pinebook PRO battery and sound support
  994. ("CONFIG_BATTERY_CW2015" . m)
  995. ("CONFIG_CHARGER_GPIO" . m)
  996. ("CONFIG_SND_SOC_ES8316" . m))
  997. %default-extra-linux-options)))
  998. (define-public linux-libre-arm64-generic-5.10
  999. (make-linux-libre* linux-libre-5.10-version
  1000. linux-libre-5.10-gnu-revision
  1001. linux-libre-5.10-source
  1002. '("aarch64-linux")
  1003. #:defconfig "defconfig"
  1004. #:extra-version "arm64-generic"
  1005. #:extra-options
  1006. (append
  1007. `(;; needed to fix the RTC on rockchip platforms
  1008. ("CONFIG_RTC_DRV_RK808" . #t)
  1009. ;; Pinebook display, battery, charger and usb
  1010. ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
  1011. ("CONFIG_CHARGER_AXP20X" . m)
  1012. ("CONFIG_INPUT_AXP20X_PEK" . m)
  1013. ("CONFIG_CHARGER_AXP20X" . m)
  1014. ("CONFIG_BATTERY_AXP20X" . m)
  1015. ("CONFIG_PINCTRL_AXP209" . m)
  1016. ("CONFIG_AXP20X_POWER" . m)
  1017. ("CONFIG_AXP20X_ADC" . m)
  1018. ;; Pinebook PRO battery and sound support
  1019. ("CONFIG_BATTERY_CW2015" . m)
  1020. ("CONFIG_CHARGER_GPIO" . m)
  1021. ("CONFIG_SND_SOC_ES8316" . m))
  1022. %default-extra-linux-options)))
  1023. (define-public linux-libre-arm64-generic-5.4
  1024. (make-linux-libre* linux-libre-5.4-version
  1025. linux-libre-5.4-gnu-revision
  1026. linux-libre-5.4-source
  1027. '("aarch64-linux")
  1028. #:defconfig "defconfig"
  1029. #:extra-version "arm64-generic"
  1030. #:extra-options
  1031. (append
  1032. `(;; needed to fix the RTC on rockchip platforms
  1033. ("CONFIG_RTC_DRV_RK808" . #t))
  1034. %default-extra-linux-options)))
  1035. (define-public linux-libre-riscv64-generic
  1036. (make-linux-libre* linux-libre-version
  1037. linux-libre-gnu-revision
  1038. linux-libre-source
  1039. '("riscv64-linux")
  1040. #:extra-version "riscv64-generic"))
  1041. (define-public linux-libre-mips64el-fuloong2e
  1042. (make-linux-libre* linux-libre-version
  1043. linux-libre-gnu-revision
  1044. linux-libre-source
  1045. '("mips64el-linux")
  1046. #:defconfig "fuloong2e_defconfig"
  1047. #:extra-version "mips64el-fuloong2e"
  1048. #:extra-options
  1049. (append
  1050. `(("CONFIG_OVERLAY_FS" . m))
  1051. %default-extra-linux-options)))
  1052. (define-public linux-libre-with-bpf
  1053. (let ((base-linux-libre
  1054. (make-linux-libre*
  1055. linux-libre-5.14-version
  1056. linux-libre-5.14-gnu-revision
  1057. linux-libre-5.14-source
  1058. '("x86_64-linux" "i686-linux" "armhf-linux"
  1059. "aarch64-linux" "riscv64-linux")
  1060. #:extra-version "bpf"
  1061. #:configuration-file kernel-config
  1062. #:extra-options
  1063. (append %bpf-extra-linux-options
  1064. %default-extra-linux-options))))
  1065. (package
  1066. (inherit base-linux-libre)
  1067. (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
  1068. ;;;
  1069. ;;; Linux kernel modules.
  1070. ;;;
  1071. (define-public acpi-call-linux-module
  1072. (package
  1073. (name "acpi-call-linux-module")
  1074. (version "1.2.2")
  1075. (source
  1076. (origin
  1077. (method git-fetch)
  1078. (uri (git-reference
  1079. (url "https://github.com/nix-community/acpi_call")
  1080. (commit (string-append "v" version))))
  1081. (file-name (git-file-name name version))
  1082. (sha256
  1083. (base32 "1s7h9y3adyfhw7cjldlfmid79lrwz3vqlvziw9nwd6x5qdj4w9vp"))))
  1084. (build-system linux-module-build-system)
  1085. (arguments
  1086. `(#:tests? #f ; no tests
  1087. #:phases
  1088. (modify-phases %standard-phases
  1089. (add-before 'install 'patch-shebangs-harder
  1090. ;; The (only) shebangs in examples/ don't justify a reference.
  1091. ;; However, do substitute a more portable one than the original.
  1092. (lambda _
  1093. (substitute* (find-files "examples" ".")
  1094. (("^(#! *)/[^ ]*/" _ shebang)
  1095. (string-append shebang "/usr/bin/env ")))))
  1096. (add-after 'install 'install-documentation
  1097. (lambda* (#:key outputs #:allow-other-keys)
  1098. (let* ((out (assoc-ref outputs "out"))
  1099. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  1100. (for-each (lambda (file)
  1101. (let ((target (string-append doc "/" file)))
  1102. (mkdir-p (dirname target))
  1103. (copy-recursively file target)))
  1104. (list "README.md" "examples"))))))))
  1105. (home-page "https://github.com/nix-community/acpi_call")
  1106. (synopsis "Linux kernel module to perform ACPI method calls")
  1107. (description
  1108. "This simple Linux kernel module allows calls from user space to any
  1109. @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
  1110. your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
  1111. any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
  1112. and @code{ACPI_BUFFER}.
  1113. It grants direct and undocumented access to your hardware that may cause damage
  1114. and should be used with caution, especially on untested models.")
  1115. (license license:gpl3+))) ; see README.md (no licence headers)
  1116. (define-public corefreq
  1117. (package
  1118. (name "corefreq")
  1119. (version "1.86.7")
  1120. (source
  1121. (origin
  1122. (method git-fetch)
  1123. (uri (git-reference
  1124. (url "https://github.com/cyring/CoreFreq")
  1125. (commit version)))
  1126. (file-name (git-file-name name version))
  1127. (sha256
  1128. (base32 "1k8pyxcahc78kcc8q1h76dr91i1r33jciqhgkajkz3xa28qx8mhn"))))
  1129. (build-system linux-module-build-system)
  1130. (outputs (list "out" "linux-module"))
  1131. (arguments
  1132. `(#:imported-modules ((guix build gnu-build-system)
  1133. ,@%linux-module-build-system-modules)
  1134. #:modules ((guix build linux-module-build-system)
  1135. ((guix build gnu-build-system) #:prefix gnu:)
  1136. (guix build utils))
  1137. #:make-flags
  1138. (list (string-append "CC=" ,(cc-for-target))
  1139. "OPTIM_LVL=3"
  1140. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  1141. #:tests? #f ; no test suite
  1142. #:phases
  1143. (modify-phases %standard-phases
  1144. (add-after 'unpack 'untangle-module-targets
  1145. ;; Having to build everything in one pass would complicate the
  1146. ;; definition. Let each build system handle what it's good at.
  1147. (lambda _
  1148. (substitute* "Makefile"
  1149. ((".*MAKE.*KERNELDIR.*") ""))))
  1150. (add-after 'build 'gnu:build
  1151. (assoc-ref gnu:%standard-phases 'build))
  1152. (add-after 'install 'gnu:install
  1153. (assoc-ref gnu:%standard-phases 'install))
  1154. (add-after 'install 'separate-module
  1155. (lambda* (#:key outputs #:allow-other-keys)
  1156. ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
  1157. ;; empty <out>/lib/modules directory, so just do it all by hand.
  1158. (let* ((out (assoc-ref outputs "out"))
  1159. (module (assoc-ref outputs "linux-module")))
  1160. (mkdir-p (string-append module "/lib"))
  1161. (rename-file (string-append out "/lib/modules")
  1162. (string-append module "/lib/modules")))))
  1163. (add-after 'install 'install-README
  1164. ;; There is no proper documentation. Provide something.
  1165. (lambda* (#:key outputs #:allow-other-keys)
  1166. (let* ((out (assoc-ref outputs "out"))
  1167. (doc (string-append out "/share/doc/"
  1168. ,name "-" ,version)))
  1169. (install-file "README.md" doc)))))))
  1170. (home-page "https://github.com/cyring/CoreFreq")
  1171. (synopsis
  1172. "Measure performance data & tweak low-level settings on x86-64 CPUs")
  1173. (description
  1174. "CoreFreq is a CPU monitor that reports low-level processor settings and
  1175. performance data with notably high precision by using a loadable Linux kernel
  1176. module. Unlike most similar tools, it can be used to modify some settings if
  1177. supported by the hardware and at your own risk. It's designed for 64-bit x86
  1178. Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
  1179. architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
  1180. Supported processor features include:
  1181. @enumerate
  1182. @item time spent in C-states, including C1/C3 Auto- and UnDemotion;
  1183. @item core temperatures, voltage, and tweaking thermal limits;
  1184. @item core frequencies, ratios, and base clock rate;
  1185. @item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
  1186. Hyper-Threading or SMT;
  1187. @item enabling or disabling data cache prefetching;
  1188. @item kernel assembly code to keep as near as possible readings of performance
  1189. counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
  1190. Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
  1191. @item the number of instructions per cycle or second (IPS, IPC, and CPI);
  1192. @item memory controller geometry and RAM timings;
  1193. @item running processes' CPU affinity.
  1194. @end enumerate
  1195. This package provides the @command{corefreqd} data collection daemon, the
  1196. @command{corefreq-cli} client to visualise and control it in real time, and the
  1197. @code{corefreqk} kernel module in its own separate output. Read the included
  1198. @file{README.md} before loading it.")
  1199. (supported-systems (list "x86_64-linux"))
  1200. (license license:gpl2)))
  1201. (define-public librem-ec-acpi-linux-module
  1202. (package
  1203. (name "librem-ec-acpi-linux-module")
  1204. (version "0.9.1")
  1205. (source
  1206. (origin
  1207. (method git-fetch)
  1208. (uri (git-reference
  1209. (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
  1210. (commit (string-append "v" version))))
  1211. (file-name (git-file-name name version))
  1212. (sha256
  1213. (base32 "1qnbfj60i8nn2ahgj2zp5ixd79bb0wl1ld36x3igws2f3c0f5pfi"))))
  1214. (build-system linux-module-build-system)
  1215. (arguments
  1216. `(#:tests? #f)) ; no test suite
  1217. (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
  1218. (synopsis "Linux kernel module to control the Librem Embedded Controller")
  1219. (description
  1220. "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
  1221. Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
  1222. on Purism Librem laptop computers. It allows user-space control over the
  1223. battery charging thresholds, keyboard backlight, fans and thermal monitors,
  1224. and the notification, WiFi, and Bluetooth LED.")
  1225. (license license:gpl2)))
  1226. (define-public rtl8821ce-linux-module
  1227. (let ((commit "897e7c4c15dd5a0a569745dc223d969a26ff5bfc")
  1228. (revision "3"))
  1229. (package
  1230. (name "rtl8821ce-linux-module")
  1231. (version (git-version "0.0.0" revision commit))
  1232. (source
  1233. (origin
  1234. (method git-fetch)
  1235. (uri (git-reference
  1236. (url "https://github.com/tomaspinho/rtl8821ce")
  1237. (commit commit)))
  1238. (file-name (git-file-name name version))
  1239. (sha256
  1240. (base32
  1241. "0935dzz0njxh78wfd17yqah1dxn6b3kaszvzclwwrwwhwcrdp80j"))))
  1242. (build-system linux-module-build-system)
  1243. (arguments
  1244. `(#:make-flags
  1245. (list (string-append "CC=" ,(cc-for-target))
  1246. (string-append "KSRC="
  1247. (assoc-ref %build-inputs "linux-module-builder")
  1248. "/lib/modules/build"))
  1249. #:phases
  1250. (modify-phases %standard-phases
  1251. (replace 'build
  1252. (lambda* (#:key (make-flags '()) (parallel-build? #t)
  1253. #:allow-other-keys)
  1254. (apply invoke "make"
  1255. `(,@(if parallel-build?
  1256. `("-j" ,(number->string (parallel-job-count)))
  1257. '())
  1258. ,@make-flags)))))
  1259. #:tests? #f)) ; no test suite
  1260. (home-page "https://github.com/tomaspinho/rtl8821ce")
  1261. (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
  1262. (description "This is Realtek's RTL8821CE Linux driver for wireless
  1263. network adapters.")
  1264. (license license:gpl2))))
  1265. (define-public rtl8812au-aircrack-ng-linux-module
  1266. (let ((commit "b8167e66b4ac046b3b76c2c40008d84528e91594")
  1267. (revision "5"))
  1268. (package
  1269. (inherit rtl8821ce-linux-module)
  1270. (name "rtl8812au-aircrack-ng-linux-module")
  1271. (version (git-version "5.6.4.2" revision commit))
  1272. (source
  1273. (origin
  1274. (method git-fetch)
  1275. (uri (git-reference
  1276. (url "https://github.com/aircrack-ng/rtl8812au")
  1277. (commit commit)))
  1278. (file-name (git-file-name name version))
  1279. (sha256
  1280. (base32 "1940f2yz5c4q2fhcd91zfzl32fhdsgr297vzamm7nd8kdk0gymi2"))
  1281. (modules '((guix build utils)))
  1282. (snippet
  1283. '(begin
  1284. ;; Remove bundled tarballs, APKs, word lists, speadsheets,
  1285. ;; and other unnecessary unlicenced things.
  1286. (for-each delete-file-recursively (list "android"
  1287. "docs"
  1288. "tools"))))))
  1289. (supported-systems '("x86_64-linux" "i686-linux"))
  1290. (home-page "https://github.com/aircrack-ng/rtl8812au")
  1291. (synopsis "Linux driver for Realtek USB wireless network adapters")
  1292. (description
  1293. "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
  1294. network adapters, modified by the aircrack-ng project to support monitor mode
  1295. and frame injection. It provides a @code{88XXau} kernel module that supports
  1296. RTL8812AU, RTL8821AU, and RTL8814AU chips.")
  1297. (license license:gpl2+))))
  1298. (define-public vhba-module
  1299. (package
  1300. (name "vhba-module")
  1301. (version "20210418")
  1302. (source
  1303. (origin
  1304. (method url-fetch)
  1305. (uri (string-append
  1306. "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
  1307. version ".tar.xz"))
  1308. (sha256
  1309. (base32 "119zgav6caialmf3hr096wkf72l9h76sqc9w5dhx26kj4yp85g8q"))))
  1310. (build-system linux-module-build-system)
  1311. (arguments
  1312. `(#:tests? #f)) ; no test suite
  1313. (home-page "https://cdemu.sourceforge.io/")
  1314. (synopsis "Linux kernel module that emulates SCSI devices")
  1315. (description
  1316. "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
  1317. between the CDemu user-space daemon and the kernel Linux. It acts as a
  1318. low-level SCSI driver that emulates a virtual SCSI adapter which can have
  1319. multiple virtual devices attached to it. Its typical use with CDEmu is to
  1320. emulate optical devices such as DVD and CD-ROM drives.")
  1321. (license license:gpl2+)))
  1322. (define-public bbswitch-module
  1323. ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
  1324. ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
  1325. (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
  1326. (package
  1327. (name "bbswitch-module")
  1328. (version (git-version "0.8" "1" commit))
  1329. (source (origin
  1330. (method git-fetch)
  1331. (uri (git-reference
  1332. (url "https://github.com/Bumblebee-Project/bbswitch")
  1333. (commit commit)))
  1334. (file-name (git-file-name name version))
  1335. (sha256
  1336. (base32
  1337. "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
  1338. (build-system linux-module-build-system)
  1339. (arguments
  1340. ;; No tests.
  1341. `(#:tests? #f))
  1342. (home-page "https://github.com/Bumblebee-Project/bbswitch")
  1343. (synopsis "Kernel module that disables discrete Nvidia graphics cards")
  1344. (description "The bbswitch module provides a way to toggle the Nvidia
  1345. graphics card on Optimus laptops.")
  1346. (license license:gpl2))))
  1347. (define-public ddcci-driver-linux
  1348. (package
  1349. (name "ddcci-driver-linux")
  1350. (version "0.3.4")
  1351. (source
  1352. (origin
  1353. (method git-fetch)
  1354. (uri
  1355. (git-reference
  1356. (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
  1357. (commit (string-append "v" version))))
  1358. (file-name (git-file-name name version))
  1359. (sha256
  1360. (base32
  1361. "0b50hhkna6ika2vwahzb9za9b41g39ialgv5y1y0kakqi50qi0ld"))))
  1362. (build-system linux-module-build-system)
  1363. (arguments
  1364. `(#:tests? #f ; no tests
  1365. #:phases
  1366. (modify-phases %standard-phases
  1367. (replace 'build
  1368. (lambda args
  1369. (for-each
  1370. (lambda (module)
  1371. (with-directory-excursion module
  1372. (apply (assoc-ref %standard-phases 'build) args)))
  1373. '("ddcci" "ddcci-backlight"))
  1374. #t))
  1375. (replace 'install
  1376. (lambda args
  1377. (for-each
  1378. (lambda (module)
  1379. (with-directory-excursion module
  1380. (apply (assoc-ref %standard-phases 'install) args)))
  1381. '("ddcci" "ddcci-backlight"))
  1382. #t)))))
  1383. (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
  1384. (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
  1385. (description "This package provides two Linux kernel drivers, ddcci and
  1386. ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
  1387. interface. The ddcci module creates a character device for each DDC/CI
  1388. monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
  1389. module allows the control of the backlight level or luminance property when
  1390. supported under @file{/sys/class/backlight/}.")
  1391. (license license:gpl2+)))
  1392. (define-public v4l2loopback-linux-module
  1393. (package
  1394. (name "v4l2loopback-linux-module")
  1395. (version "0.12.5")
  1396. (source (origin
  1397. (method git-fetch)
  1398. (uri (git-reference
  1399. (url "https://github.com/umlaeute/v4l2loopback")
  1400. (commit (string-append "v" version))))
  1401. (file-name (git-file-name name version))
  1402. (sha256
  1403. (base32
  1404. "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
  1405. (build-system linux-module-build-system)
  1406. (arguments
  1407. `(#:tests? #f)) ; no test suite
  1408. (home-page "https://github.com/umlaeute/v4l2loopback")
  1409. (synopsis "Linux kernel module to create virtual V4L2 video devices")
  1410. (description
  1411. "This Linux module creates virtual video devices. @acronym{V4L2, Video
  1412. for Linux 2} applications will treat these as ordinary video devices but read
  1413. video data generated by another application, instead of a hardware device such
  1414. as a capture card.
  1415. This lets you apply nifty effects to your Jitsi video, for example, but also
  1416. allows some more serious things like adding streaming capabilities to an
  1417. application by hooking GStreamer into the loopback device.")
  1418. (license license:gpl2+)))
  1419. (define-public xpadneo
  1420. (package
  1421. (name "xpadneo")
  1422. (version "0.9.1")
  1423. (source (origin
  1424. (method git-fetch)
  1425. (uri (git-reference
  1426. (url "https://github.com/atar-axis/xpadneo")
  1427. (commit (string-append "v" version))))
  1428. (file-name (git-file-name name version))
  1429. (sha256
  1430. (base32
  1431. "0xr0zx134s56h4ij6c3fh8ki0h58h61minbfxcl3sgpgxkh14ism"))))
  1432. (build-system linux-module-build-system)
  1433. (arguments
  1434. `(#:tests? #f ; no `check' target
  1435. #:source-directory "hid-xpadneo/src"
  1436. #:phases
  1437. (modify-phases %standard-phases
  1438. (add-after 'install 'post-install
  1439. (lambda* (#:key outputs #:allow-other-keys #:rest args)
  1440. (let ((out (assoc-ref outputs "out")))
  1441. (copy-recursively "hid-xpadneo/etc-modprobe.d"
  1442. (string-append out "/etc/modprobe.d"))
  1443. ;; udev-service-type takes its rules from /lib rather than
  1444. ;; /etc, so copy it there instead
  1445. (copy-recursively "hid-xpadneo/etc-udev-rules.d"
  1446. (string-append out "/lib/udev/rules.d"))))))))
  1447. (home-page "https://atar-axis.github.io/xpadneo/")
  1448. (synopsis "Xbox One Wireless Controller driver")
  1449. (description
  1450. "This package provides a driver for the XBox One S Wireless controller
  1451. and some newer models when connected via bluetooth. In addition to the kernel
  1452. module provided itself, it also contains a modprobe configuration and udev
  1453. rules, which need to be installed separately.")
  1454. (license license:gpl3+)))
  1455. ;;;
  1456. ;;; Pluggable authentication modules (PAM).
  1457. ;;;
  1458. (define-public linux-pam
  1459. (package
  1460. (name "linux-pam")
  1461. (version "1.5.1")
  1462. (source
  1463. (origin
  1464. (method url-fetch)
  1465. (uri (string-append
  1466. "https://github.com/linux-pam/linux-pam/releases/download/v"
  1467. version "/Linux-PAM-" version ".tar.xz"))
  1468. (sha256
  1469. (base32
  1470. "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
  1471. (patches (search-patches "linux-pam-no-setfsuid.patch"))))
  1472. (build-system gnu-build-system)
  1473. (native-inputs
  1474. `(("flex" ,flex)
  1475. ;; TODO: optional dependencies
  1476. ;; ("libxcrypt" ,libxcrypt)
  1477. ;; ("cracklib" ,cracklib)
  1478. ))
  1479. (arguments
  1480. `(;; Most users, such as `shadow', expect the headers to be under
  1481. ;; `security'.
  1482. #:configure-flags (list (string-append "--includedir="
  1483. (assoc-ref %outputs "out")
  1484. "/include/security")
  1485. ;; XXX: <rpc/rpc.h> is missing from glibc when
  1486. ;; cross-compiling, so we have to disable NIS
  1487. ;; support altogether.
  1488. ,@(if (%current-target-system)
  1489. '("--disable-nis")
  1490. '()))
  1491. ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
  1492. ;; isn't available.
  1493. #:tests? #f))
  1494. (home-page "http://www.linux-pam.org/")
  1495. (synopsis "Pluggable authentication modules for Linux")
  1496. (description
  1497. "A *Free* project to implement OSF's RFC 86.0.
  1498. Pluggable authentication modules are small shared object files that can
  1499. be used through the PAM API to perform tasks, like authenticating a user
  1500. at login. Local and dynamic reconfiguration are its key features.")
  1501. (license license:bsd-3)))
  1502. (define-public linux-pam-1.2
  1503. (package
  1504. (inherit linux-pam)
  1505. (version "1.2.1")
  1506. (source
  1507. (origin
  1508. (method url-fetch)
  1509. (uri (string-append
  1510. "http://www.linux-pam.org/library/"
  1511. "Linux-PAM-" version ".tar.bz2"))
  1512. (sha256
  1513. (base32
  1514. "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
  1515. (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
  1516. (define-public python-pamela
  1517. (package
  1518. (name "python-pamela")
  1519. (version "1.0.0")
  1520. (source
  1521. (origin
  1522. ;; Tests not distributed in pypi release.
  1523. (method git-fetch)
  1524. (uri (git-reference
  1525. (url "https://github.com/minrk/pamela")
  1526. (commit version)))
  1527. (file-name (git-file-name name version))
  1528. (sha256
  1529. (base32
  1530. "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
  1531. (build-system python-build-system)
  1532. (arguments
  1533. '(#:tests? #f ; Test suite isn't designed to be run inside a container.
  1534. #:phases
  1535. (modify-phases %standard-phases
  1536. (add-after 'unpack 'hardcode-pam.so
  1537. (lambda* (#:key inputs #:allow-other-keys)
  1538. (let ((pam (assoc-ref inputs "linux-pam")))
  1539. (substitute* "pamela.py"
  1540. (("find_library\\(\"pam\")")
  1541. (string-append "'" pam "/lib/libpam.so'")))
  1542. #t)))
  1543. (replace 'check
  1544. (lambda* (#:key tests? #:allow-other-keys)
  1545. (if tests?
  1546. (if (file-exists? "test_pamela.py")
  1547. (invoke "py.test" "--assert=plain" "test_pamela.py")
  1548. (invoke "python" "-m" "pamela" "-a" "`whoami`"))
  1549. #t))))))
  1550. (inputs
  1551. `(("linux-pam" ,linux-pam)))
  1552. (native-inputs
  1553. `(("python-pytest" ,python-pytest)))
  1554. (home-page "https://github.com/minrk/pamela")
  1555. (synopsis "PAM interface using ctypes")
  1556. (description "This package provides a PAM interface using @code{ctypes}.")
  1557. (license license:expat)))
  1558. (define-public pam-gnupg
  1559. (package
  1560. (name "pam-gnupg")
  1561. (version "0.3")
  1562. (source (origin
  1563. (method git-fetch)
  1564. (uri (git-reference
  1565. (url "https://github.com/cruegge/pam-gnupg")
  1566. (commit (string-append "v" version))))
  1567. (file-name (git-file-name name version))
  1568. (sha256
  1569. (base32
  1570. "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
  1571. (build-system gnu-build-system)
  1572. (inputs
  1573. `(("gnupg" ,gnupg)
  1574. ("linux-pam" ,linux-pam)))
  1575. (native-inputs
  1576. `(("autoconf" ,autoconf)
  1577. ("automake" ,automake)
  1578. ("libtool" ,libtool)))
  1579. (arguments
  1580. `(#:tests? #f ;no tests suite
  1581. #:configure-flags
  1582. (list (string-append "--with-moduledir="
  1583. (assoc-ref %outputs "out") "/lib/security"))))
  1584. (home-page "https://github.com/cruegge/pam-gnupg")
  1585. (synopsis "Unlock GnuPG keys on login")
  1586. (description "This package provides a PAM module that hands over your
  1587. login password to @code{gpg-agent}. This can be useful if you are using a
  1588. GnuPG-based password manager like @code{pass}.")
  1589. (license license:gpl3+)))
  1590. ;;;
  1591. ;;; Miscellaneous.
  1592. ;;;
  1593. (define-public powercap
  1594. (package
  1595. (name "powercap")
  1596. (version "0.4.0")
  1597. (source
  1598. (origin
  1599. (method git-fetch)
  1600. (uri (git-reference
  1601. (url "https://github.com/powercap/powercap")
  1602. (commit (string-append "v" version))))
  1603. (file-name (git-file-name name version))
  1604. (sha256
  1605. (base32 "1hp2i1d195v0n4jgvgaymkxlpgyhn07ic273gkda95lz65cdfcgm"))))
  1606. (build-system cmake-build-system)
  1607. (arguments
  1608. '(#:configure-flags
  1609. '("-DBUILD_SHARED_LIBS=ON")))
  1610. (home-page "https://github.com/powercap/powercap")
  1611. (synopsis "Utilities for accessing the powercap Linux kernel feature")
  1612. (description "This package contains utilities for accessing the powercap
  1613. Linux kernel feature through sysfs. It includes an implementation for working
  1614. with Intel @acronym{RAPL, Running Average Power Limit}.
  1615. It provides the commands @code{powercap-info} and @code{powercap-set}.")
  1616. (license license:bsd-3)))
  1617. (define-public powerstat
  1618. (package
  1619. (name "powerstat")
  1620. (version "0.02.26")
  1621. (source
  1622. (origin
  1623. (method url-fetch)
  1624. (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
  1625. "powerstat/powerstat-" version ".tar.gz"))
  1626. (sha256
  1627. (base32 "18m85k83hryj05vix63fay1hh0sb9h87hy5r7g1dqg2y9i8lzgxk"))))
  1628. (build-system gnu-build-system)
  1629. (arguments
  1630. `(#:make-flags
  1631. (list (string-append "CC=" ,(cc-for-target))
  1632. (string-append "prefix=" (assoc-ref %outputs "out")))
  1633. #:tests? #f ; no test suite
  1634. #:phases
  1635. (modify-phases %standard-phases
  1636. (delete 'configure)))) ; no configure script
  1637. (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
  1638. (synopsis "Measure system power consumption")
  1639. (description
  1640. "Powerstat measures and reports your computer's power consumption in real
  1641. time. On mobile PCs, it uses ACPI battery information to measure the power
  1642. drain of the entire system.
  1643. Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
  1644. domain measurements. These are available only on some hardware such as Intel
  1645. Sandybridge and newer, and cover only part of the machine's components such as
  1646. CPU, DRAM, and graphics. However, they provide accurate and immediate readings
  1647. and don't require a battery at all.
  1648. The output is like @command{vmstat} but also shows power consumption statistics:
  1649. at the end of a run, @command{powerstat} will calculate the average, standard
  1650. deviation, and minimum and maximum values. It can show a nice histogram too.")
  1651. (license license:gpl2)))
  1652. (define-public psmisc
  1653. (package
  1654. (name "psmisc")
  1655. (version "23.4")
  1656. (source
  1657. (origin
  1658. (method url-fetch)
  1659. (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
  1660. version ".tar.xz"))
  1661. (sha256
  1662. (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
  1663. (build-system gnu-build-system)
  1664. (arguments
  1665. `(,@(if (%current-target-system)
  1666. '(#:configure-flags
  1667. (list
  1668. "ac_cv_func_malloc_0_nonnull=yes"
  1669. "ac_cv_func_realloc_0_nonnull=yes"))
  1670. '())))
  1671. (inputs `(("ncurses" ,ncurses)))
  1672. (home-page "https://gitlab.com/psmisc/psmisc")
  1673. (synopsis "Small utilities that use the proc file system")
  1674. (description
  1675. "This PSmisc package is a set of some small useful utilities that
  1676. use the proc file system. We're not about changing the world, but
  1677. providing the system administrator with some help in common tasks.")
  1678. (license license:gpl2+)))
  1679. (define-public util-linux
  1680. (package
  1681. (name "util-linux")
  1682. (version "2.37.1")
  1683. (source (origin
  1684. (method url-fetch)
  1685. (uri (string-append "mirror://kernel.org/linux/utils/"
  1686. "util-linux/v" (version-major+minor version) "/"
  1687. "util-linux-" version ".tar.xz"))
  1688. (sha256
  1689. (base32
  1690. "0xkb7vw2040zi4m0sbhs5qn5l8nrq4xsf4sdxf3cy9mpachd8jwf"))
  1691. (patches (search-patches "util-linux-tests.patch"))
  1692. (modules '((guix build utils)))
  1693. (snippet
  1694. ;; We take 'nologin' from Shadow, the 'logger' program from
  1695. ;; GNU Inetutils and 'kill' from GNU Coreutils.
  1696. '(begin
  1697. (substitute* "configure"
  1698. (("build_nologin=yes") "build_nologin=no")
  1699. (("build_logger=yes") "build_logger=no")
  1700. (("build_kill=yes") "build_kill=no"))
  1701. #t))))
  1702. (build-system gnu-build-system)
  1703. (outputs '("out" ;6.4 MiB executables and documentation
  1704. "lib" ;8.8 MiB shared libraries, headers and locales
  1705. "static")) ;2.9 MiB static .a libraries
  1706. (arguments
  1707. `(#:configure-flags (list "--disable-use-tty-group"
  1708. (string-append
  1709. "--enable-fs-paths-default="
  1710. "/run/setuid-programs"
  1711. ":/run/current-system/profile/sbin")
  1712. ;; Don't try to chown root:root mount and umount
  1713. "--disable-makeinstall-chown"
  1714. "--localstatedir=/var"
  1715. (string-append "--localedir="
  1716. (assoc-ref %outputs "lib")
  1717. "/share/locale")
  1718. ;; Install completions where our
  1719. ;; bash-completion package expects them.
  1720. (string-append "--with-bashcompletiondir="
  1721. (assoc-ref %outputs "out")
  1722. "/etc/bash_completion.d"))
  1723. ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
  1724. ;; <https://bugs.gnu.org/47791>.
  1725. #:tests? ,(and (not (%current-target-system))
  1726. (not (string-suffix? "-gnu" (%current-system))))
  1727. #:phases (modify-phases %standard-phases
  1728. (add-before 'configure 'patch-build-scripts
  1729. (lambda* (#:key outputs #:allow-other-keys)
  1730. (substitute* "configure"
  1731. ;; The build system assumes that we want to install
  1732. ;; libraries below $exec_prefix when $libdir does not
  1733. ;; match any of the "usual" locations. Fix that.
  1734. (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
  1735. "usrlib_execdir=$libdir"))))
  1736. (add-before 'build 'set-umount-file-name
  1737. (lambda* (#:key outputs #:allow-other-keys)
  1738. ;; Tell 'eject' the right file name of 'umount'.
  1739. (let ((out (assoc-ref outputs "out")))
  1740. (substitute* "sys-utils/eject.c"
  1741. (("\"/bin/umount\"")
  1742. (string-append "\"" out "/bin/umount\""))))))
  1743. (add-before 'check 'pre-check
  1744. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  1745. (let ((services (search-input-file (or native-inputs inputs)
  1746. "etc/services")))
  1747. ;; Change the test to refer to the right file.
  1748. (substitute* "tests/ts/misc/mcookie"
  1749. (("/etc/services")
  1750. services))
  1751. ;; The C.UTF-8 locale does not exist in our libc.
  1752. (substitute* "tests/ts/column/invalid-multibyte"
  1753. (("C\\.UTF-8") "en_US.utf8")))))
  1754. (add-before 'check 'disable-setarch-test
  1755. (lambda _
  1756. ;; The setarch tests are unreliable in QEMU's user-mode
  1757. ;; emulation, which is our primary method of building
  1758. ;; ARMv7 packages. See
  1759. ;; <https://github.com/karelzak/util-linux/issues/601>.
  1760. (substitute* "tests/ts/misc/setarch"
  1761. (("ts_init_subtest.*" all)
  1762. (string-append
  1763. all "\n"
  1764. "ts_skip \"setarch tests are unreliable under QEMU\"")))))
  1765. ,@(if (target-x86-32?)
  1766. `((add-before 'check 'disable-lsns-test
  1767. (lambda _
  1768. ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
  1769. ;; returning ENOTTY, indicating this kernel does not
  1770. ;; support user namespaces. Curiously, this test can fail
  1771. ;; on i686 even if the same test passes on x86_64 on the
  1772. ;; same machine. See <https://issues.guix.gnu.org/49933>.
  1773. (delete-file "tests/ts/lsns/ioctl_ns"))))
  1774. '())
  1775. (add-after 'install 'move-static-libraries
  1776. (lambda* (#:key outputs #:allow-other-keys)
  1777. (let ((lib (assoc-ref outputs "lib"))
  1778. (static (assoc-ref outputs "static")))
  1779. ;; Move static libraries to the "static" output.
  1780. (mkdir-p (string-append static "/lib"))
  1781. (with-directory-excursion lib
  1782. (for-each (lambda (file)
  1783. (rename-file file
  1784. (string-append static "/"
  1785. file)))
  1786. (find-files "lib" "\\.a$"))
  1787. ;; Remove references to the static library from the '.la'
  1788. ;; files so that Libtool does the right thing when both
  1789. ;; the shared and static library is available.
  1790. (substitute* (find-files "lib" "\\.la$")
  1791. (("old_library=.*") "old_library=''\n"))))))
  1792. (add-after 'install 'adjust-pkg-config-files
  1793. (lambda* (#:key outputs #:allow-other-keys)
  1794. (let ((lib (assoc-ref outputs "lib")))
  1795. ;; Drop the unused "prefix=" and "exec_prefix=" variables from
  1796. ;; the pkg-config files to avoid a cyclic reference on "out".
  1797. (substitute* (find-files (string-append lib "/lib/pkgconfig")
  1798. "\\.pc$")
  1799. (("^(exec_)?prefix=.*") ""))))))))
  1800. (inputs
  1801. (list file ;for libmagic
  1802. ncurses
  1803. zlib))
  1804. (native-inputs
  1805. (list net-base ;for tests
  1806. perl))
  1807. (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
  1808. (synopsis "Collection of utilities for the Linux kernel")
  1809. (description "Util-linux is a diverse collection of Linux kernel
  1810. utilities. It provides dmesg and includes tools for working with file systems,
  1811. block devices, UUIDs, TTYs, and many other tools.")
  1812. ;; Note that util-linux doesn't use the same license for all the
  1813. ;; code. GPLv2+ is the default license for a code without an
  1814. ;; explicitly defined license.
  1815. (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
  1816. license:bsd-4 license:public-domain))))
  1817. ;; util-linux optionally supports udev, which allows lsblk to read file system
  1818. ;; metadata without special privileges. Add it as a separate package to avoid
  1819. ;; a circular dependency, and to keep the size small.
  1820. (define-public util-linux+udev
  1821. (package/inherit
  1822. util-linux
  1823. (name "util-linux-with-udev")
  1824. (inputs
  1825. `(("udev" ,eudev)
  1826. ,@(package-inputs util-linux)))))
  1827. (define-public ddate
  1828. (package
  1829. (name "ddate")
  1830. (version "0.2.2")
  1831. (source (origin
  1832. (method git-fetch)
  1833. (uri (git-reference
  1834. (url "https://github.com/bo0ts/ddate")
  1835. (commit (string-append "v" version))))
  1836. (file-name (git-file-name name version))
  1837. (sha256
  1838. (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
  1839. (build-system cmake-build-system)
  1840. (arguments '(#:tests? #f))
  1841. (home-page "https://github.com/bo0ts/ddate")
  1842. (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
  1843. (description
  1844. "ddate displays the Discordian date and holidays of a given date.
  1845. The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
  1846. by Robert Shea and Robert Anton Wilson.")
  1847. (license license:public-domain)))
  1848. (define-public fbset
  1849. (package
  1850. (name "fbset")
  1851. (version "2.1")
  1852. (source
  1853. (origin
  1854. (method url-fetch)
  1855. (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
  1856. version ".tar.gz"))
  1857. (sha256
  1858. (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
  1859. (build-system gnu-build-system)
  1860. (arguments
  1861. '(#:modules ((guix build gnu-build-system)
  1862. (guix build utils)
  1863. (srfi srfi-26))
  1864. #:phases
  1865. (modify-phases %standard-phases
  1866. (delete 'configure) ; no configure script
  1867. (add-before 'install 'pre-install
  1868. (lambda* (#:key outputs #:allow-other-keys)
  1869. (let ((out (assoc-ref outputs "out")))
  1870. (substitute* "Makefile"
  1871. (("mknod ") "true ")
  1872. ;; The Makefile doesn't honour PREFIX or similar.
  1873. (("/usr") out))
  1874. (mkdir out)
  1875. (with-directory-excursion out
  1876. (for-each mkdir-p (list "sbin"
  1877. "man/man5"
  1878. "man/man8")))
  1879. #t)))
  1880. (add-after 'install 'install-fb.modes
  1881. (lambda* (#:key outputs #:allow-other-keys)
  1882. (let* ((out (assoc-ref outputs "out"))
  1883. (etc (string-append out "/etc")))
  1884. (for-each (cut install-file <> etc)
  1885. (find-files "etc" "^fb\\.modes"))
  1886. (symlink "fb.modes.ATI"
  1887. (string-append etc "/fb.modes"))
  1888. #t))))
  1889. ;; Parallel building races to create modes.tab.c.
  1890. #:parallel-build? #f
  1891. #:tests? #f)) ; no test suite
  1892. (native-inputs
  1893. `(("bison" ,bison)
  1894. ("flex" ,flex)))
  1895. (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
  1896. (synopsis "Show and modify Linux frame buffer settings")
  1897. (description
  1898. "The kernel Linux's @dfn{frame buffers} provide a simple interface to
  1899. different kinds of graphic displays. The @command{fbset} utility can query and
  1900. change various device settings such as depth, virtual resolution, and timing
  1901. parameters.")
  1902. (license license:gpl2)))
  1903. (define-public procps
  1904. (package
  1905. (name "procps")
  1906. (version "3.3.16")
  1907. (source (origin
  1908. (method url-fetch)
  1909. (uri (string-append "mirror://sourceforge/procps-ng/Production/"
  1910. "procps-ng-" version ".tar.xz"))
  1911. (sha256
  1912. (base32
  1913. "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
  1914. (build-system gnu-build-system)
  1915. (arguments
  1916. `(#:modules ((guix build utils)
  1917. (guix build gnu-build-system)
  1918. (srfi srfi-1)
  1919. (srfi srfi-26))
  1920. ,@(if (%current-target-system)
  1921. '(#:configure-flags
  1922. (list
  1923. "ac_cv_func_malloc_0_nonnull=yes"
  1924. "ac_cv_func_realloc_0_nonnull=yes"))
  1925. '())
  1926. #:phases
  1927. (modify-phases %standard-phases
  1928. (add-after
  1929. 'install 'post-install
  1930. ;; Remove commands and man pages redudant with
  1931. ;; Coreutils.
  1932. (lambda* (#:key outputs #:allow-other-keys)
  1933. (let* ((out (assoc-ref outputs "out"))
  1934. (dup (append-map (cut find-files out <>)
  1935. '("^kill" "^uptime"))))
  1936. (for-each delete-file dup)
  1937. #t))))))
  1938. (inputs `(("ncurses" ,ncurses)))
  1939. (home-page "https://gitlab.com/procps-ng/procps/")
  1940. (synopsis "Utilities that give information about processes")
  1941. (description
  1942. "Procps is the package that has a bunch of small useful utilities
  1943. that give information about processes using the Linux /proc file system.
  1944. The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
  1945. slabtop, tload, top, vmstat, w, watch and sysctl.")
  1946. (license license:gpl2)))
  1947. (define-public usbutils
  1948. (package
  1949. (name "usbutils")
  1950. (version "013")
  1951. (source
  1952. (origin
  1953. (method url-fetch)
  1954. (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
  1955. "usbutils-" version ".tar.xz"))
  1956. (sha256
  1957. (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
  1958. (build-system gnu-build-system)
  1959. (outputs (list "out" "python"))
  1960. (arguments
  1961. `(#:phases
  1962. (modify-phases %standard-phases
  1963. (add-before 'bootstrap 'patch-bootstrap-scripts
  1964. (lambda _
  1965. (substitute* "usbhid-dump/bootstrap"
  1966. (("/bin/sh") (which "sh")))
  1967. ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
  1968. (substitute* "autogen.sh"
  1969. (("^\\./configure.*") ""))
  1970. #t))
  1971. (add-after 'install 'separate-python-output
  1972. ;; Separating one Python script shaves more than 106 MiB from :out.
  1973. (lambda* (#:key outputs #:allow-other-keys)
  1974. (let ((out (assoc-ref outputs "out"))
  1975. (out:python (assoc-ref outputs "python")))
  1976. (for-each (lambda (file)
  1977. (let ((old (string-append out "/" file))
  1978. (new (string-append out:python "/" file)))
  1979. (mkdir-p (dirname new))
  1980. (rename-file old new)))
  1981. (list "bin/lsusb.py"))
  1982. #t))))))
  1983. (inputs
  1984. `(("eudev" ,eudev)
  1985. ("libusb" ,libusb)
  1986. ("python" ,python)))
  1987. (native-inputs
  1988. `(("autoconf" ,autoconf)
  1989. ("automake" ,automake)
  1990. ("libtool" ,libtool)
  1991. ("pkg-config" ,pkg-config)))
  1992. (home-page "http://www.linux-usb.org/")
  1993. (synopsis
  1994. "Tools for working with USB devices, such as lsusb")
  1995. (description
  1996. "Tools for working with USB devices, such as lsusb.")
  1997. (license license:gpl2+)))
  1998. (define-public usbip-utils
  1999. (package
  2000. (name "usbip-utils")
  2001. (version (package-version linux-libre))
  2002. (source (package-source linux-libre))
  2003. (build-system gnu-build-system)
  2004. (arguments
  2005. '(#:configure-flags '("--disable-static")
  2006. #:phases (modify-phases %standard-phases
  2007. (add-after 'unpack 'enter-subdirectory
  2008. (lambda _
  2009. (chdir "tools/usb/usbip")
  2010. #t)))))
  2011. (native-inputs
  2012. `(("automake" ,automake)
  2013. ("autoreconf" ,autoconf)
  2014. ("libtool" ,libtool)))
  2015. (inputs `(("eudev" ,eudev)))
  2016. (home-page (package-home-page linux-libre))
  2017. (synopsis "Utilities for sharing USB devices over IP networks")
  2018. (description
  2019. "The USB/IP protocol enables to pass USB device from a server to
  2020. a client over the network. The server is a machine which shares an
  2021. USB device and the client is a machine which uses USB device provided by
  2022. a server over the network. The USB device may be either physical device
  2023. connected to a server or software entity created on a server using USB
  2024. gadget subsystem. The usbip-utils are userspace tools to used to handle
  2025. connection and management on both side. The client needs the @file{vhci-hcd}
  2026. Linux kernel module and the server needs the @file{usbip_host} Linux kernel
  2027. module.")
  2028. (license license:gpl2)))
  2029. (define-public e2fsprogs
  2030. (package
  2031. (name "e2fsprogs")
  2032. (version "1.45.6")
  2033. (source (origin
  2034. (method url-fetch)
  2035. (uri (string-append
  2036. "mirror://kernel.org/linux/kernel/people/tytso/"
  2037. "e2fsprogs/v" version "/"
  2038. "e2fsprogs-" version ".tar.xz"))
  2039. (sha256
  2040. (base32
  2041. "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
  2042. (build-system gnu-build-system)
  2043. (inputs `(("util-linux" ,util-linux "lib")))
  2044. (native-inputs `(("pkg-config" ,pkg-config)
  2045. ("texinfo" ,texinfo) ;for the libext2fs Info manual
  2046. ;; For tests.
  2047. ("perl" ,perl)
  2048. ("procps" ,procps)))
  2049. (arguments
  2050. '(;; util-linux is the preferred source for some of the libraries and
  2051. ;; commands, so disable them (see, e.g.,
  2052. ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
  2053. #:configure-flags (list "--disable-libblkid"
  2054. "--disable-libuuid" "--disable-uuidd"
  2055. "--disable-fsck"
  2056. ;; Use symlinks instead of hard links for
  2057. ;; 'fsck.extN' etc. This makes the resulting nar
  2058. ;; smaller and is preserved across copies.
  2059. "--enable-symlink-install"
  2060. (string-append "LDFLAGS=-Wl,-rpath="
  2061. (assoc-ref %outputs "out")
  2062. "/lib")
  2063. ;; Install libext2fs et al.
  2064. "--enable-elf-shlibs")
  2065. #:phases
  2066. (modify-phases %standard-phases
  2067. (add-before 'configure 'patch-shells
  2068. (lambda _
  2069. (substitute* "configure"
  2070. (("/bin/sh (.*)parse-types.sh" _ dir)
  2071. (string-append (which "sh") " " dir
  2072. "parse-types.sh")))
  2073. (substitute* "MCONFIG.in"
  2074. (("INSTALL_SYMLINK = /bin/sh")
  2075. "INSTALL_SYMLINK = sh"))
  2076. (substitute* (find-files "." "^Makefile.in$")
  2077. (("#!/bin/sh")
  2078. (string-append "#!" (which "sh"))))
  2079. #t))
  2080. (add-after 'install 'install-libs
  2081. (lambda* (#:key outputs #:allow-other-keys)
  2082. (let* ((out (assoc-ref outputs "out"))
  2083. (lib (string-append out "/lib")))
  2084. (invoke "make" "install-libs")
  2085. ;; Make the .a writable so that 'strip' works.
  2086. ;; Failing to do that, due to debug symbols, we
  2087. ;; retain a reference to the final
  2088. ;; linux-libre-headers, which refer to the
  2089. ;; bootstrap binaries.
  2090. (let ((archives (find-files lib "\\.a$")))
  2091. (for-each (lambda (file)
  2092. (chmod file #o666))
  2093. archives))
  2094. #t))))))
  2095. (home-page "http://e2fsprogs.sourceforge.net/")
  2096. (synopsis "Creating and checking ext2/ext3/ext4 file systems")
  2097. (description
  2098. "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
  2099. (license (list license:gpl2 ;programs
  2100. license:lgpl2.0 ;libext2fs
  2101. license:x11)))) ;libuuid
  2102. (define e2fsprogs/static
  2103. (static-package
  2104. (package (inherit e2fsprogs)
  2105. (arguments
  2106. ;; Do not build shared libraries.
  2107. (substitute-keyword-arguments (package-arguments e2fsprogs)
  2108. ((#:configure-flags _)
  2109. '(list "--disable-blkid"))
  2110. ((#:make-flags _)
  2111. '(list)))))))
  2112. (define-public e2fsck/static
  2113. (package
  2114. (name "e2fsck-static")
  2115. (version (package-version e2fsprogs))
  2116. (build-system trivial-build-system)
  2117. (source #f)
  2118. (inputs
  2119. `(("e2fsprogs" ,e2fsprogs/static)))
  2120. (arguments
  2121. `(#:modules ((guix build utils))
  2122. #:builder
  2123. (begin
  2124. (use-modules (guix build utils)
  2125. (ice-9 ftw)
  2126. (srfi srfi-26))
  2127. (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
  2128. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  2129. (mkdir-p bin)
  2130. (with-directory-excursion bin
  2131. (copy-file e2fsck "e2fsck")
  2132. (remove-store-references "e2fsck")
  2133. (chmod "e2fsck" #o555))
  2134. #t))))
  2135. (home-page (package-home-page e2fsprogs))
  2136. (synopsis "Statically-linked e2fsck command from e2fsprogs")
  2137. (description "This package provides statically-linked e2fsck command taken
  2138. from the e2fsprogs package. It is meant to be used in initrds.")
  2139. (license (package-license e2fsprogs))))
  2140. (define-public extundelete
  2141. (package
  2142. (name "extundelete")
  2143. (version "0.2.4")
  2144. (source
  2145. (origin
  2146. (method url-fetch)
  2147. (uri (string-append "mirror://sourceforge/extundelete/"
  2148. "extundelete/" version "/extundelete-"
  2149. version ".tar.bz2"))
  2150. (sha256
  2151. (base32
  2152. "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
  2153. (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
  2154. (build-system gnu-build-system)
  2155. (inputs `(("e2fsprogs" ,e2fsprogs)))
  2156. (home-page "http://extundelete.sourceforge.net/")
  2157. (synopsis "Recover deleted files from ext2/3/4 partitions")
  2158. (description
  2159. "Extundelete is a set of tools that can recover deleted files from an
  2160. ext3 or ext4 partition.")
  2161. (license license:gpl2)))
  2162. (define-public zerofree
  2163. (package
  2164. (name "zerofree")
  2165. (version "1.1.1")
  2166. (home-page "https://frippery.org/uml/")
  2167. (source (origin
  2168. (method url-fetch)
  2169. (uri (string-append home-page name "-" version
  2170. ".tgz"))
  2171. (sha256
  2172. (base32
  2173. "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
  2174. (build-system gnu-build-system)
  2175. (arguments
  2176. '(#:phases
  2177. (modify-phases %standard-phases
  2178. (delete 'configure) ; no configure script
  2179. (replace 'install
  2180. ;; The Makefile lacks an ‘install’ target.
  2181. (lambda* (#:key outputs #:allow-other-keys)
  2182. (let* ((out (assoc-ref outputs "out"))
  2183. (bin (string-append out "/bin")))
  2184. (chmod "zerofree" #o555)
  2185. (install-file "zerofree" bin)
  2186. #t))))
  2187. #:tests? #f)) ; no tests
  2188. (inputs `(("libext2fs" ,e2fsprogs)))
  2189. (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
  2190. (description
  2191. "Zerofree finds the unallocated blocks with non-zero value content in an
  2192. ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
  2193. This is a simple way to make disk images more compressible.
  2194. Zerofree requires the file system to be unmounted or mounted read-only.")
  2195. (license license:gpl2)))
  2196. (define-public strace
  2197. (package
  2198. (name "strace")
  2199. (version "5.13")
  2200. (home-page "https://strace.io")
  2201. (source (origin
  2202. (method url-fetch)
  2203. (uri (string-append home-page "/files/" version
  2204. "/strace-" version ".tar.xz"))
  2205. (sha256
  2206. (base32
  2207. "0mmns22bjjvakxj29si0x4dcylcgy26llpcimkb0llcxif439k2s"))))
  2208. (build-system gnu-build-system)
  2209. (arguments
  2210. '(#:phases
  2211. (modify-phases %standard-phases
  2212. (add-after 'unpack 'patch-/bin/sh
  2213. (lambda _
  2214. (substitute* "src/strace.c"
  2215. (("/bin/sh") (which "sh")))
  2216. #t))
  2217. (add-after 'unpack 'disable-failing-tests
  2218. (lambda _
  2219. (substitute* "tests/Makefile.in"
  2220. ;; XXX: This test fails because an extra readlink call is made
  2221. ;; by the glibc when using the ld.so cache.
  2222. (("readlink.gen.test[^:]") " ")
  2223. ;; XXX: These hang forever even if the test time-out is
  2224. ;; extended.
  2225. (("^\tstrace-DD?D?\\.test \\\\.*") "")
  2226. (("^\tpidns-cache.test \\\\.*") "")
  2227. (("^\t.*--pidns-translation.test \\\\.*") ""))
  2228. #t)))
  2229. ;; Don't fail if the architecture doesn't support different
  2230. ;; personalities.
  2231. #:configure-flags '("--enable-mpers=check")
  2232. ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
  2233. #:parallel-tests? #f)) ; undeterministic failures
  2234. (native-inputs `(("perl" ,perl)))
  2235. (synopsis "System call tracer for Linux")
  2236. (description
  2237. "strace is a system call tracer, i.e. a debugging tool which prints out a
  2238. trace of all the system calls made by a another process/program.")
  2239. (license license:lgpl2.1+)))
  2240. (define-public ltrace
  2241. (package
  2242. (name "ltrace")
  2243. (version "0.7.3")
  2244. (source (origin
  2245. (method url-fetch)
  2246. (uri (string-append "http://www.ltrace.org/ltrace_" version
  2247. ".orig.tar.bz2"))
  2248. (sha256
  2249. (base32
  2250. "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
  2251. (build-system gnu-build-system)
  2252. (inputs `(("libelf" ,elfutils)))
  2253. (arguments
  2254. ;; Compilation uses -Werror by default, but it fails.
  2255. '(#:configure-flags '("--disable-werror")))
  2256. (home-page "https://www.ltrace.org/")
  2257. (synopsis "Library call tracer for Linux")
  2258. (description
  2259. "ltrace intercepts and records dynamic library calls which are called by
  2260. an executed process and the signals received by that process. It can also
  2261. intercept and print the system calls executed by the program.")
  2262. (license license:gpl2+)))
  2263. (define-public alsa-ucm-conf
  2264. (package
  2265. (name "alsa-ucm-conf")
  2266. (version "1.2.4")
  2267. (source (origin
  2268. (method url-fetch)
  2269. (uri (string-append
  2270. "ftp://ftp.alsa-project.org/pub/lib/" name "-"
  2271. version ".tar.bz2"))
  2272. (sha256
  2273. (base32
  2274. "0h6kzi1cfdqyxp4pwpqh5wb89c8s9wrgix315bvamffwfxf56frc"))))
  2275. (build-system copy-build-system)
  2276. (arguments
  2277. '(#:install-plan
  2278. '(("ucm" "share/alsa/ucm")
  2279. ("ucm2" "share/alsa/ucm2"))))
  2280. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2281. (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
  2282. (description
  2283. "This package contains Advanced Linux Sound Architecture Use Case Manager
  2284. configuration of audio input/output names and routing for specific audio
  2285. hardware.")
  2286. (license license:bsd-3)))
  2287. (define-public alsa-topology-conf
  2288. (package
  2289. (name "alsa-topology-conf")
  2290. (version "1.2.4")
  2291. (source (origin
  2292. (method url-fetch)
  2293. (uri (string-append
  2294. "ftp://ftp.alsa-project.org/pub/lib/" name "-"
  2295. version ".tar.bz2"))
  2296. (sha256
  2297. (base32
  2298. "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
  2299. (build-system copy-build-system)
  2300. (arguments
  2301. '(#:install-plan
  2302. '(("topology" "share/alsa/topology"))))
  2303. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2304. (synopsis "The Advanced Linux Sound Architecture libraries")
  2305. (description
  2306. "This package contains Advanced Linux Sound Architecture topology
  2307. configuration files that can be used for specific audio hardware.")
  2308. (license license:bsd-3)))
  2309. (define-public alsa-lib
  2310. (package
  2311. (name "alsa-lib")
  2312. (version "1.2.4")
  2313. (source (origin
  2314. (method url-fetch)
  2315. (uri (string-append
  2316. "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
  2317. version ".tar.bz2"))
  2318. (sha256
  2319. (base32
  2320. "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
  2321. (build-system gnu-build-system)
  2322. (arguments
  2323. '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  2324. (assoc-ref %outputs "out")
  2325. "/lib"))
  2326. #:phases
  2327. (modify-phases %standard-phases
  2328. (add-before 'install 'pre-install
  2329. (lambda* (#:key inputs outputs #:allow-other-keys)
  2330. (let* ((ucm
  2331. (string-append (assoc-ref inputs "alsa-ucm-conf")))
  2332. (topology
  2333. (string-append (assoc-ref inputs "alsa-topology-conf")))
  2334. (alsa
  2335. (string-append (assoc-ref outputs "out") "/share/alsa"))
  2336. (ucm-share
  2337. (string-append ucm "/share/alsa/ucm"))
  2338. (ucm2-share
  2339. (string-append ucm "/share/alsa/ucm2"))
  2340. (topology-share
  2341. (string-append topology "/share/alsa/topology")))
  2342. (mkdir-p alsa)
  2343. (symlink ucm-share (string-append alsa "/ucm"))
  2344. (symlink ucm2-share (string-append alsa "/ucm2"))
  2345. (symlink topology-share (string-append alsa "/topology")))
  2346. #t)))))
  2347. (inputs
  2348. `(("alsa-ucm-conf" ,alsa-ucm-conf)
  2349. ("alsa-topology-conf" ,alsa-topology-conf)))
  2350. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2351. (synopsis "The Advanced Linux Sound Architecture libraries")
  2352. (description
  2353. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2354. MIDI functionality to the Linux-based operating system.")
  2355. (license license:lgpl2.1+)))
  2356. (define-public alsa-utils
  2357. (package
  2358. (name "alsa-utils")
  2359. (version "1.2.4")
  2360. (source (origin
  2361. (method url-fetch)
  2362. (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
  2363. name "-" version ".tar.bz2"))
  2364. (sha256
  2365. (base32
  2366. "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
  2367. (build-system gnu-build-system)
  2368. (arguments
  2369. ;; XXX: Disable man page creation until we have DocBook.
  2370. '(#:configure-flags (list "--disable-xmlto"
  2371. ;; The udev rule is responsible for restoring
  2372. ;; the volume.
  2373. (string-append "--with-udev-rules-dir="
  2374. (assoc-ref %outputs "out")
  2375. "/lib/udev/rules.d"))
  2376. #:phases
  2377. (modify-phases %standard-phases
  2378. (add-before 'check 'disable-broken-test
  2379. (lambda _
  2380. ;; XXX: The 1.1.8 release tarball is missing a header that's
  2381. ;; required for this test to work. Fixed in 1.1.9.
  2382. (substitute* "axfer/test/Makefile"
  2383. ((".*container-test.*") ""))
  2384. #t))
  2385. (add-before
  2386. 'install 'pre-install
  2387. (lambda _
  2388. ;; Don't try to mkdir /var/lib/alsa.
  2389. (substitute* "Makefile"
  2390. (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
  2391. "true\n"))
  2392. #t)))))
  2393. (native-inputs
  2394. `(("gettext" ,gettext-minimal)))
  2395. (inputs
  2396. `(("libsamplerate" ,libsamplerate)
  2397. ("ncurses" ,ncurses)
  2398. ("alsa-lib" ,alsa-lib)
  2399. ("xmlto" ,xmlto)))
  2400. (home-page "http://www.alsa-project.org/")
  2401. (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
  2402. (description
  2403. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2404. MIDI functionality to the Linux-based operating system.")
  2405. ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
  2406. ;; GPLv2-only.
  2407. (license license:gpl2)))
  2408. (define-public alsa-plugins
  2409. (package
  2410. (name "alsa-plugins")
  2411. (version "1.2.2")
  2412. (source (origin
  2413. (method url-fetch)
  2414. (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
  2415. name "-" version ".tar.bz2"))
  2416. (sha256
  2417. (base32
  2418. "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
  2419. (build-system gnu-build-system)
  2420. ;; TODO: Split libavcodec and speex if possible. It looks like they can not
  2421. ;; be split, there are references to both in files.
  2422. ;; TODO: Remove OSS related plugins, they add support to run native
  2423. ;; ALSA applications on OSS however we do not offer OSS and OSS is
  2424. ;; obsolete.
  2425. (outputs '("out" "pulseaudio" "jack"))
  2426. (native-search-paths
  2427. (list (search-path-specification
  2428. (variable "ALSA_PLUGIN_DIR")
  2429. (files '("lib/alsa-lib"))
  2430. (separator #f))))
  2431. (arguments
  2432. `(#:configure-flags '(;; Do not install a "local" configuration targeted
  2433. ;; for /etc/alsa. On Guix System plugins are loaded from
  2434. ;; the ALSA service, and other distributions likely
  2435. ;; won't use these files.
  2436. "--with-alsalconfdir=/tmp/noop")
  2437. #:phases
  2438. (modify-phases %standard-phases
  2439. (add-after 'install 'split
  2440. (lambda* (#:key inputs outputs #:allow-other-keys)
  2441. ;; Distribute the binaries to the various outputs.
  2442. (let* ((out (assoc-ref outputs "out"))
  2443. (jack (assoc-ref outputs "jack"))
  2444. (jacklib (string-append jack "/lib/alsa-lib"))
  2445. (pua (assoc-ref outputs "pulseaudio"))
  2446. (pualib (string-append pua "/lib/alsa-lib")))
  2447. ;; For jack.
  2448. (mkdir-p jacklib)
  2449. (for-each (lambda (file)
  2450. (rename-file file (string-append jacklib "/" (basename file))))
  2451. (find-files out ".*jack\\.(la|so)"))
  2452. ;; For pulseaudio.
  2453. (mkdir-p pualib)
  2454. (for-each (lambda (file)
  2455. (rename-file file (string-append pualib "/" (basename file))))
  2456. (find-files out ".*pulse\\.(la|so)"))
  2457. #t))))))
  2458. (inputs
  2459. `(("alsa-lib" ,alsa-lib)
  2460. ("jack" ,jack-1)
  2461. ("speex" ,speex) ; libspeexdsp resampling plugin
  2462. ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
  2463. ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
  2464. ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
  2465. (native-inputs
  2466. `(("pkg-config" ,pkg-config)))
  2467. (home-page "http://www.alsa-project.org/")
  2468. (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
  2469. (description
  2470. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2471. MIDI functionality to the Linux-based operating system. This package enhances ALSA
  2472. by providing additional plugins which include: upmixing, downmixing, jackd and
  2473. pulseaudio support for native alsa applications, format conversion (s16 to a52), and
  2474. external rate conversion.")
  2475. (license (list license:gpl2+
  2476. ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
  2477. license:lgpl2.1+))))
  2478. (define-public iptables
  2479. (package
  2480. (name "iptables")
  2481. (version "1.8.7")
  2482. (source
  2483. (origin
  2484. (method url-fetch)
  2485. (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
  2486. version ".tar.bz2")
  2487. (string-append "https://www.netfilter.org/projects/iptables/"
  2488. "files/iptables-" version ".tar.bz2")))
  2489. (sha256
  2490. (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
  2491. (build-system gnu-build-system)
  2492. (native-inputs
  2493. `(("pkg-config" ,pkg-config)
  2494. ("flex" ,flex)
  2495. ("bison" ,bison)))
  2496. (inputs
  2497. `(("libmnl" ,libmnl)
  2498. ("libnftnl" ,libnftnl)))
  2499. (arguments
  2500. '(#:tests? #f ; no test suite
  2501. #:configure-flags ; add $libdir to the RUNPATH of executables
  2502. (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
  2503. (home-page "https://www.netfilter.org/projects/iptables/index.html")
  2504. (synopsis "Programs to configure Linux IP packet filtering rules")
  2505. (description
  2506. "@command{iptables} is the user-space command line program used to
  2507. configure the Linux 2.4.x and later IPv4 packet filtering ruleset
  2508. (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
  2509. This package also includes @command{ip6tables}, which is used to configure the
  2510. IPv6 packet filter.
  2511. Both commands are targeted at system administrators.")
  2512. (license license:gpl2+)))
  2513. (define-public jitterentropy-rngd
  2514. (package
  2515. (name "jitterentropy-rngd")
  2516. (version "1.2.5")
  2517. (source
  2518. (origin
  2519. (method git-fetch)
  2520. (uri (git-reference
  2521. (url "https://github.com/smuellerDD/jitterentropy-rngd")
  2522. (commit (string-append "v" version))))
  2523. (file-name (git-file-name name version))
  2524. (sha256
  2525. (base32 "05h9a60s9x3jav33lh50ac1jw8wvbljw2ndrk3k7gs2nlz0kkl14"))))
  2526. (build-system gnu-build-system)
  2527. (arguments
  2528. `(#:tests? #f ; no test suite
  2529. #:make-flags
  2530. (list (string-append "CC=" ,(cc-for-target))
  2531. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  2532. "UNITDIR=$(PREFIX)/lib/systemd/system")
  2533. #:phases
  2534. (modify-phases %standard-phases
  2535. (delete 'configure)))) ; no ./configure script
  2536. (home-page "https://www.chronox.de/jent.html")
  2537. (synopsis "CPU jitter random number generator daemon")
  2538. (description
  2539. "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
  2540. number generator} core to the kernel Linux's entropy estimator. This prevents
  2541. the @file{/dev/random} device from blocking and should benefit users of the
  2542. preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
  2543. The CPU Jitter RNG itself is part of the kernel and claims to provide good
  2544. entropy by collecting and magnifying differences in CPU execution time as
  2545. measured by the high-resolution timer built into modern CPUs. It requires no
  2546. additional hardware or external entropy source.
  2547. The random bit stream generated by @command{jitterentropy-rngd} is not processed
  2548. by a cryptographically secure whitening function. Nonetheless, its authors
  2549. believe it to be a suitable source of cryptographically secure key material or
  2550. other cryptographically sensitive data.
  2551. If you agree with them, start this daemon as early as possible to provide
  2552. properly seeded random numbers to services like SSH or those using TLS during
  2553. early boot when entropy may be low, especially in virtualised environments.")
  2554. (license (list license:bsd-3 ; or
  2555. license:gpl2+))))
  2556. (define-public lsscsi
  2557. (package
  2558. (name "lsscsi")
  2559. (version "0.32")
  2560. (source (origin
  2561. (method url-fetch)
  2562. (uri (string-append
  2563. "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
  2564. (sha256
  2565. (base32
  2566. "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
  2567. (build-system gnu-build-system)
  2568. (synopsis "Lists information about SCSI or NVMe devices in Linux")
  2569. (home-page "http://sg.danny.cz/scsi/lsscsi.html")
  2570. (description
  2571. "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
  2572. also list NVMe namespaces or controllers and show the relationship between a
  2573. device's primary node name, its SCSI generic (sg) node name and its kernel
  2574. name.")
  2575. (license license:gpl2)))
  2576. (define-public ebtables
  2577. (package
  2578. (name "ebtables")
  2579. (version "2.0.11")
  2580. (source (origin
  2581. (method url-fetch)
  2582. (uri (string-append
  2583. "mirror://netfilter.org/ebtables/ebtables-"
  2584. version ".tar.gz"))
  2585. (sha256
  2586. (base32
  2587. "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
  2588. (build-system gnu-build-system)
  2589. (inputs
  2590. `(("perl" ,perl)
  2591. ("iptables" ,iptables)))
  2592. (synopsis "Ethernet bridge frame table administration")
  2593. (home-page "https://ebtables.netfilter.org/")
  2594. (description
  2595. "ebtables is an application program used to set up and maintain the
  2596. tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
  2597. analogous to the iptables application, but less complicated, due to the fact
  2598. that the Ethernet protocol is much simpler than the IP protocol.")
  2599. (license license:gpl2+)))
  2600. (define-public iproute
  2601. (package
  2602. (name "iproute2")
  2603. (version "5.13.0")
  2604. (source (origin
  2605. (method url-fetch)
  2606. (uri (string-append
  2607. "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
  2608. version ".tar.xz"))
  2609. (sha256
  2610. (base32
  2611. "0dhvdybfm33q9lz73sfnc24pxy2r42xywzb1gdgydjfafhvyb8kj"))))
  2612. (build-system gnu-build-system)
  2613. (arguments
  2614. `( ;; There is a test suite, but it wants network namespaces and sudo.
  2615. #:tests? #f
  2616. #:make-flags (let ((out (assoc-ref %outputs "out")))
  2617. (list "DESTDIR="
  2618. (string-append "CC=" ,(cc-for-target))
  2619. "HOSTCC=gcc"
  2620. (string-append "BASH_COMPDIR=" out
  2621. "/etc/bash_completion.d")
  2622. (string-append "LIBDIR=" out "/lib")
  2623. (string-append "HDRDIR=" out "/include")
  2624. (string-append "SBINDIR=" out "/sbin")
  2625. (string-append "CONFDIR=" out "/etc")
  2626. (string-append "DOCDIR=" out "/share/doc/"
  2627. ,name "-" ,version)
  2628. (string-append "MANDIR=" out "/share/man")))
  2629. #:phases (modify-phases %standard-phases
  2630. (add-before 'install 'pre-install
  2631. (lambda _
  2632. ;; Don't attempt to create /var/lib/arpd.
  2633. (substitute* "Makefile"
  2634. (("^.*ARPDDIR.*$") ""))
  2635. #t))
  2636. (add-after 'unpack 'patch-configure
  2637. (lambda _
  2638. (let ((target ,(%current-target-system)))
  2639. (substitute* "configure"
  2640. (("pkg-config")
  2641. (if target
  2642. (string-append target "-pkg-config")
  2643. "pkg-config")))
  2644. #t))))))
  2645. (inputs
  2646. `(("db4" ,bdb)
  2647. ("iptables" ,iptables)
  2648. ("libmnl" ,libmnl)))
  2649. (native-inputs
  2650. `(("bison" ,bison)
  2651. ("flex" ,flex)
  2652. ("pkg-config" ,pkg-config)))
  2653. ;; For tests.
  2654. ;; ("libmnl" ,libmnl)
  2655. ;; ("util-linux" ,util-linux)
  2656. (home-page
  2657. "https://wiki.linuxfoundation.org/networking/iproute2")
  2658. (synopsis
  2659. "Utilities for controlling TCP/IP networking and traffic in Linux")
  2660. (description
  2661. "Iproute2 is a collection of utilities for controlling TCP/IP networking
  2662. and traffic with the Linux kernel. The most important of these are
  2663. @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
  2664. control.
  2665. Most network configuration manuals still refer to ifconfig and route as the
  2666. primary network configuration tools, but ifconfig is known to behave
  2667. inadequately in modern network environments, and both should be deprecated.")
  2668. (license license:gpl2+)))
  2669. (define-public net-tools
  2670. ;; XXX: This package is basically unmaintained, but it provides a few
  2671. ;; commands not yet provided by Inetutils, such as 'route', so we have to
  2672. ;; live with it.
  2673. (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
  2674. (revision "0"))
  2675. (package
  2676. (name "net-tools")
  2677. (version (string-append "1.60-" revision "." (string-take commit 7)))
  2678. (source (origin
  2679. (method url-fetch)
  2680. (uri (string-append "https://sourceforge.net/code-snapshots/git/"
  2681. "n/ne/net-tools/code.git/net-tools-code-"
  2682. commit ".zip"))
  2683. (file-name (string-append name "-" version ".zip"))
  2684. (sha256
  2685. (base32
  2686. "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
  2687. (home-page "http://net-tools.sourceforge.net/")
  2688. (build-system gnu-build-system)
  2689. (arguments
  2690. `(#:modules ((guix build gnu-build-system)
  2691. (guix build utils)
  2692. (srfi srfi-1)
  2693. (srfi srfi-26))
  2694. #:phases
  2695. (modify-phases %standard-phases
  2696. (replace 'configure
  2697. (lambda* (#:key outputs #:allow-other-keys)
  2698. (let ((out (assoc-ref outputs "out")))
  2699. (mkdir-p (string-append out "/bin"))
  2700. (mkdir-p (string-append out "/sbin"))
  2701. ;; Pretend we have everything...
  2702. (system "yes | make config")
  2703. ;; ... except for the things we don't have.
  2704. ;; HAVE_AFDECnet requires libdnet, which we don't have.
  2705. ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
  2706. ;; that have been removed.
  2707. ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
  2708. ;; think about adding them later.
  2709. (substitute* '("config.make" "config.h")
  2710. (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
  2711. ""))
  2712. #t)))
  2713. (add-after 'install 'remove-redundant-commands
  2714. (lambda* (#:key outputs #:allow-other-keys)
  2715. ;; Remove commands and man pages redundant with Inetutils.
  2716. (let* ((out (assoc-ref outputs "out"))
  2717. (dup (append-map (cut find-files out <>)
  2718. '("^hostname"
  2719. "^(yp|nis|dns)?domainname"))))
  2720. (for-each delete-file dup)
  2721. #t))))
  2722. ;; Binaries that depend on libnet-tools.a don't declare that
  2723. ;; dependency, making it parallel-unsafe.
  2724. #:parallel-build? #f
  2725. #:tests? #f ; no test suite
  2726. #:make-flags (let ((out (assoc-ref %outputs "out")))
  2727. (list ,(string-append "CC=" (cc-for-target))
  2728. (string-append "BASEDIR=" out)
  2729. (string-append "INSTALLNLSDIR=" out "/share/locale")
  2730. (string-append "mandir=/share/man")))))
  2731. (native-inputs `(("gettext" ,gettext-minimal)
  2732. ("unzip" ,unzip)))
  2733. (supported-systems (delete "i586-gnu" %supported-systems))
  2734. (synopsis "Tools for controlling the network subsystem in Linux")
  2735. (description
  2736. "This package includes the important tools for controlling the network
  2737. subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
  2738. route. Additionally, this package contains utilities relating to particular
  2739. network hardware types (plipconfig, slattach) and advanced aspects of IP
  2740. configuration (iptunnel, ipmaddr).")
  2741. (license license:gpl2+))))
  2742. (define-public libcap
  2743. (package
  2744. (name "libcap")
  2745. (version "2.51")
  2746. (source (origin
  2747. (method url-fetch)
  2748. (uri (string-append
  2749. "mirror://kernel.org/linux/libs/security/linux-privs/"
  2750. "libcap2/libcap-" version ".tar.xz"))
  2751. (sha256
  2752. (base32
  2753. "1ych13qc1mvzv8iscbims5b317vxcmy5ffpmfy98zk7bgamz62b6"))))
  2754. (build-system gnu-build-system)
  2755. (arguments `(#:phases
  2756. ,#~(modify-phases %standard-phases
  2757. (replace 'configure
  2758. ;; Add $libdir to the RUNPATH of executables.
  2759. (lambda _
  2760. (substitute* "Make.Rules"
  2761. (("LDFLAGS \\?= #-g")
  2762. (string-append "LDFLAGS ?= -Wl,-rpath="
  2763. ;; TODO(core-updates): Use #$output
  2764. ;; unconditionally.
  2765. #$(if (%current-target-system)
  2766. #~#$output
  2767. '%output)
  2768. "/lib"))))))
  2769. #:test-target "test"
  2770. #:make-flags
  2771. (list "lib=lib"
  2772. (string-append "prefix=" (assoc-ref %outputs "out"))
  2773. "RAISE_SETFCAP=no"
  2774. ;; Tell the makefile to use TARGET-gcc and friends
  2775. ;; when cross-compiling.
  2776. ,@(if (%current-target-system)
  2777. `(,(string-append "CROSS_COMPILE="
  2778. (%current-target-system) "-")
  2779. "BUILD_CC=gcc")
  2780. '()))))
  2781. (native-inputs `(("perl" ,perl)))
  2782. (supported-systems (delete "i586-gnu" %supported-systems))
  2783. (home-page "https://sites.google.com/site/fullycapable/")
  2784. (synopsis "Library for working with POSIX capabilities")
  2785. (description
  2786. "Libcap2 provides a programming interface to POSIX capabilities on
  2787. Linux-based operating systems.")
  2788. ;; License is BSD-3 or GPLv2, at the user's choice.
  2789. (license license:gpl2)))
  2790. (define-public bridge-utils
  2791. (package
  2792. (name "bridge-utils")
  2793. (version "1.7.1")
  2794. (source
  2795. (origin
  2796. (method url-fetch)
  2797. (uri (string-append "mirror://kernel.org/linux/utils/net/"
  2798. "bridge-utils/bridge-utils-" version ".tar.xz"))
  2799. (sha256
  2800. (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
  2801. (build-system gnu-build-system)
  2802. ;; The tarball lacks all the generated files.
  2803. (native-inputs `(("autoconf" ,autoconf)
  2804. ("automake" ,automake)))
  2805. (arguments
  2806. '(#:tests? #f)) ; no 'check' target
  2807. (home-page "https://wiki.linuxfoundation.org/networking/bridge")
  2808. (synopsis "Manipulate Ethernet bridges")
  2809. (description
  2810. "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
  2811. to connect two Ethernet segments together in a protocol independent way.
  2812. Packets are forwarded based on Ethernet address, rather than IP address (like
  2813. a router). Since forwarding is done at Layer 2, all protocols can go
  2814. transparently through a bridge.")
  2815. (license license:gpl2+)))
  2816. (define-public libnl
  2817. (package
  2818. (name "libnl")
  2819. (version "3.5.0")
  2820. (source (origin
  2821. (method url-fetch)
  2822. (uri (string-append
  2823. "https://github.com/thom311/libnl/releases/download/"
  2824. "libnl" (string-join (string-split version #\.) "_")
  2825. "/libnl-" version ".tar.gz"))
  2826. (sha256
  2827. (base32
  2828. "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
  2829. (build-system gnu-build-system)
  2830. (native-inputs
  2831. `(("bison" ,bison)
  2832. ("flex" ,flex)
  2833. ("pkg-config" ,pkg-config)
  2834. ("swig" ,swig)
  2835. ("libnl3-doc"
  2836. ,(origin
  2837. (method url-fetch)
  2838. (uri (string-append
  2839. "https://github.com/thom311/libnl/releases/download/libnl"
  2840. (string-join (string-split version #\.) "_")
  2841. "/libnl-doc-" version ".tar.gz"))
  2842. (sha256
  2843. (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
  2844. (outputs `("out" "doc"))
  2845. (arguments
  2846. `(#:phases
  2847. (modify-phases %standard-phases
  2848. (add-after 'install 'install-doc
  2849. (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
  2850. (let ((dest (string-append (assoc-ref outputs "doc")
  2851. "/share/doc/libnl")))
  2852. (mkdir-p dest)
  2853. (invoke "tar" "xf" (assoc-ref
  2854. (or native-inputs inputs)
  2855. "libnl3-doc")
  2856. "--strip-components=1" "-C" dest)))))))
  2857. (home-page "https://www.infradead.org/~tgr/libnl/")
  2858. (synopsis "NetLink protocol library suite")
  2859. (description
  2860. "The libnl suite is a collection of libraries providing APIs to netlink
  2861. protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
  2862. between the kernel and user space processes. It was designed to be a more
  2863. flexible successor to ioctl to provide mainly networking related kernel
  2864. configuration and monitoring interfaces.")
  2865. ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
  2866. ;; 'nl-addr-add.c'), so the result is GPLv2-only.
  2867. (license license:gpl2)))
  2868. ;; libnl python extensions used to be outputs of libnl. However, as
  2869. ;; cross-compiling python extensions is currently broken, create separate
  2870. ;; packages for libnl python extensions.
  2871. (define (libnl-python-package python)
  2872. (let ((name (string-append "libnl-" python)))
  2873. (package
  2874. (inherit libnl)
  2875. (name name)
  2876. (inputs `(,@(cond
  2877. ((string=? python "python2")
  2878. `(("python-2" ,python-2)))
  2879. ((string=? python "python3")
  2880. `(("python-3" ,python-3))))))
  2881. (propagated-inputs `(("libnl" ,libnl)))
  2882. (outputs '("out"))
  2883. (arguments
  2884. `(#:modules ((guix build gnu-build-system)
  2885. (guix build utils)
  2886. (srfi srfi-1))
  2887. #:phases
  2888. (modify-phases %standard-phases
  2889. (replace 'install
  2890. (lambda* (#:key inputs outputs #:allow-other-keys)
  2891. (define (python-inst python)
  2892. (invoke python "setup.py" "build")
  2893. (invoke python "setup.py" "install"
  2894. (string-append "--prefix="
  2895. (assoc-ref %outputs "out")))
  2896. (invoke python "setup.py" "clean"))
  2897. (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
  2898. (assoc-ref inputs "libnl")))
  2899. (with-directory-excursion "./python" (python-inst ,python))
  2900. #t))))))))
  2901. (define-public libnl-python2 (libnl-python-package "python2"))
  2902. (define-public libnl-python3 (libnl-python-package "python3"))
  2903. (define-public iw
  2904. (package
  2905. (name "iw")
  2906. (version "4.14")
  2907. (source (origin
  2908. (method url-fetch)
  2909. (uri (string-append
  2910. "mirror://kernel.org/software/network/iw/iw-"
  2911. version ".tar.xz"))
  2912. (sha256
  2913. (base32
  2914. "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
  2915. (build-system gnu-build-system)
  2916. (native-inputs `(("pkg-config" ,pkg-config)))
  2917. (inputs `(("libnl" ,libnl)))
  2918. (arguments
  2919. `(#:make-flags
  2920. (let* ((target ,(%current-target-system))
  2921. (pkg-config (if target
  2922. (string-append target "-pkg-config")
  2923. "pkg-config")))
  2924. (list
  2925. ,(string-append "CC=" (cc-for-target))
  2926. (string-append "PKG_CONFIG="
  2927. (assoc-ref %build-inputs "pkg-config")
  2928. "/bin/" pkg-config)
  2929. (string-append "PREFIX=" (assoc-ref %outputs "out"))))
  2930. #:phases (modify-phases %standard-phases (delete 'configure))))
  2931. (home-page "https://wireless.wiki.kernel.org/")
  2932. (synopsis "Tool for configuring wireless devices")
  2933. (description
  2934. "iw is a new nl80211 based CLI configuration utility for wireless
  2935. devices. It replaces @code{iwconfig}, which is deprecated.")
  2936. (license license:isc)))
  2937. (define-public powertop
  2938. (package
  2939. (name "powertop")
  2940. (version "2.14")
  2941. (source
  2942. (origin
  2943. (method git-fetch)
  2944. (uri (git-reference
  2945. (url "https://github.com/fenrus75/powertop")
  2946. (commit (string-append "v" version))))
  2947. (file-name (git-file-name name version))
  2948. (sha256
  2949. (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
  2950. (build-system gnu-build-system)
  2951. (arguments
  2952. '(#:configure-flags
  2953. (list "LDFLAGS=-pthread")
  2954. #:phases
  2955. (modify-phases %standard-phases
  2956. ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
  2957. ;; allow calibrating the network interface in Guix System.
  2958. (add-after 'unpack 'patch-absolute-file-names
  2959. (lambda* (#:key inputs #:allow-other-keys)
  2960. (let ((kmod (assoc-ref inputs "kmod")))
  2961. (substitute* (find-files "src" "\\.cpp$")
  2962. ;; Give the right 'modprobe' file name so that essential
  2963. ;; modules such as msr.ko can be loaded.
  2964. (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
  2965. ;; These programs are only needed to calibrate, so using
  2966. ;; relative file names avoids adding extra inputs. When they
  2967. ;; are missing powertop gracefully handles it.
  2968. (("/usr/bin/hcitool") "hcitool")
  2969. (("/usr/bin/xset") "xset")
  2970. (("/usr/sbin/hciconfig") "hciconfig"))
  2971. #t))))))
  2972. (inputs
  2973. `(("kmod" ,kmod)
  2974. ("libnl" ,libnl)
  2975. ("ncurses" ,ncurses)
  2976. ("pciutils" ,pciutils)
  2977. ("zlib" ,zlib)))
  2978. (native-inputs
  2979. `(("autoconf" ,autoconf)
  2980. ("automake" ,automake)
  2981. ("gettext" ,gettext-minimal)
  2982. ("libtool" ,libtool)
  2983. ("pkg-config" ,pkg-config)))
  2984. (home-page "https://01.org/powertop/")
  2985. (synopsis "Analyze power consumption on Intel-based laptops")
  2986. (description
  2987. "PowerTOP is a Linux tool to diagnose issues with power consumption and
  2988. power management. In addition to being a diagnostic tool, PowerTOP also has
  2989. an interactive mode where the user can experiment various power management
  2990. settings for cases where the operating system has not enabled these
  2991. settings.")
  2992. (license license:gpl2)))
  2993. (define-public aumix
  2994. (package
  2995. (name "aumix")
  2996. (version "2.9.1")
  2997. (source (origin
  2998. (method url-fetch)
  2999. (uri (string-append
  3000. "http://www.jpj.net/~trevor/aumix/releases/aumix-"
  3001. version ".tar.bz2"))
  3002. (sha256
  3003. (base32
  3004. "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
  3005. (build-system gnu-build-system)
  3006. (arguments
  3007. ;; Allow compilation with GCC 10.
  3008. '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
  3009. (inputs `(("ncurses" ,ncurses)))
  3010. (home-page "http://www.jpj.net/~trevor/aumix.html")
  3011. (synopsis "Audio mixer for X and the console")
  3012. (description
  3013. "Aumix adjusts an audio mixer from X, the console, a terminal,
  3014. the command line or a script.")
  3015. (license license:gpl2+)))
  3016. (define-public iotop
  3017. (package
  3018. (name "iotop")
  3019. (version "0.6")
  3020. (source
  3021. (origin
  3022. (method url-fetch)
  3023. (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
  3024. version ".tar.gz"))
  3025. (sha256 (base32
  3026. "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
  3027. (build-system python-build-system)
  3028. (arguments
  3029. '(#:phases
  3030. (modify-phases %standard-phases
  3031. (add-after 'unpack 'fix-build-with-python3
  3032. (lambda _
  3033. (substitute* "setup.py"
  3034. (("itervalues") "values"))
  3035. #t)))
  3036. ;; There are currently no checks in the package.
  3037. #:tests? #f))
  3038. (native-inputs `(("python" ,python)))
  3039. (home-page "http://guichaz.free.fr/iotop/")
  3040. (synopsis
  3041. "Displays the IO activity of running processes")
  3042. (description
  3043. "Iotop is a Python program with a top like user interface to show the
  3044. processes currently causing I/O.")
  3045. (license license:gpl2+)))
  3046. (define-public fuse
  3047. (package
  3048. (name "fuse")
  3049. (version "2.9.9")
  3050. (source (origin
  3051. (method url-fetch)
  3052. (uri (string-append "https://github.com/libfuse/libfuse/releases/"
  3053. "download/fuse-" version
  3054. "/fuse-" version ".tar.gz"))
  3055. (sha256
  3056. (base32
  3057. "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
  3058. (patches (search-patches "fuse-overlapping-headers.patch"))))
  3059. (build-system gnu-build-system)
  3060. (inputs
  3061. `(("bash-minimal" ,bash-minimal)
  3062. ("util-linux" ,util-linux)))
  3063. (arguments
  3064. '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
  3065. (assoc-ref %outputs "out")
  3066. "/sbin")
  3067. (string-append "INIT_D_PATH="
  3068. (assoc-ref %outputs "out")
  3069. "/etc/init.d")
  3070. ;; The rule makes /dev/fuse 666.
  3071. (string-append "UDEV_RULES_PATH="
  3072. (assoc-ref %outputs "out")
  3073. "/lib/udev/rules.d"))
  3074. #:phases
  3075. (modify-phases %standard-phases
  3076. (add-before 'build 'set-file-names
  3077. (lambda* (#:key inputs #:allow-other-keys)
  3078. ;; libfuse calls out to mount(8) and umount(8). Make sure
  3079. ;; it refers to the right ones.
  3080. (substitute* '("lib/mount_util.c" "util/mount_util.c")
  3081. (("/bin/(u?)mount" _ maybe-u)
  3082. (search-input-file inputs
  3083. (string-append "bin/"
  3084. maybe-u "mount"))))
  3085. (substitute* '("util/mount.fuse.c")
  3086. (("/bin/sh")
  3087. (search-input-file inputs "/bin/sh")))
  3088. ;; This hack leads libfuse to search for 'fusermount' in
  3089. ;; $PATH, where it may find a setuid-root binary, instead of
  3090. ;; trying solely $out/sbin/fusermount and failing because
  3091. ;; it's not setuid.
  3092. (substitute* "lib/Makefile"
  3093. (("-DFUSERMOUNT_DIR=[[:graph:]]+")
  3094. "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))
  3095. (supported-systems (delete "i586-gnu" %supported-systems))
  3096. (home-page "https://github.com/libfuse/libfuse")
  3097. (synopsis "Support file systems implemented in user space")
  3098. (description
  3099. "As a consequence of its monolithic design, file system code for Linux
  3100. normally goes into the kernel itself---which is not only a robustness issue,
  3101. but also an impediment to system extensibility. FUSE, for \"file systems in
  3102. user space\", is a kernel module and user-space library that tries to address
  3103. part of this problem by allowing users to run file system implementations as
  3104. user-space processes.")
  3105. (license (list license:lgpl2.1 ;library
  3106. license:gpl2+)))) ;command-line utilities
  3107. (define-public fuse-3
  3108. (package
  3109. (inherit fuse)
  3110. (name "fuse")
  3111. (version "3.10.5")
  3112. (source (origin
  3113. (method url-fetch)
  3114. (uri
  3115. (string-append "https://github.com/libfuse/libfuse/releases/"
  3116. "download/fuse-" version
  3117. "/fuse-" version ".tar.xz"))
  3118. (sha256
  3119. (base32
  3120. "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
  3121. (build-system meson-build-system)
  3122. (arguments
  3123. `(#:configure-flags
  3124. ,#~(list
  3125. (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
  3126. "-Duseroot=false")
  3127. #:tests? #f
  3128. #:phases
  3129. ,#~(modify-phases %standard-phases
  3130. (add-after 'unpack 'set-file-names
  3131. (lambda* (#:key inputs #:allow-other-keys)
  3132. ;; libfuse calls out to mount(8) and umount(8). Make sure
  3133. ;; it refers to the right ones.
  3134. (substitute* '("lib/mount_util.c")
  3135. (("/bin/(u?)mount" _ maybe-u)
  3136. (search-input-file inputs
  3137. (string-append "bin/"
  3138. maybe-u "mount"))))
  3139. (substitute* '("util/mount.fuse.c")
  3140. (("/bin/sh")
  3141. (search-input-file inputs "/bin/sh")))
  3142. ;; This hack leads libfuse to search for 'fusermount' in
  3143. ;; $PATH, where it may find a setuid-root binary, instead of
  3144. ;; trying solely $out/sbin/fusermount and failing because
  3145. ;; it's not setuid.
  3146. (substitute* "lib/meson.build"
  3147. (("-DFUSERMOUNT_DIR=[[:graph:]]+")
  3148. "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
  3149. (add-after 'unpack 'fix-install
  3150. (lambda* (#:key inputs #:allow-other-keys)
  3151. (substitute* '("util/meson.build")
  3152. (("install_helper.sh") "true"))
  3153. (substitute* '("util/meson.build")
  3154. (("fuseconf_path = .*")
  3155. "fuseconf_path = '/etc/fuse.conf'"))))
  3156. (add-before 'configure 'set-paths
  3157. (lambda* (#:key inputs outputs #:allow-other-keys)
  3158. (let ((dummy-init.d
  3159. (string-append (getcwd) "/etc/init.d")))
  3160. (setenv "MOUNT_FUSE_PATH"
  3161. (string-append #$output "/sbin"))
  3162. (setenv "UDEV_RULES_PATH"
  3163. (string-append #$output
  3164. "/lib/udev/rules.d"))))))))))
  3165. (define-public unionfs-fuse
  3166. (package
  3167. (name "unionfs-fuse")
  3168. (version "2.2")
  3169. (source (origin
  3170. (method git-fetch)
  3171. (uri (git-reference
  3172. (url "https://github.com/rpodgorny/unionfs-fuse")
  3173. (commit (string-append "v" version))))
  3174. (file-name (git-file-name name version))
  3175. (sha256
  3176. (base32
  3177. "1yigh8z1q6iq6yjyq7kl7vpbpjnxjld32apvjaw2bl44pqqg56hh"))))
  3178. (build-system cmake-build-system)
  3179. (native-inputs
  3180. `(("python" ,python)))
  3181. (inputs `(("fuse" ,fuse)))
  3182. (arguments
  3183. ;; The tests were never actually run ("collected 0 items"), but in recent
  3184. ;; versions of pytest that causes an error.
  3185. '(#:tests? #f))
  3186. (home-page "https://github.com/rpodgorny/unionfs-fuse")
  3187. (synopsis "User-space union file system")
  3188. (description
  3189. "UnionFS-FUSE is a flexible union file system implementation in user
  3190. space, using the FUSE library. Mounting a union file system allows you to
  3191. \"aggregate\" the contents of several directories into a single mount point.
  3192. UnionFS-FUSE additionally supports copy-on-write.")
  3193. (license license:bsd-3)))
  3194. (define fuse-static
  3195. (package (inherit fuse)
  3196. (name "fuse-static")
  3197. (source (origin (inherit (package-source fuse))
  3198. (modules '((guix build utils)))
  3199. (snippet
  3200. '(begin
  3201. ;; Normally libfuse invokes mount(8) so that /etc/mtab is
  3202. ;; updated. Change calls to 'mtab_needs_update' to 0 so
  3203. ;; that it doesn't do that, allowing us to remove the
  3204. ;; dependency on util-linux (something that is useful in
  3205. ;; initrds.)
  3206. (substitute* '("lib/mount_util.c"
  3207. "util/mount_util.c")
  3208. (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
  3209. "0")
  3210. (("/bin/")
  3211. ""))
  3212. #t))))))
  3213. (define-public unionfs-fuse/static
  3214. (package (inherit unionfs-fuse)
  3215. (synopsis "User-space union file system (statically linked)")
  3216. (name (string-append (package-name unionfs-fuse) "-static"))
  3217. (source (origin (inherit (package-source unionfs-fuse))
  3218. (modules '((guix build utils)))
  3219. (snippet
  3220. '(begin
  3221. ;; Add -ldl to the libraries, because libfuse.a needs that.
  3222. (substitute* "src/CMakeLists.txt"
  3223. (("target_link_libraries(.*)\\)" _ libs)
  3224. (string-append "target_link_libraries"
  3225. libs " dl)")))
  3226. #t))))
  3227. (arguments
  3228. '(#:tests? #f
  3229. #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
  3230. #:phases
  3231. (modify-phases %standard-phases
  3232. (add-after 'install 'post-install
  3233. (lambda* (#:key outputs #:allow-other-keys)
  3234. (let* ((out (assoc-ref outputs "out"))
  3235. (exe (string-append out "/bin/unionfs")))
  3236. ;; By default, 'unionfs' keeps references to
  3237. ;; $glibc/share/locale and similar stuff. Remove them.
  3238. (remove-store-references exe)
  3239. ;; 'unionfsctl' has references to glibc as well. Since
  3240. ;; we don't need it, remove it.
  3241. (delete-file (string-append out "/bin/unionfsctl"))
  3242. #t))))))
  3243. (inputs `(("fuse" ,fuse-static)))))
  3244. (define-public sshfs
  3245. (package
  3246. (name "sshfs")
  3247. (version "2.10")
  3248. (source (origin
  3249. (method url-fetch)
  3250. (uri (string-append "https://github.com/libfuse/sshfs/releases/"
  3251. "download/sshfs-" version "/sshfs-" version
  3252. ".tar.gz"))
  3253. (sha256
  3254. (base32
  3255. "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
  3256. (build-system gnu-build-system)
  3257. (inputs
  3258. `(("fuse" ,fuse)
  3259. ("glib" ,glib)))
  3260. (native-inputs
  3261. `(("pkg-config" ,pkg-config)))
  3262. (home-page "https://github.com/libfuse/sshfs")
  3263. (synopsis "Mount remote file systems over SSH")
  3264. (description
  3265. "This is a file system client based on the SSH File Transfer Protocol.
  3266. Since most SSH servers already support this protocol it is very easy to set
  3267. up: on the server side there's nothing to do; on the client side mounting the
  3268. file system is as easy as logging into the server with an SSH client.")
  3269. (license license:gpl2+)))
  3270. (define-public sshfs-fuse
  3271. (package (inherit sshfs)
  3272. (name "sshfs-fuse")
  3273. (properties `((superseded . ,sshfs)))))
  3274. (define-public archivemount
  3275. (package
  3276. (name "archivemount")
  3277. (version "0.9.1")
  3278. (source
  3279. (origin
  3280. (method url-fetch)
  3281. (uri (string-append "https://www.cybernoia.de/software/archivemount/"
  3282. "archivemount-" version ".tar.gz"))
  3283. (sha256
  3284. (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
  3285. (build-system gnu-build-system)
  3286. (inputs `(("fuse" ,fuse)
  3287. ("libarchive" ,libarchive)))
  3288. (native-inputs `(("pkg-config" ,pkg-config)))
  3289. (home-page "https://www.cybernoia.de/software/archivemount.html")
  3290. (synopsis "Tool for mounting archive files with FUSE")
  3291. (description "archivemount is a FUSE-based file system for Unix variants,
  3292. including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
  3293. mount point where it can be read from or written to as with any other file
  3294. system. This makes accessing the contents of the archive, which may be
  3295. compressed, transparent to other programs, without decompressing them.")
  3296. (license license:lgpl2.0+)))
  3297. (define-public numactl
  3298. (package
  3299. (name "numactl")
  3300. (version "2.0.14")
  3301. (source (origin
  3302. (method url-fetch)
  3303. (uri (string-append
  3304. "https://github.com/numactl/numactl/releases/download/v"
  3305. version "/numactl-" version ".tar.gz"))
  3306. (sha256
  3307. (base32
  3308. "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
  3309. (build-system gnu-build-system)
  3310. (arguments
  3311. '(;; There's a 'test' target, but it requires NUMA support in the kernel
  3312. ;; to run, which we can't assume to have.
  3313. #:tests? #f))
  3314. ;; NUMA is apparently not supported on armhf, see
  3315. ;; http://www.spinics.net/lists/linux-numa/msg01157.html
  3316. (supported-systems (delete "armhf-linux" %supported-systems))
  3317. (home-page "https://github.com/numactl/numactl")
  3318. (synopsis "Tools for non-uniform memory access (NUMA) machines")
  3319. (description
  3320. "NUMA stands for Non-Uniform Memory Access, in other words a system whose
  3321. memory is not all in one place. The @command{numactl} program allows you to
  3322. run your application program on specific CPUs and memory nodes. It does this
  3323. by supplying a NUMA memory policy to the operating system before running your
  3324. program.
  3325. The package contains other commands, such as @command{numastat},
  3326. @command{memhog}, and @command{numademo} which provides a quick overview of
  3327. NUMA performance on your system.")
  3328. (license (list license:gpl2 ;programs
  3329. license:lgpl2.1)))) ;library
  3330. (define-public kbd-neo
  3331. (package
  3332. (name "kbd-neo")
  3333. (version "2486")
  3334. (source
  3335. (origin
  3336. (method url-fetch)
  3337. (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
  3338. version "/linux/console/neo.map"))
  3339. (file-name (string-append name "-" version ".map"))
  3340. (sha256
  3341. (base32
  3342. "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
  3343. (build-system trivial-build-system)
  3344. (arguments
  3345. `(#:modules ((guix build utils))
  3346. #:builder (begin
  3347. (use-modules (guix build utils))
  3348. (let ((out (string-append %output "/share/keymaps"))
  3349. (source (assoc-ref %build-inputs "source")))
  3350. (mkdir-p out)
  3351. (copy-file source (string-append out "/neo.map"))
  3352. #t))))
  3353. (home-page "https://neo-layout.org")
  3354. (synopsis "Neo2 console layout")
  3355. (description
  3356. "Kbd-neo provides the Neo2 keyboard layout for use with
  3357. @command{loadkeys(1)} from @code{kbd(4)}.")
  3358. ;; The file is located in an svn directory, the entire content of
  3359. ;; the directory is licensed as GPL3.
  3360. (license license:gpl3+)))
  3361. (define-public kbd
  3362. (package
  3363. (name "kbd")
  3364. (version "2.4.0")
  3365. (source (origin
  3366. (method url-fetch)
  3367. (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
  3368. version ".tar.xz"))
  3369. (sha256
  3370. (base32
  3371. "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
  3372. (modules '((guix build utils)))
  3373. (snippet
  3374. '(begin
  3375. (substitute* '("src/unicode_start" "src/unicode_stop")
  3376. ;; Assume the Coreutils are in $PATH.
  3377. (("/usr/bin/tty")
  3378. "tty"))))))
  3379. (build-system gnu-build-system)
  3380. (arguments
  3381. '(#:phases
  3382. (modify-phases %standard-phases
  3383. (add-before 'build 'pre-build
  3384. (lambda* (#:key inputs #:allow-other-keys)
  3385. (let ((bzip2 (assoc-ref inputs "bzip2"))
  3386. (gzip (assoc-ref inputs "gzip"))
  3387. (xz (assoc-ref inputs "xz"))
  3388. (zstd (assoc-ref inputs "zstd")))
  3389. (substitute* "src/libkbdfile/kbdfile.c"
  3390. (("bzip2") (string-append bzip2 "/bin/bzip2"))
  3391. (("gzip") (string-append gzip "/bin/gzip"))
  3392. (("xz -d") (string-append xz "/bin/xz -d"))
  3393. (("zstd") (string-append zstd "/bin/zstd"))))))
  3394. (add-after 'install 'post-install
  3395. (lambda* (#:key outputs #:allow-other-keys)
  3396. ;; Make sure these programs find their comrades.
  3397. (let* ((out (assoc-ref outputs "out"))
  3398. (bin (string-append out "/bin")))
  3399. (for-each (lambda (prog)
  3400. (wrap-program (string-append bin "/" prog)
  3401. `("PATH" ":" prefix (,bin))))
  3402. '("unicode_start" "unicode_stop"))))))))
  3403. (native-inputs
  3404. `(("autoconf" ,autoconf)
  3405. ("pkg-config" ,pkg-config)))
  3406. (inputs
  3407. `(("bzip2" ,bzip2)
  3408. ("gzip" ,gzip)
  3409. ("pam" ,linux-pam)
  3410. ("xz" ,xz)
  3411. ("zstd" ,zstd)))
  3412. (native-search-paths
  3413. (list (search-path-specification
  3414. (variable "LOADKEYS_KEYMAP_PATH")
  3415. ;; Append ‘/**’ to recursively search all directories. One can then
  3416. ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
  3417. ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
  3418. (files (list "share/keymaps/**")))))
  3419. (home-page "http://kbd-project.org/")
  3420. (synopsis "Linux keyboard utilities and keyboard maps")
  3421. (description
  3422. "This package contains keytable files and keyboard utilities compatible
  3423. for systems using the Linux kernel. This includes commands such as
  3424. @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
  3425. (license license:gpl2+)))
  3426. (define-public loadkeys-static
  3427. (package
  3428. (inherit kbd)
  3429. (name "loadkeys-static")
  3430. (arguments
  3431. (substitute-keyword-arguments (package-arguments kbd)
  3432. ((#:configure-flags flags ''())
  3433. `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
  3434. "--disable-vlock" ;so we don't need libpam
  3435. "--disable-libkeymap")
  3436. ,flags))
  3437. ((#:make-flags flags ''())
  3438. `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
  3439. ((#:phases phases '%standard-phases)
  3440. `(modify-phases ,phases
  3441. (replace 'install
  3442. (lambda* (#:key outputs #:allow-other-keys)
  3443. (let ((out (assoc-ref outputs "out")))
  3444. ;; The binary keeps references to gzip, among other things,
  3445. ;; which we don't need in the initrd, so strip references.
  3446. (remove-store-references "src/loadkeys")
  3447. (install-file "src/loadkeys"
  3448. (string-append out "/bin")))))
  3449. (delete 'post-install)))
  3450. ((#:strip-flags _ '())
  3451. ''("--strip-all"))
  3452. ((#:allowed-references _ '())
  3453. '())))
  3454. (synopsis "Statically-linked @command{loadkeys} program")
  3455. ;; This package is meant to be used internally in the initrd so don't
  3456. ;; expose it.
  3457. (properties '((hidden? . #t)))))
  3458. (define-public inotify-tools
  3459. (package
  3460. (name "inotify-tools")
  3461. (version "3.20.11.0")
  3462. (source (origin
  3463. (method git-fetch)
  3464. (uri (git-reference
  3465. (url "https://github.com/rvoicilas/inotify-tools")
  3466. (commit version)))
  3467. (file-name (git-file-name name version))
  3468. (sha256
  3469. (base32
  3470. "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
  3471. (build-system gnu-build-system)
  3472. (native-inputs
  3473. `(("autoconf" ,autoconf)
  3474. ("automake" ,automake)
  3475. ("libtool" ,libtool)))
  3476. (arguments
  3477. `(#:configure-flags
  3478. (list "--disable-static")))
  3479. (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
  3480. (synopsis "Monitor file accesses")
  3481. (description
  3482. "The inotify-tools packages provides a C library and command-line tools
  3483. to use Linux' inotify mechanism, which allows file accesses to be monitored.")
  3484. (license license:gpl2+)))
  3485. (define-public kmod
  3486. (package
  3487. (name "kmod")
  3488. (version "29")
  3489. (source (origin
  3490. (method url-fetch)
  3491. (uri
  3492. (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
  3493. "kmod-" version ".tar.xz"))
  3494. (sha256
  3495. (base32
  3496. "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
  3497. (patches (search-patches "kmod-module-directory.patch"))))
  3498. (build-system gnu-build-system)
  3499. (native-inputs
  3500. `(("pkg-config" ,pkg-config)
  3501. ;; For tests.
  3502. ("zstd" ,zstd)))
  3503. (inputs
  3504. `(("xz" ,xz)
  3505. ("zlib" ,zlib)
  3506. ("zstd-lib" ,zstd "lib")))
  3507. (arguments
  3508. `(#:configure-flags '("--with-xz" "--with-zlib" "--with-zstd"
  3509. "--disable-test-modules")
  3510. #:phases
  3511. (modify-phases %standard-phases
  3512. (add-after 'unpack 'disable-tests
  3513. (lambda _
  3514. ;; XXX: These tests need '--sysconfdir=/etc' to pass.
  3515. (substitute* "Makefile.in"
  3516. (("testsuite/test-modprobe") "")
  3517. (("testsuite/test-depmod") "")
  3518. (("testsuite/test-blacklist") ""))
  3519. #t))
  3520. (add-after 'install 'install-modprobe&co
  3521. (lambda* (#:key outputs #:allow-other-keys)
  3522. (let* ((out (assoc-ref outputs "out"))
  3523. (bin (string-append out "/bin")))
  3524. (for-each (lambda (tool)
  3525. (symlink "kmod"
  3526. (string-append bin "/" tool)))
  3527. '("insmod" "rmmod" "lsmod" "modprobe"
  3528. "modinfo" "depmod"))
  3529. #t))))))
  3530. (supported-systems (delete "i586-gnu" %supported-systems))
  3531. (home-page "https://www.kernel.org/")
  3532. (synopsis "Kernel module tools")
  3533. (description "Kmod is a set of tools to handle common tasks with Linux
  3534. kernel modules like insert, remove, list, check properties, resolve
  3535. dependencies and aliases.
  3536. These tools are designed on top of libkmod, a library that is shipped with
  3537. kmod. The aim is to be compatible with tools, configurations and indices
  3538. from the module-init-tools project.")
  3539. (license license:gpl2+))) ; library under lgpl2.1+
  3540. (define-public earlyoom
  3541. (package
  3542. (name "earlyoom")
  3543. (version "1.6.2")
  3544. (source (origin
  3545. (method git-fetch)
  3546. (uri (git-reference
  3547. (url "https://github.com/rfjakob/earlyoom")
  3548. (commit (string-append "v" version))))
  3549. (file-name (git-file-name name version))
  3550. (sha256
  3551. (base32
  3552. "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))
  3553. (modules '((guix build utils)))
  3554. (snippet
  3555. '(begin
  3556. (substitute* "Makefile"
  3557. (("go test -v")
  3558. "GO111MODULE=off go test -v"))
  3559. #t))))
  3560. (build-system gnu-build-system)
  3561. (arguments
  3562. `(#:phases
  3563. (modify-phases %standard-phases
  3564. (delete 'configure) ; no configure script
  3565. (add-before 'check 'set-go-HOME
  3566. (lambda _
  3567. (setenv "HOME" (getcwd))
  3568. #t))
  3569. (add-before 'check 'disable-failing-test
  3570. (lambda _
  3571. ;; This test relies on writing to /proc/%d/oom_score_adj.
  3572. (substitute* "testsuite_cli_test.go"
  3573. (("TestI" match)
  3574. (string-append "skipped" match)))
  3575. #t)))
  3576. #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
  3577. (list ,(string-append "CC=" (cc-for-target))
  3578. (string-append "VERSION=v" ,version)
  3579. (string-append "PREFIX=" prefix)
  3580. (string-append "SYSCONFDIR=" prefix "/etc")))
  3581. #:test-target "test"))
  3582. (native-inputs `(("go" ,go) ;for the test suite
  3583. ("pandoc" ,pandoc))) ;to generate the manpage
  3584. (home-page "https://github.com/rfjakob/earlyoom")
  3585. (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
  3586. (description "Early OOM is a minimalist out of memory (OOM) daemon that
  3587. runs in user space and provides a more responsive and configurable alternative
  3588. to the in-kernel OOM killer.")
  3589. (license license:expat)))
  3590. (define-public eudev
  3591. ;; The post-systemd fork, maintained by Gentoo.
  3592. (package
  3593. (name "eudev")
  3594. (version "3.2.9")
  3595. (source (origin
  3596. (method git-fetch)
  3597. (uri (git-reference (url "https://github.com/gentoo/eudev")
  3598. (commit (string-append "v" version))))
  3599. (file-name (git-file-name name version))
  3600. (sha256
  3601. (base32
  3602. "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
  3603. (patches (search-patches "eudev-rules-directory.patch"))))
  3604. (build-system gnu-build-system)
  3605. (arguments
  3606. `(#:phases
  3607. (modify-phases %standard-phases
  3608. (add-after 'unpack 'make-source-writable
  3609. (lambda _
  3610. ;; XXX: Git checkouts are read-only, but this package needs to
  3611. ;; modify some of its files.
  3612. (for-each make-file-writable (find-files "."))
  3613. #t))
  3614. (add-before 'bootstrap 'patch-file-names
  3615. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  3616. (substitute* "man/make.sh"
  3617. (("/usr/bin/xsltproc")
  3618. (string-append (assoc-ref
  3619. (or native-inputs inputs) "xsltproc")
  3620. "/bin/xsltproc")))
  3621. #t))
  3622. (add-before 'configure 'patch-bindir-in-btrfs-rules
  3623. (lambda* (#:key outputs #:allow-other-keys)
  3624. ;; The "@bindir@" substitution incorrectly expands to a literal
  3625. ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
  3626. ;; around it.
  3627. (let ((out (assoc-ref outputs "out")))
  3628. (substitute* "rules/64-btrfs.rules.in"
  3629. (("@bindir@")
  3630. (string-append out "/bin")))
  3631. #t)))
  3632. (add-after 'install 'move-static-library
  3633. (lambda* (#:key outputs #:allow-other-keys)
  3634. (let* ((out (assoc-ref outputs "out"))
  3635. (static (assoc-ref outputs "static"))
  3636. (source (string-append out "/lib/libudev.a"))
  3637. (target (string-append static "/lib/libudev.a")))
  3638. (mkdir-p (dirname target))
  3639. (link source target)
  3640. (delete-file source)
  3641. ;; Remove reference to the static library from the .la file
  3642. ;; such that Libtool looks for it in the usual places.
  3643. (substitute* (string-append out "/lib/libudev.la")
  3644. (("old_library=.*")
  3645. "old_library=''\n"))
  3646. #t)))
  3647. (add-after 'install 'build-hwdb
  3648. (lambda* (#:key outputs #:allow-other-keys)
  3649. ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
  3650. ;; similar tools to display product names.
  3651. ;;
  3652. ;; XXX: This can't be done when cross-compiling. Find another way
  3653. ;; to generate hwdb.bin for cross-built systems.
  3654. (let ((out (assoc-ref outputs "out")))
  3655. ,@(if (%current-target-system)
  3656. '(#t)
  3657. '((invoke (string-append out "/bin/udevadm")
  3658. "hwdb" "--update")))))))
  3659. #:configure-flags (list "--enable-manpages")))
  3660. (native-inputs
  3661. `(("autoconf" ,autoconf)
  3662. ("automake" ,automake)
  3663. ("gperf" ,gperf)
  3664. ("libtool" ,libtool)
  3665. ("pkg-config" ,pkg-config)
  3666. ;; For tests.
  3667. ("perl" ,perl)
  3668. ("python" ,python-wrapper)
  3669. ;; For documentation.
  3670. ("docbook-xml" ,docbook-xml-4.2)
  3671. ("docbook-xsl" ,docbook-xsl)
  3672. ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
  3673. ("xsltproc" ,libxslt)))
  3674. (inputs
  3675. ;; When linked against libblkid, eudev can populate /dev/disk/by-label
  3676. ;; and similar; it also installs the '60-persistent-storage.rules' file,
  3677. ;; which contains the rules to do that.
  3678. `(("util-linux" ,util-linux "lib") ;for blkid
  3679. ("kmod" ,kmod)))
  3680. (outputs '("out" "static"))
  3681. (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
  3682. (synopsis "Userspace device management")
  3683. (description "Udev is a daemon which dynamically creates and removes
  3684. device nodes from /dev/, handles hotplug events and loads drivers at boot
  3685. time.")
  3686. (license license:gpl2+)))
  3687. (define-public python-evdev
  3688. (package
  3689. (name "python-evdev")
  3690. (version "1.3.0")
  3691. (source
  3692. (origin
  3693. (method url-fetch)
  3694. (uri (pypi-uri "evdev" version))
  3695. (sha256
  3696. (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
  3697. (build-system python-build-system)
  3698. (native-inputs
  3699. `(("kernel-headers" ,linux-libre-headers)))
  3700. (arguments
  3701. `(#:tests? #f ;no rule for tests
  3702. #:phases
  3703. (modify-phases %standard-phases
  3704. (add-before 'build 'fix-hard-coded-directory
  3705. (lambda* (#:key inputs #:allow-other-keys)
  3706. (substitute* "setup.py"
  3707. (("/usr/include/linux")
  3708. (string-append
  3709. (assoc-ref inputs "kernel-headers") "/include/linux")))
  3710. #t)))))
  3711. (home-page "https://github.com/gvalkov/python-evdev")
  3712. (synopsis "Bindings to the Linux input handling subsystem")
  3713. (description
  3714. "Python-evdev provides bindings to the generic input event interface in
  3715. Linux. The @code{evdev} interface serves the purpose of passing events
  3716. generated in the kernel directly to userspace through character devices that
  3717. are typically located in @file{/dev/input/}.
  3718. This package also comes with bindings to @code{uinput}, the userspace input
  3719. subsystem. @code{uinput} allows userspace programs to create and handle input
  3720. devices that can inject events directly into the input subsystem.")
  3721. (license license:bsd-3)))
  3722. (define-public interception-tools
  3723. (package
  3724. (name "interception-tools")
  3725. (version "0.6.7")
  3726. (home-page "https://gitlab.com/interception/linux/tools")
  3727. (source (origin
  3728. (method git-fetch)
  3729. (uri (git-reference
  3730. (url home-page)
  3731. (commit (string-append "v" version))))
  3732. (file-name (git-file-name name version))
  3733. (sha256
  3734. (base32
  3735. "0wcmppa7092b33wb8vc782day5phf90pc25cn1x7rk0rlw565z36"))))
  3736. (build-system cmake-build-system)
  3737. (native-inputs
  3738. `(("pkg-config" ,pkg-config)))
  3739. (inputs
  3740. `(("boost" ,boost)
  3741. ("libevdev" ,libevdev)
  3742. ("libudev" ,eudev)
  3743. ("yaml-cpp" ,yaml-cpp)))
  3744. (arguments
  3745. `(#:tests? #f)) ; no test suite
  3746. (synopsis "Utilities for operating on input events of evdev devices")
  3747. (description
  3748. "Interception Tools provides a composable infrastructure on top of
  3749. @code{libudev} and @code{libevdev}. The following utilities are provided:
  3750. @itemize
  3751. @item @command{udevmon} --- monitor input devices for launching tasks
  3752. @item @command{intercept} --- redirect device input events to stdout
  3753. @item @command{uinput} --- redirect device input events from stding to virtual device
  3754. @item @command{mux} --- mux streams of input events
  3755. @end itemize")
  3756. ;; Dual-licensed under GPLv3+ or "something else" on request, per
  3757. ;; 'README.md'.
  3758. (license license:gpl3+)))
  3759. (define-public interception-dual-function-keys
  3760. (package
  3761. (name "interception-dual-function-keys")
  3762. (version "1.4.0")
  3763. (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
  3764. (source (origin
  3765. (method git-fetch)
  3766. (uri (git-reference
  3767. (url home-page)
  3768. (commit version)))
  3769. (file-name (git-file-name name version))
  3770. (sha256
  3771. (base32
  3772. "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
  3773. (build-system gnu-build-system)
  3774. (inputs
  3775. `(("libevdev" ,libevdev)
  3776. ("yaml-cpp" ,yaml-cpp)))
  3777. (arguments
  3778. `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
  3779. ,(string-append "CXX=" (cxx-for-target))
  3780. (string-append "PREFIX=" %output))
  3781. #:phases
  3782. (modify-phases %standard-phases
  3783. (add-after 'unpack 'fix-libevdev-path
  3784. (lambda* (#:key inputs #:allow-other-keys)
  3785. (let ((libevdev (assoc-ref inputs "libevdev")))
  3786. (substitute* "config.mk"
  3787. (("/usr/include/libevdev-1.0")
  3788. (string-append libevdev "/include/libevdev-1.0")))
  3789. #t)))
  3790. ;; No configure script
  3791. (delete 'configure))
  3792. ;; No tests are included.
  3793. #:tests? #f))
  3794. (synopsis "Tap for one key, hold for another")
  3795. (description
  3796. "Dual Function Keys is a plugin for @code{interception-tools} that allows
  3797. one to send arbitrary keycodes when a given key is tapped or held.")
  3798. (license license:expat)))
  3799. (define-public lvm2
  3800. (package
  3801. (name "lvm2")
  3802. (version "2.03.11")
  3803. (source (origin
  3804. (method url-fetch)
  3805. (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
  3806. version ".tgz")
  3807. (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
  3808. version ".tgz")))
  3809. (sha256
  3810. (base32
  3811. "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
  3812. (modules '((guix build utils)))
  3813. (snippet
  3814. '(begin
  3815. (use-modules (guix build utils))
  3816. ;; Honor sysconfdir.
  3817. (substitute* "make.tmpl.in"
  3818. (("^confdir = .*$")
  3819. "confdir = @sysconfdir@\n")
  3820. (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
  3821. "DEFAULT_SYS_DIR = @sysconfdir@"))
  3822. #t))
  3823. (patches (search-patches "lvm2-static-link.patch"))))
  3824. (build-system gnu-build-system)
  3825. (native-inputs
  3826. `(("pkg-config" ,pkg-config)
  3827. ("procps" ,procps))) ;tests use 'pgrep'
  3828. (inputs
  3829. `(("libaio" ,libaio)
  3830. ("udev" ,eudev)))
  3831. (arguments
  3832. `(#:phases
  3833. (modify-phases %standard-phases
  3834. (add-after 'configure 'set-makefile-shell
  3835. (lambda _
  3836. ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
  3837. ;; expected.
  3838. (setenv "SHELL" (which "sh"))
  3839. ;; Replace /bin/sh with the right file name.
  3840. (patch-makefile-SHELL "make.tmpl")
  3841. #t)))
  3842. #:configure-flags (list (string-append "--sysconfdir="
  3843. (assoc-ref %outputs "out")
  3844. "/etc/lvm")
  3845. "--enable-udev_sync"
  3846. "--enable-udev_rules"
  3847. "--enable-pkgconfig"
  3848. "--enable-cmdlib"
  3849. "--enable-dmeventd" ; Requires '--enable-cmdlib'.
  3850. ;; Make sure programs such as 'dmsetup' can
  3851. ;; find libdevmapper.so.
  3852. (string-append "LDFLAGS=-Wl,-rpath="
  3853. (assoc-ref %outputs "out")
  3854. "/lib,-rpath="
  3855. (assoc-ref %outputs "out")
  3856. "/lib/device-mapper")
  3857. ;; This is needed when cross-compiling.
  3858. ,@(if (%current-target-system)
  3859. '("ac_cv_func_malloc_0_nonnull=yes"
  3860. "ac_cv_func_realloc_0_nonnull=yes")
  3861. '()))
  3862. ;; The tests use 'mknod', which requires root access.
  3863. #:tests? #f))
  3864. (supported-systems (delete "i586-gnu" %supported-systems))
  3865. (home-page "https://sourceware.org/lvm2/")
  3866. (synopsis "Logical volume management for Linux")
  3867. (description
  3868. "LVM2 is the logical volume management tool set for Linux-based systems.
  3869. This package includes the user-space libraries and tools, including the device
  3870. mapper. Kernel components are part of Linux-libre.")
  3871. ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
  3872. ;; Command-line tools are GPLv2.
  3873. (license (list license:gpl2 license:lgpl2.1))))
  3874. (define-public lvm2-static
  3875. (package
  3876. (inherit lvm2)
  3877. (name "lvm2-static")
  3878. ;; Propagate udev because libdevmapper.a depends on libudev.
  3879. (propagated-inputs `(("udev:static" ,eudev "static")))
  3880. (arguments
  3881. (substitute-keyword-arguments (package-arguments lvm2)
  3882. ((#:configure-flags flags '())
  3883. ;; LVM2 doesn't use Libtool, hence the custom option.
  3884. `(append '("--enable-static_link")
  3885. ;; Building dmeventd statically is complicated due to a
  3886. ;; requirement on libdevmapper.a, which is being phased out
  3887. ;; in favor of libdevice-mapper.a, which in turn is is not
  3888. ;; easily made available at dmeventd build time. Just ignore
  3889. ;; it until the situation improves.
  3890. (delete "--enable-dmeventd" ,flags)))
  3891. ((#:phases phases)
  3892. `(modify-phases ,phases
  3893. (add-before 'configure 'adjust-Makefile
  3894. (lambda _
  3895. ;; These fixes are related to the upstream libdm->device_mapper
  3896. ;; migration and will hopefully be fixed upstream in due time.
  3897. (substitute* "tools/Makefile.in"
  3898. ;; This variable is empty in a static configuration and causes
  3899. ;; an erroneous GCC command line.
  3900. (("-L\\$\\(interfacebuilddir\\)") "")
  3901. ;; Remove obsolete reference to libdevmapper.a.
  3902. (("-ldevmapper") ""))
  3903. #t))))))
  3904. (synopsis "Logical volume management for Linux (statically linked)")))
  3905. (define-public thin-provisioning-tools
  3906. (package
  3907. (name "thin-provisioning-tools")
  3908. (version "0.8.5")
  3909. (source
  3910. (origin
  3911. (method git-fetch)
  3912. (uri (git-reference
  3913. (url "https://github.com/jthornber/thin-provisioning-tools")
  3914. (commit (string-append "v" version))))
  3915. (file-name (git-file-name name version))
  3916. (sha256
  3917. (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
  3918. (build-system gnu-build-system)
  3919. (arguments
  3920. ;; Doesn't build with --enable-testing due to a function name collision
  3921. ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
  3922. `(#:tests? #f))
  3923. (native-inputs
  3924. `(("automake" ,automake)
  3925. ("autoreconf" ,autoconf)))
  3926. (inputs
  3927. `(("boost" ,boost)
  3928. ("expat" ,expat)
  3929. ("libaio" ,libaio)))
  3930. (synopsis "Tools for manipulating the metadata of device-mapper targets")
  3931. (description "A suite of tools for manipulating the metadata of the
  3932. dm-thin, dm-cache and dm-era device-mapper targets.")
  3933. (home-page "https://github.com/jthornber/thin-provisioning-tools")
  3934. (license license:gpl3+)))
  3935. (define-public wireless-tools
  3936. (package
  3937. (name "wireless-tools")
  3938. (version "30.pre9")
  3939. (source (origin
  3940. (method url-fetch)
  3941. (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
  3942. version ".tar.gz"))
  3943. (sha256
  3944. (base32
  3945. "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
  3946. (snippet
  3947. '(begin
  3948. ;; Remove the older header files that are not free software.
  3949. (for-each (lambda (n)
  3950. (delete-file (format #f "wireless.~a.h" n)))
  3951. '(10 11 12 13 14 15 16 17 18 19 20))
  3952. #t))))
  3953. (build-system gnu-build-system)
  3954. (arguments
  3955. `(#:make-flags
  3956. (list (string-append "PREFIX=" %output)
  3957. (string-append "INSTALL_MAN=" %output "/share/man")
  3958. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
  3959. "BUILD_STATIC=")
  3960. #:phases
  3961. (modify-phases %standard-phases
  3962. (replace 'configure
  3963. (lambda* (#:key target #:allow-other-keys)
  3964. (when ,(%current-target-system)
  3965. ;; Cross-compilation: use the cross tools.
  3966. (substitute* (find-files "." "Makefile")
  3967. (("CC = .*$")
  3968. (string-append "CC = " target "-gcc\n"))
  3969. (("AR = .*$")
  3970. (string-append "AR = " target "-ar\n"))
  3971. (("RANLIB = .*$")
  3972. (string-append "RANLIB = " target "-ranlib\n"))))
  3973. #t)))
  3974. #:tests? #f))
  3975. (synopsis "Tools for manipulating Linux Wireless Extensions")
  3976. (description "Wireless Tools are used to manipulate the now-deprecated
  3977. Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
  3978. Extension was an interface allowing you to set Wireless LAN specific
  3979. parameters and get the specific stats. It is deprecated in favor the nl80211
  3980. interface.")
  3981. (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
  3982. ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
  3983. ;; other files are distributed under gpl2.
  3984. (license (list license:gpl2 license:lgpl2.1+))))
  3985. (define-public crda
  3986. (package
  3987. (name "crda")
  3988. (version "3.18")
  3989. (source (origin
  3990. (method url-fetch)
  3991. (uri (string-append "mirror://kernel.org/software/network/crda/"
  3992. "crda-" version ".tar.xz"))
  3993. (sha256
  3994. (base32
  3995. "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
  3996. (patches (search-patches "crda-optional-gcrypt.patch"))))
  3997. (build-system gnu-build-system)
  3998. (arguments
  3999. `(#:phases (modify-phases %standard-phases
  4000. (delete 'configure)
  4001. (add-after 'unpack 'gzip-determinism
  4002. (lambda _
  4003. (substitute* "Makefile"
  4004. (("gzip") "gzip --no-name"))
  4005. #t))
  4006. ,@(if (%current-target-system)
  4007. '((add-after
  4008. 'unpack 'fix-pkg-config
  4009. (lambda* (#:key target #:allow-other-keys)
  4010. (substitute*
  4011. "Makefile"
  4012. (("pkg-config")
  4013. (string-append target "-pkg-config")))
  4014. #t)))
  4015. '())
  4016. (add-before
  4017. 'build 'no-werror-no-ldconfig
  4018. (lambda _
  4019. (substitute* "Makefile"
  4020. (("-Werror") "")
  4021. (("ldconfig") "true"))
  4022. #t))
  4023. (add-before
  4024. 'build 'set-regulator-db-file-name
  4025. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  4026. ;; Tell CRDA where to find our database.
  4027. (let ((regdb (assoc-ref (or native-inputs inputs)
  4028. "wireless-regdb")))
  4029. (substitute* "crda.c"
  4030. (("\"/lib/crda/regulatory.bin\"")
  4031. (string-append "\"" regdb
  4032. "/lib/crda/regulatory.bin\"")))
  4033. #t))))
  4034. #:test-target "verify"
  4035. #:make-flags (let ((out (assoc-ref %outputs "out"))
  4036. (regdb (assoc-ref %build-inputs "wireless-regdb")))
  4037. (list
  4038. (string-append "CC=" ,(cc-for-target))
  4039. "V=1"
  4040. ;; Disable signature-checking on 'regulatory.bin'.
  4041. ;; The reason is that this simplifies maintenance
  4042. ;; on our side (no need to manage a distro key
  4043. ;; pair), and we can guarantee integrity of
  4044. ;; 'regulatory.bin' by other means anyway, such as
  4045. ;; 'guix gc --verify'. See
  4046. ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
  4047. ;; for a discssion.
  4048. "USE_OPENSSL=0"
  4049. (string-append "PREFIX=" out)
  4050. (string-append "SBINDIR=" out "/sbin/")
  4051. (string-append "UDEV_RULE_DIR="
  4052. out "/lib/udev/rules.d")
  4053. (string-append "LDFLAGS=-Wl,-rpath="
  4054. out "/lib -L.")
  4055. (string-append "REG_BIN=" regdb
  4056. "/lib/crda/regulatory.bin")
  4057. "all_noverify"))))
  4058. (native-inputs `(("pkg-config" ,pkg-config)
  4059. ("wireless-regdb" ,wireless-regdb)))
  4060. (inputs `(("libnl" ,libnl)))
  4061. (home-page
  4062. "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
  4063. (synopsis "Central regulatory domain agent (CRDA) for WiFi")
  4064. (description
  4065. "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
  4066. communication between the kernel Linux and user space for regulatory
  4067. compliance.")
  4068. (license license:copyleft-next)))
  4069. (define-public wireless-regdb
  4070. (package
  4071. (name "wireless-regdb")
  4072. (version "2020.11.20")
  4073. (source (origin
  4074. (method url-fetch)
  4075. (uri (string-append
  4076. "mirror://kernel.org/software/network/wireless-regdb/"
  4077. "wireless-regdb-" version ".tar.xz"))
  4078. (sha256
  4079. (base32
  4080. "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
  4081. ;; We're building 'regulatory.bin' by ourselves.
  4082. (snippet '(begin
  4083. (delete-file "regulatory.bin")
  4084. #t))))
  4085. (build-system gnu-build-system)
  4086. (arguments
  4087. '(#:phases
  4088. (modify-phases %standard-phases
  4089. (add-after 'unpack 'gzip-determinism
  4090. (lambda _
  4091. (substitute* "Makefile"
  4092. (("gzip") "gzip --no-name"))
  4093. #t))
  4094. (add-after 'unpack 'omit-signature
  4095. (lambda _
  4096. (substitute* "Makefile"
  4097. ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
  4098. ;; don't provide (see below). Disable it.
  4099. ((" regulatory\\.db\\.p7s") "")
  4100. ;; regulatory.db is built as a dependency of regulatory.db.p7s,
  4101. ;; but ‘make install’ depends only on the latter while installing
  4102. ;; both (and failing). Depend on it explicitly.
  4103. (("^install: " all) (string-append all "regulatory.db ")))
  4104. #t))
  4105. (delete 'configure)) ; no configure script
  4106. ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
  4107. ;; is computed and can be equal to 'maintainer-clean'; when that
  4108. ;; happens, we can end up deleting the 'regulatory.bin' file that we
  4109. ;; just built. Thus, build things sequentially.
  4110. #:parallel-build? #f
  4111. #:tests? #f ; no tests
  4112. #:make-flags
  4113. (let ((out (assoc-ref %outputs "out")))
  4114. (list (string-append "PREFIX=" out)
  4115. (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
  4116. ;; Leave this empty so that db2bin.py doesn't try to sign
  4117. ;; ‘regulatory.bin’. This allows us to avoid managing a key
  4118. ;; pair for the whole distribution.
  4119. (string-append "REGDB_PRIVKEY=")
  4120. ;; Don't generate a public key for the same reason. These are
  4121. ;; used as Makefile targets and can't be the empty string.
  4122. (string-append "REGDB_PUBCERT=/dev/null")
  4123. (string-append "REGDB_PUBKEY=/dev/null")))))
  4124. (native-inputs
  4125. `(("python" ,python-wrapper)))
  4126. (home-page
  4127. "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
  4128. (synopsis "Wireless regulatory database")
  4129. (description
  4130. "This package contains the wireless regulatory database for the Central
  4131. Regulatory Database Agent (CRDA). The database contains information on
  4132. country-specific regulations for the wireless spectrum.")
  4133. (license license:isc)))
  4134. (define-public lm-sensors
  4135. (package
  4136. (name "lm-sensors")
  4137. (version "3.6.0")
  4138. (source
  4139. (origin
  4140. (method git-fetch)
  4141. (uri (git-reference
  4142. (url "https://github.com/groeck/lm-sensors")
  4143. (commit (string-append "V" (string-join
  4144. (string-split version #\.) "-")))))
  4145. (file-name (git-file-name name version))
  4146. (sha256
  4147. (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
  4148. (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
  4149. (build-system gnu-build-system)
  4150. (inputs `(("rrdtool" ,rrdtool)
  4151. ("perl" ,perl)
  4152. ("kmod" ,kmod)
  4153. ("gnuplot" ,gnuplot)))
  4154. (native-inputs `(("pkg-config" ,pkg-config)
  4155. ("flex" ,flex)
  4156. ("bison" ,bison)
  4157. ("which" ,which)))
  4158. (outputs '("lib" ; avoid perl in closure
  4159. "out"))
  4160. (arguments
  4161. `(#:tests? #f ; no 'check' target
  4162. #:make-flags (list (string-append "PREFIX=" %output)
  4163. (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
  4164. (string-append "INCLUDEDIR="
  4165. (assoc-ref %outputs "lib") "/include")
  4166. (string-append "MANDIR=" %output "/share/man")
  4167. (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
  4168. #:phases
  4169. (modify-phases %standard-phases
  4170. (delete 'configure)
  4171. (add-before 'build 'patch-exec-paths
  4172. (lambda* (#:key inputs outputs #:allow-other-keys)
  4173. (substitute* "prog/detect/sensors-detect"
  4174. (("`uname")
  4175. (string-append "`" (assoc-ref inputs "coreutils")
  4176. "/bin/uname"))
  4177. (("(`|\")modprobe" all open-quote)
  4178. (string-append open-quote
  4179. (assoc-ref inputs "kmod")
  4180. "/bin/modprobe")))
  4181. (substitute* '("prog/pwm/pwmconfig"
  4182. "prog/pwm/fancontrol")
  4183. (("gnuplot")
  4184. (search-input-file inputs "/bin/gnuplot"))
  4185. (("cat ")
  4186. (string-append (search-input-file inputs "/bin/cat")
  4187. " "))
  4188. (("e?grep " match)
  4189. (string-append (search-input-file inputs
  4190. (string-append
  4191. "/bin/"
  4192. (string-trim-right match)))
  4193. " "))
  4194. (("sed -e")
  4195. (string-append (search-input-file inputs "/bin/sed")
  4196. " -e"))
  4197. (("cut -d")
  4198. (string-append (search-input-file inputs "/bin/cut")
  4199. " -d"))
  4200. (("sleep ")
  4201. (string-append (search-input-file inputs "/bin/sleep")
  4202. " "))
  4203. (("readlink -f")
  4204. (string-append (search-input-file inputs "/bin/readlink")
  4205. " -f"))))))))
  4206. (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
  4207. (synopsis "Utilities to read temperature/voltage/fan sensors")
  4208. (description
  4209. "Lm-sensors is a hardware health monitoring package for Linux. It allows
  4210. you to access information from temperature, voltage, and fan speed sensors.
  4211. It works with most newer systems.")
  4212. (license license:gpl2+)))
  4213. (define-public iucode-tool
  4214. (package
  4215. (name "iucode-tool")
  4216. (version "2.3.1")
  4217. (source (origin
  4218. (method url-fetch)
  4219. (uri (string-append "https://gitlab.com/iucode-tool/releases"
  4220. "/raw/latest/iucode-tool_" version ".tar.xz"))
  4221. (sha256
  4222. (base32
  4223. "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
  4224. (build-system gnu-build-system)
  4225. (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
  4226. (synopsis "Manipulate Intel microcode bundles")
  4227. (description
  4228. "@command{iucode_tool} is a utility to work with microcode packages for
  4229. Intel processors. It can convert between formats, extract specific versions,
  4230. create a firmware image suitable for the Linux kernel, and more.")
  4231. ;; cpuid.h is available for i686, x86_64, and ia64.
  4232. (supported-systems '("i686-linux" "x86_64-linux"))
  4233. (license license:gpl2+)))
  4234. (define-public i2c-tools
  4235. (package
  4236. (name "i2c-tools")
  4237. (version "3.1.1")
  4238. (source (origin
  4239. (method url-fetch)
  4240. (uri (string-append
  4241. "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
  4242. version ".tar.bz2"))
  4243. (sha256
  4244. (base32
  4245. "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
  4246. (build-system gnu-build-system)
  4247. (arguments
  4248. `(#:tests? #f ; no 'check' target
  4249. #:make-flags (list (string-append "prefix=" %output)
  4250. ,(string-append "CC=" (cc-for-target)))
  4251. ;; No configure script.
  4252. #:phases (modify-phases %standard-phases (delete 'configure))))
  4253. (inputs
  4254. `(("perl" ,perl)))
  4255. (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
  4256. (synopsis "I2C tools for Linux")
  4257. (description
  4258. "The i2c-tools package contains a heterogeneous set of I2C tools for
  4259. Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
  4260. EEPROM decoding scripts, EEPROM programming tools, and a python module for
  4261. SMBus access.")
  4262. (license license:gpl2+)))
  4263. (define-public xsensors
  4264. (package
  4265. (name "xsensors")
  4266. (version "0.70")
  4267. (source (origin
  4268. (method url-fetch)
  4269. (uri (string-append
  4270. "http://www.linuxhardware.org/xsensors/xsensors-"
  4271. version ".tar.gz"))
  4272. (sha256
  4273. (base32
  4274. "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
  4275. (build-system gnu-build-system)
  4276. (inputs `(("lm-sensors" ,lm-sensors "lib")
  4277. ("gtk" ,gtk+-2)))
  4278. (native-inputs `(("pkg-config" ,pkg-config)))
  4279. (arguments
  4280. `(#:phases
  4281. (modify-phases %standard-phases
  4282. (add-before 'configure 'enable-deprecated
  4283. (lambda _
  4284. (substitute* "src/Makefile.in"
  4285. (("-DGDK_DISABLE_DEPRECATED") "")
  4286. (("-DGTK_DISABLE_DEPRECATED") ""))
  4287. #t))
  4288. (add-before 'configure 'remove-Werror
  4289. (lambda _
  4290. (substitute* '("configure" "src/Makefile.in")
  4291. (("-Werror") ""))
  4292. #t)))))
  4293. (home-page "http://www.linuxhardware.org/xsensors/")
  4294. (synopsis "Hardware health information viewer")
  4295. (description
  4296. "Xsensors reads data from the libsensors library regarding hardware
  4297. health such as temperature, voltage and fan speed and displays the information
  4298. in a digital read-out.")
  4299. (license license:gpl2+)))
  4300. (define-public perf
  4301. (package
  4302. (name "perf")
  4303. (version (package-version linux-libre))
  4304. (source (package-source linux-libre))
  4305. (build-system gnu-build-system)
  4306. (arguments
  4307. '(#:phases
  4308. (modify-phases %standard-phases
  4309. (replace 'configure
  4310. (lambda* (#:key inputs #:allow-other-keys)
  4311. (setenv "SHELL_PATH" (which "bash"))
  4312. (chdir "tools/perf")
  4313. #t)))
  4314. #:make-flags (list (string-append "prefix="
  4315. (assoc-ref %outputs "out"))
  4316. "CC=gcc"
  4317. "WERROR=0"
  4318. ;; By default, 'config/Makefile' uses lib64 on
  4319. ;; x86_64. Work around that.
  4320. "lib=lib")
  4321. #:tests? #f)) ;no tests
  4322. (native-inputs
  4323. `(("pkg-config" ,pkg-config)
  4324. ("bison" ,bison)
  4325. ("flex" ,flex)
  4326. ;; There are build scripts written in these languages.
  4327. ("perl" ,perl)
  4328. ("python2" ,python-2)
  4329. ("python3" ,python-3)))
  4330. (inputs
  4331. `(("slang" ,slang) ;for the interactive TUI
  4332. ;; ("newt" ,newt)
  4333. ("python" ,python-2) ;'perf' links against libpython
  4334. ("elfutils" ,elfutils)
  4335. ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
  4336. ("libunwind" ,libunwind) ;better stack walking
  4337. ("numactl" ,numactl) ;for 'perf bench numa mem'
  4338. ;; Documentation.
  4339. ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
  4340. ("docbook-xsl" ,docbook-xsl)
  4341. ("xmlto" ,xmlto)
  4342. ("asciidoc" ,asciidoc)))
  4343. (home-page "https://perf.wiki.kernel.org/")
  4344. (synopsis "Linux profiling with performance counters")
  4345. (description
  4346. "perf is a tool suite for profiling using hardware performance counters,
  4347. with support in the Linux kernel. perf can instrument CPU performance
  4348. counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
  4349. of lightweight profiling. This package contains the user-land tools and in
  4350. particular the @code{perf} command.")
  4351. (license (package-license linux-libre))))
  4352. (define-public pflask
  4353. (package
  4354. (name "pflask")
  4355. (version "0.2")
  4356. (source (origin
  4357. (method git-fetch)
  4358. (uri (git-reference
  4359. (url "https://github.com/ghedo/pflask")
  4360. (commit (string-append "v" version))))
  4361. (file-name (git-file-name name version))
  4362. (sha256
  4363. (base32
  4364. "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
  4365. (build-system cmake-build-system)
  4366. (arguments
  4367. '(#:tests? #f)) ; no tests
  4368. (home-page "https://ghedo.github.io/pflask/")
  4369. (synopsis "Simple tool for creating Linux namespace containers")
  4370. (description "pflask is a simple tool for creating Linux namespace
  4371. containers. It can be used for running a command or even booting an OS inside
  4372. an isolated container, created with the help of Linux namespaces. It is
  4373. similar in functionality to chroot, although pflask provides better isolation
  4374. thanks to the use of namespaces.")
  4375. (license license:bsd-2)))
  4376. (define-public singularity
  4377. (package
  4378. (name "singularity")
  4379. (version "2.6.1")
  4380. (source (origin
  4381. (method url-fetch)
  4382. (uri (string-append "https://github.com/singularityware/singularity/"
  4383. "releases/download/" version
  4384. "/singularity-" version ".tar.gz"))
  4385. (sha256
  4386. (base32
  4387. "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
  4388. (modules '((guix build utils)))
  4389. (snippet
  4390. '(begin
  4391. ;; Do not create directories in /var.
  4392. (substitute* "Makefile.in"
  4393. (("\\$\\(MAKE\\) .*install-data-hook") ""))
  4394. ;; The original source overrides PATH so that it points to
  4395. ;; /bin, /usr/local/bin, etc., which obviously doesn't work
  4396. ;; on Guix System. Leave PATH unchanged so we refer to the
  4397. ;; installed Coreutils, grep, etc.
  4398. (substitute* "bin/singularity.in"
  4399. (("^PATH=.*" all)
  4400. (string-append "#" all "\n")))
  4401. (substitute* (find-files "libexec/cli" "\\.exec$")
  4402. (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
  4403. _ program)
  4404. (string-append "/run/setuid-programs/singularity-"
  4405. program "-helper")))
  4406. ;; These squashfs mount options are apparently no longer
  4407. ;; supported since Linux-libre 5.4.5.
  4408. (substitute* "src/lib/image/squashfs/mount.c"
  4409. (("\"errors=remount-ro\"")
  4410. "NULL"))
  4411. #t))))
  4412. (build-system gnu-build-system)
  4413. (arguments
  4414. `(#:configure-flags '("--localstatedir=/var")
  4415. #:phases
  4416. (modify-phases %standard-phases
  4417. (add-after 'unpack 'patch-references
  4418. (lambda _
  4419. (substitute* "libexec/cli/build.exec.in"
  4420. (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
  4421. (substitute* (append
  4422. (find-files "libexec" "functions")
  4423. (find-files "libexec/bootstrap-scripts" ".*sh$")
  4424. (find-files "libexec/cli" ".*exec$"))
  4425. (("\\| grep ")
  4426. (string-append "| " (which "grep") " "))
  4427. (("egrep ")
  4428. (string-append (which "egrep") " "))
  4429. ((" sed ")
  4430. (string-append " " (which "sed") " ")))
  4431. #t))
  4432. (add-after 'install 'set-PATH
  4433. (lambda* (#:key inputs outputs #:allow-other-keys)
  4434. ;; Have the 'singularity' and 'run-singularity' self-sufficient.
  4435. (let ((out (assoc-ref outputs "out"))
  4436. (coreutils (assoc-ref inputs "coreutils")))
  4437. (wrap-program (string-append out "/bin/singularity")
  4438. `("PATH" ":" = (,(string-append coreutils "/bin"))))
  4439. (substitute* (string-append out "/bin/run-singularity")
  4440. (("/usr/bin/env singularity")
  4441. (string-append (which "env") " "
  4442. out "/bin/singularity")))
  4443. #t))))))
  4444. (inputs
  4445. `(("libarchive" ,libarchive)
  4446. ("python" ,python-wrapper)
  4447. ("zlib" ,zlib)
  4448. ("squashfs-tools" ,squashfs-tools)))
  4449. (home-page "https://singularity.lbl.gov/")
  4450. (synopsis "Container platform")
  4451. (description "Singularity is a container platform supporting a number of
  4452. container image formats. It can build SquashFS container images or import
  4453. existing Docker images. Singularity requires kernel support for container
  4454. isolation or root privileges.")
  4455. (license license:bsd-3)))
  4456. (define-public hdparm
  4457. (package
  4458. (name "hdparm")
  4459. (version "9.62")
  4460. (source (origin
  4461. (method url-fetch)
  4462. (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
  4463. "hdparm-" version ".tar.gz"))
  4464. (sha256
  4465. (base32
  4466. "0zvppv8qw0y1shlhn34iq1g4883i1cywsa514n595nmyrmsrs3rc"))))
  4467. (build-system gnu-build-system)
  4468. (arguments
  4469. `(#:make-flags
  4470. (let ((out (assoc-ref %outputs "out")))
  4471. (list (string-append "binprefix=" out)
  4472. (string-append "manprefix=" out)
  4473. ,(string-append "CC=" (cc-for-target))
  4474. ;; Let Guix strip the binaries and not break cross-compilation.
  4475. "STRIP=true"))
  4476. #:phases
  4477. (modify-phases %standard-phases
  4478. (delete 'configure)) ; no configure script
  4479. #:tests? #f)) ; no test suite
  4480. (home-page "https://sourceforge.net/projects/hdparm/")
  4481. (synopsis "View and tune ATA disk drive parameters")
  4482. (description
  4483. "@command{hdparm} is a command-line utility to control ATA controllers and
  4484. disk drives. It can increase performance and/or reliability by careful tuning
  4485. of hardware settings like power and acoustic management, DMA modes, and caching.
  4486. It can also display detailed device information, or be used as a simple
  4487. performance benchmarking tool.
  4488. @command{hdparm} provides a command line interface to various Linux kernel
  4489. interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
  4490. IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
  4491. Translation (@dfn{SAT}) are also supported.")
  4492. (license (license:non-copyleft "file://LICENSE.TXT"))))
  4493. (define-public nvme-cli
  4494. (package
  4495. (name "nvme-cli")
  4496. (version "1.15")
  4497. (home-page "https://github.com/linux-nvme/nvme-cli")
  4498. (source (origin
  4499. (method git-fetch)
  4500. (uri (git-reference
  4501. (url home-page)
  4502. (commit (string-append "v" version))))
  4503. (sha256
  4504. (base32 "0qr1wa163cb7z6g083nl3zcc28mmlbxh1m97pd54bp3gyrhmdhhr"))
  4505. (file-name (git-file-name name version))))
  4506. (build-system gnu-build-system)
  4507. (arguments
  4508. `(#:make-flags
  4509. (list ,(string-append "CC=" (cc-for-target)))
  4510. #:phases (modify-phases %standard-phases
  4511. (delete 'configure) ; no ./configure script
  4512. (replace 'install
  4513. (lambda _
  4514. (invoke "make" "install-spec" "PREFIX="
  4515. (string-append "DESTDIR=" %output)))))
  4516. ;; The tests require sysfs, which is not accessible from from the build
  4517. ;; environment
  4518. #:tests? #f))
  4519. (synopsis "NVM-Express user space tooling for Linux")
  4520. (description "Nvme-cli is a utility to provide standards compliant tooling
  4521. for NVM-Express drives. It was made specifically for Linux as it relies on the
  4522. IOCTLs defined by the mainline kernel driver.")
  4523. (license license:gpl2+)))
  4524. (define-public rfkill
  4525. (package
  4526. (name "rfkill")
  4527. (version "0.5")
  4528. (source (origin
  4529. (method url-fetch)
  4530. (uri (string-append "mirror://kernel.org/software/network/"
  4531. name "/" name "-" version ".tar.xz"))
  4532. (sha256
  4533. (base32
  4534. "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
  4535. (build-system gnu-build-system)
  4536. (arguments
  4537. `(#:make-flags (list "CC=gcc"
  4538. (string-append "PREFIX=" %output))
  4539. #:phases (modify-phases %standard-phases
  4540. (delete 'configure))
  4541. #:tests? #f))
  4542. (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
  4543. (synopsis "Tool for enabling and disabling wireless devices")
  4544. (description
  4545. "rfkill is a simple tool for accessing the rfkill device interface,
  4546. which is used to enable and disable wireless networking devices, typically
  4547. WLAN, Bluetooth and mobile broadband.")
  4548. (license (license:non-copyleft "file://COPYING"
  4549. "See COPYING in the distribution."))
  4550. ;; rfkill is part of util-linux as of 2.31.
  4551. (properties `((superseded . ,util-linux)))))
  4552. (define-public acpi
  4553. (package
  4554. (name "acpi")
  4555. (version "1.7")
  4556. (source (origin
  4557. (method url-fetch)
  4558. (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
  4559. version "/" name "-" version ".tar.gz"))
  4560. (sha256
  4561. (base32
  4562. "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
  4563. (build-system gnu-build-system)
  4564. (home-page "http://acpiclient.sourceforge.net")
  4565. (synopsis "Display information on ACPI devices")
  4566. (description "@code{acpi} attempts to replicate the functionality of the
  4567. \"old\" @code{apm} command on ACPI systems, including battery and thermal
  4568. information. It does not support ACPI suspending, only displays information
  4569. about ACPI devices.")
  4570. (license license:gpl2+)))
  4571. (define-public acpid
  4572. (package
  4573. (name "acpid")
  4574. (version "2.0.33")
  4575. (source (origin
  4576. (method url-fetch)
  4577. (uri (string-append "mirror://sourceforge/acpid2/acpid-"
  4578. version ".tar.xz"))
  4579. (sha256
  4580. (base32
  4581. "1s6vf8lqwrcqi14k0ww47pk1kifbvxin73ha7mk1njmk7qdzfmh8"))))
  4582. (build-system gnu-build-system)
  4583. (home-page "https://sourceforge.net/projects/acpid2/")
  4584. (synopsis "Daemon for delivering ACPI events to user-space programs")
  4585. (description
  4586. "acpid is designed to notify user-space programs of Advanced
  4587. Configuration and Power Interface (ACPI) events. acpid should be started
  4588. during the system boot, and will run as a background process. When an ACPI
  4589. event is received from the kernel, acpid will examine the list of rules
  4590. specified in /etc/acpi/events and execute the rules that match the event.")
  4591. (license license:gpl2+)))
  4592. (define-public sysfsutils
  4593. (package
  4594. (name "sysfsutils")
  4595. (version "2.1.0")
  4596. (source
  4597. (origin
  4598. (method url-fetch)
  4599. (uri
  4600. (string-append
  4601. "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
  4602. version ".tar.gz"))
  4603. (sha256
  4604. (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
  4605. (build-system gnu-build-system)
  4606. (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
  4607. (synopsis "System utilities based on Linux sysfs")
  4608. (description
  4609. "These are a set of utilities built upon sysfs, a virtual file system in
  4610. Linux kernel versions 2.5+ that exposes a system's device tree. The package
  4611. also contains the libsysfs library.")
  4612. ;; The library is under lgpl2.1+ (all files say "or any later version").
  4613. ;; The rest is mostly gpl2, with a few files indicating gpl2+.
  4614. (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
  4615. (define-public cpufrequtils
  4616. (package
  4617. (name "cpufrequtils")
  4618. (version "008")
  4619. (source
  4620. (origin
  4621. (method url-fetch)
  4622. (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
  4623. "cpufrequtils-" version ".tar.gz"))
  4624. (sha256
  4625. (base32 "0xjs8j44hh0cz6qpig1n0iw8xjpr6s5qmcmwh965ngapxgarr7af"))))
  4626. (build-system gnu-build-system)
  4627. (arguments
  4628. `(#:tests? #f ; no test suite
  4629. #:make-flags
  4630. (let ((out (assoc-ref %outputs "out")))
  4631. (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
  4632. (string-append "CC=" ,(cc-for-target))
  4633. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  4634. "INSTALL=install"
  4635. (string-append "bindir=" out "/bin")
  4636. (string-append "sbindir=" out "/sbin")
  4637. (string-append "mandir=" out "/share/man")
  4638. (string-append "includedir=" out "/include")
  4639. (string-append "libdir=" out "/lib")
  4640. (string-append "localedir=" out "/share/locale")
  4641. (string-append "docdir=" out "/share/doc/" ,name)))
  4642. #:phases
  4643. (modify-phases %standard-phases
  4644. (delete 'configure)))) ; no configure script
  4645. (native-inputs
  4646. `(("gettext" ,gettext-minimal)))
  4647. (home-page
  4648. "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
  4649. (synopsis "Utilities to get and set CPU frequency on Linux")
  4650. (description
  4651. "The cpufrequtils suite contains utilities to retrieve CPU frequency
  4652. information, and set the CPU frequency if supported, using the cpufreq
  4653. capabilities of the Linux kernel.")
  4654. (license license:gpl2)))
  4655. (define-public libraw1394
  4656. (package
  4657. (name "libraw1394")
  4658. (version "2.1.2")
  4659. (source (origin
  4660. (method url-fetch)
  4661. (uri (string-append
  4662. "mirror://kernel.org/linux/libs/ieee1394/"
  4663. name "-" version ".tar.xz"))
  4664. (sha256
  4665. (base32
  4666. "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
  4667. (build-system gnu-build-system)
  4668. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  4669. (synopsis "Interface library for the Linux IEEE1394 drivers")
  4670. (description
  4671. "Libraw1394 is the only supported interface to the kernel side raw1394 of
  4672. the Linux IEEE-1394 subsystem, which provides direct access to the connected
  4673. 1394 buses to user space. Through libraw1394/raw1394, applications can directly
  4674. send to and receive from other nodes without requiring a kernel driver for the
  4675. protocol in question.")
  4676. (license license:lgpl2.1+)))
  4677. (define-public libavc1394
  4678. (package
  4679. (name "libavc1394")
  4680. (version "0.5.4")
  4681. (source (origin
  4682. (method url-fetch)
  4683. (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
  4684. name "-" version ".tar.gz"))
  4685. (sha256
  4686. (base32
  4687. "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
  4688. (build-system gnu-build-system)
  4689. (native-inputs
  4690. `(("pkg-config" ,pkg-config)))
  4691. (propagated-inputs
  4692. `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
  4693. (home-page "https://sourceforge.net/projects/libavc1394/")
  4694. (synopsis "AV/C protocol library for IEEE 1394")
  4695. (description
  4696. "Libavc1394 is a programming interface to the AV/C specification from
  4697. the 1394 Trade Association. AV/C stands for Audio/Video Control.")
  4698. (license license:lgpl2.1+)))
  4699. (define-public libiec61883
  4700. (package
  4701. (name "libiec61883")
  4702. (version "1.2.0")
  4703. (source (origin
  4704. (method url-fetch)
  4705. (uri (string-append
  4706. "mirror://kernel.org/linux/libs/ieee1394/"
  4707. name "-" version ".tar.xz"))
  4708. (sha256
  4709. (base32
  4710. "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
  4711. (build-system gnu-build-system)
  4712. (native-inputs
  4713. `(("pkg-config" ,pkg-config)))
  4714. (propagated-inputs
  4715. `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
  4716. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  4717. (synopsis "Isochronous streaming media library for IEEE 1394")
  4718. (description
  4719. "The libiec61883 library provides a higher level API for streaming DV,
  4720. MPEG-2 and audio over Linux IEEE 1394.")
  4721. (license license:lgpl2.1+)))
  4722. (define-public mdadm
  4723. (package
  4724. (name "mdadm")
  4725. (version "4.1")
  4726. (source (origin
  4727. (method url-fetch)
  4728. (uri (string-append
  4729. "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
  4730. version ".tar.xz"))
  4731. (sha256
  4732. (base32
  4733. "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
  4734. (build-system gnu-build-system)
  4735. (inputs
  4736. `(("udev" ,eudev)))
  4737. (arguments
  4738. `(#:make-flags (let ((out (assoc-ref %outputs "out")))
  4739. (list ,(string-append "CC=" (cc-for-target))
  4740. "INSTALL=install"
  4741. "CHECK_RUN_DIR=0"
  4742. ;; TODO: tell it where to find 'sendmail'
  4743. ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
  4744. (string-append "BINDIR=" out "/sbin")
  4745. (string-append "MANDIR=" out "/share/man")
  4746. (string-append "UDEVDIR=" out "/lib/udev")))
  4747. #:phases
  4748. (modify-phases %standard-phases
  4749. (add-before 'build 'patch-program-paths
  4750. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  4751. (let ((coreutils (assoc-ref (or native-inputs inputs)
  4752. "coreutils")))
  4753. (substitute* "udev-md-raid-arrays.rules"
  4754. (("/usr/bin/(readlink|basename)" all program)
  4755. (string-append coreutils "/bin/" program))))
  4756. #t))
  4757. (add-before 'build 'remove-W-error
  4758. (lambda _
  4759. ;; We cannot build with -Werror on i686 due to a
  4760. ;; 'sign-compare' warning in util.c.
  4761. (substitute* "Makefile"
  4762. (("-Werror") ""))
  4763. #t))
  4764. (delete 'configure))
  4765. ;;tests must be done as root
  4766. #:tests? #f))
  4767. (supported-systems (delete "i586-gnu" %supported-systems))
  4768. (home-page "http://neil.brown.name/blog/mdadm")
  4769. (synopsis "Tool for managing Linux Software RAID arrays")
  4770. (description
  4771. "mdadm is a tool for managing Linux Software RAID arrays. It can create,
  4772. assemble, report on, and monitor arrays. It can also move spares between raid
  4773. arrays when needed.")
  4774. (license license:gpl2+)))
  4775. (define-public mdadm-static
  4776. (package
  4777. (inherit mdadm)
  4778. (name "mdadm-static")
  4779. (arguments
  4780. (substitute-keyword-arguments (package-arguments mdadm)
  4781. ((#:make-flags flags)
  4782. `(cons "LDFLAGS = -static" ,flags))
  4783. ((#:phases phases)
  4784. `(modify-phases ,phases
  4785. (add-after 'install 'remove-cruft
  4786. (lambda* (#:key outputs #:allow-other-keys)
  4787. (let* ((out (assoc-ref outputs "out"))
  4788. (precious? (lambda (file)
  4789. (member file '("." ".." "sbin"))))
  4790. (directories (scandir out (negate precious?))))
  4791. (with-directory-excursion out
  4792. (for-each delete-file-recursively directories)
  4793. (remove-store-references "sbin/mdadm")
  4794. (delete-file "sbin/mdmon")
  4795. #t))))))
  4796. ((#:modules modules %gnu-build-system-modules)
  4797. `((ice-9 ftw) ,@modules))
  4798. ((#:strip-flags _ '())
  4799. ''("--strip-all")) ;strip a few extra KiB
  4800. ((#:allowed-references _ '("out"))
  4801. '("out")))) ;refer only self
  4802. (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
  4803. (define-public multipath-tools
  4804. (package
  4805. (name "multipath-tools")
  4806. (version "0.8.5")
  4807. (source (origin
  4808. (method git-fetch)
  4809. (uri (git-reference
  4810. (url "https://git.opensvc.com/multipath-tools/.git")
  4811. (commit version)))
  4812. (file-name (git-file-name name version))
  4813. (sha256
  4814. (base32
  4815. "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
  4816. (modules '((guix build utils)))
  4817. (snippet
  4818. '(begin
  4819. ;; Drop bundled valgrind headers.
  4820. (delete-file-recursively "third-party")
  4821. (substitute* '("multipathd/main.c"
  4822. "libmultipath/debug.c")
  4823. (("#include \"../third-party/")
  4824. "#include \""))
  4825. #t))))
  4826. (build-system gnu-build-system)
  4827. (arguments
  4828. '(#:test-target "test"
  4829. #:parallel-build? #f ;XXX: broken in 0.8.4
  4830. #:make-flags (list "CC=gcc"
  4831. (string-append "DESTDIR="
  4832. (assoc-ref %outputs "out"))
  4833. ;; Install Udev rules below this directory, relative
  4834. ;; to the prefix.
  4835. "SYSTEMDPATH=lib"
  4836. (string-append "LDFLAGS=-Wl,-rpath="
  4837. (assoc-ref %outputs "out")
  4838. "/lib"))
  4839. #:phases
  4840. (modify-phases %standard-phases
  4841. (add-after 'unpack 'patch-source
  4842. (lambda* (#:key inputs #:allow-other-keys)
  4843. (let ((lvm2 (assoc-ref inputs "lvm2"))
  4844. (udev (assoc-ref inputs "udev")))
  4845. (substitute* "Makefile.inc"
  4846. (("\\$\\(prefix\\)/usr") "$(prefix)")
  4847. ;; Do not save timestamp to avoid gzip "timestamp
  4848. ;; out-of-range" warnings.
  4849. (("gzip -9") "gzip -9n"))
  4850. (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
  4851. (("/usr/include/libdevmapper.h")
  4852. (string-append lvm2 "/include/libdevmapper.h"))
  4853. (("/usr/include/libudev.h")
  4854. (string-append udev "/include/libudev.h")))
  4855. #t)))
  4856. (add-after 'unpack 'fix-maybe-uninitialized-variable
  4857. (lambda _
  4858. ;; This variable gets initialized later if needed, but GCC 7
  4859. ;; fails to notice. Should be fixed for > 0.8.4.
  4860. ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
  4861. (substitute* "libmultipath/structs_vec.c"
  4862. (("bool is_queueing;")
  4863. "bool is_queueing = false;"))
  4864. #t))
  4865. (add-after 'unpack 'fix-linking-tests
  4866. (lambda _
  4867. ;; Add missing linker flag for -lmpathcmd. This should be fixed
  4868. ;; for versions > 0.8.4.
  4869. (substitute* "tests/Makefile"
  4870. (("-lmultipath -lcmocka")
  4871. "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
  4872. #t))
  4873. (add-after 'unpack 'skip-failing-tests
  4874. (lambda _
  4875. ;; This test and the module's setup() test an arbitrary block
  4876. ;; device node name, but the build environment has none.
  4877. (substitute* "tests/devt.c"
  4878. (("return get_one_devt.*") "return 0;\n")
  4879. (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
  4880. ;; The above triggers -Werror=unused-function. Ignore it.
  4881. (substitute* "tests/Makefile"
  4882. (("CFLAGS \\+= " match)
  4883. (string-append match "-Wno-error=unused-function ")))
  4884. #t))
  4885. (delete 'configure)))) ; no configure script
  4886. (native-inputs
  4887. `(("perl" ,perl)
  4888. ("pkg-config" ,pkg-config)
  4889. ("valgrind" ,valgrind)
  4890. ;; For tests.
  4891. ("cmocka" ,cmocka)))
  4892. (inputs
  4893. `(("json-c" ,json-c)
  4894. ("libaio" ,libaio)
  4895. ("liburcu" ,liburcu)
  4896. ("lvm2" ,lvm2)
  4897. ("readline" ,readline)
  4898. ("udev" ,eudev)))
  4899. (home-page "http://christophe.varoqui.free.fr/")
  4900. (synopsis "Access block devices through multiple paths")
  4901. (description
  4902. "This package provides the following binaries to drive the
  4903. Linux Device Mapper multipathing driver:
  4904. @enumerate
  4905. @item @command{multipath} - Device mapper target autoconfig.
  4906. @item @command{multipathd} - Multipath daemon.
  4907. @item @command{mpathpersist} - Manages SCSI persistent reservations on
  4908. @code{dm} multipath devices.
  4909. @item @command{kpartx} - Create device maps from partition tables.
  4910. @end enumerate")
  4911. (license (list license:gpl2+ ; main distribution
  4912. license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
  4913. (define-public libaio
  4914. (package
  4915. (name "libaio")
  4916. (version "0.3.112")
  4917. (source (origin
  4918. (method url-fetch)
  4919. (uri (list
  4920. (string-append "https://releases.pagure.org/libaio/"
  4921. name "-" version ".tar.gz")))
  4922. (sha256
  4923. (base32
  4924. "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
  4925. (build-system gnu-build-system)
  4926. (arguments
  4927. `(#:make-flags
  4928. (let ((target ,(%current-target-system)))
  4929. (list (string-append "prefix=" %output)
  4930. (string-append
  4931. "CC=" (if target
  4932. (string-append (assoc-ref %build-inputs "cross-gcc")
  4933. "/bin/" target "-gcc")
  4934. "gcc"))))
  4935. #:test-target "partcheck" ; need root for a full 'check'
  4936. #:phases
  4937. (modify-phases %standard-phases (delete 'configure)))) ; no configure script
  4938. (home-page "https://pagure.io/libaio")
  4939. (synopsis "Linux-native asynchronous I/O access library")
  4940. (description
  4941. "This library enables userspace to use Linux kernel asynchronous I/O
  4942. system calls, important for the performance of databases and other advanced
  4943. applications.")
  4944. (license license:lgpl2.1+)))
  4945. (define-public blktrace
  4946. ;; Take a newer commit to get the fix for CVE-2018-10689.
  4947. (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
  4948. (revision "1"))
  4949. (package
  4950. (name "blktrace")
  4951. (version (git-version "1.2.0" revision commit))
  4952. (home-page
  4953. "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
  4954. (source (origin
  4955. (method git-fetch)
  4956. (uri (git-reference
  4957. (url home-page)
  4958. (commit commit)))
  4959. (sha256
  4960. (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
  4961. (file-name (git-file-name name version))))
  4962. (build-system gnu-build-system)
  4963. (arguments
  4964. `(#:make-flags
  4965. (list ,(string-append "CC=" (cc-for-target))
  4966. (string-append "prefix=" %output))
  4967. #:tests? #f ; no tests
  4968. #:phases
  4969. (modify-phases %standard-phases
  4970. (delete 'configure) ; no configure script
  4971. (add-after 'unpack 'fix-gnuplot-path
  4972. (lambda* (#:key inputs #:allow-other-keys)
  4973. (let ((gnuplot (assoc-ref inputs "gnuplot")))
  4974. (substitute* "btt/bno_plot.py"
  4975. (("gnuplot %s")
  4976. (string-append gnuplot "/bin/gnuplot %s")))
  4977. #t))))))
  4978. (inputs
  4979. `(("libaio" ,libaio)
  4980. ("gnuplot" ,gnuplot)
  4981. ("python" ,python-wrapper))) ;for 'bno_plot.py'
  4982. (synopsis "Block layer IO tracing mechanism")
  4983. (description "Blktrace is a block layer IO tracing mechanism which provides
  4984. detailed information about request queue operations to user space. It extracts
  4985. event traces from the kernel (via the relaying through the debug file system).")
  4986. (license license:gpl2))))
  4987. (define-public sbc
  4988. (package
  4989. (name "sbc")
  4990. (version "1.5")
  4991. (source (origin
  4992. (method url-fetch)
  4993. (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
  4994. version ".tar.xz"))
  4995. (patches (search-patches "sbc-fix-build-non-x86.patch"))
  4996. (sha256
  4997. (base32
  4998. "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
  4999. (build-system gnu-build-system)
  5000. (inputs
  5001. `(("libsndfile" ,libsndfile)))
  5002. (native-inputs
  5003. `(("pkg-config" ,pkg-config)))
  5004. (home-page "https://www.kernel.org/pub/linux/bluetooth/")
  5005. (synopsis "Bluetooth subband audio codec")
  5006. (description
  5007. "The SBC is a digital audio encoder and decoder used to transfer data to
  5008. Bluetooth audio output devices like headphones or loudspeakers.")
  5009. (license license:gpl2+)))
  5010. (define-public bluez
  5011. (package
  5012. (name "bluez")
  5013. (version "5.55")
  5014. (source (origin
  5015. (method url-fetch)
  5016. (uri (string-append
  5017. "mirror://kernel.org/linux/bluetooth/bluez-"
  5018. version ".tar.xz"))
  5019. (sha256
  5020. (base32
  5021. "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
  5022. (build-system gnu-build-system)
  5023. (arguments
  5024. `(#:configure-flags
  5025. (let ((out (assoc-ref %outputs "out")))
  5026. (list "--sysconfdir=/etc"
  5027. "--localstatedir=/var"
  5028. "--enable-library"
  5029. "--disable-systemd"
  5030. ;; TODO: is this needed? Not installed by default since 5.55.
  5031. "--enable-hid2hci"
  5032. ;; Install dbus/udev files to the correct location.
  5033. (string-append "--with-dbusconfdir=" out "/etc")
  5034. (string-append "--with-udevdir=" out "/lib/udev")))
  5035. #:phases
  5036. (modify-phases %standard-phases
  5037. ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
  5038. ;; issue (discussion on upstream mailing list:
  5039. ;; https://marc.info/?t=149578476300002&r=1&w=2)
  5040. (add-before 'check 'skip-wonky-test
  5041. (lambda _
  5042. (substitute* "unit/test-gatt.c"
  5043. (("tester_init\\(&argc, &argv\\);") "return 77;"))
  5044. #t))
  5045. (add-after 'install 'post-install
  5046. (lambda* (#:key inputs outputs #:allow-other-keys)
  5047. (let* ((out (assoc-ref outputs "out"))
  5048. (servicedir (string-append out "/share/dbus-1/services"))
  5049. (service "obexd/src/org.bluez.obex.service")
  5050. (rule (string-append
  5051. out "/lib/udev/rules.d/97-hid2hci.rules")))
  5052. ;; Install the obex dbus service file.
  5053. (substitute* service
  5054. (("/bin/false")
  5055. (string-append out "/libexec/bluetooth/obexd")))
  5056. (install-file service servicedir)
  5057. ;; Fix paths in the udev rule.
  5058. (substitute* rule
  5059. (("hid2hci --method")
  5060. (string-append out "/lib/udev/hid2hci --method"))
  5061. (("/sbin/udevadm")
  5062. (search-input-file inputs "/bin/udevadm")))
  5063. #t))))))
  5064. (native-inputs
  5065. `(("pkg-config" ,pkg-config)
  5066. ("gettext" ,gettext-minimal)))
  5067. (inputs
  5068. `(("glib" ,glib)
  5069. ("dbus" ,dbus)
  5070. ("eudev" ,eudev)
  5071. ("libical" ,libical)
  5072. ("readline" ,readline)))
  5073. (home-page "http://www.bluez.org/")
  5074. (synopsis "Linux Bluetooth protocol stack")
  5075. (description
  5076. "BlueZ provides support for the core Bluetooth layers and protocols. It
  5077. is flexible, efficient and uses a modular implementation.")
  5078. (license license:gpl2+)))
  5079. (define-public fuse-exfat
  5080. (package
  5081. (name "fuse-exfat")
  5082. (version "1.3.0")
  5083. (source (origin
  5084. (method url-fetch)
  5085. (uri (string-append
  5086. "https://github.com/relan/exfat/releases/download/v"
  5087. version "/" name "-" version ".tar.gz"))
  5088. (sha256
  5089. (base32
  5090. "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
  5091. (build-system gnu-build-system)
  5092. (native-inputs
  5093. `(("pkg-config" ,pkg-config)))
  5094. (inputs
  5095. `(("fuse" ,fuse)))
  5096. (home-page "https://github.com/relan/exfat")
  5097. (synopsis "Mount exFAT file systems")
  5098. (description
  5099. "This package provides a FUSE-based file system that provides read and
  5100. write access to exFAT devices.")
  5101. (license license:gpl2+)))
  5102. (define-public fuseiso
  5103. (package
  5104. (name "fuseiso")
  5105. (version "20070708")
  5106. (source (origin
  5107. (method url-fetch)
  5108. (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
  5109. version "/fuseiso-" version ".tar.bz2"))
  5110. (sha256
  5111. (base32
  5112. "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
  5113. (build-system gnu-build-system)
  5114. (native-inputs
  5115. `(("pkg-config" ,pkg-config)))
  5116. (inputs
  5117. `(("fuse" ,fuse)
  5118. ("glib" ,glib)
  5119. ("zlib" ,zlib)))
  5120. (home-page "https://sourceforge.net/projects/fuseiso/")
  5121. (synopsis "Mount ISO file system images")
  5122. (description
  5123. "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
  5124. .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
  5125. Ridge, Joliet, and zisofs.")
  5126. (license license:gpl2)))
  5127. (define-public gpm
  5128. (package
  5129. (name "gpm")
  5130. (version "1.20.7")
  5131. (source (origin
  5132. (method url-fetch)
  5133. (uri (string-append
  5134. "https://www.nico.schottelius.org/software/gpm/archives/"
  5135. "gpm-" version ".tar.bz2"))
  5136. (patches (search-patches "gpm-glibc-2.26.patch"))
  5137. (sha256
  5138. (base32
  5139. "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
  5140. (modules '((guix build utils)))
  5141. (snippet
  5142. '(begin
  5143. ;; Take a patch from upstream to fix building with -fno-common,
  5144. ;; which is default in GCC 10:
  5145. ;; https://github.com/telmich/gpm/pull/37
  5146. (substitute* "src/headers/daemon.h"
  5147. (("^time_t[[:blank:]]+last_selection_time;")
  5148. "extern time_t last_selection_time;"))))))
  5149. (build-system gnu-build-system)
  5150. (arguments
  5151. '(#:phases (modify-phases %standard-phases
  5152. (replace 'bootstrap
  5153. (lambda _
  5154. ;; The tarball was not generated with 'make dist' so we
  5155. ;; need to bootstrap things ourselves.
  5156. (substitute* "autogen.sh"
  5157. (("/bin/sh") (which "sh")))
  5158. (invoke "./autogen.sh")
  5159. (patch-makefile-SHELL "Makefile.include.in")
  5160. #t)))
  5161. ;; Make sure programs find libgpm.so.
  5162. #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  5163. (assoc-ref %outputs "out")
  5164. "/lib"))))
  5165. (native-inputs
  5166. `(("texinfo" ,texinfo)
  5167. ("bison" ,bison)
  5168. ("flex" ,flex)
  5169. ("autoconf" ,autoconf)
  5170. ("automake" ,automake)
  5171. ("libtool" ,libtool)))
  5172. (home-page "https://www.nico.schottelius.org/software/gpm/")
  5173. (synopsis "Mouse support for the Linux console")
  5174. (description
  5175. "The GPM (general-purpose mouse) daemon is a mouse server for
  5176. applications running on the Linux console. It allows users to select items
  5177. and copy/paste text in the console and in xterm.")
  5178. (license license:gpl2+)))
  5179. (define-public btrfs-progs
  5180. (package
  5181. (name "btrfs-progs")
  5182. (version "5.14.2")
  5183. (source (origin
  5184. (method url-fetch)
  5185. (uri (string-append "mirror://kernel.org/linux/kernel/"
  5186. "people/kdave/btrfs-progs/"
  5187. "btrfs-progs-v" version ".tar.xz"))
  5188. (sha256
  5189. (base32
  5190. "1afpa8izagkr9sn5fqrm6687idiqdkcz08ks2j07972kd0rm5il5"))))
  5191. (build-system gnu-build-system)
  5192. (outputs '("out"
  5193. "static")) ; static versions of the binaries in "out"
  5194. (arguments
  5195. '(#:phases (modify-phases %standard-phases
  5196. (add-after 'unpack 'patch-makefile
  5197. (lambda* (#:key outputs #:allow-other-keys)
  5198. (substitute* "Makefile"
  5199. (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
  5200. (string-append (assoc-ref outputs "out")
  5201. "/lib/udev/rules.d")))))
  5202. (add-after 'build 'build-static
  5203. (lambda _ (invoke "make" "static")))
  5204. (add-after 'install 'install-bash-completion
  5205. (lambda* (#:key outputs #:allow-other-keys)
  5206. (let* ((out (assoc-ref outputs "out"))
  5207. (bashcomp (string-append out "/etc/bash_completion.d")))
  5208. (mkdir-p bashcomp)
  5209. (copy-file "btrfs-completion"
  5210. (string-append bashcomp "/btrfs")))))
  5211. (add-after 'install 'install-static
  5212. (let ((staticbin (string-append (assoc-ref %outputs "static")
  5213. "/bin")))
  5214. (lambda _
  5215. (invoke "make"
  5216. (string-append "bindir=" staticbin)
  5217. "install-static")))))
  5218. #:tests? #f ; XXX: require the 'btrfs' kernel module.
  5219. #:test-target "test"
  5220. #:parallel-tests? #f)) ; tests fail when run in parallel
  5221. (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
  5222. ("lzo" ,lzo)
  5223. ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
  5224. ("util-linux:static" ,util-linux "static") ;ditto
  5225. ("zlib" ,zlib)
  5226. ("zlib:static" ,zlib "static")
  5227. ("zstd" ,zstd "lib")
  5228. ("zstd:static" ,zstd "static")))
  5229. (native-inputs `(("pkg-config" ,pkg-config)
  5230. ("asciidoc" ,asciidoc)
  5231. ("python" ,python)
  5232. ("xmlto" ,xmlto)
  5233. ;; Remove this input entirely when the default headers
  5234. ;; version provides blk_zone.capacity (>= 5.9).
  5235. ("linux-libre-headers" ,linux-libre-headers-5.10)
  5236. ;; For building documentation.
  5237. ("libxml2" ,libxml2)
  5238. ("docbook-xsl" ,docbook-xsl)
  5239. ;; For tests.
  5240. ("acl" ,acl)
  5241. ("which" ,which)
  5242. ("dmsetup" ,lvm2)
  5243. ("udevadm" ,eudev)
  5244. ;; The tests need 'grep' with perl regexp support.
  5245. ("grep" ,grep)))
  5246. (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
  5247. (synopsis "Create and manage btrfs copy-on-write file systems")
  5248. (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
  5249. aimed at implementing advanced features while focusing on fault tolerance,
  5250. repair and easy administration.")
  5251. ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
  5252. ;; GPL2: Everything else.
  5253. (license (list license:gpl2 license:gpl2+))))
  5254. (define-public btrfs-progs/static
  5255. (package
  5256. (name "btrfs-progs-static")
  5257. (version (package-version btrfs-progs))
  5258. (source #f)
  5259. (build-system trivial-build-system)
  5260. (inputs
  5261. `(("btrfs-progs:static" ,btrfs-progs "static")))
  5262. (arguments
  5263. `(#:modules ((guix build utils))
  5264. #:builder
  5265. (begin
  5266. (use-modules (guix build utils)
  5267. (ice-9 ftw)
  5268. (srfi srfi-26))
  5269. (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
  5270. (out (assoc-ref %outputs "out"))
  5271. (source (string-append btrfs "/bin/btrfs.static"))
  5272. (target (string-append out "/bin/btrfs")))
  5273. (mkdir-p (dirname target))
  5274. (copy-file source target)
  5275. (remove-store-references target)
  5276. (chmod target #o555)
  5277. #t))))
  5278. (home-page (package-home-page btrfs-progs))
  5279. (synopsis "Statically-linked btrfs command from btrfs-progs")
  5280. (description "This package provides the statically-linked @command{btrfs}
  5281. from the btrfs-progs package. It is meant to be used in initrds.")
  5282. (license (package-license btrfs-progs))))
  5283. (define-public cramfs-tools
  5284. (package
  5285. (name "cramfs-tools")
  5286. (home-page "https://github.com/npitre/cramfs-tools")
  5287. (version "2.1")
  5288. (source (origin
  5289. (method git-fetch)
  5290. (uri (git-reference
  5291. (url home-page)
  5292. (commit (string-append "v" version))))
  5293. (sha256
  5294. (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
  5295. (file-name (git-file-name name version))))
  5296. (build-system gnu-build-system)
  5297. (arguments
  5298. '(#:tests? #f ; No tests.
  5299. #:phases
  5300. (modify-phases %standard-phases
  5301. (delete 'configure)
  5302. (replace 'install
  5303. (lambda* (#:key outputs #:allow-other-keys)
  5304. (let ((out (assoc-ref outputs "out")))
  5305. (install-file "mkcramfs" (string-append out "/sbin"))
  5306. (install-file "cramfsck" (string-append out "/sbin")))
  5307. #t)))))
  5308. (inputs
  5309. `(("zlib" ,zlib)))
  5310. (synopsis "Tools to manage Cramfs file systems")
  5311. (description "Cramfs is a Linux file system designed to be simple, small,
  5312. and to compress things well. It is used on a number of embedded systems and
  5313. small devices. This version has additional features such as uncompressed
  5314. blocks and random block placement.")
  5315. (license license:gpl2+)))
  5316. (define-public compsize
  5317. (package
  5318. (name "compsize")
  5319. (version "1.5")
  5320. (home-page "https://github.com/kilobyte/compsize")
  5321. (source (origin
  5322. (method git-fetch)
  5323. (uri (git-reference
  5324. (url home-page)
  5325. (commit (string-append "v" version))))
  5326. (sha256
  5327. (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
  5328. (file-name (git-file-name name version))))
  5329. (build-system gnu-build-system)
  5330. (inputs
  5331. `(("btrfs-progs" ,btrfs-progs)))
  5332. (arguments
  5333. `(#:tests? #f ; No tests.
  5334. #:make-flags
  5335. (list (string-append "CC=" ,(cc-for-target)))
  5336. #:phases
  5337. (modify-phases %standard-phases
  5338. (delete 'configure)
  5339. (replace 'install
  5340. (lambda* (#:key outputs #:allow-other-keys)
  5341. (let ((out (assoc-ref outputs "out")))
  5342. (install-file "compsize" (string-append out "/bin"))
  5343. (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
  5344. (synopsis "Find compression type/ratio on Btrfs files")
  5345. (description "@command{compsize} takes a list of files (given as
  5346. arguments) on a Btrfs file system and measures used compression types and
  5347. effective compression ratio, producing a report.
  5348. A directory has no extents but has a (recursive) list of files. A non-regular
  5349. file is silently ignored.
  5350. As it makes no sense to talk about compression ratio of a partial extent,
  5351. every referenced extent is counted whole, exactly once -- no matter if you use
  5352. only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
  5353. uncompressed size will not match the number given by @command{tar} or
  5354. @command{du}. On the other hand, the space used should be accurate (although
  5355. obviously it can be shared with files outside our set).")
  5356. (license license:gpl2+)))
  5357. (define-public f2fs-tools-1.7
  5358. (package
  5359. (name "f2fs-tools")
  5360. (version "1.7.0")
  5361. (source (origin
  5362. (method url-fetch)
  5363. (uri (string-append
  5364. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  5365. "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
  5366. (sha256
  5367. (base32
  5368. "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
  5369. (build-system gnu-build-system)
  5370. (arguments
  5371. `(#:configure-flags '("CFLAGS=-fcommon")
  5372. #:phases
  5373. (modify-phases %standard-phases
  5374. (add-after 'install 'install-headers
  5375. (lambda* (#:key outputs #:allow-other-keys)
  5376. (let* ((out (assoc-ref outputs "out"))
  5377. (out-include (string-append out "/include")))
  5378. (install-file "include/f2fs_fs.h" out-include)
  5379. (install-file "mkfs/f2fs_format_utils.h" out-include)
  5380. #t))))))
  5381. (native-inputs
  5382. `(("autoconf" ,autoconf)
  5383. ("automake" ,automake)
  5384. ("libtool" ,libtool)
  5385. ("pkg-config" ,pkg-config)))
  5386. (inputs
  5387. `(("libuuid" ,util-linux "lib")
  5388. ("libselinux" ,libselinux)))
  5389. (home-page "https://f2fs.wiki.kernel.org/")
  5390. (synopsis "Userland tools for f2fs")
  5391. (description
  5392. "F2FS, the Flash-Friendly File System, is a modern file system
  5393. designed to be fast and durable on flash devices such as solid-state
  5394. disks and SD cards. This package provides the userland utilities.")
  5395. ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
  5396. ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
  5397. (license (list license:gpl2 license:lgpl2.1))))
  5398. (define-public f2fs-tools
  5399. (package
  5400. (inherit f2fs-tools-1.7)
  5401. (name "f2fs-tools")
  5402. (version "1.14.0")
  5403. (source (origin
  5404. (method url-fetch)
  5405. (uri (string-append
  5406. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  5407. "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
  5408. (sha256
  5409. (base32
  5410. "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
  5411. (inputs
  5412. `(("libuuid" ,util-linux "lib")))))
  5413. (define-public f2fs-tools/static
  5414. (static-package
  5415. (package
  5416. (inherit f2fs-tools)
  5417. (name "f2fs-tools-static")
  5418. (arguments
  5419. `(#:configure-flags
  5420. (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
  5421. (libuuid (assoc-ref %build-inputs "libuuid")))
  5422. (list
  5423. (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
  5424. (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
  5425. (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
  5426. "-I" libuuid "/include/blkid")
  5427. (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
  5428. #:disallowed-references (,util-linux)
  5429. #:phases
  5430. (modify-phases %standard-phases ; TODO: f2fs phases.
  5431. (add-after 'unpack 'make-static
  5432. (lambda _
  5433. (define (append-to-file name body)
  5434. (let ((file (open-file name "a")))
  5435. (display body file)
  5436. (close-port file)))
  5437. (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
  5438. (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
  5439. (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
  5440. #t))
  5441. (add-after 'install 'remove-store-references
  5442. (lambda* (#:key outputs #:allow-other-keys)
  5443. ;; Work around bug in our util-linux.
  5444. ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
  5445. (remove-store-references (string-append (assoc-ref outputs "out")
  5446. "/sbin/mkfs.f2fs"))
  5447. #t)))))
  5448. (inputs
  5449. `(("libuuid:static" ,util-linux "static")
  5450. ("libuuid" ,util-linux "lib")))))) ; for include files
  5451. (define-public f2fs-fsck/static
  5452. (package
  5453. (name "f2fs-fsck-static")
  5454. (version (package-version f2fs-tools/static))
  5455. (source #f)
  5456. (build-system trivial-build-system)
  5457. (arguments
  5458. `(#:modules ((guix build utils))
  5459. #:builder
  5460. (begin
  5461. (use-modules (guix build utils)
  5462. (ice-9 ftw)
  5463. (srfi srfi-26))
  5464. (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
  5465. (fsck "fsck.f2fs")
  5466. (out (assoc-ref %outputs "out"))
  5467. (sbin (string-append out "/sbin")))
  5468. (mkdir-p sbin)
  5469. (with-directory-excursion sbin
  5470. (install-file (string-append f2fs-tools "/sbin/" fsck)
  5471. ".")
  5472. (remove-store-references fsck)
  5473. (chmod fsck #o555))
  5474. #t))))
  5475. (inputs
  5476. `(("f2fs-tools-static" ,f2fs-tools/static)))
  5477. (home-page (package-home-page f2fs-tools/static))
  5478. (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
  5479. (description "This package provides statically-linked fsck.f2fs command taken
  5480. from the f2fs-tools package. It is meant to be used in initrds.")
  5481. (license (package-license f2fs-tools/static))))
  5482. (define-public freefall
  5483. (package
  5484. (name "freefall")
  5485. (version (package-version linux-libre))
  5486. (source (package-source linux-libre))
  5487. (build-system gnu-build-system)
  5488. (arguments
  5489. '(#:phases (modify-phases %standard-phases
  5490. (add-after 'unpack 'enter-subdirectory
  5491. (lambda _
  5492. (chdir "tools/laptop/freefall")
  5493. #t))
  5494. (delete 'configure)
  5495. (add-before 'build 'increase-timeout
  5496. (lambda _
  5497. ;; The default of 2 seconds is too low: it assumes an
  5498. ;; open lid and AC power without actually checking.
  5499. (substitute* "freefall.c"
  5500. (("alarm\\(2\\)") "alarm(5)"))
  5501. #t)))
  5502. #:make-flags (list (string-append "PREFIX="
  5503. (assoc-ref %outputs "out"))
  5504. "CC=gcc")
  5505. #:tests? #f)) ;no tests
  5506. (home-page (package-home-page linux-libre))
  5507. (synopsis "Free-fall protection for spinning laptop hard drives")
  5508. (description
  5509. "Prevents shock damage to the internal spinning hard drive(s) of some
  5510. HP and Dell laptops. When sudden movement is detected, all input/output
  5511. operations on the drive are suspended and its heads are parked on the ramp,
  5512. where they are less likely to cause damage to the spinning disc. Requires a
  5513. drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
  5514. feature, and a laptop with an accelerometer. It has no effect on SSDs.")
  5515. (license license:gpl2)))
  5516. (define-public thinkfan
  5517. (package
  5518. (name "thinkfan")
  5519. (version "1.2.2")
  5520. (source
  5521. (origin
  5522. (method git-fetch)
  5523. (uri (git-reference
  5524. (url "https://github.com/vmatare/thinkfan")
  5525. (commit version)))
  5526. (file-name (git-file-name name version))
  5527. (sha256
  5528. (base32 "01l1pnj1cgy3dwgyys2s5iqzyv6kk47vlpy09qjafk8py21ijik3"))))
  5529. (build-system cmake-build-system)
  5530. (arguments
  5531. `(#:modules ((guix build cmake-build-system)
  5532. (guix build utils)
  5533. (srfi srfi-26))
  5534. #:tests? #f ; no test target
  5535. #:configure-flags
  5536. ;; Enable reading temperatures from hard disks via S.M.A.R.T.
  5537. ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
  5538. ;; inefficient’.
  5539. `("-DUSE_ATASMART:BOOL=ON")
  5540. #:phases
  5541. (modify-phases %standard-phases
  5542. (add-after 'unpack 'create-init-scripts
  5543. ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
  5544. ;; systemd to patch and install their service files. Fake their
  5545. ;; presence rather than duplicating the build system below. Leave
  5546. ;; things like ‘/bin/kill’ because they're not worth a dependency.
  5547. ;; The sysvinit needs manual patching, but since upstream doesn't
  5548. ;; even provide the option to install it: don't.
  5549. (lambda* (#:key outputs #:allow-other-keys)
  5550. (let* ((out (assoc-ref outputs "out"))
  5551. (share (string-append out "/share/" ,name)))
  5552. (substitute* "CMakeLists.txt"
  5553. (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
  5554. (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
  5555. ;; That was easy! Now we just need to fix the destinations.
  5556. (("/etc" directory)
  5557. (string-append out directory)))
  5558. #t))))))
  5559. (native-inputs
  5560. `(("pkg-config" ,pkg-config)))
  5561. (inputs
  5562. `(("libatasmart" ,libatasmart)
  5563. ("yaml-cpp" ,yaml-cpp)))
  5564. (home-page "https://github.com/vmatare/thinkfan")
  5565. (synopsis "Simple fan control program")
  5566. (description
  5567. "Thinkfan is a simple fan control program. It reads temperatures,
  5568. checks them against configured limits and switches to appropriate (also
  5569. pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
  5570. other @code{hwmon} driver that enables temperature reading and fan control
  5571. from userspace.")
  5572. (license license:gpl3+)))
  5573. (define-public tpacpi-bat
  5574. (package
  5575. (name "tpacpi-bat")
  5576. (version "3.1")
  5577. (source
  5578. (origin
  5579. (method git-fetch)
  5580. (uri (git-reference
  5581. (url "https://github.com/teleshoes/tpacpi-bat")
  5582. (commit (string-append "v" version))))
  5583. (file-name (git-file-name name version))
  5584. (sha256
  5585. (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
  5586. (build-system gnu-build-system)
  5587. (arguments
  5588. `(#:tests? #f ; no test target
  5589. #:phases
  5590. (modify-phases %standard-phases
  5591. (add-after 'unpack 'refer-to-inputs
  5592. (lambda _
  5593. (substitute* "tpacpi-bat"
  5594. (("cat ")
  5595. (format #f "~a " (which "cat")))
  5596. ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
  5597. ;; loaded. That's the administrator's prerogative; disable it.
  5598. (("system \"(modprobe .*)\"" _ match)
  5599. (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
  5600. #t))
  5601. (delete 'configure) ; nothing to configure
  5602. (delete 'build) ; nothing to build
  5603. (replace 'install
  5604. (lambda* (#:key outputs #:allow-other-keys)
  5605. (let* ((out (assoc-ref outputs "out"))
  5606. (bin (string-append out "/bin"))
  5607. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  5608. (install-file "tpacpi-bat" bin)
  5609. ;; There's no man page. Install other forms of documentation.
  5610. (for-each (lambda (file)
  5611. (let ((target (string-append doc "/" file)))
  5612. (mkdir-p (dirname target))
  5613. (copy-recursively file target)))
  5614. (list "battery_asl" "examples" "README.md"))
  5615. #t))))))
  5616. (inputs
  5617. `(("perl" ,perl)))
  5618. (home-page "https://github.com/teleshoes/tpacpi-bat")
  5619. (synopsis "ThinkPad battery charge controller")
  5620. (description
  5621. "Tpacpi-bat is a command-line interface to control battery charging on
  5622. @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
  5623. ThinkPad models released after 2011}, starting with the xx20 series. It can
  5624. query and set the thresholds at which one or both batteries will start and stop
  5625. charging, inhibit charging batteries for a set period of time, or force them to
  5626. discharge when they otherwise would not.
  5627. This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
  5628. kernel module provided by the @code{acpi-call-linux-module} package, which must
  5629. be installed and loaded separately. Only the original vendor firmware is
  5630. supported.")
  5631. (license license:gpl3+)))
  5632. (define-public tmon
  5633. (package
  5634. (name "tmon")
  5635. ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
  5636. (version (package-version linux-libre))
  5637. (source (package-source linux-libre))
  5638. (build-system gnu-build-system)
  5639. (arguments
  5640. `(#:tests? #f ; no test suite
  5641. #:make-flags
  5642. (list (string-append "CC=" ,(cc-for-target))
  5643. (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
  5644. "BINDIR=bin")
  5645. #:phases
  5646. (modify-phases %standard-phases
  5647. (add-after 'unpack 'enter-subdirectory
  5648. (lambda _
  5649. (chdir "tools/thermal/tmon")
  5650. #t))
  5651. (add-after 'install 'install-man-page
  5652. (lambda* (#:key outputs #:allow-other-keys)
  5653. (let* ((out (assoc-ref outputs "out"))
  5654. (man8 (string-append out "/share/man/man8")))
  5655. (install-file "tmon.8" man8)
  5656. #t)))
  5657. (delete 'configure)))) ; no configure script
  5658. (inputs
  5659. `(("ncurses" ,ncurses)))
  5660. (home-page (package-home-page linux-libre))
  5661. (synopsis "Monitor and test the Linux thermal subsystem in real time")
  5662. (description
  5663. "Tmon is a tool to interact with the complex thermal subsystem of the
  5664. kernel Linux. It helps visualize thermal relationships and real-time thermal
  5665. data, tune and test cooling devices and sensors, and collect thermal data for
  5666. further analysis.
  5667. As computers become smaller and more thermally constrained, more sensors are
  5668. added and new cooling capabilities introduced. Thermal relationships can change
  5669. dynamically. Their complexity grows exponentially among cooling devices, zones,
  5670. sensors, and trip points.
  5671. Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
  5672. of symbolic links, trip point bindings, and device instances. To traverse it
  5673. by hand is no trivial task: @command{tmon} aims to make it understandable.")
  5674. (license (list license:gpl2 ; the man page
  5675. license:gpl2+)))) ; the actual rest
  5676. (define-public turbostat
  5677. (package
  5678. (name "turbostat")
  5679. ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
  5680. ;; make it harder to benefit from ‘free’ linux-libre package updates.
  5681. (version (package-version linux-libre))
  5682. (source (package-source linux-libre))
  5683. (build-system gnu-build-system)
  5684. (arguments
  5685. `(#:tests? #f ; no test suite
  5686. #:make-flags
  5687. (list (string-append "CC=" ,(cc-for-target))
  5688. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  5689. #:phases
  5690. (modify-phases %standard-phases
  5691. (add-after 'unpack 'enter-subdirectory
  5692. (lambda _
  5693. (chdir "tools/power/x86/turbostat")
  5694. #t))
  5695. (delete 'configure)))) ; no configure script
  5696. (inputs
  5697. `(("libcap" ,libcap)))
  5698. (supported-systems '("i686-linux" "x86_64-linux"))
  5699. (home-page (package-home-page linux-libre))
  5700. (synopsis "Report x86 processor frequency and idle statistics")
  5701. (description
  5702. "Turbostat reports x86 processor topology, frequency, idle power state
  5703. statistics, temperature, and power consumption. Some information is unavailable
  5704. on older processors.
  5705. It can be used to identify machines that are inefficient in terms of power usage
  5706. or idle time, report the rate of @acronym{SMI, system management interrupt}s
  5707. occurring on the system, or verify the effects of power management tuning.
  5708. @command{turbostat} reads hardware counters but doesn't write to them, so it
  5709. won't interfere with the OS or other running processes---including multiple
  5710. invocations of itself.")
  5711. (license license:gpl2)))
  5712. (define-public ntfs-3g
  5713. (package
  5714. (name "ntfs-3g")
  5715. (version "2021.8.22")
  5716. (source (origin
  5717. (method url-fetch)
  5718. (uri (string-append "https://tuxera.com/opensource/"
  5719. "ntfs-3g_ntfsprogs-" version ".tgz"))
  5720. (sha256
  5721. (base32
  5722. "1yrf42xr92qv3pads8lzp5nyssz6875ncfgg8v3jwjyr0nm87f2m"))
  5723. (modules '((guix build utils)))
  5724. (snippet '(begin
  5725. ;; Install under $prefix.
  5726. (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
  5727. (("/sbin")
  5728. "@sbindir@"))
  5729. #t))))
  5730. (build-system gnu-build-system)
  5731. (inputs `(("util-linux" ,util-linux) ; libuuid
  5732. ("fuse" ,fuse)))
  5733. (native-inputs `(("pkg-config" ,pkg-config)))
  5734. (arguments
  5735. '(#:configure-flags (list "--disable-static"
  5736. "--disable-ldconfig" ;not necessary
  5737. "--exec-prefix=${prefix}"
  5738. "--with-fuse=external" ;use our own FUSE
  5739. "--enable-mount-helper"
  5740. "--enable-posix-acls"
  5741. "--enable-xattr-mappings")
  5742. #:phases
  5743. (modify-phases %standard-phases
  5744. ;; If users install ntfs-3g, they probably want to make it the
  5745. ;; default driver as well, so we opt for sensible defaults and link
  5746. ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
  5747. ;; mount NTFS file systems.)
  5748. (add-after 'install 'install-link
  5749. (lambda* (#:key outputs #:allow-other-keys)
  5750. (let* ((out (assoc-ref outputs "out"))
  5751. (sbin (string-append out "/sbin")))
  5752. (symlink "mount.ntfs-3g"
  5753. (string-append sbin "/mount.ntfs")))
  5754. #t)))))
  5755. (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
  5756. (synopsis "Read-write access to NTFS file systems")
  5757. (description
  5758. "NTFS-3G provides read-write access to NTFS file systems, which are
  5759. commonly found on Microsoft Windows. It is implemented as a FUSE file system.
  5760. The package provides additional NTFS tools.")
  5761. (license license:gpl2+)))
  5762. (define-public ntfs-3g/static
  5763. (static-package
  5764. (package
  5765. (inherit ntfs-3g)
  5766. (name "ntfs-3g-static")
  5767. (arguments
  5768. (substitute-keyword-arguments (package-arguments ntfs-3g)
  5769. ((#:configure-flags flags)
  5770. `(append ,flags
  5771. (list "--enable-really-static"
  5772. ;; The FUSE driver isn't currently used by our initrd.
  5773. "--disable-ntfs-3g")))
  5774. ((#:phases phases)
  5775. `(modify-phases ,phases
  5776. (add-after 'unpack 'make-really-static-really-static
  5777. (lambda _
  5778. (substitute* "ntfsprogs/Makefile.in"
  5779. ((" -static") " -all-static"))))
  5780. (delete 'install-link))))))))
  5781. (define-public ntfsfix/static
  5782. (package
  5783. (name "ntfsfix-static")
  5784. (version (package-version ntfs-3g/static))
  5785. (source #f)
  5786. (build-system trivial-build-system)
  5787. (arguments
  5788. `(#:modules ((guix build utils))
  5789. #:builder
  5790. (begin
  5791. (use-modules (guix build utils))
  5792. (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
  5793. (out (assoc-ref %outputs "out"))
  5794. (bin (string-append out "/bin")))
  5795. (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
  5796. (with-directory-excursion bin
  5797. (remove-store-references "ntfsfix"))))))
  5798. (inputs
  5799. `(("ntfs-3g" ,ntfs-3g/static)))
  5800. (home-page (package-home-page ntfs-3g/static))
  5801. (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
  5802. (description
  5803. "This package provides a statically linked @command{ntfsfix} taken
  5804. from the ntfs-3g package. It is meant to be used in initrds.")
  5805. (license (package-license ntfs-3g/static))))
  5806. (define-public rdma-core
  5807. (package
  5808. (name "rdma-core")
  5809. (version "33.1")
  5810. (source (origin
  5811. (method url-fetch)
  5812. (uri (string-append "https://github.com/linux-rdma/rdma-core"
  5813. "/releases/download/v" version "/rdma-core-"
  5814. version ".tar.gz"))
  5815. (sha256
  5816. (base32
  5817. "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
  5818. (build-system cmake-build-system)
  5819. (arguments
  5820. `(#:tests? #f ; no tests
  5821. ;; Upstream uses the "ninja" build system and encourage distros
  5822. ;; to do the same for consistency.
  5823. #:configure-flags (list "-GNinja"
  5824. (string-append "-DRST2MAN_EXECUTABLE="
  5825. (assoc-ref %build-inputs
  5826. "python-docutils")
  5827. "/bin/rst2man.py"))
  5828. #:phases
  5829. (modify-phases %standard-phases
  5830. (replace 'build
  5831. (lambda _
  5832. (invoke "ninja"
  5833. "-j" (number->string (parallel-job-count)))))
  5834. (replace 'install
  5835. (lambda _
  5836. (invoke "ninja" "install"))))))
  5837. (native-inputs
  5838. `(("ninja" ,ninja)
  5839. ("pkg-config" ,pkg-config)
  5840. ("python" ,python-wrapper)
  5841. ("python-docutils" ,python-docutils))) ;for 'rst2man'
  5842. (inputs
  5843. `(("libnl" ,libnl)
  5844. ("udev" ,eudev)))
  5845. (home-page "https://github.com/linux-rdma/rdma-core")
  5846. (synopsis "Utilities and libraries for working with RDMA devices")
  5847. (description
  5848. "This package provides userspace components for the InfiniBand
  5849. subsystem of the Linux kernel. Specifically it contains userspace
  5850. libraries for the following device nodes:
  5851. @enumerate
  5852. @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
  5853. @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
  5854. @item @file{/dev/infiniband/umadX} (@code{libibumad})
  5855. @end enumerate
  5856. The following service daemons are also provided:
  5857. @enumerate
  5858. @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
  5859. @item @code{iwpmd} (for iWARP kernel providers)
  5860. @item @code{ibacm} (for InfiniBand communication management assistant)
  5861. @end enumerate")
  5862. ;; All library code is dual licensed under GPL2 and a custom MIT
  5863. ;; variant. The package also includes some components covered by
  5864. ;; other licenses. Consult COPYING.md for full details.
  5865. (license
  5866. (list license:gpl2
  5867. (license:x11-style "See COPYING.BSD_MIT in the distribution")
  5868. license:bsd-2 ; Files referring to COPYING.BSD_FB
  5869. license:cc0 ; most files in ccan/
  5870. license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
  5871. (define-public perftest
  5872. (package
  5873. (name "perftest")
  5874. (version "4.4-0.4")
  5875. (source
  5876. (origin
  5877. (method url-fetch)
  5878. (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
  5879. version "/perftest-" version ".g0927198.tar.gz"))
  5880. (sha256
  5881. (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
  5882. (build-system gnu-build-system)
  5883. (arguments
  5884. `(#:phases
  5885. (modify-phases %standard-phases
  5886. (add-after 'unpack 'patch-header-paths
  5887. (lambda _
  5888. (substitute* '("src/raw_ethernet_fs_rate.c"
  5889. "src/raw_ethernet_resources.c"
  5890. "src/raw_ethernet_resources.h"
  5891. "src/raw_ethernet_send_burst_lat.c"
  5892. "src/raw_ethernet_send_bw.c"
  5893. "src/raw_ethernet_send_lat.c")
  5894. (("/usr/include/netinet/ip.h") "netinet/ip.h"))
  5895. #t)))))
  5896. (inputs `(("rdma-core" ,rdma-core)))
  5897. (home-page "https://github.com/linux-rdma/perftest/")
  5898. (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
  5899. (description "This is a collection of tests written over uverbs intended for
  5900. use as a performance micro-benchmark. The tests may be used for hardware or
  5901. software tuning as well as for functional testing.
  5902. The collection contains a set of bandwidth and latency benchmark such as:
  5903. @enumerate
  5904. @item Send - @code{ib_send_bw} and @code{ib_send_lat}
  5905. @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
  5906. @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
  5907. @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
  5908. @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
  5909. @end enumerate")
  5910. (license license:gpl2)))
  5911. (define-public rng-tools
  5912. (package
  5913. (name "rng-tools")
  5914. (home-page "https://github.com/nhorman/rng-tools")
  5915. (version "6.14")
  5916. (source (origin
  5917. (method git-fetch)
  5918. (uri (git-reference (url home-page)
  5919. (commit (string-append "v" version))))
  5920. (file-name (git-file-name name version))
  5921. (sha256
  5922. (base32
  5923. "1hrbm4y7fbzkg5j2f7vpj19ri2ff2lp77al17fhi4mv0bvdfjd9m"))))
  5924. (build-system gnu-build-system)
  5925. (arguments
  5926. `(;; Disable support for various hardware entropy sources as they need
  5927. ;; dependencies that are not yet in Guix, and would significantly
  5928. ;; increase closure size.
  5929. #:configure-flags '("--without-nistbeacon"
  5930. "--without-pkcs11"
  5931. "--without-rtlsdr")))
  5932. (native-inputs
  5933. `(("autoconf" ,autoconf)
  5934. ("automake" ,automake)
  5935. ("pkg-config" ,pkg-config)))
  5936. (inputs
  5937. `(("libsysfs" ,sysfsutils)
  5938. ("openssl" ,openssl)))
  5939. (synopsis "Random number generator daemon")
  5940. (description
  5941. "Monitor a hardware random number generator, and supply entropy
  5942. from that to the system kernel's @file{/dev/random} machinery.")
  5943. ;; The source package is offered under the GPL2+, but the files
  5944. ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
  5945. (license (list license:gpl2 license:gpl2+))))
  5946. (define-public cpupower
  5947. (package
  5948. (name "cpupower")
  5949. (version (package-version linux-libre))
  5950. (source (package-source linux-libre))
  5951. (build-system gnu-build-system)
  5952. (arguments
  5953. '(#:phases (modify-phases %standard-phases
  5954. (add-after 'unpack 'enter-subdirectory
  5955. (lambda _
  5956. (chdir "tools/power/cpupower")
  5957. #t))
  5958. (delete 'configure)
  5959. (add-before 'build 'fix-makefiles
  5960. (lambda _
  5961. (substitute* "Makefile"
  5962. (("/usr/") "/")
  5963. (("/bin/(install|pwd)" _ command) command))
  5964. (substitute* "bench/Makefile"
  5965. (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
  5966. #t)))
  5967. #:make-flags (let ((out (assoc-ref %outputs "out")))
  5968. (list (string-append "DESTDIR=" out)
  5969. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  5970. "libdir=/lib"
  5971. "docdir=/share/doc/cpupower"
  5972. "confdir=$(docdir)/examples"
  5973. ;; The Makefile recommends the following changes
  5974. "DEBUG=false"
  5975. "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
  5976. #:tests? #f)) ;no tests
  5977. (native-inputs `(("gettext" ,gettext-minimal)))
  5978. (inputs `(("pciutils" ,pciutils)))
  5979. (home-page (package-home-page linux-libre))
  5980. (synopsis "CPU frequency and voltage scaling tools for Linux")
  5981. (description
  5982. "cpupower is a set of user-space tools that use the cpufreq feature of the
  5983. Linux kernel to retrieve and control processor features related to power saving,
  5984. such as frequency and voltage scaling.")
  5985. (license license:gpl2)))
  5986. (define-public x86-energy-perf-policy
  5987. (package
  5988. (name "x86-energy-perf-policy")
  5989. (version (package-version linux-libre))
  5990. (source (package-source linux-libre))
  5991. (build-system gnu-build-system)
  5992. (arguments
  5993. '(#:tests? #f
  5994. #:phases
  5995. (modify-phases %standard-phases
  5996. (add-after 'unpack 'enter-subdirectory
  5997. (lambda _
  5998. (chdir "tools/power/x86/x86_energy_perf_policy")
  5999. #t))
  6000. (delete 'configure)
  6001. (add-before 'build 'fix-makefile
  6002. (lambda _
  6003. (substitute* "Makefile" (("/usr") ""))
  6004. #t)))
  6005. #:make-flags
  6006. (let ((out (assoc-ref %outputs "out")))
  6007. (list (string-append "DESTDIR=" out)
  6008. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
  6009. (supported-systems '("i686-linux" "x86_64-linux"))
  6010. (home-page (package-home-page linux-libre))
  6011. (synopsis "Display and update Intel-CPU energy-performance policy")
  6012. (description
  6013. "@command{x86_energy_perf_policy} displays and updates energy-performance
  6014. policy settings specific to Intel Architecture Processors. Settings are
  6015. accessed via Model Specific Register (MSR) updates, no matter if the Linux
  6016. cpufreq sub-system is enabled or not.")
  6017. (license license:gpl2)))
  6018. (define-public haveged
  6019. (package
  6020. (name "haveged")
  6021. (version "1.9.15")
  6022. (source
  6023. (origin
  6024. (method git-fetch)
  6025. (uri (git-reference
  6026. (url "https://github.com/jirka-h/haveged")
  6027. (commit (string-append "v" version))))
  6028. (file-name (git-file-name name version))
  6029. (sha256
  6030. (base32 "1zb790adsmqq3r26zlaxfrk2hpgxjcjz8l73hn3hli3l3javykvd"))))
  6031. (build-system gnu-build-system)
  6032. (arguments
  6033. `(#:configure-flags
  6034. (list "--disable-static")))
  6035. (home-page "https://www.issihosts.com/haveged")
  6036. (synopsis "Entropy source for the Linux random number generator")
  6037. (description
  6038. "haveged generates an unpredictable stream of random numbers for use by
  6039. Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
  6040. standard mechanisms for filling the entropy pool may not be sufficient for
  6041. systems with high needs or limited user interaction, such as headless servers.
  6042. @command{haveged} runs as a privileged daemon, harvesting randomness from the
  6043. indirect effects of hardware events on hidden processor state using the
  6044. @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
  6045. It tunes itself to its environment and provides the same built-in test suite
  6046. for the output stream as used on certified hardware security devices.
  6047. The quality of the randomness produced by this algorithm has not been proven.
  6048. It is recommended to run it together with another entropy source like rngd, and
  6049. not as a replacement for it.")
  6050. (license (list (license:non-copyleft "file://nist/mconf.h")
  6051. (license:non-copyleft "file://nist/packtest.c")
  6052. license:public-domain ; nist/dfft.c
  6053. license:gpl3+)))) ; everything else
  6054. (define-public ecryptfs-utils
  6055. (package
  6056. (name "ecryptfs-utils")
  6057. (version "111")
  6058. (source
  6059. (origin
  6060. (method url-fetch)
  6061. (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
  6062. version "/+download/ecryptfs-utils_"
  6063. version ".orig.tar.gz"))
  6064. (sha256
  6065. (base32
  6066. "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
  6067. (build-system gnu-build-system)
  6068. (arguments
  6069. `(#:configure-flags (list "--disable-pywrap")
  6070. #:phases
  6071. (modify-phases %standard-phases
  6072. (add-after 'patch-source-shebangs 'patch-hardcoded-paths
  6073. (lambda* (#:key inputs outputs #:allow-other-keys)
  6074. (let ((out (assoc-ref outputs "out"))
  6075. (utils-linux (assoc-ref inputs "utils-linux"))
  6076. (cryptsetup (assoc-ref inputs "cryptsetup"))
  6077. (linux-pam (assoc-ref inputs "linux-pam"))
  6078. (lvm2 (assoc-ref inputs "lvm2")))
  6079. (substitute* '("src/utils/ecryptfs-mount-private"
  6080. "src/utils/ecryptfs-umount-private"
  6081. "src/utils/ecryptfs-setup-private"
  6082. "src/utils/ecryptfs-setup-swap"
  6083. "src/utils/mount.ecryptfs.c"
  6084. "src/utils/umount.ecryptfs.c"
  6085. "src/pam_ecryptfs/pam_ecryptfs.c"
  6086. "src/desktop/ecryptfs-mount-private.desktop.in"
  6087. "src/desktop/ecryptfs-setup-private.desktop.in")
  6088. (("/bin/mount")
  6089. (string-append utils-linux "/bin/mount"))
  6090. (("/bin/umount")
  6091. (string-append utils-linux "/bin/umount"))
  6092. (("/sbin/mount.ecryptfs_private")
  6093. (string-append out "/sbin/mount.ecryptfs_private"))
  6094. (("/sbin/umount.ecryptfs_private")
  6095. (string-append out "/sbin/umount.ecryptfs_private"))
  6096. (("/usr/bin/ecryptfs-mount-private")
  6097. (string-append out "/bin/ecryptfs-mount-private"))
  6098. (("/usr/bin/ecryptfs-rewrite-file")
  6099. (string-append out "/bin/ecryptfs-rewrite-file"))
  6100. (("/usr/bin/ecryptfs-setup-private")
  6101. (string-append out "/bin/ecryptfs-setup-private"))
  6102. (("/sbin/cryptsetup")
  6103. (string-append cryptsetup "/sbin/cryptsetup"))
  6104. (("/sbin/unix_chkpwd")
  6105. (string-append linux-pam "/sbin/unix_chkpwd"))
  6106. (("/sbin/dmsetup")
  6107. (string-append lvm2 "/sbin/dmsetup")))))))))
  6108. (native-inputs
  6109. `(("intltool" ,intltool)
  6110. ("perl" ,perl) ; for pod2man
  6111. ("pkg-config" ,pkg-config)))
  6112. (inputs
  6113. `(("keyutils" ,keyutils)
  6114. ("linux-pam" ,linux-pam)
  6115. ("utils-linux" ,util-linux)
  6116. ("cryptsetup" ,cryptsetup)
  6117. ("lvm2" ,lvm2)
  6118. ("nss" ,nss)))
  6119. (home-page "https://ecryptfs.org/")
  6120. (synopsis "eCryptfs cryptographic file system utilities")
  6121. (description
  6122. "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
  6123. Each file's cryptographic meta-data is stored inside the file itself, along
  6124. with the encrypted contents. This allows individual encrypted files to be
  6125. copied between hosts and still be decrypted with the proper key. eCryptfs is a
  6126. native Linux file system, and has been part of the Linux kernel since version
  6127. 2.6.19. This package contains the userland utilities to manage it.")
  6128. ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
  6129. ;; grant additional permission to link with OpenSSL.
  6130. (license license:gpl2+)))
  6131. (define-public libnfsidmap
  6132. (package
  6133. (name "libnfsidmap")
  6134. (version "0.27")
  6135. (source
  6136. (origin
  6137. (method url-fetch)
  6138. (uri (string-append "https://fedorapeople.org/~steved/"
  6139. name "/" version "/" name "-" version ".tar.bz2"))
  6140. (sha256
  6141. (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
  6142. (build-system gnu-build-system)
  6143. (arguments
  6144. `(#:configure-flags (list
  6145. (string-append "--with-pluginpath="
  6146. (assoc-ref %outputs "out")
  6147. "/lib/libnfsidmap"))))
  6148. (native-inputs
  6149. `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
  6150. (home-page
  6151. "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
  6152. (synopsis "NFSv4 support library for name/ID mapping")
  6153. (description "Libnfsidmap is a library holding mulitiple methods of
  6154. mapping names to ids and visa versa, mainly for NFSv4. It provides an
  6155. extensible array of mapping functions, currently consisting of two choices:
  6156. the default @code{nsswitch} and the experimental @code{umich_ldap}.")
  6157. (license (license:non-copyleft "file://COPYING"
  6158. "See COPYING in the distribution."))))
  6159. (define-public module-init-tools
  6160. (package
  6161. (name "module-init-tools")
  6162. (version "3.16")
  6163. (source (origin
  6164. (method url-fetch)
  6165. (uri (string-append
  6166. "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
  6167. "module-init-tools-" version ".tar.bz2"))
  6168. (sha256
  6169. (base32
  6170. "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
  6171. (patches (search-patches "module-init-tools-moduledir.patch"))))
  6172. (build-system gnu-build-system)
  6173. (arguments
  6174. ;; FIXME: The upstream tarball lacks man pages, and building them would
  6175. ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
  6176. ;; but they vanished. In the meantime, fake it.
  6177. '(#:phases
  6178. (modify-phases %standard-phases
  6179. (add-before 'configure 'fake-docbook
  6180. (lambda _
  6181. (substitute* "Makefile.in"
  6182. (("^DOCBOOKTOMAN.*$")
  6183. "DOCBOOKTOMAN = true\n"))
  6184. #t)))))
  6185. (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
  6186. (synopsis "Tools for loading and managing Linux kernel modules")
  6187. (description
  6188. "Tools for loading and managing Linux kernel modules, such as
  6189. @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
  6190. (license license:gpl2+)))
  6191. (define-public mcelog
  6192. (package
  6193. (name "mcelog")
  6194. (version "176")
  6195. (source
  6196. (origin
  6197. (method git-fetch)
  6198. (uri (git-reference
  6199. (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
  6200. (commit (string-append "v" version))))
  6201. (file-name (git-file-name name version))
  6202. (sha256
  6203. (base32 "1mlwn6ck9qiwqa2vg5wg1gvfva3jv7ygjr7p7bam0qszajs5pirk"))
  6204. (modules '((guix build utils)))
  6205. (snippet
  6206. `(begin
  6207. ;; The checkout lacks a .git directory, breaking ‘git describe’.
  6208. (substitute* "Makefile"
  6209. (("\"unknown\"") (string-append "\"v" ,version "\"")))
  6210. #t))))
  6211. (build-system gnu-build-system)
  6212. (arguments
  6213. `(#:phases (modify-phases %standard-phases
  6214. (delete 'configure)) ; no configure script
  6215. #:make-flags (let ((out (assoc-ref %outputs "out")))
  6216. (list (string-append "CC=" ,(cc-for-target))
  6217. (string-append "prefix=" out)
  6218. (string-append "DOCDIR=" out "/share/doc/"
  6219. ,name "-" ,version)
  6220. "etcprefix=$(DOCDIR)/examples"))
  6221. ;; The tests will only run as root on certain supported CPU models.
  6222. #:tests? #f))
  6223. (supported-systems (list "i686-linux" "x86_64-linux"))
  6224. (home-page "https://mcelog.org/")
  6225. (synopsis "Machine check monitor for x86 Linux systems")
  6226. (description
  6227. "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
  6228. systems running the kernel Linux. It can also perform user-defined tasks, such
  6229. as bringing bad pages off-line, when configurable error thresholds are
  6230. exceeded.")
  6231. (license license:gpl2)))
  6232. (define-public mtd-utils
  6233. (package
  6234. (name "mtd-utils")
  6235. (version "2.1.2")
  6236. (source (origin
  6237. (method url-fetch)
  6238. (uri (string-append
  6239. "ftp://ftp.infradead.org/pub/mtd-utils/"
  6240. "mtd-utils-" version ".tar.bz2"))
  6241. (sha256
  6242. (base32
  6243. "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
  6244. (arguments
  6245. '(#:configure-flags '("--enable-unit-tests")))
  6246. (native-inputs
  6247. `(("cmocka" ,cmocka)
  6248. ("pkg-config" ,pkg-config)))
  6249. (inputs
  6250. `(("acl" ,acl) ; extended attributes (xattr)
  6251. ("libuuid" ,util-linux "lib")
  6252. ("lzo" ,lzo)
  6253. ("openssl" ,openssl) ; optional crypto support
  6254. ("zlib" ,zlib)
  6255. ("zstd" ,zstd "lib")))
  6256. (build-system gnu-build-system)
  6257. (synopsis "MTD Flash Storage Utilities")
  6258. (description "This package provides utilities for testing, partitioning, etc
  6259. of flash storage.")
  6260. (home-page "http://www.linux-mtd.infradead.org/")
  6261. (license
  6262. (list license:gpl2 ; Almost everything is gpl2 or gpl2+
  6263. license:mpl1.1 ; All ftl* files
  6264. license:expat)))) ; libiniparser
  6265. (define-public libseccomp
  6266. (package
  6267. (name "libseccomp")
  6268. (version "2.5.2")
  6269. (source (origin
  6270. (method url-fetch)
  6271. (uri (string-append "https://github.com/seccomp/libseccomp/"
  6272. "releases/download/v" version
  6273. "/libseccomp-" version ".tar.gz"))
  6274. (sha256
  6275. (base32
  6276. "1pw7rd4gwqpmraipgdqkdkhnx4ql35wrn3lnjgl6pncinkgm59hp"))))
  6277. (build-system gnu-build-system)
  6278. (arguments
  6279. '(#:configure-flags '("--disable-static")
  6280. #:phases (modify-phases %standard-phases
  6281. (add-before 'check 'skip-load-test
  6282. (lambda _
  6283. ;; This test does a native system call and fails when
  6284. ;; run under QEMU user-mode emulation. Just skip it.
  6285. (delete-file "tests/52-basic-load.tests"))))))
  6286. (native-inputs
  6287. `(("gperf" ,gperf)
  6288. ("which" ,which)))
  6289. (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
  6290. (description "The libseccomp library provides an easy to use, platform
  6291. independent, interface to the Linux Kernel's syscall filtering mechanism. The
  6292. libseccomp API is designed to abstract away the underlying BPF based syscall
  6293. filter language and present a more conventional function-call based filtering
  6294. interface that should be familiar to, and easily adopted by, application
  6295. developers.")
  6296. (home-page "https://github.com/seccomp/libseccomp")
  6297. (license license:lgpl2.1)))
  6298. (define-public radeontop
  6299. (package
  6300. (name "radeontop")
  6301. (version "1.3")
  6302. (source
  6303. (origin
  6304. (method git-fetch)
  6305. (uri (git-reference
  6306. (url "https://github.com/clbr/radeontop")
  6307. (commit (string-append "v" version))))
  6308. (file-name (git-file-name name version))
  6309. (sha256
  6310. (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
  6311. (build-system gnu-build-system)
  6312. (arguments
  6313. `(#:phases (modify-phases %standard-phases
  6314. ;; getver.sh uses ‘git --describe’, isn't worth an extra git
  6315. ;; dependency, and doesn't even work on release(!) tarballs.
  6316. (add-after 'unpack 'report-correct-version
  6317. (lambda _
  6318. (substitute* "getver.sh"
  6319. (("ver=unknown")
  6320. (string-append "ver=" ,version)))
  6321. #t))
  6322. (delete 'configure)) ; no configure script
  6323. #:make-flags (list "CC=gcc"
  6324. (string-append "PREFIX=" %output))
  6325. #:tests? #f)) ; no tests
  6326. (native-inputs
  6327. `(("gettext" ,gettext-minimal)
  6328. ("pkg-config" ,pkg-config)))
  6329. (inputs
  6330. `(("libdrm" ,libdrm)
  6331. ("libpciaccess" ,libpciaccess)
  6332. ("libxcb" ,libxcb)
  6333. ("ncurses" ,ncurses)))
  6334. (home-page "https://github.com/clbr/radeontop/")
  6335. (synopsis "Usage monitor for AMD Radeon graphics")
  6336. (description "RadeonTop monitors resource consumption on supported AMD
  6337. Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
  6338. a terminal or saved to a file for further processing. It measures both the
  6339. activity of the GPU as a whole, which is also accurate during OpenCL
  6340. computations, as well as separate component statistics that are only meaningful
  6341. under OpenGL graphics workloads.")
  6342. (license license:gpl3)))
  6343. (define-public efivar
  6344. (package
  6345. (name "efivar")
  6346. (version "37")
  6347. (source (origin
  6348. (method url-fetch)
  6349. (uri (string-append "https://github.com/rhboot/" name
  6350. "/releases/download/" version "/" name
  6351. "-" version ".tar.bz2"))
  6352. (patches (search-patches "efivar-gcc-compat.patch"))
  6353. (sha256
  6354. (base32
  6355. "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))
  6356. (modules '((guix build utils)))
  6357. (snippet
  6358. '(begin
  6359. ;; Compile everything within a single LTO partition
  6360. ;; to work around ordering issues in the code. Try
  6361. ;; removing this for versions > 37.
  6362. (substitute* "Make.defaults"
  6363. (("-flto")
  6364. "-flto -flto-partition=one"))))))
  6365. (build-system gnu-build-system)
  6366. (arguments
  6367. `(;; Tests require a UEFI system and is not detected in the chroot.
  6368. #:tests? #f
  6369. #:make-flags (list (string-append "prefix=" %output)
  6370. (string-append "libdir=" %output "/lib")
  6371. (string-append "CC_FOR_BUILD=" ,(cc-for-target))
  6372. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  6373. #:phases
  6374. (modify-phases %standard-phases
  6375. (delete 'configure))))
  6376. (native-inputs
  6377. `(("pkg-config" ,pkg-config)))
  6378. (inputs
  6379. `(("popt" ,popt)))
  6380. (home-page "https://github.com/rhboot/efivar")
  6381. (synopsis "Tool and library to manipulate EFI variables")
  6382. (description "This package provides a library and a command line
  6383. interface to the variable facility of UEFI boot firmware.")
  6384. (license license:lgpl2.1+)))
  6385. (define-public efibootmgr
  6386. (package
  6387. (name "efibootmgr")
  6388. (version "17")
  6389. (source
  6390. (origin
  6391. (method git-fetch)
  6392. (uri (git-reference
  6393. (url "https://github.com/rhinstaller/efibootmgr")
  6394. (commit version)))
  6395. (file-name (git-file-name name version))
  6396. (sha256
  6397. (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
  6398. (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
  6399. (build-system gnu-build-system)
  6400. (arguments
  6401. `(#:tests? #f ;no tests
  6402. #:make-flags (list (string-append "prefix=" %output)
  6403. (string-append "libdir=" %output "/lib")
  6404. ;; EFIDIR denotes a subdirectory relative to the
  6405. ;; EFI System Partition where the loader will be
  6406. ;; installed (known as OS_VENDOR in the code).
  6407. ;; GRUB overrides this, as such it's only used if
  6408. ;; nothing else is specified on the command line.
  6409. "EFIDIR=gnu")
  6410. #:phases (modify-phases %standard-phases (delete 'configure))))
  6411. (native-inputs
  6412. `(("pkg-config" ,pkg-config)))
  6413. (inputs
  6414. `(("efivar" ,efivar)
  6415. ("popt" ,popt)))
  6416. (home-page "https://github.com/rhinstaller/efibootmgr")
  6417. (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
  6418. (description
  6419. "@code{efibootmgr} is a user-space application to modify the Intel
  6420. Extensible Firmware Interface (EFI) Boot Manager. This application can
  6421. create and destroy boot entries, change the boot order, change the next
  6422. running boot option, and more.")
  6423. (license license:gpl2+)))
  6424. (define-public sysstat
  6425. (package
  6426. (name "sysstat")
  6427. (version "12.4.3")
  6428. (source
  6429. (origin
  6430. (method url-fetch)
  6431. (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
  6432. "sysstat-" version ".tar.xz"))
  6433. (sha256
  6434. (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
  6435. (build-system gnu-build-system)
  6436. (arguments
  6437. `(#:tests? #f ; no test suite.
  6438. ;; Without this flag, it tries to install the man pages with group 'root'
  6439. ;; and fails because /etc/passwd lacks an entry for the root user.
  6440. #:configure-flags
  6441. (list "--disable-file-attr"
  6442. (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
  6443. #:phases
  6444. (modify-phases %standard-phases
  6445. ;; The build process tries to create '/var/lib/sa', so we skip that
  6446. ;; instruction.
  6447. (add-after 'build 'skip-touching-var
  6448. (lambda _
  6449. (substitute* "Makefile"
  6450. (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
  6451. ""))
  6452. #t)))))
  6453. (home-page "http://sebastien.godard.pagesperso-orange.fr/")
  6454. (synopsis "Performance monitoring tools for Linux")
  6455. (description "The sysstat utilities are a collection of performance
  6456. monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
  6457. @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
  6458. @code{sadf} and @code{sa}.")
  6459. (license license:gpl2+)))
  6460. (define-public light
  6461. (package
  6462. (name "light")
  6463. (version "1.2.2")
  6464. (source
  6465. (origin
  6466. (method git-fetch)
  6467. (uri (git-reference
  6468. (url "https://github.com/haikarainen/light")
  6469. (commit (string-append "v" version))))
  6470. (sha256
  6471. (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
  6472. (file-name (git-file-name name version))))
  6473. (build-system gnu-build-system)
  6474. (arguments
  6475. `(#:configure-flags '("CFLAGS=-fcommon")
  6476. #:phases
  6477. (modify-phases %standard-phases
  6478. (add-after 'unpack 'patch-udev-rules-absolute-path-bins
  6479. (lambda* (#:key inputs #:allow-other-keys)
  6480. (substitute* "90-backlight.rules"
  6481. (("/bin/chgrp") (which "chgrp"))
  6482. (("/bin/chmod") (which "chmod")))
  6483. #t))
  6484. (add-after 'install 'install-udev-rules
  6485. (lambda* (#:key outputs #:allow-other-keys)
  6486. (let ((out (assoc-ref outputs "out")))
  6487. (install-file
  6488. "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
  6489. #t))))))
  6490. (native-inputs
  6491. `(("autoconf" ,autoconf)
  6492. ("automake" ,automake)))
  6493. (home-page "https://haikarainen.github.io/light/")
  6494. (synopsis "GNU/Linux application to control backlights")
  6495. (description
  6496. "Light is a program to send commands to screen backlight controllers
  6497. under GNU/Linux. Features include:
  6498. @itemize
  6499. @item It does not rely on X.
  6500. @item Light can automatically figure out the best controller to use, making
  6501. full use of underlying hardware.
  6502. @item It is possible to set a minimum brightness value, as some controllers
  6503. set the screen to be pitch black at a value of 0 (or higher).
  6504. @end itemize\n")
  6505. (license license:gpl3+)))
  6506. (define-public brightnessctl
  6507. (package
  6508. (name "brightnessctl")
  6509. (version "0.5.1")
  6510. (home-page "https://github.com/Hummer12007/brightnessctl")
  6511. (source (origin
  6512. (method git-fetch)
  6513. (uri (git-reference (url home-page) (commit version)))
  6514. (file-name (git-file-name name version))
  6515. (sha256
  6516. (base32
  6517. "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
  6518. (patches (search-patches "brightnessctl-elogind-support.patch"))))
  6519. (build-system gnu-build-system)
  6520. (arguments
  6521. `(#:tests? #f ; no tests
  6522. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  6523. (string-append "PREFIX=" %output)
  6524. (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
  6525. "ENABLE_SYSTEMD=1")
  6526. #:phases
  6527. (modify-phases %standard-phases
  6528. (delete 'configure)
  6529. (add-after 'unpack 'adjust-udev-rules
  6530. (lambda _
  6531. (substitute* "Makefile"
  6532. (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
  6533. (substitute* "90-brightnessctl.rules"
  6534. (("/bin/") "/run/current-system/profile/bin/"))
  6535. #t)))))
  6536. (native-inputs
  6537. `(("pkg-config" ,pkg-config)))
  6538. (inputs
  6539. `(("elogind" ,elogind)))
  6540. (synopsis "Backlight and LED brightness control")
  6541. (description
  6542. "This program allows you read and control device brightness. Devices
  6543. include backlight and LEDs. It can also preserve current brightness before
  6544. applying the operation, such as on lid close.
  6545. The appropriate permissions must be set on the backlight or LED control
  6546. interface in sysfs, which can be accomplished with the included udev rules.")
  6547. (license license:expat)))
  6548. (define-public tlp
  6549. (package
  6550. (name "tlp")
  6551. (version "1.4.0")
  6552. (source
  6553. (origin
  6554. (method git-fetch)
  6555. (uri (git-reference
  6556. (url "https://github.com/linrunner/TLP")
  6557. (commit version)))
  6558. (file-name (git-file-name name version))
  6559. (sha256
  6560. (base32 "0bnsz9bw9rj1apl80jwz39zj5mnlps3jbckihvl8bbdbrbhj6p06"))))
  6561. (native-inputs
  6562. `(("shellcheck" ,shellcheck)))
  6563. (inputs
  6564. `(("bash" ,bash)
  6565. ("dbus" ,dbus)
  6566. ("ethtool" ,ethtool)
  6567. ("eudev" ,eudev)
  6568. ("grep" ,grep)
  6569. ("hdparm" ,hdparm)
  6570. ("inetutils" ,inetutils)
  6571. ("iw" ,iw)
  6572. ("kmod" ,kmod)
  6573. ("pciutils" ,pciutils)
  6574. ("perl" ,perl)
  6575. ("rfkill" ,rfkill)
  6576. ("sed" ,sed)
  6577. ("usbutils" ,usbutils)
  6578. ("util-linux" ,util-linux)
  6579. ("wireless-tools" ,wireless-tools)
  6580. ,@(if (let ((system (or (%current-target-system)
  6581. (%current-system))))
  6582. (or (string-prefix? "i686-" system)
  6583. (string-prefix? "x86_64-" system)))
  6584. `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
  6585. '())))
  6586. (build-system gnu-build-system)
  6587. (arguments
  6588. ;; XXX: The full test suite is run with "checkall" but it requires
  6589. ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
  6590. `(#:test-target "shellcheck"
  6591. #:modules ((guix build gnu-build-system)
  6592. (guix build utils)
  6593. (srfi srfi-1))
  6594. #:phases
  6595. (modify-phases %standard-phases
  6596. (delete 'configure) ; no configure script
  6597. (add-before 'build 'setenv
  6598. (lambda* (#:key outputs #:allow-other-keys)
  6599. (let ((out (assoc-ref outputs "out")))
  6600. (setenv "TLP_WITH_SYSTEMD" "0")
  6601. (setenv "TLP_NO_INIT" "1")
  6602. (setenv "TLP_NO_PMUTILS" "1")
  6603. (setenv "TLP_SBIN" (string-append out "/bin"))
  6604. (setenv "TLP_BATD" (string-append out "/share/tlp/bat.d"))
  6605. (setenv "TLP_BIN" (string-append out "/bin"))
  6606. (setenv "TLP_TLIB" (string-append out "/share/tlp"))
  6607. (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
  6608. (setenv "TLP_ULIB" (string-append out "/lib/udev"))
  6609. (setenv "TLP_CONFDEF"
  6610. (string-append out "/share/tlp/defaults.conf"))
  6611. (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
  6612. (setenv "TLP_CONFREN"
  6613. (string-append out "/share/tlp/rename.conf"))
  6614. (setenv "TLP_ELOD"
  6615. (string-append out "/lib/elogind/system-sleep"))
  6616. (setenv "TLP_SHCPL"
  6617. (string-append out "/share/bash-completion/completions"))
  6618. (setenv "TLP_MAN" (string-append out "/share/man"))
  6619. (setenv "TLP_META" (string-append out "/share/metainfo"))
  6620. #t)))
  6621. (add-before 'install 'fix-installation
  6622. (lambda _
  6623. ;; Stop the Makefile from trying to create system directories.
  6624. (substitute* "Makefile"
  6625. (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
  6626. (("install -d -m 755 \\$\\(_VAR\\)") "#"))
  6627. #t))
  6628. (replace 'install
  6629. (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
  6630. (add-after 'install 'wrap
  6631. (lambda* (#:key inputs outputs #:allow-other-keys)
  6632. (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
  6633. (bin-files (find-files bin ".*")))
  6634. (define (bin-directory input-name)
  6635. (let ((p (assoc-ref inputs input-name)))
  6636. (and p (string-append p "/bin"))))
  6637. (define (sbin-directory input-name)
  6638. (string-append (assoc-ref inputs input-name) "/sbin"))
  6639. (for-each (lambda (program)
  6640. (wrap-program program
  6641. `("PATH" ":" prefix
  6642. ,(append
  6643. (filter-map bin-directory
  6644. '("bash"
  6645. "coreutils"
  6646. "dbus"
  6647. "eudev"
  6648. "grep"
  6649. "inetutils"
  6650. "kmod"
  6651. "perl"
  6652. "sed"
  6653. "usbutils"
  6654. "util-linux"
  6655. "x86-energy-perf-policy"))
  6656. (filter-map sbin-directory
  6657. '("ethtool"
  6658. "hdparm"
  6659. "iw"
  6660. "pciutils"
  6661. "rfkill"
  6662. "wireless-tools"))))))
  6663. bin-files)
  6664. #t))))))
  6665. (home-page "https://linrunner.de/en/tlp/tlp.html")
  6666. (synopsis "Power management tool for Linux")
  6667. (description "TLP is a power management tool for Linux. It comes with
  6668. a default configuration already optimized for battery life. Nevertheless,
  6669. TLP is customizable to fulfil system requirements. TLP settings are applied
  6670. every time the power supply source is changed.")
  6671. ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
  6672. ;; rest is GPLv2+.
  6673. (license (list license:gpl2+ license:gpl3+))))
  6674. (define-public lshw
  6675. (package
  6676. (name "lshw")
  6677. (version "B.02.19.2")
  6678. (source (origin
  6679. (method url-fetch)
  6680. (uri (string-append "https://www.ezix.org/software/"
  6681. "files/lshw-" version
  6682. ".tar.gz"))
  6683. (sha256
  6684. (base32
  6685. "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
  6686. (build-system gnu-build-system)
  6687. (arguments
  6688. `(#:phases (modify-phases %standard-phases (delete 'configure))
  6689. #:tests? #f ; no tests
  6690. #:make-flags
  6691. (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  6692. (synopsis "List hardware information")
  6693. (description
  6694. "@command{lshw} (Hardware Lister) is a small tool to provide
  6695. detailed information on the hardware configuration of the machine.
  6696. It can report exact memory configuration, firmware version, mainboard
  6697. configuration, CPU version and speed, cache configuration, bus speed,
  6698. and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
  6699. machines (PowerMac G4 is known to work).")
  6700. (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
  6701. (license license:gpl2+)))
  6702. (define-public libmnl
  6703. (package
  6704. (name "libmnl")
  6705. (version "1.0.4")
  6706. (source
  6707. (origin
  6708. (method url-fetch)
  6709. (uri (string-append "mirror://netfilter.org/libmnl/"
  6710. "libmnl-" version ".tar.bz2"))
  6711. (sha256
  6712. (base32
  6713. "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
  6714. (build-system gnu-build-system)
  6715. (home-page "https://www.netfilter.org/projects/libmnl/")
  6716. (synopsis "Netlink utility library")
  6717. (description "Libmnl is a minimalistic user-space library oriented to
  6718. Netlink developers. There are a lot of common tasks in parsing, validating,
  6719. constructing of both the Netlink header and TLVs that are repetitive and easy to
  6720. get wrong. This library aims to provide simple helpers that allows you to
  6721. re-use code and to avoid re-inventing the wheel.")
  6722. (license license:lgpl2.1+)))
  6723. (define-public libnftnl
  6724. (package
  6725. (name "libnftnl")
  6726. (version "1.2.0")
  6727. (source
  6728. (origin
  6729. (method url-fetch)
  6730. (uri (string-append "mirror://netfilter.org/libnftnl/"
  6731. "libnftnl-" version ".tar.bz2"))
  6732. (sha256
  6733. (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
  6734. (build-system gnu-build-system)
  6735. (native-inputs
  6736. `(("pkg-config" ,pkg-config)))
  6737. (inputs
  6738. `(("libmnl" ,libmnl)))
  6739. (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
  6740. (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
  6741. (description "Libnftnl is a userspace library providing a low-level netlink
  6742. programming interface to the in-kernel nf_tables subsystem. The library
  6743. libnftnl has been previously known as libnftables. This library is currently
  6744. used by nftables.")
  6745. (license license:gpl2+)))
  6746. (define-public nftables
  6747. (package
  6748. (name "nftables")
  6749. (version "1.0.0")
  6750. (source
  6751. (origin
  6752. (method url-fetch)
  6753. (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
  6754. version ".tar.bz2")
  6755. (string-append "https://www.nftables.org/projects/nftables"
  6756. "/files/nftables-" version ".tar.bz2")))
  6757. (sha256
  6758. (base32 "1x25zs2czmn14mmq1nqi4zibsvh04vqjbx5lxj42nylnmxym9gsq"))))
  6759. (build-system gnu-build-system)
  6760. (arguments `(#:configure-flags
  6761. '("--disable-man-doc" ; FIXME: needs docbook2x
  6762. "--disable-static")))
  6763. (inputs `(("gmp" ,gmp)
  6764. ("libmnl" ,libmnl)
  6765. ("libnftnl" ,libnftnl)
  6766. ("readline" ,readline)))
  6767. (native-inputs `(("pkg-config" ,pkg-config)
  6768. ("bison" ,bison)
  6769. ("flex" ,flex)))
  6770. (home-page "https://www.nftables.org")
  6771. (synopsis "Userspace utility for Linux packet filtering")
  6772. (description "nftables is the project that aims to replace the existing
  6773. {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
  6774. filtering framework, a new userspace utility and also a compatibility layer for
  6775. {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
  6776. infrastructure such as the existing hooks, the connection tracking system, the
  6777. userspace queueing component and the logging subsystem.")
  6778. (license license:gpl2)))
  6779. (define-public proot
  6780. (let ((revision "0")
  6781. (commit "a70023ab3db47d011265451b99a1abef7b9d7afc"))
  6782. (package
  6783. (name "proot")
  6784. ;; The last stable release was made in 2015, and fails to build for the
  6785. ;; aarch64 platform. Use the latest commit, which includes fixes for
  6786. ;; the supported ARM architectures and the test suite, among others.
  6787. (version (git-version "5.2.0-alpha" revision commit))
  6788. (source
  6789. (origin
  6790. (method git-fetch)
  6791. (uri (git-reference
  6792. (url "https://github.com/proot-me/PRoot")
  6793. (commit (string-append commit))))
  6794. (file-name (git-file-name name version))
  6795. (sha256
  6796. (base32 "1kmry3rb967phxnxjfnx310gy1d4gpmjd6fp3hbm9v9jciysxy4z"))))
  6797. (build-system gnu-build-system)
  6798. ;; The powerpc64le-linux and mips64el-linux architectures are not
  6799. ;; supported (see:
  6800. ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
  6801. (supported-systems '("x86_64-linux" "i686-linux"
  6802. "armhf-linux" "aarch64-linux" "i586-gnu"))
  6803. (arguments
  6804. ;; Disable the test suite on armhf-linux, as there are too many
  6805. ;; failures to keep track of (see for example:
  6806. ;; https://github.com/proot-me/proot/issues/286).
  6807. `(#:tests? ,(not (string-prefix? "armhf"
  6808. (or (%current-target-system)
  6809. (%current-system))))
  6810. #:make-flags '("-C" "src")
  6811. #:phases (modify-phases %standard-phases
  6812. (add-after 'unpack 'patch-sources
  6813. (lambda* (#:key inputs #:allow-other-keys)
  6814. (substitute* (find-files "src" "\\.[ch]$")
  6815. (("\"/bin/sh\"")
  6816. (string-append "\"" (assoc-ref inputs "bash")
  6817. "/bin/sh\"")))
  6818. (substitute* "src/GNUmakefile"
  6819. (("/bin/echo") (which "echo"))
  6820. (("^VERSION = .*")
  6821. (string-append "VERSION := " ,version "\n")))
  6822. (substitute* (find-files "test" "\\.sh$")
  6823. ;; Some of the tests try to "bind-mount" /bin/true.
  6824. (("-b /bin/true:")
  6825. (string-append "-b " (which "true") ":"))
  6826. ;; Likewise for /bin.
  6827. (("-b /bin:") "-b /gnu:")
  6828. ;; Others try to run /bin/sh.
  6829. (("/bin/sh") (which "sh"))
  6830. ;; Others assume /etc/fstab exists.
  6831. (("/etc/fstab") "/etc/passwd"))
  6832. (substitute* "test/GNUmakefile"
  6833. (("-b /bin:") "-b /gnu:"))
  6834. (substitute* "test/test-c6b77b77.mk"
  6835. (("/bin/bash") (which "bash"))
  6836. (("/usr/bin/test") (which "test")))
  6837. (substitute* "test/test-16573e73.c"
  6838. (("/bin/([a-z-]+)" _ program)
  6839. (which program)))
  6840. (substitute* "test/test-d2175fc3.sh"
  6841. (("\\^/bin/true\\$") "$(which true)"))
  6842. (substitute* "test/test-5467b986.sh"
  6843. (("-w /usr") "-w /gnu")
  6844. (("-w usr") "-w gnu")
  6845. (("/usr/share") "/gnu/store")
  6846. (("share") "store"))
  6847. (substitute* "test/test-092c5e26.sh"
  6848. (("-q echo ")
  6849. "-q $(which echo) "))
  6850. ;; The following tests are known to fail (see:
  6851. ;; https://github.com/proot-me/proot/issues/184).
  6852. (delete-file "test/test-0228fbe7.sh")
  6853. (delete-file "test/test-2db65cd2.sh")
  6854. (delete-file "test/test-cdd39012.sh")
  6855. (delete-file "test/test-d92b57ca.sh")
  6856. ;; This one fails on a waitpid call that returns 1 (see:
  6857. ;; https://github.com/proot-me/proot/issues/261).
  6858. (delete-file "test/test-ptrace01.c")
  6859. ;; XXX: This test fails in an obscure corner case, just
  6860. ;; skip it.
  6861. (delete-file "test/test-kkkkkkkk.c")
  6862. ;; This one requires Docker.
  6863. (delete-file "test/test-docker.sh")
  6864. ;; The socket tests requires networking.
  6865. (for-each delete-file
  6866. (find-files "test" "test-socket.*\\.sh$"))))
  6867. (delete 'configure)
  6868. (add-after 'build 'build-manpage
  6869. (lambda _
  6870. (with-directory-excursion "doc"
  6871. (invoke "make" "proot/man.1" "SUFFIX=.py"))))
  6872. (replace 'check
  6873. (lambda* (#:key tests? #:allow-other-keys)
  6874. (when tests?
  6875. (let ((n (parallel-job-count)))
  6876. ;; Most of the tests expect "/bin" to be in $PATH so
  6877. ;; they can run things that live in $ROOTFS/bin.
  6878. (setenv "PATH"
  6879. (string-append (getenv "PATH") ":/bin"))
  6880. (invoke "make" "check" "-C" "test"
  6881. ;;"V=1"
  6882. "-j" (number->string n))))))
  6883. (replace 'install
  6884. (lambda* (#:key outputs #:allow-other-keys)
  6885. ;; The 'install' rule does nearly nothing.
  6886. (let* ((out (assoc-ref outputs "out"))
  6887. (man1 (string-append out "/share/man/man1")))
  6888. ;; TODO: 'make install-care' (does not even
  6889. ;; build currently.)
  6890. (invoke "make" "-C" "src" "install"
  6891. (string-append "PREFIX=" out))
  6892. (mkdir-p man1)
  6893. (copy-file "doc/proot/man.1"
  6894. (string-append man1 "/proot.1"))))))))
  6895. (native-inputs `(("which" ,which)
  6896. ;; For 'mcookie', used by some of the tests.
  6897. ("util-linux" ,util-linux)
  6898. ("coreutils" ,coreutils)
  6899. ("pkg-config" ,pkg-config)
  6900. ;; For rst2man, used to generate the manual page.
  6901. ("python-docutils" ,python-docutils)))
  6902. (inputs `(("libarchive" ,libarchive)
  6903. ("talloc" ,talloc)))
  6904. (home-page "https://github.com/proot-me/PRoot")
  6905. (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
  6906. (description
  6907. "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
  6908. and @code{binfmt_misc}. This means that users don't need any privileges or
  6909. setup to do things like using an arbitrary directory as the new root
  6910. file system, making files accessible somewhere else in the file system
  6911. hierarchy, or executing programs built for another CPU architecture
  6912. transparently through QEMU user-mode. Also, developers can use PRoot as a
  6913. generic process instrumentation engine thanks to its extension mechanism.
  6914. Technically PRoot relies on @code{ptrace}, an unprivileged system-call
  6915. available in the kernel Linux.")
  6916. (license license:gpl2+))))
  6917. (define-public proot-static
  6918. (package
  6919. (inherit proot)
  6920. (name "proot-static")
  6921. (synopsis
  6922. "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
  6923. (inputs `(("talloc" ,talloc/static)))
  6924. (arguments
  6925. (substitute-keyword-arguments (package-arguments proot)
  6926. ((#:make-flags flags)
  6927. `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
  6928. ((#:phases phases)
  6929. `(modify-phases ,phases
  6930. (add-after 'strip 'remove-store-references
  6931. (lambda* (#:key outputs #:allow-other-keys)
  6932. (let* ((out (assoc-ref outputs "out")))
  6933. (with-directory-excursion out
  6934. (remove-store-references "bin/proot")
  6935. #t))))))
  6936. ((#:allowed-references _ '("out"))
  6937. '("out"))))))
  6938. (define-public cpuid
  6939. (package
  6940. (name "cpuid")
  6941. (version "20201006")
  6942. (source (origin
  6943. (method url-fetch)
  6944. (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
  6945. version ".src.tar.gz"))
  6946. (sha256
  6947. (base32
  6948. "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
  6949. (build-system gnu-build-system)
  6950. (arguments
  6951. `(#:make-flags
  6952. (list (string-append "CC=" ,(cc-for-target)))
  6953. #:tests? #f ; no tests
  6954. #:phases (modify-phases %standard-phases
  6955. (delete 'configure) ; no configure script
  6956. (add-before 'install 'fix-makefile
  6957. (lambda* (#:key outputs #:allow-other-keys)
  6958. (substitute* "Makefile"
  6959. (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
  6960. ;; Make the compressed manpages writable so that the
  6961. ;; reset-gzip-timestamps phase does not error out.
  6962. (substitute* "Makefile"
  6963. (("-m 444") "-m 644"))
  6964. #t)))))
  6965. (inputs `(("perl" ,perl)))
  6966. (supported-systems '("i686-linux" "x86_64-linux"))
  6967. (home-page "http://www.etallen.com/cpuid.html")
  6968. (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
  6969. (description "cpuid dumps detailed information about the CPU(s) gathered
  6970. from the CPUID instruction, and also determines the exact model of CPU(s). It
  6971. supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
  6972. NexGen, Rise, and SiS CPUs.")
  6973. (license license:gpl2+)))
  6974. (define-public jmtpfs
  6975. (package
  6976. (name "jmtpfs")
  6977. (version "0.5")
  6978. (source
  6979. (origin
  6980. (method git-fetch)
  6981. (uri (git-reference
  6982. (url "https://github.com/JasonFerrara/jmtpfs")
  6983. (commit (string-append "v" version))))
  6984. (file-name (git-file-name name version))
  6985. (sha256
  6986. (base32
  6987. "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
  6988. (build-system gnu-build-system)
  6989. (inputs
  6990. `(("file" ,file)
  6991. ("fuse" ,fuse)
  6992. ("libmtp" ,libmtp)))
  6993. (native-inputs
  6994. `(("pkg-config" ,pkg-config)))
  6995. (home-page "https://github.com/JasonFerrara/jmtpfs")
  6996. (synopsis "Use a FUSE file system to access data over MTP")
  6997. (description "jmtpfs uses FUSE (file system in userspace) to provide access
  6998. to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
  6999. the MTP device as a file system.")
  7000. (license license:gpl3)))
  7001. (define-public procenv
  7002. (package
  7003. (name "procenv")
  7004. (version "0.58")
  7005. (source
  7006. (origin
  7007. (method git-fetch)
  7008. (uri (git-reference
  7009. (url "https://github.com/jamesodhunt/procenv")
  7010. (commit version)))
  7011. (file-name (git-file-name name version))
  7012. (sha256
  7013. (base32 "137n630qzml4yraqzp2fij8nzn8341nf8d58yzfhk8ddlzi60sfm"))))
  7014. (build-system gnu-build-system)
  7015. (native-inputs
  7016. `(("pkg-config" ,pkg-config)
  7017. ;; For tests.
  7018. ("check" ,check)
  7019. ("groff" ,groff)))
  7020. (inputs
  7021. `(("expat" ,expat)
  7022. ("libcap" ,libcap)
  7023. ("libselinux" ,libselinux)))
  7024. (synopsis "Utility to show process environment")
  7025. (description
  7026. "Procenv is a command-line tool that displays as much detail about
  7027. itself and its environment as possible. It can be used as a test
  7028. tool, to understand the type of environment a process runs in, and for
  7029. comparing system environments.")
  7030. (home-page "https://github.com/jamesodhunt/procenv/")
  7031. (license license:gpl3+)))
  7032. (define-public libfabric
  7033. (package
  7034. (name "libfabric")
  7035. (version "1.11.2")
  7036. (source
  7037. (origin
  7038. (method url-fetch)
  7039. (uri
  7040. (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
  7041. version "/libfabric-" version ".tar.bz2"))
  7042. (sha256
  7043. (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
  7044. (build-system gnu-build-system)
  7045. (inputs `(("rdma-core" ,rdma-core)
  7046. ,@(match (%current-system)
  7047. ((member (package-supported-systems psm))
  7048. `(("psm" ,psm)))
  7049. (_ `()))
  7050. ("libnl" ,libnl)))
  7051. (home-page "https://ofiwg.github.io/libfabric/")
  7052. (synopsis "Open Fabric Interfaces")
  7053. (description
  7054. "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
  7055. communication services to applications. OFI is best described as a collection
  7056. of libraries and applications used to export fabric services. The key
  7057. components of OFI are: application interfaces, provider libraries, kernel
  7058. services, daemons, and test applications.
  7059. Libfabric is a core component of OFI. It is the library that defines and
  7060. exports the user-space API of OFI, and is typically the only software that
  7061. applications deal with directly. It works in conjunction with provider
  7062. libraries, which are often integrated directly into libfabric.")
  7063. (license (list license:bsd-2 license:gpl2)))) ;dual
  7064. (define-public psm
  7065. (package
  7066. (name "psm")
  7067. (version "3.3.20170428")
  7068. (home-page "https://github.com/intel/psm")
  7069. (source
  7070. (origin
  7071. (method git-fetch)
  7072. (uri (git-reference (url home-page)
  7073. (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
  7074. (file-name (string-append "psm-" version ".tar.gz"))
  7075. (sha256
  7076. (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
  7077. (patches (search-patches
  7078. "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
  7079. "psm-ldflags.patch" ; build shared lib with LDFLAGS
  7080. "psm-repro.patch" ; reproducibility
  7081. "psm-disable-memory-stats.patch"))))
  7082. (build-system gnu-build-system)
  7083. (outputs '("out" "debug"))
  7084. (inputs `(("libuuid" ,util-linux "lib")))
  7085. (arguments
  7086. '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
  7087. ,(string-append "INSTALL_PREFIX=" %output)
  7088. ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
  7089. " -funwind-tables -O3 -g3"
  7090. " -DPSM_USE_SYS_UUID"
  7091. " -Wno-strict-aliasing -DNVALGRIND"
  7092. " -fcommon")
  7093. ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  7094. #:tests? #f
  7095. #:phases (modify-phases %standard-phases
  7096. (delete 'configure)
  7097. (add-after 'unpack 'patch-/usr/include
  7098. (lambda _
  7099. (substitute* "Makefile"
  7100. (("\\$\\{DESTDIR}/usr/include")
  7101. (string-append %output "/include")))
  7102. (substitute* "Makefile"
  7103. (("/lib64") "/lib"))
  7104. #t))
  7105. (add-after 'unpack 'patch-sysmacros
  7106. (lambda _
  7107. (substitute* "ipath/ipath_proto.c"
  7108. (("#include <sys/poll.h>" m)
  7109. (string-append m "\n"
  7110. "#include <sys/sysmacros.h>")))
  7111. #t)))))
  7112. (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
  7113. (description
  7114. "The PSM Messaging API, or PSM API, is Intel's low-level user-level
  7115. communications interface for the True Scale family of products. PSM users are
  7116. enabled with mechanisms necessary to implement higher level communications
  7117. interfaces in parallel environments.")
  7118. ;; Only Intel-compatable processors are supported.
  7119. (supported-systems '("i686-linux" "x86_64-linux"))
  7120. (license (list license:bsd-2 license:gpl2)))) ;dual
  7121. (define-public snapscreenshot
  7122. (package
  7123. (name "snapscreenshot")
  7124. (version "1.0.14.3")
  7125. (source
  7126. (origin
  7127. (method url-fetch)
  7128. (uri (string-append "http://bisqwit.iki.fi/src/arch/"
  7129. name "-" version ".tar.bz2"))
  7130. (sha256
  7131. (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
  7132. (build-system gnu-build-system)
  7133. (arguments
  7134. `(#:make-flags
  7135. (let ((out (assoc-ref %outputs "out")))
  7136. (list (string-append "BINDIR=" out "/bin")
  7137. (string-append "MANDIR=" out "/share/man")))
  7138. #:tests? #f ; no test suite
  7139. #:phases
  7140. (modify-phases %standard-phases
  7141. (delete 'configure) ; ./configure is a snarky no-op
  7142. (add-before 'install 'fix-ownership
  7143. ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
  7144. (lambda _
  7145. (substitute* "depfun.mak"
  7146. ((" -o bin -g bin ") " "))
  7147. #t))
  7148. (add-before 'install 'create-output-directories
  7149. (lambda* (#:key outputs #:allow-other-keys)
  7150. (let ((out (assoc-ref outputs "out")))
  7151. (mkdir-p (string-append out "/share/man/man1"))
  7152. #t))))))
  7153. (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
  7154. (synopsis "Take screenshots of one or more Linux text consoles")
  7155. (description
  7156. "snapscreenshot saves a screenshot of one or more Linux text consoles as a
  7157. Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
  7158. relevant @file{/dev/vcs*} file(s).")
  7159. (license license:gpl2)))
  7160. (define-public fbcat
  7161. (package
  7162. (name "fbcat")
  7163. (version "0.5.2")
  7164. (source
  7165. (origin
  7166. (method url-fetch)
  7167. (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
  7168. version "/" name "-" version ".tar.gz"))
  7169. (sha256
  7170. (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
  7171. (build-system gnu-build-system)
  7172. (inputs
  7173. ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
  7174. ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
  7175. ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
  7176. `(("pnmtopng" ,netpbm)))
  7177. (outputs (list "out" "fbgrab"))
  7178. (arguments
  7179. `(#:make-flags
  7180. (list "CC=gcc"
  7181. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  7182. #:tests? #f ; no tests
  7183. #:phases
  7184. (modify-phases %standard-phases
  7185. (delete 'configure) ; no configure script
  7186. (add-after 'build 'qualify-references
  7187. (lambda* (#:key inputs outputs #:allow-other-keys)
  7188. (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
  7189. (out (assoc-ref outputs "out")))
  7190. (substitute* "fbgrab"
  7191. (("fbcat" all)
  7192. (string-append out "/bin/" all))
  7193. (("pnmtopng" all)
  7194. (string-append pnmtopng "/bin/" all))))))
  7195. (add-after 'install 'split-fbgrab-output
  7196. (lambda* (#:key outputs #:allow-other-keys)
  7197. (let* ((out (assoc-ref outputs "out"))
  7198. (out:fbgrab (assoc-ref outputs "fbgrab")))
  7199. (for-each (lambda (file)
  7200. (let ((old (string-append out "/" file))
  7201. (new (string-append out:fbgrab "/" file)))
  7202. (mkdir-p (dirname new))
  7203. (rename-file old new)))
  7204. (list "bin/fbgrab"
  7205. "share/man/man1/fbgrab.1"))))))))
  7206. (home-page "https://jwilk.net/software/fbcat")
  7207. (synopsis "Take a screenshot of the contents of the Linux framebuffer")
  7208. (description
  7209. "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
  7210. a dump therof. It supports a wide range of drivers and pixel formats.
  7211. @command{fbcat} can take screenshots of virtually any application that can be
  7212. made to write its output to the framebuffer, including (but not limited to)
  7213. text-mode or graphical applications that don't use a display server.
  7214. Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
  7215. emulates the behaviour of Gunnar Monell's older fbgrab utility.")
  7216. (license license:gpl2)))
  7217. (define-public libcgroup
  7218. (package
  7219. (name "libcgroup")
  7220. (version "0.41")
  7221. (source
  7222. (origin
  7223. (method url-fetch)
  7224. (uri (string-append
  7225. "mirror://sourceforge/libcg/" name "/"
  7226. version "/" name "-" version ".tar.bz2"))
  7227. (sha256
  7228. (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
  7229. (build-system gnu-build-system)
  7230. (arguments
  7231. `(#:tests? #f))
  7232. (native-inputs
  7233. `(("bison" ,bison)
  7234. ("flex" ,flex)))
  7235. (inputs
  7236. `(("linux-pam" ,linux-pam)))
  7237. (home-page "https://sourceforge.net/projects/libcg/")
  7238. (synopsis "Control groups management tools")
  7239. (description "Control groups is Linux kernel method for process resource
  7240. restriction, permission handling and more. This package provides userspace
  7241. interface to this kernel feature.")
  7242. (license license:lgpl2.1)))
  7243. (define-public mbpfan
  7244. (package
  7245. (name "mbpfan")
  7246. (version "2.2.1")
  7247. (source
  7248. (origin
  7249. (method git-fetch)
  7250. (uri (git-reference
  7251. (url "https://github.com/dgraziotin/mbpfan")
  7252. (commit (string-append "v" version))))
  7253. (file-name (git-file-name name version))
  7254. (sha256
  7255. (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
  7256. (build-system gnu-build-system)
  7257. (arguments
  7258. `(#:tests? #f ; tests ask to be run as root
  7259. #:make-flags (let ((out (assoc-ref %outputs "out")))
  7260. (list (string-append "DESTDIR=" out)
  7261. ,(string-append "CC=" (cc-for-target))))
  7262. #:phases
  7263. (modify-phases %standard-phases
  7264. (add-after 'unpack 'patch-paths
  7265. (lambda _
  7266. (substitute* "Makefile"
  7267. (("/usr") ""))
  7268. #t))
  7269. (delete 'configure)))) ; there's no configure phase
  7270. (home-page "https://github.com/dgraziotin/mbpfan")
  7271. (synopsis "Control fan speed on Macbooks")
  7272. (description
  7273. "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
  7274. the @code{coretemp} module and sets the fan speed using the @code{applesmc}
  7275. module. It can be executed as a daemon or in the foreground with root
  7276. privileges.")
  7277. (license license:gpl3+)))
  7278. (define-public psm2
  7279. (package
  7280. (name "psm2")
  7281. (version "11.2.185")
  7282. (source (origin
  7283. (method git-fetch)
  7284. (uri (git-reference
  7285. (url "https://github.com/intel/opa-psm2")
  7286. (commit (string-append "PSM2_" version))))
  7287. (file-name (git-file-name name version))
  7288. (sha256
  7289. (base32
  7290. "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
  7291. (build-system gnu-build-system)
  7292. (arguments
  7293. '(#:make-flags
  7294. `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  7295. #:tests? #f
  7296. #:phases (modify-phases %standard-phases
  7297. (delete 'configure)
  7298. (add-after 'unpack 'patch-Makefiles
  7299. (lambda _
  7300. (substitute* "Makefile"
  7301. (("/lib64") "/lib")
  7302. (("/usr") ""))
  7303. (substitute* "compat/Makefile"
  7304. (("/lib64") "/lib")
  7305. (("/usr") ""))
  7306. #t))
  7307. (replace 'install
  7308. (lambda _
  7309. (setenv "DESTDIR" %output)
  7310. (invoke "make" "install")
  7311. #t)))))
  7312. (inputs
  7313. `(("rdma-core" ,rdma-core)
  7314. ("numactl" ,numactl)))
  7315. (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
  7316. (description
  7317. "This package is low-level user-level Intel's communications interface.
  7318. The PSM2 API is a high-performance vendor-specific protocol that provides a
  7319. low-level communications interface for the Intel Omni-Path family of
  7320. high-speed networking devices.")
  7321. (home-page "https://github.com/intel/opa-psm2")
  7322. ;; Only the x86_64 architecure is supported.
  7323. (supported-systems '("x86_64-linux"))
  7324. (license (list license:bsd-3 license:gpl2)))) ; dual
  7325. (define-public libpfm4
  7326. (package
  7327. (name "libpfm4")
  7328. (version "4.9.0")
  7329. (source (origin
  7330. (method url-fetch)
  7331. (uri (string-append "mirror://sourceforge/perfmon2/"
  7332. name "/libpfm-" version ".tar.gz"))
  7333. (sha256
  7334. (base32
  7335. "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
  7336. (build-system gnu-build-system)
  7337. (arguments
  7338. '(#:modules ((guix build utils)
  7339. (guix build gnu-build-system))
  7340. #:phases (modify-phases %standard-phases
  7341. (delete 'configure)
  7342. (delete 'check)
  7343. (replace 'build
  7344. (lambda* (#:key inputs outputs #:allow-other-keys)
  7345. (let* ((out (assoc-ref outputs "out")))
  7346. (setenv "CC" "gcc")
  7347. (invoke "make")
  7348. #t)))
  7349. (replace 'install
  7350. (lambda* (#:key outputs #:allow-other-keys)
  7351. (let* ((out (assoc-ref outputs "out")))
  7352. (invoke "make"
  7353. (string-append "PREFIX=" out)
  7354. "install")
  7355. #t))))))
  7356. (synopsis "Performance event monitoring library")
  7357. (description
  7358. "This package provides a library called libpfm4, which is used to develop
  7359. monitoring tools exploiting the performance monitoring events such as those
  7360. provided by the Performance Monitoring Unit (PMU) of modern processors.
  7361. Libpfm4 helps convert from an event name, expressed as a string, to the event
  7362. encoding that is either the raw event as documented by the hardware vendor or
  7363. the OS-specific encoding. In the latter case, the library is able to prepare
  7364. the OS-specific data structures needed by the kernel to setup the event.
  7365. libpfm4 provides support for the @code{perf_events} interface, which was
  7366. introduced in Linux 2.6.31.")
  7367. (home-page "http://perfmon2.sourceforge.net/")
  7368. (license license:expat)))
  7369. (define-public libnfnetlink
  7370. (package
  7371. (name "libnfnetlink")
  7372. (version "1.0.1")
  7373. (source (origin
  7374. (method url-fetch)
  7375. (uri (string-append
  7376. "https://www.netfilter.org/projects/libnfnetlink/files/"
  7377. "libnfnetlink-" version ".tar.bz2"))
  7378. (sha256
  7379. (base32
  7380. "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
  7381. (build-system gnu-build-system)
  7382. (home-page "https://www.netfilter.org/projects/libnfnetlink/")
  7383. (synopsis "Low-level netfilter netlink communication library")
  7384. (description
  7385. "@code{libnfnetlink} is the low-level library for netfilter related
  7386. kernel/userspace communication. It provides a generic messaging
  7387. infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
  7388. nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
  7389. management tools in userspace.")
  7390. (license license:gpl2)))
  7391. (define-public go-netlink
  7392. (package
  7393. (name "go-netlink")
  7394. (version "1.0.0")
  7395. (source (origin
  7396. (method git-fetch)
  7397. (uri (git-reference
  7398. (url "https://github.com/vishvananda/netlink")
  7399. (commit (string-append "v" version))))
  7400. (file-name (git-file-name name version))
  7401. (sha256
  7402. (base32
  7403. "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
  7404. (build-system go-build-system)
  7405. (arguments
  7406. `(#:import-path "github.com/vishvananda/netlink"))
  7407. (native-inputs
  7408. `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
  7409. ("go-netns" ,go-netns)))
  7410. (home-page "https://github.com/vishvananda/netlink")
  7411. (synopsis "Simple netlink library for Go")
  7412. (description "The netlink package provides a simple netlink library for
  7413. Go. Netlink is the interface a user-space program in Linux uses to
  7414. communicate with the kernel. It can be used to add and remove interfaces, set
  7415. IP addresses and routes, and configure IPsec.")
  7416. (license license:asl2.0)))
  7417. (define-public libinih
  7418. (package
  7419. (name "libinih")
  7420. (version "53")
  7421. (source (origin
  7422. (method git-fetch)
  7423. (uri (git-reference
  7424. (url "https://github.com/benhoyt/inih")
  7425. (commit (string-append "r" version))))
  7426. (file-name (git-file-name name version))
  7427. (sha256
  7428. (base32
  7429. "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
  7430. (build-system meson-build-system)
  7431. ;; Install static libraries for use by the initrd's xfsprogs/static.
  7432. (outputs (list "out" "static"))
  7433. (arguments
  7434. `(#:configure-flags
  7435. (list "-Ddistro_install=true"
  7436. "-Ddefault_library=both")
  7437. #:phases
  7438. (modify-phases %standard-phases
  7439. (add-after 'install 'separate-static
  7440. (lambda* (#:key outputs #:allow-other-keys)
  7441. (let ((out (assoc-ref outputs "out"))
  7442. (static (assoc-ref outputs "static")))
  7443. (with-directory-excursion out
  7444. (for-each (lambda (source)
  7445. (let ((target (string-append static "/" source)))
  7446. (mkdir-p (dirname target))
  7447. (rename-file source target)))
  7448. (find-files "lib" "\\.a$")))))))))
  7449. (home-page "https://github.com/benhoyt/inih")
  7450. (synopsis "Simple .INI parser library for C")
  7451. (description "The inih (INI Not Invented Here) library is a simple .INI file
  7452. parser written in C. It's only a couple of pages of code, and it was designed to
  7453. be small and simple, so it's good for embedded systems. It's also more or less
  7454. compatible with Python's ConfigParser style of .INI files, including RFC
  7455. 822-style multi-line syntax and name: value entries.")
  7456. (license license:bsd-3)))
  7457. (define-public xfsprogs
  7458. (package
  7459. (name "xfsprogs")
  7460. (version "5.13.0")
  7461. (source (origin
  7462. (method url-fetch)
  7463. (uri (string-append
  7464. "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
  7465. "xfsprogs-" version ".tar.gz"))
  7466. (sha256
  7467. (base32
  7468. "09s3alwrhs1gaaywkpx2knc5bxb44b77009jw8zgsy9c2wxximns"))))
  7469. (build-system gnu-build-system)
  7470. (outputs (list "out" "python"))
  7471. (arguments
  7472. `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
  7473. #:make-flags
  7474. (list "V=1")
  7475. #:phases
  7476. (modify-phases %standard-phases
  7477. (add-after 'install 'separate-python-output
  7478. (lambda* (#:key outputs #:allow-other-keys)
  7479. (let ((out (assoc-ref outputs "out"))
  7480. (python (assoc-ref outputs "python")))
  7481. (for-each
  7482. (lambda (script)
  7483. (mkdir-p (string-append python (dirname script)))
  7484. (rename-file (string-append out script)
  7485. (string-append python script)))
  7486. (list "/sbin/xfs_scrub_all")))))
  7487. (add-after 'install 'install-headers
  7488. (lambda* (#:key make-flags #:allow-other-keys)
  7489. (apply invoke "make" "install-dev" make-flags))))))
  7490. (native-inputs
  7491. `(("gettext" ,gettext-minimal)))
  7492. (inputs
  7493. `(("libinih" ,libinih)
  7494. ("libuuid" ,util-linux "lib")
  7495. ("python" ,python-wrapper)))
  7496. (home-page "https://xfs.wiki.kernel.org/")
  7497. (synopsis "XFS file system tools")
  7498. (description "This package provides commands to create and check XFS
  7499. file systems.")
  7500. ;; The library "libhandle" and the headers in "xfslibs-dev" are
  7501. ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
  7502. (license (list license:gpl2 license:lgpl2.1))))
  7503. (define-public xfsprogs/static
  7504. (package
  7505. (inherit xfsprogs)
  7506. (name "xfsprogs-static")
  7507. (outputs (list "out"))
  7508. (arguments
  7509. (substitute-keyword-arguments (package-arguments xfsprogs)
  7510. ((#:make-flags make-flags ''())
  7511. `(cons* "LLDFLAGS=-all-static" ,make-flags))
  7512. ((#:phases _ ''())
  7513. `(modify-phases %standard-phases
  7514. (add-after 'install 'delete-useless-files
  7515. (lambda* (#:key outputs #:allow-other-keys)
  7516. (with-directory-excursion (assoc-ref outputs "out")
  7517. (for-each delete-file-recursively
  7518. (list "include" "lib")))))))))
  7519. (inputs
  7520. `(("libinih:static" ,libinih "static")
  7521. ("util-linux:static" ,util-linux "static")
  7522. ,@(remove (match-lambda
  7523. ((label . _)
  7524. (member label '("python"))))
  7525. (package-inputs xfsprogs))))
  7526. (synopsis "Statically linked XFS file system tools")))
  7527. (define-public xfs_repair/static
  7528. (package
  7529. (name "xfs_repair-static")
  7530. (version (package-version xfsprogs/static))
  7531. (source #f)
  7532. (build-system trivial-build-system)
  7533. (arguments
  7534. `(#:modules ((guix build utils))
  7535. #:builder
  7536. (begin
  7537. (use-modules (guix build utils))
  7538. (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
  7539. (out (assoc-ref %outputs "out"))
  7540. (sbin (string-append out "/sbin")))
  7541. (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
  7542. (with-directory-excursion sbin
  7543. (remove-store-references "xfs_repair"))))))
  7544. (inputs
  7545. `(("xfsprogs" ,xfsprogs/static)))
  7546. (home-page (package-home-page xfsprogs/static))
  7547. (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
  7548. (description
  7549. "This package provides a statically linked @command{xfs_repair} taken
  7550. from the xfsprogs package. It is meant to be used in initrds.")
  7551. (license (package-license xfsprogs/static))))
  7552. (define-public genext2fs
  7553. (package
  7554. (name "genext2fs")
  7555. (version "1.4.1-4")
  7556. (source (origin
  7557. (method git-fetch)
  7558. (uri (git-reference
  7559. (url "https://github.com/jeremie-koenig/genext2fs")
  7560. ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
  7561. (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
  7562. (file-name (git-file-name name version))
  7563. (sha256
  7564. (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
  7565. (build-system gnu-build-system)
  7566. (arguments
  7567. `(#:phases
  7568. (modify-phases %standard-phases
  7569. (add-after 'unpack 'apply-debian-patches
  7570. ;; Debian changes (the revision after ‘-’ in VERSION) are
  7571. ;; maintained as separate patches. Apply those relevant to us.
  7572. (lambda _
  7573. (for-each
  7574. (lambda (file-name)
  7575. (invoke "patch" "-p1" "-i"
  7576. (string-append "debian/patches/" file-name)))
  7577. (list "blocksize+creator.diff" ; add -B/-o options
  7578. "byteswap_fix.diff"))
  7579. #t)))))
  7580. (native-inputs
  7581. `(("autoconf" ,autoconf)
  7582. ("automake" ,automake)))
  7583. (home-page "https://github.com/jeremie-koenig/genext2fs")
  7584. (synopsis "Generate ext2 file system as a normal user")
  7585. (description "This package provides a program to generate an ext2
  7586. file system as a normal (non-root) user. It does not require you to mount
  7587. the image file to copy files on it, nor does it require that you become
  7588. the superuser to make device nodes.")
  7589. (license license:gpl2)))
  7590. (define-public fakeroot
  7591. (package
  7592. (name "fakeroot")
  7593. (version "1.26")
  7594. (source
  7595. (origin
  7596. ;; There are no tags in the repository, so take this snapshot.
  7597. (method url-fetch)
  7598. (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
  7599. "fakeroot/fakeroot_" version ".orig.tar.gz"))
  7600. (file-name (string-append name "-" version ".tar.gz"))
  7601. (sha256
  7602. (base32
  7603. "1sg8inv1zzp4h9ncbbmxip3svd11sd86j22cvxrjwnf5zn7mf2j8"))
  7604. (modules '((guix build utils)
  7605. (ice-9 ftw)))
  7606. (snippet
  7607. `(begin
  7608. ;; Delete pregenerated man page translations, but not the originals.
  7609. (with-directory-excursion "doc"
  7610. (for-each (lambda (language)
  7611. (for-each delete-file
  7612. (find-files language "\\.[0-9]$")))
  7613. (scandir "."
  7614. (lambda (file)
  7615. (and (not (string-prefix? "." file))
  7616. (eq? 'directory
  7617. (stat:type (lstat file))))))))))))
  7618. (build-system gnu-build-system)
  7619. (arguments
  7620. `(#:configure-flags
  7621. (list "--disable-static")
  7622. #:phases
  7623. (modify-phases %standard-phases
  7624. (add-after 'unpack 'patch-Makefile.am
  7625. (lambda _
  7626. (substitute* "Makefile.am"
  7627. (("/bin/sh") (which "sh")))))
  7628. (add-after 'unpack 'patch-script
  7629. (lambda* (#:key inputs #:allow-other-keys)
  7630. (substitute* "scripts/fakeroot.in"
  7631. (("getopt")
  7632. (string-append (assoc-ref inputs "util-linux")
  7633. "/bin/getopt"))
  7634. (("sed")
  7635. (string-append (assoc-ref inputs "sed")
  7636. "/bin/sed"))
  7637. (("cat|cut" command)
  7638. (string-append (assoc-ref inputs "coreutils")
  7639. "/bin/" command)) )))
  7640. (replace 'bootstrap
  7641. (lambda _
  7642. ;; The "preroll" script takes care of Autoconf and also
  7643. ;; prepares the translated manuals.
  7644. (invoke "sh" "./preroll")))
  7645. (add-before 'configure 'setenv
  7646. (lambda _
  7647. (setenv "LIBS" "-lacl")))
  7648. (add-before 'check 'prepare-check
  7649. (lambda _
  7650. (setenv "SHELL" (which "bash"))
  7651. (setenv "VERBOSE" "1")
  7652. (substitute* "test/t.touchinstall"
  7653. ;; We don't have the name of the root user, so use ID=0.
  7654. (("grep root") "grep \"\\<0\\>\""))
  7655. (substitute* "test/tartest"
  7656. ;; We don't have the name of the root group, so use ID=0.
  7657. (("ROOTGROUP=root") "ROOTGROUP=0")
  7658. ;; We don't have the name of the daemon user, so use IDs.
  7659. (("daemon:sys") "1:3")
  7660. (("daemon:") "1:"))
  7661. ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
  7662. (substitute* "test/compare-tar"
  7663. (("tar -tvf") "tar --numeric-owner -tvf")))))))
  7664. (native-inputs
  7665. `(;; For bootstrapping the package.
  7666. ("autoconf" ,autoconf-2.71)
  7667. ("automake" ,automake)
  7668. ("libtool" ,libtool)
  7669. ("gettext" ,gettext-minimal)
  7670. ("po4a" ,po4a)
  7671. ;; For tests.
  7672. ("sharutils" ,sharutils)
  7673. ("xz" ,xz)))
  7674. (inputs
  7675. `(("acl" ,acl)
  7676. ("libcap" ,libcap)
  7677. ("util-linux" ,util-linux)
  7678. ("sed" ,sed)
  7679. ("coreutils" ,coreutils)))
  7680. (synopsis "Run commands in an environment with fake root privileges")
  7681. (description
  7682. "@command{fakeroot} runs a command in an environment where it appears to
  7683. have root privileges for file manipulation. This is useful for allowing users
  7684. to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
  7685. them with root permissions and/or ownership.
  7686. Without fakeroot, one would have to have root privileges to create the
  7687. constituent files of the archives with the correct permissions and ownership,
  7688. and then pack them up, or one would have to construct the archives directly,
  7689. without using the archiver.")
  7690. (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
  7691. (license license:gpl3+)))
  7692. (define-public fakechroot
  7693. ;; XXX: Build from the change submitted at
  7694. ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
  7695. ;; against glibc 2.33. Switch back to the official repository on the next
  7696. ;; release.
  7697. (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
  7698. (revision "0"))
  7699. (package
  7700. (name "fakechroot")
  7701. (version (git-version "2.20.1" revision commit))
  7702. (source (origin
  7703. (method git-fetch)
  7704. (uri (git-reference
  7705. (url "https://github.com/lipnitsk/fakechroot")
  7706. (commit commit)))
  7707. (file-name (git-file-name name version))
  7708. (sha256
  7709. (base32
  7710. "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
  7711. (build-system gnu-build-system)
  7712. (arguments
  7713. ;; XXX: The tests heavily assume they run on an FHS system so for now
  7714. ;; skip them.
  7715. '(#:tests? #f
  7716. #:configure-flags '("--disable-static")))
  7717. (native-inputs (list autoconf automake libtool perl))
  7718. (synopsis "Emulate @code{chroot} by overriding file system calls")
  7719. (description
  7720. "@command{fakechroot} runs a command in an environment were is additional
  7721. possibility to use @code{chroot} command without root privileges. This is
  7722. useful for allowing users to create own chrooted environment with possibility
  7723. to install another packages without need for root privileges.
  7724. It works by providing @file{libfakechroot.so}, a shared library meant to be
  7725. set as @code{LD_PRELOAD} to override the C library file system functions.")
  7726. (home-page "https://github.com/dex4er/fakechroot/")
  7727. (license license:lgpl2.1+))))
  7728. (define-public inputattach
  7729. (package
  7730. (name "inputattach")
  7731. (version "0.42.0")
  7732. (source (origin
  7733. (method git-fetch)
  7734. (uri (git-reference
  7735. (url "https://github.com/linuxwacom/input-wacom")
  7736. (commit (string-append "input-wacom-" version))))
  7737. (file-name (git-file-name name version))
  7738. (sha256
  7739. (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
  7740. (build-system gnu-build-system)
  7741. (arguments
  7742. `(#:phases
  7743. (modify-phases %standard-phases
  7744. (delete 'bootstrap)
  7745. (delete 'configure)
  7746. (replace 'build
  7747. (lambda* (#:key inputs #:allow-other-keys)
  7748. (with-directory-excursion "inputattach"
  7749. (invoke "gcc" "-O2" "-o" "inputattach"
  7750. "inputattach.c"))))
  7751. (delete 'check)
  7752. (replace 'install
  7753. (lambda* (#:key outputs #:allow-other-keys)
  7754. (let ((target-dir (string-append
  7755. (assoc-ref outputs "out")
  7756. "/bin/")))
  7757. (mkdir-p target-dir)
  7758. (copy-file "inputattach/inputattach"
  7759. (string-append target-dir
  7760. "inputattach"))
  7761. #t))))))
  7762. (home-page "https://linuxwacom.github.io/")
  7763. (synopsis "Dispatch input peripherals events to a device file")
  7764. (description "inputattach dispatches input events from several device
  7765. types and interfaces and translates so that the X server can use them.")
  7766. (license license:gpl2+)))
  7767. (define-public pipewire
  7768. (package
  7769. (name "pipewire")
  7770. (version "0.2.7")
  7771. (source (origin
  7772. (method git-fetch)
  7773. (uri (git-reference
  7774. (url "https://github.com/PipeWire/pipewire")
  7775. (commit version)))
  7776. (file-name (git-file-name name version))
  7777. (sha256
  7778. (base32
  7779. "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))
  7780. (patches (search-patches "pipewire-0.2.7-fno-common.patch"))))
  7781. (build-system meson-build-system)
  7782. (arguments
  7783. '(#:configure-flags '("-Dsystemd=false")))
  7784. (native-inputs
  7785. `(("pkg-config" ,pkg-config)))
  7786. (inputs
  7787. `(("alsa-lib" ,alsa-lib)
  7788. ("dbus" ,dbus)
  7789. ("eudev" ,eudev)
  7790. ("ffmpeg" ,ffmpeg)
  7791. ("gstreamer" ,gstreamer)
  7792. ("gst-plugins-base" ,gst-plugins-base)
  7793. ("libva" ,libva)
  7794. ("sbc" ,sbc)
  7795. ("sdl2" ,sdl2)))
  7796. (home-page "https://pipewire.org/")
  7797. (synopsis "Server and user space API to deal with multimedia pipelines")
  7798. (description
  7799. "PipeWire is a project that aims to greatly improve handling of audio and
  7800. video under Linux. It aims to support the usecases currently handled by both
  7801. PulseAudio and Jack and at the same time provide same level of powerful handling
  7802. of Video input and output. It also introduces a security model that makes
  7803. interacting with audio and video devices from containerized applications easy,
  7804. with supporting Flatpak applications being the primary goal. Alongside Wayland
  7805. and Flatpak we expect PipeWire to provide a core building block for the future
  7806. of Linux application development.")
  7807. (license license:lgpl2.0+)))
  7808. (define-public pipewire-0.3
  7809. (package
  7810. (inherit pipewire)
  7811. (name "pipewire")
  7812. (version "0.3.29")
  7813. (source (origin
  7814. (method git-fetch)
  7815. (uri (git-reference
  7816. (url "https://github.com/PipeWire/pipewire")
  7817. (commit version)))
  7818. (file-name (git-file-name name version))
  7819. (sha256
  7820. (base32
  7821. "16jjxcnahxqfcawz77ywx837ybhwzcivn7hgqb9cmlp1y2syy8gk"))))
  7822. (arguments
  7823. '(#:configure-flags
  7824. (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
  7825. "/lib/udev/rules.d")
  7826. "-Dsystemd=disabled")
  7827. #:phases
  7828. (modify-phases %standard-phases
  7829. ;; Skip shrink-runpath, otherwise validate-runpath fails.
  7830. (delete 'shrink-runpath))))
  7831. (inputs
  7832. (append (package-inputs pipewire)
  7833. `(("bluez" ,bluez)
  7834. ("jack" ,jack-2)
  7835. ("pulseaudio" ,pulseaudio)
  7836. ("vulkan-loader" ,vulkan-loader)
  7837. ("vulkan-headers" ,vulkan-headers))))))
  7838. (define-public ell
  7839. (package
  7840. (name "ell")
  7841. (version "0.41")
  7842. (source (origin
  7843. (method git-fetch)
  7844. (uri (git-reference
  7845. (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
  7846. (commit version)))
  7847. (file-name (git-file-name name version))
  7848. (sha256
  7849. (base32
  7850. "14scs8vqpcf2810gvabsplg9yzh9y4sz47407bjy6vd604z3w8ah"))))
  7851. (build-system gnu-build-system)
  7852. (arguments
  7853. `(#:phases
  7854. (modify-phases %standard-phases
  7855. (add-after 'unpack 'fix-dbus-tests
  7856. (lambda _
  7857. (substitute* '("unit/test-dbus-message-fds.c"
  7858. "unit/test-dbus-properties.c"
  7859. "unit/test-dbus.c")
  7860. (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
  7861. #t)))))
  7862. (inputs
  7863. `(("dbus" ,dbus)))
  7864. (native-inputs
  7865. `(("autoconf" ,autoconf)
  7866. ("libtool" ,libtool)
  7867. ("pkgconfig" ,pkg-config)
  7868. ("automake" ,automake)))
  7869. (home-page "https://01.org/ell")
  7870. (synopsis "Embedded Linux Library")
  7871. (description "The Embedded Linux* Library (ELL) provides core, low-level
  7872. functionality for system daemons. It typically has no dependencies other than
  7873. the Linux kernel, C standard library, and libdl (for dynamic linking). While
  7874. ELL is designed to be efficient and compact enough for use on embedded Linux
  7875. platforms, it is not limited to resource-constrained systems.")
  7876. (license license:lgpl2.1+)))
  7877. (define-public lttng-ust
  7878. (package
  7879. (name "lttng-ust")
  7880. (version "2.12.2")
  7881. (source (origin
  7882. (method url-fetch)
  7883. (uri (string-append "https://lttng.org/files/lttng-ust/"
  7884. "lttng-ust-" version ".tar.bz2"))
  7885. (sha256
  7886. (base32
  7887. "1iwz6p79zvibj8sl8qqw84lcir9a8z1ylq77hhnwg26anrjg1l5w"))))
  7888. (build-system gnu-build-system)
  7889. (inputs
  7890. `(("liburcu" ,liburcu)
  7891. ("numactl" ,numactl)))
  7892. (native-inputs
  7893. `(("python" ,python-3)))
  7894. (home-page "https://lttng.org/")
  7895. (synopsis "LTTng userspace tracer libraries")
  7896. (description "The user space tracing library, liblttng-ust, is the LTTng
  7897. user space tracer. It receives commands from a session daemon, for example to
  7898. enable and disable specific instrumentation points, and writes event records
  7899. to ring buffers shared with a consumer daemon.")
  7900. (license license:lgpl2.1+)))
  7901. (define-public kexec-tools
  7902. (package
  7903. (name "kexec-tools")
  7904. (version "2.0.22")
  7905. (source (origin
  7906. (method url-fetch)
  7907. (uri (string-append "mirror://kernel.org/linux/utils/kernel"
  7908. "/kexec/kexec-tools-" version ".tar.xz"))
  7909. (sha256
  7910. (base32
  7911. "1hj9mj6x3qs9c8x8mrri9xd3wsg3gwzbab3jfa5ry146xm4pzjcn"))))
  7912. (build-system gnu-build-system)
  7913. (arguments
  7914. ;; There are no automated tests.
  7915. '(#:tests? #f))
  7916. (home-page "https://projects.horms.net/projects/kexec/")
  7917. (synopsis "Tools for booting directly into different kernels")
  7918. (description "This package provides the @code{kexec} program and ancillary
  7919. utilities. Using @code{kexec}, it is possible to boot directly into a new
  7920. kernel from the context of an already-running kernel, bypassing the normal
  7921. system boot process.")
  7922. (license license:gpl2)))
  7923. (define-public cachefilesd
  7924. (package
  7925. (name "cachefilesd")
  7926. (version "0.10.10")
  7927. (source (origin
  7928. (method url-fetch)
  7929. (uri (string-append
  7930. "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
  7931. "/cachefilesd.git/snapshot/cachefilesd-"
  7932. version ".tar.gz"))
  7933. (sha256
  7934. (base32
  7935. "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
  7936. (build-system gnu-build-system)
  7937. (outputs '("out"))
  7938. (arguments
  7939. `(#:tests? #f ; there are no tests
  7940. #:make-flags
  7941. (let ((prefix-dir (lambda (var dir)
  7942. (string-append var "=" %output "/" dir))))
  7943. (list (string-append "CC=" ,(cc-for-target))
  7944. (prefix-dir "SBINDIR" "sbin/")
  7945. (prefix-dir "ETCDIR" "etc/")
  7946. (prefix-dir "MANDIR" "share/man/")))
  7947. #:phases (modify-phases %standard-phases (delete 'configure))))
  7948. (home-page "https://people.redhat.com/~dhowells/cachefs/")
  7949. (synopsis "CacheFiles userspace management daemon")
  7950. (description "@code{cachefilesd} is a userspace daemon that manages the
  7951. cache data store that is used by network file systems such as @code{AFS} and
  7952. @code{NFS} to cache data locally on disk. The content of the cache is
  7953. persistent over reboots.")
  7954. (license license:gpl2+)))
  7955. (define-public libbpf
  7956. (package
  7957. (name "libbpf")
  7958. (version "0.1.1")
  7959. (source
  7960. (origin
  7961. (method git-fetch)
  7962. (uri (git-reference
  7963. (url "https://github.com/libbpf/libbpf")
  7964. (commit (string-append "v" version))))
  7965. (file-name (git-file-name name version))
  7966. (sha256
  7967. (base32
  7968. "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
  7969. (build-system gnu-build-system)
  7970. (native-inputs
  7971. `(("pkg-config" ,pkg-config)))
  7972. (propagated-inputs
  7973. ;; In Requires.private of libbpf.pc.
  7974. `(("libelf" ,libelf)
  7975. ("zlib" ,zlib)))
  7976. (arguments
  7977. `(#:tests? #f ; no tests
  7978. #:make-flags
  7979. (list
  7980. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  7981. (string-append "LIBDIR=$(PREFIX)/lib")
  7982. (string-append
  7983. "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
  7984. #:phases
  7985. (modify-phases %standard-phases
  7986. (delete 'configure)
  7987. (add-before 'build 'pre-build
  7988. (lambda _
  7989. (chdir "src")
  7990. #t)))))
  7991. (home-page "https://github.com/libbpf/libbpf")
  7992. (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
  7993. (description
  7994. "Libbpf supports building BPF CO-RE-enabled applications, which, in
  7995. contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
  7996. headers.")
  7997. (license `(,license:lgpl2.1 ,license:bsd-2))))
  7998. (define-public bcc
  7999. (package
  8000. (name "bcc")
  8001. (version "0.16.0")
  8002. (source
  8003. (origin
  8004. (method git-fetch)
  8005. (uri (git-reference
  8006. (url "https://github.com/iovisor/bcc")
  8007. (commit (string-append "v" version))))
  8008. (file-name (git-file-name name version))
  8009. (sha256
  8010. (base32
  8011. "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
  8012. (build-system cmake-build-system)
  8013. (native-inputs
  8014. `(("bison" ,bison)
  8015. ("flex" ,flex)))
  8016. (inputs
  8017. `(("clang-toolchain" ,clang-toolchain)
  8018. ("libbpf" ,(package-source libbpf))
  8019. ;; LibElf required but libelf does not contain
  8020. ;; archives, only object files.
  8021. ;; https://github.com/iovisor/bcc/issues/504
  8022. ("elfutils" ,elfutils)
  8023. ("linux-libre-headers" ,linux-libre-headers)
  8024. ("luajit" ,luajit)
  8025. ("python-wrapper" ,python-wrapper)))
  8026. (arguments
  8027. `(;; Tests all require root permissions and a "standard" file hierarchy.
  8028. #:tests? #f
  8029. #:configure-flags
  8030. (let ((revision ,version))
  8031. `(,(string-append "-DREVISION=" revision)))
  8032. #:phases
  8033. (modify-phases %standard-phases
  8034. ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
  8035. (add-after 'unpack 'copy-libbpf
  8036. (lambda* (#:key inputs #:allow-other-keys)
  8037. (delete-file-recursively "src/cc/libbpf")
  8038. (copy-recursively
  8039. (assoc-ref inputs "libbpf") "src/cc/libbpf")))
  8040. (add-after 'copy-libbpf 'substitute-libbc
  8041. (lambda* (#:key outputs #:allow-other-keys)
  8042. (substitute* "src/python/bcc/libbcc.py"
  8043. (("(libbcc\\.so.*)\\b" _ libbcc)
  8044. (string-append
  8045. (assoc-ref outputs "out") "/lib/" libbcc)))))
  8046. (add-after 'install 'wrap-tools
  8047. (lambda* (#:key outputs #:allow-other-keys)
  8048. (use-modules (ice-9 textual-ports))
  8049. (let* ((out (assoc-ref outputs "out"))
  8050. (lib (string-append out "/lib"))
  8051. (tools (string-append out "/share/bcc/tools"))
  8052. (python-executable?
  8053. (lambda (filename _)
  8054. (call-with-input-file filename
  8055. (lambda (port)
  8056. (string-contains (get-line port)
  8057. "/bin/python"))))))
  8058. (for-each
  8059. (lambda (python-executable)
  8060. (format #t "Wrapping: ~A.~%" python-executable)
  8061. (wrap-program python-executable
  8062. `("GUIX_PYTHONPATH" ":" prefix
  8063. (,(string-append lib
  8064. "/python"
  8065. ,(version-major+minor
  8066. (package-version python))
  8067. "/site-packages")))))
  8068. (find-files tools python-executable?))
  8069. #t))))))
  8070. (home-page "https://github.com/iovisor/bcc")
  8071. (synopsis "Tools for BPF on Linux")
  8072. (description
  8073. "BCC is a toolkit for creating efficient kernel tracing and manipulation
  8074. programs, and includes several useful tools and examples. It makes use of
  8075. extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
  8076. that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
  8077. and above.")
  8078. (license license:asl2.0)))
  8079. (define-public bpftrace
  8080. (package
  8081. (name "bpftrace")
  8082. (version "0.11.4")
  8083. (source
  8084. (origin
  8085. (method git-fetch)
  8086. (uri (git-reference
  8087. (url "https://github.com/iovisor/bpftrace")
  8088. (commit (string-append "v" version))))
  8089. (file-name (git-file-name name version))
  8090. (sha256
  8091. (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
  8092. (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
  8093. (build-system cmake-build-system)
  8094. (native-inputs
  8095. `(("bison" ,bison)
  8096. ("flex" ,flex)))
  8097. (inputs
  8098. `(("bcc" ,bcc)
  8099. ("clang-toolchain" ,clang-toolchain)
  8100. ("elfutils" ,elfutils)
  8101. ("libbpf" ,libbpf)
  8102. ("linux-libre-headers" ,linux-libre-headers)))
  8103. (arguments
  8104. `(#:tests? #f ;Tests require googletest sources.
  8105. #:configure-flags
  8106. '("-DBUILD_TESTING=OFF"
  8107. ;; FIXME: libbfd misses some link dependencies, when fixed, remove
  8108. ;; the associated patch.
  8109. "-DHAVE_BFD_DISASM=OFF")))
  8110. (home-page "https://github.com/iovisor/bpftrace")
  8111. (synopsis "High-level tracing language for Linux eBPF")
  8112. (description
  8113. "bpftrace is a high-level tracing language for Linux enhanced Berkeley
  8114. Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
  8115. LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
  8116. interacting with the Linux BPF system, as well as existing Linux tracing
  8117. capabilities: kernel dynamic tracing (kprobes), user-level dynamic
  8118. tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
  8119. and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
  8120. created by Alastair Robertson.")
  8121. (license license:asl2.0)))
  8122. (define-public ttyebus-linux-module
  8123. (let ((revision "0")
  8124. (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
  8125. (package
  8126. (name "ttyebus-linux-module")
  8127. (version (git-version "1.5" revision commit))
  8128. (source
  8129. (origin
  8130. (method git-fetch)
  8131. (uri (git-reference
  8132. (url "https://github.com/eBUS/ttyebus")
  8133. (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
  8134. (file-name (git-file-name name version))
  8135. (sha256
  8136. (base32
  8137. "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
  8138. (supported-systems '("armhf-linux" "aarch64-linux"))
  8139. (build-system linux-module-build-system)
  8140. (arguments
  8141. `(#:tests? #f))
  8142. (home-page "https://github.com/eBUS/ttyebus")
  8143. (synopsis "Low-latency Raspberry Pi UART driver")
  8144. (description "This package provides a Linux kernel module that will
  8145. provide a serial device @code{/dev/ttyebus} with almost no latency upon
  8146. receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
  8147. (license license:gpl3+))))
  8148. (define-public ipset
  8149. (package
  8150. (name "ipset")
  8151. (version "7.15")
  8152. (source
  8153. (origin
  8154. (method url-fetch)
  8155. (uri (string-append "https://ipset.netfilter.org/"
  8156. "ipset-" version ".tar.bz2"))
  8157. (sha256
  8158. (base32 "0l8pcaym6057hq3a4zwnk53p5y6xg1m3d3c83wn18h5nmnm4am8a"))))
  8159. (build-system gnu-build-system)
  8160. (inputs
  8161. `(("libmnl" ,libmnl)))
  8162. (native-inputs
  8163. `(("pkg-config" ,pkg-config)))
  8164. (arguments
  8165. `(#:configure-flags '("--disable-static"
  8166. "--with-kmod=no")))
  8167. (home-page "https://ipset.netfilter.org/")
  8168. (synopsis "Administration tool for IP sets")
  8169. (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
  8170. can be administered by the ipset utility. Depending on the type,
  8171. currently an IP set may store IP addresses, (TCP/UDP) port numbers or
  8172. IP addresses with MAC addresses in a way which ensures lightning speed
  8173. when matching an entry against a set.
  8174. If you want to
  8175. @itemize @bullet
  8176. @item store multiple IP addresses or port numbers and match against the entire
  8177. collection using a single iptables rule.
  8178. @item dynamically update iptables rules against IP addresses or ports without
  8179. performance penalty.
  8180. @item express complex IP address and ports based rulesets with a single
  8181. iptables rule and benefit from the speed of IP sets.
  8182. @end itemize\n
  8183. then IP sets may be the proper tool for you.")
  8184. (license license:gpl2+)))
  8185. (define-public liburing
  8186. (package
  8187. (name "liburing")
  8188. (version "0.7")
  8189. (source (origin
  8190. (method git-fetch)
  8191. (uri (git-reference
  8192. (url "https://git.kernel.dk/liburing")
  8193. (commit (string-append "liburing-" version))))
  8194. (file-name (git-file-name name version))
  8195. (sha256
  8196. (base32
  8197. "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
  8198. (build-system gnu-build-system)
  8199. (arguments
  8200. `(;; Tests are dependent on kernel version and features
  8201. #:tests? #f
  8202. #:phases
  8203. (modify-phases %standard-phases
  8204. (replace 'configure
  8205. ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
  8206. ;; --enable-fast-install, and --build
  8207. (lambda* (#:key outputs #:allow-other-keys)
  8208. (let ((out (assoc-ref outputs "out")))
  8209. (setenv "SHELL" (which "sh"))
  8210. (setenv "CONFIG_SHELL" (which "sh"))
  8211. (invoke "./configure" (string-append "--prefix=" out))))))))
  8212. (home-page "https://github.com/axboe/liburing")
  8213. (synopsis "Interface to the Linux kernel @code{io_uring} interface")
  8214. (description "This is the io_uring library, liburing. liburing provides
  8215. helpers to setup and teardown io_uring instances, and also a simplified
  8216. interface for applications that don't need (or want) to deal with the full
  8217. kernel side implementation.")
  8218. (license license:expat)))
  8219. (define-public erofs-utils
  8220. (package
  8221. (name "erofs-utils")
  8222. (version "1.3")
  8223. (source
  8224. (origin
  8225. (method git-fetch)
  8226. (uri (git-reference
  8227. (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
  8228. (commit (string-append "v" version))))
  8229. (file-name (git-file-name name version))
  8230. (sha256
  8231. (base32 "0sqiw05zbxr6l0g9gn3whkc4qc5km2qvfg4lnm08nppwskm8yaw8"))))
  8232. (build-system gnu-build-system)
  8233. (inputs
  8234. `(("lz4" ,lz4)
  8235. ("libuuid" ,util-linux "lib")))
  8236. (native-inputs
  8237. `(("autoconf" ,autoconf)
  8238. ("automake" ,automake)
  8239. ("libtool" ,libtool)
  8240. ("pkg-config" ,pkg-config)))
  8241. (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
  8242. (synopsis "User-space tools for the EROFS file system")
  8243. (description
  8244. "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
  8245. read-only file system optimized for resource-scarce devices. This package
  8246. provides user-space tools for creating EROFS file systems.")
  8247. (license license:gpl2+)))
  8248. (define-public rasdaemon
  8249. (package
  8250. (name "rasdaemon")
  8251. (version "0.6.7")
  8252. (source
  8253. (origin
  8254. (method git-fetch)
  8255. (uri (git-reference
  8256. (url "https://github.com/mchehab/rasdaemon")
  8257. (commit (string-append "v" version))))
  8258. (file-name (git-file-name name version))
  8259. (sha256
  8260. (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
  8261. (native-inputs `(("autoconf" ,autoconf)
  8262. ("automake" ,automake)
  8263. ("libtool" ,libtool)))
  8264. (inputs `(("sqlite" ,sqlite)))
  8265. (arguments
  8266. `(#:configure-flags
  8267. (list "--enable-all"
  8268. ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
  8269. "--with-sysconfdefdir=."
  8270. "--localstatedir=/var")
  8271. #:phases
  8272. (modify-phases %standard-phases
  8273. (add-before 'configure 'munge-autotools
  8274. (lambda _
  8275. ;; For some reason upstream forces sysconfdir=/etc. This results
  8276. ;; in EPERM during the install phase. Removing the offending
  8277. ;; line lets sysconfdir correctly pick up DESTDIR.
  8278. (substitute* "configure.ac"
  8279. (("^test .* sysconfdir=/etc\n$") ""))
  8280. ;; Upstream tries to create /var/lib/rasdaemon at install time.
  8281. ;; This results in EPERM on guix. Instead, the service should
  8282. ;; create this at activation time.
  8283. (substitute* "Makefile.am"
  8284. (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
  8285. (build-system gnu-build-system)
  8286. (home-page "https://github.com/mchehab/rasdaemon")
  8287. (synopsis "Platform Reliability, Availability, and Serviceability tools")
  8288. (description
  8289. "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
  8290. Availability and Serviceability} reports from Linux kernel trace events.
  8291. These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
  8292. through standard log mechanisms like syslog.")
  8293. (license license:gpl2)))
  8294. (define-public libgpiod
  8295. (package
  8296. (name "libgpiod")
  8297. (version "1.6.3")
  8298. (source
  8299. (origin
  8300. (method git-fetch)
  8301. (uri
  8302. (git-reference
  8303. (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
  8304. (commit (string-append "v" version))))
  8305. (file-name (git-file-name name version))
  8306. (sha256 (base32 "0rv8a11hx3pc6sdw6nfc6k35hkp2clb3v53n1381cvip8fzhbsad"))))
  8307. (build-system gnu-build-system)
  8308. (arguments
  8309. `(#:configure-flags
  8310. '("--enable-tools=yes"
  8311. "--enable-bindings-cxx"
  8312. "--enable-bindings-python")))
  8313. (native-inputs
  8314. `(("automake" ,automake)
  8315. ("autoconf" ,autoconf)
  8316. ("libtool" ,libtool)
  8317. ("autoconf-archive" ,autoconf-archive)
  8318. ("pkg-config" ,pkg-config)
  8319. ("python" ,python-3)))
  8320. (synopsis "Interact with the Linux GPIO character device")
  8321. (description
  8322. "This package provides a C library with C++/Python bindings and
  8323. command-line tools for interacting with GPIO devices that avoids the usage of
  8324. older system-wide @file{/sys} interface.")
  8325. (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
  8326. (license (list license:lgpl2.1+ ;; libgpiod
  8327. license:gpl2+ ;; gpio-tools
  8328. license:lgpl3+)))) ;; C++ bindings