linux.scm 368 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012-2021, 2021-2022 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, 2022 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-2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  15. ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  16. ;;; Copyright © 2016 David Craven <david@craven.ch>
  17. ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
  18. ;;; Copyright © 2016-2022 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, 2022 Leo Famulari <leo@famulari.name>
  23. ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
  24. ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
  25. ;;; Copyright © 2017, 2019, 2021 Mathieu Othacehe <othacehe@gnu.org>
  26. ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
  27. ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
  28. ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
  29. ;;; Copyright © 2017 Dave Love <fx@gnu.org>
  30. ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
  31. ;;; Copyright © 2018, 2020 Brendan Tildesley <mail@brendan.scot>
  32. ;;; Copyright © 2018 Manuel Graf <graf@init.at>
  33. ;;; Copyright © 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
  34. ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
  35. ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
  36. ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  37. ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
  38. ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
  39. ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
  40. ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
  41. ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
  42. ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
  43. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  44. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  45. ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
  46. ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
  47. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  48. ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
  49. ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
  50. ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
  51. ;;; Copyright © 2020 David Dashyan <mail@davie.li>
  52. ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
  53. ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
  54. ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
  55. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  56. ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
  57. ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
  58. ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
  59. ;;; Copyright © 2021 Josselin Poiret <josselin.poiret@protonmail.ch>
  60. ;;; Copyright © 2021 Olivier Dion <olivier.dion@polymtl.ca>
  61. ;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
  62. ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
  63. ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
  64. ;;;
  65. ;;; This file is part of GNU Guix.
  66. ;;;
  67. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  68. ;;; under the terms of the GNU General Public License as published by
  69. ;;; the Free Software Foundation; either version 3 of the License, or (at
  70. ;;; your option) any later version.
  71. ;;;
  72. ;;; GNU Guix is distributed in the hope that it will be useful, but
  73. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  74. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  75. ;;; GNU General Public License for more details.
  76. ;;;
  77. ;;; You should have received a copy of the GNU General Public License
  78. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  79. (define-module (gnu packages linux)
  80. #:use-module (gnu packages)
  81. #:use-module (gnu packages acl)
  82. #:use-module (gnu packages admin)
  83. #:use-module (gnu packages algebra)
  84. #:use-module (gnu packages audio)
  85. #:use-module (gnu packages autotools)
  86. #:use-module (gnu packages avahi)
  87. #:use-module (gnu packages backup)
  88. #:use-module (gnu packages base)
  89. #:use-module (gnu packages bash)
  90. #:use-module (gnu packages bison)
  91. #:use-module (gnu packages boost)
  92. #:use-module (gnu packages calendar)
  93. #:use-module (gnu packages check)
  94. #:use-module (gnu packages cpio)
  95. #:use-module (gnu packages crypto)
  96. #:use-module (gnu packages cryptsetup)
  97. #:use-module (gnu packages compression)
  98. #:use-module (gnu packages dbm)
  99. #:use-module (gnu packages datastructures)
  100. #:use-module (gnu packages docbook)
  101. #:use-module (gnu packages documentation)
  102. #:use-module (gnu packages elf)
  103. #:use-module (gnu packages flex)
  104. #:use-module (gnu packages file)
  105. #:use-module (gnu packages freedesktop)
  106. #:use-module (gnu packages gawk)
  107. #:use-module (gnu packages gcc)
  108. #:use-module (gnu packages gettext)
  109. #:use-module (gnu packages glib)
  110. #:use-module (gnu packages gnupg)
  111. #:use-module (gnu packages golang)
  112. #:use-module (gnu packages gperf)
  113. #:use-module (gnu packages gstreamer)
  114. #:use-module (gnu packages gtk)
  115. #:use-module (gnu packages haskell-apps)
  116. #:use-module (gnu packages haskell-xyz)
  117. #:use-module (gnu packages libunwind)
  118. #:use-module (gnu packages libusb)
  119. #:use-module (gnu packages llvm)
  120. #:use-module (gnu packages lua)
  121. #:use-module (gnu packages man)
  122. #:use-module (gnu packages maths)
  123. #:use-module (gnu packages multiprecision)
  124. #:use-module (gnu packages ncurses)
  125. #:use-module (gnu packages netpbm)
  126. #:use-module (gnu packages networking)
  127. #:use-module (gnu packages ninja)
  128. #:use-module (gnu packages nss)
  129. #:use-module (gnu packages perl)
  130. #:use-module (gnu packages pciutils)
  131. #:use-module (gnu packages pkg-config)
  132. #:use-module (gnu packages popt)
  133. #:use-module (gnu packages pulseaudio)
  134. #:use-module (gnu packages python)
  135. #:use-module (gnu packages python-xyz)
  136. #:use-module (gnu packages readline)
  137. #:use-module (gnu packages rrdtool)
  138. #:use-module (gnu packages samba)
  139. #:use-module (gnu packages sdl)
  140. #:use-module (gnu packages serialization)
  141. #:use-module (gnu packages slang)
  142. #:use-module (gnu packages sqlite)
  143. #:use-module (gnu packages texinfo)
  144. #:use-module (gnu packages textutils)
  145. #:use-module (gnu packages tls)
  146. #:use-module (gnu packages valgrind)
  147. #:use-module (gnu packages video)
  148. #:use-module (gnu packages vulkan)
  149. #:use-module (gnu packages web)
  150. #:use-module (gnu packages xiph)
  151. #:use-module (gnu packages xml)
  152. #:use-module (gnu packages xdisorg)
  153. #:use-module (gnu packages xorg)
  154. #:use-module (gnu packages groff)
  155. #:use-module (gnu packages selinux)
  156. #:use-module (gnu packages swig)
  157. #:use-module (guix build-system cmake)
  158. #:use-module (guix build-system copy)
  159. #:use-module (guix build-system gnu)
  160. #:use-module (guix build-system go)
  161. #:use-module (guix build-system meson)
  162. #:use-module (guix build-system python)
  163. #:use-module (guix build-system trivial)
  164. #:use-module (guix build-system linux-module)
  165. #:use-module (guix download)
  166. #:use-module (guix git-download)
  167. #:use-module ((guix licenses) #:prefix license:)
  168. #:use-module (guix packages)
  169. #:use-module (guix gexp)
  170. #:use-module (guix store)
  171. #:use-module (guix monads)
  172. #:use-module (guix utils)
  173. #:use-module (guix deprecation) ;for libcap/next
  174. #:use-module (srfi srfi-1)
  175. #:use-module (srfi srfi-2)
  176. #:use-module (srfi srfi-26)
  177. #:use-module (ice-9 match)
  178. #:use-module (ice-9 regex))
  179. (define-public (system->linux-architecture arch)
  180. "Return the Linux architecture name for ARCH, a Guix system name such as
  181. \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
  182. (let ((arch (car (string-split arch #\-))))
  183. (cond ((string=? arch "i686") "i386")
  184. ((string-prefix? "mips" arch) "mips")
  185. ((string-prefix? "arm" arch) "arm")
  186. ((string-prefix? "aarch64" arch) "arm64")
  187. ((string-prefix? "alpha" arch) "alpha")
  188. ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
  189. ((string-prefix? "s390" arch) "s390")
  190. ((string-prefix? "riscv" arch) "riscv")
  191. (else arch))))
  192. (define-public (system->defconfig system)
  193. "Some systems (notably powerpc-linux) require a special target for kernel
  194. defconfig. Return the appropriate make target if applicable, otherwise return
  195. \"defconfig\"."
  196. (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
  197. ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
  198. ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
  199. (else "defconfig")))
  200. ;;;
  201. ;;; Kernel source code deblobbing.
  202. ;;;
  203. (define (linux-libre-deblob-scripts version gnu-revision
  204. deblob-hash
  205. deblob-check-hash)
  206. (list (version-major+minor version)
  207. (origin
  208. (method url-fetch)
  209. (uri (string-append "https://linux-libre.fsfla.org"
  210. "/pub/linux-libre/releases/" version "-" gnu-revision "/"
  211. "deblob-" (version-major+minor version)))
  212. (file-name (string-append "linux-libre-deblob-"
  213. version "-" gnu-revision))
  214. (sha256 deblob-hash))
  215. (origin
  216. (method url-fetch)
  217. (uri (string-append "https://linux-libre.fsfla.org"
  218. "/pub/linux-libre/releases/" version "-" gnu-revision "/"
  219. "deblob-check"))
  220. (file-name (string-append "linux-libre-deblob-check-" version "-" gnu-revision))
  221. (sha256 deblob-check-hash))))
  222. ;; XXXX: Workaround 'snippet' limitations
  223. (define computed-origin-method (@@ (guix packages) computed-origin-method))
  224. (define (make-linux-libre-source version
  225. upstream-source
  226. deblob-scripts)
  227. "Return a 'computed' origin that generates a Linux-libre tarball from the
  228. corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
  229. (match deblob-scripts
  230. ((deblob-version (? origin? deblob) (? origin? deblob-check))
  231. (unless (string=? deblob-version (version-major+minor version))
  232. ;; The deblob script cannot be expected to work properly on a
  233. ;; different version (major+minor) of Linux, even if no errors
  234. ;; are signaled during execution.
  235. (error "deblob major+minor version mismatch"))
  236. (origin
  237. (method computed-origin-method)
  238. (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
  239. (sha256 #f)
  240. (uri
  241. (delay
  242. (with-imported-modules '((guix build utils))
  243. #~(begin
  244. (use-modules (guix build utils)
  245. (srfi srfi-1)
  246. (ice-9 match)
  247. (ice-9 ftw))
  248. (setvbuf (current-output-port) 'line)
  249. (let ((dir (string-append "linux-" #$version)))
  250. (mkdir "/tmp/bin")
  251. (set-path-environment-variable
  252. "PATH" '("bin")
  253. (list "/tmp"
  254. #+(canonical-package bash)
  255. #+(canonical-package coreutils)
  256. #+(canonical-package diffutils)
  257. #+(canonical-package findutils)
  258. #+(canonical-package patch)
  259. #+(canonical-package xz)
  260. #+(canonical-package sed)
  261. #+(canonical-package grep)
  262. #+(canonical-package bzip2)
  263. #+(canonical-package gzip)
  264. #+(canonical-package tar)
  265. #+(canonical-package gawk)
  266. #+python-wrapper))
  267. (with-directory-excursion "/tmp/bin"
  268. (copy-file #+deblob "deblob")
  269. (chmod "deblob" #o755)
  270. (substitute* "deblob"
  271. (("/bin/sh") (which "sh")))
  272. (copy-file #+deblob-check "deblob-check")
  273. (chmod "deblob-check" #o755)
  274. (substitute* "deblob-check"
  275. (("/bin/sh") (which "sh"))
  276. (("/bin/sed") (which "sed"))
  277. (("/usr/bin/python") (which "python"))))
  278. (if (file-is-directory? #+upstream-source)
  279. (begin
  280. (format #t "Copying upstream linux source...~%")
  281. (invoke "cp" "--archive" #+upstream-source dir)
  282. (invoke "chmod" "--recursive" "u+w" dir))
  283. (begin
  284. (format #t "Unpacking upstream linux tarball...~%")
  285. (invoke "tar" "xf" #$upstream-source)
  286. (match (scandir "."
  287. (lambda (name)
  288. (and (not (member name '("." "..")))
  289. (file-is-directory? name))))
  290. ((unpacked-dir)
  291. (unless (string=? dir unpacked-dir)
  292. (rename-file unpacked-dir dir)))
  293. (dirs
  294. (error "multiple directories found" dirs)))))
  295. (with-directory-excursion dir
  296. (format #t "Running deblob script...~%")
  297. (invoke "/tmp/bin/deblob"))
  298. (format #t "~%Packing new Linux-libre tarball...~%")
  299. (invoke "tar" "cvfa" #$output
  300. ;; Avoid non-determinism in the archive.
  301. "--mtime=@0"
  302. "--owner=root:0"
  303. "--group=root:0"
  304. "--sort=name"
  305. "--hard-dereference"
  306. dir)
  307. (format #t "~%Scanning the generated tarball for blobs...~%")
  308. (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
  309. #$output))))))))))
  310. ;;;
  311. ;;; Kernel sources.
  312. ;;;
  313. (define (linux-libre-urls version gnu-revision)
  314. "Return a list of URLs for Linux-Libre VERSION."
  315. (list (string-append
  316. "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
  317. version "-" gnu-revision "/linux-libre-" version "-" gnu-revision ".tar.xz")
  318. ;; XXX: Work around <http://bugs.gnu.org/14851>.
  319. (string-append
  320. "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
  321. version "-" gnu-revision ".tar.xz")
  322. ;; Maybe this URL will become valid eventually.
  323. (string-append
  324. "mirror://gnu/linux-libre/" version "-" gnu-revision "/linux-libre-"
  325. version "-" gnu-revision ".tar.xz")))
  326. (define (%upstream-linux-source version hash)
  327. (origin
  328. (method url-fetch)
  329. (uri (string-append "mirror://kernel.org"
  330. "/linux/kernel/v" (version-major version) ".x/"
  331. "linux-" version ".tar.xz"))
  332. (sha256 hash)))
  333. ;; The current "stable" kernels. That is, the most recently released major
  334. ;; versions that are still supported upstream.
  335. (define-public linux-libre-5.17-version "5.17.1")
  336. (define-public linux-libre-5.17-gnu-revision "gnu")
  337. (define deblob-scripts-5.17
  338. (linux-libre-deblob-scripts
  339. linux-libre-5.17-version
  340. linux-libre-5.17-gnu-revision
  341. (base32 "08ip5g827f30qzb3j2l19zkbdqv00sij46nbrjg75h5kkasdbfgr")
  342. (base32 "0d4wmgirn2b7bv99f8ckfpcagwd2pylzn1sd6jz6d2apdfdspi0g")))
  343. (define-public linux-libre-5.17-pristine-source
  344. (let ((version linux-libre-5.17-version)
  345. (hash (base32 "092cx18va108lb27kxx2b00ma3l9g22nmkk81034apx26bacbmbw")))
  346. (make-linux-libre-source version
  347. (%upstream-linux-source version hash)
  348. deblob-scripts-5.17)))
  349. (define-public linux-libre-5.16-version "5.16.18")
  350. (define-public linux-libre-5.16-gnu-revision "gnu")
  351. (define deblob-scripts-5.16
  352. (linux-libre-deblob-scripts
  353. linux-libre-5.16-version
  354. linux-libre-5.16-gnu-revision
  355. (base32 "1hrs478hnmk32gp6irjramdiwm118f3plhvmg6g118b6pzhzxjs2")
  356. (base32 "1g57ki73s8bxm1kdgd4nqbcix0rp1x5mwi8i2c874f4grnsqbfny")))
  357. (define-public linux-libre-5.16-pristine-source
  358. (let ((version linux-libre-5.16-version)
  359. (hash (base32 "096f80m2czj8khvil7s037pqdf1s6pklqn5d9419jqkz7v70piry")))
  360. (make-linux-libre-source version
  361. (%upstream-linux-source version hash)
  362. deblob-scripts-5.16)))
  363. ;; The "longterm" kernels — the older releases with long-term upstream support.
  364. ;; Here are the support timelines:
  365. ;; <https://www.kernel.org/category/releases.html>
  366. (define-public linux-libre-5.15-version "5.15.32")
  367. (define-public linux-libre-5.15-gnu-revision "gnu")
  368. (define deblob-scripts-5.15
  369. (linux-libre-deblob-scripts
  370. linux-libre-5.15-version
  371. linux-libre-5.15-gnu-revision
  372. (base32 "1n57mz5agvf1d0ggbg080d7hvx8p9y0iqxkq4ypg10a7n96zy7y5")
  373. (base32 "1rvfr97nbr5s6cp2llhx6l1aih13xs0mh3wjdpn0l6q3f4zz2wfk")))
  374. (define-public linux-libre-5.15-pristine-source
  375. (let ((version linux-libre-5.15-version)
  376. (hash (base32 "11nz2w6hgwy6va6sxf4ic1s4kv24zbpssgjxsq6n321h4bxcsqql")))
  377. (make-linux-libre-source version
  378. (%upstream-linux-source version hash)
  379. deblob-scripts-5.15)))
  380. (define-public linux-libre-5.10-version "5.10.109")
  381. (define-public linux-libre-5.10-gnu-revision "gnu1")
  382. (define deblob-scripts-5.10
  383. (linux-libre-deblob-scripts
  384. linux-libre-5.10-version
  385. linux-libre-5.10-gnu-revision
  386. (base32 "0mw7qn77y9c6wrnw4rjvf75cpm1w6n1aqqhf8cnghcb97p2yxxrf")
  387. (base32 "0wx0y9fbgfbmhdb8v4ki2hq58m0w6gp66wq944sr5x0sv6m4bgf3")))
  388. (define-public linux-libre-5.10-pristine-source
  389. (let ((version linux-libre-5.10-version)
  390. (hash (base32 "1p0k46isy2wzzms801lrnb59f1nb9mhywjj7fnkrwrj9nbn25yqq")))
  391. (make-linux-libre-source version
  392. (%upstream-linux-source version hash)
  393. deblob-scripts-5.10)))
  394. (define-public linux-libre-5.4-version "5.4.188")
  395. (define-public linux-libre-5.4-gnu-revision "gnu1")
  396. (define deblob-scripts-5.4
  397. (linux-libre-deblob-scripts
  398. linux-libre-5.4-version
  399. linux-libre-5.4-gnu-revision
  400. (base32 "1nlgk8ajb5wl3aa96h9a0pb9j5a5wmrbpk63varn557x1d00r7wj")
  401. (base32 "1mp9d0b7mqw7cl65k0a18265cvn4qwcpnvna8r6n5m3y4pz3rik9")))
  402. (define-public linux-libre-5.4-pristine-source
  403. (let ((version linux-libre-5.4-version)
  404. (hash (base32 "1g7xf2jx1hx580f42yirfgv9v0f9f88wzxxx0wiwx7wcqbyqpg4z")))
  405. (make-linux-libre-source version
  406. (%upstream-linux-source version hash)
  407. deblob-scripts-5.4)))
  408. (define-public linux-libre-4.19-version "4.19.237")
  409. (define-public linux-libre-4.19-gnu-revision "gnu1")
  410. (define deblob-scripts-4.19
  411. (linux-libre-deblob-scripts
  412. linux-libre-4.19-version
  413. linux-libre-4.19-gnu-revision
  414. (base32 "06pqv050bkii0hc2v7ymny5264w1bca8db0dp1pw9mfmjg865am5")
  415. (base32 "1mp9d0b7mqw7cl65k0a18265cvn4qwcpnvna8r6n5m3y4pz3rik9")))
  416. (define-public linux-libre-4.19-pristine-source
  417. (let ((version linux-libre-4.19-version)
  418. (hash (base32 "1n0c4bmmbj145zsp662a5rxh294fpq4dkillpz16wj6c098z7zxs")))
  419. (make-linux-libre-source version
  420. (%upstream-linux-source version hash)
  421. deblob-scripts-4.19)))
  422. (define-public linux-libre-4.14-version "4.14.274")
  423. (define-public linux-libre-4.14-gnu-revision "gnu1")
  424. (define deblob-scripts-4.14
  425. (linux-libre-deblob-scripts
  426. linux-libre-4.14-version
  427. linux-libre-4.14-gnu-revision
  428. (base32 "02rxvr0gmxb3zfsyyzdmzgfq04gkdkv1cc38md0xfl0mxzdzdfyk")
  429. (base32 "1mp9d0b7mqw7cl65k0a18265cvn4qwcpnvna8r6n5m3y4pz3rik9")))
  430. (define-public linux-libre-4.14-pristine-source
  431. (let ((version linux-libre-4.14-version)
  432. (hash (base32 "1bbz1w5l7im7dspq6g6iy5vahsxcaa1b2ykrw49m3pw8rf7m6hib")))
  433. (make-linux-libre-source version
  434. (%upstream-linux-source version hash)
  435. deblob-scripts-4.14)))
  436. (define-public linux-libre-4.9-version "4.9.309")
  437. (define-public linux-libre-4.9-gnu-revision "gnu1")
  438. (define deblob-scripts-4.9
  439. (linux-libre-deblob-scripts
  440. linux-libre-4.9-version
  441. linux-libre-4.9-gnu-revision
  442. (base32 "0nai5m4rbh37qaj1xf2qj7656l2gacfh0847q5d07y22b048fq5n")
  443. (base32 "0wdaj40pcq9wg5xnz2zj3jj8bawhfgqxcwp6dnavbf9lq0gca48p")))
  444. (define-public linux-libre-4.9-pristine-source
  445. (let ((version linux-libre-4.9-version)
  446. (hash (base32 "05468rk4hlz9ag1zb7shngn5rl42npw7haqbi5mpaa0yksl5asp8")))
  447. (make-linux-libre-source version
  448. (%upstream-linux-source version hash)
  449. deblob-scripts-4.9)))
  450. (define %boot-logo-patch
  451. ;; Linux-Libre boot logo featuring Freedo and a gnu.
  452. (origin
  453. (method url-fetch)
  454. (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
  455. "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
  456. (sha256
  457. (base32
  458. "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
  459. (define %linux-libre-arm-export-__sync_icache_dcache-patch
  460. (origin
  461. (method url-fetch)
  462. (uri (string-append
  463. "https://salsa.debian.org/kernel-team/linux"
  464. "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
  465. "/debian/patches/bugfix/arm/"
  466. "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
  467. (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
  468. (sha256
  469. (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
  470. (define (source-with-patches source patches)
  471. (origin
  472. (inherit source)
  473. (patches (append (origin-patches source)
  474. patches))))
  475. (define-public linux-libre-5.17-source
  476. (source-with-patches linux-libre-5.17-pristine-source
  477. (list %boot-logo-patch
  478. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  479. (define-public linux-libre-5.16-source
  480. (source-with-patches linux-libre-5.16-pristine-source
  481. (list %boot-logo-patch
  482. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  483. (define-public linux-libre-5.15-source
  484. (source-with-patches linux-libre-5.15-pristine-source
  485. (list %boot-logo-patch
  486. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  487. (define-public linux-libre-5.10-source
  488. (source-with-patches linux-libre-5.10-pristine-source
  489. (list %boot-logo-patch
  490. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  491. (define-public linux-libre-5.4-source
  492. (source-with-patches linux-libre-5.4-pristine-source
  493. (list %boot-logo-patch
  494. %linux-libre-arm-export-__sync_icache_dcache-patch
  495. ;; Pinebook Pro patch from linux-next,
  496. ;; can be dropped for linux-libre 5.7
  497. (search-patch
  498. "linux-libre-support-for-Pinebook-Pro.patch"))))
  499. (define-public linux-libre-4.19-source
  500. (source-with-patches linux-libre-4.19-pristine-source
  501. (list %boot-logo-patch
  502. %linux-libre-arm-export-__sync_icache_dcache-patch)))
  503. (define-public linux-libre-4.14-source
  504. (source-with-patches linux-libre-4.14-pristine-source
  505. (list %boot-logo-patch)))
  506. (define-public linux-libre-4.9-source
  507. (source-with-patches linux-libre-4.9-pristine-source
  508. (list %boot-logo-patch)))
  509. ;;;
  510. ;;; Kernel headers.
  511. ;;;
  512. (define (make-linux-libre-headers version gnu-revision hash-string)
  513. (make-linux-libre-headers* version gnu-revision
  514. (origin
  515. (method url-fetch)
  516. (uri (linux-libre-urls version gnu-revision))
  517. (sha256 (base32 hash-string)))))
  518. (define (make-linux-libre-headers* version gnu-revision source)
  519. (package
  520. (name "linux-libre-headers")
  521. (version version)
  522. (source source)
  523. (build-system gnu-build-system)
  524. (native-inputs `(("perl" ,perl)
  525. ,@(if (version>=? version "4.16")
  526. `(("flex" ,flex)
  527. ("bison" ,bison))
  528. '())))
  529. (arguments
  530. `(#:modules ((guix build gnu-build-system)
  531. (guix build utils)
  532. (srfi srfi-1)
  533. (ice-9 match))
  534. #:phases
  535. (modify-phases %standard-phases
  536. (delete 'configure)
  537. (replace 'build
  538. (lambda _
  539. (let ((arch ,(system->linux-architecture
  540. (or (%current-target-system)
  541. (%current-system))))
  542. (defconfig ,(system->defconfig
  543. (or (%current-target-system)
  544. (%current-system))))
  545. (make-target ,(if (version>=? version "5.3")
  546. "headers"
  547. "headers_check")))
  548. (setenv "ARCH" arch)
  549. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  550. (invoke "make" defconfig)
  551. (invoke "make" "mrproper" make-target))))
  552. (replace 'install
  553. (lambda* (#:key outputs #:allow-other-keys)
  554. (let ((out (assoc-ref outputs "out")))
  555. ;; Mimic the quiet_cmd_headers_install target to avoid a
  556. ;; dependency on rsync.
  557. (for-each (lambda (file)
  558. (let ((destination (string-append
  559. out "/include/"
  560. ;; Drop the 'usr/include' prefix.
  561. (match (string-split file #\/)
  562. ((_ _ path ...)
  563. (string-join path "/"))))))
  564. (format #t "`~a' -> `~a'~%" file destination)
  565. (install-file file (dirname destination))))
  566. (find-files "usr/include" "\\.h$"))
  567. (mkdir (string-append out "/include/config"))
  568. (call-with-output-file
  569. (string-append out
  570. "/include/config/kernel.release")
  571. (lambda (p)
  572. (format p "~a-default~%" ,version)))))))
  573. #:allowed-references ()
  574. #:tests? #f))
  575. (home-page "https://www.gnu.org/software/linux-libre/")
  576. (synopsis "GNU Linux-Libre kernel headers")
  577. (description "Headers of the Linux-Libre kernel.")
  578. (license license:gpl2)))
  579. (define-public linux-libre-headers-5.17
  580. (make-linux-libre-headers* linux-libre-5.17-version
  581. linux-libre-5.17-gnu-revision
  582. linux-libre-5.17-source))
  583. (define-public linux-libre-headers-5.16
  584. (make-linux-libre-headers* linux-libre-5.16-version
  585. linux-libre-5.16-gnu-revision
  586. linux-libre-5.16-source))
  587. (define-public linux-libre-headers-5.15
  588. (make-linux-libre-headers* linux-libre-5.15-version
  589. linux-libre-5.15-gnu-revision
  590. linux-libre-5.15-source))
  591. (define-public linux-libre-headers-5.10
  592. (make-linux-libre-headers* linux-libre-5.10-version
  593. linux-libre-5.10-gnu-revision
  594. linux-libre-5.10-source))
  595. (define-public linux-libre-headers-5.4
  596. (make-linux-libre-headers* linux-libre-5.4-version
  597. linux-libre-5.4-gnu-revision
  598. linux-libre-5.4-source))
  599. (define-public linux-libre-headers-4.19
  600. (make-linux-libre-headers* linux-libre-4.19-version
  601. linux-libre-4.19-gnu-revision
  602. linux-libre-4.19-source))
  603. (define-public linux-libre-headers-4.14
  604. (make-linux-libre-headers* linux-libre-4.14-version
  605. linux-libre-4.14-gnu-revision
  606. linux-libre-4.14-source))
  607. (define-public linux-libre-headers-4.9
  608. (make-linux-libre-headers* linux-libre-4.9-version
  609. linux-libre-4.9-gnu-revision
  610. linux-libre-4.9-source))
  611. ;; The following package is used in the early bootstrap, and thus must be kept
  612. ;; stable and with minimal build requirements.
  613. (define-public linux-libre-headers-5.10.35
  614. (make-linux-libre-headers "5.10.35" "gnu"
  615. "0q2rnchad55d49f3rajrkazz0fcjv1irwrdb1hwjnl01fzm2gjk3"))
  616. (define-public linux-libre-headers linux-libre-headers-5.10.35)
  617. ;;;
  618. ;;; Kernel configurations.
  619. ;;;
  620. (define* (kernel-config arch #:key variant)
  621. "Return the absolute file name of the Linux-Libre build configuration file
  622. for ARCH and optionally VARIANT, or #f if there is no such configuration."
  623. (let* ((name (string-append (if variant (string-append variant "-") "")
  624. (if (string=? "i386" arch) "i686" arch) ".conf"))
  625. (file (string-append "linux-libre/" name)))
  626. (search-auxiliary-file file)))
  627. (define %default-extra-linux-options
  628. `(;; Make the kernel config available at /proc/config.gz
  629. ("CONFIG_IKCONFIG" . #t)
  630. ("CONFIG_IKCONFIG_PROC" . #t)
  631. ;; Some very mild hardening.
  632. ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
  633. ;; All kernels should have NAMESPACES options enabled
  634. ("CONFIG_NAMESPACES" . #t)
  635. ("CONFIG_UTS_NS" . #t)
  636. ("CONFIG_IPC_NS" . #t)
  637. ("CONFIG_USER_NS" . #t)
  638. ("CONFIG_PID_NS" . #t)
  639. ("CONFIG_NET_NS" . #t)
  640. ;; Various options needed for elogind service:
  641. ;; https://issues.guix.gnu.org/43078
  642. ("CONFIG_CGROUP_FREEZER" . #t)
  643. ("CONFIG_BLK_CGROUP" . #t)
  644. ("CONFIG_CGROUP_WRITEBACK" . #t)
  645. ("CONFIG_CGROUP_SCHED" . #t)
  646. ("CONFIG_CGROUP_PIDS" . #t)
  647. ("CONFIG_CGROUP_FREEZER" . #t)
  648. ("CONFIG_CGROUP_DEVICE" . #t)
  649. ("CONFIG_CGROUP_CPUACCT" . #t)
  650. ("CONFIG_CGROUP_PERF" . #t)
  651. ("CONFIG_SOCK_CGROUP_DATA" . #t)
  652. ("CONFIG_BLK_CGROUP_IOCOST" . #t)
  653. ("CONFIG_CGROUP_NET_PRIO" . #t)
  654. ("CONFIG_CGROUP_NET_CLASSID" . #t)
  655. ("CONFIG_MEMCG" . #t)
  656. ("CONFIG_MEMCG_SWAP" . #t)
  657. ("CONFIG_MEMCG_KMEM" . #t)
  658. ("CONFIG_CPUSETS" . #t)
  659. ("CONFIG_PROC_PID_CPUSET" . #t)
  660. ;; Allow disk encryption by default
  661. ("CONFIG_DM_CRYPT" . m)
  662. ;; Modules required for initrd:
  663. ("CONFIG_NET_9P" . m)
  664. ("CONFIG_NET_9P_VIRTIO" . m)
  665. ("CONFIG_VIRTIO_BLK" . m)
  666. ("CONFIG_VIRTIO_NET" . m)
  667. ("CONFIG_VIRTIO_PCI" . m)
  668. ("CONFIG_VIRTIO_BALLOON" . m)
  669. ("CONFIG_VIRTIO_MMIO" . m)
  670. ("CONFIG_FUSE_FS" . m)
  671. ("CONFIG_CIFS" . m)
  672. ("CONFIG_9P_FS" . m)))
  673. ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
  674. (define %bpf-extra-linux-options
  675. `(;; Needed for probes
  676. ("CONFIG_UPROBE_EVENTS" . #t)
  677. ("CONFIG_KPROBE_EVENTS" . #t)
  678. ;; kheaders module also helpful for tracing
  679. ("CONFIG_IKHEADERS" . #t)
  680. ("CONFIG_BPF" . #t)
  681. ("CONFIG_BPF_SYSCALL" . #t)
  682. ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
  683. ;; optional, for tc filters
  684. ("CONFIG_NET_CLS_BPF" . m)
  685. ;; optional, for tc actions
  686. ("CONFIG_NET_ACT_BPF" . m)
  687. ("CONFIG_BPF_JIT" . #t)
  688. ;; for Linux kernel versions 4.1 through 4.6
  689. ;; ("CONFIG_HAVE_BPF_JIT" . y)
  690. ;; for Linux kernel versions 4.7 and later
  691. ("CONFIG_HAVE_EBPF_JIT" . #t)
  692. ;; optional, for kprobes
  693. ("CONFIG_BPF_EVENTS" . #t)
  694. ;; kheaders module
  695. ("CONFIG_IKHEADERS" . #t)))
  696. (define (config->string options)
  697. (string-join (map (match-lambda
  698. ((option . 'm)
  699. (string-append option "=m"))
  700. ((option . #t)
  701. (string-append option "=y"))
  702. ((option . #f)
  703. (string-append option "=n")))
  704. options)
  705. "\n"))
  706. ;;;
  707. ;;; Kernel package utilities.
  708. ;;;
  709. (define* (make-linux-libre version gnu-revision hash-string supported-systems
  710. #:key
  711. (extra-version #f)
  712. ;; A function that takes an arch and a variant.
  713. ;; See kernel-config for an example.
  714. (configuration-file #f)
  715. (defconfig "defconfig")
  716. (extra-options %default-extra-linux-options)
  717. (patches (list %boot-logo-patch)))
  718. (make-linux-libre* version gnu-revision
  719. (origin
  720. (method url-fetch)
  721. (uri (linux-libre-urls version gnu-revision))
  722. (sha256 (base32 hash-string))
  723. (patches patches))
  724. supported-systems
  725. #:extra-version extra-version
  726. #:configuration-file configuration-file
  727. #:defconfig defconfig
  728. #:extra-options extra-options))
  729. (define* (make-linux-libre* version gnu-revision source supported-systems
  730. #:key
  731. (extra-version #f)
  732. ;; A function that takes an arch and a variant.
  733. ;; See kernel-config for an example.
  734. (configuration-file #f)
  735. (defconfig "defconfig")
  736. (extra-options %default-extra-linux-options))
  737. (package
  738. (name (if extra-version
  739. (string-append "linux-libre-" extra-version)
  740. "linux-libre"))
  741. (version version)
  742. (source source)
  743. (supported-systems supported-systems)
  744. (build-system gnu-build-system)
  745. (native-inputs
  746. `(("perl" ,perl)
  747. ("bc" ,bc)
  748. ("openssl" ,openssl)
  749. ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
  750. ("flex" ,flex)
  751. ("bison" ,bison)
  752. ;; These are needed to compile the GCC plugins.
  753. ("gmp" ,gmp)
  754. ("mpfr" ,mpfr)
  755. ("mpc" ,mpc)
  756. ,@(match (and configuration-file
  757. (configuration-file
  758. (system->linux-architecture
  759. (or (%current-target-system) (%current-system)))
  760. #:variant (version-major+minor version)))
  761. (#f ;no config for this platform
  762. '())
  763. ((? string? config)
  764. `(("kconfig" ,config))))))
  765. (arguments
  766. (list #:modules '((guix build gnu-build-system)
  767. (guix build utils)
  768. (srfi srfi-1)
  769. (srfi srfi-26)
  770. (ice-9 ftw)
  771. (ice-9 match))
  772. #:phases
  773. #~(modify-phases %standard-phases
  774. (add-after 'unpack 'patch-/bin/pwd
  775. (lambda _
  776. (substitute* (find-files "." "^Makefile(\\.include)?$")
  777. (("/bin/pwd") "pwd"))))
  778. (replace 'configure
  779. (lambda* (#:key inputs target #:allow-other-keys)
  780. ;; Avoid introducing timestamps.
  781. (setenv "KCONFIG_NOTIMESTAMP" "1")
  782. (setenv "KBUILD_BUILD_TIMESTAMP"
  783. (getenv "SOURCE_DATE_EPOCH"))
  784. ;; Other variables useful for reproducibility.
  785. (setenv "KBUILD_BUILD_USER" "guix")
  786. (setenv "KBUILD_BUILD_HOST" "guix")
  787. ;; Set ARCH and CROSS_COMPILE.
  788. (let ((arch #$(system->linux-architecture
  789. (or (%current-target-system)
  790. (%current-system)))))
  791. (setenv "ARCH" arch)
  792. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  793. (when target
  794. (setenv "CROSS_COMPILE" (string-append target "-"))
  795. (format #t "`CROSS_COMPILE' set to `~a'~%"
  796. (getenv "CROSS_COMPILE"))))
  797. (setenv "EXTRAVERSION"
  798. #$(and extra-version
  799. (string-append "-" extra-version)))
  800. (let ((build (assoc-ref %standard-phases 'build))
  801. (config (assoc-ref inputs "kconfig")))
  802. ;; Use a custom kernel configuration file or a default
  803. ;; configuration file.
  804. (if config
  805. (begin
  806. (copy-file config ".config")
  807. (chmod ".config" #o666))
  808. (invoke "make" #$defconfig))
  809. ;; Appending works even when the option wasn't in the
  810. ;; file. The last one prevails if duplicated.
  811. (let ((port (open-file ".config" "a"))
  812. (extra-configuration #$(config->string extra-options)))
  813. (display extra-configuration port)
  814. (close-port port))
  815. (invoke "make" "oldconfig"))))
  816. (replace 'install
  817. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  818. (let ((moddir (string-append #$output "/lib/modules"))
  819. (dtbdir (string-append #$output "/lib/dtbs")))
  820. ;; Install kernel image, kernel configuration and link map.
  821. (for-each (lambda (file) (install-file file #$output))
  822. (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
  823. ;; Install device tree files
  824. (unless (null? (find-files "." "\\.dtb$"))
  825. (mkdir-p dtbdir)
  826. (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
  827. "dtbs_install"))
  828. ;; Install kernel modules
  829. (mkdir-p moddir)
  830. (invoke "make"
  831. ;; Disable depmod because the Guix system's
  832. ;; module directory is an union of potentially
  833. ;; multiple packages. It is not possible to use
  834. ;; depmod to usefully calculate a dependency
  835. ;; graph while building only one of them.
  836. "DEPMOD=true"
  837. (string-append "MODULE_DIR=" moddir)
  838. (string-append "INSTALL_PATH=" #$output)
  839. (string-append "INSTALL_MOD_PATH=" #$output)
  840. "INSTALL_MOD_STRIP=1"
  841. "modules_install")
  842. (let* ((versions (filter (lambda (name)
  843. (not (string-prefix? "." name)))
  844. (scandir moddir)))
  845. (version (match versions
  846. ((x) x))))
  847. ;; There are symlinks to the build and source directory.
  848. ;; Both will point to target /tmp/guix-build* and thus
  849. ;; not be useful in a profile. Delete the symlinks.
  850. (false-if-file-not-found
  851. (delete-file
  852. (string-append moddir "/" version "/build")))
  853. (false-if-file-not-found
  854. (delete-file
  855. (string-append moddir "/" version "/source"))))))))
  856. #:tests? #f))
  857. (home-page "https://www.gnu.org/software/linux-libre/")
  858. (synopsis "100% free redistribution of a cleaned Linux kernel")
  859. (description
  860. "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
  861. It has been modified to remove all non-free binary blobs.")
  862. (license license:gpl2)
  863. (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
  864. ;;;
  865. ;;; Generic kernel packages.
  866. ;;;
  867. (define-public linux-libre-5.17
  868. (make-linux-libre* linux-libre-5.17-version
  869. linux-libre-5.17-gnu-revision
  870. linux-libre-5.17-source
  871. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  872. #:configuration-file kernel-config))
  873. (define-public linux-libre-5.16
  874. (make-linux-libre* linux-libre-5.16-version
  875. linux-libre-5.16-gnu-revision
  876. linux-libre-5.16-source
  877. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  878. #:configuration-file kernel-config))
  879. (define-public linux-libre-version linux-libre-5.16-version)
  880. (define-public linux-libre-gnu-revision linux-libre-5.16-gnu-revision)
  881. (define-public linux-libre-pristine-source linux-libre-5.16-pristine-source)
  882. (define-public linux-libre-source linux-libre-5.16-source)
  883. (define-public linux-libre linux-libre-5.16)
  884. (define-public linux-libre-5.15
  885. (make-linux-libre* linux-libre-5.15-version
  886. linux-libre-5.15-gnu-revision
  887. linux-libre-5.15-source
  888. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  889. #:configuration-file kernel-config))
  890. (define-public linux-libre-5.10
  891. (make-linux-libre* linux-libre-5.10-version
  892. linux-libre-5.10-gnu-revision
  893. linux-libre-5.10-source
  894. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  895. #:configuration-file kernel-config))
  896. (define-public linux-libre-5.4
  897. (make-linux-libre* linux-libre-5.4-version
  898. linux-libre-5.4-gnu-revision
  899. linux-libre-5.4-source
  900. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
  901. #:configuration-file kernel-config))
  902. (define-public linux-libre-4.19
  903. (make-linux-libre* linux-libre-4.19-version
  904. linux-libre-4.19-gnu-revision
  905. linux-libre-4.19-source
  906. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
  907. #:configuration-file kernel-config))
  908. (define-public linux-libre-4.14
  909. (make-linux-libre* linux-libre-4.14-version
  910. linux-libre-4.14-gnu-revision
  911. linux-libre-4.14-source
  912. '("x86_64-linux" "i686-linux" "armhf-linux")
  913. #:configuration-file kernel-config))
  914. (define-public linux-libre-4.9
  915. (make-linux-libre* linux-libre-4.9-version
  916. linux-libre-4.9-gnu-revision
  917. linux-libre-4.9-source
  918. '("x86_64-linux" "i686-linux")
  919. #:configuration-file kernel-config))
  920. ;; Linux-Libre-LTS points to the *newest* released long-term support version of
  921. ;; Linux-Libre.
  922. ;; Reference: https://jxself.org/linux-libre/
  923. (define-public linux-libre-lts-version linux-libre-5.15-version)
  924. (define-public linux-libre-lts-gnu-revision linux-libre-5.15-gnu-revision)
  925. (define-public linux-libre-lts-pristine-source linux-libre-5.15-pristine-source)
  926. (define-public linux-libre-lts-source linux-libre-5.15-source)
  927. (define-public linux-libre-lts linux-libre-5.15)
  928. ;;;
  929. ;;; Specialized kernel variants.
  930. ;;;
  931. (define-public linux-libre-arm-generic
  932. (make-linux-libre* linux-libre-version
  933. linux-libre-gnu-revision
  934. linux-libre-source
  935. '("armhf-linux")
  936. #:defconfig "multi_v7_defconfig"
  937. #:extra-version "arm-generic"
  938. #:extra-options
  939. (append
  940. `(;; needed to fix the RTC on rockchip platforms
  941. ("CONFIG_RTC_DRV_RK808" . #t))
  942. %default-extra-linux-options)))
  943. (define-public linux-libre-arm-generic-5.10
  944. (make-linux-libre* linux-libre-5.10-version
  945. linux-libre-5.10-gnu-revision
  946. linux-libre-5.10-source
  947. '("armhf-linux")
  948. #:defconfig "multi_v7_defconfig"
  949. #:extra-version "arm-generic"
  950. #:extra-options
  951. (append
  952. `(;; needed to fix the RTC on rockchip platforms
  953. ("CONFIG_RTC_DRV_RK808" . #t))
  954. %default-extra-linux-options)))
  955. (define-public linux-libre-arm-generic-5.4
  956. (make-linux-libre* linux-libre-5.4-version
  957. linux-libre-5.4-gnu-revision
  958. linux-libre-5.4-source
  959. '("armhf-linux")
  960. #:defconfig "multi_v7_defconfig"
  961. #:extra-version "arm-generic"
  962. #:extra-options
  963. (append
  964. `(;; needed to fix the RTC on rockchip platforms
  965. ("CONFIG_RTC_DRV_RK808" . #t))
  966. %default-extra-linux-options)))
  967. (define-public linux-libre-arm-generic-4.19
  968. (make-linux-libre* linux-libre-4.19-version
  969. linux-libre-4.19-gnu-revision
  970. linux-libre-4.19-source
  971. '("armhf-linux")
  972. #:defconfig "multi_v7_defconfig"
  973. #:extra-version "arm-generic"))
  974. (define-public linux-libre-arm-generic-4.14
  975. (make-linux-libre* linux-libre-4.14-version
  976. linux-libre-4.14-gnu-revision
  977. linux-libre-4.14-source
  978. '("armhf-linux")
  979. #:defconfig "multi_v7_defconfig"
  980. #:extra-version "arm-generic"))
  981. (define-public linux-libre-arm-omap2plus
  982. (make-linux-libre* linux-libre-version
  983. linux-libre-gnu-revision
  984. linux-libre-source
  985. '("armhf-linux")
  986. #:defconfig "omap2plus_defconfig"
  987. #:extra-version "arm-omap2plus"))
  988. (define-public linux-libre-arm-omap2plus-4.19
  989. (make-linux-libre* linux-libre-4.19-version
  990. linux-libre-4.19-gnu-revision
  991. linux-libre-4.19-source
  992. '("armhf-linux")
  993. #:defconfig "omap2plus_defconfig"
  994. #:extra-version "arm-omap2plus"))
  995. (define-public linux-libre-arm-omap2plus-4.14
  996. (make-linux-libre* linux-libre-4.14-version
  997. linux-libre-4.14-gnu-revision
  998. linux-libre-4.14-source
  999. '("armhf-linux")
  1000. #:defconfig "omap2plus_defconfig"
  1001. #:extra-version "arm-omap2plus"))
  1002. (define-public linux-libre-arm64-generic
  1003. (make-linux-libre* linux-libre-version
  1004. linux-libre-gnu-revision
  1005. linux-libre-source
  1006. '("aarch64-linux")
  1007. #:defconfig "defconfig"
  1008. #:extra-version "arm64-generic"
  1009. #:extra-options
  1010. (append
  1011. `(;; needed to fix the RTC on rockchip platforms
  1012. ("CONFIG_RTC_DRV_RK808" . #t)
  1013. ;; Pinebook display, battery, charger and usb
  1014. ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
  1015. ("CONFIG_CHARGER_AXP20X" . m)
  1016. ("CONFIG_INPUT_AXP20X_PEK" . m)
  1017. ("CONFIG_CHARGER_AXP20X" . m)
  1018. ("CONFIG_BATTERY_AXP20X" . m)
  1019. ("CONFIG_PINCTRL_AXP209" . m)
  1020. ("CONFIG_AXP20X_POWER" . m)
  1021. ("CONFIG_AXP20X_ADC" . m)
  1022. ;; Pinebook PRO battery and sound support
  1023. ("CONFIG_BATTERY_CW2015" . m)
  1024. ("CONFIG_CHARGER_GPIO" . m)
  1025. ("CONFIG_SND_SOC_ES8316" . m))
  1026. %default-extra-linux-options)))
  1027. (define-public linux-libre-arm64-generic-5.10
  1028. (make-linux-libre* linux-libre-5.10-version
  1029. linux-libre-5.10-gnu-revision
  1030. linux-libre-5.10-source
  1031. '("aarch64-linux")
  1032. #:defconfig "defconfig"
  1033. #:extra-version "arm64-generic"
  1034. #:extra-options
  1035. (append
  1036. `(;; needed to fix the RTC on rockchip platforms
  1037. ("CONFIG_RTC_DRV_RK808" . #t)
  1038. ;; Pinebook display, battery, charger and usb
  1039. ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
  1040. ("CONFIG_CHARGER_AXP20X" . m)
  1041. ("CONFIG_INPUT_AXP20X_PEK" . m)
  1042. ("CONFIG_CHARGER_AXP20X" . m)
  1043. ("CONFIG_BATTERY_AXP20X" . m)
  1044. ("CONFIG_PINCTRL_AXP209" . m)
  1045. ("CONFIG_AXP20X_POWER" . m)
  1046. ("CONFIG_AXP20X_ADC" . m)
  1047. ;; Pinebook PRO battery and sound support
  1048. ("CONFIG_BATTERY_CW2015" . m)
  1049. ("CONFIG_CHARGER_GPIO" . m)
  1050. ("CONFIG_SND_SOC_ES8316" . m))
  1051. %default-extra-linux-options)))
  1052. (define-public linux-libre-arm64-generic-5.4
  1053. (make-linux-libre* linux-libre-5.4-version
  1054. linux-libre-5.4-gnu-revision
  1055. linux-libre-5.4-source
  1056. '("aarch64-linux")
  1057. #:defconfig "defconfig"
  1058. #:extra-version "arm64-generic"
  1059. #:extra-options
  1060. (append
  1061. `(;; needed to fix the RTC on rockchip platforms
  1062. ("CONFIG_RTC_DRV_RK808" . #t))
  1063. %default-extra-linux-options)))
  1064. (define-public linux-libre-riscv64-generic
  1065. (make-linux-libre* linux-libre-version
  1066. linux-libre-gnu-revision
  1067. linux-libre-source
  1068. '("riscv64-linux")
  1069. #:extra-version "riscv64-generic"))
  1070. (define-public linux-libre-mips64el-fuloong2e
  1071. (make-linux-libre* linux-libre-version
  1072. linux-libre-gnu-revision
  1073. linux-libre-source
  1074. '("mips64el-linux")
  1075. #:defconfig "fuloong2e_defconfig"
  1076. #:extra-version "mips64el-fuloong2e"
  1077. #:extra-options
  1078. (append
  1079. `(("CONFIG_OVERLAY_FS" . m))
  1080. %default-extra-linux-options)))
  1081. (define-public linux-libre-with-bpf
  1082. (let ((base-linux-libre
  1083. (make-linux-libre*
  1084. linux-libre-5.16-version
  1085. linux-libre-5.16-gnu-revision
  1086. linux-libre-5.16-source
  1087. '("x86_64-linux" "i686-linux" "armhf-linux"
  1088. "aarch64-linux" "riscv64-linux")
  1089. #:extra-version "bpf"
  1090. #:configuration-file kernel-config
  1091. #:extra-options
  1092. (append %bpf-extra-linux-options
  1093. %default-extra-linux-options))))
  1094. (package
  1095. (inherit base-linux-libre)
  1096. (inputs (modify-inputs (package-inputs base-linux-libre)
  1097. (prepend cpio))))))
  1098. ;;;
  1099. ;;; Linux kernel modules.
  1100. ;;;
  1101. (define-public acpi-call-linux-module
  1102. (package
  1103. (name "acpi-call-linux-module")
  1104. (version "1.2.2")
  1105. (source
  1106. (origin
  1107. (method git-fetch)
  1108. (uri (git-reference
  1109. (url "https://github.com/nix-community/acpi_call")
  1110. (commit (string-append "v" version))))
  1111. (file-name (git-file-name name version))
  1112. (sha256
  1113. (base32 "1s7h9y3adyfhw7cjldlfmid79lrwz3vqlvziw9nwd6x5qdj4w9vp"))))
  1114. (build-system linux-module-build-system)
  1115. (arguments
  1116. (list #:tests? #f ; no tests
  1117. #:phases
  1118. #~(modify-phases %standard-phases
  1119. (add-before 'install 'patch-shebangs-harder
  1120. ;; The (only) shebangs in examples/ don't justify a reference.
  1121. ;; However, do substitute a slightly more portable one.
  1122. (lambda _
  1123. (substitute* (find-files "examples" ".")
  1124. (("^(#! *)/[^ ]*/" _ shebang)
  1125. (string-append shebang "/usr/bin/env ")))))
  1126. (add-after 'install 'install-documentation
  1127. (lambda _
  1128. (let* ((doc (string-append #$output "/share/doc/"
  1129. #$name "-" #$version)))
  1130. (for-each (lambda (file)
  1131. (let ((target (string-append doc "/" file)))
  1132. (mkdir-p (dirname target))
  1133. (copy-recursively file target)))
  1134. (list "README.md" "examples"))))))))
  1135. (home-page "https://github.com/nix-community/acpi_call")
  1136. (synopsis "Linux kernel module to perform ACPI method calls")
  1137. (description
  1138. "This simple Linux kernel module allows calls from user space to any
  1139. @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
  1140. your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
  1141. any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
  1142. and @code{ACPI_BUFFER}.
  1143. It grants direct and undocumented access to your hardware that may cause damage
  1144. and should be used with caution, especially on untested models.")
  1145. (license license:gpl3+))) ; see README.md (no licence headers)
  1146. (define-public corefreq
  1147. (package
  1148. (name "corefreq")
  1149. (version "1.87.4")
  1150. (source
  1151. (origin
  1152. (method git-fetch)
  1153. (uri (git-reference
  1154. (url "https://github.com/cyring/CoreFreq")
  1155. (commit version)))
  1156. (file-name (git-file-name name version))
  1157. (sha256
  1158. (base32 "01g1smhfzb02gmfjm8c7rchc79dan9jc9pv9c0f8f7fly2hy5zvs"))))
  1159. (build-system linux-module-build-system)
  1160. (outputs (list "out" "linux-module"))
  1161. (arguments
  1162. (list #:imported-modules `((guix build gnu-build-system)
  1163. ,@%linux-module-build-system-modules)
  1164. #:modules `((guix build linux-module-build-system)
  1165. ((guix build gnu-build-system) #:prefix gnu:)
  1166. (guix build utils))
  1167. #:make-flags
  1168. #~(list (string-append "CC=" #$(cc-for-target))
  1169. "OPTIM_LVL=3"
  1170. (string-append "PREFIX=" #$output))
  1171. #:tests? #f ; no test suite
  1172. #:phases
  1173. #~(modify-phases %standard-phases
  1174. (add-after 'unpack 'untangle-module-targets
  1175. ;; Having to build everything in one pass would complicate the
  1176. ;; definition. Let each build system handle what it's good at.
  1177. (lambda _
  1178. (substitute* "Makefile"
  1179. ((".*MAKE.*KERNELDIR.*") ""))))
  1180. (add-after 'build 'gnu:build
  1181. (assoc-ref gnu:%standard-phases 'build))
  1182. (add-after 'install 'gnu:install
  1183. (assoc-ref gnu:%standard-phases 'install))
  1184. (add-after 'install 'separate-module
  1185. (lambda* (#:key outputs #:allow-other-keys)
  1186. ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an
  1187. ;; empty <out>/lib/modules directory, so just do it all by hand.
  1188. (let* ((out (assoc-ref outputs "out"))
  1189. (module (assoc-ref outputs "linux-module")))
  1190. (mkdir-p (string-append module "/lib"))
  1191. (rename-file (string-append out "/lib/modules")
  1192. (string-append module "/lib/modules")))))
  1193. (add-after 'install 'install-README
  1194. ;; There is no proper documentation. Provide something.
  1195. (lambda* (#:key outputs #:allow-other-keys)
  1196. (let* ((out (assoc-ref outputs "out"))
  1197. (doc (string-append out "/share/doc/"
  1198. #$name "-" #$version)))
  1199. (install-file "README.md" doc)))))))
  1200. (home-page "https://github.com/cyring/CoreFreq")
  1201. (synopsis
  1202. "Measure performance data & tweak low-level settings on x86-64 CPUs")
  1203. (description
  1204. "CoreFreq is a CPU monitor that reports low-level processor settings and
  1205. performance data with notably high precision by using a loadable Linux kernel
  1206. module. Unlike most similar tools, it can be used to modify some settings if
  1207. supported by the hardware and at your own risk. It's designed for 64-bit x86
  1208. Intel processors (Atom, Core2, Nehalem, SandyBridge, and newer) and compatible
  1209. architectures like AMD@tie{}Zen and Hygon@tie{}Dhyana.
  1210. Supported processor features include:
  1211. @enumerate
  1212. @item time spent in C-states, including C1/C3 Auto- and UnDemotion;
  1213. @item core temperatures, voltage, and tweaking thermal limits;
  1214. @item core frequencies, ratios, and base clock rate;
  1215. @item enabling, disabling, and testing SpeedStep (EIST), Turbo Boost, and
  1216. Hyper-Threading or SMT;
  1217. @item enabling or disabling data cache prefetching;
  1218. @item kernel assembly code to keep as near as possible readings of performance
  1219. counters such as the @acronym{TSC, Time Stamp Counter}, @acronym{UCC, Unhalted
  1220. Core Cycles}, and @acronym{URC, Unhalted Reference Cycles};
  1221. @item the number of instructions per cycle or second (IPS, IPC, and CPI);
  1222. @item memory controller geometry and RAM timings;
  1223. @item running processes' CPU affinity.
  1224. @end enumerate
  1225. This package provides the @command{corefreqd} data collection daemon, the
  1226. @command{corefreq-cli} client to visualise and control it in real time, and the
  1227. @code{corefreqk} kernel module in its own separate output. Read the included
  1228. @file{README.md} before loading it.")
  1229. (supported-systems (list "x86_64-linux"))
  1230. (license license:gpl2)))
  1231. (define-public librem-ec-acpi-linux-module
  1232. (package
  1233. (name "librem-ec-acpi-linux-module")
  1234. (version "0.9.1")
  1235. (source
  1236. (origin
  1237. (method git-fetch)
  1238. (uri (git-reference
  1239. (url "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
  1240. (commit (string-append "v" version))))
  1241. (file-name (git-file-name name version))
  1242. (sha256
  1243. (base32 "1qnbfj60i8nn2ahgj2zp5ixd79bb0wl1ld36x3igws2f3c0f5pfi"))))
  1244. (build-system linux-module-build-system)
  1245. (arguments
  1246. (list #:tests? #f)) ; no test suite
  1247. (home-page "https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms")
  1248. (synopsis "Linux kernel module to control the Librem Embedded Controller")
  1249. (description
  1250. "This is the Linux kernel @acronym{ACPI, Advanced Configuration and Power
  1251. Interface} platform driver for the @acronym{EC, Embedded Controller} firmware
  1252. on Purism Librem laptop computers. It allows user-space control over the
  1253. battery charging thresholds, keyboard backlight, fans and thermal monitors,
  1254. and the notification, WiFi, and Bluetooth LED.")
  1255. (license license:gpl2)))
  1256. (define-public rtl8821ce-linux-module
  1257. (let ((commit "ca204c60724d23ab10244f920d4e50759ed1affb")
  1258. (revision "4"))
  1259. (package
  1260. (name "rtl8821ce-linux-module")
  1261. (version (git-version "0.0.0" revision commit))
  1262. (source
  1263. (origin
  1264. (method git-fetch)
  1265. (uri (git-reference
  1266. (url "https://github.com/tomaspinho/rtl8821ce")
  1267. (commit commit)))
  1268. (file-name (git-file-name name version))
  1269. (sha256
  1270. (base32
  1271. "18ma8a8h1l90dss0k6al7q6plwr57jc9g67p22g9917k1jfbhm97"))))
  1272. (build-system linux-module-build-system)
  1273. (arguments
  1274. (list #:make-flags
  1275. #~(list (string-append "CC=" #$(cc-for-target))
  1276. (string-append "KSRC="
  1277. (assoc-ref %build-inputs
  1278. "linux-module-builder")
  1279. "/lib/modules/build"))
  1280. #:phases
  1281. #~(modify-phases %standard-phases
  1282. (replace 'build
  1283. (lambda* (#:key (make-flags '()) (parallel-build? #t)
  1284. #:allow-other-keys)
  1285. (apply invoke "make"
  1286. `(,@(if parallel-build?
  1287. `("-j" ,(number->string (parallel-job-count)))
  1288. '())
  1289. ,@make-flags)))))
  1290. #:tests? #f)) ; no test suite
  1291. (home-page "https://github.com/tomaspinho/rtl8821ce")
  1292. (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
  1293. (description "This is Realtek's RTL8821CE Linux driver for wireless
  1294. network adapters.")
  1295. (license license:gpl2))))
  1296. (define-public rtl8812au-aircrack-ng-linux-module
  1297. (let ((commit "37e27f9165300c89607144b646545fac576ec510")
  1298. (revision "7"))
  1299. (package
  1300. (inherit rtl8821ce-linux-module)
  1301. (name "rtl8812au-aircrack-ng-linux-module")
  1302. (version (git-version "5.6.4.2" revision commit))
  1303. (source
  1304. (origin
  1305. (method git-fetch)
  1306. (uri (git-reference
  1307. (url "https://github.com/aircrack-ng/rtl8812au")
  1308. (commit commit)))
  1309. (file-name (git-file-name name version))
  1310. (sha256
  1311. (base32 "09n814pa6i0b0xkgssymcmbcdic05y9z5bsr6sxjfs40wawsk6af"))
  1312. (modules '((guix build utils)))
  1313. (snippet
  1314. #~(begin
  1315. ;; Remove bundled tarballs, APKs, word lists, speadsheets,
  1316. ;; and other unnecessary unlicenced things.
  1317. (for-each delete-file-recursively (list "android"
  1318. "docs"
  1319. "tools"))))))
  1320. (supported-systems '("x86_64-linux" "i686-linux"))
  1321. (home-page "https://github.com/aircrack-ng/rtl8812au")
  1322. (synopsis "Linux driver for Realtek USB wireless network adapters")
  1323. (description
  1324. "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
  1325. network adapters, modified by the aircrack-ng project to support monitor mode
  1326. and frame injection. It provides a @code{88XXau} kernel module that supports
  1327. RTL8812AU, RTL8821AU, and RTL8814AU chips.")
  1328. (license license:gpl2+))))
  1329. (define-public vhba-module
  1330. (package
  1331. (name "vhba-module")
  1332. (version "20211218")
  1333. (source
  1334. (origin
  1335. (method url-fetch)
  1336. (uri (string-append
  1337. "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
  1338. version ".tar.xz"))
  1339. (sha256
  1340. (base32 "1dkprnnya0i8121p7ip4g8cww99drk7fzbwcxx65x02jqk0siibj"))))
  1341. (build-system linux-module-build-system)
  1342. (arguments
  1343. (list #:tests? #f)) ; no test suite
  1344. (home-page "https://cdemu.sourceforge.io/")
  1345. (synopsis "Linux kernel module that emulates SCSI devices")
  1346. (description
  1347. "The @acronym{VHBA, Virtual SCSI Host Bus Adapter} module is the link
  1348. between the CDemu user-space daemon and the kernel Linux. It acts as a
  1349. low-level SCSI driver that emulates a virtual SCSI adapter which can have
  1350. multiple virtual devices attached to it. Its typical use with CDEmu is to
  1351. emulate optical devices such as DVD and CD-ROM drives.")
  1352. (license license:gpl2+)))
  1353. (define-public bbswitch-module
  1354. ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
  1355. ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
  1356. (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
  1357. (package
  1358. (name "bbswitch-module")
  1359. (version (git-version "0.8" "1" commit))
  1360. (source (origin
  1361. (method git-fetch)
  1362. (uri (git-reference
  1363. (url "https://github.com/Bumblebee-Project/bbswitch")
  1364. (commit commit)))
  1365. (file-name (git-file-name name version))
  1366. (sha256
  1367. (base32
  1368. "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
  1369. (build-system linux-module-build-system)
  1370. (arguments
  1371. (list #:tests? #f)) ; no test suite
  1372. (home-page "https://github.com/Bumblebee-Project/bbswitch")
  1373. (synopsis "Kernel module that disables discrete Nvidia graphics cards")
  1374. (description "The bbswitch module provides a way to toggle the Nvidia
  1375. graphics card on Optimus laptops.")
  1376. (license license:gpl2))))
  1377. (define-public ddcci-driver-linux
  1378. (package
  1379. (name "ddcci-driver-linux")
  1380. (version "0.4.2")
  1381. (source
  1382. (origin
  1383. (method git-fetch)
  1384. (uri
  1385. (git-reference
  1386. (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
  1387. (commit (string-append "v" version))))
  1388. (file-name (git-file-name name version))
  1389. (sha256
  1390. (base32 "1lww3mnqhxqzj0qbxzbwbq93v9zw49myp7p9ib873a5izbq8nadi"))))
  1391. (build-system linux-module-build-system)
  1392. (arguments
  1393. (list #:tests? #f ; no tests
  1394. #:phases
  1395. #~(modify-phases %standard-phases
  1396. (replace 'build
  1397. (lambda args
  1398. (for-each
  1399. (lambda (module)
  1400. (with-directory-excursion module
  1401. (apply (assoc-ref %standard-phases 'build) args)))
  1402. '("ddcci" "ddcci-backlight"))))
  1403. (replace 'install
  1404. (lambda args
  1405. (for-each
  1406. (lambda (module)
  1407. (with-directory-excursion module
  1408. (apply (assoc-ref %standard-phases 'install) args)))
  1409. '("ddcci" "ddcci-backlight")))))))
  1410. (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
  1411. (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
  1412. (description "This package provides two Linux kernel drivers, ddcci and
  1413. ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
  1414. interface. The ddcci module creates a character device for each DDC/CI
  1415. monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
  1416. module allows the control of the backlight level or luminance property when
  1417. supported under @file{/sys/class/backlight/}.")
  1418. (license license:gpl2+)))
  1419. (define-public v4l2loopback-linux-module
  1420. (package
  1421. (name "v4l2loopback-linux-module")
  1422. (version "0.12.5")
  1423. (source (origin
  1424. (method git-fetch)
  1425. (uri (git-reference
  1426. (url "https://github.com/umlaeute/v4l2loopback")
  1427. (commit (string-append "v" version))))
  1428. (file-name (git-file-name name version))
  1429. (sha256
  1430. (base32
  1431. "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
  1432. (build-system linux-module-build-system)
  1433. (arguments
  1434. (list #:tests? #f)) ; no test suite
  1435. (home-page "https://github.com/umlaeute/v4l2loopback")
  1436. (synopsis "Linux kernel module to create virtual V4L2 video devices")
  1437. (description
  1438. "This Linux module creates virtual video devices. @acronym{V4L2, Video
  1439. for Linux 2} applications will treat these as ordinary video devices but read
  1440. video data generated by another application, instead of a hardware device such
  1441. as a capture card.
  1442. This lets you apply nifty effects to your Jitsi video, for example, but also
  1443. allows some more serious things like adding streaming capabilities to an
  1444. application by hooking GStreamer into the loopback device.")
  1445. (license license:gpl2+)))
  1446. (define-public xpadneo
  1447. (package
  1448. (name "xpadneo")
  1449. (version "0.9.1")
  1450. (source (origin
  1451. (method git-fetch)
  1452. (uri (git-reference
  1453. (url "https://github.com/atar-axis/xpadneo")
  1454. (commit (string-append "v" version))))
  1455. (file-name (git-file-name name version))
  1456. (sha256
  1457. (base32
  1458. "0xr0zx134s56h4ij6c3fh8ki0h58h61minbfxcl3sgpgxkh14ism"))))
  1459. (build-system linux-module-build-system)
  1460. (arguments
  1461. (list #:tests? #f ; no `check' target
  1462. #:source-directory "hid-xpadneo/src"
  1463. #:phases
  1464. #~(modify-phases %standard-phases
  1465. (add-after 'install 'post-install
  1466. (lambda _
  1467. (copy-recursively "hid-xpadneo/etc-modprobe.d"
  1468. (string-append #$output "/etc/modprobe.d"))
  1469. ;; udev-service-type takes its rules from /lib rather than
  1470. ;; /etc, so copy it there instead
  1471. (copy-recursively "hid-xpadneo/etc-udev-rules.d"
  1472. (string-append #$output
  1473. "/lib/udev/rules.d")))))))
  1474. (home-page "https://atar-axis.github.io/xpadneo/")
  1475. (synopsis "Xbox One Wireless Controller driver for the kernel Linux")
  1476. (description
  1477. "This package provides a driver for the XBox One S Wireless controller
  1478. and some newer models when connected via Bluetooth. In addition to the included
  1479. Linux kernel module, it also contains a modprobe configuration and udev rules,
  1480. which need to be installed separately.")
  1481. (license license:gpl3+)))
  1482. ;;;
  1483. ;;; Pluggable authentication modules (PAM).
  1484. ;;;
  1485. (define-public linux-pam
  1486. (package
  1487. (name "linux-pam")
  1488. (version "1.5.1")
  1489. (source
  1490. (origin
  1491. (method url-fetch)
  1492. (uri (string-append
  1493. "https://github.com/linux-pam/linux-pam/releases/download/v"
  1494. version "/Linux-PAM-" version ".tar.xz"))
  1495. (sha256
  1496. (base32
  1497. "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
  1498. (patches (search-patches "linux-pam-no-setfsuid.patch"))))
  1499. (build-system gnu-build-system)
  1500. (native-inputs
  1501. (list flex
  1502. ;; TODO: optional dependencies
  1503. ;; ("libxcrypt" ,libxcrypt)
  1504. ;; ("cracklib" ,cracklib)
  1505. ))
  1506. (arguments
  1507. `(;; Most users, such as `shadow', expect the headers to be under
  1508. ;; `security'.
  1509. #:configure-flags (list (string-append "--includedir="
  1510. (assoc-ref %outputs "out")
  1511. "/include/security")
  1512. ;; XXX: <rpc/rpc.h> is missing from glibc when
  1513. ;; cross-compiling, so we have to disable NIS
  1514. ;; support altogether.
  1515. ,@(if (%current-target-system)
  1516. '("--disable-nis")
  1517. '()))
  1518. ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
  1519. ;; isn't available.
  1520. #:tests? #f))
  1521. (home-page "http://www.linux-pam.org/")
  1522. (synopsis "Pluggable authentication modules for Linux")
  1523. (description
  1524. "A *Free* project to implement OSF's RFC 86.0.
  1525. Pluggable authentication modules are small shared object files that can
  1526. be used through the PAM API to perform tasks, like authenticating a user
  1527. at login. Local and dynamic reconfiguration are its key features.")
  1528. (license license:bsd-3)))
  1529. (define-public linux-pam-1.2
  1530. (package
  1531. (inherit linux-pam)
  1532. (version "1.2.1")
  1533. (source
  1534. (origin
  1535. (method url-fetch)
  1536. (uri (string-append
  1537. "http://www.linux-pam.org/library/"
  1538. "Linux-PAM-" version ".tar.bz2"))
  1539. (sha256
  1540. (base32
  1541. "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
  1542. (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
  1543. (define-public python-pamela
  1544. (package
  1545. (name "python-pamela")
  1546. (version "1.0.0")
  1547. (source
  1548. (origin
  1549. ;; Tests not distributed in pypi release.
  1550. (method git-fetch)
  1551. (uri (git-reference
  1552. (url "https://github.com/minrk/pamela")
  1553. (commit version)))
  1554. (file-name (git-file-name name version))
  1555. (sha256
  1556. (base32
  1557. "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
  1558. (build-system python-build-system)
  1559. (arguments
  1560. '(#:tests? #f ; Test suite isn't designed to be run inside a container.
  1561. #:phases
  1562. (modify-phases %standard-phases
  1563. (add-after 'unpack 'hardcode-pam.so
  1564. (lambda* (#:key inputs #:allow-other-keys)
  1565. (let ((pam (assoc-ref inputs "linux-pam")))
  1566. (substitute* "pamela.py"
  1567. (("find_library\\(\"pam\")")
  1568. (string-append "'" pam "/lib/libpam.so'")))
  1569. #t)))
  1570. (replace 'check
  1571. (lambda* (#:key tests? #:allow-other-keys)
  1572. (if tests?
  1573. (if (file-exists? "test_pamela.py")
  1574. (invoke "py.test" "--assert=plain" "test_pamela.py")
  1575. (invoke "python" "-m" "pamela" "-a" "`whoami`"))
  1576. #t))))))
  1577. (inputs
  1578. (list linux-pam))
  1579. (native-inputs
  1580. (list python-pytest))
  1581. (home-page "https://github.com/minrk/pamela")
  1582. (synopsis "PAM interface using ctypes")
  1583. (description "This package provides a PAM interface using @code{ctypes}.")
  1584. (license license:expat)))
  1585. (define-public pam-gnupg
  1586. (package
  1587. (name "pam-gnupg")
  1588. (version "0.3")
  1589. (source (origin
  1590. (method git-fetch)
  1591. (uri (git-reference
  1592. (url "https://github.com/cruegge/pam-gnupg")
  1593. (commit (string-append "v" version))))
  1594. (file-name (git-file-name name version))
  1595. (sha256
  1596. (base32
  1597. "1bf91gi6zmfzzmczxm7pajxdlgnikasvg5xsd3j0a368rcr7lf9l"))))
  1598. (build-system gnu-build-system)
  1599. (inputs
  1600. (list gnupg linux-pam))
  1601. (native-inputs
  1602. (list autoconf automake libtool))
  1603. (arguments
  1604. `(#:tests? #f ;no tests suite
  1605. #:configure-flags
  1606. (list (string-append "--with-moduledir="
  1607. (assoc-ref %outputs "out") "/lib/security"))))
  1608. (home-page "https://github.com/cruegge/pam-gnupg")
  1609. (synopsis "Unlock GnuPG keys on login")
  1610. (description "This package provides a PAM module that hands over your
  1611. login password to @code{gpg-agent}. This can be useful if you are using a
  1612. GnuPG-based password manager like @code{pass}.")
  1613. (license license:gpl3+)))
  1614. ;;;
  1615. ;;; Miscellaneous.
  1616. ;;;
  1617. (define-public powercap
  1618. (package
  1619. (name "powercap")
  1620. (version "0.5.0")
  1621. (source
  1622. (origin
  1623. (method git-fetch)
  1624. (uri (git-reference
  1625. (url "https://github.com/powercap/powercap")
  1626. (commit (string-append "v" version))))
  1627. (file-name (git-file-name name version))
  1628. (sha256
  1629. (base32 "1vs84fmhdc3w1541vp0f5ydvdsbg0amjdv2g2f8xdvaw01nakxsn"))))
  1630. (build-system cmake-build-system)
  1631. (arguments
  1632. (list #:configure-flags
  1633. #~(list "-DBUILD_SHARED_LIBS=ON")))
  1634. (home-page "https://github.com/powercap/powercap")
  1635. (synopsis "Utilities for accessing the powercap Linux kernel feature")
  1636. (description "This package contains utilities for accessing the powercap
  1637. Linux kernel feature through sysfs. It includes an implementation for working
  1638. with Intel @acronym{RAPL, Running Average Power Limit}.
  1639. It provides the commands @code{powercap-info} and @code{powercap-set}.")
  1640. (license license:bsd-3)))
  1641. (define-public powerstat
  1642. (package
  1643. (name "powerstat")
  1644. (version "0.02.27")
  1645. (source
  1646. (origin
  1647. (method git-fetch)
  1648. (uri (git-reference
  1649. (url "https://github.com/ColinIanKing/powerstat")
  1650. (commit (string-append "V" version))))
  1651. (file-name (git-file-name name version))
  1652. (sha256
  1653. (base32 "1ik5yv2bhz2hvyga4h1m28rf0xpi20zpqm4swhvskyf1g6qf381z"))))
  1654. (build-system gnu-build-system)
  1655. (arguments
  1656. `(#:make-flags
  1657. (list (string-append "CC=" ,(cc-for-target))
  1658. (string-append "prefix=" (assoc-ref %outputs "out")))
  1659. #:tests? #f ; no test suite
  1660. #:phases
  1661. (modify-phases %standard-phases
  1662. (delete 'configure)))) ; no configure script
  1663. (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
  1664. (synopsis "Measure system power consumption")
  1665. (description
  1666. "Powerstat measures and reports your computer's power consumption in real
  1667. time. On mobile PCs, it uses ACPI battery information to measure the power
  1668. drain of the entire system.
  1669. Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
  1670. domain measurements. These are available only on some hardware such as Intel
  1671. Sandybridge and newer, and cover only part of the machine's components such as
  1672. CPU, DRAM, and graphics. However, they provide accurate and immediate readings
  1673. and don't require a battery at all.
  1674. The output is like @command{vmstat} but also shows power consumption statistics:
  1675. at the end of a run, @command{powerstat} will calculate the average, standard
  1676. deviation, and minimum and maximum values. It can show a nice histogram too.")
  1677. (license license:gpl2)))
  1678. (define-public psmisc
  1679. (package
  1680. (name "psmisc")
  1681. (version "23.4")
  1682. (source
  1683. (origin
  1684. (method url-fetch)
  1685. (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
  1686. version ".tar.xz"))
  1687. (sha256
  1688. (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
  1689. (build-system gnu-build-system)
  1690. (arguments
  1691. `(,@(if (%current-target-system)
  1692. '(#:configure-flags
  1693. (list
  1694. "ac_cv_func_malloc_0_nonnull=yes"
  1695. "ac_cv_func_realloc_0_nonnull=yes"))
  1696. '())))
  1697. (inputs (list ncurses))
  1698. (home-page "https://gitlab.com/psmisc/psmisc")
  1699. (synopsis "Small utilities that use the proc file system")
  1700. (description
  1701. "This PSmisc package is a set of some small useful utilities that
  1702. use the proc file system. We're not about changing the world, but
  1703. providing the system administrator with some help in common tasks.")
  1704. (license license:gpl2+)))
  1705. (define-public util-linux
  1706. (package
  1707. (name "util-linux")
  1708. (replacement util-linux/fixed)
  1709. (version "2.37.2")
  1710. (source (origin
  1711. (method url-fetch)
  1712. (uri (string-append "mirror://kernel.org/linux/utils/"
  1713. "util-linux/v" (version-major+minor version) "/"
  1714. "util-linux-" version ".tar.xz"))
  1715. (sha256
  1716. (base32
  1717. "1ng9517c37mdp858425a4zyybma7dh7jrpd6z1z61yz7mb0n81va"))
  1718. (patches (search-patches "util-linux-tests.patch"))
  1719. (modules '((guix build utils)))
  1720. (snippet
  1721. ;; We take 'nologin' from Shadow, the 'logger' program from
  1722. ;; GNU Inetutils and 'kill' from GNU Coreutils.
  1723. '(begin
  1724. (substitute* "configure"
  1725. (("build_nologin=yes") "build_nologin=no")
  1726. (("build_logger=yes") "build_logger=no")
  1727. (("build_kill=yes") "build_kill=no"))
  1728. #t))))
  1729. (build-system gnu-build-system)
  1730. (outputs '("out" ;6.4 MiB executables and documentation
  1731. "lib" ;8.8 MiB shared libraries, headers and locales
  1732. "static")) ;2.9 MiB static .a libraries
  1733. (arguments
  1734. `(#:configure-flags (list "--disable-use-tty-group"
  1735. (string-append
  1736. "--enable-fs-paths-default="
  1737. "/run/setuid-programs"
  1738. ":/run/current-system/profile/sbin")
  1739. ;; Don't try to chown root:root mount and umount
  1740. "--disable-makeinstall-chown"
  1741. "--localstatedir=/var"
  1742. (string-append "--localedir="
  1743. (assoc-ref %outputs "lib")
  1744. "/share/locale")
  1745. ;; Install completions where our
  1746. ;; bash-completion package expects them.
  1747. (string-append "--with-bashcompletiondir="
  1748. (assoc-ref %outputs "out")
  1749. "/etc/bash_completion.d"))
  1750. ;; FIXME: For now we cannot reliably run tests on GNU/Hurd:
  1751. ;; <https://bugs.gnu.org/47791>.
  1752. #:tests? ,(and (not (%current-target-system))
  1753. (not (string-suffix? "-gnu" (%current-system))))
  1754. #:phases (modify-phases %standard-phases
  1755. (add-before 'configure 'patch-build-scripts
  1756. (lambda* (#:key outputs #:allow-other-keys)
  1757. (substitute* "configure"
  1758. ;; The build system assumes that we want to install
  1759. ;; libraries below $exec_prefix when $libdir does not
  1760. ;; match any of the "usual" locations. Fix that.
  1761. (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
  1762. "usrlib_execdir=$libdir"))))
  1763. (add-before 'build 'set-umount-file-name
  1764. (lambda* (#:key outputs #:allow-other-keys)
  1765. ;; Tell 'eject' the right file name of 'umount'.
  1766. (let ((out (assoc-ref outputs "out")))
  1767. (substitute* "sys-utils/eject.c"
  1768. (("\"/bin/umount\"")
  1769. (string-append "\"" out "/bin/umount\""))))))
  1770. (add-before 'check 'pre-check
  1771. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  1772. (let ((services (search-input-file (or native-inputs inputs)
  1773. "etc/services")))
  1774. ;; Change the test to refer to the right file.
  1775. (substitute* "tests/ts/misc/mcookie"
  1776. (("/etc/services")
  1777. services))
  1778. ;; The C.UTF-8 locale does not exist in our libc.
  1779. (substitute* "tests/ts/column/invalid-multibyte"
  1780. (("C\\.UTF-8") "en_US.utf8")))))
  1781. (add-before 'check 'disable-setarch-test
  1782. (lambda _
  1783. ;; The setarch tests are unreliable in QEMU's user-mode
  1784. ;; emulation, which is our primary method of building
  1785. ;; ARMv7 packages. See
  1786. ;; <https://github.com/karelzak/util-linux/issues/601>.
  1787. (substitute* "tests/ts/misc/setarch"
  1788. (("ts_init_subtest.*" all)
  1789. (string-append
  1790. all "\n"
  1791. "ts_skip \"setarch tests are unreliable under QEMU\"")))))
  1792. (add-before 'check 'disable-lsns-test
  1793. (lambda _
  1794. ;; The lsns tests can fail due to ioctl(_, NS_GET_USERNS)
  1795. ;; returning ENOTTY, indicating this kernel does not
  1796. ;; support user namespaces. Curiously, this test can fail
  1797. ;; on i686 even if the same test passes on x86_64 on the
  1798. ;; same machine. See <https://issues.guix.gnu.org/49933>.
  1799. (delete-file "tests/ts/lsns/ioctl_ns")))
  1800. (add-after 'install 'move-static-libraries
  1801. (lambda* (#:key outputs #:allow-other-keys)
  1802. (let ((lib (assoc-ref outputs "lib"))
  1803. (static (assoc-ref outputs "static")))
  1804. ;; Move static libraries to the "static" output.
  1805. (mkdir-p (string-append static "/lib"))
  1806. (with-directory-excursion lib
  1807. (for-each (lambda (file)
  1808. (rename-file file
  1809. (string-append static "/"
  1810. file)))
  1811. (find-files "lib" "\\.a$"))
  1812. ;; Remove references to the static library from the '.la'
  1813. ;; files so that Libtool does the right thing when both
  1814. ;; the shared and static library is available.
  1815. (substitute* (find-files "lib" "\\.la$")
  1816. (("old_library=.*") "old_library=''\n"))))))
  1817. (add-after 'install 'adjust-pkg-config-files
  1818. (lambda* (#:key outputs #:allow-other-keys)
  1819. (let ((lib (assoc-ref outputs "lib")))
  1820. ;; Drop the unused "prefix=" and "exec_prefix=" variables from
  1821. ;; the pkg-config files to avoid a cyclic reference on "out".
  1822. (substitute* (find-files (string-append lib "/lib/pkgconfig")
  1823. "\\.pc$")
  1824. (("^(exec_)?prefix=.*") ""))))))))
  1825. (inputs
  1826. (list file ;for libmagic
  1827. ncurses
  1828. zlib))
  1829. (native-inputs
  1830. (list net-base ;for tests
  1831. perl))
  1832. (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
  1833. (synopsis "Collection of utilities for the Linux kernel")
  1834. (description "Util-linux is a diverse collection of Linux kernel
  1835. utilities. It provides dmesg and includes tools for working with file systems,
  1836. block devices, UUIDs, TTYs, and many other tools.")
  1837. (properties '((upstream-name . "util-linux")))
  1838. ;; Note that util-linux doesn't use the same license for all the
  1839. ;; code. GPLv2+ is the default license for a code without an
  1840. ;; explicitly defined license.
  1841. (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
  1842. license:bsd-4 license:public-domain))))
  1843. ;; util-linux optionally supports udev, which allows lsblk to read file system
  1844. ;; metadata without special privileges. Add it as a separate package to avoid
  1845. ;; a circular dependency, and to keep the size small.
  1846. (define-public util-linux+udev
  1847. (package/inherit
  1848. util-linux
  1849. (name "util-linux-with-udev")
  1850. (inputs
  1851. (modify-inputs (package-inputs util-linux)
  1852. (prepend eudev)))))
  1853. ;; This is mostly equivalent to the upstream release version v2.37.3, except
  1854. ;; that the upstream tarball was generated improperly, which breaks the build.
  1855. ;; There will not be a v2.37.3-fixed release or anything like that to fix it:
  1856. ;; https://github.com/util-linux/util-linux/issues/1577
  1857. (define-public util-linux/fixed
  1858. (hidden-package
  1859. (package
  1860. (inherit util-linux)
  1861. (source (origin
  1862. (inherit (package-source util-linux))
  1863. (patches (append (search-patches "util-linux-CVE-2021-3995.patch"
  1864. "util-linux-CVE-2021-3996.patch")
  1865. (origin-patches (package-source util-linux)))))))))
  1866. (define-public ddate
  1867. (package
  1868. (name "ddate")
  1869. (version "0.2.2")
  1870. (source (origin
  1871. (method git-fetch)
  1872. (uri (git-reference
  1873. (url "https://github.com/bo0ts/ddate")
  1874. (commit (string-append "v" version))))
  1875. (file-name (git-file-name name version))
  1876. (sha256
  1877. (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
  1878. (build-system cmake-build-system)
  1879. (arguments '(#:tests? #f))
  1880. (home-page "https://github.com/bo0ts/ddate")
  1881. (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
  1882. (description
  1883. "ddate displays the Discordian date and holidays of a given date.
  1884. The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
  1885. by Robert Shea and Robert Anton Wilson.")
  1886. (license license:public-domain)))
  1887. (define-public fbset
  1888. (package
  1889. (name "fbset")
  1890. (version "2.1")
  1891. (source
  1892. (origin
  1893. (method url-fetch)
  1894. (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
  1895. version ".tar.gz"))
  1896. (sha256
  1897. (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
  1898. (build-system gnu-build-system)
  1899. (arguments
  1900. '(#:modules ((guix build gnu-build-system)
  1901. (guix build utils)
  1902. (srfi srfi-26))
  1903. #:phases
  1904. (modify-phases %standard-phases
  1905. (delete 'configure) ; no configure script
  1906. (add-before 'install 'pre-install
  1907. (lambda* (#:key outputs #:allow-other-keys)
  1908. (let ((out (assoc-ref outputs "out")))
  1909. (substitute* "Makefile"
  1910. (("mknod ") "true ")
  1911. ;; The Makefile doesn't honour PREFIX or similar.
  1912. (("/usr") out))
  1913. (mkdir out)
  1914. (with-directory-excursion out
  1915. (for-each mkdir-p (list "sbin"
  1916. "man/man5"
  1917. "man/man8")))
  1918. #t)))
  1919. (add-after 'install 'install-fb.modes
  1920. (lambda* (#:key outputs #:allow-other-keys)
  1921. (let* ((out (assoc-ref outputs "out"))
  1922. (etc (string-append out "/etc")))
  1923. (for-each (cut install-file <> etc)
  1924. (find-files "etc" "^fb\\.modes"))
  1925. (symlink "fb.modes.ATI"
  1926. (string-append etc "/fb.modes"))
  1927. #t))))
  1928. ;; Parallel building races to create modes.tab.c.
  1929. #:parallel-build? #f
  1930. #:tests? #f)) ; no test suite
  1931. (native-inputs
  1932. (list bison flex))
  1933. (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
  1934. (synopsis "Show and modify Linux frame buffer settings")
  1935. (description
  1936. "The kernel Linux's @dfn{frame buffers} provide a simple interface to
  1937. different kinds of graphic displays. The @command{fbset} utility can query and
  1938. change various device settings such as depth, virtual resolution, and timing
  1939. parameters.")
  1940. (license license:gpl2)))
  1941. (define-public procps
  1942. (package
  1943. (name "procps")
  1944. (version "3.3.16")
  1945. (source (origin
  1946. (method url-fetch)
  1947. (uri (string-append "mirror://sourceforge/procps-ng/Production/"
  1948. "procps-ng-" version ".tar.xz"))
  1949. (sha256
  1950. (base32
  1951. "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
  1952. (build-system gnu-build-system)
  1953. (arguments
  1954. `(#:modules ((guix build utils)
  1955. (guix build gnu-build-system)
  1956. (srfi srfi-1)
  1957. (srfi srfi-26))
  1958. ,@(if (%current-target-system)
  1959. '(#:configure-flags
  1960. (list
  1961. "ac_cv_func_malloc_0_nonnull=yes"
  1962. "ac_cv_func_realloc_0_nonnull=yes"))
  1963. '())
  1964. #:phases
  1965. (modify-phases %standard-phases
  1966. (add-after
  1967. 'install 'post-install
  1968. ;; Remove commands and man pages redudant with
  1969. ;; Coreutils.
  1970. (lambda* (#:key outputs #:allow-other-keys)
  1971. (let* ((out (assoc-ref outputs "out"))
  1972. (dup (append-map (cut find-files out <>)
  1973. '("^kill" "^uptime"))))
  1974. (for-each delete-file dup)
  1975. #t))))))
  1976. (inputs (list ncurses))
  1977. (home-page "https://gitlab.com/procps-ng/procps/")
  1978. (synopsis "Utilities that give information about processes")
  1979. (description
  1980. "Procps is the package that has a bunch of small useful utilities
  1981. that give information about processes using the Linux /proc file system.
  1982. The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
  1983. slabtop, tload, top, vmstat, w, watch and sysctl.")
  1984. (properties '((upstream-name . "procps-ng")))
  1985. (license license:gpl2)))
  1986. (define-public usbutils
  1987. (package
  1988. (name "usbutils")
  1989. (version "014")
  1990. (source
  1991. (origin
  1992. (method url-fetch)
  1993. (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
  1994. "usbutils-" version ".tar.xz"))
  1995. (sha256
  1996. (base32 "0sgwfvr1b5w3ai1c0rmvzhk67y9vh7bq490rcxxj4q05svx9q1rs"))))
  1997. (build-system gnu-build-system)
  1998. (outputs (list "out" "python"))
  1999. (arguments
  2000. `(#:phases
  2001. (modify-phases %standard-phases
  2002. (add-before 'bootstrap 'patch-bootstrap-scripts
  2003. (lambda _
  2004. (substitute* "usbhid-dump/bootstrap"
  2005. (("/bin/sh") (which "sh")))))
  2006. (add-after 'install 'separate-python-output
  2007. ;; Separating one Python script shaves more than 106 MiB from :out.
  2008. (lambda* (#:key outputs #:allow-other-keys)
  2009. (let ((out (assoc-ref outputs "out"))
  2010. (out:python (assoc-ref outputs "python")))
  2011. (for-each (lambda (file)
  2012. (let ((old (string-append out "/" file))
  2013. (new (string-append out:python "/" file)))
  2014. (mkdir-p (dirname new))
  2015. (rename-file old new)))
  2016. (list "bin/lsusb.py"))))))))
  2017. (inputs
  2018. (list eudev libusb python))
  2019. (native-inputs
  2020. (list autoconf automake libtool pkg-config))
  2021. (home-page "http://www.linux-usb.org/")
  2022. (synopsis
  2023. "Tools for working with USB devices, such as lsusb")
  2024. (description
  2025. "Tools for working with USB devices, such as lsusb.")
  2026. (license license:gpl2+)))
  2027. (define-public usbip-utils
  2028. (package
  2029. (name "usbip-utils")
  2030. (version (package-version linux-libre))
  2031. (source (package-source linux-libre))
  2032. (build-system gnu-build-system)
  2033. (arguments
  2034. '(#:configure-flags '("--disable-static")
  2035. #:phases (modify-phases %standard-phases
  2036. (add-after 'unpack 'enter-subdirectory
  2037. (lambda _
  2038. (chdir "tools/usb/usbip")
  2039. #t)))))
  2040. (native-inputs
  2041. `(("automake" ,automake)
  2042. ("autoreconf" ,autoconf)
  2043. ("libtool" ,libtool)))
  2044. (inputs (list eudev))
  2045. (home-page (package-home-page linux-libre))
  2046. (synopsis "Utilities for sharing USB devices over IP networks")
  2047. (description
  2048. "The USB/IP protocol enables to pass USB device from a server to
  2049. a client over the network. The server is a machine which shares an
  2050. USB device and the client is a machine which uses USB device provided by
  2051. a server over the network. The USB device may be either physical device
  2052. connected to a server or software entity created on a server using USB
  2053. gadget subsystem. The usbip-utils are userspace tools to used to handle
  2054. connection and management on both side. The client needs the @file{vhci-hcd}
  2055. Linux kernel module and the server needs the @file{usbip_host} Linux kernel
  2056. module.")
  2057. (license license:gpl2)))
  2058. (define-public e2fsprogs
  2059. (package
  2060. (name "e2fsprogs")
  2061. (version "1.46.4")
  2062. (source (origin
  2063. (method url-fetch)
  2064. (uri (string-append
  2065. "mirror://kernel.org/linux/kernel/people/tytso/"
  2066. "e2fsprogs/v" version "/"
  2067. "e2fsprogs-" version ".tar.xz"))
  2068. (sha256
  2069. (base32
  2070. "04wp77fg842dhribgn0xvbd77idh0n7a839ga4bwy78v7i9l445i"))))
  2071. (build-system gnu-build-system)
  2072. (inputs (list `(,util-linux "lib")))
  2073. (native-inputs (list pkg-config
  2074. texinfo ;for the libext2fs Info manual
  2075. ;; For tests.
  2076. perl
  2077. procps))
  2078. (arguments
  2079. '(;; util-linux is the preferred source for some of the libraries and
  2080. ;; commands, so disable them (see, e.g.,
  2081. ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
  2082. #:configure-flags (list "--disable-libblkid"
  2083. "--disable-libuuid" "--disable-uuidd"
  2084. "--disable-fsck"
  2085. ;; Use symlinks instead of hard links for
  2086. ;; 'fsck.extN' etc. This makes the resulting nar
  2087. ;; smaller and is preserved across copies.
  2088. "--enable-symlink-install"
  2089. (string-append "LDFLAGS=-Wl,-rpath="
  2090. (assoc-ref %outputs "out")
  2091. "/lib")
  2092. ;; Install libext2fs et al.
  2093. "--enable-elf-shlibs")
  2094. #:phases
  2095. (modify-phases %standard-phases
  2096. (add-before 'configure 'patch-shells
  2097. (lambda _
  2098. (substitute* "configure"
  2099. (("/bin/sh (.*)parse-types.sh" _ dir)
  2100. (string-append (which "sh") " " dir
  2101. "parse-types.sh")))
  2102. (substitute* "MCONFIG.in"
  2103. (("INSTALL_SYMLINK = /bin/sh")
  2104. "INSTALL_SYMLINK = sh"))
  2105. (substitute* (find-files "." "^Makefile.in$")
  2106. (("#!/bin/sh")
  2107. (string-append "#!" (which "sh"))))))
  2108. (add-after 'install 'install-libs
  2109. (lambda* (#:key outputs #:allow-other-keys)
  2110. (let* ((out (assoc-ref outputs "out"))
  2111. (lib (string-append out "/lib")))
  2112. (invoke "make" "install-libs")
  2113. ;; Make the .a writable so that 'strip' works.
  2114. ;; Failing to do that, due to debug symbols, we
  2115. ;; retain a reference to the final
  2116. ;; linux-libre-headers, which refer to the
  2117. ;; bootstrap binaries.
  2118. (let ((archives (find-files lib "\\.a$")))
  2119. (for-each (lambda (file)
  2120. (chmod file #o666))
  2121. archives))))))))
  2122. (home-page "http://e2fsprogs.sourceforge.net/")
  2123. (synopsis "Creating and checking ext2/ext3/ext4 file systems")
  2124. (description
  2125. "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
  2126. (license (list license:gpl2 ;programs
  2127. license:lgpl2.0 ;libext2fs
  2128. license:x11)))) ;libuuid
  2129. (define e2fsprogs/static
  2130. (static-package
  2131. (package (inherit e2fsprogs)
  2132. (arguments
  2133. ;; Do not build shared libraries.
  2134. (substitute-keyword-arguments (package-arguments e2fsprogs)
  2135. ((#:configure-flags _)
  2136. '(list "--disable-blkid"))
  2137. ((#:make-flags _)
  2138. '(list)))))))
  2139. (define-public e2fsck/static
  2140. (package
  2141. (name "e2fsck-static")
  2142. (version (package-version e2fsprogs))
  2143. (build-system trivial-build-system)
  2144. (source #f)
  2145. (inputs
  2146. (list e2fsprogs/static))
  2147. (arguments
  2148. `(#:modules ((guix build utils))
  2149. #:builder
  2150. (begin
  2151. (use-modules (guix build utils)
  2152. (ice-9 ftw)
  2153. (srfi srfi-26))
  2154. (let ((e2fsck (search-input-file %build-inputs "/sbin/e2fsck"))
  2155. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  2156. (mkdir-p bin)
  2157. (with-directory-excursion bin
  2158. (copy-file e2fsck "e2fsck")
  2159. (remove-store-references "e2fsck")
  2160. (chmod "e2fsck" #o555))
  2161. #t))))
  2162. (home-page (package-home-page e2fsprogs))
  2163. (synopsis "Statically-linked e2fsck command from e2fsprogs")
  2164. (description "This package provides statically-linked e2fsck command taken
  2165. from the e2fsprogs package. It is meant to be used in initrds.")
  2166. (license (package-license e2fsprogs))))
  2167. (define-public extundelete
  2168. (package
  2169. (name "extundelete")
  2170. (version "0.2.4")
  2171. (source
  2172. (origin
  2173. (method url-fetch)
  2174. (uri (string-append "mirror://sourceforge/extundelete/"
  2175. "extundelete/" version "/extundelete-"
  2176. version ".tar.bz2"))
  2177. (sha256
  2178. (base32
  2179. "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
  2180. (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
  2181. (build-system gnu-build-system)
  2182. (inputs (list e2fsprogs))
  2183. (home-page "http://extundelete.sourceforge.net/")
  2184. (synopsis "Recover deleted files from ext2/3/4 partitions")
  2185. (description
  2186. "Extundelete is a set of tools that can recover deleted files from an
  2187. ext3 or ext4 partition.")
  2188. (license license:gpl2)))
  2189. (define-public zerofree
  2190. (package
  2191. (name "zerofree")
  2192. (version "1.1.1")
  2193. (home-page "https://frippery.org/uml/")
  2194. (source (origin
  2195. (method url-fetch)
  2196. (uri (string-append home-page name "-" version
  2197. ".tgz"))
  2198. (sha256
  2199. (base32
  2200. "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
  2201. (build-system gnu-build-system)
  2202. (arguments
  2203. '(#:phases
  2204. (modify-phases %standard-phases
  2205. (delete 'configure) ; no configure script
  2206. (replace 'install
  2207. ;; The Makefile lacks an ‘install’ target.
  2208. (lambda* (#:key outputs #:allow-other-keys)
  2209. (let* ((out (assoc-ref outputs "out"))
  2210. (bin (string-append out "/bin")))
  2211. (chmod "zerofree" #o555)
  2212. (install-file "zerofree" bin)
  2213. #t))))
  2214. #:tests? #f)) ; no tests
  2215. (inputs `(("libext2fs" ,e2fsprogs)))
  2216. (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
  2217. (description
  2218. "Zerofree finds the unallocated blocks with non-zero value content in an
  2219. ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
  2220. This is a simple way to make disk images more compressible.
  2221. Zerofree requires the file system to be unmounted or mounted read-only.")
  2222. (license license:gpl2)))
  2223. (define-public strace
  2224. (package
  2225. (name "strace")
  2226. (version "5.15")
  2227. (home-page "https://strace.io")
  2228. (source (origin
  2229. (method url-fetch)
  2230. (uri (string-append home-page "/files/" version
  2231. "/strace-" version ".tar.xz"))
  2232. (sha256
  2233. (base32
  2234. "1p3jipp6mj5fwfcjdnp6xhxk84z07jy5qhjlqr6jjdbk54pw5jpb"))
  2235. (patches (search-patches "strace-readlink-tests.patch"))))
  2236. (build-system gnu-build-system)
  2237. (arguments
  2238. '(#:phases
  2239. (modify-phases %standard-phases
  2240. (add-after 'unpack 'patch-/bin/sh
  2241. (lambda _
  2242. (substitute* "src/strace.c"
  2243. (("/bin/sh") (which "sh")))))
  2244. (add-after 'unpack 'disable-failing-tests
  2245. (lambda _
  2246. (substitute* "tests/Makefile.in"
  2247. ;; XXX: These hang forever even if the test time-out is
  2248. ;; extended.
  2249. (("^\tstrace-DD?D?\\.test \\\\.*") "")
  2250. (("^\tpidns-cache.test \\\\.*") "")
  2251. (("^\t.*--pidns-translation.test \\\\.*") "")
  2252. ;; This one fails with an encoding error.
  2253. (("^\t.*net-yy-unix.test \\\\.*") "")))))
  2254. ;; Don't fail if the architecture doesn't support different
  2255. ;; personalities.
  2256. #:configure-flags '("--enable-mpers=check")
  2257. ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
  2258. #:parallel-tests? #f)) ; undeterministic failures
  2259. (native-inputs (list perl))
  2260. (synopsis "System call tracer for Linux")
  2261. (description
  2262. "strace is a system call tracer, i.e. a debugging tool which prints out a
  2263. trace of all the system calls made by a another process/program.")
  2264. (license license:lgpl2.1+)))
  2265. (define-public ltrace
  2266. (package
  2267. (name "ltrace")
  2268. (version "0.7.3")
  2269. (source (origin
  2270. (method url-fetch)
  2271. (uri (string-append "http://www.ltrace.org/ltrace_" version
  2272. ".orig.tar.bz2"))
  2273. (sha256
  2274. (base32
  2275. "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
  2276. (build-system gnu-build-system)
  2277. (inputs `(("libelf" ,elfutils)))
  2278. (arguments
  2279. ;; Compilation uses -Werror by default, but it fails.
  2280. '(#:configure-flags '("--disable-werror")))
  2281. (home-page "https://www.ltrace.org/")
  2282. (synopsis "Library call tracer for Linux")
  2283. (description
  2284. "ltrace intercepts and records dynamic library calls which are called by
  2285. an executed process and the signals received by that process. It can also
  2286. intercept and print the system calls executed by the program.")
  2287. (license license:gpl2+)))
  2288. (define-public alsa-ucm-conf
  2289. (package
  2290. (name "alsa-ucm-conf")
  2291. (version "1.2.4")
  2292. (source (origin
  2293. (method url-fetch)
  2294. (uri (string-append
  2295. "ftp://ftp.alsa-project.org/pub/lib/" name "-"
  2296. version ".tar.bz2"))
  2297. (sha256
  2298. (base32
  2299. "0h6kzi1cfdqyxp4pwpqh5wb89c8s9wrgix315bvamffwfxf56frc"))))
  2300. (build-system copy-build-system)
  2301. (arguments
  2302. '(#:install-plan
  2303. '(("ucm" "share/alsa/ucm")
  2304. ("ucm2" "share/alsa/ucm2"))))
  2305. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2306. (synopsis "The Advanced Linux Sound Architecture Use Case Manager")
  2307. (description
  2308. "This package contains Advanced Linux Sound Architecture Use Case Manager
  2309. configuration of audio input/output names and routing for specific audio
  2310. hardware.")
  2311. (license license:bsd-3)))
  2312. (define-public alsa-topology-conf
  2313. (package
  2314. (name "alsa-topology-conf")
  2315. (version "1.2.4")
  2316. (source (origin
  2317. (method url-fetch)
  2318. (uri (string-append
  2319. "ftp://ftp.alsa-project.org/pub/lib/" name "-"
  2320. version ".tar.bz2"))
  2321. (sha256
  2322. (base32
  2323. "01zdg6q4s6d01k39z96wi4vbhrfw1i2g4yi5dijwfk6a5vjfdq2m"))))
  2324. (build-system copy-build-system)
  2325. (arguments
  2326. '(#:install-plan
  2327. '(("topology" "share/alsa/topology"))))
  2328. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2329. (synopsis "The Advanced Linux Sound Architecture libraries")
  2330. (description
  2331. "This package contains Advanced Linux Sound Architecture topology
  2332. configuration files that can be used for specific audio hardware.")
  2333. (license license:bsd-3)))
  2334. (define-public alsa-lib
  2335. (package
  2336. (name "alsa-lib")
  2337. (version "1.2.4")
  2338. (source (origin
  2339. (method url-fetch)
  2340. (uri (string-append
  2341. "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
  2342. version ".tar.bz2"))
  2343. (sha256
  2344. (base32
  2345. "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
  2346. (build-system gnu-build-system)
  2347. (arguments
  2348. '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  2349. (assoc-ref %outputs "out")
  2350. "/lib"))
  2351. #:phases
  2352. (modify-phases %standard-phases
  2353. (add-before 'install 'pre-install
  2354. (lambda* (#:key inputs outputs #:allow-other-keys)
  2355. (let* ((ucm
  2356. (string-append (assoc-ref inputs "alsa-ucm-conf")))
  2357. (topology
  2358. (string-append (assoc-ref inputs "alsa-topology-conf")))
  2359. (alsa
  2360. (string-append (assoc-ref outputs "out") "/share/alsa"))
  2361. (ucm-share
  2362. (string-append ucm "/share/alsa/ucm"))
  2363. (ucm2-share
  2364. (string-append ucm "/share/alsa/ucm2"))
  2365. (topology-share
  2366. (string-append topology "/share/alsa/topology")))
  2367. (mkdir-p alsa)
  2368. (symlink ucm-share (string-append alsa "/ucm"))
  2369. (symlink ucm2-share (string-append alsa "/ucm2"))
  2370. (symlink topology-share (string-append alsa "/topology")))
  2371. #t)))))
  2372. (inputs
  2373. (list alsa-ucm-conf alsa-topology-conf))
  2374. (home-page "https://www.alsa-project.org/wiki/Main_Page")
  2375. (synopsis "The Advanced Linux Sound Architecture libraries")
  2376. (description
  2377. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2378. MIDI functionality to the Linux-based operating system.")
  2379. (license license:lgpl2.1+)))
  2380. (define-public alsa-utils
  2381. (package
  2382. (name "alsa-utils")
  2383. (version "1.2.4")
  2384. (source (origin
  2385. (method url-fetch)
  2386. (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
  2387. name "-" version ".tar.bz2"))
  2388. (sha256
  2389. (base32
  2390. "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
  2391. (build-system gnu-build-system)
  2392. (arguments
  2393. ;; XXX: Disable man page creation until we have DocBook.
  2394. '(#:configure-flags (list "--disable-xmlto"
  2395. ;; The udev rule is responsible for restoring
  2396. ;; the volume.
  2397. (string-append "--with-udev-rules-dir="
  2398. (assoc-ref %outputs "out")
  2399. "/lib/udev/rules.d"))
  2400. #:phases
  2401. (modify-phases %standard-phases
  2402. (add-before 'check 'disable-broken-test
  2403. (lambda _
  2404. ;; XXX: The 1.1.8 release tarball is missing a header that's
  2405. ;; required for this test to work. Fixed in 1.1.9.
  2406. (substitute* "axfer/test/Makefile"
  2407. ((".*container-test.*") ""))
  2408. #t))
  2409. (add-before
  2410. 'install 'pre-install
  2411. (lambda _
  2412. ;; Don't try to mkdir /var/lib/alsa.
  2413. (substitute* "Makefile"
  2414. (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
  2415. "true\n"))
  2416. #t)))))
  2417. (native-inputs
  2418. `(("gettext" ,gettext-minimal)))
  2419. (inputs
  2420. (list libsamplerate ncurses alsa-lib xmlto))
  2421. (home-page "http://www.alsa-project.org/")
  2422. (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
  2423. (description
  2424. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2425. MIDI functionality to the Linux-based operating system.")
  2426. ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
  2427. ;; GPLv2-only.
  2428. (license license:gpl2)))
  2429. (define-public alsa-plugins
  2430. (package
  2431. (name "alsa-plugins")
  2432. (version "1.2.2")
  2433. (source (origin
  2434. (method url-fetch)
  2435. (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
  2436. name "-" version ".tar.bz2"))
  2437. (sha256
  2438. (base32
  2439. "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
  2440. (build-system gnu-build-system)
  2441. ;; TODO: Split libavcodec and speex if possible. It looks like they can not
  2442. ;; be split, there are references to both in files.
  2443. ;; TODO: Remove OSS related plugins, they add support to run native
  2444. ;; ALSA applications on OSS however we do not offer OSS and OSS is
  2445. ;; obsolete.
  2446. (outputs '("out" "pulseaudio" "jack"))
  2447. (native-search-paths
  2448. (list (search-path-specification
  2449. (variable "ALSA_PLUGIN_DIR")
  2450. (files '("lib/alsa-lib"))
  2451. (separator #f))))
  2452. (arguments
  2453. `(#:configure-flags '(;; Do not install a "local" configuration targeted
  2454. ;; for /etc/alsa. On Guix System plugins are loaded from
  2455. ;; the ALSA service, and other distributions likely
  2456. ;; won't use these files.
  2457. "--with-alsalconfdir=/tmp/noop")
  2458. #:phases
  2459. (modify-phases %standard-phases
  2460. (add-after 'install 'split
  2461. (lambda* (#:key inputs outputs #:allow-other-keys)
  2462. ;; Distribute the binaries to the various outputs.
  2463. (let* ((out (assoc-ref outputs "out"))
  2464. (jack (assoc-ref outputs "jack"))
  2465. (jacklib (string-append jack "/lib/alsa-lib"))
  2466. (pua (assoc-ref outputs "pulseaudio"))
  2467. (pualib (string-append pua "/lib/alsa-lib")))
  2468. ;; For jack.
  2469. (mkdir-p jacklib)
  2470. (for-each (lambda (file)
  2471. (rename-file file (string-append jacklib "/" (basename file))))
  2472. (find-files out ".*jack\\.(la|so)"))
  2473. ;; For pulseaudio.
  2474. (mkdir-p pualib)
  2475. (for-each (lambda (file)
  2476. (rename-file file (string-append pualib "/" (basename file))))
  2477. (find-files out ".*pulse\\.(la|so)"))
  2478. #t))))))
  2479. (inputs
  2480. (list alsa-lib
  2481. jack-1
  2482. speex ; libspeexdsp resampling plugin
  2483. libsamplerate ; libsamplerate resampling plugin
  2484. ffmpeg ; libavcodec resampling plugin, a52 plugin
  2485. pulseaudio)) ; PulseAudio plugin
  2486. (native-inputs
  2487. (list pkg-config))
  2488. (home-page "http://www.alsa-project.org/")
  2489. (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
  2490. (description
  2491. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  2492. MIDI functionality to the Linux-based operating system. This package enhances ALSA
  2493. by providing additional plugins which include: upmixing, downmixing, jackd and
  2494. pulseaudio support for native alsa applications, format conversion (s16 to a52), and
  2495. external rate conversion.")
  2496. (license (list license:gpl2+
  2497. ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
  2498. license:lgpl2.1+))))
  2499. (define-public iptables
  2500. (package
  2501. (name "iptables")
  2502. (version "1.8.7")
  2503. (source
  2504. (origin
  2505. (method url-fetch)
  2506. (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
  2507. version ".tar.bz2")
  2508. (string-append "https://www.netfilter.org/projects/iptables/"
  2509. "files/iptables-" version ".tar.bz2")))
  2510. (sha256
  2511. (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
  2512. (build-system gnu-build-system)
  2513. (native-inputs
  2514. (list pkg-config flex bison))
  2515. (inputs
  2516. (list libmnl libnftnl/fixed))
  2517. (arguments
  2518. (list #:tests? #f ; no test suite
  2519. #:configure-flags ; add $libdir to the RUNPATH of executables
  2520. ;; XXX TODO: Replace with simply #$OUTPUT on core-updates.
  2521. #~(list (string-append "LDFLAGS=-Wl,-rpath="
  2522. #$(if (%current-target-system)
  2523. #~#$output
  2524. #~%output) "/lib"))))
  2525. (home-page "https://www.netfilter.org/projects/iptables/index.html")
  2526. (synopsis "Programs to configure Linux IP packet filtering rules")
  2527. (description
  2528. "@command{iptables} is the user-space command line program used to
  2529. configure the Linux 2.4.x and later IPv4 packet filtering ruleset
  2530. (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
  2531. This package also includes @command{ip6tables}, which is used to configure the
  2532. IPv6 packet filter.
  2533. Both commands are targeted at system administrators.")
  2534. (license license:gpl2+)))
  2535. (define-public jitterentropy-rngd
  2536. (package
  2537. (name "jitterentropy-rngd")
  2538. (version "1.2.6")
  2539. (source
  2540. (origin
  2541. (method git-fetch)
  2542. (uri (git-reference
  2543. (url "https://github.com/smuellerDD/jitterentropy-rngd")
  2544. (commit (string-append "v" version))))
  2545. (file-name (git-file-name name version))
  2546. (sha256
  2547. (base32 "03cbcxkscjcmn6ybkmssq7i39sn5cfsap9fv058pi0k2mr90djwq"))))
  2548. (build-system gnu-build-system)
  2549. (arguments
  2550. `(#:tests? #f ; no test suite
  2551. #:make-flags
  2552. (list (string-append "CC=" ,(cc-for-target))
  2553. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  2554. "UNITDIR=$(PREFIX)/lib/systemd/system")
  2555. #:phases
  2556. (modify-phases %standard-phases
  2557. (delete 'configure)))) ; no ./configure script
  2558. (home-page "https://www.chronox.de/jent.html")
  2559. (synopsis "CPU jitter random number generator daemon")
  2560. (description
  2561. "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
  2562. number generator} core to the kernel Linux's entropy estimator. This prevents
  2563. the @file{/dev/random} device from blocking and should benefit users of the
  2564. preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
  2565. The CPU Jitter RNG itself is part of the kernel and claims to provide good
  2566. entropy by collecting and magnifying differences in CPU execution time as
  2567. measured by the high-resolution timer built into modern CPUs. It requires no
  2568. additional hardware or external entropy source.
  2569. The random bit stream generated by @command{jitterentropy-rngd} is not processed
  2570. by a cryptographically secure whitening function. Nonetheless, its authors
  2571. believe it to be a suitable source of cryptographically secure key material or
  2572. other cryptographically sensitive data.
  2573. If you agree with them, start this daemon as early as possible to provide
  2574. properly seeded random numbers to services like SSH or those using TLS during
  2575. early boot when entropy may be low, especially in virtualised environments.")
  2576. (license (list license:bsd-3 ; or
  2577. license:gpl2+))))
  2578. (define-public lsscsi
  2579. (package
  2580. (name "lsscsi")
  2581. (version "0.32")
  2582. (source (origin
  2583. (method url-fetch)
  2584. (uri (string-append
  2585. "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
  2586. (sha256
  2587. (base32
  2588. "0jp458m2b3wckr18qkln69i01152qlwz33zm49103lq8fgx0n6d4"))))
  2589. (build-system gnu-build-system)
  2590. (synopsis "Lists information about SCSI or NVMe devices in Linux")
  2591. (home-page "http://sg.danny.cz/scsi/lsscsi.html")
  2592. (description
  2593. "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
  2594. also list NVMe namespaces or controllers and show the relationship between a
  2595. device's primary node name, its SCSI generic (sg) node name and its kernel
  2596. name.")
  2597. (license license:gpl2)))
  2598. (define-public ebtables
  2599. (package
  2600. (name "ebtables")
  2601. (version "2.0.11")
  2602. (source (origin
  2603. (method url-fetch)
  2604. (uri (string-append
  2605. "mirror://netfilter.org/ebtables/ebtables-"
  2606. version ".tar.gz"))
  2607. (sha256
  2608. (base32
  2609. "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
  2610. (build-system gnu-build-system)
  2611. (inputs
  2612. (list perl iptables))
  2613. (synopsis "Ethernet bridge frame table administration")
  2614. (home-page "https://ebtables.netfilter.org/")
  2615. (description
  2616. "ebtables is an application program used to set up and maintain the
  2617. tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
  2618. analogous to the iptables application, but less complicated, due to the fact
  2619. that the Ethernet protocol is much simpler than the IP protocol.")
  2620. (license license:gpl2+)))
  2621. (define-public iproute
  2622. (package
  2623. (name "iproute2")
  2624. (version "5.15.0")
  2625. (source (origin
  2626. (method url-fetch)
  2627. (uri (string-append
  2628. "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
  2629. version ".tar.xz"))
  2630. (sha256
  2631. (base32
  2632. "1zwin8sjnnwf2a9rjwzb3q8lkhcpy06s29sh05f5gxd7z6jy9qrq"))))
  2633. (build-system gnu-build-system)
  2634. (arguments
  2635. `( ;; There is a test suite, but it wants network namespaces and sudo.
  2636. #:tests? #f
  2637. #:make-flags (let ((out (assoc-ref %outputs "out")))
  2638. (list "DESTDIR="
  2639. (string-append "CC=" ,(cc-for-target))
  2640. "HOSTCC=gcc"
  2641. (string-append "BASH_COMPDIR=" out
  2642. "/etc/bash_completion.d")
  2643. (string-append "LIBDIR=" out "/lib")
  2644. (string-append "HDRDIR=" out "/include")
  2645. (string-append "SBINDIR=" out "/sbin")
  2646. (string-append "CONFDIR=" out "/etc")
  2647. (string-append "DOCDIR=" out "/share/doc/"
  2648. ,name "-" ,version)
  2649. (string-append "MANDIR=" out "/share/man")))
  2650. #:phases (modify-phases %standard-phases
  2651. (add-before 'install 'pre-install
  2652. (lambda _
  2653. ;; Don't attempt to create /var/lib/arpd.
  2654. (substitute* "Makefile"
  2655. (("^.*ARPDDIR.*$") ""))
  2656. #t))
  2657. (add-after 'unpack 'patch-configure
  2658. (lambda _
  2659. (let ((target ,(%current-target-system)))
  2660. (substitute* "configure"
  2661. (("pkg-config")
  2662. (if target
  2663. (string-append target "-pkg-config")
  2664. "pkg-config")))
  2665. #t))))))
  2666. (inputs
  2667. `(("db4" ,bdb)
  2668. ("iptables" ,iptables)
  2669. ("libmnl" ,libmnl)))
  2670. (native-inputs
  2671. (list bison flex pkg-config))
  2672. ;; For tests.
  2673. ;; ("libmnl" ,libmnl)
  2674. ;; ("util-linux" ,util-linux)
  2675. (home-page
  2676. "https://wiki.linuxfoundation.org/networking/iproute2")
  2677. (synopsis
  2678. "Utilities for controlling TCP/IP networking and traffic in Linux")
  2679. (description
  2680. "Iproute2 is a collection of utilities for controlling TCP/IP networking
  2681. and traffic with the Linux kernel. The most important of these are
  2682. @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
  2683. control.
  2684. Most network configuration manuals still refer to ifconfig and route as the
  2685. primary network configuration tools, but ifconfig is known to behave
  2686. inadequately in modern network environments, and both should be deprecated.")
  2687. (license license:gpl2+)))
  2688. (define-public net-tools
  2689. ;; XXX: This package is basically unmaintained, but it provides a few
  2690. ;; commands not yet provided by Inetutils, such as 'route', so we have to
  2691. ;; live with it.
  2692. (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
  2693. (revision "0"))
  2694. (package
  2695. (name "net-tools")
  2696. (version (string-append "1.60-" revision "." (string-take commit 7)))
  2697. (source (origin
  2698. (method url-fetch)
  2699. (uri (string-append "https://sourceforge.net/code-snapshots/git/"
  2700. "n/ne/net-tools/code.git/net-tools-code-"
  2701. commit ".zip"))
  2702. (file-name (string-append name "-" version ".zip"))
  2703. (sha256
  2704. (base32
  2705. "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
  2706. (home-page "http://net-tools.sourceforge.net/")
  2707. (build-system gnu-build-system)
  2708. (arguments
  2709. `(#:modules ((guix build gnu-build-system)
  2710. (guix build utils)
  2711. (srfi srfi-1)
  2712. (srfi srfi-26))
  2713. #:phases
  2714. (modify-phases %standard-phases
  2715. (replace 'configure
  2716. (lambda* (#:key outputs #:allow-other-keys)
  2717. (let ((out (assoc-ref outputs "out")))
  2718. (mkdir-p (string-append out "/bin"))
  2719. (mkdir-p (string-append out "/sbin"))
  2720. ;; Pretend we have everything...
  2721. (system "yes | make config")
  2722. ;; ... except for the things we don't have.
  2723. ;; HAVE_AFDECnet requires libdnet, which we don't have.
  2724. ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
  2725. ;; that have been removed.
  2726. ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
  2727. ;; think about adding them later.
  2728. (substitute* '("config.make" "config.h")
  2729. (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
  2730. ""))
  2731. #t)))
  2732. (add-after 'install 'remove-redundant-commands
  2733. (lambda* (#:key outputs #:allow-other-keys)
  2734. ;; Remove commands and man pages redundant with Inetutils.
  2735. (let* ((out (assoc-ref outputs "out"))
  2736. (dup (append-map (cut find-files out <>)
  2737. '("^hostname"
  2738. "^(yp|nis|dns)?domainname"))))
  2739. (for-each delete-file dup)
  2740. #t))))
  2741. ;; Binaries that depend on libnet-tools.a don't declare that
  2742. ;; dependency, making it parallel-unsafe.
  2743. #:parallel-build? #f
  2744. #:tests? #f ; no test suite
  2745. #:make-flags (let ((out (assoc-ref %outputs "out")))
  2746. (list ,(string-append "CC=" (cc-for-target))
  2747. (string-append "BASEDIR=" out)
  2748. (string-append "INSTALLNLSDIR=" out "/share/locale")
  2749. (string-append "mandir=/share/man")))))
  2750. (native-inputs `(("gettext" ,gettext-minimal)
  2751. ("unzip" ,unzip)))
  2752. (supported-systems (delete "i586-gnu" %supported-systems))
  2753. (synopsis "Tools for controlling the network subsystem in Linux")
  2754. (description
  2755. "This package includes the important tools for controlling the network
  2756. subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
  2757. route. Additionally, this package contains utilities relating to particular
  2758. network hardware types (plipconfig, slattach) and advanced aspects of IP
  2759. configuration (iptunnel, ipmaddr).")
  2760. (license license:gpl2+))))
  2761. (define-public libcap
  2762. (package
  2763. (name "libcap")
  2764. (version "2.62")
  2765. (source (origin
  2766. (method url-fetch)
  2767. (uri (string-append
  2768. "mirror://kernel.org/linux/libs/security/linux-privs/"
  2769. "libcap2/libcap-" version ".tar.xz"))
  2770. (sha256
  2771. (base32
  2772. "18l3pngsbaahdjzz01rmzrjgcqny4zld685fkq96mq5yr6m5n30r"))))
  2773. (build-system gnu-build-system)
  2774. (arguments
  2775. (list #:phases
  2776. #~(modify-phases %standard-phases
  2777. (delete 'configure))
  2778. #:test-target "test"
  2779. #:make-flags
  2780. #~(list "lib=lib"
  2781. (string-append "prefix=" #$output)
  2782. (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
  2783. "RAISE_SETFCAP=no"
  2784. ;; Tell the makefile to use TARGET-gcc and friends
  2785. ;; when cross-compiling.
  2786. #$@(if (%current-target-system)
  2787. `((string-append "CROSS_COMPILE="
  2788. ,(%current-target-system) "-")
  2789. "BUILD_CC=gcc")
  2790. '()))))
  2791. (native-inputs (list perl))
  2792. (supported-systems (delete "i586-gnu" %supported-systems))
  2793. (home-page "https://sites.google.com/site/fullycapable/")
  2794. (synopsis "Library for working with POSIX capabilities")
  2795. (description
  2796. "Libcap2 provides a programming interface to POSIX capabilities on
  2797. Linux-based operating systems.")
  2798. ;; License is BSD-3 or GPLv2, at the user's choice.
  2799. (license license:gpl2)))
  2800. (define-public bridge-utils
  2801. (package
  2802. (name "bridge-utils")
  2803. (version "1.7.1")
  2804. (source
  2805. (origin
  2806. (method url-fetch)
  2807. (uri (string-append "mirror://kernel.org/linux/utils/net/"
  2808. "bridge-utils/bridge-utils-" version ".tar.xz"))
  2809. (sha256
  2810. (base32 "03p6cmhm6cqhnfsfa1wv7frhb361y12daf7gr1h5qh51y7j8n7d6"))))
  2811. (build-system gnu-build-system)
  2812. ;; The tarball lacks all the generated files.
  2813. (native-inputs (list autoconf automake))
  2814. (arguments
  2815. '(#:tests? #f)) ; no 'check' target
  2816. (home-page "https://wiki.linuxfoundation.org/networking/bridge")
  2817. (synopsis "Manipulate Ethernet bridges")
  2818. (description
  2819. "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
  2820. to connect two Ethernet segments together in a protocol independent way.
  2821. Packets are forwarded based on Ethernet address, rather than IP address (like
  2822. a router). Since forwarding is done at Layer 2, all protocols can go
  2823. transparently through a bridge.")
  2824. (license license:gpl2+)))
  2825. (define-public libnl
  2826. (package
  2827. (name "libnl")
  2828. (version "3.5.0")
  2829. (source (origin
  2830. (method url-fetch)
  2831. (uri (string-append
  2832. "https://github.com/thom311/libnl/releases/download/"
  2833. "libnl" (string-join (string-split version #\.) "_")
  2834. "/libnl-" version ".tar.gz"))
  2835. (sha256
  2836. (base32
  2837. "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
  2838. (build-system gnu-build-system)
  2839. (native-inputs
  2840. `(("bison" ,bison)
  2841. ("flex" ,flex)
  2842. ("pkg-config" ,pkg-config)
  2843. ("swig" ,swig)
  2844. ("libnl3-doc"
  2845. ,(origin
  2846. (method url-fetch)
  2847. (uri (string-append
  2848. "https://github.com/thom311/libnl/releases/download/libnl"
  2849. (string-join (string-split version #\.) "_")
  2850. "/libnl-doc-" version ".tar.gz"))
  2851. (sha256
  2852. (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
  2853. (outputs `("out" "doc"))
  2854. (arguments
  2855. `(#:phases
  2856. (modify-phases %standard-phases
  2857. (add-after 'install 'install-doc
  2858. (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
  2859. (let ((dest (string-append (assoc-ref outputs "doc")
  2860. "/share/doc/libnl")))
  2861. (mkdir-p dest)
  2862. (invoke "tar" "xf" (assoc-ref
  2863. (or native-inputs inputs)
  2864. "libnl3-doc")
  2865. "--strip-components=1" "-C" dest)))))))
  2866. (home-page "https://www.infradead.org/~tgr/libnl/")
  2867. (synopsis "NetLink protocol library suite")
  2868. (description
  2869. "The libnl suite is a collection of libraries providing APIs to netlink
  2870. protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
  2871. between the kernel and user space processes. It was designed to be a more
  2872. flexible successor to ioctl to provide mainly networking related kernel
  2873. configuration and monitoring interfaces.")
  2874. ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
  2875. ;; 'nl-addr-add.c'), so the result is GPLv2-only.
  2876. (license license:gpl2)))
  2877. ;; libnl python extensions used to be outputs of libnl. However, as
  2878. ;; cross-compiling python extensions is currently broken, create separate
  2879. ;; packages for libnl python extensions.
  2880. (define (libnl-python-package python)
  2881. (let ((name (string-append "libnl-" python)))
  2882. (package
  2883. (inherit libnl)
  2884. (name name)
  2885. (inputs `(,@(cond
  2886. ((string=? python "python2")
  2887. `(("python-2" ,python-2)))
  2888. ((string=? python "python3")
  2889. `(("python-3" ,python-3))))))
  2890. (propagated-inputs (list libnl))
  2891. (outputs '("out"))
  2892. (arguments
  2893. `(#:modules ((guix build gnu-build-system)
  2894. (guix build utils)
  2895. (srfi srfi-1))
  2896. #:phases
  2897. (modify-phases %standard-phases
  2898. (replace 'install
  2899. (lambda* (#:key inputs outputs #:allow-other-keys)
  2900. (define (python-inst python)
  2901. (invoke python "setup.py" "build")
  2902. (invoke python "setup.py" "install"
  2903. (string-append "--prefix="
  2904. (assoc-ref %outputs "out")))
  2905. (invoke python "setup.py" "clean"))
  2906. (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
  2907. (assoc-ref inputs "libnl")))
  2908. (with-directory-excursion "./python" (python-inst ,python))
  2909. #t))))))))
  2910. (define-public libnl-python2 (libnl-python-package "python2"))
  2911. (define-public libnl-python3 (libnl-python-package "python3"))
  2912. (define-public iw
  2913. (package
  2914. (name "iw")
  2915. (version "4.14")
  2916. (source (origin
  2917. (method url-fetch)
  2918. (uri (string-append
  2919. "mirror://kernel.org/software/network/iw/iw-"
  2920. version ".tar.xz"))
  2921. (sha256
  2922. (base32
  2923. "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
  2924. (build-system gnu-build-system)
  2925. (native-inputs (list pkg-config))
  2926. (inputs (list libnl))
  2927. (arguments
  2928. (list #:make-flags
  2929. #~(list
  2930. (string-append "CC=" #$(cc-for-target))
  2931. (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
  2932. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  2933. #:phases
  2934. #~(modify-phases %standard-phases
  2935. (delete 'configure)))) ; no configure script
  2936. (home-page "https://wireless.wiki.kernel.org/")
  2937. (synopsis "Tool for configuring wireless devices")
  2938. (description
  2939. "iw is a new nl80211 based CLI configuration utility for wireless
  2940. devices. It replaces @code{iwconfig}, which is deprecated.")
  2941. (license license:isc)))
  2942. (define-public powertop
  2943. (package
  2944. (name "powertop")
  2945. (version "2.14")
  2946. (source
  2947. (origin
  2948. (method git-fetch)
  2949. (uri (git-reference
  2950. (url "https://github.com/fenrus75/powertop")
  2951. (commit (string-append "v" version))))
  2952. (file-name (git-file-name name version))
  2953. (sha256
  2954. (base32 "1zkr2y5nb1nr22nq8a3zli87iyfasfq6489p7h1k428pv8k45w4f"))))
  2955. (build-system gnu-build-system)
  2956. (arguments
  2957. '(#:configure-flags
  2958. (list "LDFLAGS=-pthread")
  2959. #:phases
  2960. (modify-phases %standard-phases
  2961. ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
  2962. ;; allow calibrating the network interface in Guix System.
  2963. (add-after 'unpack 'patch-absolute-file-names
  2964. (lambda* (#:key inputs #:allow-other-keys)
  2965. (let ((kmod (assoc-ref inputs "kmod")))
  2966. (substitute* (find-files "src" "\\.cpp$")
  2967. ;; Give the right 'modprobe' file name so that essential
  2968. ;; modules such as msr.ko can be loaded.
  2969. (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
  2970. ;; These programs are only needed to calibrate, so using
  2971. ;; relative file names avoids adding extra inputs. When they
  2972. ;; are missing powertop gracefully handles it.
  2973. (("/usr/bin/hcitool") "hcitool")
  2974. (("/usr/bin/xset") "xset")
  2975. (("/usr/sbin/hciconfig") "hciconfig"))
  2976. #t))))))
  2977. (inputs
  2978. (list kmod libnl ncurses pciutils zlib))
  2979. (native-inputs
  2980. `(("autoconf" ,autoconf)
  2981. ("automake" ,automake)
  2982. ("gettext" ,gettext-minimal)
  2983. ("libtool" ,libtool)
  2984. ("pkg-config" ,pkg-config)))
  2985. (home-page "https://01.org/powertop/")
  2986. (synopsis "Analyze power consumption on Intel-based laptops")
  2987. (description
  2988. "PowerTOP is a Linux tool to diagnose issues with power consumption and
  2989. power management. In addition to being a diagnostic tool, PowerTOP also has
  2990. an interactive mode where the user can experiment various power management
  2991. settings for cases where the operating system has not enabled these
  2992. settings.")
  2993. (license license:gpl2)))
  2994. (define-public aumix
  2995. (package
  2996. (name "aumix")
  2997. (version "2.9.1")
  2998. (source (origin
  2999. (method url-fetch)
  3000. (uri (string-append
  3001. "http://www.jpj.net/~trevor/aumix/releases/aumix-"
  3002. version ".tar.bz2"))
  3003. (sha256
  3004. (base32
  3005. "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
  3006. (build-system gnu-build-system)
  3007. (arguments
  3008. ;; Allow compilation with GCC 10.
  3009. '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
  3010. (inputs (list ncurses))
  3011. (home-page "http://www.jpj.net/~trevor/aumix.html")
  3012. (synopsis "Audio mixer for X and the console")
  3013. (description
  3014. "Aumix adjusts an audio mixer from X, the console, a terminal,
  3015. the command line or a script.")
  3016. (license license:gpl2+)))
  3017. (define-public iotop
  3018. (package
  3019. (name "iotop")
  3020. (version "0.6")
  3021. (source
  3022. (origin
  3023. (method url-fetch)
  3024. (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
  3025. version ".tar.gz"))
  3026. (sha256 (base32
  3027. "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
  3028. (build-system python-build-system)
  3029. (arguments
  3030. '(#:phases
  3031. (modify-phases %standard-phases
  3032. (add-after 'unpack 'fix-build-with-python3
  3033. (lambda _
  3034. (substitute* "setup.py"
  3035. (("itervalues") "values"))
  3036. #t)))
  3037. ;; There are currently no checks in the package.
  3038. #:tests? #f))
  3039. (native-inputs (list python))
  3040. (home-page "http://guichaz.free.fr/iotop/")
  3041. (synopsis
  3042. "Displays the IO activity of running processes")
  3043. (description
  3044. "Iotop is a Python program with a top like user interface to show the
  3045. processes currently causing I/O.")
  3046. (license license:gpl2+)))
  3047. (define-public fuse
  3048. (package
  3049. (name "fuse")
  3050. (version "2.9.9")
  3051. (source (origin
  3052. (method url-fetch)
  3053. (uri (string-append "https://github.com/libfuse/libfuse/releases/"
  3054. "download/fuse-" version
  3055. "/fuse-" version ".tar.gz"))
  3056. (sha256
  3057. (base32
  3058. "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
  3059. (patches (search-patches "fuse-overlapping-headers.patch"))))
  3060. (build-system gnu-build-system)
  3061. (inputs
  3062. (list bash-minimal util-linux))
  3063. (arguments
  3064. '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
  3065. (assoc-ref %outputs "out")
  3066. "/sbin")
  3067. (string-append "INIT_D_PATH="
  3068. (assoc-ref %outputs "out")
  3069. "/etc/init.d")
  3070. ;; The rule makes /dev/fuse 666.
  3071. (string-append "UDEV_RULES_PATH="
  3072. (assoc-ref %outputs "out")
  3073. "/lib/udev/rules.d"))
  3074. #:phases
  3075. (modify-phases %standard-phases
  3076. (add-before 'build 'set-file-names
  3077. (lambda* (#:key inputs #:allow-other-keys)
  3078. ;; libfuse calls out to mount(8) and umount(8). Make sure
  3079. ;; it refers to the right ones.
  3080. (substitute* '("lib/mount_util.c" "util/mount_util.c")
  3081. (("/bin/(u?)mount" _ maybe-u)
  3082. (search-input-file inputs
  3083. (string-append "bin/"
  3084. maybe-u "mount"))))
  3085. (substitute* '("util/mount.fuse.c")
  3086. (("/bin/sh")
  3087. (search-input-file inputs "/bin/sh")))
  3088. ;; This hack leads libfuse to search for 'fusermount' in
  3089. ;; $PATH, where it may find a setuid-root binary, instead of
  3090. ;; trying solely $out/sbin/fusermount and failing because
  3091. ;; it's not setuid.
  3092. (substitute* "lib/Makefile"
  3093. (("-DFUSERMOUNT_DIR=[[:graph:]]+")
  3094. "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))))))
  3095. (supported-systems (delete "i586-gnu" %supported-systems))
  3096. (home-page "https://github.com/libfuse/libfuse")
  3097. (synopsis "Support file systems implemented in user space")
  3098. (description
  3099. "As a consequence of its monolithic design, file system code for Linux
  3100. normally goes into the kernel itself---which is not only a robustness issue,
  3101. but also an impediment to system extensibility. FUSE, for \"file systems in
  3102. user space\", is a kernel module and user-space library that tries to address
  3103. part of this problem by allowing users to run file system implementations as
  3104. user-space processes.")
  3105. (license (list license:lgpl2.1 ;library
  3106. license:gpl2+)))) ;command-line utilities
  3107. (define-public fuse-3
  3108. (package
  3109. (inherit fuse)
  3110. (name "fuse")
  3111. (version "3.10.5")
  3112. (source (origin
  3113. (method url-fetch)
  3114. (uri
  3115. (string-append "https://github.com/libfuse/libfuse/releases/"
  3116. "download/fuse-" version
  3117. "/fuse-" version ".tar.xz"))
  3118. (sha256
  3119. (base32
  3120. "0rlnnsiw614qcmgy8xz67044gqc1pbvvf2yxjv44lh27bm487qmj"))))
  3121. (build-system meson-build-system)
  3122. (arguments
  3123. `(#:configure-flags
  3124. ,#~(list
  3125. (string-append "-Dudevrulesdir=" #$output "/udev/rules.d")
  3126. "-Duseroot=false")
  3127. #:tests? #f
  3128. #:phases
  3129. ,#~(modify-phases %standard-phases
  3130. (add-after 'unpack 'set-file-names
  3131. (lambda* (#:key inputs #:allow-other-keys)
  3132. ;; libfuse calls out to mount(8) and umount(8). Make sure
  3133. ;; it refers to the right ones.
  3134. (substitute* '("lib/mount_util.c")
  3135. (("/bin/(u?)mount" _ maybe-u)
  3136. (search-input-file inputs
  3137. (string-append "bin/"
  3138. maybe-u "mount"))))
  3139. (substitute* '("util/mount.fuse.c")
  3140. (("/bin/sh")
  3141. (search-input-file inputs "/bin/sh")))
  3142. ;; This hack leads libfuse to search for 'fusermount' in
  3143. ;; $PATH, where it may find a setuid-root binary, instead of
  3144. ;; trying solely $out/sbin/fusermount and failing because
  3145. ;; it's not setuid.
  3146. (substitute* "lib/meson.build"
  3147. (("-DFUSERMOUNT_DIR=[[:graph:]]+")
  3148. "-DFUSERMOUNT_DIR=\"/var/empty\"'"))))
  3149. (add-after 'unpack 'fix-install
  3150. (lambda* (#:key inputs #:allow-other-keys)
  3151. (substitute* '("util/meson.build")
  3152. (("install_helper.sh") "true"))
  3153. (substitute* '("util/meson.build")
  3154. (("fuseconf_path = .*")
  3155. "fuseconf_path = '/etc/fuse.conf'"))))
  3156. (add-before 'configure 'set-paths
  3157. (lambda* (#:key inputs outputs #:allow-other-keys)
  3158. (let ((dummy-init.d
  3159. (string-append (getcwd) "/etc/init.d")))
  3160. (setenv "MOUNT_FUSE_PATH"
  3161. (string-append #$output "/sbin"))
  3162. (setenv "UDEV_RULES_PATH"
  3163. (string-append #$output
  3164. "/lib/udev/rules.d"))))))))))
  3165. (define-public unionfs-fuse
  3166. (package
  3167. (name "unionfs-fuse")
  3168. (version "2.2")
  3169. (source (origin
  3170. (method git-fetch)
  3171. (uri (git-reference
  3172. (url "https://github.com/rpodgorny/unionfs-fuse")
  3173. (commit (string-append "v" version))))
  3174. (file-name (git-file-name name version))
  3175. (sha256
  3176. (base32
  3177. "1yigh8z1q6iq6yjyq7kl7vpbpjnxjld32apvjaw2bl44pqqg56hh"))))
  3178. (build-system cmake-build-system)
  3179. (native-inputs
  3180. (list python))
  3181. (inputs (list fuse))
  3182. (arguments
  3183. ;; The tests were never actually run ("collected 0 items"), but in recent
  3184. ;; versions of pytest that causes an error.
  3185. '(#:tests? #f))
  3186. (home-page "https://github.com/rpodgorny/unionfs-fuse")
  3187. (synopsis "User-space union file system")
  3188. (description
  3189. "UnionFS-FUSE is a flexible union file system implementation in user
  3190. space, using the FUSE library. Mounting a union file system allows you to
  3191. \"aggregate\" the contents of several directories into a single mount point.
  3192. UnionFS-FUSE additionally supports copy-on-write.")
  3193. (license license:bsd-3)))
  3194. (define fuse-static
  3195. (package (inherit fuse)
  3196. (name "fuse-static")
  3197. (source (origin (inherit (package-source fuse))
  3198. (modules '((guix build utils)))
  3199. (snippet
  3200. '(begin
  3201. ;; Normally libfuse invokes mount(8) so that /etc/mtab is
  3202. ;; updated. Change calls to 'mtab_needs_update' to 0 so
  3203. ;; that it doesn't do that, allowing us to remove the
  3204. ;; dependency on util-linux (something that is useful in
  3205. ;; initrds.)
  3206. (substitute* '("lib/mount_util.c"
  3207. "util/mount_util.c")
  3208. (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
  3209. "0")
  3210. (("/bin/")
  3211. ""))
  3212. #t))))))
  3213. (define-public unionfs-fuse/static
  3214. (package (inherit unionfs-fuse)
  3215. (synopsis "User-space union file system (statically linked)")
  3216. (name (string-append (package-name unionfs-fuse) "-static"))
  3217. (source (origin (inherit (package-source unionfs-fuse))
  3218. (modules '((guix build utils)))
  3219. (snippet
  3220. '(begin
  3221. ;; Add -ldl to the libraries, because libfuse.a needs that.
  3222. (substitute* "src/CMakeLists.txt"
  3223. (("target_link_libraries(.*)\\)" _ libs)
  3224. (string-append "target_link_libraries"
  3225. libs " dl)")))
  3226. #t))))
  3227. (arguments
  3228. '(#:tests? #f
  3229. #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
  3230. #:phases
  3231. (modify-phases %standard-phases
  3232. (add-after 'install 'post-install
  3233. (lambda* (#:key outputs #:allow-other-keys)
  3234. (let* ((out (assoc-ref outputs "out"))
  3235. (exe (string-append out "/bin/unionfs")))
  3236. ;; By default, 'unionfs' keeps references to
  3237. ;; $glibc/share/locale and similar stuff. Remove them.
  3238. (remove-store-references exe)
  3239. ;; 'unionfsctl' has references to glibc as well. Since
  3240. ;; we don't need it, remove it.
  3241. (delete-file (string-append out "/bin/unionfsctl"))
  3242. #t))))))
  3243. (inputs `(("fuse" ,fuse-static)))))
  3244. (define-public sshfs
  3245. (package
  3246. (name "sshfs")
  3247. (version "2.10")
  3248. (source (origin
  3249. (method url-fetch)
  3250. (uri (string-append "https://github.com/libfuse/sshfs/releases/"
  3251. "download/sshfs-" version "/sshfs-" version
  3252. ".tar.gz"))
  3253. (sha256
  3254. (base32
  3255. "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
  3256. (build-system gnu-build-system)
  3257. (inputs
  3258. (list fuse glib))
  3259. (native-inputs
  3260. (list pkg-config))
  3261. (home-page "https://github.com/libfuse/sshfs")
  3262. (synopsis "Mount remote file systems over SSH")
  3263. (description
  3264. "This is a file system client based on the SSH File Transfer Protocol.
  3265. Since most SSH servers already support this protocol it is very easy to set
  3266. up: on the server side there's nothing to do; on the client side mounting the
  3267. file system is as easy as logging into the server with an SSH client.")
  3268. (license license:gpl2+)))
  3269. (define-public sshfs-fuse
  3270. (package (inherit sshfs)
  3271. (name "sshfs-fuse")
  3272. (properties `((superseded . ,sshfs)))))
  3273. (define-public archivemount
  3274. (package
  3275. (name "archivemount")
  3276. (version "0.9.1")
  3277. (source
  3278. (origin
  3279. (method url-fetch)
  3280. (uri (string-append "https://www.cybernoia.de/software/archivemount/"
  3281. "archivemount-" version ".tar.gz"))
  3282. (sha256
  3283. (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
  3284. (build-system gnu-build-system)
  3285. (inputs (list fuse libarchive))
  3286. (native-inputs (list pkg-config))
  3287. (home-page "https://www.cybernoia.de/software/archivemount.html")
  3288. (synopsis "Tool for mounting archive files with FUSE")
  3289. (description "archivemount is a FUSE-based file system for Unix variants,
  3290. including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
  3291. mount point where it can be read from or written to as with any other file
  3292. system. This makes accessing the contents of the archive, which may be
  3293. compressed, transparent to other programs, without decompressing them.")
  3294. (license license:lgpl2.0+)))
  3295. (define-public numactl
  3296. (package
  3297. (name "numactl")
  3298. (version "2.0.14")
  3299. (source (origin
  3300. (method url-fetch)
  3301. (uri (string-append
  3302. "https://github.com/numactl/numactl/releases/download/v"
  3303. version "/numactl-" version ".tar.gz"))
  3304. (sha256
  3305. (base32
  3306. "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
  3307. (build-system gnu-build-system)
  3308. (arguments
  3309. '(;; There's a 'test' target, but it requires NUMA support in the kernel
  3310. ;; to run, which we can't assume to have.
  3311. #:tests? #f))
  3312. ;; NUMA is apparently not supported on armhf, see
  3313. ;; http://www.spinics.net/lists/linux-numa/msg01157.html
  3314. (supported-systems (delete "armhf-linux" %supported-systems))
  3315. (home-page "https://github.com/numactl/numactl")
  3316. (synopsis "Tools for non-uniform memory access (NUMA) machines")
  3317. (description
  3318. "NUMA stands for Non-Uniform Memory Access, in other words a system whose
  3319. memory is not all in one place. The @command{numactl} program allows you to
  3320. run your application program on specific CPUs and memory nodes. It does this
  3321. by supplying a NUMA memory policy to the operating system before running your
  3322. program.
  3323. The package contains other commands, such as @command{numastat},
  3324. @command{memhog}, and @command{numademo} which provides a quick overview of
  3325. NUMA performance on your system.")
  3326. (license (list license:gpl2 ;programs
  3327. license:lgpl2.1)))) ;library
  3328. (define-public kbd-neo
  3329. (package
  3330. (name "kbd-neo")
  3331. (version "2486")
  3332. (source
  3333. (origin
  3334. (method url-fetch)
  3335. (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
  3336. version "/linux/console/neo.map"))
  3337. (file-name (string-append name "-" version ".map"))
  3338. (sha256
  3339. (base32
  3340. "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
  3341. (build-system trivial-build-system)
  3342. (arguments
  3343. `(#:modules ((guix build utils))
  3344. #:builder (begin
  3345. (use-modules (guix build utils))
  3346. (let ((out (string-append %output "/share/keymaps"))
  3347. (source (assoc-ref %build-inputs "source")))
  3348. (mkdir-p out)
  3349. (copy-file source (string-append out "/neo.map"))
  3350. #t))))
  3351. (home-page "https://neo-layout.org")
  3352. (synopsis "Neo2 console layout")
  3353. (description
  3354. "Kbd-neo provides the Neo2 keyboard layout for use with
  3355. @command{loadkeys(1)} from @code{kbd(4)}.")
  3356. ;; The file is located in an svn directory, the entire content of
  3357. ;; the directory is licensed as GPL3.
  3358. (license license:gpl3+)))
  3359. (define-public kbd
  3360. (package
  3361. (name "kbd")
  3362. (version "2.4.0")
  3363. (source (origin
  3364. (method url-fetch)
  3365. (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
  3366. version ".tar.xz"))
  3367. (sha256
  3368. (base32
  3369. "17wvrqz2kk0w87idinhyvd31ih1dp7ldfl2yfx7ailygb0279w2m"))
  3370. (modules '((guix build utils)))
  3371. (snippet
  3372. '(begin
  3373. (substitute* '("src/unicode_start" "src/unicode_stop")
  3374. ;; Assume the Coreutils are in $PATH.
  3375. (("/usr/bin/tty")
  3376. "tty"))))))
  3377. (build-system gnu-build-system)
  3378. (arguments
  3379. '(#:phases
  3380. (modify-phases %standard-phases
  3381. (add-before 'build 'pre-build
  3382. (lambda* (#:key inputs #:allow-other-keys)
  3383. (let ((bzip2 (assoc-ref inputs "bzip2"))
  3384. (gzip (assoc-ref inputs "gzip"))
  3385. (xz (assoc-ref inputs "xz"))
  3386. (zstd (assoc-ref inputs "zstd")))
  3387. (substitute* "src/libkbdfile/kbdfile.c"
  3388. (("bzip2") (string-append bzip2 "/bin/bzip2"))
  3389. (("gzip") (string-append gzip "/bin/gzip"))
  3390. (("xz -d") (string-append xz "/bin/xz -d"))
  3391. (("zstd") (string-append zstd "/bin/zstd"))))))
  3392. (add-after 'install 'post-install
  3393. (lambda* (#:key outputs #:allow-other-keys)
  3394. ;; Make sure these programs find their comrades.
  3395. (let* ((out (assoc-ref outputs "out"))
  3396. (bin (string-append out "/bin")))
  3397. (for-each (lambda (prog)
  3398. (wrap-program (string-append bin "/" prog)
  3399. `("PATH" ":" prefix (,bin))))
  3400. '("unicode_start" "unicode_stop"))))))))
  3401. (native-inputs
  3402. (list autoconf pkg-config))
  3403. (inputs
  3404. `(("bzip2" ,bzip2)
  3405. ("gzip" ,gzip)
  3406. ("pam" ,linux-pam)
  3407. ("xz" ,xz)
  3408. ("zstd" ,zstd)))
  3409. (native-search-paths
  3410. (list (search-path-specification
  3411. (variable "LOADKEYS_KEYMAP_PATH")
  3412. ;; Append ‘/**’ to recursively search all directories. One can then
  3413. ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
  3414. ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
  3415. (files (list "share/keymaps/**")))))
  3416. (home-page "http://kbd-project.org/")
  3417. (synopsis "Linux keyboard utilities and keyboard maps")
  3418. (description
  3419. "This package contains keytable files and keyboard utilities compatible
  3420. for systems using the Linux kernel. This includes commands such as
  3421. @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
  3422. (license license:gpl2+)))
  3423. (define-public loadkeys-static
  3424. (package
  3425. (inherit kbd)
  3426. (name "loadkeys-static")
  3427. (arguments
  3428. (substitute-keyword-arguments (package-arguments kbd)
  3429. ((#:configure-flags flags ''())
  3430. `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
  3431. "--disable-vlock" ;so we don't need libpam
  3432. "--disable-libkeymap")
  3433. ,flags))
  3434. ((#:make-flags flags ''())
  3435. `(cons "LDFLAGS=-all-static -lrt -lpthread" ,flags))
  3436. ((#:phases phases '%standard-phases)
  3437. `(modify-phases ,phases
  3438. (replace 'install
  3439. (lambda* (#:key outputs #:allow-other-keys)
  3440. (let ((out (assoc-ref outputs "out")))
  3441. ;; The binary keeps references to gzip, among other things,
  3442. ;; which we don't need in the initrd, so strip references.
  3443. (remove-store-references "src/loadkeys")
  3444. (install-file "src/loadkeys"
  3445. (string-append out "/bin")))))
  3446. (delete 'post-install)))
  3447. ((#:strip-flags _ '())
  3448. ''("--strip-all"))
  3449. ((#:allowed-references _ '())
  3450. '())))
  3451. (synopsis "Statically-linked @command{loadkeys} program")
  3452. ;; This package is meant to be used internally in the initrd so don't
  3453. ;; expose it.
  3454. (properties '((hidden? . #t)))))
  3455. (define-public inotify-tools
  3456. (package
  3457. (name "inotify-tools")
  3458. (version "3.20.11.0")
  3459. (source (origin
  3460. (method git-fetch)
  3461. (uri (git-reference
  3462. (url "https://github.com/rvoicilas/inotify-tools")
  3463. (commit version)))
  3464. (file-name (git-file-name name version))
  3465. (sha256
  3466. (base32
  3467. "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
  3468. (build-system gnu-build-system)
  3469. (native-inputs
  3470. (list autoconf automake libtool))
  3471. (arguments
  3472. `(#:configure-flags
  3473. (list "--disable-static")))
  3474. (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
  3475. (synopsis "Monitor file accesses")
  3476. (description
  3477. "The inotify-tools packages provides a C library and command-line tools
  3478. to use Linux' inotify mechanism, which allows file accesses to be monitored.")
  3479. (license license:gpl2+)))
  3480. (define-public kmod
  3481. (package
  3482. (name "kmod")
  3483. (version "29")
  3484. (source (origin
  3485. (method url-fetch)
  3486. (uri
  3487. (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
  3488. "kmod-" version ".tar.xz"))
  3489. (sha256
  3490. (base32
  3491. "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"))
  3492. (patches (search-patches "kmod-module-directory.patch"))))
  3493. (build-system gnu-build-system)
  3494. (native-inputs
  3495. (list pkg-config
  3496. ;; For tests.
  3497. zstd))
  3498. (inputs
  3499. `(("xz" ,xz)
  3500. ("zlib" ,zlib)
  3501. ("zstd-lib" ,zstd "lib")))
  3502. (arguments
  3503. `(#:configure-flags '("--with-xz" "--with-zlib" "--with-zstd"
  3504. "--disable-test-modules")
  3505. #:phases
  3506. (modify-phases %standard-phases
  3507. (add-after 'unpack 'disable-tests
  3508. (lambda _
  3509. ;; XXX: These tests need '--sysconfdir=/etc' to pass.
  3510. (substitute* "Makefile.in"
  3511. (("testsuite/test-modprobe") "")
  3512. (("testsuite/test-depmod") "")
  3513. (("testsuite/test-blacklist") ""))
  3514. #t))
  3515. (add-after 'install 'install-modprobe&co
  3516. (lambda* (#:key outputs #:allow-other-keys)
  3517. (let* ((out (assoc-ref outputs "out"))
  3518. (bin (string-append out "/bin")))
  3519. (for-each (lambda (tool)
  3520. (symlink "kmod"
  3521. (string-append bin "/" tool)))
  3522. '("insmod" "rmmod" "lsmod" "modprobe"
  3523. "modinfo" "depmod"))
  3524. #t))))))
  3525. (supported-systems (delete "i586-gnu" %supported-systems))
  3526. (home-page "https://www.kernel.org/")
  3527. (synopsis "Kernel module tools")
  3528. (description "Kmod is a set of tools to handle common tasks with Linux
  3529. kernel modules like insert, remove, list, check properties, resolve
  3530. dependencies and aliases.
  3531. These tools are designed on top of libkmod, a library that is shipped with
  3532. kmod. The aim is to be compatible with tools, configurations and indices
  3533. from the module-init-tools project.")
  3534. (license license:gpl2+))) ; library under lgpl2.1+
  3535. (define-public earlyoom
  3536. (package
  3537. (name "earlyoom")
  3538. (version "1.6.2")
  3539. (source (origin
  3540. (method git-fetch)
  3541. (uri (git-reference
  3542. (url "https://github.com/rfjakob/earlyoom")
  3543. (commit (string-append "v" version))))
  3544. (file-name (git-file-name name version))
  3545. (sha256
  3546. (base32
  3547. "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
  3548. (build-system gnu-build-system)
  3549. (arguments
  3550. (list
  3551. #:phases
  3552. #~(modify-phases %standard-phases
  3553. (delete 'configure) ; no configure script
  3554. (add-before 'check 'set-go-HOME
  3555. (lambda _
  3556. (setenv "HOME" (getcwd))))
  3557. (add-before 'check 'disable-failing-test
  3558. (lambda _
  3559. ;; This test relies on writing to /proc/%d/oom_score_adj.
  3560. (substitute* "testsuite_cli_test.go"
  3561. (("TestI" match)
  3562. (string-append "skipped" match))))))
  3563. #:make-flags
  3564. #~(list (string-append "CC=" #$(cc-for-target))
  3565. (string-append "VERSION=v" #$version)
  3566. (string-append "PREFIX=" #$output)
  3567. (string-append "SYSCONFDIR=" #$output "/etc")
  3568. "GO111MODULE=off")
  3569. #:test-target "test"))
  3570. (native-inputs
  3571. (append
  3572. ;; To generate the manpage.
  3573. (if (or (target-x86-64?) (target-x86-32?))
  3574. (list pandoc)
  3575. '())
  3576. (list
  3577. ;; For the test suite.
  3578. cppcheck
  3579. go)))
  3580. (home-page "https://github.com/rfjakob/earlyoom")
  3581. (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
  3582. (description "Early OOM is a minimalist out of memory (OOM) daemon that
  3583. runs in user space and provides a more responsive and configurable alternative
  3584. to the in-kernel OOM killer.")
  3585. (license license:expat)))
  3586. (define-public eudev
  3587. ;; The post-systemd fork, maintained by Gentoo.
  3588. (package
  3589. (name "eudev")
  3590. (version "3.2.11")
  3591. (source (origin
  3592. (method git-fetch)
  3593. (uri (git-reference (url "https://github.com/gentoo/eudev")
  3594. (commit (string-append "v" version))))
  3595. (file-name (git-file-name name version))
  3596. (sha256
  3597. (base32
  3598. "0dzaqwjnl55f69ird57wb6skahc6l7zs1slsrzqqfhww33icp6av"))
  3599. (patches (search-patches "eudev-rules-directory.patch"))))
  3600. (build-system gnu-build-system)
  3601. (arguments
  3602. `(#:phases
  3603. (modify-phases %standard-phases
  3604. (add-before 'bootstrap 'patch-file-names
  3605. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  3606. (substitute* "man/make.sh"
  3607. (("/usr/bin/xsltproc")
  3608. (string-append (assoc-ref
  3609. (or native-inputs inputs) "xsltproc")
  3610. "/bin/xsltproc")))))
  3611. (add-after 'install 'move-static-library
  3612. (lambda* (#:key outputs #:allow-other-keys)
  3613. (let* ((out (assoc-ref outputs "out"))
  3614. (static (assoc-ref outputs "static"))
  3615. (source (string-append out "/lib/libudev.a"))
  3616. (target (string-append static "/lib/libudev.a")))
  3617. (mkdir-p (dirname target))
  3618. (link source target)
  3619. (delete-file source)
  3620. ;; Remove reference to the static library from the .la file
  3621. ;; such that Libtool looks for it in the usual places.
  3622. (substitute* (string-append out "/lib/libudev.la")
  3623. (("old_library=.*")
  3624. "old_library=''\n")))))
  3625. (add-after 'install 'build-hwdb
  3626. (lambda* (#:key outputs #:allow-other-keys)
  3627. ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
  3628. ;; similar tools to display product names.
  3629. ;;
  3630. ;; XXX: This can't be done when cross-compiling. Find another way
  3631. ;; to generate hwdb.bin for cross-built systems.
  3632. (let ((out (assoc-ref outputs "out")))
  3633. ,@(if (%current-target-system)
  3634. '(#t)
  3635. '((invoke (string-append out "/bin/udevadm")
  3636. "hwdb" "--update")))))))
  3637. #:configure-flags (list "--enable-manpages")))
  3638. (native-inputs
  3639. `(("autoconf" ,autoconf)
  3640. ("automake" ,automake)
  3641. ("gperf" ,gperf)
  3642. ("libtool" ,libtool)
  3643. ("pkg-config" ,pkg-config)
  3644. ;; For tests.
  3645. ("perl" ,perl)
  3646. ("python" ,python-wrapper)
  3647. ;; For documentation.
  3648. ("docbook-xml" ,docbook-xml-4.2)
  3649. ("docbook-xsl" ,docbook-xsl)
  3650. ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
  3651. ("xsltproc" ,libxslt)))
  3652. (inputs
  3653. ;; When linked against libblkid, eudev can populate /dev/disk/by-label
  3654. ;; and similar; it also installs the '60-persistent-storage.rules' file,
  3655. ;; which contains the rules to do that.
  3656. (list `(,util-linux "lib") ;for blkid
  3657. kmod))
  3658. (outputs '("out" "static"))
  3659. (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
  3660. (synopsis "Userspace device management")
  3661. (description "Udev is a daemon which dynamically creates and removes
  3662. device nodes from /dev/, handles hotplug events and loads drivers at boot
  3663. time.")
  3664. (license license:gpl2+)))
  3665. (define-public python-evdev
  3666. (package
  3667. (name "python-evdev")
  3668. (version "1.3.0")
  3669. (source
  3670. (origin
  3671. (method url-fetch)
  3672. (uri (pypi-uri "evdev" version))
  3673. (sha256
  3674. (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
  3675. (build-system python-build-system)
  3676. (arguments
  3677. `(#:tests? #f ;no rule for tests
  3678. #:phases
  3679. (modify-phases %standard-phases
  3680. (add-before 'build 'fix-hard-coded-directory
  3681. (lambda* (#:key inputs #:allow-other-keys)
  3682. (substitute* "setup.py"
  3683. (("/usr/include/linux")
  3684. (string-append
  3685. (assoc-ref inputs "kernel-headers") "/include/linux")))
  3686. #t)))))
  3687. (home-page "https://github.com/gvalkov/python-evdev")
  3688. (synopsis "Bindings to the Linux input handling subsystem")
  3689. (description
  3690. "Python-evdev provides bindings to the generic input event interface in
  3691. Linux. The @code{evdev} interface serves the purpose of passing events
  3692. generated in the kernel directly to userspace through character devices that
  3693. are typically located in @file{/dev/input/}.
  3694. This package also comes with bindings to @code{uinput}, the userspace input
  3695. subsystem. @code{uinput} allows userspace programs to create and handle input
  3696. devices that can inject events directly into the input subsystem.")
  3697. (license license:bsd-3)))
  3698. (define-public interception-tools
  3699. (package
  3700. (name "interception-tools")
  3701. (version "0.6.8")
  3702. (home-page "https://gitlab.com/interception/linux/tools")
  3703. (source (origin
  3704. (method git-fetch)
  3705. (uri (git-reference
  3706. (url home-page)
  3707. (commit (string-append "v" version))))
  3708. (file-name (git-file-name name version))
  3709. (sha256
  3710. (base32
  3711. "1sbidym6ld4c8cx2ww5i54zsv8v0kygv15zq1yimz44v4my605wf"))))
  3712. (build-system cmake-build-system)
  3713. (native-inputs
  3714. (list pkg-config))
  3715. (inputs
  3716. (list boost libevdev eudev yaml-cpp))
  3717. (arguments
  3718. `(#:tests? #f)) ; no test suite
  3719. (synopsis "Utilities for operating on input events of evdev devices")
  3720. (description
  3721. "Interception Tools provides a composable infrastructure on top of
  3722. @code{libudev} and @code{libevdev}. The following utilities are provided:
  3723. @itemize
  3724. @item @command{udevmon} --- monitor input devices for launching tasks
  3725. @item @command{intercept} --- redirect device input events to stdout
  3726. @item @command{uinput} --- redirect device input events from stding to virtual device
  3727. @item @command{mux} --- mux streams of input events
  3728. @end itemize")
  3729. ;; Dual-licensed under GPLv3+ or "something else" on request, per
  3730. ;; 'README.md'.
  3731. (license license:gpl3+)))
  3732. (define-public interception-dual-function-keys
  3733. (package
  3734. (name "interception-dual-function-keys")
  3735. (version "1.4.0")
  3736. (home-page "https://gitlab.com/interception/linux/plugins/dual-function-keys")
  3737. (source (origin
  3738. (method git-fetch)
  3739. (uri (git-reference
  3740. (url home-page)
  3741. (commit version)))
  3742. (file-name (git-file-name name version))
  3743. (sha256
  3744. (base32
  3745. "0s49vbg3j4rwh78i8rx8qr7myql09p7b3lhrjl0p7dd98xp6ann6"))))
  3746. (build-system gnu-build-system)
  3747. (inputs
  3748. (list libevdev yaml-cpp))
  3749. (arguments
  3750. `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
  3751. ,(string-append "CXX=" (cxx-for-target))
  3752. (string-append "PREFIX=" %output))
  3753. #:phases
  3754. (modify-phases %standard-phases
  3755. (add-after 'unpack 'fix-libevdev-path
  3756. (lambda* (#:key inputs #:allow-other-keys)
  3757. (let ((libevdev (assoc-ref inputs "libevdev")))
  3758. (substitute* "config.mk"
  3759. (("/usr/include/libevdev-1.0")
  3760. (string-append libevdev "/include/libevdev-1.0")))
  3761. #t)))
  3762. ;; No configure script
  3763. (delete 'configure))
  3764. ;; No tests are included.
  3765. #:tests? #f))
  3766. (synopsis "Tap for one key, hold for another")
  3767. (description
  3768. "Dual Function Keys is a plugin for @code{interception-tools} that allows
  3769. one to send arbitrary keycodes when a given key is tapped or held.")
  3770. (license license:expat)))
  3771. (define-public lvm2
  3772. (package
  3773. (name "lvm2")
  3774. (version "2.03.11")
  3775. (source (origin
  3776. (method url-fetch)
  3777. (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
  3778. version ".tgz")
  3779. (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
  3780. version ".tgz")))
  3781. (sha256
  3782. (base32
  3783. "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
  3784. (modules '((guix build utils)))
  3785. (snippet
  3786. '(begin
  3787. (use-modules (guix build utils))
  3788. ;; Honor sysconfdir.
  3789. (substitute* "make.tmpl.in"
  3790. (("^confdir = .*$")
  3791. "confdir = @sysconfdir@\n")
  3792. (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
  3793. "DEFAULT_SYS_DIR = @sysconfdir@"))
  3794. #t))
  3795. (patches (search-patches "lvm2-static-link.patch"))))
  3796. (build-system gnu-build-system)
  3797. (native-inputs
  3798. (list config
  3799. pkg-config procps)) ;tests use 'pgrep'
  3800. (inputs
  3801. `(("libaio" ,libaio)
  3802. ("udev" ,eudev)))
  3803. (arguments
  3804. `(#:phases
  3805. (modify-phases %standard-phases
  3806. (add-after 'unpack 'update-config
  3807. (lambda* (#:key inputs native-inputs #:allow-other-keys)
  3808. (install-file (search-input-file
  3809. (or native-inputs inputs) "/bin/config.sub")
  3810. "autoconf")
  3811. (install-file (search-input-file
  3812. (or native-inputs inputs) "/bin/config.guess")
  3813. "autoconf")))
  3814. (add-after 'configure 'set-makefile-shell
  3815. (lambda _
  3816. ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
  3817. ;; expected.
  3818. (setenv "SHELL" (which "sh"))
  3819. ;; Replace /bin/sh with the right file name.
  3820. (patch-makefile-SHELL "make.tmpl")
  3821. #t)))
  3822. #:configure-flags (list (string-append "--sysconfdir="
  3823. (assoc-ref %outputs "out")
  3824. "/etc/lvm")
  3825. "--enable-udev_sync"
  3826. "--enable-udev_rules"
  3827. "--enable-pkgconfig"
  3828. "--enable-cmdlib"
  3829. "--enable-dmeventd" ; Requires '--enable-cmdlib'.
  3830. ;; Make sure programs such as 'dmsetup' can
  3831. ;; find libdevmapper.so.
  3832. (string-append "LDFLAGS=-Wl,-rpath="
  3833. (assoc-ref %outputs "out")
  3834. "/lib,-rpath="
  3835. (assoc-ref %outputs "out")
  3836. "/lib/device-mapper")
  3837. ;; This is needed when cross-compiling.
  3838. ,@(if (%current-target-system)
  3839. '("ac_cv_func_malloc_0_nonnull=yes"
  3840. "ac_cv_func_realloc_0_nonnull=yes")
  3841. '()))
  3842. ;; The tests use 'mknod', which requires root access.
  3843. #:tests? #f))
  3844. (supported-systems (delete "i586-gnu" %supported-systems))
  3845. (home-page "https://sourceware.org/lvm2/")
  3846. (synopsis "Logical volume management for Linux")
  3847. (description
  3848. "LVM2 is the logical volume management tool set for Linux-based systems.
  3849. This package includes the user-space libraries and tools, including the device
  3850. mapper. Kernel components are part of Linux-libre.")
  3851. ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
  3852. ;; Command-line tools are GPLv2.
  3853. (license (list license:gpl2 license:lgpl2.1))))
  3854. (define-public lvm2-static
  3855. (package
  3856. (inherit lvm2)
  3857. (name "lvm2-static")
  3858. ;; Propagate udev because libdevmapper.a depends on libudev.
  3859. (propagated-inputs `(("udev:static" ,eudev "static")))
  3860. (arguments
  3861. (substitute-keyword-arguments (package-arguments lvm2)
  3862. ((#:configure-flags flags '())
  3863. ;; LVM2 doesn't use Libtool, hence the custom option.
  3864. `(append '("--enable-static_link")
  3865. ;; Building dmeventd statically is complicated due to a
  3866. ;; requirement on libdevmapper.a, which is being phased out
  3867. ;; in favor of libdevice-mapper.a, which in turn is is not
  3868. ;; easily made available at dmeventd build time. Just ignore
  3869. ;; it until the situation improves.
  3870. (delete "--enable-dmeventd" ,flags)))
  3871. ((#:phases phases)
  3872. `(modify-phases ,phases
  3873. (add-before 'configure 'adjust-Makefile
  3874. (lambda _
  3875. ;; These fixes are related to the upstream libdm->device_mapper
  3876. ;; migration and will hopefully be fixed upstream in due time.
  3877. (substitute* "tools/Makefile.in"
  3878. ;; This variable is empty in a static configuration and causes
  3879. ;; an erroneous GCC command line.
  3880. (("-L\\$\\(interfacebuilddir\\)") "")
  3881. ;; Remove obsolete reference to libdevmapper.a.
  3882. (("-ldevmapper") ""))
  3883. #t))))))
  3884. (synopsis "Logical volume management for Linux (statically linked)")))
  3885. (define-public thin-provisioning-tools
  3886. (package
  3887. (name "thin-provisioning-tools")
  3888. (version "0.8.5")
  3889. (source
  3890. (origin
  3891. (method git-fetch)
  3892. (uri (git-reference
  3893. (url "https://github.com/jthornber/thin-provisioning-tools")
  3894. (commit (string-append "v" version))))
  3895. (file-name (git-file-name name version))
  3896. (sha256
  3897. (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
  3898. (build-system gnu-build-system)
  3899. (arguments
  3900. ;; Doesn't build with --enable-testing due to a function name collision
  3901. ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
  3902. `(#:tests? #f))
  3903. (native-inputs
  3904. `(("automake" ,automake)
  3905. ("autoreconf" ,autoconf)))
  3906. (inputs
  3907. (list boost expat libaio))
  3908. (synopsis "Tools for manipulating the metadata of device-mapper targets")
  3909. (description "A suite of tools for manipulating the metadata of the
  3910. dm-thin, dm-cache and dm-era device-mapper targets.")
  3911. (home-page "https://github.com/jthornber/thin-provisioning-tools")
  3912. (license license:gpl3+)))
  3913. (define-public watchdogd
  3914. (package
  3915. (name "watchdogd")
  3916. (version "3.5")
  3917. (source (origin
  3918. (method git-fetch)
  3919. (uri (git-reference
  3920. (url "https://github.com/troglobit/watchdogd")
  3921. (commit version)))
  3922. (file-name (git-file-name name version))
  3923. (sha256
  3924. (base32
  3925. "05f7igavzimfgbh39fflbkmpya12r854n03dkyimwashcqwchx8f"))))
  3926. (build-system gnu-build-system)
  3927. (native-inputs (list autoconf automake libtool pkg-config))
  3928. (inputs (list libconfuse libite libuev))
  3929. (synopsis "Advanced system & process supervisor for Linux")
  3930. (description "This package provides an advanced monitor of critical system
  3931. resources, supervises the heartbeat of processes, records deadline
  3932. transgressions, and initiates a controlled reset if needed.")
  3933. (home-page "https://troglobit.com/projects/watchdogd/")
  3934. (license license:isc)))
  3935. (define-public wireless-tools
  3936. (package
  3937. (name "wireless-tools")
  3938. (version "30.pre9")
  3939. (source
  3940. (origin
  3941. (method url-fetch)
  3942. (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/"
  3943. "Linux/wireless_tools." version ".tar.gz"))
  3944. (sha256
  3945. (base32 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
  3946. (snippet
  3947. #~(begin
  3948. ;; Remove the older header files that are not free software.
  3949. (for-each (lambda (n)
  3950. (delete-file (format #f "wireless.~a.h" n)))
  3951. '(10 11 12 13 14 15 16 17 18 19 20))))))
  3952. (build-system gnu-build-system)
  3953. (arguments
  3954. (list #:make-flags
  3955. #~(list (string-append "PREFIX=" #$output)
  3956. (string-append "INSTALL_MAN=" #$output "/share/man")
  3957. (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
  3958. "BUILD_STATIC=")
  3959. #:phases
  3960. #~(modify-phases %standard-phases
  3961. (replace 'configure
  3962. (lambda* (#:key target #:allow-other-keys)
  3963. (when target
  3964. ;; Cross-compilation: use the cross tools.
  3965. (substitute* (find-files "." "Makefile")
  3966. (("CC = .*$")
  3967. (string-append "CC = " target "-gcc\n"))
  3968. (("AR = .*$")
  3969. (string-append "AR = " target "-ar\n"))
  3970. (("RANLIB = .*$")
  3971. (string-append "RANLIB = " target "-ranlib\n")))))))
  3972. #:tests? #f))
  3973. (synopsis "Tools for manipulating Linux Wireless Extensions")
  3974. (description "Wireless Tools are used to manipulate the now-deprecated
  3975. Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
  3976. Extension was an interface allowing you to set Wireless LAN specific
  3977. parameters and get the specific stats. It is deprecated in favor the nl80211
  3978. interface.")
  3979. (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
  3980. ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
  3981. ;; other files are distributed under gpl2.
  3982. (license (list license:gpl2 license:lgpl2.1+))))
  3983. (define-public crda
  3984. (package
  3985. (name "crda")
  3986. (version "3.18")
  3987. (source (origin
  3988. (method url-fetch)
  3989. (uri (string-append "mirror://kernel.org/software/network/crda/"
  3990. "crda-" version ".tar.xz"))
  3991. (sha256
  3992. (base32
  3993. "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
  3994. (patches (search-patches "crda-optional-gcrypt.patch"))))
  3995. (build-system gnu-build-system)
  3996. (arguments
  3997. `(#:phases (modify-phases %standard-phases
  3998. (delete 'configure)
  3999. (add-after 'unpack 'gzip-determinism
  4000. (lambda _
  4001. (substitute* "Makefile"
  4002. (("gzip") "gzip --no-name"))
  4003. #t))
  4004. ,@(if (%current-target-system)
  4005. '((add-after
  4006. 'unpack 'fix-pkg-config
  4007. (lambda* (#:key target #:allow-other-keys)
  4008. (substitute*
  4009. "Makefile"
  4010. (("pkg-config")
  4011. (string-append target "-pkg-config")))
  4012. #t)))
  4013. '())
  4014. (add-before
  4015. 'build 'no-werror-no-ldconfig
  4016. (lambda _
  4017. (substitute* "Makefile"
  4018. (("-Werror") "")
  4019. (("ldconfig") "true"))
  4020. #t))
  4021. (add-before
  4022. 'build 'set-regulator-db-file-name
  4023. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  4024. ;; Tell CRDA where to find our database.
  4025. (let ((regdb (assoc-ref (or native-inputs inputs)
  4026. "wireless-regdb")))
  4027. (substitute* "crda.c"
  4028. (("\"/lib/crda/regulatory.bin\"")
  4029. (string-append "\"" regdb
  4030. "/lib/crda/regulatory.bin\"")))
  4031. #t))))
  4032. #:test-target "verify"
  4033. #:make-flags (let ((out (assoc-ref %outputs "out"))
  4034. (regdb (assoc-ref %build-inputs "wireless-regdb")))
  4035. (list
  4036. (string-append "CC=" ,(cc-for-target))
  4037. "V=1"
  4038. ;; Disable signature-checking on 'regulatory.bin'.
  4039. ;; The reason is that this simplifies maintenance
  4040. ;; on our side (no need to manage a distro key
  4041. ;; pair), and we can guarantee integrity of
  4042. ;; 'regulatory.bin' by other means anyway, such as
  4043. ;; 'guix gc --verify'. See
  4044. ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
  4045. ;; for a discssion.
  4046. "USE_OPENSSL=0"
  4047. (string-append "PREFIX=" out)
  4048. (string-append "SBINDIR=" out "/sbin/")
  4049. (string-append "UDEV_RULE_DIR="
  4050. out "/lib/udev/rules.d")
  4051. (string-append "LDFLAGS=-Wl,-rpath="
  4052. out "/lib -L.")
  4053. (string-append "REG_BIN=" regdb
  4054. "/lib/crda/regulatory.bin")
  4055. "all_noverify"))))
  4056. (native-inputs (list pkg-config wireless-regdb))
  4057. (inputs (list libnl))
  4058. (home-page
  4059. "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
  4060. (synopsis "Central regulatory domain agent (CRDA) for WiFi")
  4061. (description
  4062. "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
  4063. communication between the kernel Linux and user space for regulatory
  4064. compliance.")
  4065. (license license:copyleft-next)))
  4066. (define-public wireless-regdb
  4067. (package
  4068. (name "wireless-regdb")
  4069. (version "2020.11.20")
  4070. (source (origin
  4071. (method url-fetch)
  4072. (uri (string-append
  4073. "mirror://kernel.org/software/network/wireless-regdb/"
  4074. "wireless-regdb-" version ".tar.xz"))
  4075. (sha256
  4076. (base32
  4077. "0liagyi6ppf5w474qk9j4jz5gbvvn8mc8al1dq4b1xrgv28485ml"))
  4078. ;; We're building 'regulatory.bin' by ourselves.
  4079. (snippet '(begin
  4080. (delete-file "regulatory.bin")
  4081. #t))))
  4082. (build-system gnu-build-system)
  4083. (arguments
  4084. '(#:phases
  4085. (modify-phases %standard-phases
  4086. (add-after 'unpack 'gzip-determinism
  4087. (lambda _
  4088. (substitute* "Makefile"
  4089. (("gzip") "gzip --no-name"))
  4090. #t))
  4091. (add-after 'unpack 'omit-signature
  4092. (lambda _
  4093. (substitute* "Makefile"
  4094. ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
  4095. ;; don't provide (see below). Disable it.
  4096. ((" regulatory\\.db\\.p7s") "")
  4097. ;; regulatory.db is built as a dependency of regulatory.db.p7s,
  4098. ;; but ‘make install’ depends only on the latter while installing
  4099. ;; both (and failing). Depend on it explicitly.
  4100. (("^install: " all) (string-append all "regulatory.db ")))
  4101. #t))
  4102. (delete 'configure)) ; no configure script
  4103. ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
  4104. ;; is computed and can be equal to 'maintainer-clean'; when that
  4105. ;; happens, we can end up deleting the 'regulatory.bin' file that we
  4106. ;; just built. Thus, build things sequentially.
  4107. #:parallel-build? #f
  4108. #:tests? #f ; no tests
  4109. #:make-flags
  4110. (let ((out (assoc-ref %outputs "out")))
  4111. (list (string-append "PREFIX=" out)
  4112. (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
  4113. ;; Leave this empty so that db2bin.py doesn't try to sign
  4114. ;; ‘regulatory.bin’. This allows us to avoid managing a key
  4115. ;; pair for the whole distribution.
  4116. (string-append "REGDB_PRIVKEY=")
  4117. ;; Don't generate a public key for the same reason. These are
  4118. ;; used as Makefile targets and can't be the empty string.
  4119. (string-append "REGDB_PUBCERT=/dev/null")
  4120. (string-append "REGDB_PUBKEY=/dev/null")))))
  4121. (native-inputs
  4122. `(("python" ,python-wrapper)))
  4123. (home-page
  4124. "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
  4125. (synopsis "Wireless regulatory database")
  4126. (description
  4127. "This package contains the wireless regulatory database for the Central
  4128. Regulatory Database Agent (CRDA). The database contains information on
  4129. country-specific regulations for the wireless spectrum.")
  4130. (license license:isc)))
  4131. (define-public lm-sensors
  4132. (package
  4133. (name "lm-sensors")
  4134. (version "3.6.0")
  4135. (source
  4136. (origin
  4137. (method git-fetch)
  4138. (uri (git-reference
  4139. (url "https://github.com/groeck/lm-sensors")
  4140. (commit (string-append "V" (string-join
  4141. (string-split version #\.) "-")))))
  4142. (file-name (git-file-name name version))
  4143. (sha256
  4144. (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
  4145. (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
  4146. (build-system gnu-build-system)
  4147. (inputs (list rrdtool perl kmod gnuplot))
  4148. (native-inputs (list pkg-config flex bison which))
  4149. (outputs '("lib" ; avoid perl in closure
  4150. "out"))
  4151. (arguments
  4152. `(#:tests? #f ; no 'check' target
  4153. #:make-flags (list (string-append "PREFIX=" %output)
  4154. (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
  4155. (string-append "INCLUDEDIR="
  4156. (assoc-ref %outputs "lib") "/include")
  4157. (string-append "MANDIR=" %output "/share/man")
  4158. (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
  4159. #:phases
  4160. (modify-phases %standard-phases
  4161. (delete 'configure)
  4162. (add-before 'build 'patch-exec-paths
  4163. (lambda* (#:key inputs outputs #:allow-other-keys)
  4164. (substitute* "prog/detect/sensors-detect"
  4165. (("`uname")
  4166. (string-append "`" (assoc-ref inputs "coreutils")
  4167. "/bin/uname"))
  4168. (("(`|\")modprobe" all open-quote)
  4169. (string-append open-quote
  4170. (assoc-ref inputs "kmod")
  4171. "/bin/modprobe")))
  4172. (substitute* '("prog/pwm/pwmconfig"
  4173. "prog/pwm/fancontrol")
  4174. (("gnuplot")
  4175. (search-input-file inputs "/bin/gnuplot"))
  4176. (("cat ")
  4177. (string-append (search-input-file inputs "/bin/cat")
  4178. " "))
  4179. (("e?grep " match)
  4180. (string-append (search-input-file inputs
  4181. (string-append
  4182. "/bin/"
  4183. (string-trim-right match)))
  4184. " "))
  4185. (("sed -e")
  4186. (string-append (search-input-file inputs "/bin/sed")
  4187. " -e"))
  4188. (("cut -d")
  4189. (string-append (search-input-file inputs "/bin/cut")
  4190. " -d"))
  4191. (("sleep ")
  4192. (string-append (search-input-file inputs "/bin/sleep")
  4193. " "))
  4194. (("readlink -f")
  4195. (string-append (search-input-file inputs "/bin/readlink")
  4196. " -f"))))))))
  4197. (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
  4198. (synopsis "Utilities to read temperature/voltage/fan sensors")
  4199. (description
  4200. "Lm-sensors is a hardware health monitoring package for Linux. It allows
  4201. you to access information from temperature, voltage, and fan speed sensors.
  4202. It works with most newer systems.")
  4203. (license license:gpl2+)))
  4204. (define-public iucode-tool
  4205. (package
  4206. (name "iucode-tool")
  4207. (version "2.3.1")
  4208. (source (origin
  4209. (method url-fetch)
  4210. (uri (string-append "https://gitlab.com/iucode-tool/releases"
  4211. "/raw/latest/iucode-tool_" version ".tar.xz"))
  4212. (sha256
  4213. (base32
  4214. "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
  4215. (build-system gnu-build-system)
  4216. (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
  4217. (synopsis "Manipulate Intel microcode bundles")
  4218. (description
  4219. "@command{iucode_tool} is a utility to work with microcode packages for
  4220. Intel processors. It can convert between formats, extract specific versions,
  4221. create a firmware image suitable for the Linux kernel, and more.")
  4222. ;; cpuid.h is available for i686, x86_64, and ia64.
  4223. (supported-systems '("i686-linux" "x86_64-linux"))
  4224. (license license:gpl2+)))
  4225. (define-public i2c-tools
  4226. (package
  4227. (name "i2c-tools")
  4228. (version "4.3")
  4229. (source (origin
  4230. (method url-fetch)
  4231. (uri (string-append
  4232. "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
  4233. version ".tar.xz"))
  4234. (sha256
  4235. (base32
  4236. "1y0fphjd5ah2j886x8i175r7viq0hmx666hyca0wi4dzrm290qxk"))))
  4237. (build-system gnu-build-system)
  4238. (arguments
  4239. `(#:tests? #f ; no 'check' target
  4240. #:make-flags
  4241. ,#~(list (string-append "PREFIX=" #$output)
  4242. (string-append "LDFLAGS+=-Wl,-rpath=" #$output "/lib")
  4243. (string-append "CC=" #$(cc-for-target)))
  4244. ;; No configure script.
  4245. #:phases (modify-phases %standard-phases (delete 'configure))))
  4246. (inputs
  4247. (list perl))
  4248. (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
  4249. (synopsis "I2C tools for Linux")
  4250. (description
  4251. "The i2c-tools package contains a heterogeneous set of I2C tools for
  4252. Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
  4253. EEPROM decoding scripts, EEPROM programming tools, and a python module for
  4254. SMBus access.")
  4255. (license license:gpl2+)))
  4256. (define-public i2c-tools-3
  4257. (package
  4258. (inherit i2c-tools)
  4259. (name "i2c-tools")
  4260. (version "3.1.2")
  4261. (source (origin
  4262. (method url-fetch)
  4263. (uri (string-append
  4264. "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
  4265. version ".tar.bz2"))
  4266. (sha256
  4267. (base32 "0hd4c1w8lnwc3j95h3vpd125170l1d4myspyrlpamqx6wbr6jpnv"))))
  4268. (arguments
  4269. (substitute-keyword-arguments (package-arguments i2c-tools)
  4270. ((#:make-flags _)
  4271. #~(list (string-append "prefix=" #$output)
  4272. (string-append "CC=" #$(cc-for-target))))))))
  4273. (define-public xsensors
  4274. (package
  4275. (name "xsensors")
  4276. (version "0.70")
  4277. (source (origin
  4278. (method url-fetch)
  4279. (uri (string-append
  4280. "http://www.linuxhardware.org/xsensors/xsensors-"
  4281. version ".tar.gz"))
  4282. (sha256
  4283. (base32
  4284. "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
  4285. (build-system gnu-build-system)
  4286. (inputs `(("lm-sensors" ,lm-sensors "lib")
  4287. ("gtk" ,gtk+-2)))
  4288. (native-inputs (list pkg-config))
  4289. (arguments
  4290. `(#:phases
  4291. (modify-phases %standard-phases
  4292. (add-before 'configure 'enable-deprecated
  4293. (lambda _
  4294. (substitute* "src/Makefile.in"
  4295. (("-DGDK_DISABLE_DEPRECATED") "")
  4296. (("-DGTK_DISABLE_DEPRECATED") ""))
  4297. #t))
  4298. (add-before 'configure 'remove-Werror
  4299. (lambda _
  4300. (substitute* '("configure" "src/Makefile.in")
  4301. (("-Werror") ""))
  4302. #t)))))
  4303. (home-page "http://www.linuxhardware.org/xsensors/")
  4304. (synopsis "Hardware health information viewer")
  4305. (description
  4306. "Xsensors reads data from the libsensors library regarding hardware
  4307. health such as temperature, voltage and fan speed and displays the information
  4308. in a digital read-out.")
  4309. (license license:gpl2+)))
  4310. (define-public perf
  4311. (package
  4312. (name "perf")
  4313. (version (package-version linux-libre))
  4314. (source (package-source linux-libre))
  4315. (build-system gnu-build-system)
  4316. (arguments
  4317. '(#:phases
  4318. (modify-phases %standard-phases
  4319. (replace 'configure
  4320. (lambda* (#:key inputs #:allow-other-keys)
  4321. (setenv "SHELL_PATH" (which "bash"))
  4322. (chdir "tools/perf")
  4323. ;; This file hard-codes file system layouts for specific distros
  4324. ;; but not for ours; address that. With this change, one can run
  4325. ;; "perf report --symfs=$HOME/.guix-profile" (without
  4326. ;; "/lib/debug") and 'perf' should be able to find separate debug
  4327. ;; info files.
  4328. (substitute* "util/dso.c"
  4329. (("/usr/lib/debug")
  4330. "/lib/debug")))))
  4331. #:make-flags (list (string-append "prefix="
  4332. (assoc-ref %outputs "out"))
  4333. "CC=gcc"
  4334. "WERROR=0"
  4335. ;; By default, 'config/Makefile' uses lib64 on
  4336. ;; x86_64. Work around that.
  4337. "lib=lib")
  4338. #:tests? #f)) ;no tests
  4339. (native-inputs
  4340. (list pkg-config
  4341. bison
  4342. flex
  4343. ;; There are build scripts written in these languages.
  4344. perl
  4345. python-2
  4346. python-3))
  4347. (inputs
  4348. (list slang ;for the interactive TUI
  4349. ;; newt
  4350. python-2 ;'perf' links against libpython
  4351. elfutils
  4352. libiberty ;used alongside BDF for symbol demangling
  4353. libunwind ;better stack walking
  4354. numactl ;for 'perf bench numa mem'
  4355. ;; Documentation.
  4356. libxml2 ;for $XML_CATALOG_FILES
  4357. docbook-xsl
  4358. xmlto
  4359. asciidoc))
  4360. (home-page "https://perf.wiki.kernel.org/")
  4361. (synopsis "Linux profiling with performance counters")
  4362. (description
  4363. "perf is a tool suite for profiling using hardware performance counters,
  4364. with support in the Linux kernel. perf can instrument CPU performance
  4365. counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
  4366. of lightweight profiling. This package contains the user-land tools and in
  4367. particular the @code{perf} command.")
  4368. (license (package-license linux-libre))))
  4369. (define-public pflask
  4370. (package
  4371. (name "pflask")
  4372. (version "0.2")
  4373. (source (origin
  4374. (method git-fetch)
  4375. (uri (git-reference
  4376. (url "https://github.com/ghedo/pflask")
  4377. (commit (string-append "v" version))))
  4378. (file-name (git-file-name name version))
  4379. (sha256
  4380. (base32
  4381. "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
  4382. (build-system cmake-build-system)
  4383. (arguments
  4384. '(#:tests? #f)) ; no tests
  4385. (home-page "https://ghedo.github.io/pflask/")
  4386. (synopsis "Simple tool for creating Linux namespace containers")
  4387. (description "pflask is a simple tool for creating Linux namespace
  4388. containers. It can be used for running a command or even booting an OS inside
  4389. an isolated container, created with the help of Linux namespaces. It is
  4390. similar in functionality to chroot, although pflask provides better isolation
  4391. thanks to the use of namespaces.")
  4392. (license license:bsd-2)))
  4393. (define-public singularity
  4394. (package
  4395. (name "singularity")
  4396. (version "2.6.1")
  4397. (source (origin
  4398. (method url-fetch)
  4399. (uri (string-append "https://github.com/singularityware/singularity/"
  4400. "releases/download/" version
  4401. "/singularity-" version ".tar.gz"))
  4402. (sha256
  4403. (base32
  4404. "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
  4405. (modules '((guix build utils)))
  4406. (snippet
  4407. '(begin
  4408. ;; Do not create directories in /var.
  4409. (substitute* "Makefile.in"
  4410. (("\\$\\(MAKE\\) .*install-data-hook") ""))
  4411. ;; The original source overrides PATH so that it points to
  4412. ;; /bin, /usr/local/bin, etc., which obviously doesn't work
  4413. ;; on Guix System. Leave PATH unchanged so we refer to the
  4414. ;; installed Coreutils, grep, etc.
  4415. (substitute* "bin/singularity.in"
  4416. (("^PATH=.*" all)
  4417. (string-append "#" all "\n")))
  4418. (substitute* (find-files "libexec/cli" "\\.exec$")
  4419. (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
  4420. _ program)
  4421. (string-append "/run/setuid-programs/singularity-"
  4422. program "-helper")))
  4423. ;; These squashfs mount options are apparently no longer
  4424. ;; supported since Linux-libre 5.4.5.
  4425. (substitute* "src/lib/image/squashfs/mount.c"
  4426. (("\"errors=remount-ro\"")
  4427. "NULL"))
  4428. #t))))
  4429. (build-system gnu-build-system)
  4430. (arguments
  4431. `(#:configure-flags '("--localstatedir=/var")
  4432. #:phases
  4433. (modify-phases %standard-phases
  4434. (add-after 'unpack 'patch-references
  4435. (lambda _
  4436. (substitute* "libexec/cli/build.exec.in"
  4437. (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
  4438. (substitute* (append
  4439. (find-files "libexec" "functions")
  4440. (find-files "libexec/bootstrap-scripts" ".*sh$")
  4441. (find-files "libexec/cli" ".*exec$"))
  4442. (("\\| grep ")
  4443. (string-append "| " (which "grep") " "))
  4444. (("egrep ")
  4445. (string-append (which "egrep") " "))
  4446. ((" sed ")
  4447. (string-append " " (which "sed") " ")))
  4448. #t))
  4449. (add-after 'install 'set-PATH
  4450. (lambda* (#:key inputs outputs #:allow-other-keys)
  4451. ;; Have the 'singularity' and 'run-singularity' self-sufficient.
  4452. (let ((out (assoc-ref outputs "out"))
  4453. (coreutils (assoc-ref inputs "coreutils")))
  4454. (wrap-program (string-append out "/bin/singularity")
  4455. `("PATH" ":" = (,(string-append coreutils "/bin"))))
  4456. (substitute* (string-append out "/bin/run-singularity")
  4457. (("/usr/bin/env singularity")
  4458. (string-append (which "env") " "
  4459. out "/bin/singularity")))
  4460. #t))))))
  4461. (inputs
  4462. `(("libarchive" ,libarchive)
  4463. ("python" ,python-wrapper)
  4464. ("zlib" ,zlib)
  4465. ("squashfs-tools" ,squashfs-tools)))
  4466. (home-page "https://singularity.lbl.gov/")
  4467. (synopsis "Container platform")
  4468. (description "Singularity is a container platform supporting a number of
  4469. container image formats. It can build SquashFS container images or import
  4470. existing Docker images. Singularity requires kernel support for container
  4471. isolation or root privileges.")
  4472. (license license:bsd-3)))
  4473. (define-public hdparm
  4474. (package
  4475. (name "hdparm")
  4476. (version "9.63")
  4477. (source (origin
  4478. (method url-fetch)
  4479. (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
  4480. "hdparm-" version ".tar.gz"))
  4481. (sha256
  4482. (base32
  4483. "14cni5r116k07zqj0565byjhv6gf3ns6hd8jkjl7fn5sxgm5sy3h"))))
  4484. (build-system gnu-build-system)
  4485. (arguments
  4486. (list #:make-flags
  4487. #~(list (string-append "binprefix=" #$output)
  4488. (string-append "manprefix=" #$output)
  4489. (string-append "CC=" #$(cc-for-target))
  4490. ;; Let Guix strip binaries and not break cross-compilation.
  4491. "STRIP=true")
  4492. #:phases
  4493. #~(modify-phases %standard-phases
  4494. (delete 'configure)) ; no configure script
  4495. #:tests? #f)) ; no test suite
  4496. (home-page "https://sourceforge.net/projects/hdparm/")
  4497. (synopsis "View and tune ATA disk drive parameters")
  4498. (description
  4499. "@command{hdparm} is a command-line utility to control ATA controllers and
  4500. disk drives. It can increase performance and/or reliability by careful tuning
  4501. of hardware settings like power and acoustic management, DMA modes, and caching.
  4502. It can also display detailed device information, or be used as a simple
  4503. performance benchmarking tool.
  4504. @command{hdparm} provides a command line interface to various Linux kernel
  4505. interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
  4506. IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
  4507. Translation (@dfn{SAT}) are also supported.")
  4508. (license (license:non-copyleft "file://LICENSE.TXT"))))
  4509. (define-public nvme-cli
  4510. (package
  4511. (name "nvme-cli")
  4512. (version "1.16")
  4513. (home-page "https://github.com/linux-nvme/nvme-cli")
  4514. (source (origin
  4515. (method git-fetch)
  4516. (uri (git-reference
  4517. (url home-page)
  4518. (commit (string-append "v" version))))
  4519. (sha256
  4520. (base32 "130x5cf6kkcnyg5qd35igii249ysfjnbxp1pxfwkickmqg3d007z"))
  4521. (file-name (git-file-name name version))))
  4522. (build-system gnu-build-system)
  4523. (arguments
  4524. (list #:make-flags
  4525. #~(list (string-append "CC=" #$(cc-for-target)))
  4526. #:phases
  4527. #~(modify-phases %standard-phases
  4528. (delete 'configure) ; no ./configure script
  4529. (replace 'install
  4530. (lambda _
  4531. (invoke "make" "install-spec" "PREFIX="
  4532. (string-append "DESTDIR=" #$output)))))
  4533. ;; The tests require sysfs, which is not accessible from from the
  4534. ;; build environment.
  4535. #:tests? #f))
  4536. (synopsis "NVM-Express user space tooling for Linux")
  4537. (description "Nvme-cli is a utility to provide standards compliant tooling
  4538. for NVM-Express drives. It was made specifically for Linux as it relies on the
  4539. IOCTLs defined by the mainline kernel driver.")
  4540. (license license:gpl2+)))
  4541. (define-public rfkill
  4542. (package
  4543. (name "rfkill")
  4544. (version "0.5")
  4545. (source (origin
  4546. (method url-fetch)
  4547. (uri (string-append "mirror://kernel.org/software/network/"
  4548. name "/" name "-" version ".tar.xz"))
  4549. (sha256
  4550. (base32
  4551. "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
  4552. (build-system gnu-build-system)
  4553. (arguments
  4554. `(#:make-flags (list "CC=gcc"
  4555. (string-append "PREFIX=" %output))
  4556. #:phases (modify-phases %standard-phases
  4557. (delete 'configure))
  4558. #:tests? #f))
  4559. (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
  4560. (synopsis "Tool for enabling and disabling wireless devices")
  4561. (description
  4562. "rfkill is a simple tool for accessing the rfkill device interface,
  4563. which is used to enable and disable wireless networking devices, typically
  4564. WLAN, Bluetooth and mobile broadband.")
  4565. (license (license:non-copyleft "file://COPYING"
  4566. "See COPYING in the distribution."))
  4567. ;; rfkill is part of util-linux as of 2.31.
  4568. (properties `((superseded . ,util-linux)))))
  4569. (define-public acpi
  4570. (package
  4571. (name "acpi")
  4572. (version "1.7")
  4573. (source (origin
  4574. (method url-fetch)
  4575. (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
  4576. version "/" name "-" version ".tar.gz"))
  4577. (sha256
  4578. (base32
  4579. "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
  4580. (build-system gnu-build-system)
  4581. (home-page "http://acpiclient.sourceforge.net")
  4582. (synopsis "Display information on ACPI devices")
  4583. (description "@code{acpi} attempts to replicate the functionality of the
  4584. \"old\" @code{apm} command on ACPI systems, including battery and thermal
  4585. information. It does not support ACPI suspending, only displays information
  4586. about ACPI devices.")
  4587. (license license:gpl2+)))
  4588. (define-public acpid
  4589. (package
  4590. (name "acpid")
  4591. (version "2.0.33")
  4592. (source (origin
  4593. (method url-fetch)
  4594. (uri (string-append "mirror://sourceforge/acpid2/acpid-"
  4595. version ".tar.xz"))
  4596. (sha256
  4597. (base32
  4598. "1s6vf8lqwrcqi14k0ww47pk1kifbvxin73ha7mk1njmk7qdzfmh8"))))
  4599. (build-system gnu-build-system)
  4600. (home-page "https://sourceforge.net/projects/acpid2/")
  4601. (synopsis "Daemon for delivering ACPI events to user-space programs")
  4602. (description
  4603. "acpid is designed to notify user-space programs of Advanced
  4604. Configuration and Power Interface (ACPI) events. acpid should be started
  4605. during the system boot, and will run as a background process. When an ACPI
  4606. event is received from the kernel, acpid will examine the list of rules
  4607. specified in /etc/acpi/events and execute the rules that match the event.")
  4608. (license license:gpl2+)))
  4609. (define-public sysfsutils
  4610. (package
  4611. (name "sysfsutils")
  4612. (version "2.1.0")
  4613. (source
  4614. (origin
  4615. (method url-fetch)
  4616. (uri
  4617. (string-append
  4618. "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
  4619. version ".tar.gz"))
  4620. (sha256
  4621. (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
  4622. (build-system gnu-build-system)
  4623. (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
  4624. (synopsis "System utilities based on Linux sysfs")
  4625. (description
  4626. "These are a set of utilities built upon sysfs, a virtual file system in
  4627. Linux kernel versions 2.5+ that exposes a system's device tree. The package
  4628. also contains the libsysfs library.")
  4629. ;; The library is under lgpl2.1+ (all files say "or any later version").
  4630. ;; The rest is mostly gpl2, with a few files indicating gpl2+.
  4631. (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
  4632. (define-public cpufrequtils
  4633. (package
  4634. (name "cpufrequtils")
  4635. (version "008")
  4636. (source
  4637. (origin
  4638. (method url-fetch)
  4639. (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
  4640. "cpufrequtils-" version ".tar.gz"))
  4641. (sha256
  4642. (base32 "0xjs8j44hh0cz6qpig1n0iw8xjpr6s5qmcmwh965ngapxgarr7af"))))
  4643. (build-system gnu-build-system)
  4644. (arguments
  4645. `(#:tests? #f ; no test suite
  4646. #:make-flags
  4647. (let ((out (assoc-ref %outputs "out")))
  4648. (list "PROC=false" ; obsoleted by sysfs in Linux 2.6(!)
  4649. (string-append "CC=" ,(cc-for-target))
  4650. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  4651. "INSTALL=install"
  4652. (string-append "bindir=" out "/bin")
  4653. (string-append "sbindir=" out "/sbin")
  4654. (string-append "mandir=" out "/share/man")
  4655. (string-append "includedir=" out "/include")
  4656. (string-append "libdir=" out "/lib")
  4657. (string-append "localedir=" out "/share/locale")
  4658. (string-append "docdir=" out "/share/doc/" ,name)))
  4659. #:phases
  4660. (modify-phases %standard-phases
  4661. (delete 'configure)))) ; no configure script
  4662. (native-inputs
  4663. `(("gettext" ,gettext-minimal)))
  4664. (home-page
  4665. "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html")
  4666. (synopsis "Utilities to get and set CPU frequency on Linux")
  4667. (description
  4668. "The cpufrequtils suite contains utilities to retrieve CPU frequency
  4669. information, and set the CPU frequency if supported, using the cpufreq
  4670. capabilities of the Linux kernel.")
  4671. (license license:gpl2)))
  4672. (define-public libite
  4673. (package
  4674. (name "libite")
  4675. (version "2.5.1")
  4676. (source
  4677. (origin
  4678. (method git-fetch)
  4679. (uri (git-reference
  4680. (url "https://github.com/troglobit/libite")
  4681. (commit (string-append "v" version))))
  4682. (file-name (git-file-name name version))
  4683. (sha256
  4684. (base32
  4685. "14i0q0nxns6g4zh86zdqy97dwljkqdr5l85ammljzccsrijg9m8v"))))
  4686. (build-system gnu-build-system)
  4687. (arguments
  4688. `(#:phases
  4689. (modify-phases %standard-phases
  4690. (add-after 'unpack 'fix-tests
  4691. (lambda* (#:key inputs #:allow-other-keys)
  4692. ;; replace paths to the executables
  4693. (substitute* "test/which.c"
  4694. (("/usr/bin/which")
  4695. (search-input-file inputs "/bin/which"))
  4696. (("ls\"")
  4697. (string-append
  4698. (search-input-file inputs "/bin/ls") "\"")))
  4699. ;; create pidfile in /tmp instead of /var
  4700. (substitute* "test/pidfile.c" (("/var/tmp") "/tmp")))))))
  4701. (native-inputs (list autoconf automake libtool which))
  4702. (synopsis "Library providing missing pieces in GNU libc")
  4703. (description "This package provides many of the missing pieces in GNU
  4704. libc. Most notably the string functions: strlcpy(3), strlcat(3) and the *BSD
  4705. sys/queue.h and sys/tree.h API's.")
  4706. (home-page "https://troglobit.com/projects/libite/")
  4707. (license license:expat)))
  4708. (define-public libuev
  4709. (package
  4710. (name "libuev")
  4711. (version "2.4.0")
  4712. (source
  4713. (origin
  4714. (method git-fetch)
  4715. (uri (git-reference
  4716. (url "https://github.com/troglobit/libuev")
  4717. (commit (string-append "v" version))))
  4718. (file-name (git-file-name name version))
  4719. (sha256
  4720. (base32
  4721. "0ih82lxfdcq179kknzdl5c8vi1l0n5j7yh68y8f6kwsrm457paf7"))))
  4722. (build-system gnu-build-system)
  4723. (native-inputs (list autoconf automake libtool))
  4724. (synopsis "Lightweight event loop library for epoll family APIs")
  4725. (description "This package provides small event loop that wraps the
  4726. epoll family of APIs.")
  4727. (home-page "https://troglobit.com/projects/libuev/")
  4728. (license license:expat)))
  4729. (define-public libraw1394
  4730. (package
  4731. (name "libraw1394")
  4732. (version "2.1.2")
  4733. (source (origin
  4734. (method url-fetch)
  4735. (uri (string-append
  4736. "mirror://kernel.org/linux/libs/ieee1394/"
  4737. name "-" version ".tar.xz"))
  4738. (sha256
  4739. (base32
  4740. "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
  4741. (build-system gnu-build-system)
  4742. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  4743. (synopsis "Interface library for the Linux IEEE1394 drivers")
  4744. (description
  4745. "Libraw1394 is the only supported interface to the kernel side raw1394 of
  4746. the Linux IEEE-1394 subsystem, which provides direct access to the connected
  4747. 1394 buses to user space. Through libraw1394/raw1394, applications can directly
  4748. send to and receive from other nodes without requiring a kernel driver for the
  4749. protocol in question.")
  4750. (license license:lgpl2.1+)))
  4751. (define-public libavc1394
  4752. (package
  4753. (name "libavc1394")
  4754. (version "0.5.4")
  4755. (source (origin
  4756. (method url-fetch)
  4757. (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
  4758. name "-" version ".tar.gz"))
  4759. (sha256
  4760. (base32
  4761. "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
  4762. (build-system gnu-build-system)
  4763. (native-inputs
  4764. (list pkg-config))
  4765. (propagated-inputs
  4766. (list libraw1394)) ; required by libavc1394.pc
  4767. (home-page "https://sourceforge.net/projects/libavc1394/")
  4768. (synopsis "AV/C protocol library for IEEE 1394")
  4769. (description
  4770. "Libavc1394 is a programming interface to the AV/C specification from
  4771. the 1394 Trade Association. AV/C stands for Audio/Video Control.")
  4772. (license license:lgpl2.1+)))
  4773. (define-public libiec61883
  4774. (package
  4775. (name "libiec61883")
  4776. (version "1.2.0")
  4777. (source (origin
  4778. (method url-fetch)
  4779. (uri (string-append
  4780. "mirror://kernel.org/linux/libs/ieee1394/"
  4781. name "-" version ".tar.xz"))
  4782. (sha256
  4783. (base32
  4784. "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
  4785. (build-system gnu-build-system)
  4786. (native-inputs
  4787. (list pkg-config))
  4788. (propagated-inputs
  4789. (list libraw1394)) ; required by libiec61883.pc
  4790. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  4791. (synopsis "Isochronous streaming media library for IEEE 1394")
  4792. (description
  4793. "The libiec61883 library provides a higher level API for streaming DV,
  4794. MPEG-2 and audio over Linux IEEE 1394.")
  4795. (license license:lgpl2.1+)))
  4796. (define-public mdadm
  4797. (package
  4798. (name "mdadm")
  4799. (version "4.2")
  4800. (source (origin
  4801. (method url-fetch)
  4802. (uri (string-append
  4803. "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
  4804. version ".tar.xz"))
  4805. (sha256
  4806. (base32
  4807. "07ghmibmbnkdy91ng87zdllzicm299l20dhs9m5bfjw6f1b22726"))))
  4808. (build-system gnu-build-system)
  4809. (arguments
  4810. (list #:make-flags
  4811. #~(list (string-append "CC=" #$(cc-for-target))
  4812. "INSTALL=install"
  4813. "CHECK_RUN_DIR=0"
  4814. ;; TODO: tell it where to find 'sendmail'
  4815. ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
  4816. (string-append "BINDIR=" #$output "/sbin")
  4817. (string-append "MANDIR=" #$output "/share/man")
  4818. (string-append "UDEVDIR=" #$output "/lib/udev"))
  4819. #:phases
  4820. #~(modify-phases %standard-phases
  4821. (add-before 'build 'patch-program-paths
  4822. (lambda* (#:key native-inputs inputs #:allow-other-keys)
  4823. (let ((coreutils (assoc-ref (or native-inputs inputs)
  4824. "coreutils")))
  4825. (substitute* "udev-md-raid-arrays.rules"
  4826. (("/usr/bin/(readlink|basename)" all program)
  4827. (string-append coreutils "/bin/" program))))))
  4828. (add-before 'build 'remove-W-error
  4829. (lambda _
  4830. ;; We cannot build with -Werror on i686 due to a
  4831. ;; 'sign-compare' warning in util.c.
  4832. (substitute* "Makefile"
  4833. (("-Werror") ""))))
  4834. (delete 'configure))
  4835. ;; Tests must be run as root.
  4836. #:tests? #f))
  4837. (inputs
  4838. (list eudev))
  4839. (supported-systems (delete "i586-gnu" %supported-systems))
  4840. (home-page "http://neil.brown.name/blog/mdadm")
  4841. (synopsis "Tool for managing Linux Software RAID arrays")
  4842. (description
  4843. "mdadm is a tool for managing Linux Software RAID arrays. It can create,
  4844. assemble, report on, and monitor arrays. It can also move spares between raid
  4845. arrays when needed.")
  4846. (license license:gpl2+)))
  4847. (define-public mdadm-static
  4848. (package
  4849. (inherit mdadm)
  4850. (name "mdadm-static")
  4851. (arguments
  4852. (substitute-keyword-arguments (package-arguments mdadm)
  4853. ((#:make-flags flags)
  4854. #~(cons* "LDFLAGS = -static"
  4855. "CXFLAGS = -DNO_LIBUDEV"
  4856. #$flags))
  4857. ((#:phases phases)
  4858. #~(modify-phases #$phases
  4859. (add-after 'install 'remove-cruft
  4860. (lambda* (#:key outputs #:allow-other-keys)
  4861. (let* ((out (assoc-ref outputs "out"))
  4862. (precious? (lambda (file)
  4863. (member file '("." ".." "sbin"))))
  4864. (directories (scandir out (negate precious?))))
  4865. (with-directory-excursion out
  4866. (for-each delete-file-recursively directories)
  4867. (remove-store-references "sbin/mdadm")
  4868. (delete-file "sbin/mdmon")))))))
  4869. ((#:modules modules %gnu-build-system-modules)
  4870. `((ice-9 ftw) ,@modules))
  4871. ((#:strip-flags _ '())
  4872. ''("--strip-all")) ;strip a few extra KiB
  4873. ((#:allowed-references _ '("out"))
  4874. '("out")))) ;refer only self
  4875. (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
  4876. (define-public multipath-tools
  4877. (package
  4878. (name "multipath-tools")
  4879. (version "0.8.5")
  4880. (source (origin
  4881. (method git-fetch)
  4882. (uri (git-reference
  4883. (url "https://git.opensvc.com/multipath-tools/.git")
  4884. (commit version)))
  4885. (file-name (git-file-name name version))
  4886. (sha256
  4887. (base32
  4888. "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
  4889. (modules '((guix build utils)))
  4890. (snippet
  4891. '(begin
  4892. ;; Drop bundled valgrind headers.
  4893. (delete-file-recursively "third-party")
  4894. (substitute* '("multipathd/main.c"
  4895. "libmultipath/debug.c")
  4896. (("#include \"../third-party/")
  4897. "#include \""))
  4898. #t))))
  4899. (build-system gnu-build-system)
  4900. (arguments
  4901. '(#:test-target "test"
  4902. #:parallel-build? #f ;XXX: broken in 0.8.4
  4903. #:make-flags (list "CC=gcc"
  4904. (string-append "DESTDIR="
  4905. (assoc-ref %outputs "out"))
  4906. ;; Install Udev rules below this directory, relative
  4907. ;; to the prefix.
  4908. "SYSTEMDPATH=lib"
  4909. (string-append "LDFLAGS=-Wl,-rpath="
  4910. (assoc-ref %outputs "out")
  4911. "/lib"))
  4912. #:phases
  4913. (modify-phases %standard-phases
  4914. (add-after 'unpack 'patch-source
  4915. (lambda* (#:key inputs #:allow-other-keys)
  4916. (let ((lvm2 (assoc-ref inputs "lvm2"))
  4917. (udev (assoc-ref inputs "udev")))
  4918. (substitute* "Makefile.inc"
  4919. (("\\$\\(prefix\\)/usr") "$(prefix)")
  4920. ;; Do not save timestamp to avoid gzip "timestamp
  4921. ;; out-of-range" warnings.
  4922. (("gzip -9") "gzip -9n"))
  4923. (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
  4924. (("/usr/include/libdevmapper.h")
  4925. (string-append lvm2 "/include/libdevmapper.h"))
  4926. (("/usr/include/libudev.h")
  4927. (string-append udev "/include/libudev.h")))
  4928. #t)))
  4929. (add-after 'unpack 'fix-maybe-uninitialized-variable
  4930. (lambda _
  4931. ;; This variable gets initialized later if needed, but GCC 7
  4932. ;; fails to notice. Should be fixed for > 0.8.4.
  4933. ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
  4934. (substitute* "libmultipath/structs_vec.c"
  4935. (("bool is_queueing;")
  4936. "bool is_queueing = false;"))
  4937. #t))
  4938. (add-after 'unpack 'fix-linking-tests
  4939. (lambda _
  4940. ;; Add missing linker flag for -lmpathcmd. This should be fixed
  4941. ;; for versions > 0.8.4.
  4942. (substitute* "tests/Makefile"
  4943. (("-lmultipath -lcmocka")
  4944. "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
  4945. #t))
  4946. (add-after 'unpack 'skip-failing-tests
  4947. (lambda _
  4948. ;; This test and the module's setup() test an arbitrary block
  4949. ;; device node name, but the build environment has none.
  4950. (substitute* "tests/devt.c"
  4951. (("return get_one_devt.*") "return 0;\n")
  4952. (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
  4953. ;; The above triggers -Werror=unused-function. Ignore it.
  4954. (substitute* "tests/Makefile"
  4955. (("CFLAGS \\+= " match)
  4956. (string-append match "-Wno-error=unused-function ")))
  4957. #t))
  4958. (delete 'configure)))) ; no configure script
  4959. (native-inputs
  4960. (list perl pkg-config valgrind
  4961. ;; For tests.
  4962. cmocka))
  4963. (inputs
  4964. `(("json-c" ,json-c)
  4965. ("libaio" ,libaio)
  4966. ("liburcu" ,liburcu)
  4967. ("lvm2" ,lvm2)
  4968. ("readline" ,readline)
  4969. ("udev" ,eudev)))
  4970. (home-page "http://christophe.varoqui.free.fr/")
  4971. (synopsis "Access block devices through multiple paths")
  4972. (description
  4973. "This package provides the following binaries to drive the
  4974. Linux Device Mapper multipathing driver:
  4975. @enumerate
  4976. @item @command{multipath} - Device mapper target autoconfig.
  4977. @item @command{multipathd} - Multipath daemon.
  4978. @item @command{mpathpersist} - Manages SCSI persistent reservations on
  4979. @code{dm} multipath devices.
  4980. @item @command{kpartx} - Create device maps from partition tables.
  4981. @end enumerate")
  4982. (license (list license:gpl2+ ; main distribution
  4983. license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
  4984. (define-public libaio
  4985. (package
  4986. (name "libaio")
  4987. (version "0.3.112")
  4988. (source (origin
  4989. (method url-fetch)
  4990. (uri (list
  4991. (string-append "https://releases.pagure.org/libaio/"
  4992. name "-" version ".tar.gz")))
  4993. (sha256
  4994. (base32
  4995. "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
  4996. (build-system gnu-build-system)
  4997. (arguments
  4998. (list #:make-flags
  4999. #~(let ((target #$(%current-target-system)))
  5000. ;; XXX TODO: Replace with simply #$OUTPUT on core-updates.
  5001. (list (string-append "prefix=" #$(if (%current-target-system)
  5002. #~#$output
  5003. #~%output))
  5004. (string-append
  5005. "CC=" (if target
  5006. (string-append (assoc-ref %build-inputs
  5007. "cross-gcc")
  5008. "/bin/" target "-gcc")
  5009. "gcc"))))
  5010. #:test-target "partcheck" ; need root for a full 'check'
  5011. #:phases
  5012. #~(modify-phases %standard-phases
  5013. (delete 'configure) ; no configure script
  5014. ;; TODO: Make this phase unconditional on core-updates.
  5015. #$@(if (target-riscv64?)
  5016. '((add-before 'check 'patch-for-riscv-support
  5017. (lambda _
  5018. ;; Taken from the upstream repo:
  5019. ;; https://pagure.io/libaio/c/f322f467c3cd2ac4d8d08a19bd281eabb65433b1?branch=master
  5020. (substitute* "harness/cases/16.t"
  5021. (("(elif defined\\(__aarch64__\\))" all)
  5022. (string-append all " || defined(__riscv)"))
  5023. (("(endif /* __aarch64__)" all)
  5024. (string-append all " || __riscv "))))))
  5025. '()))))
  5026. (home-page "https://pagure.io/libaio")
  5027. (synopsis "Linux-native asynchronous I/O access library")
  5028. (description
  5029. "This library enables userspace to use Linux kernel asynchronous I/O
  5030. system calls, important for the performance of databases and other advanced
  5031. applications.")
  5032. (license license:lgpl2.1+)))
  5033. (define-public blktrace
  5034. ;; Take a newer commit to get the fix for CVE-2018-10689.
  5035. (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
  5036. (revision "1"))
  5037. (package
  5038. (name "blktrace")
  5039. (version (git-version "1.2.0" revision commit))
  5040. (home-page
  5041. "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
  5042. (source (origin
  5043. (method git-fetch)
  5044. (uri (git-reference
  5045. (url home-page)
  5046. (commit commit)))
  5047. (sha256
  5048. (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
  5049. (file-name (git-file-name name version))))
  5050. (build-system gnu-build-system)
  5051. (arguments
  5052. `(#:make-flags
  5053. (list ,(string-append "CC=" (cc-for-target))
  5054. (string-append "prefix=" %output))
  5055. #:tests? #f ; no tests
  5056. #:phases
  5057. (modify-phases %standard-phases
  5058. (delete 'configure) ; no configure script
  5059. (add-after 'unpack 'fix-gnuplot-path
  5060. (lambda* (#:key inputs #:allow-other-keys)
  5061. (let ((gnuplot (assoc-ref inputs "gnuplot")))
  5062. (substitute* "btt/bno_plot.py"
  5063. (("gnuplot %s")
  5064. (string-append gnuplot "/bin/gnuplot %s")))
  5065. #t))))))
  5066. (inputs
  5067. `(("libaio" ,libaio)
  5068. ("gnuplot" ,gnuplot)
  5069. ("python" ,python-wrapper))) ;for 'bno_plot.py'
  5070. (synopsis "Block layer IO tracing mechanism")
  5071. (description "Blktrace is a block layer IO tracing mechanism which provides
  5072. detailed information about request queue operations to user space. It extracts
  5073. event traces from the kernel (via the relaying through the debug file system).")
  5074. (license license:gpl2))))
  5075. (define-public sbc
  5076. (package
  5077. (name "sbc")
  5078. (version "1.5")
  5079. (source (origin
  5080. (method url-fetch)
  5081. (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
  5082. version ".tar.xz"))
  5083. (patches (search-patches "sbc-fix-build-non-x86.patch"))
  5084. (sha256
  5085. (base32
  5086. "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
  5087. (build-system gnu-build-system)
  5088. (inputs
  5089. (list libsndfile))
  5090. (native-inputs
  5091. (list pkg-config))
  5092. (home-page "https://www.kernel.org/pub/linux/bluetooth/")
  5093. (synopsis "Bluetooth subband audio codec")
  5094. (description
  5095. "The SBC is a digital audio encoder and decoder used to transfer data to
  5096. Bluetooth audio output devices like headphones or loudspeakers.")
  5097. (license license:gpl2+)))
  5098. (define-public bluez
  5099. (package
  5100. (name "bluez")
  5101. (version "5.61")
  5102. (source (origin
  5103. (method url-fetch)
  5104. (uri (string-append
  5105. "mirror://kernel.org/linux/bluetooth/bluez-"
  5106. version ".tar.xz"))
  5107. (sha256
  5108. (base32
  5109. "0fs2kjsdhylxniqhii63i85fjszbqbz3iddwmgz4nmbr472xdbw3"))))
  5110. (build-system gnu-build-system)
  5111. (arguments
  5112. `(#:configure-flags
  5113. (let ((out (assoc-ref %outputs "out")))
  5114. (list "--sysconfdir=/etc"
  5115. "--localstatedir=/var"
  5116. "--enable-library"
  5117. "--disable-systemd"
  5118. ;; TODO: is this needed? Not installed by default since 5.55.
  5119. "--enable-hid2hci"
  5120. ;; Install dbus/udev files to the correct location.
  5121. (string-append "--with-dbusconfdir=" out "/etc")
  5122. (string-append "--with-udevdir=" out "/lib/udev")))
  5123. #:phases
  5124. (modify-phases %standard-phases
  5125. ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
  5126. ;; issue (discussion on upstream mailing list:
  5127. ;; https://marc.info/?t=149578476300002&r=1&w=2)
  5128. (add-before 'check 'skip-wonky-test
  5129. (lambda _
  5130. (substitute* "unit/test-gatt.c"
  5131. (("tester_init\\(&argc, &argv\\);") "return 77;"))
  5132. #t))
  5133. (add-after 'install 'post-install
  5134. (lambda* (#:key inputs outputs #:allow-other-keys)
  5135. (let* ((out (assoc-ref outputs "out"))
  5136. (servicedir (string-append out "/share/dbus-1/services"))
  5137. (service "obexd/src/org.bluez.obex.service")
  5138. (rule (string-append
  5139. out "/lib/udev/rules.d/97-hid2hci.rules")))
  5140. ;; Install the obex dbus service file.
  5141. (substitute* service
  5142. (("/bin/false")
  5143. (string-append out "/libexec/bluetooth/obexd")))
  5144. (install-file service servicedir)
  5145. ;; Fix paths in the udev rule.
  5146. (substitute* rule
  5147. (("hid2hci --method")
  5148. (string-append out "/lib/udev/hid2hci --method"))
  5149. (("/sbin/udevadm")
  5150. (search-input-file inputs "/bin/udevadm")))
  5151. #t))))))
  5152. (native-inputs
  5153. `(("pkg-config" ,pkg-config)
  5154. ("rst2man" ,python-docutils)
  5155. ("gettext" ,gettext-minimal)))
  5156. (inputs
  5157. (list glib dbus eudev libical readline))
  5158. (home-page "http://www.bluez.org/")
  5159. (synopsis "Linux Bluetooth protocol stack")
  5160. (description
  5161. "BlueZ provides support for the core Bluetooth layers and protocols. It
  5162. is flexible, efficient and uses a modular implementation.")
  5163. (license license:gpl2+)))
  5164. (define-public fuse-exfat
  5165. (package
  5166. (name "fuse-exfat")
  5167. (version "1.3.0")
  5168. (source (origin
  5169. (method url-fetch)
  5170. (uri (string-append
  5171. "https://github.com/relan/exfat/releases/download/v"
  5172. version "/" name "-" version ".tar.gz"))
  5173. (sha256
  5174. (base32
  5175. "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
  5176. (build-system gnu-build-system)
  5177. (native-inputs
  5178. (list pkg-config))
  5179. (inputs
  5180. (list fuse))
  5181. (home-page "https://github.com/relan/exfat")
  5182. (synopsis "Mount exFAT file systems")
  5183. (description
  5184. "This package provides a FUSE-based file system that provides read and
  5185. write access to exFAT devices.")
  5186. (license license:gpl2+)))
  5187. (define-public fuseiso
  5188. (package
  5189. (name "fuseiso")
  5190. (version "20070708")
  5191. (source (origin
  5192. (method url-fetch)
  5193. (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
  5194. version "/fuseiso-" version ".tar.bz2"))
  5195. (sha256
  5196. (base32
  5197. "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
  5198. (build-system gnu-build-system)
  5199. (native-inputs
  5200. (list pkg-config))
  5201. (inputs
  5202. (list fuse glib zlib))
  5203. (home-page "https://sourceforge.net/projects/fuseiso/")
  5204. (synopsis "Mount ISO file system images")
  5205. (description
  5206. "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
  5207. .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
  5208. Ridge, Joliet, and zisofs.")
  5209. (license license:gpl2)))
  5210. (define-public gpm
  5211. (package
  5212. (name "gpm")
  5213. (version "1.20.7")
  5214. (source (origin
  5215. (method url-fetch)
  5216. (uri (string-append
  5217. "https://www.nico.schottelius.org/software/gpm/archives/"
  5218. "gpm-" version ".tar.bz2"))
  5219. (patches (search-patches "gpm-glibc-2.26.patch"))
  5220. (sha256
  5221. (base32
  5222. "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))
  5223. (modules '((guix build utils)))
  5224. (snippet
  5225. '(begin
  5226. ;; Take a patch from upstream to fix building with -fno-common,
  5227. ;; which is default in GCC 10:
  5228. ;; https://github.com/telmich/gpm/pull/37
  5229. (substitute* "src/headers/daemon.h"
  5230. (("^time_t[[:blank:]]+last_selection_time;")
  5231. "extern time_t last_selection_time;"))))))
  5232. (build-system gnu-build-system)
  5233. (arguments
  5234. '(#:phases (modify-phases %standard-phases
  5235. (replace 'bootstrap
  5236. (lambda _
  5237. ;; The tarball was not generated with 'make dist' so we
  5238. ;; need to bootstrap things ourselves.
  5239. (substitute* "autogen.sh"
  5240. (("/bin/sh") (which "sh")))
  5241. (invoke "./autogen.sh")
  5242. (patch-makefile-SHELL "Makefile.include.in")
  5243. #t)))
  5244. ;; Make sure programs find libgpm.so.
  5245. #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  5246. (assoc-ref %outputs "out")
  5247. "/lib"))))
  5248. (native-inputs
  5249. (list texinfo
  5250. bison
  5251. flex
  5252. autoconf
  5253. automake
  5254. libtool))
  5255. (home-page "https://www.nico.schottelius.org/software/gpm/")
  5256. (synopsis "Mouse support for the Linux console")
  5257. (description
  5258. "The GPM (general-purpose mouse) daemon is a mouse server for
  5259. applications running on the Linux console. It allows users to select items
  5260. and copy/paste text in the console and in xterm.")
  5261. (license license:gpl2+)))
  5262. (define-public btrfs-progs
  5263. (package
  5264. (name "btrfs-progs")
  5265. (version "5.15.1")
  5266. (source (origin
  5267. (method url-fetch)
  5268. (uri (string-append "mirror://kernel.org/linux/kernel/"
  5269. "people/kdave/btrfs-progs/"
  5270. "btrfs-progs-v" version ".tar.xz"))
  5271. (sha256
  5272. (base32
  5273. "085rg9p7kifhh8kjyyhs38y86srwk820s6v07min5gb177rzhc32"))))
  5274. (build-system gnu-build-system)
  5275. (outputs '("out"
  5276. "static")) ; static versions of the binaries in "out"
  5277. (arguments
  5278. '(#:phases (modify-phases %standard-phases
  5279. (add-after 'unpack 'patch-makefile
  5280. (lambda* (#:key outputs #:allow-other-keys)
  5281. (substitute* "Makefile"
  5282. (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
  5283. (string-append (assoc-ref outputs "out")
  5284. "/lib/udev/rules.d")))))
  5285. (add-after 'build 'build-static
  5286. (lambda _ (invoke "make" "static")))
  5287. (add-after 'install 'install-bash-completion
  5288. (lambda* (#:key outputs #:allow-other-keys)
  5289. (let* ((out (assoc-ref outputs "out"))
  5290. (bashcomp (string-append out "/etc/bash_completion.d")))
  5291. (mkdir-p bashcomp)
  5292. (copy-file "btrfs-completion"
  5293. (string-append bashcomp "/btrfs")))))
  5294. (add-after 'install 'install-static
  5295. (let ((staticbin (string-append (assoc-ref %outputs "static")
  5296. "/bin")))
  5297. (lambda _
  5298. (invoke "make"
  5299. (string-append "bindir=" staticbin)
  5300. "install-static")))))
  5301. #:tests? #f ; XXX: require the 'btrfs' kernel module.
  5302. #:test-target "test"
  5303. #:parallel-tests? #f)) ; tests fail when run in parallel
  5304. (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
  5305. ("lzo" ,lzo)
  5306. ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
  5307. ("util-linux:static" ,util-linux "static") ;ditto
  5308. ("zlib" ,zlib)
  5309. ("zlib:static" ,zlib "static")
  5310. ("zstd" ,zstd "lib")
  5311. ("zstd:static" ,zstd "static")))
  5312. (native-inputs `(("pkg-config" ,pkg-config)
  5313. ("asciidoc" ,asciidoc)
  5314. ("python" ,python)
  5315. ("xmlto" ,xmlto)
  5316. ;; For building documentation.
  5317. ("libxml2" ,libxml2)
  5318. ("docbook-xsl" ,docbook-xsl)
  5319. ;; For tests.
  5320. ("acl" ,acl)
  5321. ("which" ,which)
  5322. ("dmsetup" ,lvm2)
  5323. ("udevadm" ,eudev)
  5324. ;; The tests need 'grep' with perl regexp support.
  5325. ("grep" ,grep)))
  5326. (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
  5327. (synopsis "Create and manage btrfs copy-on-write file systems")
  5328. (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
  5329. aimed at implementing advanced features while focusing on fault tolerance,
  5330. repair and easy administration.")
  5331. ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
  5332. ;; GPL2: Everything else.
  5333. (license (list license:gpl2 license:gpl2+))))
  5334. (define-public btrfs-progs/static
  5335. (package
  5336. (name "btrfs-progs-static")
  5337. (version (package-version btrfs-progs))
  5338. (source #f)
  5339. (build-system trivial-build-system)
  5340. (inputs
  5341. `(("btrfs-progs:static" ,btrfs-progs "static")))
  5342. (arguments
  5343. `(#:modules ((guix build utils))
  5344. #:builder
  5345. (begin
  5346. (use-modules (guix build utils)
  5347. (ice-9 ftw)
  5348. (srfi srfi-26))
  5349. (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
  5350. (out (assoc-ref %outputs "out"))
  5351. (source (string-append btrfs "/bin/btrfs.static"))
  5352. (target (string-append out "/bin/btrfs")))
  5353. (mkdir-p (dirname target))
  5354. (copy-file source target)
  5355. (remove-store-references target)
  5356. (chmod target #o555)
  5357. #t))))
  5358. (home-page (package-home-page btrfs-progs))
  5359. (synopsis "Statically-linked btrfs command from btrfs-progs")
  5360. (description "This package provides the statically-linked @command{btrfs}
  5361. from the btrfs-progs package. It is meant to be used in initrds.")
  5362. (license (package-license btrfs-progs))))
  5363. (define-public cramfs-tools
  5364. (package
  5365. (name "cramfs-tools")
  5366. (home-page "https://github.com/npitre/cramfs-tools")
  5367. (version "2.1")
  5368. (source (origin
  5369. (method git-fetch)
  5370. (uri (git-reference
  5371. (url home-page)
  5372. (commit (string-append "v" version))))
  5373. (sha256
  5374. (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
  5375. (file-name (git-file-name name version))))
  5376. (build-system gnu-build-system)
  5377. (arguments
  5378. '(#:tests? #f ; No tests.
  5379. #:phases
  5380. (modify-phases %standard-phases
  5381. (delete 'configure)
  5382. (replace 'install
  5383. (lambda* (#:key outputs #:allow-other-keys)
  5384. (let ((out (assoc-ref outputs "out")))
  5385. (install-file "mkcramfs" (string-append out "/sbin"))
  5386. (install-file "cramfsck" (string-append out "/sbin")))
  5387. #t)))))
  5388. (inputs
  5389. (list zlib))
  5390. (synopsis "Tools to manage Cramfs file systems")
  5391. (description "Cramfs is a Linux file system designed to be simple, small,
  5392. and to compress things well. It is used on a number of embedded systems and
  5393. small devices. This version has additional features such as uncompressed
  5394. blocks and random block placement.")
  5395. (license license:gpl2+)))
  5396. (define-public compsize
  5397. (package
  5398. (name "compsize")
  5399. (version "1.5")
  5400. (home-page "https://github.com/kilobyte/compsize")
  5401. (source (origin
  5402. (method git-fetch)
  5403. (uri (git-reference
  5404. (url home-page)
  5405. (commit (string-append "v" version))))
  5406. (sha256
  5407. (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
  5408. (file-name (git-file-name name version))))
  5409. (build-system gnu-build-system)
  5410. (inputs
  5411. (list btrfs-progs))
  5412. (arguments
  5413. `(#:tests? #f ; No tests.
  5414. #:make-flags
  5415. (list (string-append "CC=" ,(cc-for-target)))
  5416. #:phases
  5417. (modify-phases %standard-phases
  5418. (delete 'configure)
  5419. (replace 'install
  5420. (lambda* (#:key outputs #:allow-other-keys)
  5421. (let ((out (assoc-ref outputs "out")))
  5422. (install-file "compsize" (string-append out "/bin"))
  5423. (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
  5424. (synopsis "Find compression type/ratio on Btrfs files")
  5425. (description "@command{compsize} takes a list of files (given as
  5426. arguments) on a Btrfs file system and measures used compression types and
  5427. effective compression ratio, producing a report.
  5428. A directory has no extents but has a (recursive) list of files. A non-regular
  5429. file is silently ignored.
  5430. As it makes no sense to talk about compression ratio of a partial extent,
  5431. every referenced extent is counted whole, exactly once -- no matter if you use
  5432. only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
  5433. uncompressed size will not match the number given by @command{tar} or
  5434. @command{du}. On the other hand, the space used should be accurate (although
  5435. obviously it can be shared with files outside our set).")
  5436. (license license:gpl2+)))
  5437. (define-public f2fs-tools-1.7
  5438. (package
  5439. (name "f2fs-tools")
  5440. (version "1.7.0")
  5441. (source (origin
  5442. (method url-fetch)
  5443. (uri (string-append
  5444. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  5445. "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
  5446. (sha256
  5447. (base32
  5448. "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
  5449. (build-system gnu-build-system)
  5450. (arguments
  5451. `(#:configure-flags '("CFLAGS=-fcommon")
  5452. #:phases
  5453. (modify-phases %standard-phases
  5454. (add-after 'install 'install-headers
  5455. (lambda* (#:key outputs #:allow-other-keys)
  5456. (let* ((out (assoc-ref outputs "out"))
  5457. (out-include (string-append out "/include")))
  5458. (install-file "include/f2fs_fs.h" out-include)
  5459. (install-file "mkfs/f2fs_format_utils.h" out-include)
  5460. #t))))))
  5461. (native-inputs
  5462. (list autoconf automake libtool pkg-config))
  5463. (inputs
  5464. `(("libuuid" ,util-linux "lib")
  5465. ("libselinux" ,libselinux)))
  5466. (home-page "https://f2fs.wiki.kernel.org/")
  5467. (synopsis "Userland tools for f2fs")
  5468. (description
  5469. "F2FS, the Flash-Friendly File System, is a modern file system
  5470. designed to be fast and durable on flash devices such as solid-state
  5471. disks and SD cards. This package provides the userland utilities.")
  5472. ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
  5473. ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
  5474. (license (list license:gpl2 license:lgpl2.1))))
  5475. (define-public f2fs-tools
  5476. (package
  5477. (inherit f2fs-tools-1.7)
  5478. (name "f2fs-tools")
  5479. (version "1.14.0")
  5480. (source (origin
  5481. (method url-fetch)
  5482. (uri (string-append
  5483. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  5484. "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
  5485. (sha256
  5486. (base32
  5487. "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
  5488. (inputs
  5489. `(("libuuid" ,util-linux "lib")))))
  5490. (define-public f2fs-tools/static
  5491. (static-package
  5492. (package
  5493. (inherit f2fs-tools)
  5494. (name "f2fs-tools-static")
  5495. (arguments
  5496. `(#:configure-flags
  5497. (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
  5498. (libuuid (assoc-ref %build-inputs "libuuid")))
  5499. (list
  5500. (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
  5501. (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
  5502. (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
  5503. "-I" libuuid "/include/blkid")
  5504. (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
  5505. #:disallowed-references (,util-linux)
  5506. #:phases
  5507. (modify-phases %standard-phases ; TODO: f2fs phases.
  5508. (add-after 'unpack 'make-static
  5509. (lambda _
  5510. (define (append-to-file name body)
  5511. (let ((file (open-file name "a")))
  5512. (display body file)
  5513. (close-port file)))
  5514. (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
  5515. (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
  5516. (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
  5517. #t))
  5518. (add-after 'install 'remove-store-references
  5519. (lambda* (#:key outputs #:allow-other-keys)
  5520. ;; Work around bug in our util-linux.
  5521. ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
  5522. (remove-store-references (string-append (assoc-ref outputs "out")
  5523. "/sbin/mkfs.f2fs"))
  5524. #t)))))
  5525. (inputs
  5526. `(("libuuid:static" ,util-linux "static")
  5527. ("libuuid" ,util-linux "lib")))))) ; for include files
  5528. (define-public f2fs-fsck/static
  5529. (package
  5530. (name "f2fs-fsck-static")
  5531. (version (package-version f2fs-tools/static))
  5532. (source #f)
  5533. (build-system trivial-build-system)
  5534. (arguments
  5535. `(#:modules ((guix build utils))
  5536. #:builder
  5537. (begin
  5538. (use-modules (guix build utils)
  5539. (ice-9 ftw)
  5540. (srfi srfi-26))
  5541. (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
  5542. (fsck "fsck.f2fs")
  5543. (out (assoc-ref %outputs "out"))
  5544. (sbin (string-append out "/sbin")))
  5545. (mkdir-p sbin)
  5546. (with-directory-excursion sbin
  5547. (install-file (string-append f2fs-tools "/sbin/" fsck)
  5548. ".")
  5549. (remove-store-references fsck)
  5550. (chmod fsck #o555))
  5551. #t))))
  5552. (inputs
  5553. (list f2fs-tools/static))
  5554. (home-page (package-home-page f2fs-tools/static))
  5555. (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
  5556. (description "This package provides statically-linked fsck.f2fs command taken
  5557. from the f2fs-tools package. It is meant to be used in initrds.")
  5558. (license (package-license f2fs-tools/static))))
  5559. (define-public freefall
  5560. (package
  5561. (name "freefall")
  5562. (version (package-version linux-libre))
  5563. (source (package-source linux-libre))
  5564. (build-system gnu-build-system)
  5565. (arguments
  5566. '(#:phases (modify-phases %standard-phases
  5567. (add-after 'unpack 'enter-subdirectory
  5568. (lambda _
  5569. (chdir "tools/laptop/freefall")
  5570. #t))
  5571. (delete 'configure)
  5572. (add-before 'build 'increase-timeout
  5573. (lambda _
  5574. ;; The default of 2 seconds is too low: it assumes an
  5575. ;; open lid and AC power without actually checking.
  5576. (substitute* "freefall.c"
  5577. (("alarm\\(2\\)") "alarm(5)"))
  5578. #t)))
  5579. #:make-flags (list (string-append "PREFIX="
  5580. (assoc-ref %outputs "out"))
  5581. "CC=gcc")
  5582. #:tests? #f)) ;no tests
  5583. (home-page (package-home-page linux-libre))
  5584. (synopsis "Free-fall protection for spinning laptop hard drives")
  5585. (description
  5586. "Prevents shock damage to the internal spinning hard drive(s) of some
  5587. HP and Dell laptops. When sudden movement is detected, all input/output
  5588. operations on the drive are suspended and its heads are parked on the ramp,
  5589. where they are less likely to cause damage to the spinning disc. Requires a
  5590. drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
  5591. feature, and a laptop with an accelerometer. It has no effect on SSDs.")
  5592. (license license:gpl2)))
  5593. (define-public thinkfan
  5594. (package
  5595. (name "thinkfan")
  5596. (version "1.3.1")
  5597. (source
  5598. (origin
  5599. (method git-fetch)
  5600. (uri (git-reference
  5601. (url "https://github.com/vmatare/thinkfan")
  5602. (commit version)))
  5603. (file-name (git-file-name name version))
  5604. (sha256
  5605. (base32 "07l7cxbsyvy7awa1zk0zxng60749idvsx3535iginhkqxfzij4b9"))))
  5606. (build-system cmake-build-system)
  5607. (arguments
  5608. (list
  5609. #:modules '((guix build cmake-build-system)
  5610. (guix build utils)
  5611. (srfi srfi-26))
  5612. #:tests? #f ; no test target
  5613. #:configure-flags
  5614. ;; Enable reading temperatures from hard disks via S.M.A.R.T.
  5615. ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
  5616. ;; inefficient’.
  5617. #~(list "-DUSE_ATASMART:BOOL=ON")
  5618. #:phases
  5619. #~(modify-phases %standard-phases
  5620. (add-after 'unpack 'create-init-scripts
  5621. ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
  5622. ;; systemd to patch and install their service files. Fake their
  5623. ;; presence rather than duplicating the build system below. Leave
  5624. ;; things like ‘/bin/kill’ because they're not worth a dependency.
  5625. ;; The sysvinit needs manual patching, but since upstream doesn't
  5626. ;; even provide the option to install it: don't.
  5627. (lambda _
  5628. (substitute* "CMakeLists.txt"
  5629. (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
  5630. (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
  5631. ;; That was easy! Now we just need to fix the destinations.
  5632. (("/etc" directory)
  5633. (string-append #$output directory))))))))
  5634. (native-inputs
  5635. (list pkg-config))
  5636. (inputs
  5637. (list libatasmart yaml-cpp))
  5638. (home-page "https://github.com/vmatare/thinkfan")
  5639. (synopsis "Simple fan control program")
  5640. (description
  5641. "Thinkfan is a simple fan control program. It reads temperatures,
  5642. checks them against configured limits and switches to appropriate (also
  5643. pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
  5644. other @code{hwmon} driver that enables temperature reading and fan control
  5645. from userspace.")
  5646. (license license:gpl3+)))
  5647. (define-public tpacpi-bat
  5648. (package
  5649. (name "tpacpi-bat")
  5650. (version "3.1")
  5651. (source
  5652. (origin
  5653. (method git-fetch)
  5654. (uri (git-reference
  5655. (url "https://github.com/teleshoes/tpacpi-bat")
  5656. (commit (string-append "v" version))))
  5657. (file-name (git-file-name name version))
  5658. (sha256
  5659. (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
  5660. (build-system gnu-build-system)
  5661. (arguments
  5662. `(#:tests? #f ; no test target
  5663. #:phases
  5664. (modify-phases %standard-phases
  5665. (add-after 'unpack 'refer-to-inputs
  5666. (lambda _
  5667. (substitute* "tpacpi-bat"
  5668. (("cat ")
  5669. (format #f "~a " (which "cat")))
  5670. ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
  5671. ;; loaded. That's the administrator's prerogative; disable it.
  5672. (("system \"(modprobe .*)\"" _ match)
  5673. (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
  5674. #t))
  5675. (delete 'configure) ; nothing to configure
  5676. (delete 'build) ; nothing to build
  5677. (replace 'install
  5678. (lambda* (#:key outputs #:allow-other-keys)
  5679. (let* ((out (assoc-ref outputs "out"))
  5680. (bin (string-append out "/bin"))
  5681. (doc (string-append out "/share/doc/" ,name "-" ,version)))
  5682. (install-file "tpacpi-bat" bin)
  5683. ;; There's no man page. Install other forms of documentation.
  5684. (for-each (lambda (file)
  5685. (let ((target (string-append doc "/" file)))
  5686. (mkdir-p (dirname target))
  5687. (copy-recursively file target)))
  5688. (list "battery_asl" "examples" "README.md"))
  5689. #t))))))
  5690. (inputs
  5691. (list perl))
  5692. (home-page "https://github.com/teleshoes/tpacpi-bat")
  5693. (synopsis "ThinkPad battery charge controller")
  5694. (description
  5695. "Tpacpi-bat is a command-line interface to control battery charging on
  5696. @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
  5697. ThinkPad models released after 2011}, starting with the xx20 series. It can
  5698. query and set the thresholds at which one or both batteries will start and stop
  5699. charging, inhibit charging batteries for a set period of time, or force them to
  5700. discharge when they otherwise would not.
  5701. This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
  5702. kernel module provided by the @code{acpi-call-linux-module} package, which must
  5703. be installed and loaded separately. Only the original vendor firmware is
  5704. supported.")
  5705. (license license:gpl3+)))
  5706. (define-public tmon
  5707. (package
  5708. (name "tmon")
  5709. ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
  5710. (version (package-version linux-libre))
  5711. (source (package-source linux-libre))
  5712. (build-system gnu-build-system)
  5713. (arguments
  5714. `(#:tests? #f ; no test suite
  5715. #:make-flags
  5716. (list (string-append "CC=" ,(cc-for-target))
  5717. (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
  5718. "BINDIR=bin")
  5719. #:phases
  5720. (modify-phases %standard-phases
  5721. (add-after 'unpack 'enter-subdirectory
  5722. (lambda _
  5723. (chdir "tools/thermal/tmon")
  5724. #t))
  5725. (add-after 'install 'install-man-page
  5726. (lambda* (#:key outputs #:allow-other-keys)
  5727. (let* ((out (assoc-ref outputs "out"))
  5728. (man8 (string-append out "/share/man/man8")))
  5729. (install-file "tmon.8" man8)
  5730. #t)))
  5731. (delete 'configure)))) ; no configure script
  5732. (inputs
  5733. (list ncurses))
  5734. (home-page (package-home-page linux-libre))
  5735. (synopsis "Monitor and test the Linux thermal subsystem in real time")
  5736. (description
  5737. "Tmon is a tool to interact with the complex thermal subsystem of the
  5738. kernel Linux. It helps visualize thermal relationships and real-time thermal
  5739. data, tune and test cooling devices and sensors, and collect thermal data for
  5740. further analysis.
  5741. As computers become smaller and more thermally constrained, more sensors are
  5742. added and new cooling capabilities introduced. Thermal relationships can change
  5743. dynamically. Their complexity grows exponentially among cooling devices, zones,
  5744. sensors, and trip points.
  5745. Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
  5746. of symbolic links, trip point bindings, and device instances. To traverse it
  5747. by hand is no trivial task: @command{tmon} aims to make it understandable.")
  5748. (license (list license:gpl2 ; the man page
  5749. license:gpl2+)))) ; the actual rest
  5750. (define-public turbostat
  5751. (package
  5752. (name "turbostat")
  5753. ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
  5754. ;; make it harder to benefit from ‘free’ linux-libre package updates.
  5755. (version (package-version linux-libre))
  5756. (source (package-source linux-libre))
  5757. (build-system gnu-build-system)
  5758. (arguments
  5759. `(#:tests? #f ; no test suite
  5760. #:make-flags
  5761. (list (string-append "CC=" ,(cc-for-target))
  5762. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  5763. #:phases
  5764. (modify-phases %standard-phases
  5765. (add-after 'unpack 'enter-subdirectory
  5766. (lambda _
  5767. (chdir "tools/power/x86/turbostat")
  5768. #t))
  5769. (delete 'configure)))) ; no configure script
  5770. (inputs
  5771. (list libcap))
  5772. (supported-systems '("i686-linux" "x86_64-linux"))
  5773. (home-page (package-home-page linux-libre))
  5774. (synopsis "Report x86 processor frequency and idle statistics")
  5775. (description
  5776. "Turbostat reports x86 processor topology, frequency, idle power state
  5777. statistics, temperature, and power consumption. Some information is unavailable
  5778. on older processors.
  5779. It can be used to identify machines that are inefficient in terms of power usage
  5780. or idle time, report the rate of @acronym{SMI, system management interrupt}s
  5781. occurring on the system, or verify the effects of power management tuning.
  5782. @command{turbostat} reads hardware counters but doesn't write to them, so it
  5783. won't interfere with the OS or other running processes---including multiple
  5784. invocations of itself.")
  5785. (license license:gpl2)))
  5786. (define-public ntfs-3g
  5787. (package
  5788. (name "ntfs-3g")
  5789. (version "2021.8.22")
  5790. (source (origin
  5791. (method url-fetch)
  5792. (uri (string-append "https://tuxera.com/opensource/"
  5793. "ntfs-3g_ntfsprogs-" version ".tgz"))
  5794. (sha256
  5795. (base32
  5796. "1yrf42xr92qv3pads8lzp5nyssz6875ncfgg8v3jwjyr0nm87f2m"))
  5797. (modules '((guix build utils)))
  5798. (snippet '(begin
  5799. ;; Install under $prefix.
  5800. (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
  5801. (("/sbin")
  5802. "@sbindir@"))
  5803. #t))))
  5804. (build-system gnu-build-system)
  5805. (inputs (list util-linux ; libuuid
  5806. fuse))
  5807. (native-inputs (list pkg-config))
  5808. (arguments
  5809. '(#:configure-flags (list "--disable-static"
  5810. "--disable-ldconfig" ;not necessary
  5811. "--exec-prefix=${prefix}"
  5812. "--with-fuse=external" ;use our own FUSE
  5813. "--enable-mount-helper"
  5814. "--enable-posix-acls"
  5815. "--enable-xattr-mappings")
  5816. #:phases
  5817. (modify-phases %standard-phases
  5818. ;; If users install ntfs-3g, they probably want to make it the
  5819. ;; default driver as well, so we opt for sensible defaults and link
  5820. ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
  5821. ;; mount NTFS file systems.)
  5822. (add-after 'install 'install-link
  5823. (lambda* (#:key outputs #:allow-other-keys)
  5824. (let* ((out (assoc-ref outputs "out"))
  5825. (sbin (string-append out "/sbin")))
  5826. (symlink "mount.ntfs-3g"
  5827. (string-append sbin "/mount.ntfs")))
  5828. #t)))))
  5829. (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
  5830. (synopsis "Read-write access to NTFS file systems")
  5831. (description
  5832. "NTFS-3G provides read-write access to NTFS file systems, which are
  5833. commonly found on Microsoft Windows. It is implemented as a FUSE file system.
  5834. The package provides additional NTFS tools.")
  5835. (license license:gpl2+)))
  5836. (define-public ntfs-3g/static
  5837. (static-package
  5838. (package
  5839. (inherit ntfs-3g)
  5840. (name "ntfs-3g-static")
  5841. (arguments
  5842. (substitute-keyword-arguments (package-arguments ntfs-3g)
  5843. ((#:configure-flags flags)
  5844. `(append ,flags
  5845. (list "--enable-really-static"
  5846. ;; The FUSE driver isn't currently used by our initrd.
  5847. "--disable-ntfs-3g")))
  5848. ((#:phases phases)
  5849. `(modify-phases ,phases
  5850. (add-after 'unpack 'make-really-static-really-static
  5851. (lambda _
  5852. (substitute* "ntfsprogs/Makefile.in"
  5853. ((" -static") " -all-static"))))
  5854. (delete 'install-link))))))))
  5855. (define-public ntfsfix/static
  5856. (package
  5857. (name "ntfsfix-static")
  5858. (version (package-version ntfs-3g/static))
  5859. (source #f)
  5860. (build-system trivial-build-system)
  5861. (arguments
  5862. `(#:modules ((guix build utils))
  5863. #:builder
  5864. (begin
  5865. (use-modules (guix build utils))
  5866. (let* ((ntfs-3g (assoc-ref %build-inputs "ntfs-3g"))
  5867. (out (assoc-ref %outputs "out"))
  5868. (bin (string-append out "/bin")))
  5869. (install-file (string-append ntfs-3g "/bin/ntfsfix") bin)
  5870. (with-directory-excursion bin
  5871. (remove-store-references "ntfsfix"))))))
  5872. (inputs
  5873. `(("ntfs-3g" ,ntfs-3g/static)))
  5874. (home-page (package-home-page ntfs-3g/static))
  5875. (synopsis "Statically linked @command{ntfsfix} from ntfs-3g")
  5876. (description
  5877. "This package provides a statically linked @command{ntfsfix} taken
  5878. from the ntfs-3g package. It is meant to be used in initrds.")
  5879. (license (package-license ntfs-3g/static))))
  5880. (define-public rdma-core
  5881. (package
  5882. (name "rdma-core")
  5883. (version "33.1")
  5884. (source (origin
  5885. (method url-fetch)
  5886. (uri (string-append "https://github.com/linux-rdma/rdma-core"
  5887. "/releases/download/v" version "/rdma-core-"
  5888. version ".tar.gz"))
  5889. (sha256
  5890. (base32
  5891. "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
  5892. (build-system cmake-build-system)
  5893. (arguments
  5894. `(#:tests? #f ; no tests
  5895. ;; Upstream uses the "ninja" build system and encourage distros
  5896. ;; to do the same for consistency.
  5897. #:configure-flags (list "-GNinja"
  5898. ,@(if (%current-target-system)
  5899. `((string-append
  5900. "-DPKG_CONFIG_EXECUTABLE="
  5901. (search-input-file
  5902. %build-inputs
  5903. (string-append "/bin/"
  5904. ,(pkg-config-for-target)))))
  5905. '())
  5906. (string-append "-DRST2MAN_EXECUTABLE="
  5907. (assoc-ref %build-inputs
  5908. "python-docutils")
  5909. "/bin/rst2man.py"))
  5910. #:phases
  5911. (modify-phases %standard-phases
  5912. (replace 'build
  5913. (lambda _
  5914. (invoke "ninja"
  5915. "-j" (number->string (parallel-job-count)))))
  5916. (replace 'install
  5917. (lambda _
  5918. (invoke "ninja" "install"))))))
  5919. (native-inputs
  5920. `(("ninja" ,ninja)
  5921. ("pkg-config" ,pkg-config)
  5922. ("python" ,python-wrapper)
  5923. ("python-docutils" ,python-docutils))) ;for 'rst2man'
  5924. (inputs
  5925. `(("libnl" ,libnl)
  5926. ("udev" ,eudev)))
  5927. (home-page "https://github.com/linux-rdma/rdma-core")
  5928. (synopsis "Utilities and libraries for working with RDMA devices")
  5929. (description
  5930. "This package provides userspace components for the InfiniBand
  5931. subsystem of the Linux kernel. Specifically it contains userspace
  5932. libraries for the following device nodes:
  5933. @enumerate
  5934. @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
  5935. @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
  5936. @item @file{/dev/infiniband/umadX} (@code{libibumad})
  5937. @end enumerate
  5938. The following service daemons are also provided:
  5939. @enumerate
  5940. @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
  5941. @item @code{iwpmd} (for iWARP kernel providers)
  5942. @item @code{ibacm} (for InfiniBand communication management assistant)
  5943. @end enumerate")
  5944. ;; All library code is dual licensed under GPL2 and a custom MIT
  5945. ;; variant. The package also includes some components covered by
  5946. ;; other licenses. Consult COPYING.md for full details.
  5947. (license
  5948. (list license:gpl2
  5949. (license:x11-style "See COPYING.BSD_MIT in the distribution")
  5950. license:bsd-2 ; Files referring to COPYING.BSD_FB
  5951. license:cc0 ; most files in ccan/
  5952. license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
  5953. (define-public perftest
  5954. (package
  5955. (name "perftest")
  5956. (version "4.4-0.4")
  5957. (source
  5958. (origin
  5959. (method url-fetch)
  5960. (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
  5961. version "/perftest-" version ".g0927198.tar.gz"))
  5962. (sha256
  5963. (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
  5964. (build-system gnu-build-system)
  5965. (arguments
  5966. `(#:phases
  5967. (modify-phases %standard-phases
  5968. (add-after 'unpack 'patch-header-paths
  5969. (lambda _
  5970. (substitute* '("src/raw_ethernet_fs_rate.c"
  5971. "src/raw_ethernet_resources.c"
  5972. "src/raw_ethernet_resources.h"
  5973. "src/raw_ethernet_send_burst_lat.c"
  5974. "src/raw_ethernet_send_bw.c"
  5975. "src/raw_ethernet_send_lat.c")
  5976. (("/usr/include/netinet/ip.h") "netinet/ip.h"))
  5977. #t)))))
  5978. (inputs (list rdma-core))
  5979. (home-page "https://github.com/linux-rdma/perftest/")
  5980. (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
  5981. (description "This is a collection of tests written over uverbs intended for
  5982. use as a performance micro-benchmark. The tests may be used for hardware or
  5983. software tuning as well as for functional testing.
  5984. The collection contains a set of bandwidth and latency benchmark such as:
  5985. @enumerate
  5986. @item Send - @code{ib_send_bw} and @code{ib_send_lat}
  5987. @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
  5988. @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
  5989. @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
  5990. @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
  5991. @end enumerate")
  5992. (license license:gpl2)))
  5993. (define-public rng-tools
  5994. (package
  5995. (name "rng-tools")
  5996. (home-page "https://github.com/nhorman/rng-tools")
  5997. (version "6.14")
  5998. (source (origin
  5999. (method git-fetch)
  6000. (uri (git-reference (url home-page)
  6001. (commit (string-append "v" version))))
  6002. (file-name (git-file-name name version))
  6003. (sha256
  6004. (base32
  6005. "1hrbm4y7fbzkg5j2f7vpj19ri2ff2lp77al17fhi4mv0bvdfjd9m"))))
  6006. (build-system gnu-build-system)
  6007. (arguments
  6008. `(;; Disable support for various hardware entropy sources as they need
  6009. ;; dependencies that are not yet in Guix, and would significantly
  6010. ;; increase closure size.
  6011. #:configure-flags '("--without-nistbeacon"
  6012. "--without-pkcs11"
  6013. "--without-rtlsdr")))
  6014. (native-inputs
  6015. (list autoconf automake pkg-config))
  6016. (inputs
  6017. `(("libsysfs" ,sysfsutils)
  6018. ("openssl" ,openssl)))
  6019. (synopsis "Random number generator daemon")
  6020. (description
  6021. "Monitor a hardware random number generator, and supply entropy
  6022. from that to the system kernel's @file{/dev/random} machinery.")
  6023. ;; The source package is offered under the GPL2+, but the files
  6024. ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
  6025. (license (list license:gpl2 license:gpl2+))))
  6026. (define-public cpupower
  6027. (package
  6028. (name "cpupower")
  6029. (version (package-version linux-libre))
  6030. (source (package-source linux-libre))
  6031. (build-system gnu-build-system)
  6032. (arguments
  6033. '(#:phases (modify-phases %standard-phases
  6034. (add-after 'unpack 'enter-subdirectory
  6035. (lambda _
  6036. (chdir "tools/power/cpupower")
  6037. #t))
  6038. (delete 'configure)
  6039. (add-before 'build 'fix-makefiles
  6040. (lambda _
  6041. (substitute* "Makefile"
  6042. (("/usr/") "/")
  6043. (("/bin/(install|pwd)" _ command) command))
  6044. (substitute* "bench/Makefile"
  6045. (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
  6046. #t)))
  6047. #:make-flags (let ((out (assoc-ref %outputs "out")))
  6048. (list (string-append "DESTDIR=" out)
  6049. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  6050. "libdir=/lib"
  6051. "docdir=/share/doc/cpupower"
  6052. "confdir=$(docdir)/examples"
  6053. ;; The Makefile recommends the following changes
  6054. "DEBUG=false"
  6055. "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
  6056. #:tests? #f)) ;no tests
  6057. (native-inputs `(("gettext" ,gettext-minimal)))
  6058. (inputs (list pciutils))
  6059. (home-page (package-home-page linux-libre))
  6060. (synopsis "CPU frequency and voltage scaling tools for Linux")
  6061. (description
  6062. "cpupower is a set of user-space tools that use the cpufreq feature of the
  6063. Linux kernel to retrieve and control processor features related to power saving,
  6064. such as frequency and voltage scaling.")
  6065. (license license:gpl2)))
  6066. (define-public x86-energy-perf-policy
  6067. (package
  6068. (name "x86-energy-perf-policy")
  6069. (version (package-version linux-libre))
  6070. (source (package-source linux-libre))
  6071. (build-system gnu-build-system)
  6072. (arguments
  6073. '(#:tests? #f
  6074. #:phases
  6075. (modify-phases %standard-phases
  6076. (add-after 'unpack 'enter-subdirectory
  6077. (lambda _
  6078. (chdir "tools/power/x86/x86_energy_perf_policy")
  6079. #t))
  6080. (delete 'configure)
  6081. (add-before 'build 'fix-makefile
  6082. (lambda _
  6083. (substitute* "Makefile" (("/usr") ""))
  6084. #t)))
  6085. #:make-flags
  6086. (let ((out (assoc-ref %outputs "out")))
  6087. (list (string-append "DESTDIR=" out)
  6088. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
  6089. (supported-systems '("i686-linux" "x86_64-linux"))
  6090. (home-page (package-home-page linux-libre))
  6091. (synopsis "Display and update Intel-CPU energy-performance policy")
  6092. (description
  6093. "@command{x86_energy_perf_policy} displays and updates energy-performance
  6094. policy settings specific to Intel Architecture Processors. Settings are
  6095. accessed via Model Specific Register (MSR) updates, no matter if the Linux
  6096. cpufreq sub-system is enabled or not.")
  6097. (license license:gpl2)))
  6098. (define-public haveged
  6099. (package
  6100. (name "haveged")
  6101. (version "1.9.17")
  6102. (source
  6103. (origin
  6104. (method git-fetch)
  6105. (uri (git-reference
  6106. (url "https://github.com/jirka-h/haveged")
  6107. (commit (string-append "v" version))))
  6108. (file-name (git-file-name name version))
  6109. (sha256
  6110. (base32 "119iy8qrvdjkfwnzn1nfjzh2bbihb1vl44qhd6yzzcacjm6pwndr"))))
  6111. (build-system gnu-build-system)
  6112. (arguments
  6113. `(#:configure-flags
  6114. (list "--disable-static")))
  6115. (home-page "https://www.issihosts.com/haveged")
  6116. (synopsis "Entropy source for the Linux random number generator")
  6117. (description
  6118. "haveged generates an unpredictable stream of random numbers for use by
  6119. Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
  6120. standard mechanisms for filling the entropy pool may not be sufficient for
  6121. systems with high needs or limited user interaction, such as headless servers.
  6122. @command{haveged} runs as a privileged daemon, harvesting randomness from the
  6123. indirect effects of hardware events on hidden processor state using the
  6124. @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
  6125. It tunes itself to its environment and provides the same built-in test suite
  6126. for the output stream as used on certified hardware security devices.
  6127. The quality of the randomness produced by this algorithm has not been proven.
  6128. It is recommended to run it together with another entropy source like rngd, and
  6129. not as a replacement for it.")
  6130. (license (list (license:non-copyleft "file://nist/mconf.h")
  6131. (license:non-copyleft "file://nist/packtest.c")
  6132. license:public-domain ; nist/dfft.c
  6133. license:gpl3+)))) ; everything else
  6134. (define-public ecryptfs-utils
  6135. (package
  6136. (name "ecryptfs-utils")
  6137. (version "111")
  6138. (source
  6139. (origin
  6140. (method url-fetch)
  6141. (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
  6142. version "/+download/ecryptfs-utils_"
  6143. version ".orig.tar.gz"))
  6144. (sha256
  6145. (base32
  6146. "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
  6147. (build-system gnu-build-system)
  6148. (arguments
  6149. `(#:configure-flags (list "--disable-pywrap")
  6150. #:phases
  6151. (modify-phases %standard-phases
  6152. (add-after 'patch-source-shebangs 'patch-hardcoded-paths
  6153. (lambda* (#:key inputs outputs #:allow-other-keys)
  6154. (let ((out (assoc-ref outputs "out"))
  6155. (utils-linux (assoc-ref inputs "utils-linux"))
  6156. (cryptsetup (assoc-ref inputs "cryptsetup"))
  6157. (linux-pam (assoc-ref inputs "linux-pam"))
  6158. (lvm2 (assoc-ref inputs "lvm2")))
  6159. (substitute* '("src/utils/ecryptfs-mount-private"
  6160. "src/utils/ecryptfs-umount-private"
  6161. "src/utils/ecryptfs-setup-private"
  6162. "src/utils/ecryptfs-setup-swap"
  6163. "src/utils/mount.ecryptfs.c"
  6164. "src/utils/umount.ecryptfs.c"
  6165. "src/pam_ecryptfs/pam_ecryptfs.c"
  6166. "src/desktop/ecryptfs-mount-private.desktop.in"
  6167. "src/desktop/ecryptfs-setup-private.desktop.in")
  6168. (("/bin/mount")
  6169. (string-append utils-linux "/bin/mount"))
  6170. (("/bin/umount")
  6171. (string-append utils-linux "/bin/umount"))
  6172. (("/sbin/mount.ecryptfs_private")
  6173. (string-append out "/sbin/mount.ecryptfs_private"))
  6174. (("/sbin/umount.ecryptfs_private")
  6175. (string-append out "/sbin/umount.ecryptfs_private"))
  6176. (("/usr/bin/ecryptfs-mount-private")
  6177. (string-append out "/bin/ecryptfs-mount-private"))
  6178. (("/usr/bin/ecryptfs-rewrite-file")
  6179. (string-append out "/bin/ecryptfs-rewrite-file"))
  6180. (("/usr/bin/ecryptfs-setup-private")
  6181. (string-append out "/bin/ecryptfs-setup-private"))
  6182. (("/sbin/cryptsetup")
  6183. (string-append cryptsetup "/sbin/cryptsetup"))
  6184. (("/sbin/unix_chkpwd")
  6185. (string-append linux-pam "/sbin/unix_chkpwd"))
  6186. (("/sbin/dmsetup")
  6187. (string-append lvm2 "/sbin/dmsetup")))))))))
  6188. (native-inputs
  6189. (list intltool perl ; for pod2man
  6190. pkg-config))
  6191. (inputs
  6192. `(("keyutils" ,keyutils)
  6193. ("linux-pam" ,linux-pam)
  6194. ("utils-linux" ,util-linux)
  6195. ("cryptsetup" ,cryptsetup)
  6196. ("lvm2" ,lvm2)
  6197. ("nss" ,nss)))
  6198. (home-page "https://ecryptfs.org/")
  6199. (synopsis "eCryptfs cryptographic file system utilities")
  6200. (description
  6201. "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
  6202. Each file's cryptographic meta-data is stored inside the file itself, along
  6203. with the encrypted contents. This allows individual encrypted files to be
  6204. copied between hosts and still be decrypted with the proper key. eCryptfs is a
  6205. native Linux file system, and has been part of the Linux kernel since version
  6206. 2.6.19. This package contains the userland utilities to manage it.")
  6207. ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
  6208. ;; grant additional permission to link with OpenSSL.
  6209. (license license:gpl2+)))
  6210. (define-public libnfsidmap
  6211. (package
  6212. (name "libnfsidmap")
  6213. (version "0.27")
  6214. (source
  6215. (origin
  6216. (method url-fetch)
  6217. (uri (string-append "https://fedorapeople.org/~steved/"
  6218. name "/" version "/" name "-" version ".tar.bz2"))
  6219. (sha256
  6220. (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
  6221. (build-system gnu-build-system)
  6222. (arguments
  6223. `(#:configure-flags (list
  6224. (string-append "--with-pluginpath="
  6225. (assoc-ref %outputs "out")
  6226. "/lib/libnfsidmap"))))
  6227. (native-inputs
  6228. (list autoconf)) ; 0.27 still needs autoheader
  6229. (home-page
  6230. "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
  6231. (synopsis "NFSv4 support library for name/ID mapping")
  6232. (description "Libnfsidmap is a library holding mulitiple methods of
  6233. mapping names to ids and visa versa, mainly for NFSv4. It provides an
  6234. extensible array of mapping functions, currently consisting of two choices:
  6235. the default @code{nsswitch} and the experimental @code{umich_ldap}.")
  6236. (license (license:non-copyleft "file://COPYING"
  6237. "See COPYING in the distribution."))))
  6238. (define-public module-init-tools
  6239. (package
  6240. (name "module-init-tools")
  6241. (version "3.16")
  6242. (source (origin
  6243. (method url-fetch)
  6244. (uri (string-append
  6245. "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
  6246. "module-init-tools-" version ".tar.bz2"))
  6247. (sha256
  6248. (base32
  6249. "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
  6250. (patches (search-patches "module-init-tools-moduledir.patch"))))
  6251. (build-system gnu-build-system)
  6252. (arguments
  6253. ;; FIXME: The upstream tarball lacks man pages, and building them would
  6254. ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
  6255. ;; but they vanished. In the meantime, fake it.
  6256. '(#:phases
  6257. (modify-phases %standard-phases
  6258. (add-before 'configure 'fake-docbook
  6259. (lambda _
  6260. (substitute* "Makefile.in"
  6261. (("^DOCBOOKTOMAN.*$")
  6262. "DOCBOOKTOMAN = true\n"))
  6263. #t)))))
  6264. (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
  6265. (synopsis "Tools for loading and managing Linux kernel modules")
  6266. (description
  6267. "Tools for loading and managing Linux kernel modules, such as
  6268. @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
  6269. (license license:gpl2+)))
  6270. (define-public mcelog
  6271. (package
  6272. (name "mcelog")
  6273. (version "180")
  6274. (source
  6275. (origin
  6276. (method git-fetch)
  6277. (uri (git-reference
  6278. (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
  6279. (commit (string-append "v" version))))
  6280. (file-name (git-file-name name version))
  6281. (sha256
  6282. (base32 "1xy1082c67yd48idg5vwvrw7yx74gn6jj2d9c67d0rh6yji091ki"))
  6283. (modules '((guix build utils)))
  6284. (snippet
  6285. `(begin
  6286. ;; The checkout lacks a .git directory, breaking ‘git describe’.
  6287. (substitute* "Makefile"
  6288. (("\"unknown\"") (string-append "\"v" ,version "\"")))))))
  6289. (build-system gnu-build-system)
  6290. (arguments
  6291. `(#:phases (modify-phases %standard-phases
  6292. (delete 'configure)) ; no configure script
  6293. #:make-flags (let ((out (assoc-ref %outputs "out")))
  6294. (list (string-append "CC=" ,(cc-for-target))
  6295. (string-append "prefix=" out)
  6296. (string-append "DOCDIR=" out "/share/doc/"
  6297. ,name "-" ,version)
  6298. "etcprefix=$(DOCDIR)/examples"))
  6299. ;; The tests will only run as root on certain supported CPU models.
  6300. #:tests? #f))
  6301. (native-inputs
  6302. (list python-wrapper)) ; to generate example mcelog.conf
  6303. (supported-systems (list "i686-linux" "x86_64-linux"))
  6304. (home-page "https://mcelog.org/")
  6305. (synopsis "Machine check monitor for x86 Linux systems")
  6306. (description
  6307. "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
  6308. systems running the kernel Linux. It can also perform user-defined tasks, such
  6309. as bringing bad pages off-line, when configurable error thresholds are
  6310. exceeded.")
  6311. (license license:gpl2)))
  6312. (define-public mtd-utils
  6313. (package
  6314. (name "mtd-utils")
  6315. (version "2.1.2")
  6316. (source (origin
  6317. (method url-fetch)
  6318. (uri (string-append
  6319. "ftp://ftp.infradead.org/pub/mtd-utils/"
  6320. "mtd-utils-" version ".tar.bz2"))
  6321. (sha256
  6322. (base32
  6323. "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
  6324. (arguments
  6325. (list #:configure-flags
  6326. (if (%current-target-system) ; When cross-compiling.
  6327. #~(list)
  6328. #~(list "--enable-unit-tests"))))
  6329. (native-inputs
  6330. (list cmocka pkg-config))
  6331. (inputs
  6332. `(("acl" ,acl) ; extended attributes (xattr)
  6333. ("libuuid" ,util-linux "lib")
  6334. ("lzo" ,lzo)
  6335. ("openssl" ,openssl) ; optional crypto support
  6336. ("zlib" ,zlib)
  6337. ("zstd" ,zstd "lib")))
  6338. (build-system gnu-build-system)
  6339. (synopsis "MTD Flash Storage Utilities")
  6340. (description "This package provides utilities for testing, partitioning, etc
  6341. of flash storage.")
  6342. (home-page "http://www.linux-mtd.infradead.org/")
  6343. (license
  6344. (list license:gpl2 ; Almost everything is gpl2 or gpl2+
  6345. license:mpl1.1 ; All ftl* files
  6346. license:expat)))) ; libiniparser
  6347. (define-public libseccomp
  6348. (package
  6349. (name "libseccomp")
  6350. (version "2.5.3")
  6351. (source (origin
  6352. (method url-fetch)
  6353. (uri (string-append "https://github.com/seccomp/libseccomp/"
  6354. "releases/download/v" version
  6355. "/libseccomp-" version ".tar.gz"))
  6356. (sha256
  6357. (base32
  6358. "0xhan73zn4p0n7s8vx6s47wjmidvk4x8r90vfbljairn6f3mq1jr"))))
  6359. (build-system gnu-build-system)
  6360. (arguments
  6361. '(#:configure-flags '("--disable-static")
  6362. #:phases (modify-phases %standard-phases
  6363. (add-before 'check 'skip-load-test
  6364. (lambda _
  6365. ;; This test does a native system call and fails when
  6366. ;; run under QEMU user-mode emulation. Just skip it.
  6367. (delete-file "tests/52-basic-load.tests"))))))
  6368. (native-inputs
  6369. (list gperf which))
  6370. (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
  6371. (description "The libseccomp library provides an easy to use, platform
  6372. independent, interface to the Linux Kernel's syscall filtering mechanism. The
  6373. libseccomp API is designed to abstract away the underlying BPF based syscall
  6374. filter language and present a more conventional function-call based filtering
  6375. interface that should be familiar to, and easily adopted by, application
  6376. developers.")
  6377. (home-page "https://github.com/seccomp/libseccomp")
  6378. (license license:lgpl2.1)))
  6379. (define-public radeontop
  6380. (package
  6381. (name "radeontop")
  6382. (version "1.4")
  6383. (source
  6384. (origin
  6385. (method git-fetch)
  6386. (uri (git-reference
  6387. (url "https://github.com/clbr/radeontop")
  6388. (commit (string-append "v" version))))
  6389. (file-name (git-file-name name version))
  6390. (sha256
  6391. (base32 "0kwqddidr45s1blp0h8r8h1dd1p50l516yb6mb4s6zsc827xzgg3"))))
  6392. (build-system gnu-build-system)
  6393. (arguments
  6394. `(#:phases (modify-phases %standard-phases
  6395. ;; getver.sh uses ‘git --describe’, isn't worth an extra git
  6396. ;; dependency, and doesn't even work on release(!) tarballs.
  6397. (add-after 'unpack 'report-correct-version
  6398. (lambda _
  6399. (substitute* "getver.sh"
  6400. (("ver=unknown")
  6401. (string-append "ver=" ,version)))))
  6402. (delete 'configure)) ; no configure script
  6403. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  6404. (string-append "PREFIX=" %output))
  6405. #:tests? #f)) ; no tests
  6406. (native-inputs
  6407. `(("gettext" ,gettext-minimal)
  6408. ("pkg-config" ,pkg-config)))
  6409. (inputs
  6410. (list libdrm libpciaccess libxcb ncurses))
  6411. (home-page "https://github.com/clbr/radeontop/")
  6412. (synopsis "Usage monitor for AMD Radeon graphics")
  6413. (description "RadeonTop monitors resource consumption on supported AMD
  6414. Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
  6415. a terminal or saved to a file for further processing. It measures both the
  6416. activity of the GPU as a whole, which is also accurate during OpenCL
  6417. computations, as well as separate component statistics that are only meaningful
  6418. under OpenGL graphics workloads.")
  6419. (license license:gpl3)))
  6420. (define-public efivar
  6421. (package
  6422. (name "efivar")
  6423. (version "38")
  6424. (source (origin
  6425. (method url-fetch)
  6426. (uri (string-append "https://github.com/rhboot/" name
  6427. "/releases/download/" version "/" name
  6428. "-" version ".tar.bz2"))
  6429. (sha256
  6430. (base32
  6431. "0jaka7b4lccswjqiv4liclkj6w78gildg7vd6dnw3wf595pfs67h"))))
  6432. (build-system gnu-build-system)
  6433. (arguments
  6434. (list
  6435. ;; Tests require a UEFI system and is not detected in the chroot.
  6436. #:tests? #f
  6437. #:make-flags
  6438. #~(list (string-append "prefix=" #$output)
  6439. (string-append "libdir=" #$output "/lib")
  6440. (string-append "CC_FOR_BUILD=" #$(cc-for-target))
  6441. (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
  6442. #:phases
  6443. #~(modify-phases %standard-phases
  6444. (add-after 'unpack 'build-deterministically
  6445. (lambda _
  6446. (substitute* "src/include/defaults.mk"
  6447. ;; Don't use -march=native.
  6448. (("-march=native")
  6449. ""))))
  6450. (delete 'configure))))
  6451. (native-inputs
  6452. (list mandoc pkg-config))
  6453. (inputs
  6454. (list popt))
  6455. (home-page "https://github.com/rhboot/efivar")
  6456. (synopsis "Tool and library to manipulate EFI variables")
  6457. (description "This package provides a library and a command line
  6458. interface to the variable facility of UEFI boot firmware.")
  6459. (license license:lgpl2.1+)))
  6460. (define-public efibootmgr
  6461. (package
  6462. (name "efibootmgr")
  6463. (version "17")
  6464. (source
  6465. (origin
  6466. (method git-fetch)
  6467. (uri (git-reference
  6468. (url "https://github.com/rhinstaller/efibootmgr")
  6469. (commit version)))
  6470. (file-name (git-file-name name version))
  6471. (sha256
  6472. (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
  6473. (patches (search-patches "efibootmgr-remove-extra-decl.patch"))
  6474. (modules '((guix build utils)))
  6475. (snippet
  6476. '(begin
  6477. ;; Cast the first argument to the correct type. Extracted
  6478. ;; from upstream commit e8ce9fecebd15adb4.
  6479. (substitute* '("src/efibootdump.c" "src/efibootmgr.c")
  6480. (("efidp_format_device_path\\(text_path,")
  6481. "efidp_format_device_path((unsigned char *)text_path,"))))))
  6482. (build-system gnu-build-system)
  6483. (arguments
  6484. (list
  6485. #:tests? #f ;no tests
  6486. #:make-flags #~(list (string-append "prefix=" #$output)
  6487. (string-append "libdir=" #$output "/lib")
  6488. ;; EFIDIR denotes a subdirectory relative to the
  6489. ;; EFI System Partition where the loader will be
  6490. ;; installed (known as OS_VENDOR in the code).
  6491. ;; GRUB overrides this, as such it's only used if
  6492. ;; nothing else is specified on the command line.
  6493. "EFIDIR=gnu")
  6494. #:phases #~(modify-phases %standard-phases (delete 'configure))))
  6495. (native-inputs
  6496. (list pkg-config))
  6497. (inputs
  6498. (list efivar popt))
  6499. (home-page "https://github.com/rhinstaller/efibootmgr")
  6500. (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
  6501. (description
  6502. "@code{efibootmgr} is a user-space application to modify the Intel
  6503. Extensible Firmware Interface (EFI) Boot Manager. This application can
  6504. create and destroy boot entries, change the boot order, change the next
  6505. running boot option, and more.")
  6506. (license license:gpl2+)))
  6507. (define-public sysstat
  6508. (package
  6509. (name "sysstat")
  6510. (version "12.4.4")
  6511. (source
  6512. (origin
  6513. (method url-fetch)
  6514. (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
  6515. "sysstat-" version ".tar.xz"))
  6516. (sha256
  6517. (base32 "091xjip7l52dxal8dsfh5chksr4g9gclnssw3hjjxy84kr3yf4lm"))))
  6518. (build-system gnu-build-system)
  6519. (arguments
  6520. `(#:tests? #f ; no test suite.
  6521. ;; Without this flag, it tries to install the man pages with group 'root'
  6522. ;; and fails because /etc/passwd lacks an entry for the root user.
  6523. #:configure-flags
  6524. (list "--disable-file-attr"
  6525. (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
  6526. #:phases
  6527. (modify-phases %standard-phases
  6528. ;; The build process tries to create '/var/lib/sa', so we skip that
  6529. ;; instruction.
  6530. (add-after 'build 'skip-touching-var
  6531. (lambda _
  6532. (substitute* "Makefile"
  6533. (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
  6534. "")))))))
  6535. (home-page "http://sebastien.godard.pagesperso-orange.fr/")
  6536. (synopsis "Performance monitoring tools for Linux")
  6537. (description "The sysstat utilities are a collection of performance
  6538. monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
  6539. @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
  6540. @code{sadf} and @code{sa}.")
  6541. (license license:gpl2+)))
  6542. (define-public light
  6543. (package
  6544. (name "light")
  6545. (version "1.2.2")
  6546. (source
  6547. (origin
  6548. (method git-fetch)
  6549. (uri (git-reference
  6550. (url "https://github.com/haikarainen/light")
  6551. (commit (string-append "v" version))))
  6552. (sha256
  6553. (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
  6554. (file-name (git-file-name name version))))
  6555. (build-system gnu-build-system)
  6556. (arguments
  6557. `(#:configure-flags '("CFLAGS=-fcommon")
  6558. #:phases
  6559. (modify-phases %standard-phases
  6560. (add-after 'unpack 'patch-udev-rules-absolute-path-bins
  6561. (lambda* (#:key inputs #:allow-other-keys)
  6562. (substitute* "90-backlight.rules"
  6563. (("/bin/chgrp") (which "chgrp"))
  6564. (("/bin/chmod") (which "chmod")))
  6565. #t))
  6566. (add-after 'install 'install-udev-rules
  6567. (lambda* (#:key outputs #:allow-other-keys)
  6568. (let ((out (assoc-ref outputs "out")))
  6569. (install-file
  6570. "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
  6571. #t))))))
  6572. (native-inputs
  6573. (list autoconf automake))
  6574. (home-page "https://haikarainen.github.io/light/")
  6575. (synopsis "GNU/Linux application to control backlights")
  6576. (description
  6577. "Light is a program to send commands to screen backlight controllers
  6578. under GNU/Linux. Features include:
  6579. @itemize
  6580. @item It does not rely on X.
  6581. @item Light can automatically figure out the best controller to use, making
  6582. full use of underlying hardware.
  6583. @item It is possible to set a minimum brightness value, as some controllers
  6584. set the screen to be pitch black at a value of 0 (or higher).
  6585. @end itemize\n")
  6586. (license license:gpl3+)))
  6587. (define-public brightnessctl
  6588. (package
  6589. (name "brightnessctl")
  6590. (version "0.5.1")
  6591. (home-page "https://github.com/Hummer12007/brightnessctl")
  6592. (source (origin
  6593. (method git-fetch)
  6594. (uri (git-reference (url home-page) (commit version)))
  6595. (file-name (git-file-name name version))
  6596. (sha256
  6597. (base32
  6598. "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))
  6599. (patches (search-patches "brightnessctl-elogind-support.patch"))))
  6600. (build-system gnu-build-system)
  6601. (arguments
  6602. `(#:tests? #f ; no tests
  6603. #:make-flags (list (string-append "CC=" ,(cc-for-target))
  6604. (string-append "PREFIX=" %output)
  6605. (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")
  6606. "ENABLE_SYSTEMD=1")
  6607. #:phases
  6608. (modify-phases %standard-phases
  6609. (delete 'configure)
  6610. (add-after 'unpack 'adjust-udev-rules
  6611. (lambda _
  6612. (substitute* "Makefile"
  6613. (("INSTALL_UDEV_RULES=0") "INSTALL_UDEV_RULES=1"))
  6614. (substitute* "90-brightnessctl.rules"
  6615. (("/bin/") "/run/current-system/profile/bin/"))
  6616. #t)))))
  6617. (native-inputs
  6618. (list pkg-config))
  6619. (inputs
  6620. (list elogind))
  6621. (synopsis "Backlight and LED brightness control")
  6622. (description
  6623. "This program allows you read and control device brightness. Devices
  6624. include backlight and LEDs. It can also preserve current brightness before
  6625. applying the operation, such as on lid close.
  6626. The appropriate permissions must be set on the backlight or LED control
  6627. interface in sysfs, which can be accomplished with the included udev rules.")
  6628. (license license:expat)))
  6629. (define-public tlp
  6630. (package
  6631. (name "tlp")
  6632. (version "1.5.0")
  6633. (source
  6634. (origin
  6635. (method git-fetch)
  6636. (uri (git-reference
  6637. (url "https://github.com/linrunner/TLP")
  6638. (commit version)))
  6639. (file-name (git-file-name name version))
  6640. (sha256
  6641. (base32 "0cssclk2brhwvn9dm7h5snm2svwy0c8cfr4z2cgkdkac2pfaaxw4"))))
  6642. (native-inputs
  6643. (list shellcheck))
  6644. (inputs
  6645. `(("bash" ,bash)
  6646. ("dbus" ,dbus)
  6647. ("ethtool" ,ethtool)
  6648. ("eudev" ,eudev)
  6649. ("grep" ,grep)
  6650. ("hdparm" ,hdparm)
  6651. ("inetutils" ,inetutils)
  6652. ("iw" ,iw)
  6653. ("kmod" ,kmod)
  6654. ("pciutils" ,pciutils)
  6655. ("perl" ,perl)
  6656. ("rfkill" ,rfkill)
  6657. ("sed" ,sed)
  6658. ("usbutils" ,usbutils)
  6659. ("util-linux" ,util-linux)
  6660. ("wireless-tools" ,wireless-tools)
  6661. ,@(if (let ((system (or (%current-target-system)
  6662. (%current-system))))
  6663. (or (string-prefix? "i686-" system)
  6664. (string-prefix? "x86_64-" system)))
  6665. `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
  6666. '())))
  6667. (build-system gnu-build-system)
  6668. (arguments
  6669. ;; XXX: The full test suite is run with "checkall" but it requires
  6670. ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
  6671. `(#:test-target "shellcheck"
  6672. #:modules ((guix build gnu-build-system)
  6673. (guix build utils)
  6674. (srfi srfi-1))
  6675. #:phases
  6676. (modify-phases %standard-phases
  6677. (delete 'configure) ; no configure script
  6678. (add-before 'build 'setenv
  6679. (lambda* (#:key outputs #:allow-other-keys)
  6680. (let ((out (assoc-ref outputs "out")))
  6681. (setenv "TLP_WITH_SYSTEMD" "0")
  6682. (setenv "TLP_NO_INIT" "1")
  6683. (setenv "TLP_NO_PMUTILS" "1")
  6684. (setenv "TLP_SBIN" (string-append out "/bin"))
  6685. (setenv "TLP_BATD" (string-append out "/share/tlp/bat.d"))
  6686. (setenv "TLP_BIN" (string-append out "/bin"))
  6687. (setenv "TLP_TLIB" (string-append out "/share/tlp"))
  6688. (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
  6689. (setenv "TLP_ULIB" (string-append out "/lib/udev"))
  6690. (setenv "TLP_CONFDEF"
  6691. (string-append out "/share/tlp/defaults.conf"))
  6692. (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
  6693. (setenv "TLP_CONFREN"
  6694. (string-append out "/share/tlp/rename.conf"))
  6695. (setenv "TLP_ELOD"
  6696. (string-append out "/lib/elogind/system-sleep"))
  6697. (setenv "TLP_SHCPL"
  6698. (string-append out "/share/bash-completion/completions"))
  6699. (setenv "TLP_MAN" (string-append out "/share/man"))
  6700. (setenv "TLP_META" (string-append out "/share/metainfo")))))
  6701. (add-before 'install 'fix-installation
  6702. (lambda _
  6703. ;; Stop the Makefile from trying to create system directories.
  6704. (substitute* "Makefile"
  6705. (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
  6706. (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
  6707. (replace 'install
  6708. (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
  6709. (add-after 'install 'wrap
  6710. (lambda* (#:key inputs outputs #:allow-other-keys)
  6711. (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
  6712. (bin-files (find-files bin ".*")))
  6713. (define (bin-directory input-name)
  6714. (let ((p (assoc-ref inputs input-name)))
  6715. (and p (string-append p "/bin"))))
  6716. (define (sbin-directory input-name)
  6717. (string-append (assoc-ref inputs input-name) "/sbin"))
  6718. (for-each (lambda (program)
  6719. (wrap-program program
  6720. `("PATH" ":" prefix
  6721. ,(append
  6722. (filter-map bin-directory
  6723. '("bash"
  6724. "coreutils"
  6725. "dbus"
  6726. "eudev"
  6727. "grep"
  6728. "inetutils"
  6729. "kmod"
  6730. "perl"
  6731. "sed"
  6732. "usbutils"
  6733. "util-linux"
  6734. "x86-energy-perf-policy"))
  6735. (filter-map sbin-directory
  6736. '("ethtool"
  6737. "hdparm"
  6738. "iw"
  6739. "pciutils"
  6740. "rfkill"
  6741. "wireless-tools"))))))
  6742. bin-files)))))))
  6743. (home-page "https://linrunner.de/en/tlp/tlp.html")
  6744. (synopsis "Power management tool for Linux")
  6745. (description "TLP is a power management tool for Linux. It comes with
  6746. a default configuration already optimized for battery life. Nevertheless,
  6747. TLP is customizable to fulfil system requirements. TLP settings are applied
  6748. every time the power supply source is changed.")
  6749. ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
  6750. ;; rest is GPLv2+.
  6751. (license (list license:gpl2+ license:gpl3+))))
  6752. (define-public tlpui
  6753. (package
  6754. (name "tlpui")
  6755. (version "1.5.0")
  6756. (source
  6757. (origin
  6758. (method git-fetch)
  6759. (uri (git-reference
  6760. (url "https://github.com/d4nj1/TLPUI")
  6761. (commit (string-append "tlpui-" version))))
  6762. (file-name (git-file-name name version))
  6763. (sha256
  6764. (base32 "0ca18hazxksx516nkh28f6rd0l1039nkn7mszqfy68c461061q1h"))))
  6765. (build-system python-build-system)
  6766. (arguments
  6767. `(#:phases
  6768. (modify-phases %standard-phases
  6769. (add-after 'unpack 'patch-setup.py
  6770. ;; Install data_files to $out/share instead of /usr/share.
  6771. (lambda _
  6772. (substitute* "setup.py"
  6773. (("/usr/") ""))))
  6774. (add-after 'unpack 'use-tlp-input
  6775. ;; Hard-code tlp-stat filename to avoid propagating "tlp".
  6776. (lambda* (#:key inputs #:allow-other-keys)
  6777. (let ((tlp-stat (search-input-file inputs "/bin/tlp-stat")))
  6778. (with-directory-excursion "tlpui"
  6779. (substitute* '("file.py" "settingshelper.py" "statui.py")
  6780. (("which\\(\"tlp-stat\"\\)")
  6781. (string-append "'" tlp-stat "'"))
  6782. (("\"tlp-stat\"")
  6783. (string-append "'" tlp-stat "'")))))))
  6784. (add-before 'check 'fix-home-directory
  6785. (lambda _
  6786. ;; Tests fail with "Permission denied:
  6787. ;; '/homeless-shelter'".
  6788. (setenv "HOME" "/tmp")))
  6789. ;; `sanity-check' phase errors out with the following
  6790. ;; messages: "Unable to init server: Could not connect:
  6791. ;; Connection refused" and "Error: cannot read user
  6792. ;; configuration from /etc/tlp.conf or /etc/default/tlp".
  6793. (delete 'sanity-check)
  6794. (replace 'check
  6795. (lambda _
  6796. (invoke "python" "-m" "discover")))
  6797. (add-after 'install 'wrap-gi-python
  6798. (lambda* (#:key outputs #:allow-other-keys)
  6799. (let ((out (assoc-ref outputs "out"))
  6800. (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
  6801. (wrap-program (string-append out "/bin/tlpui")
  6802. `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
  6803. (native-inputs
  6804. (list `(,glib "bin") gobject-introspection python-discover))
  6805. (inputs
  6806. (list gtk+ python-pygobject tlp))
  6807. (home-page "https://github.com/d4nj1/TLPUI")
  6808. (synopsis "User interface for TLP written in Python")
  6809. (description
  6810. "The Python scripts in this project generate a GTK-UI to change
  6811. TLP configuration files easily. It aims to protect users from setting
  6812. bad configuration and to deliver a basic overview of all the valid
  6813. configuration values.")
  6814. (license license:gpl2+)))
  6815. (define-public lshw
  6816. (package
  6817. (name "lshw")
  6818. (version "B.02.19.2")
  6819. (source (origin
  6820. (method url-fetch)
  6821. (uri (string-append "https://www.ezix.org/software/"
  6822. "files/lshw-" version
  6823. ".tar.gz"))
  6824. (sha256
  6825. (base32
  6826. "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
  6827. (build-system gnu-build-system)
  6828. (arguments
  6829. `(#:phases (modify-phases %standard-phases (delete 'configure))
  6830. #:tests? #f ; no tests
  6831. #:make-flags
  6832. (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  6833. (synopsis "List hardware information")
  6834. (description
  6835. "@command{lshw} (Hardware Lister) is a small tool to provide
  6836. detailed information on the hardware configuration of the machine.
  6837. It can report exact memory configuration, firmware version, mainboard
  6838. configuration, CPU version and speed, cache configuration, bus speed,
  6839. and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
  6840. machines (PowerMac G4 is known to work).")
  6841. (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
  6842. (license license:gpl2+)))
  6843. (define-public libmnl
  6844. (package
  6845. (name "libmnl")
  6846. (version "1.0.4")
  6847. (source
  6848. (origin
  6849. (method url-fetch)
  6850. (uri (string-append "mirror://netfilter.org/libmnl/"
  6851. "libmnl-" version ".tar.bz2"))
  6852. (sha256
  6853. (base32
  6854. "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
  6855. (build-system gnu-build-system)
  6856. (home-page "https://www.netfilter.org/projects/libmnl/")
  6857. (synopsis "Netlink utility library")
  6858. (description "Libmnl is a minimalistic user-space library oriented to
  6859. Netlink developers. There are a lot of common tasks in parsing, validating,
  6860. constructing of both the Netlink header and TLVs that are repetitive and easy to
  6861. get wrong. This library aims to provide simple helpers that allows you to
  6862. re-use code and to avoid re-inventing the wheel.")
  6863. (license license:lgpl2.1+)))
  6864. (define-public libnftnl
  6865. (package
  6866. (name "libnftnl")
  6867. (version "1.2.1")
  6868. (source
  6869. (origin
  6870. (method url-fetch)
  6871. (uri (string-append "mirror://netfilter.org/libnftnl/"
  6872. "libnftnl-" version ".tar.bz2"))
  6873. (sha256
  6874. (base32 "0z4khm2mnys9mcl8ckwf19cw20jgrv8650nfncy3xcgs2k2aa23m"))))
  6875. (build-system gnu-build-system)
  6876. (native-inputs
  6877. (list pkg-config))
  6878. (inputs
  6879. (list libmnl))
  6880. (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
  6881. (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
  6882. (description "Libnftnl is a userspace library providing a low-level netlink
  6883. programming interface to the in-kernel nf_tables subsystem. The library
  6884. libnftnl has been previously known as libnftables. This library is currently
  6885. used by nftables.")
  6886. (license license:gpl2+)))
  6887. ;; This is used in iptables, which contributes to rust. We're pinning this
  6888. ;; variant to avoid accidental rebuilds of rust.
  6889. (define-public libnftnl/fixed
  6890. (package (inherit libnftnl)
  6891. (version "1.2.0")
  6892. (source
  6893. (origin
  6894. (method url-fetch)
  6895. (uri (string-append "mirror://netfilter.org/libnftnl/"
  6896. "libnftnl-" version ".tar.bz2"))
  6897. (sha256
  6898. (base32 "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h"))))
  6899. (build-system gnu-build-system)
  6900. (native-inputs
  6901. (list pkg-config))
  6902. (inputs
  6903. (list libmnl))))
  6904. (define-public nftables
  6905. (package
  6906. (name "nftables")
  6907. (version "1.0.1")
  6908. (source
  6909. (origin
  6910. (method url-fetch)
  6911. (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
  6912. version ".tar.bz2")
  6913. (string-append "https://www.nftables.org/projects/nftables"
  6914. "/files/nftables-" version ".tar.bz2")))
  6915. (sha256
  6916. (base32 "08x4xw0s5sap3q7jfr91v7mrkxrydi4dvsckw85ims0qb1ibmviw"))))
  6917. (build-system gnu-build-system)
  6918. (arguments `(#:configure-flags
  6919. '("--disable-static"
  6920. "--with-cli=readline"
  6921. "--with-json")))
  6922. (inputs (list gmp libmnl libnftnl readline jansson))
  6923. (native-inputs (list pkg-config bison flex docbook2x))
  6924. (home-page "https://www.nftables.org")
  6925. (synopsis "Userspace utility for Linux packet filtering")
  6926. (description "nftables is the project that aims to replace the existing
  6927. {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
  6928. filtering framework, a new userspace utility and also a compatibility layer for
  6929. {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
  6930. infrastructure such as the existing hooks, the connection tracking system, the
  6931. userspace queueing component and the logging subsystem.")
  6932. (license license:gpl2)))
  6933. (define-public proot
  6934. (package
  6935. (name "proot")
  6936. (version "5.3.0")
  6937. (source
  6938. (origin
  6939. (method git-fetch)
  6940. (uri (git-reference
  6941. (url "https://github.com/proot-me/PRoot")
  6942. (commit (string-append "v" version))))
  6943. (file-name (git-file-name name version))
  6944. (sha256
  6945. (base32 "1r1ga3xbwq5kx4i8ihj1p6nmgaa14lfkwxzpsbdcmfh1jimpbmzk"))))
  6946. (build-system gnu-build-system)
  6947. ;; Many architectures are not supported (see:
  6948. ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
  6949. (supported-systems '("x86_64-linux" "i686-linux"
  6950. "armhf-linux" "aarch64-linux" "i586-gnu"))
  6951. (arguments
  6952. ;; Disable the test suite on armhf-linux, as there are too many
  6953. ;; failures to keep track of (see for example:
  6954. ;; https://github.com/proot-me/proot/issues/286).
  6955. `(#:tests? ,(not (string-prefix? "armhf"
  6956. (or (%current-target-system)
  6957. (%current-system))))
  6958. #:make-flags '("-C" "src")
  6959. #:phases (modify-phases %standard-phases
  6960. (add-after 'unpack 'patch-sources
  6961. (lambda* (#:key inputs #:allow-other-keys)
  6962. (substitute* (find-files "src" "\\.[ch]$")
  6963. (("\"/bin/sh\"")
  6964. (string-append "\"" (assoc-ref inputs "bash")
  6965. "/bin/sh\"")))
  6966. (substitute* "src/GNUmakefile"
  6967. (("/bin/echo") (which "echo"))
  6968. (("^VERSION = .*")
  6969. (string-append "VERSION := " ,version "\n")))
  6970. (substitute* (find-files "test" "\\.sh$")
  6971. ;; Some of the tests try to "bind-mount" /bin/true.
  6972. (("-b /bin/true:")
  6973. (string-append "-b " (which "true") ":"))
  6974. ;; Likewise for /bin.
  6975. (("-b /bin:") "-b /gnu:")
  6976. ;; Others try to run /bin/sh.
  6977. (("/bin/sh") (which "sh"))
  6978. ;; Others assume /etc/fstab exists.
  6979. (("/etc/fstab") "/etc/passwd"))
  6980. (substitute* "test/GNUmakefile"
  6981. (("-b /bin:") "-b /gnu:"))
  6982. (substitute* "test/test-c6b77b77.mk"
  6983. (("/bin/bash") (which "bash"))
  6984. (("/usr/bin/test") (which "test")))
  6985. (substitute* "test/test-16573e73.c"
  6986. (("/bin/([a-z-]+)" _ program)
  6987. (which program)))
  6988. (substitute* "test/test-5467b986.sh"
  6989. (("-w /usr") "-w /gnu")
  6990. (("-w usr") "-w gnu")
  6991. (("/usr/share") "/gnu/store")
  6992. (("share") "store"))
  6993. (substitute* "test/test-092c5e26.sh"
  6994. (("-q echo ")
  6995. "-q $(which echo) "))
  6996. ;; The socket tests requires networking.
  6997. (for-each delete-file
  6998. (find-files "test" "test-socket.*\\.sh$"))))
  6999. (delete 'configure)
  7000. (add-after 'build 'build-manpage
  7001. (lambda _
  7002. (with-directory-excursion "doc"
  7003. (invoke "make" "proot/man.1" "SUFFIX=.py"))))
  7004. (replace 'check
  7005. (lambda* (#:key tests? #:allow-other-keys)
  7006. (when tests?
  7007. (let ((n (parallel-job-count)))
  7008. ;; Most of the tests expect "/bin" to be in $PATH so
  7009. ;; they can run things that live in $ROOTFS/bin.
  7010. (setenv "PATH"
  7011. (string-append (getenv "PATH") ":/bin"))
  7012. (invoke "make" "check" "-C" "test"
  7013. ;;"V=1"
  7014. "-j" (number->string n))))))
  7015. (replace 'install
  7016. (lambda* (#:key outputs #:allow-other-keys)
  7017. ;; The 'install' rule does nearly nothing.
  7018. (let* ((out (assoc-ref outputs "out"))
  7019. (man1 (string-append out "/share/man/man1")))
  7020. ;; TODO: 'make install-care' (does not even
  7021. ;; build currently.)
  7022. (invoke "make" "-C" "src" "install"
  7023. (string-append "PREFIX=" out))
  7024. (mkdir-p man1)
  7025. (copy-file "doc/proot/man.1"
  7026. (string-append man1 "/proot.1"))))))))
  7027. (native-inputs (list which
  7028. ;; For 'mcookie', used by some of the tests.
  7029. util-linux
  7030. coreutils
  7031. pkg-config
  7032. ;; For rst2man, used to generate the manual page.
  7033. python-docutils))
  7034. (inputs (list libarchive talloc))
  7035. (home-page "https://github.com/proot-me/PRoot")
  7036. (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
  7037. (description
  7038. "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
  7039. and @code{binfmt_misc}. This means that users don't need any privileges or
  7040. setup to do things like using an arbitrary directory as the new root
  7041. file system, making files accessible somewhere else in the file system
  7042. hierarchy, or executing programs built for another CPU architecture
  7043. transparently through QEMU user-mode. Also, developers can use PRoot as a
  7044. generic process instrumentation engine thanks to its extension mechanism.
  7045. Technically PRoot relies on @code{ptrace}, an unprivileged system-call
  7046. available in the kernel Linux.")
  7047. (license license:gpl2+)))
  7048. (define-public proot-static
  7049. (package
  7050. (inherit proot)
  7051. (name "proot-static")
  7052. (synopsis
  7053. "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
  7054. (inputs `(("talloc" ,talloc/static)))
  7055. (arguments
  7056. (substitute-keyword-arguments (package-arguments proot)
  7057. ((#:make-flags flags)
  7058. `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
  7059. ((#:phases phases)
  7060. `(modify-phases ,phases
  7061. (add-after 'strip 'remove-store-references
  7062. (lambda* (#:key outputs #:allow-other-keys)
  7063. (let* ((out (assoc-ref outputs "out")))
  7064. (with-directory-excursion out
  7065. (remove-store-references "bin/proot")
  7066. #t))))))
  7067. ((#:allowed-references _ '("out"))
  7068. '("out"))))))
  7069. (define-public cpuid
  7070. (package
  7071. (name "cpuid")
  7072. (version "20211210")
  7073. (source (origin
  7074. (method url-fetch)
  7075. (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
  7076. version ".src.tar.gz"))
  7077. (sha256
  7078. (base32
  7079. "0i2z1r0zwsmvnx2azwsz3x6van6dj9480lh26s1ny6ny01bqjag0"))))
  7080. (build-system gnu-build-system)
  7081. (arguments
  7082. `(#:make-flags
  7083. (list (string-append "CC=" ,(cc-for-target)))
  7084. #:tests? #f ; no tests
  7085. #:phases (modify-phases %standard-phases
  7086. (delete 'configure) ; no configure script
  7087. (add-before 'install 'fix-makefile
  7088. (lambda* (#:key outputs #:allow-other-keys)
  7089. (substitute* "Makefile"
  7090. (("\\$\\(BUILDROOT\\)/usr")
  7091. (assoc-ref outputs "out"))))))))
  7092. (inputs (list perl))
  7093. (supported-systems '("i686-linux" "x86_64-linux"))
  7094. (home-page "http://www.etallen.com/cpuid.html")
  7095. (synopsis "Dump x86 CPUID processor information")
  7096. (description "cpuid dumps detailed information about the CPU(s) gathered
  7097. from the CPUID instruction, and also determines the exact model of CPU(s). It
  7098. supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
  7099. NexGen, Rise, and SiS CPUs.")
  7100. (license license:gpl2+)))
  7101. (define-public jmtpfs
  7102. (package
  7103. (name "jmtpfs")
  7104. (version "0.5")
  7105. (source
  7106. (origin
  7107. (method git-fetch)
  7108. (uri (git-reference
  7109. (url "https://github.com/JasonFerrara/jmtpfs")
  7110. (commit (string-append "v" version))))
  7111. (file-name (git-file-name name version))
  7112. (sha256
  7113. (base32
  7114. "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
  7115. (build-system gnu-build-system)
  7116. (inputs
  7117. (list file fuse libmtp))
  7118. (native-inputs
  7119. (list pkg-config))
  7120. (home-page "https://github.com/JasonFerrara/jmtpfs")
  7121. (synopsis "Use a FUSE file system to access data over MTP")
  7122. (description "jmtpfs uses FUSE (file system in userspace) to provide access
  7123. to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
  7124. the MTP device as a file system.")
  7125. (license license:gpl3)))
  7126. (define-public procenv
  7127. (package
  7128. (name "procenv")
  7129. (version "0.60")
  7130. (source
  7131. (origin
  7132. (method git-fetch)
  7133. (uri (git-reference
  7134. (url "https://github.com/jamesodhunt/procenv")
  7135. (commit version)))
  7136. (file-name (git-file-name name version))
  7137. (sha256
  7138. (base32 "00d7q0h4qjc8lg435lq77lp2fx6ikm5piq90m81mr1dqqna1g6pz"))))
  7139. (build-system gnu-build-system)
  7140. (native-inputs
  7141. (list pkg-config
  7142. ;; For tests.
  7143. check groff))
  7144. (inputs
  7145. (list expat libcap libselinux))
  7146. (synopsis "Utility to show process environment")
  7147. (description
  7148. "Procenv is a command-line tool that displays as much detail about
  7149. itself and its environment as possible. It can be used as a test
  7150. tool, to understand the type of environment a process runs in, and for
  7151. comparing system environments.")
  7152. (home-page "https://github.com/jamesodhunt/procenv/")
  7153. (license license:gpl3+)))
  7154. (define-public libfabric
  7155. (package
  7156. (name "libfabric")
  7157. (version "1.11.2")
  7158. (source
  7159. (origin
  7160. (method url-fetch)
  7161. (uri
  7162. (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
  7163. version "/libfabric-" version ".tar.bz2"))
  7164. (sha256
  7165. (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
  7166. (build-system gnu-build-system)
  7167. (inputs `(("rdma-core" ,rdma-core)
  7168. ,@(match (%current-system)
  7169. ((member (package-supported-systems psm))
  7170. `(("psm" ,psm)))
  7171. (_ `()))
  7172. ("libnl" ,libnl)))
  7173. (home-page "https://ofiwg.github.io/libfabric/")
  7174. (synopsis "Open Fabric Interfaces")
  7175. (description
  7176. "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
  7177. communication services to applications. OFI is best described as a collection
  7178. of libraries and applications used to export fabric services. The key
  7179. components of OFI are: application interfaces, provider libraries, kernel
  7180. services, daemons, and test applications.
  7181. Libfabric is a core component of OFI. It is the library that defines and
  7182. exports the user-space API of OFI, and is typically the only software that
  7183. applications deal with directly. It works in conjunction with provider
  7184. libraries, which are often integrated directly into libfabric.")
  7185. (license (list license:bsd-2 license:gpl2)))) ;dual
  7186. (define-public psm
  7187. (package
  7188. (name "psm")
  7189. (version "3.3.20170428")
  7190. (home-page "https://github.com/intel/psm")
  7191. (source
  7192. (origin
  7193. (method git-fetch)
  7194. (uri (git-reference (url home-page)
  7195. (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
  7196. (file-name (string-append "psm-" version ".tar.gz"))
  7197. (sha256
  7198. (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
  7199. (patches (search-patches
  7200. "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
  7201. "psm-ldflags.patch" ; build shared lib with LDFLAGS
  7202. "psm-repro.patch" ; reproducibility
  7203. "psm-disable-memory-stats.patch"))))
  7204. (build-system gnu-build-system)
  7205. (outputs '("out" "debug"))
  7206. (inputs `(("libuuid" ,util-linux "lib")))
  7207. (arguments
  7208. '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
  7209. ,(string-append "INSTALL_PREFIX=" %output)
  7210. ,(string-append "CFLAGS=-Wall -fpic -fPIC -D_GNU_SOURCE"
  7211. " -funwind-tables -O3 -g3"
  7212. " -DPSM_USE_SYS_UUID"
  7213. " -Wno-strict-aliasing -DNVALGRIND"
  7214. " -fcommon")
  7215. ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  7216. #:tests? #f
  7217. #:phases (modify-phases %standard-phases
  7218. (delete 'configure)
  7219. (add-after 'unpack 'patch-/usr/include
  7220. (lambda _
  7221. (substitute* "Makefile"
  7222. (("\\$\\{DESTDIR}/usr/include")
  7223. (string-append %output "/include")))
  7224. (substitute* "Makefile"
  7225. (("/lib64") "/lib"))
  7226. #t))
  7227. (add-after 'unpack 'patch-sysmacros
  7228. (lambda _
  7229. (substitute* "ipath/ipath_proto.c"
  7230. (("#include <sys/poll.h>" m)
  7231. (string-append m "\n"
  7232. "#include <sys/sysmacros.h>")))
  7233. #t)))))
  7234. (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
  7235. (description
  7236. "The PSM Messaging API, or PSM API, is Intel's low-level user-level
  7237. communications interface for the True Scale family of products. PSM users are
  7238. enabled with mechanisms necessary to implement higher level communications
  7239. interfaces in parallel environments.")
  7240. ;; Only Intel-compatable processors are supported.
  7241. (supported-systems '("i686-linux" "x86_64-linux"))
  7242. (license (list license:bsd-2 license:gpl2)))) ;dual
  7243. (define-public snapscreenshot
  7244. (package
  7245. (name "snapscreenshot")
  7246. (version "1.0.14.3")
  7247. (source
  7248. (origin
  7249. (method url-fetch)
  7250. (uri (string-append "http://bisqwit.iki.fi/src/arch/"
  7251. name "-" version ".tar.bz2"))
  7252. (sha256
  7253. (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
  7254. (build-system gnu-build-system)
  7255. (arguments
  7256. `(#:make-flags
  7257. (let ((out (assoc-ref %outputs "out")))
  7258. (list (string-append "BINDIR=" out "/bin")
  7259. (string-append "MANDIR=" out "/share/man")))
  7260. #:tests? #f ; no test suite
  7261. #:phases
  7262. (modify-phases %standard-phases
  7263. (delete 'configure) ; ./configure is a snarky no-op
  7264. (add-before 'install 'fix-ownership
  7265. ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
  7266. (lambda _
  7267. (substitute* "depfun.mak"
  7268. ((" -o bin -g bin ") " "))
  7269. #t))
  7270. (add-before 'install 'create-output-directories
  7271. (lambda* (#:key outputs #:allow-other-keys)
  7272. (let ((out (assoc-ref outputs "out")))
  7273. (mkdir-p (string-append out "/share/man/man1"))
  7274. #t))))))
  7275. (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
  7276. (synopsis "Take screenshots of one or more Linux text consoles")
  7277. (description
  7278. "snapscreenshot saves a screenshot of one or more Linux text consoles as a
  7279. Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
  7280. relevant @file{/dev/vcs*} file(s).")
  7281. (license license:gpl2)))
  7282. (define-public fbcat
  7283. (package
  7284. (name "fbcat")
  7285. (version "0.5.2")
  7286. (source
  7287. (origin
  7288. (method url-fetch)
  7289. (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
  7290. version "/" name "-" version ".tar.gz"))
  7291. (sha256
  7292. (base32 "07q6f0xj7b4gjvn69qfn0g04yd0ch8ndzyigcz8nnrhli0cvsbh6"))))
  7293. (build-system gnu-build-system)
  7294. (inputs
  7295. ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
  7296. ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
  7297. ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
  7298. `(("pnmtopng" ,netpbm)))
  7299. (outputs (list "out" "fbgrab"))
  7300. (arguments
  7301. `(#:make-flags
  7302. (list "CC=gcc"
  7303. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  7304. #:tests? #f ; no tests
  7305. #:phases
  7306. (modify-phases %standard-phases
  7307. (delete 'configure) ; no configure script
  7308. (add-after 'build 'qualify-references
  7309. (lambda* (#:key inputs outputs #:allow-other-keys)
  7310. (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
  7311. (out (assoc-ref outputs "out")))
  7312. (substitute* "fbgrab"
  7313. (("fbcat" all)
  7314. (string-append out "/bin/" all))
  7315. (("pnmtopng" all)
  7316. (string-append pnmtopng "/bin/" all))))))
  7317. (add-after 'install 'split-fbgrab-output
  7318. (lambda* (#:key outputs #:allow-other-keys)
  7319. (let* ((out (assoc-ref outputs "out"))
  7320. (out:fbgrab (assoc-ref outputs "fbgrab")))
  7321. (for-each (lambda (file)
  7322. (let ((old (string-append out "/" file))
  7323. (new (string-append out:fbgrab "/" file)))
  7324. (mkdir-p (dirname new))
  7325. (rename-file old new)))
  7326. (list "bin/fbgrab"
  7327. "share/man/man1/fbgrab.1"))))))))
  7328. (home-page "https://jwilk.net/software/fbcat")
  7329. (synopsis "Take a screenshot of the contents of the Linux framebuffer")
  7330. (description
  7331. "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
  7332. a dump therof. It supports a wide range of drivers and pixel formats.
  7333. @command{fbcat} can take screenshots of virtually any application that can be
  7334. made to write its output to the framebuffer, including (but not limited to)
  7335. text-mode or graphical applications that don't use a display server.
  7336. Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
  7337. emulates the behaviour of Gunnar Monell's older fbgrab utility.")
  7338. (license license:gpl2)))
  7339. (define-public libcgroup
  7340. (package
  7341. (name "libcgroup")
  7342. (version "0.41")
  7343. (source
  7344. (origin
  7345. (method url-fetch)
  7346. (uri (string-append
  7347. "mirror://sourceforge/libcg/" name "/"
  7348. version "/" name "-" version ".tar.bz2"))
  7349. (sha256
  7350. (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
  7351. (build-system gnu-build-system)
  7352. (arguments
  7353. `(#:tests? #f))
  7354. (native-inputs
  7355. (list bison flex))
  7356. (inputs
  7357. (list linux-pam))
  7358. (home-page "https://sourceforge.net/projects/libcg/")
  7359. (synopsis "Control groups management tools")
  7360. (description "Control groups is Linux kernel method for process resource
  7361. restriction, permission handling and more. This package provides userspace
  7362. interface to this kernel feature.")
  7363. (license license:lgpl2.1)))
  7364. (define-public mbpfan
  7365. (package
  7366. (name "mbpfan")
  7367. (version "2.2.1")
  7368. (source
  7369. (origin
  7370. (method git-fetch)
  7371. (uri (git-reference
  7372. (url "https://github.com/dgraziotin/mbpfan")
  7373. (commit (string-append "v" version))))
  7374. (file-name (git-file-name name version))
  7375. (sha256
  7376. (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
  7377. (build-system gnu-build-system)
  7378. (arguments
  7379. `(#:tests? #f ; tests ask to be run as root
  7380. #:make-flags (let ((out (assoc-ref %outputs "out")))
  7381. (list (string-append "DESTDIR=" out)
  7382. ,(string-append "CC=" (cc-for-target))))
  7383. #:phases
  7384. (modify-phases %standard-phases
  7385. (add-after 'unpack 'patch-paths
  7386. (lambda _
  7387. (substitute* "Makefile"
  7388. (("/usr") ""))
  7389. #t))
  7390. (delete 'configure)))) ; there's no configure phase
  7391. (home-page "https://github.com/dgraziotin/mbpfan")
  7392. (synopsis "Control fan speed on Macbooks")
  7393. (description
  7394. "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
  7395. the @code{coretemp} module and sets the fan speed using the @code{applesmc}
  7396. module. It can be executed as a daemon or in the foreground with root
  7397. privileges.")
  7398. (license license:gpl3+)))
  7399. (define-public psm2
  7400. (package
  7401. (name "psm2")
  7402. (version "11.2.185")
  7403. (source (origin
  7404. (method git-fetch)
  7405. (uri (git-reference
  7406. (url "https://github.com/intel/opa-psm2")
  7407. (commit (string-append "PSM2_" version))))
  7408. (file-name (git-file-name name version))
  7409. (sha256
  7410. (base32
  7411. "062hg4r6gz7pla9df70nqs5i2a3mp1wszmp4l0g771fykhhrxsjg"))))
  7412. (build-system gnu-build-system)
  7413. (arguments
  7414. '(#:make-flags
  7415. `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  7416. #:tests? #f
  7417. #:phases (modify-phases %standard-phases
  7418. (delete 'configure)
  7419. (add-after 'unpack 'patch-Makefiles
  7420. (lambda _
  7421. (substitute* "Makefile"
  7422. (("/lib64") "/lib")
  7423. (("/usr") ""))
  7424. (substitute* "compat/Makefile"
  7425. (("/lib64") "/lib")
  7426. (("/usr") ""))
  7427. #t))
  7428. (replace 'install
  7429. (lambda _
  7430. (setenv "DESTDIR" %output)
  7431. (invoke "make" "install")
  7432. #t)))))
  7433. (inputs
  7434. (list rdma-core numactl))
  7435. (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
  7436. (description
  7437. "This package is low-level user-level Intel's communications interface.
  7438. The PSM2 API is a high-performance vendor-specific protocol that provides a
  7439. low-level communications interface for the Intel Omni-Path family of
  7440. high-speed networking devices.")
  7441. (home-page "https://github.com/intel/opa-psm2")
  7442. ;; Only the x86_64 architecure is supported.
  7443. (supported-systems '("x86_64-linux"))
  7444. (license (list license:bsd-3 license:gpl2)))) ; dual
  7445. (define-public libpfm4
  7446. (package
  7447. (name "libpfm4")
  7448. (version "4.9.0")
  7449. (source (origin
  7450. (method url-fetch)
  7451. (uri (string-append "mirror://sourceforge/perfmon2/"
  7452. name "/libpfm-" version ".tar.gz"))
  7453. (sha256
  7454. (base32
  7455. "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
  7456. (build-system gnu-build-system)
  7457. (arguments
  7458. '(#:modules ((guix build utils)
  7459. (guix build gnu-build-system))
  7460. #:phases (modify-phases %standard-phases
  7461. (delete 'configure)
  7462. (delete 'check)
  7463. (replace 'build
  7464. (lambda* (#:key inputs outputs #:allow-other-keys)
  7465. (let* ((out (assoc-ref outputs "out")))
  7466. (setenv "CC" "gcc")
  7467. (setenv "CFLAGS" "-Wno-format-truncation")
  7468. (invoke "make")
  7469. #t)))
  7470. (replace 'install
  7471. (lambda* (#:key outputs #:allow-other-keys)
  7472. (let* ((out (assoc-ref outputs "out")))
  7473. (invoke "make"
  7474. (string-append "PREFIX=" out)
  7475. "install")
  7476. #t))))))
  7477. (synopsis "Performance event monitoring library")
  7478. (description
  7479. "This package provides a library called libpfm4, which is used to develop
  7480. monitoring tools exploiting the performance monitoring events such as those
  7481. provided by the Performance Monitoring Unit (PMU) of modern processors.
  7482. Libpfm4 helps convert from an event name, expressed as a string, to the event
  7483. encoding that is either the raw event as documented by the hardware vendor or
  7484. the OS-specific encoding. In the latter case, the library is able to prepare
  7485. the OS-specific data structures needed by the kernel to setup the event.
  7486. libpfm4 provides support for the @code{perf_events} interface, which was
  7487. introduced in Linux 2.6.31.")
  7488. (home-page "http://perfmon2.sourceforge.net/")
  7489. (license license:expat)))
  7490. (define-public libnfnetlink
  7491. (package
  7492. (name "libnfnetlink")
  7493. (version "1.0.1")
  7494. (source (origin
  7495. (method url-fetch)
  7496. (uri (string-append
  7497. "https://www.netfilter.org/projects/libnfnetlink/files/"
  7498. "libnfnetlink-" version ".tar.bz2"))
  7499. (sha256
  7500. (base32
  7501. "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
  7502. (build-system gnu-build-system)
  7503. (home-page "https://www.netfilter.org/projects/libnfnetlink/")
  7504. (synopsis "Low-level netfilter netlink communication library")
  7505. (description
  7506. "@code{libnfnetlink} is the low-level library for netfilter related
  7507. kernel/userspace communication. It provides a generic messaging
  7508. infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
  7509. nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
  7510. management tools in userspace.")
  7511. (license license:gpl2)))
  7512. (define-public go-netlink
  7513. (package
  7514. (name "go-netlink")
  7515. (version "1.0.0")
  7516. (source (origin
  7517. (method git-fetch)
  7518. (uri (git-reference
  7519. (url "https://github.com/vishvananda/netlink")
  7520. (commit (string-append "v" version))))
  7521. (file-name (git-file-name name version))
  7522. (sha256
  7523. (base32
  7524. "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
  7525. (build-system go-build-system)
  7526. (arguments
  7527. `(#:import-path "github.com/vishvananda/netlink"))
  7528. (native-inputs
  7529. (list go-golang-org-x-sys go-netns))
  7530. (home-page "https://github.com/vishvananda/netlink")
  7531. (synopsis "Simple netlink library for Go")
  7532. (description "The netlink package provides a simple netlink library for
  7533. Go. Netlink is the interface a user-space program in Linux uses to
  7534. communicate with the kernel. It can be used to add and remove interfaces, set
  7535. IP addresses and routes, and configure IPsec.")
  7536. (license license:asl2.0)))
  7537. (define-public libinih
  7538. (package
  7539. (name "libinih")
  7540. (version "53")
  7541. (source (origin
  7542. (method git-fetch)
  7543. (uri (git-reference
  7544. (url "https://github.com/benhoyt/inih")
  7545. (commit (string-append "r" version))))
  7546. (file-name (git-file-name name version))
  7547. (sha256
  7548. (base32
  7549. "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
  7550. (build-system meson-build-system)
  7551. ;; Install static libraries for use by the initrd's xfsprogs/static.
  7552. (outputs (list "out" "static"))
  7553. (arguments
  7554. `(#:configure-flags
  7555. (list "-Ddistro_install=true"
  7556. "-Ddefault_library=both")
  7557. #:phases
  7558. (modify-phases %standard-phases
  7559. (add-after 'install 'separate-static
  7560. (lambda* (#:key outputs #:allow-other-keys)
  7561. (let ((out (assoc-ref outputs "out"))
  7562. (static (assoc-ref outputs "static")))
  7563. (with-directory-excursion out
  7564. (for-each (lambda (source)
  7565. (let ((target (string-append static "/" source)))
  7566. (mkdir-p (dirname target))
  7567. (rename-file source target)))
  7568. (find-files "lib" "\\.a$")))))))))
  7569. (home-page "https://github.com/benhoyt/inih")
  7570. (synopsis "Simple .INI parser library for C")
  7571. (description "The inih (INI Not Invented Here) library is a simple .INI file
  7572. parser written in C. It's only a couple of pages of code, and it was designed to
  7573. be small and simple, so it's good for embedded systems. It's also more or less
  7574. compatible with Python's ConfigParser style of .INI files, including RFC
  7575. 822-style multi-line syntax and name: value entries.")
  7576. (license license:bsd-3)))
  7577. (define-public xfsprogs
  7578. (package
  7579. (name "xfsprogs")
  7580. (version "5.14.2")
  7581. (source (origin
  7582. (method url-fetch)
  7583. (uri (string-append
  7584. "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
  7585. "xfsprogs-" version ".tar.gz"))
  7586. (sha256
  7587. (base32
  7588. "0368dacdjq55ip38yizs9spdyl7b0b1c0vz3gr1gvcb9rw3a6dnp"))))
  7589. (build-system gnu-build-system)
  7590. (outputs (list "out" "python"))
  7591. (arguments
  7592. `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
  7593. #:configure-flags
  7594. (list "--disable-static")
  7595. #:make-flags
  7596. (list "V=1")
  7597. #:phases
  7598. (modify-phases %standard-phases
  7599. (add-after 'install 'separate-python-output
  7600. (lambda* (#:key outputs #:allow-other-keys)
  7601. (let ((out (assoc-ref outputs "out"))
  7602. (python (assoc-ref outputs "python")))
  7603. (for-each
  7604. (lambda (script)
  7605. (mkdir-p (string-append python (dirname script)))
  7606. (rename-file (string-append out script)
  7607. (string-append python script)))
  7608. (list "/sbin/xfs_scrub_all")))))
  7609. (add-after 'install 'install-headers
  7610. (lambda* (#:key make-flags #:allow-other-keys)
  7611. (apply invoke "make" "install-dev" make-flags))))))
  7612. (native-inputs
  7613. `(("gettext" ,gettext-minimal)))
  7614. (inputs
  7615. `(("libinih" ,libinih)
  7616. ("liburcu" ,liburcu)
  7617. ("libuuid" ,util-linux "lib")
  7618. ("python" ,python-wrapper)))
  7619. (home-page "https://xfs.wiki.kernel.org/")
  7620. (synopsis "XFS file system tools")
  7621. (description "This package provides commands to create and check XFS
  7622. file systems.")
  7623. ;; The library "libhandle" and the headers in "xfslibs-dev" are
  7624. ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
  7625. (license (list license:gpl2 license:lgpl2.1))))
  7626. (define-public xfsprogs/static
  7627. (package
  7628. (inherit xfsprogs)
  7629. (name "xfsprogs-static")
  7630. (outputs (list "out"))
  7631. (arguments
  7632. (substitute-keyword-arguments (package-arguments xfsprogs)
  7633. ((#:configure-flags configure-flags '())
  7634. `(append ,configure-flags
  7635. (list "--enable-static")))
  7636. ((#:make-flags make-flags ''())
  7637. `(cons* "LLDFLAGS=-all-static" ,make-flags))
  7638. ((#:phases _ ''())
  7639. `(modify-phases %standard-phases
  7640. (add-after 'install 'delete-useless-files
  7641. (lambda* (#:key outputs #:allow-other-keys)
  7642. (with-directory-excursion (assoc-ref outputs "out")
  7643. (for-each delete-file-recursively
  7644. (list "include" "lib")))))))))
  7645. (inputs
  7646. `(("libinih:static" ,libinih "static")
  7647. ("util-linux:static" ,util-linux "static")
  7648. ,@(remove (match-lambda
  7649. ((label . _)
  7650. (member label '("python"))))
  7651. (package-inputs xfsprogs))))
  7652. (synopsis "Statically linked XFS file system tools")))
  7653. (define-public xfs_repair/static
  7654. (package
  7655. (name "xfs_repair-static")
  7656. (version (package-version xfsprogs/static))
  7657. (source #f)
  7658. (build-system trivial-build-system)
  7659. (arguments
  7660. `(#:modules ((guix build utils))
  7661. #:builder
  7662. (begin
  7663. (use-modules (guix build utils))
  7664. (let* ((xfsprogs (assoc-ref %build-inputs "xfsprogs"))
  7665. (out (assoc-ref %outputs "out"))
  7666. (sbin (string-append out "/sbin")))
  7667. (install-file (string-append xfsprogs "/sbin/xfs_repair") sbin)
  7668. (with-directory-excursion sbin
  7669. (remove-store-references "xfs_repair"))))))
  7670. (inputs
  7671. `(("xfsprogs" ,xfsprogs/static)))
  7672. (home-page (package-home-page xfsprogs/static))
  7673. (synopsis "Statically linked @command{xfs_repair} from xfsprogs")
  7674. (description
  7675. "This package provides a statically linked @command{xfs_repair} taken
  7676. from the xfsprogs package. It is meant to be used in initrds.")
  7677. (license (package-license xfsprogs/static))))
  7678. (define-public genext2fs
  7679. (package
  7680. (name "genext2fs")
  7681. (version "1.4.1-4")
  7682. (source (origin
  7683. (method git-fetch)
  7684. (uri (git-reference
  7685. (url "https://github.com/jeremie-koenig/genext2fs")
  7686. ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
  7687. (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
  7688. (file-name (git-file-name name version))
  7689. (sha256
  7690. (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
  7691. (build-system gnu-build-system)
  7692. (arguments
  7693. `(#:phases
  7694. (modify-phases %standard-phases
  7695. (add-after 'unpack 'apply-debian-patches
  7696. ;; Debian changes (the revision after ‘-’ in VERSION) are
  7697. ;; maintained as separate patches. Apply those relevant to us.
  7698. (lambda _
  7699. (for-each
  7700. (lambda (file-name)
  7701. (invoke "patch" "-p1" "-i"
  7702. (string-append "debian/patches/" file-name)))
  7703. (list "blocksize+creator.diff" ; add -B/-o options
  7704. "byteswap_fix.diff"))
  7705. #t)))))
  7706. (native-inputs
  7707. (list autoconf automake))
  7708. (home-page "https://github.com/jeremie-koenig/genext2fs")
  7709. (synopsis "Generate ext2 file system as a normal user")
  7710. (description "This package provides a program to generate an ext2
  7711. file system as a normal (non-root) user. It does not require you to mount
  7712. the image file to copy files on it, nor does it require that you become
  7713. the superuser to make device nodes.")
  7714. (license license:gpl2)))
  7715. (define-public fakeroot
  7716. (package
  7717. (name "fakeroot")
  7718. (version "1.26")
  7719. (source
  7720. (origin
  7721. ;; There are no tags in the repository, so take this snapshot.
  7722. (method url-fetch)
  7723. (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
  7724. "fakeroot/fakeroot_" version ".orig.tar.gz"))
  7725. (file-name (string-append name "-" version ".tar.gz"))
  7726. (sha256
  7727. (base32
  7728. "1sg8inv1zzp4h9ncbbmxip3svd11sd86j22cvxrjwnf5zn7mf2j8"))
  7729. (modules '((guix build utils)
  7730. (ice-9 ftw)))
  7731. (snippet
  7732. `(begin
  7733. ;; Delete pregenerated man page translations, but not the originals.
  7734. (with-directory-excursion "doc"
  7735. (for-each (lambda (language)
  7736. (for-each delete-file
  7737. (find-files language "\\.[0-9]$")))
  7738. (scandir "."
  7739. (lambda (file)
  7740. (and (not (string-prefix? "." file))
  7741. (eq? 'directory
  7742. (stat:type (lstat file))))))))))))
  7743. (build-system gnu-build-system)
  7744. (arguments
  7745. `(#:configure-flags
  7746. (list "--disable-static")
  7747. #:phases
  7748. (modify-phases %standard-phases
  7749. (add-after 'unpack 'patch-Makefile.am
  7750. (lambda _
  7751. (substitute* "Makefile.am"
  7752. (("/bin/sh") (which "sh")))))
  7753. (add-after 'unpack 'patch-script
  7754. (lambda* (#:key inputs #:allow-other-keys)
  7755. (substitute* "scripts/fakeroot.in"
  7756. (("getopt")
  7757. (string-append (assoc-ref inputs "util-linux")
  7758. "/bin/getopt"))
  7759. (("sed")
  7760. (string-append (assoc-ref inputs "sed")
  7761. "/bin/sed"))
  7762. (("cat|cut" command)
  7763. (string-append (assoc-ref inputs "coreutils")
  7764. "/bin/" command)) )))
  7765. (replace 'bootstrap
  7766. (lambda _
  7767. ;; The "preroll" script takes care of Autoconf and also
  7768. ;; prepares the translated manuals.
  7769. (invoke "sh" "./preroll")))
  7770. (add-before 'configure 'setenv
  7771. (lambda _
  7772. (setenv "LIBS" "-lacl")))
  7773. (add-before 'check 'prepare-check
  7774. (lambda _
  7775. (setenv "SHELL" (which "bash"))
  7776. (setenv "VERBOSE" "1")
  7777. (substitute* "test/t.touchinstall"
  7778. ;; We don't have the name of the root user, so use ID=0.
  7779. (("grep root") "grep \"\\<0\\>\""))
  7780. (substitute* "test/tartest"
  7781. ;; We don't have the name of the root group, so use ID=0.
  7782. (("ROOTGROUP=root") "ROOTGROUP=0")
  7783. ;; We don't have the name of the daemon user, so use IDs.
  7784. (("daemon:sys") "1:3")
  7785. (("daemon:") "1:"))
  7786. ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
  7787. (substitute* "test/compare-tar"
  7788. (("tar -tvf") "tar --numeric-owner -tvf")))))))
  7789. (native-inputs
  7790. `(;; For bootstrapping the package.
  7791. ("autoconf" ,autoconf-2.71)
  7792. ("automake" ,automake)
  7793. ("libtool" ,libtool)
  7794. ("gettext" ,gettext-minimal)
  7795. ("po4a" ,po4a)
  7796. ;; For tests.
  7797. ("sharutils" ,sharutils)
  7798. ("xz" ,xz)))
  7799. (inputs
  7800. (list acl libcap util-linux sed coreutils))
  7801. (synopsis "Run commands in an environment with fake root privileges")
  7802. (description
  7803. "@command{fakeroot} runs a command in an environment where it appears to
  7804. have root privileges for file manipulation. This is useful for allowing users
  7805. to create archives (@file{tar}, @file{ar}, @file{deb}, etc.) with files in
  7806. them with root permissions and/or ownership.
  7807. Without fakeroot, one would have to have root privileges to create the
  7808. constituent files of the archives with the correct permissions and ownership,
  7809. and then pack them up, or one would have to construct the archives directly,
  7810. without using the archiver.")
  7811. (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
  7812. (license license:gpl3+)))
  7813. (define-public fakechroot
  7814. ;; XXX: Build from the change submitted at
  7815. ;; <https://github.com/dex4er/fakechroot/pull/85> to allow compilation
  7816. ;; against glibc 2.33. Switch back to the official repository on the next
  7817. ;; release.
  7818. (let ((commit "e7c1f3a446e594a4d0cce5f5d499c9439ce1d5c5")
  7819. (revision "0"))
  7820. (package
  7821. (name "fakechroot")
  7822. (version (git-version "2.20.1" revision commit))
  7823. (source (origin
  7824. (method git-fetch)
  7825. (uri (git-reference
  7826. (url "https://github.com/lipnitsk/fakechroot")
  7827. (commit commit)))
  7828. (file-name (git-file-name name version))
  7829. (sha256
  7830. (base32
  7831. "0gac6a6djx3nf343vd33sr5qqngz8ss3aij54zl8x9wb47pc11kb"))))
  7832. (build-system gnu-build-system)
  7833. (arguments
  7834. ;; XXX: The tests heavily assume they run on an FHS system so for now
  7835. ;; skip them.
  7836. '(#:tests? #f
  7837. #:configure-flags '("--disable-static")))
  7838. (native-inputs (list autoconf automake libtool perl))
  7839. (synopsis "Emulate @code{chroot} by overriding file system calls")
  7840. (description
  7841. "@command{fakechroot} runs a command in an environment were is additional
  7842. possibility to use @code{chroot} command without root privileges. This is
  7843. useful for allowing users to create own chrooted environment with possibility
  7844. to install another packages without need for root privileges.
  7845. It works by providing @file{libfakechroot.so}, a shared library meant to be
  7846. set as @code{LD_PRELOAD} to override the C library file system functions.")
  7847. (home-page "https://github.com/dex4er/fakechroot/")
  7848. (license license:lgpl2.1+))))
  7849. (define-public inputattach
  7850. (package
  7851. (name "inputattach")
  7852. (version "0.42.0")
  7853. (source (origin
  7854. (method git-fetch)
  7855. (uri (git-reference
  7856. (url "https://github.com/linuxwacom/input-wacom")
  7857. (commit (string-append "input-wacom-" version))))
  7858. (file-name (git-file-name name version))
  7859. (sha256
  7860. (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
  7861. (build-system gnu-build-system)
  7862. (arguments
  7863. `(#:phases
  7864. (modify-phases %standard-phases
  7865. (delete 'bootstrap)
  7866. (delete 'configure)
  7867. (replace 'build
  7868. (lambda* (#:key inputs #:allow-other-keys)
  7869. (with-directory-excursion "inputattach"
  7870. (invoke "gcc" "-O2" "-o" "inputattach"
  7871. "inputattach.c"))))
  7872. (delete 'check)
  7873. (replace 'install
  7874. (lambda* (#:key outputs #:allow-other-keys)
  7875. (let ((target-dir (string-append
  7876. (assoc-ref outputs "out")
  7877. "/bin/")))
  7878. (mkdir-p target-dir)
  7879. (copy-file "inputattach/inputattach"
  7880. (string-append target-dir
  7881. "inputattach"))
  7882. #t))))))
  7883. (home-page "https://linuxwacom.github.io/")
  7884. (synopsis "Dispatch input peripherals events to a device file")
  7885. (description "inputattach dispatches input events from several device
  7886. types and interfaces and translates so that the X server can use them.")
  7887. (license license:gpl2+)))
  7888. (define-public pipewire
  7889. (package
  7890. (name "pipewire")
  7891. (version "0.2.7")
  7892. (source (origin
  7893. (method git-fetch)
  7894. (uri (git-reference
  7895. (url "https://github.com/PipeWire/pipewire")
  7896. (commit version)))
  7897. (file-name (git-file-name name version))
  7898. (sha256
  7899. (base32
  7900. "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))
  7901. (patches (search-patches "pipewire-0.2.7-fno-common.patch"))))
  7902. (build-system meson-build-system)
  7903. (arguments
  7904. '(#:configure-flags '("-Dsystemd=false")))
  7905. (native-inputs
  7906. (list pkg-config))
  7907. (inputs
  7908. (list alsa-lib
  7909. dbus
  7910. eudev
  7911. ffmpeg
  7912. gstreamer
  7913. gst-plugins-base
  7914. libva
  7915. sbc
  7916. sdl2))
  7917. (home-page "https://pipewire.org/")
  7918. (synopsis "Server and user space API to deal with multimedia pipelines")
  7919. (description
  7920. "PipeWire is a project that aims to greatly improve handling of audio and
  7921. video under Linux. It aims to support the usecases currently handled by both
  7922. PulseAudio and Jack and at the same time provide same level of powerful handling
  7923. of Video input and output. It also introduces a security model that makes
  7924. interacting with audio and video devices from containerized applications easy,
  7925. with supporting Flatpak applications being the primary goal. Alongside Wayland
  7926. and Flatpak we expect PipeWire to provide a core building block for the future
  7927. of Linux application development.")
  7928. (license license:lgpl2.0+)))
  7929. (define-public pipewire-0.3
  7930. (package
  7931. (inherit pipewire)
  7932. (name "pipewire")
  7933. (version "0.3.43")
  7934. (source (origin
  7935. (method git-fetch)
  7936. (uri (git-reference
  7937. (url "https://github.com/PipeWire/pipewire")
  7938. (commit version)))
  7939. (file-name (git-file-name name version))
  7940. (sha256
  7941. (base32
  7942. "0gp2h0sidapcqmnifl0iipdmbzb18bdh8zdi7pfywr9gsksh0cxy"))))
  7943. (arguments
  7944. '(#:configure-flags
  7945. (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
  7946. "/lib/udev/rules.d")
  7947. "-Dsystemd=disabled"
  7948. "-Dsession-managers=[]")
  7949. #:phases
  7950. (modify-phases %standard-phases
  7951. ;; Skip shrink-runpath, otherwise validate-runpath fails.
  7952. (delete 'shrink-runpath))))
  7953. (inputs (modify-inputs (package-inputs pipewire)
  7954. (prepend avahi
  7955. bluez
  7956. jack-2
  7957. ldacbt
  7958. pulseaudio
  7959. vulkan-loader
  7960. vulkan-headers)))))
  7961. (define-public wireplumber
  7962. (package
  7963. (name "wireplumber")
  7964. (version "0.4.6")
  7965. (source
  7966. (origin
  7967. (method git-fetch)
  7968. (uri (git-reference
  7969. (url
  7970. "https://gitlab.freedesktop.org/pipewire/wireplumber.git")
  7971. (commit version)))
  7972. (file-name (git-file-name name version))
  7973. (sha256
  7974. (base32 "0g7xkgkjlxrhs49hqkwrjk2hb478gq55wwydafvvbsv78vsa7qfb"))))
  7975. (build-system meson-build-system)
  7976. (arguments
  7977. `(#:configure-flags '("-Dsystemd=disabled"
  7978. "-Dsystem-lua=true")))
  7979. (native-inputs
  7980. (list `(,glib "bin")
  7981. pkg-config))
  7982. (inputs (list dbus elogind glib lua pipewire-0.3))
  7983. (home-page "https://gitlab.freedesktop.org/pipewire/wireplumber")
  7984. (synopsis "Session / policy manager implementation for PipeWire")
  7985. (description "WirePlumber is a modular session / policy manager for
  7986. PipeWire and a GObject-based high-level library that wraps PipeWire's API,
  7987. providing convenience for writing the daemon's modules as well as external
  7988. tools for managing PipeWire.")
  7989. (license license:expat)))
  7990. (define-public ell
  7991. (package
  7992. (name "ell")
  7993. (version "0.48")
  7994. (source (origin
  7995. (method git-fetch)
  7996. (uri (git-reference
  7997. (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
  7998. (commit version)))
  7999. (file-name (git-file-name name version))
  8000. (sha256
  8001. (base32
  8002. "0lxjizby3zdyhzad5a0gbz4m2pp44jf1j4l1pn18d04rw9mr2gqy"))))
  8003. (build-system gnu-build-system)
  8004. (arguments
  8005. ;; Tests launch dbus-daemon instances that all try to bind to
  8006. ;; "/tmp/ell-test-bus". Thus, we need to run them sequentially.
  8007. '(#:parallel-tests? #f))
  8008. (inputs
  8009. (list dbus))
  8010. (native-inputs
  8011. (list autoconf automake libtool pkg-config))
  8012. (home-page "https://01.org/ell")
  8013. (synopsis "Embedded Linux Library")
  8014. (description "The Embedded Linux* Library (ELL) provides core, low-level
  8015. functionality for system daemons. It typically has no dependencies other than
  8016. the Linux kernel, C standard library, and libdl (for dynamic linking). While
  8017. ELL is designed to be efficient and compact enough for use on embedded Linux
  8018. platforms, it is not limited to resource-constrained systems.")
  8019. (license license:lgpl2.1+)))
  8020. (define-public kexec-tools
  8021. (package
  8022. (name "kexec-tools")
  8023. (version "2.0.23")
  8024. (source (origin
  8025. (method url-fetch)
  8026. (uri (string-append "mirror://kernel.org/linux/utils/kernel"
  8027. "/kexec/kexec-tools-" version ".tar.xz"))
  8028. (sha256
  8029. (base32
  8030. "06r44i91g1s9f7k5b9kmvb58j9vrqvysfh32pb70cnyrgmncsqxa"))))
  8031. (build-system gnu-build-system)
  8032. (arguments
  8033. ;; There are no automated tests.
  8034. '(#:tests? #f))
  8035. ;; This variant of binutils is used for the 64 bit support needed to
  8036. ;; assemble the `purgatory/arch/i386/compat_x86_64.S' program on i686-linux.
  8037. (native-inputs (list (make-ld-wrapper "ld-wrapper"
  8038. #:binutils binutils)
  8039. binutils))
  8040. (home-page "https://projects.horms.net/projects/kexec/")
  8041. (synopsis "Tools for booting directly into different kernels")
  8042. (description "This package provides the @code{kexec} program and ancillary
  8043. utilities. Using @code{kexec}, it is possible to boot directly into a new
  8044. kernel from the context of an already-running kernel, bypassing the normal
  8045. system boot process.")
  8046. (supported-systems (delete "riscv64-linux" %supported-systems))
  8047. (license license:gpl2)))
  8048. (define-public cachefilesd
  8049. (package
  8050. (name "cachefilesd")
  8051. (version "0.10.10")
  8052. (source (origin
  8053. (method url-fetch)
  8054. (uri (string-append
  8055. "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
  8056. "/cachefilesd.git/snapshot/cachefilesd-"
  8057. version ".tar.gz"))
  8058. (sha256
  8059. (base32
  8060. "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
  8061. (build-system gnu-build-system)
  8062. (outputs '("out"))
  8063. (arguments
  8064. `(#:tests? #f ; there are no tests
  8065. #:make-flags
  8066. (let ((prefix-dir (lambda (var dir)
  8067. (string-append var "=" %output "/" dir))))
  8068. (list (string-append "CC=" ,(cc-for-target))
  8069. (prefix-dir "SBINDIR" "sbin/")
  8070. (prefix-dir "ETCDIR" "etc/")
  8071. (prefix-dir "MANDIR" "share/man/")))
  8072. #:phases (modify-phases %standard-phases (delete 'configure))))
  8073. (home-page "https://people.redhat.com/~dhowells/cachefs/")
  8074. (synopsis "CacheFiles userspace management daemon")
  8075. (description "@code{cachefilesd} is a userspace daemon that manages the
  8076. cache data store that is used by network file systems such as @code{AFS} and
  8077. @code{NFS} to cache data locally on disk. The content of the cache is
  8078. persistent over reboots.")
  8079. (license license:gpl2+)))
  8080. (define-public libbpf
  8081. (package
  8082. (name "libbpf")
  8083. (version "0.1.1")
  8084. (source
  8085. (origin
  8086. (method git-fetch)
  8087. (uri (git-reference
  8088. (url "https://github.com/libbpf/libbpf")
  8089. (commit (string-append "v" version))))
  8090. (file-name (git-file-name name version))
  8091. (sha256
  8092. (base32
  8093. "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
  8094. (build-system gnu-build-system)
  8095. (native-inputs
  8096. (list pkg-config))
  8097. (propagated-inputs
  8098. ;; In Requires.private of libbpf.pc.
  8099. (list libelf zlib))
  8100. (arguments
  8101. `(#:tests? #f ; no tests
  8102. #:make-flags
  8103. (list
  8104. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  8105. (string-append "LIBDIR=$(PREFIX)/lib")
  8106. (string-append
  8107. "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
  8108. #:phases
  8109. (modify-phases %standard-phases
  8110. (delete 'configure)
  8111. (add-before 'build 'pre-build
  8112. (lambda _
  8113. (chdir "src")
  8114. #t)))))
  8115. (home-page "https://github.com/libbpf/libbpf")
  8116. (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
  8117. (description
  8118. "Libbpf supports building BPF CO-RE-enabled applications, which, in
  8119. contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
  8120. headers.")
  8121. (license `(,license:lgpl2.1 ,license:bsd-2))))
  8122. (define-public bcc
  8123. (package
  8124. (name "bcc")
  8125. (version "0.16.0")
  8126. (source
  8127. (origin
  8128. (method git-fetch)
  8129. (uri (git-reference
  8130. (url "https://github.com/iovisor/bcc")
  8131. (commit (string-append "v" version))))
  8132. (file-name (git-file-name name version))
  8133. (sha256
  8134. (base32
  8135. "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
  8136. (build-system cmake-build-system)
  8137. (native-inputs
  8138. (list bison flex))
  8139. (inputs
  8140. `(("clang-toolchain" ,clang-toolchain-9)
  8141. ("libbpf" ,(package-source libbpf))
  8142. ;; LibElf required but libelf does not contain
  8143. ;; archives, only object files.
  8144. ;; https://github.com/iovisor/bcc/issues/504
  8145. ("elfutils" ,elfutils)
  8146. ("luajit" ,luajit)
  8147. ("python-wrapper" ,python-wrapper)))
  8148. (arguments
  8149. `(;; Tests all require root permissions and a "standard" file hierarchy.
  8150. #:tests? #f
  8151. #:configure-flags
  8152. (let ((revision ,version))
  8153. `(,(string-append "-DREVISION=" revision)))
  8154. #:phases
  8155. (modify-phases %standard-phases
  8156. ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
  8157. (add-after 'unpack 'copy-libbpf
  8158. (lambda* (#:key inputs #:allow-other-keys)
  8159. (delete-file-recursively "src/cc/libbpf")
  8160. (copy-recursively
  8161. (assoc-ref inputs "libbpf") "src/cc/libbpf")))
  8162. (add-after 'copy-libbpf 'substitute-libbc
  8163. (lambda* (#:key outputs #:allow-other-keys)
  8164. (substitute* "src/python/bcc/libbcc.py"
  8165. (("(libbcc\\.so.*)\\b" _ libbcc)
  8166. (string-append
  8167. (assoc-ref outputs "out") "/lib/" libbcc)))))
  8168. (add-after 'install 'wrap-tools
  8169. (lambda* (#:key outputs #:allow-other-keys)
  8170. (use-modules (ice-9 textual-ports))
  8171. (let* ((out (assoc-ref outputs "out"))
  8172. (lib (string-append out "/lib"))
  8173. (tools (string-append out "/share/bcc/tools"))
  8174. (python-executable?
  8175. (lambda (filename _)
  8176. (call-with-input-file filename
  8177. (lambda (port)
  8178. (string-contains (get-line port)
  8179. "/bin/python"))))))
  8180. (for-each
  8181. (lambda (python-executable)
  8182. (format #t "Wrapping: ~A.~%" python-executable)
  8183. (wrap-program python-executable
  8184. `("GUIX_PYTHONPATH" ":" prefix
  8185. (,(string-append lib
  8186. "/python"
  8187. ,(version-major+minor
  8188. (package-version python))
  8189. "/site-packages")))))
  8190. (find-files tools python-executable?))
  8191. #t))))))
  8192. (home-page "https://github.com/iovisor/bcc")
  8193. (synopsis "Tools for BPF on Linux")
  8194. (description
  8195. "BCC is a toolkit for creating efficient kernel tracing and manipulation
  8196. programs, and includes several useful tools and examples. It makes use of
  8197. extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
  8198. that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
  8199. and above.")
  8200. (license license:asl2.0)))
  8201. (define-public bpftrace
  8202. (package
  8203. (name "bpftrace")
  8204. (version "0.11.4")
  8205. (source
  8206. (origin
  8207. (method git-fetch)
  8208. (uri (git-reference
  8209. (url "https://github.com/iovisor/bpftrace")
  8210. (commit (string-append "v" version))))
  8211. (file-name (git-file-name name version))
  8212. (sha256
  8213. (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
  8214. (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
  8215. (build-system cmake-build-system)
  8216. (native-inputs
  8217. (list bison flex))
  8218. (inputs
  8219. (list bcc clang-toolchain-9 elfutils libbpf))
  8220. (arguments
  8221. `(#:tests? #f ;Tests require googletest sources.
  8222. #:configure-flags
  8223. '("-DBUILD_TESTING=OFF"
  8224. ;; FIXME: libbfd misses some link dependencies, when fixed, remove
  8225. ;; the associated patch.
  8226. "-DHAVE_BFD_DISASM=OFF")))
  8227. (home-page "https://github.com/iovisor/bpftrace")
  8228. (synopsis "High-level tracing language for Linux eBPF")
  8229. (description
  8230. "bpftrace is a high-level tracing language for Linux enhanced Berkeley
  8231. Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
  8232. LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
  8233. interacting with the Linux BPF system, as well as existing Linux tracing
  8234. capabilities: kernel dynamic tracing (kprobes), user-level dynamic
  8235. tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
  8236. and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
  8237. created by Alastair Robertson.")
  8238. (license license:asl2.0)))
  8239. (define-public ttyebus-linux-module
  8240. (let ((revision "0")
  8241. (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
  8242. (package
  8243. (name "ttyebus-linux-module")
  8244. (version (git-version "1.5" revision commit))
  8245. (source
  8246. (origin
  8247. (method git-fetch)
  8248. (uri (git-reference
  8249. (url "https://github.com/eBUS/ttyebus")
  8250. (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
  8251. (file-name (git-file-name name version))
  8252. (sha256
  8253. (base32
  8254. "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
  8255. (supported-systems '("armhf-linux" "aarch64-linux"))
  8256. (build-system linux-module-build-system)
  8257. (arguments
  8258. `(#:tests? #f))
  8259. (home-page "https://github.com/eBUS/ttyebus")
  8260. (synopsis "Low-latency Raspberry Pi UART driver")
  8261. (description "This package provides a Linux kernel module that will
  8262. provide a serial device @code{/dev/ttyebus} with almost no latency upon
  8263. receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
  8264. (license license:gpl3+))))
  8265. (define-public ipset
  8266. (package
  8267. (name "ipset")
  8268. (version "7.15")
  8269. (source
  8270. (origin
  8271. (method url-fetch)
  8272. (uri (string-append "https://ipset.netfilter.org/"
  8273. "ipset-" version ".tar.bz2"))
  8274. (sha256
  8275. (base32 "0l8pcaym6057hq3a4zwnk53p5y6xg1m3d3c83wn18h5nmnm4am8a"))))
  8276. (build-system gnu-build-system)
  8277. (inputs
  8278. (list libmnl))
  8279. (native-inputs
  8280. (list pkg-config))
  8281. (arguments
  8282. `(#:configure-flags '("--disable-static"
  8283. "--with-kmod=no")))
  8284. (home-page "https://ipset.netfilter.org/")
  8285. (synopsis "Administration tool for IP sets")
  8286. (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
  8287. can be administered by the ipset utility. Depending on the type,
  8288. currently an IP set may store IP addresses, (TCP/UDP) port numbers or
  8289. IP addresses with MAC addresses in a way which ensures lightning speed
  8290. when matching an entry against a set.
  8291. If you want to
  8292. @itemize @bullet
  8293. @item store multiple IP addresses or port numbers and match against the entire
  8294. collection using a single iptables rule.
  8295. @item dynamically update iptables rules against IP addresses or ports without
  8296. performance penalty.
  8297. @item express complex IP address and ports based rulesets with a single
  8298. iptables rule and benefit from the speed of IP sets.
  8299. @end itemize\n
  8300. then IP sets may be the proper tool for you.")
  8301. (license license:gpl2+)))
  8302. (define-public liburing
  8303. (package
  8304. (name "liburing")
  8305. (version "0.7")
  8306. (source (origin
  8307. (method git-fetch)
  8308. (uri (git-reference
  8309. (url "https://git.kernel.dk/liburing")
  8310. (commit (string-append "liburing-" version))))
  8311. (file-name (git-file-name name version))
  8312. (sha256
  8313. (base32
  8314. "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
  8315. (build-system gnu-build-system)
  8316. (arguments
  8317. `(;; Tests are dependent on kernel version and features
  8318. #:tests? #f
  8319. #:phases
  8320. (modify-phases %standard-phases
  8321. (replace 'configure
  8322. ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
  8323. ;; --enable-fast-install, and --build
  8324. (lambda* (#:key outputs #:allow-other-keys)
  8325. (let ((out (assoc-ref outputs "out")))
  8326. (setenv "SHELL" (which "sh"))
  8327. (setenv "CONFIG_SHELL" (which "sh"))
  8328. (invoke "./configure" (string-append "--prefix=" out))))))))
  8329. (home-page "https://github.com/axboe/liburing")
  8330. (synopsis "Interface to the Linux kernel @code{io_uring} interface")
  8331. (description "This is the io_uring library, liburing. liburing provides
  8332. helpers to setup and teardown io_uring instances, and also a simplified
  8333. interface for applications that don't need (or want) to deal with the full
  8334. kernel side implementation.")
  8335. (license license:expat)))
  8336. (define-public erofs-utils
  8337. (package
  8338. (name "erofs-utils")
  8339. (version "1.4")
  8340. (source
  8341. (origin
  8342. (method git-fetch)
  8343. (uri (git-reference
  8344. (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
  8345. (commit (string-append "v" version))))
  8346. (file-name (git-file-name name version))
  8347. (sha256
  8348. (base32 "1ygaw69pfz2hfzw9cqzg9rfnjzrdbfkwsiinz6qs2h56dssjz0y9"))))
  8349. (build-system gnu-build-system)
  8350. (inputs
  8351. (list lz4
  8352. `(,util-linux "lib")))
  8353. (native-inputs
  8354. (list autoconf automake libtool pkg-config))
  8355. (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
  8356. (synopsis "User-space tools for the EROFS file system")
  8357. (description
  8358. "@acronym{EROFS, The Enhanced Read-Only File System} is a compressed,
  8359. read-only file system optimized for resource-scarce devices. This package
  8360. provides user-space tools for creating EROFS file systems.")
  8361. (license license:gpl2+)))
  8362. (define-public rasdaemon
  8363. (package
  8364. (name "rasdaemon")
  8365. (version "0.6.7")
  8366. (source
  8367. (origin
  8368. (method git-fetch)
  8369. (uri (git-reference
  8370. (url "https://github.com/mchehab/rasdaemon")
  8371. (commit (string-append "v" version))))
  8372. (file-name (git-file-name name version))
  8373. (sha256
  8374. (base32 "12ih96jwmr7imp9zyckf9zjqqm5ra1kv5fj6kbw71y6yl31069dz"))))
  8375. (native-inputs (list autoconf automake libtool))
  8376. (inputs (list sqlite))
  8377. (arguments
  8378. `(#:configure-flags
  8379. (list "--enable-all"
  8380. ;; Don't install unused /etc/sysconfig/rasdaemon environment file.
  8381. "--with-sysconfdefdir=."
  8382. "--localstatedir=/var")
  8383. #:phases
  8384. (modify-phases %standard-phases
  8385. (add-before 'configure 'munge-autotools
  8386. (lambda _
  8387. ;; For some reason upstream forces sysconfdir=/etc. This results
  8388. ;; in EPERM during the install phase. Removing the offending
  8389. ;; line lets sysconfdir correctly pick up DESTDIR.
  8390. (substitute* "configure.ac"
  8391. (("^test .* sysconfdir=/etc\n$") ""))
  8392. ;; Upstream tries to create /var/lib/rasdaemon at install time.
  8393. ;; This results in EPERM on guix. Instead, the service should
  8394. ;; create this at activation time.
  8395. (substitute* "Makefile.am"
  8396. (("^\\s*\\$\\(install_sh\\) -d .*@RASSTATEDIR@.*$") "")))))))
  8397. (build-system gnu-build-system)
  8398. (home-page "https://github.com/mchehab/rasdaemon")
  8399. (synopsis "Platform Reliability, Availability, and Serviceability tools")
  8400. (description
  8401. "The @code{rasdaemon} daemon monitors platform @acronym{RAS, Reliability
  8402. Availability and Serviceability} reports from Linux kernel trace events.
  8403. These trace events are logged in @file{/sys/kernel/debug/tracing} and reported
  8404. through standard log mechanisms like syslog.")
  8405. (license license:gpl2)))
  8406. (define-public libgpiod
  8407. (package
  8408. (name "libgpiod")
  8409. (version "1.6.3")
  8410. (source
  8411. (origin
  8412. (method git-fetch)
  8413. (uri
  8414. (git-reference
  8415. (url "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git")
  8416. (commit (string-append "v" version))))
  8417. (file-name (git-file-name name version))
  8418. (sha256 (base32 "0rv8a11hx3pc6sdw6nfc6k35hkp2clb3v53n1381cvip8fzhbsad"))))
  8419. (build-system gnu-build-system)
  8420. (arguments
  8421. `(#:configure-flags
  8422. '("--enable-tools=yes"
  8423. "--enable-bindings-cxx"
  8424. "--enable-bindings-python")))
  8425. (native-inputs
  8426. (list automake
  8427. autoconf
  8428. libtool
  8429. autoconf-archive
  8430. pkg-config
  8431. python-3))
  8432. (synopsis "Interact with the Linux GPIO character device")
  8433. (description
  8434. "This package provides a C library with C++/Python bindings and
  8435. command-line tools for interacting with GPIO devices that avoids the usage of
  8436. older system-wide @file{/sys} interface.")
  8437. (home-page "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/")
  8438. (license (list license:lgpl2.1+ ;; libgpiod
  8439. license:gpl2+ ;; gpio-tools
  8440. license:lgpl3+)))) ;; C++ bindings
  8441. (define-public libtree
  8442. (package
  8443. (name "libtree")
  8444. (version "3.0.2")
  8445. (source
  8446. (origin
  8447. (method git-fetch)
  8448. (uri (git-reference
  8449. (url "https://github.com/haampie/libtree")
  8450. (commit (string-append "v" version))))
  8451. (file-name (git-file-name name version))
  8452. (sha256
  8453. (base32 "072624anz9g01mp5vfkahfmzy0nb7axg5rwk3n1yrdm4hr3d4zrb"))))
  8454. (arguments
  8455. (list #:make-flags
  8456. ;; NOTE: Official documentation recommends to build libtree with
  8457. ;; "-static" flag.
  8458. #~(list (string-append "CC=" #$(cc-for-target))
  8459. (string-append "PREFIX=" #$output))
  8460. #:phases
  8461. #~(modify-phases %standard-phases
  8462. (delete 'configure))))
  8463. (build-system gnu-build-system)
  8464. (home-page "https://github.com/haampie/libtree")
  8465. (synopsis "Show output of @command{ldd} as a tree")
  8466. (description
  8467. "This tool turns @command{ldd} into a tree and explains how shared
  8468. libraries are found or why they cannot be located.")
  8469. (license license:expat)))