linux.scm 359 KB

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