linux.scm 210 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 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 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 Efraim Flashner <efraim@flashner.co.il>
  9. ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
  10. ;;; Copyright © 2016, 2017, 2018, 2019 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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  15. ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
  16. ;;; Copyright © 2016 David Craven <david@craven.ch>
  17. ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
  18. ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
  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 Nils Gillmann <ng0@n0.is>
  22. ;;; Copyright © 2017, 2018 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 Mathieu Othacehe <m.othacehe@gmail.com>
  26. ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
  27. ;;; Copyright © 2017, 2018 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 Brendan Tildesley <brendan.tildesley@openmailbox.org>
  32. ;;; Copyright © 2018 Manuel Graf <graf@init.at>
  33. ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
  34. ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
  35. ;;;
  36. ;;; This file is part of GNU Guix.
  37. ;;;
  38. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  39. ;;; under the terms of the GNU General Public License as published by
  40. ;;; the Free Software Foundation; either version 3 of the License, or (at
  41. ;;; your option) any later version.
  42. ;;;
  43. ;;; GNU Guix is distributed in the hope that it will be useful, but
  44. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  45. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  46. ;;; GNU General Public License for more details.
  47. ;;;
  48. ;;; You should have received a copy of the GNU General Public License
  49. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  50. (define-module (gnu packages linux)
  51. #:use-module (gnu packages)
  52. #:use-module (gnu packages acl)
  53. #:use-module (gnu packages admin)
  54. #:use-module (gnu packages algebra)
  55. #:use-module (gnu packages attr)
  56. #:use-module (gnu packages audio)
  57. #:use-module (gnu packages autotools)
  58. #:use-module (gnu packages backup)
  59. #:use-module (gnu packages base)
  60. #:use-module (gnu packages bash)
  61. #:use-module (gnu packages bison)
  62. #:use-module (gnu packages calendar)
  63. #:use-module (gnu packages check)
  64. #:use-module (gnu packages crypto)
  65. #:use-module (gnu packages cryptsetup)
  66. #:use-module (gnu packages compression)
  67. #:use-module (gnu packages dbm)
  68. #:use-module (gnu packages datastructures)
  69. #:use-module (gnu packages docbook)
  70. #:use-module (gnu packages documentation)
  71. #:use-module (gnu packages elf)
  72. #:use-module (gnu packages flex)
  73. #:use-module (gnu packages file)
  74. #:use-module (gnu packages freedesktop)
  75. #:use-module (gnu packages gcc)
  76. #:use-module (gnu packages gettext)
  77. #:use-module (gnu packages glib)
  78. #:use-module (gnu packages gnuzilla)
  79. #:use-module (gnu packages gperf)
  80. #:use-module (gnu packages gtk)
  81. #:use-module (gnu packages libunwind)
  82. #:use-module (gnu packages libusb)
  83. #:use-module (gnu packages man)
  84. #:use-module (gnu packages maths)
  85. #:use-module (gnu packages multiprecision)
  86. #:use-module (gnu packages ncurses)
  87. #:use-module (gnu packages netpbm)
  88. #:use-module (gnu packages nettle)
  89. #:use-module (gnu packages networking)
  90. #:use-module (gnu packages ninja)
  91. #:use-module (gnu packages perl)
  92. #:use-module (gnu packages pciutils)
  93. #:use-module (gnu packages pkg-config)
  94. #:use-module (gnu packages popt)
  95. #:use-module (gnu packages pulseaudio)
  96. #:use-module (gnu packages python)
  97. #:use-module (gnu packages readline)
  98. #:use-module (gnu packages rrdtool)
  99. #:use-module (gnu packages samba)
  100. #:use-module (gnu packages slang)
  101. #:use-module (gnu packages storage)
  102. #:use-module (gnu packages texinfo)
  103. #:use-module (gnu packages tls)
  104. #:use-module (gnu packages valgrind)
  105. #:use-module (gnu packages video)
  106. #:use-module (gnu packages web)
  107. #:use-module (gnu packages xiph)
  108. #:use-module (gnu packages xml)
  109. #:use-module (gnu packages xdisorg)
  110. #:use-module (gnu packages xorg)
  111. #:use-module (gnu packages groff)
  112. #:use-module (gnu packages selinux)
  113. #:use-module (gnu packages swig)
  114. #:use-module (guix build-system cmake)
  115. #:use-module (guix build-system gnu)
  116. #:use-module (guix build-system python)
  117. #:use-module (guix build-system trivial)
  118. #:use-module (guix download)
  119. #:use-module (guix git-download)
  120. #:use-module ((guix licenses) #:prefix license:)
  121. #:use-module (guix packages)
  122. #:use-module (guix utils)
  123. #:use-module (srfi srfi-1)
  124. #:use-module (srfi srfi-2)
  125. #:use-module (srfi srfi-26)
  126. #:use-module (ice-9 match))
  127. (define-public (system->linux-architecture arch)
  128. "Return the Linux architecture name for ARCH, a Guix system name such as
  129. \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
  130. (let ((arch (car (string-split arch #\-))))
  131. (cond ((string=? arch "i686") "i386")
  132. ((string-prefix? "mips" arch) "mips")
  133. ((string-prefix? "arm" arch) "arm")
  134. ((string-prefix? "aarch64" arch) "arm64")
  135. ((string-prefix? "alpha" arch) "alpha")
  136. ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
  137. ((string-prefix? "s390" arch) "s390")
  138. (else arch))))
  139. (define-public (system->defconfig system)
  140. "Some systems (notably powerpc-linux) require a special target for kernel
  141. defconfig. Return the appropriate make target if applicable, otherwise return
  142. \"defconfig\"."
  143. (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
  144. ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
  145. (else "defconfig")))
  146. (define (linux-libre-urls version)
  147. "Return a list of URLs for Linux-Libre VERSION."
  148. (list (string-append
  149. "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
  150. version "-gnu/linux-libre-" version "-gnu.tar.xz")
  151. ;; XXX: Work around <http://bugs.gnu.org/14851>.
  152. (string-append
  153. "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
  154. version "-gnu.tar.xz")
  155. ;; Maybe this URL will become valid eventually.
  156. (string-append
  157. "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
  158. version "-gnu.tar.xz")))
  159. (define-public linux-libre-headers
  160. (package
  161. (name "linux-libre-headers")
  162. (version "4.14.67")
  163. (source (origin
  164. (method url-fetch)
  165. (uri (linux-libre-urls version))
  166. (sha256
  167. (base32
  168. "050zvdxjy6sc64q75pr1gxsmh49chwav2pwxz8xlif39bvahnrpg"))))
  169. (build-system gnu-build-system)
  170. (native-inputs `(("perl" ,perl)))
  171. (arguments
  172. `(#:modules ((guix build gnu-build-system)
  173. (guix build utils)
  174. (srfi srfi-1))
  175. #:phases
  176. (modify-phases %standard-phases
  177. (delete 'configure)
  178. (replace 'build
  179. (lambda _
  180. (let ((arch ,(system->linux-architecture
  181. (or (%current-target-system)
  182. (%current-system))))
  183. (defconfig ,(system->defconfig
  184. (or (%current-target-system)
  185. (%current-system)))))
  186. (setenv "ARCH" arch)
  187. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  188. (invoke "make" defconfig)
  189. (invoke "make" "mrproper" "headers_check"))))
  190. (replace 'install
  191. (lambda* (#:key outputs #:allow-other-keys)
  192. (let ((out (assoc-ref outputs "out")))
  193. (invoke "make"
  194. (string-append "INSTALL_HDR_PATH=" out)
  195. "headers_install")
  196. (mkdir (string-append out "/include/config"))
  197. (call-with-output-file
  198. (string-append out
  199. "/include/config/kernel.release")
  200. (lambda (p)
  201. (format p "~a-default~%" ,version)))
  202. ;; Remove the '.install' and '..install.cmd' files; the
  203. ;; latter contains store paths, which pulls in bootstrap
  204. ;; binaries in the build environment, and prevents bit
  205. ;; reproducibility for the bootstrap binaries.
  206. (for-each delete-file (find-files out "\\.install"))
  207. #t))))
  208. #:allowed-references ()
  209. #:tests? #f))
  210. (home-page "https://www.gnu.org/software/linux-libre/")
  211. (synopsis "GNU Linux-Libre kernel headers")
  212. (description "Headers of the Linux-Libre kernel.")
  213. (license license:gpl2)))
  214. (define %boot-logo-patch
  215. ;; Linux-Libre boot logo featuring Freedo and a gnu.
  216. (origin
  217. (method url-fetch)
  218. (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
  219. "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
  220. (sha256
  221. (base32
  222. "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
  223. (define %linux-libre-arm-export-__sync_icache_dcache-patch
  224. (origin
  225. (method url-fetch)
  226. (uri (string-append
  227. "https://salsa.debian.org/kernel-team/linux"
  228. "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
  229. "/debian/patches/bugfix/arm/"
  230. "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
  231. (file-name "linux-libre-4.19-arm-export-__sync_icache_dcache.patch")
  232. (sha256
  233. (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
  234. (define* (kernel-config arch #:key variant)
  235. "Return the absolute file name of the Linux-Libre build configuration file
  236. for ARCH and optionally VARIANT, or #f if there is no such configuration."
  237. (let* ((name (string-append (if variant (string-append variant "-") "")
  238. (if (string=? "i386" arch) "i686" arch) ".conf"))
  239. (file (string-append "linux-libre/" name)))
  240. (search-auxiliary-file file)))
  241. (define %default-extra-linux-options
  242. `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
  243. ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
  244. ;; Modules required for initrd:
  245. ("CONFIG_NET_9P" . m)
  246. ("CONFIG_NET_9P_VIRTIO" . m)
  247. ("CONFIG_VIRTIO_BLK" . m)
  248. ("CONFIG_VIRTIO_NET" . m)
  249. ("CONFIG_VIRTIO_PCI" . m)
  250. ("CONFIG_VIRTIO_BALLOON" . m)
  251. ("CONFIG_VIRTIO_MMIO" . m)
  252. ("CONFIG_FUSE_FS" . m)
  253. ("CONFIG_CIFS" . m)
  254. ("CONFIG_9P_FS" . m)))
  255. (define (config->string options)
  256. (string-join (map (match-lambda
  257. ((option . 'm)
  258. (string-append option "=m"))
  259. ((option . #t)
  260. (string-append option "=y"))
  261. ((option . #f)
  262. (string-append option "=n")))
  263. options)
  264. "\n"))
  265. (define* (make-linux-libre version hash supported-systems
  266. #:key
  267. ;; A function that takes an arch and a variant.
  268. ;; See kernel-config for an example.
  269. (extra-version #f)
  270. (configuration-file #f)
  271. (defconfig "defconfig")
  272. (extra-options %default-extra-linux-options)
  273. (patches (list %boot-logo-patch)))
  274. (package
  275. (name (if extra-version
  276. (string-append "linux-libre-" extra-version)
  277. "linux-libre"))
  278. (version version)
  279. (source (origin
  280. (method url-fetch)
  281. (uri (linux-libre-urls version))
  282. (sha256 (base32 hash))
  283. (patches patches)))
  284. (supported-systems supported-systems)
  285. (build-system gnu-build-system)
  286. (native-inputs
  287. `(("perl" ,perl)
  288. ("bc" ,bc)
  289. ("openssl" ,openssl)
  290. ("kmod" ,kmod)
  291. ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
  292. ("flex" ,flex)
  293. ("bison" ,bison)
  294. ;; Build with GCC-7 for full retpoline support.
  295. ;; FIXME: Remove this when our default compiler has retpoline support.
  296. ("gcc" ,gcc-7)
  297. ;; These are needed to compile the GCC plugins.
  298. ("gmp" ,gmp)
  299. ("mpfr" ,mpfr)
  300. ("mpc" ,mpc)
  301. ,@(match (and configuration-file
  302. (configuration-file
  303. (system->linux-architecture
  304. (or (%current-target-system) (%current-system)))
  305. #:variant (version-major+minor version)))
  306. (#f ;no config for this platform
  307. '())
  308. ((? string? config)
  309. `(("kconfig" ,config))))))
  310. (arguments
  311. `(#:modules ((guix build gnu-build-system)
  312. (guix build utils)
  313. (srfi srfi-1)
  314. (ice-9 match))
  315. #:phases
  316. (modify-phases %standard-phases
  317. (add-after 'unpack 'patch-/bin/pwd
  318. (lambda _
  319. (substitute* (find-files "." "^Makefile(\\.include)?$")
  320. (("/bin/pwd") "pwd"))
  321. #t))
  322. (add-before 'configure 'work-around-gcc-7-include-path-issue
  323. (lambda _
  324. (unsetenv "C_INCLUDE_PATH")
  325. (unsetenv "CPLUS_INCLUDE_PATH")
  326. #t))
  327. (replace 'configure
  328. (lambda* (#:key inputs native-inputs target #:allow-other-keys)
  329. ;; Avoid introducing timestamps
  330. (setenv "KCONFIG_NOTIMESTAMP" "1")
  331. (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
  332. ;; Set ARCH and CROSS_COMPILE
  333. (let ((arch ,(system->linux-architecture
  334. (or (%current-target-system)
  335. (%current-system)))))
  336. (setenv "ARCH" arch)
  337. (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
  338. (when target
  339. (setenv "CROSS_COMPILE" (string-append target "-"))
  340. (format #t "`CROSS_COMPILE' set to `~a'~%"
  341. (getenv "CROSS_COMPILE"))))
  342. (setenv "EXTRA_VERSION" ,extra-version)
  343. (let ((build (assoc-ref %standard-phases 'build))
  344. (config (assoc-ref (or native-inputs inputs) "kconfig")))
  345. ;; Use a custom kernel configuration file or a default
  346. ;; configuration file.
  347. (if config
  348. (begin
  349. (copy-file config ".config")
  350. (chmod ".config" #o666))
  351. (invoke "make" ,defconfig))
  352. ;; Appending works even when the option wasn't in the
  353. ;; file. The last one prevails if duplicated.
  354. (let ((port (open-file ".config" "a"))
  355. (extra-configuration ,(config->string extra-options)))
  356. (display extra-configuration port)
  357. (close-port port))
  358. (invoke "make" "oldconfig"))))
  359. (replace 'install
  360. (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
  361. (let* ((out (assoc-ref outputs "out"))
  362. (moddir (string-append out "/lib/modules"))
  363. (dtbdir (string-append out "/lib/dtbs"))
  364. (kmod (assoc-ref (or native-inputs inputs) "kmod")))
  365. ;; Install kernel image, kernel configuration and link map.
  366. (for-each (lambda (file) (install-file file out))
  367. (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
  368. ;; Install device tree files
  369. (unless (null? (find-files "." "\\.dtb$"))
  370. (mkdir-p dtbdir)
  371. (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
  372. "dtbs_install"))
  373. ;; Install kernel modules
  374. (mkdir-p moddir)
  375. (invoke "make"
  376. (string-append "DEPMOD=" kmod "/bin/depmod")
  377. (string-append "MODULE_DIR=" moddir)
  378. (string-append "INSTALL_PATH=" out)
  379. (string-append "INSTALL_MOD_PATH=" out)
  380. "INSTALL_MOD_STRIP=1"
  381. "modules_install")))))
  382. #:tests? #f))
  383. (home-page "https://www.gnu.org/software/linux-libre/")
  384. (synopsis "100% free redistribution of a cleaned Linux kernel")
  385. (description
  386. "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
  387. It has been modified to remove all non-free binary blobs.")
  388. (license license:gpl2)))
  389. (define %linux-libre-version "4.20.12")
  390. (define %linux-libre-hash "16w52g5s7qhvmmz3srai1myl8949nxv6cqybiw3wx3mwcvp95mlh")
  391. (define %linux-libre-4.20-patches
  392. (list %boot-logo-patch
  393. %linux-libre-arm-export-__sync_icache_dcache-patch))
  394. (define-public linux-libre
  395. (make-linux-libre %linux-libre-version
  396. %linux-libre-hash
  397. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
  398. #:patches %linux-libre-4.20-patches
  399. #:configuration-file kernel-config))
  400. (define %linux-libre-4.19-version "4.19.25")
  401. (define %linux-libre-4.19-hash "0kg8gibmyihh4lr7ksp8szrs0jx5sr2g56szm69lff1zmsywpqc6")
  402. (define %linux-libre-4.19-patches
  403. (list %boot-logo-patch
  404. %linux-libre-arm-export-__sync_icache_dcache-patch))
  405. (define-public linux-libre-4.19
  406. (make-linux-libre %linux-libre-4.19-version
  407. %linux-libre-4.19-hash
  408. '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
  409. #:patches %linux-libre-4.19-patches
  410. #:configuration-file kernel-config))
  411. (define %linux-libre-4.14-version "4.14.103")
  412. (define %linux-libre-4.14-hash "05zcb7kaj6cni4v0s0qdywwrqzlr63mkqbhxkbmrjz4blxxxdszg")
  413. (define-public linux-libre-4.14
  414. (make-linux-libre %linux-libre-4.14-version
  415. %linux-libre-4.14-hash
  416. '("x86_64-linux" "i686-linux" "armhf-linux")
  417. #:configuration-file kernel-config))
  418. (define-public linux-libre-4.9
  419. (make-linux-libre "4.9.160"
  420. "1j3z3kn4n9vm7fkzb63ddmxba9r2pm623kar1jn7i5xsd1vz4qr9"
  421. '("x86_64-linux" "i686-linux")
  422. #:configuration-file kernel-config))
  423. (define-public linux-libre-4.4
  424. (make-linux-libre "4.4.176"
  425. "0c300zqmsadahs2fpzxh6cn7q3h7jxq69msd17rh8v3wnvql8vzx"
  426. '("x86_64-linux" "i686-linux")
  427. #:configuration-file kernel-config))
  428. (define-public linux-libre-arm-generic
  429. (make-linux-libre %linux-libre-version
  430. %linux-libre-hash
  431. '("armhf-linux")
  432. #:patches %linux-libre-4.20-patches
  433. #:defconfig "multi_v7_defconfig"
  434. #:extra-version "arm-generic"))
  435. (define-public linux-libre-arm-generic-4.19
  436. (make-linux-libre %linux-libre-4.19-version
  437. %linux-libre-4.19-hash
  438. '("armhf-linux")
  439. #:patches %linux-libre-4.19-patches
  440. #:defconfig "multi_v7_defconfig"
  441. #:extra-version "arm-generic"))
  442. (define-public linux-libre-arm-generic-4.14
  443. (make-linux-libre %linux-libre-4.14-version
  444. %linux-libre-4.14-hash
  445. '("armhf-linux")
  446. #:defconfig "multi_v7_defconfig"
  447. #:extra-version "arm-generic"))
  448. (define-public linux-libre-arm-omap2plus
  449. (make-linux-libre %linux-libre-version
  450. %linux-libre-hash
  451. '("armhf-linux")
  452. #:patches %linux-libre-4.20-patches
  453. #:defconfig "omap2plus_defconfig"
  454. #:extra-version "arm-omap2plus"))
  455. (define-public linux-libre-arm-omap2plus-4.19
  456. (make-linux-libre %linux-libre-4.19-version
  457. %linux-libre-4.19-hash
  458. '("armhf-linux")
  459. #:patches %linux-libre-4.19-patches
  460. #:defconfig "omap2plus_defconfig"
  461. #:extra-version "arm-omap2plus"))
  462. (define-public linux-libre-arm-omap2plus-4.14
  463. (make-linux-libre %linux-libre-4.14-version
  464. %linux-libre-4.14-hash
  465. '("armhf-linux")
  466. #:defconfig "omap2plus_defconfig"
  467. #:extra-version "arm-omap2plus"))
  468. ;;;
  469. ;;; Pluggable authentication modules (PAM).
  470. ;;;
  471. (define-public linux-pam
  472. (package
  473. (name "linux-pam")
  474. (version "1.3.1")
  475. (source
  476. (origin
  477. (method url-fetch)
  478. (uri (string-append
  479. "https://github.com/linux-pam/linux-pam/releases/download/v"
  480. version "/Linux-PAM-" version ".tar.xz"))
  481. (sha256
  482. (base32
  483. "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
  484. (patches (search-patches "linux-pam-no-setfsuid.patch"))))
  485. (build-system gnu-build-system)
  486. (native-inputs
  487. `(("flex" ,flex)
  488. ;; TODO: optional dependencies
  489. ;; ("libxcrypt" ,libxcrypt)
  490. ;; ("cracklib" ,cracklib)
  491. ))
  492. (arguments
  493. `(;; Most users, such as `shadow', expect the headers to be under
  494. ;; `security'.
  495. #:configure-flags (list (string-append "--includedir="
  496. (assoc-ref %outputs "out")
  497. "/include/security")
  498. ;; XXX: <rpc/rpc.h> is missing from glibc when
  499. ;; cross-compiling, so we have to disable NIS
  500. ;; support altogether.
  501. ,@(if (%current-target-system)
  502. '("--disable-nis")
  503. '()))
  504. ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
  505. ;; isn't available.
  506. #:tests? #f))
  507. (home-page "http://www.linux-pam.org/")
  508. (synopsis "Pluggable authentication modules for Linux")
  509. (description
  510. "A *Free* project to implement OSF's RFC 86.0.
  511. Pluggable authentication modules are small shared object files that can
  512. be used through the PAM API to perform tasks, like authenticating a user
  513. at login. Local and dynamic reconfiguration are its key features.")
  514. (license license:bsd-3)))
  515. (define-public linux-pam-1.2
  516. (package
  517. (inherit linux-pam)
  518. (version "1.2.1")
  519. (source
  520. (origin
  521. (method url-fetch)
  522. (uri (string-append
  523. "http://www.linux-pam.org/library/"
  524. "Linux-PAM-" version ".tar.bz2"))
  525. (sha256
  526. (base32
  527. "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
  528. (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
  529. ;;;
  530. ;;; Miscellaneous.
  531. ;;;
  532. (define-public psmisc
  533. (package
  534. (name "psmisc")
  535. (version "23.2")
  536. (source
  537. (origin
  538. (method url-fetch)
  539. (uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
  540. version ".tar.xz"))
  541. (sha256
  542. (base32
  543. "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
  544. (build-system gnu-build-system)
  545. (inputs `(("ncurses" ,ncurses)))
  546. (home-page "https://gitlab.com/psmisc/psmisc")
  547. (synopsis
  548. "Small utilities that use the proc file system")
  549. (description
  550. "This PSmisc package is a set of some small useful utilities that
  551. use the proc file system. We're not about changing the world, but
  552. providing the system administrator with some help in common tasks.")
  553. (license license:gpl2+)))
  554. (define-public util-linux
  555. (package
  556. (name "util-linux")
  557. (version "2.32.1")
  558. (source (origin
  559. (method url-fetch)
  560. (uri (string-append "mirror://kernel.org/linux/utils/"
  561. name "/v" (version-major+minor version) "/"
  562. name "-" version ".tar.xz"))
  563. (sha256
  564. (base32
  565. "1ck7d8srw5szpjq7v0gpmjahnjs6wgqzm311ki4gazww6xx71rl6"))
  566. (patches (search-patches "util-linux-tests.patch"))
  567. (modules '((guix build utils)))
  568. (snippet
  569. ;; We take 'nologin' from Shadow, the 'logger' program from
  570. ;; GNU Inetutils and 'kill' from GNU Coreutils.
  571. '(begin
  572. (substitute* "configure"
  573. (("build_nologin=yes") "build_nologin=no")
  574. (("build_logger=yes") "build_logger=no")
  575. (("build_kill=yes") "build_kill=no"))
  576. #t))))
  577. (build-system gnu-build-system)
  578. (outputs '("out"
  579. "static")) ; >2 MiB of static .a libraries
  580. (arguments
  581. `(#:configure-flags (list "--disable-use-tty-group"
  582. "--enable-fs-paths-default=/run/current-system/profile/sbin"
  583. ;; Don't try to chown root:root mount and umount
  584. "--disable-makeinstall-chown"
  585. ;; Install completions where our
  586. ;; bash-completion package expects them.
  587. (string-append "--with-bashcompletiondir="
  588. (assoc-ref %outputs "out")
  589. "/etc/bash_completion.d"))
  590. #:phases (modify-phases %standard-phases
  591. (add-before
  592. 'build 'set-umount-file-name
  593. (lambda* (#:key outputs #:allow-other-keys)
  594. ;; Tell 'eject' the right file name of 'umount'.
  595. (let ((out (assoc-ref outputs "out")))
  596. (substitute* "sys-utils/eject.c"
  597. (("\"/bin/umount\"")
  598. (string-append "\"" out "/bin/umount\"")))
  599. #t)))
  600. (add-before
  601. 'check 'pre-check
  602. (lambda* (#:key inputs outputs #:allow-other-keys)
  603. (let ((out (assoc-ref outputs "out"))
  604. (net (assoc-ref inputs "net-base")))
  605. ;; Change the test to refer to the right file.
  606. (substitute* "tests/ts/misc/mcookie"
  607. (("/etc/services")
  608. (string-append net "/etc/services")))
  609. #t)))
  610. (add-after
  611. 'install 'move-static-libraries
  612. (lambda* (#:key outputs #:allow-other-keys)
  613. (let ((out (assoc-ref outputs "out"))
  614. (static (assoc-ref outputs "static")))
  615. (mkdir-p (string-append static "/lib"))
  616. (with-directory-excursion out
  617. (for-each (lambda (file)
  618. (rename-file file
  619. (string-append static "/"
  620. file)))
  621. (find-files "lib" "\\.a$"))
  622. ;; Remove references to the static library from the '.la'
  623. ;; files so that Libtool does the right thing when both
  624. ;; the shared and static library is available.
  625. (substitute* (find-files "lib" "\\.la$")
  626. (("old_library=.*") "old_library=''\n")))
  627. #t))))))
  628. (inputs `(("zlib" ,zlib)
  629. ("ncurses" ,ncurses)
  630. ;; XXX: This is so that the 'pre-check' phase can find it.
  631. ,@(if (%current-target-system)
  632. `(("net-base" ,net-base))
  633. '())))
  634. (native-inputs
  635. `(("perl" ,perl)
  636. ("net-base" ,net-base))) ;for tests
  637. (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
  638. (synopsis "Collection of utilities for the Linux kernel")
  639. (description "Util-linux is a diverse collection of Linux kernel
  640. utilities. It provides dmesg and includes tools for working with file systems,
  641. block devices, UUIDs, TTYs, and many other tools.")
  642. ;; Note that util-linux doesn't use the same license for all the
  643. ;; code. GPLv2+ is the default license for a code without an
  644. ;; explicitly defined license.
  645. (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
  646. license:bsd-4 license:public-domain))))
  647. (define-public ddate
  648. (package
  649. (name "ddate")
  650. (version "0.2.2")
  651. (source (origin
  652. (method url-fetch)
  653. (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
  654. version ".tar.gz"))
  655. (file-name (string-append name "-" version ".tar.gz"))
  656. (sha256
  657. (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
  658. (build-system cmake-build-system)
  659. (arguments '(#:tests? #f))
  660. (home-page "https://github.com/bo0ts/ddate")
  661. (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
  662. (description
  663. "ddate displays the Discordian date and holidays of a given date.
  664. The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
  665. by Robert Shea and Robert Anton Wilson.")
  666. (license license:public-domain)))
  667. (define-public procps
  668. (package
  669. (name "procps")
  670. (version "3.3.15")
  671. (source (origin
  672. (method url-fetch)
  673. (uri (string-append "mirror://sourceforge/procps-ng/Production/"
  674. "procps-ng-" version ".tar.xz"))
  675. (sha256
  676. (base32
  677. "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
  678. (build-system gnu-build-system)
  679. (arguments
  680. '(#:modules ((guix build utils)
  681. (guix build gnu-build-system)
  682. (srfi srfi-1)
  683. (srfi srfi-26))
  684. #:phases
  685. (modify-phases %standard-phases
  686. (add-after
  687. 'install 'post-install
  688. ;; Remove commands and man pages redudant with
  689. ;; Coreutils.
  690. (lambda* (#:key outputs #:allow-other-keys)
  691. (let* ((out (assoc-ref outputs "out"))
  692. (dup (append-map (cut find-files out <>)
  693. '("^kill" "^uptime"))))
  694. (for-each delete-file dup)
  695. #t))))))
  696. (inputs `(("ncurses" ,ncurses)))
  697. (home-page "https://gitlab.com/procps-ng/procps/")
  698. (synopsis "Utilities that give information about processes")
  699. (description
  700. "Procps is the package that has a bunch of small useful utilities
  701. that give information about processes using the Linux /proc file system.
  702. The package includes the programs ps, top, vmstat, w, kill, free,
  703. slabtop, and skill.")
  704. (license license:gpl2)))
  705. (define-public usbutils
  706. (package
  707. (name "usbutils")
  708. (version "010")
  709. (source
  710. (origin
  711. (method url-fetch)
  712. (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
  713. "usbutils-" version ".tar.xz"))
  714. (sha256
  715. (base32
  716. "06aag4jfgsfjxk563xsp9ik9nadihmasrr37a1gb0vwqni5kdiv1"))))
  717. (build-system gnu-build-system)
  718. (inputs
  719. `(("libusb" ,libusb)
  720. ("eudev" ,eudev)))
  721. (native-inputs
  722. `(("pkg-config" ,pkg-config)))
  723. (home-page "http://www.linux-usb.org/")
  724. (synopsis
  725. "Tools for working with USB devices, such as lsusb")
  726. (description
  727. "Tools for working with USB devices, such as lsusb.")
  728. (license license:gpl2+)))
  729. (define-public e2fsprogs
  730. (package
  731. (name "e2fsprogs")
  732. (version "1.44.5")
  733. (source (origin
  734. (method url-fetch)
  735. (uri (string-append
  736. "mirror://kernel.org/linux/kernel/people/tytso/"
  737. name "/v" version "/"
  738. name "-" version ".tar.xz"))
  739. (sha256
  740. (base32
  741. "1ff56h6h1h17sj2zvlddv5c88nmbx46p1fcbh6b0s5k9kl3b6pms"))))
  742. (build-system gnu-build-system)
  743. (inputs `(("util-linux" ,util-linux)))
  744. (native-inputs `(("pkg-config" ,pkg-config)
  745. ("texinfo" ,texinfo) ;for the libext2fs Info manual
  746. ;; For tests.
  747. ("perl" ,perl)
  748. ("procps" ,procps)))
  749. (arguments
  750. '(;; util-linux is the preferred source for some of the libraries and
  751. ;; commands, so disable them (see, e.g.,
  752. ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
  753. #:configure-flags (list "--disable-libblkid"
  754. "--disable-libuuid" "--disable-uuidd"
  755. "--disable-fsck"
  756. ;; Use symlinks instead of hard links for
  757. ;; 'fsck.extN' etc. This makes the resulting nar
  758. ;; smaller and is preserved across copies.
  759. "--enable-symlink-install"
  760. (string-append "LDFLAGS=-Wl,-rpath="
  761. (assoc-ref %outputs "out")
  762. "/lib")
  763. ;; Install libext2fs et al.
  764. "--enable-elf-shlibs")
  765. #:phases
  766. (modify-phases %standard-phases
  767. (add-before 'configure 'patch-shells
  768. (lambda _
  769. (substitute* "configure"
  770. (("/bin/sh (.*)parse-types.sh" _ dir)
  771. (string-append (which "sh") " " dir
  772. "parse-types.sh")))
  773. (substitute* "MCONFIG.in"
  774. (("INSTALL_SYMLINK = /bin/sh")
  775. "INSTALL_SYMLINK = sh"))
  776. (substitute* (find-files "." "^Makefile.in$")
  777. (("#!/bin/sh")
  778. (string-append "#!" (which "sh"))))
  779. #t))
  780. (add-after 'install 'install-libs
  781. (lambda* (#:key outputs #:allow-other-keys)
  782. (let* ((out (assoc-ref outputs "out"))
  783. (lib (string-append out "/lib")))
  784. (invoke "make" "install-libs")
  785. ;; Make the .a writable so that 'strip' works.
  786. ;; Failing to do that, due to debug symbols, we
  787. ;; retain a reference to the final
  788. ;; linux-libre-headers, which refer to the
  789. ;; bootstrap binaries.
  790. (let ((archives (find-files lib "\\.a$")))
  791. (for-each (lambda (file)
  792. (chmod file #o666))
  793. archives))
  794. #t))))))
  795. (home-page "http://e2fsprogs.sourceforge.net/")
  796. (synopsis "Creating and checking ext2/ext3/ext4 file systems")
  797. (description
  798. "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
  799. (license (list license:gpl2 ;programs
  800. license:lgpl2.0 ;libext2fs
  801. license:x11)))) ;libuuid
  802. (define e2fsprogs/static
  803. (static-package
  804. (package (inherit e2fsprogs)
  805. (arguments
  806. ;; Do not build shared libraries.
  807. (substitute-keyword-arguments (package-arguments e2fsprogs)
  808. ((#:configure-flags _)
  809. '(list "--disable-blkid"))
  810. ((#:make-flags _)
  811. '(list)))))))
  812. (define-public e2fsck/static
  813. (package
  814. (name "e2fsck-static")
  815. (version (package-version e2fsprogs))
  816. (build-system trivial-build-system)
  817. (source #f)
  818. (inputs
  819. `(("e2fsprogs" ,e2fsprogs/static)))
  820. (arguments
  821. `(#:modules ((guix build utils))
  822. #:builder
  823. (begin
  824. (use-modules (guix build utils)
  825. (ice-9 ftw)
  826. (srfi srfi-26))
  827. (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
  828. "/sbin/e2fsck"))
  829. (bin (string-append (assoc-ref %outputs "out") "/sbin")))
  830. (mkdir-p bin)
  831. (with-directory-excursion bin
  832. (copy-file e2fsck "e2fsck")
  833. (remove-store-references "e2fsck")
  834. (chmod "e2fsck" #o555))
  835. #t))))
  836. (home-page (package-home-page e2fsprogs))
  837. (synopsis "Statically-linked e2fsck command from e2fsprogs")
  838. (description "This package provides statically-linked e2fsck command taken
  839. from the e2fsprogs package. It is meant to be used in initrds.")
  840. (license (package-license e2fsprogs))))
  841. (define-public extundelete
  842. (package
  843. (name "extundelete")
  844. (version "0.2.4")
  845. (source
  846. (origin
  847. (method url-fetch)
  848. (uri (string-append "mirror://sourceforge/extundelete/"
  849. "extundelete/" version "/extundelete-"
  850. version ".tar.bz2"))
  851. (sha256
  852. (base32
  853. "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
  854. (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
  855. (build-system gnu-build-system)
  856. (inputs `(("e2fsprogs" ,e2fsprogs)))
  857. (home-page "http://extundelete.sourceforge.net/")
  858. (synopsis "Recover deleted files from ext2/3/4 partitions")
  859. (description
  860. "Extundelete is a set of tools that can recover deleted files from an
  861. ext3 or ext4 partition.")
  862. (license license:gpl2)))
  863. (define-public zerofree
  864. (package
  865. (name "zerofree")
  866. (version "1.1.1")
  867. (home-page "https://frippery.org/uml/")
  868. (source (origin
  869. (method url-fetch)
  870. (uri (string-append home-page name "-" version
  871. ".tgz"))
  872. (sha256
  873. (base32
  874. "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
  875. (build-system gnu-build-system)
  876. (arguments
  877. '(#:phases
  878. (modify-phases %standard-phases
  879. (delete 'configure) ; no configure script
  880. (replace 'install
  881. ;; The Makefile lacks an ‘install’ target.
  882. (lambda* (#:key outputs #:allow-other-keys)
  883. (let* ((out (assoc-ref outputs "out"))
  884. (bin (string-append out "/bin")))
  885. (chmod "zerofree" #o555)
  886. (install-file "zerofree" bin)
  887. #t))))
  888. #:tests? #f)) ; no tests
  889. (inputs `(("libext2fs" ,e2fsprogs)))
  890. (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
  891. (description
  892. "Zerofree finds the unallocated blocks with non-zero value content in an
  893. ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
  894. This is a simple way to make disk images more compressible.
  895. Zerofree requires the file system to be unmounted or mounted read-only.")
  896. (license license:gpl2)))
  897. (define-public strace
  898. (package
  899. (name "strace")
  900. (version "4.26")
  901. (home-page "https://strace.io")
  902. (source (origin
  903. (method url-fetch)
  904. (uri (string-append home-page "/files/" version
  905. "/strace-" version ".tar.xz"))
  906. (sha256
  907. (base32
  908. "070yz8xii8gnb4psiz628zwm5srh266sfb06f7f1qzagxzz2ykbw"))))
  909. (build-system gnu-build-system)
  910. (arguments
  911. '(#:phases
  912. (modify-phases %standard-phases
  913. (add-after 'unpack 'patch-/bin/sh
  914. (lambda _
  915. (substitute* "strace.c"
  916. (("/bin/sh") (which "sh")))
  917. #t)))
  918. ;; Don't fail if the architecture doesn't support different personalities.
  919. #:configure-flags '("--enable-mpers=check")
  920. ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
  921. #:parallel-tests? #f)) ; undeterministic failures
  922. (native-inputs `(("perl" ,perl)))
  923. (synopsis "System call tracer for Linux")
  924. (description
  925. "strace is a system call tracer, i.e. a debugging tool which prints out a
  926. trace of all the system calls made by a another process/program.")
  927. (license license:lgpl2.1+)))
  928. (define-public ltrace
  929. (package
  930. (name "ltrace")
  931. (version "0.7.3")
  932. (source (origin
  933. (method url-fetch)
  934. (uri (string-append "http://www.ltrace.org/ltrace_" version
  935. ".orig.tar.bz2"))
  936. (sha256
  937. (base32
  938. "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
  939. (build-system gnu-build-system)
  940. (inputs `(("libelf" ,libelf)))
  941. (arguments
  942. ;; Compilation uses -Werror by default, but it fails.
  943. '(#:configure-flags '("--disable-werror")))
  944. (home-page "https://www.ltrace.org/")
  945. (synopsis "Library call tracer for Linux")
  946. (description
  947. "ltrace intercepts and records dynamic library calls which are called by
  948. an executed process and the signals received by that process. It can also
  949. intercept and print the system calls executed by the program.")
  950. (license license:gpl2+)))
  951. (define-public alsa-lib
  952. (package
  953. (name "alsa-lib")
  954. (version "1.1.7")
  955. (source (origin
  956. (method url-fetch)
  957. (uri (string-append
  958. "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
  959. version ".tar.bz2"))
  960. (sha256
  961. (base32
  962. "02fw7dw202mjid49w9ki3dsfcyvid5fj488561bdzcm3haw00q4x"))))
  963. (build-system gnu-build-system)
  964. (home-page "https://www.alsa-project.org/")
  965. (synopsis "The Advanced Linux Sound Architecture libraries")
  966. (description
  967. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  968. MIDI functionality to the Linux-based operating system.")
  969. (license license:lgpl2.1+)))
  970. (define-public alsa-utils
  971. (package
  972. (name "alsa-utils")
  973. (version "1.1.7")
  974. (source (origin
  975. (method url-fetch)
  976. (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
  977. name "-" version ".tar.bz2"))
  978. (sha256
  979. (base32
  980. "02jlw6a22j2rr7inggfgk2hzx3w0fjhvhs0dn1afpzdp9aspzchx"))))
  981. (build-system gnu-build-system)
  982. (arguments
  983. ;; XXX: Disable man page creation until we have DocBook.
  984. '(#:configure-flags (list "--disable-xmlto"
  985. ;; The udev rule is responsible for restoring
  986. ;; the volume.
  987. (string-append "--with-udev-rules-dir="
  988. (assoc-ref %outputs "out")
  989. "/lib/udev/rules.d"))
  990. #:phases
  991. (modify-phases %standard-phases
  992. (add-before
  993. 'install 'pre-install
  994. (lambda _
  995. ;; Don't try to mkdir /var/lib/alsa.
  996. (substitute* "Makefile"
  997. (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
  998. "true\n"))
  999. #t)))))
  1000. (inputs
  1001. `(("libsamplerate" ,libsamplerate)
  1002. ("ncurses" ,ncurses)
  1003. ("alsa-lib" ,alsa-lib)
  1004. ("xmlto" ,xmlto)
  1005. ("gettext" ,gettext-minimal)))
  1006. (home-page "http://www.alsa-project.org/")
  1007. (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
  1008. (description
  1009. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  1010. MIDI functionality to the Linux-based operating system.")
  1011. ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
  1012. ;; GPLv2-only.
  1013. (license license:gpl2)))
  1014. (define-public alsa-plugins
  1015. (package
  1016. (name "alsa-plugins")
  1017. (version "1.1.7")
  1018. (source (origin
  1019. (method url-fetch)
  1020. (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
  1021. name "-" version ".tar.bz2"))
  1022. (sha256
  1023. (base32
  1024. "0iys4zl1davzyg3mn9lvil1n3k1ifrg3v1caj3k4dqyrnrd40jx7"))))
  1025. (build-system gnu-build-system)
  1026. ;; TODO: Split libavcodec and speex if possible. It looks like they can not
  1027. ;; be split, there are references to both in files.
  1028. ;; TODO: Remove OSS related plugins, they add support to run native
  1029. ;; ALSA applications on OSS however we do not offer OSS and OSS is
  1030. ;; obsolete.
  1031. (outputs '("out" "pulseaudio" "jack"))
  1032. (arguments
  1033. `(#:configure-flags '(;; Do not install a "local" configuration targeted
  1034. ;; for /etc/alsa. On GuixSD plugins are loaded from
  1035. ;; the ALSA service, and other distributions likely
  1036. ;; won't use these files.
  1037. "--with-alsalconfdir=/tmp/noop")
  1038. #:phases
  1039. (modify-phases %standard-phases
  1040. (add-after 'install 'split
  1041. (lambda* (#:key inputs outputs #:allow-other-keys)
  1042. ;; Distribute the binaries to the various outputs.
  1043. (let* ((out (assoc-ref outputs "out"))
  1044. (jack (assoc-ref outputs "jack"))
  1045. (jacklib (string-append jack "/lib/alsa-lib"))
  1046. (pua (assoc-ref outputs "pulseaudio"))
  1047. (pualib (string-append pua "/lib/alsa-lib")))
  1048. ;; For jack.
  1049. (mkdir-p jacklib)
  1050. (for-each (lambda (file)
  1051. (rename-file file (string-append jacklib "/" (basename file))))
  1052. (find-files out ".*jack\\.(la|so)"))
  1053. ;; For pulseaudio.
  1054. (mkdir-p pualib)
  1055. (for-each (lambda (file)
  1056. (rename-file file (string-append pualib "/" (basename file))))
  1057. (find-files out ".*pulse\\.(la|so)"))
  1058. #t))))))
  1059. (inputs
  1060. `(("alsa-lib" ,alsa-lib)
  1061. ("jack" ,jack-1)
  1062. ("speex" ,speex) ; libspeexdsp resampling plugin
  1063. ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
  1064. ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
  1065. ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
  1066. (native-inputs
  1067. `(("pkg-config" ,pkg-config)))
  1068. (home-page "http://www.alsa-project.org/")
  1069. (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
  1070. (description
  1071. "The Advanced Linux Sound Architecture (ALSA) provides audio and
  1072. MIDI functionality to the Linux-based operating system. This package enhances ALSA
  1073. by providing additional plugins which include: upmixing, downmixing, jackd and
  1074. pulseaudio support for native alsa applications, format conversion (s16 to a52), and
  1075. external rate conversion.")
  1076. (license (list license:gpl2+
  1077. ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
  1078. license:lgpl2.1+))))
  1079. (define-public iptables
  1080. (package
  1081. (name "iptables")
  1082. (version "1.6.2")
  1083. (source (origin
  1084. (method url-fetch)
  1085. (uri (string-append
  1086. "mirror://netfilter.org/iptables/iptables-"
  1087. version ".tar.bz2"))
  1088. (sha256
  1089. (base32
  1090. "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
  1091. (build-system gnu-build-system)
  1092. (native-inputs
  1093. `(("pkg-config" ,pkg-config)
  1094. ("flex" ,flex)
  1095. ("bison" ,bison)))
  1096. (inputs
  1097. `(("libmnl" ,libmnl)
  1098. ("libnftnl" ,libnftnl)))
  1099. (arguments
  1100. '(#:tests? #f ; no test suite
  1101. #:configure-flags ; add $libdir to the RUNPATH of executables
  1102. (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
  1103. (home-page "https://www.netfilter.org/projects/iptables/index.html")
  1104. (synopsis "Programs to configure Linux IP packet filtering rules")
  1105. (description
  1106. "@command{iptables} is the user-space command line program used to
  1107. configure the Linux 2.4.x and later IPv4 packet filtering ruleset
  1108. (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
  1109. This package also includes @command{ip6tables}, which is used to configure the
  1110. IPv6 packet filter.
  1111. Both commands are targeted at system administrators.")
  1112. (license license:gpl2+)))
  1113. (define-public ebtables
  1114. (package
  1115. (name "ebtables")
  1116. (version "2.0.10-4")
  1117. (source (origin
  1118. (method url-fetch)
  1119. (uri (string-append
  1120. "mirror://netfilter.org/ebtables/ebtables-v"
  1121. version ".tar.gz"))
  1122. (sha256
  1123. (base32
  1124. "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
  1125. (build-system gnu-build-system)
  1126. (arguments
  1127. '(#:tests? #f ; no test suite
  1128. #:make-flags
  1129. (let* ((out (assoc-ref %outputs "out"))
  1130. (bin (string-append out "/sbin"))
  1131. (lib (string-append out "/lib"))
  1132. (man (string-append out "/share/man"))
  1133. (iptables (assoc-ref %build-inputs "iptables"))
  1134. (ethertypes (string-append iptables "/etc/ethertypes")))
  1135. (list (string-append "LIBDIR=" lib)
  1136. (string-append "MANDIR=" man)
  1137. (string-append "BINDIR=" bin)
  1138. (string-append "ETHERTYPESFILE=" ethertypes)
  1139. ;; With the default CFLAGS, it falis with:
  1140. ;; communication.c:259:58: error: variable ‘ret’ set but not
  1141. ;; used [-Werror=unused-but-set-variable]
  1142. "CFLAGS=-Wall"))
  1143. #:phases
  1144. (modify-phases %standard-phases
  1145. (replace 'configure
  1146. ;; no configure script
  1147. (lambda _
  1148. (substitute* "Makefile"
  1149. ;; Remove user and group options from install commands,
  1150. ;; otherwise it fails with: invalid user 'root'.
  1151. (("-o root -g root") "")
  1152. ;; Remove 'ethertypes' from the install target.
  1153. (("install: .*")
  1154. "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
  1155. #t)))))
  1156. (inputs
  1157. `(("perl" ,perl)
  1158. ("iptables" ,iptables)))
  1159. (synopsis "Ethernet bridge frame table administration")
  1160. (home-page "http://ebtables.netfilter.org/")
  1161. (description
  1162. "ebtables is an application program used to set up and maintain the
  1163. tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
  1164. analogous to the iptables application, but less complicated, due to the fact
  1165. that the Ethernet protocol is much simpler than the IP protocol.")
  1166. (license license:gpl2+)))
  1167. (define-public iproute
  1168. (package
  1169. (name "iproute2")
  1170. (version "4.20.0")
  1171. (source (origin
  1172. (method url-fetch)
  1173. (uri (string-append
  1174. "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
  1175. version ".tar.xz"))
  1176. (sha256
  1177. (base32
  1178. "1a7xyvqjxfnm7rk21amm0xgxa38clg7q7cmc4dmlg27q81mambf8"))))
  1179. (build-system gnu-build-system)
  1180. (arguments
  1181. `(#:tests? #f ; no test suite
  1182. #:make-flags (let ((out (assoc-ref %outputs "out")))
  1183. (list "DESTDIR="
  1184. (string-append "BASH_COMPDIR=" out
  1185. "/etc/bash_completion.d")
  1186. (string-append "LIBDIR=" out "/lib")
  1187. (string-append "HDRDIR=" out "/include")
  1188. (string-append "SBINDIR=" out "/sbin")
  1189. (string-append "CONFDIR=" out "/etc")
  1190. (string-append "DOCDIR=" out "/share/doc/"
  1191. ,name "-" ,version)
  1192. (string-append "MANDIR=" out "/share/man")))
  1193. #:phases (modify-phases %standard-phases
  1194. (add-before 'install 'pre-install
  1195. (lambda _
  1196. ;; Don't attempt to create /var/lib/arpd.
  1197. (substitute* "Makefile"
  1198. (("^.*ARPDDIR.*$") ""))
  1199. #t)))))
  1200. (inputs
  1201. `(("iptables" ,iptables)
  1202. ("db4" ,bdb)))
  1203. (native-inputs
  1204. `(("pkg-config" ,pkg-config)
  1205. ("flex" ,flex)
  1206. ("bison" ,bison)))
  1207. (home-page
  1208. "https://wiki.linuxfoundation.org/networking/iproute2")
  1209. (synopsis
  1210. "Utilities for controlling TCP/IP networking and traffic in Linux")
  1211. (description
  1212. "Iproute2 is a collection of utilities for controlling TCP/IP networking
  1213. and traffic with the Linux kernel. The most important of these are
  1214. @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
  1215. control.
  1216. Most network configuration manuals still refer to ifconfig and route as the
  1217. primary network configuration tools, but ifconfig is known to behave
  1218. inadequately in modern network environments, and both should be deprecated.")
  1219. (license license:gpl2+)))
  1220. (define-public net-tools
  1221. ;; XXX: This package is basically unmaintained, but it provides a few
  1222. ;; commands not yet provided by Inetutils, such as 'route', so we have to
  1223. ;; live with it.
  1224. (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
  1225. (revision "0"))
  1226. (package
  1227. (name "net-tools")
  1228. (version (string-append "1.60-" revision "." (string-take commit 7)))
  1229. (source (origin
  1230. (method url-fetch)
  1231. (uri (string-append "https://sourceforge.net/code-snapshots/git/"
  1232. "n/ne/net-tools/code.git/net-tools-code-"
  1233. commit ".zip"))
  1234. (file-name (string-append name "-" version ".zip"))
  1235. (sha256
  1236. (base32
  1237. "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
  1238. (home-page "http://net-tools.sourceforge.net/")
  1239. (build-system gnu-build-system)
  1240. (arguments
  1241. '(#:modules ((guix build gnu-build-system)
  1242. (guix build utils)
  1243. (srfi srfi-1)
  1244. (srfi srfi-26))
  1245. #:phases
  1246. (modify-phases %standard-phases
  1247. (replace 'configure
  1248. (lambda* (#:key outputs #:allow-other-keys)
  1249. (let ((out (assoc-ref outputs "out")))
  1250. (mkdir-p (string-append out "/bin"))
  1251. (mkdir-p (string-append out "/sbin"))
  1252. ;; Pretend we have everything...
  1253. (system "yes | make config")
  1254. ;; ... except for the things we don't have.
  1255. ;; HAVE_AFDECnet requires libdnet, which we don't have.
  1256. ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
  1257. ;; that have been removed.
  1258. ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
  1259. ;; think about adding them later.
  1260. (substitute* '("config.make" "config.h")
  1261. (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
  1262. ""))
  1263. #t)))
  1264. (add-after 'install 'remove-redundant-commands
  1265. (lambda* (#:key outputs #:allow-other-keys)
  1266. ;; Remove commands and man pages redundant with Inetutils.
  1267. (let* ((out (assoc-ref outputs "out"))
  1268. (dup (append-map (cut find-files out <>)
  1269. '("^hostname"
  1270. "^(yp|nis|dns)?domainname"))))
  1271. (for-each delete-file dup)
  1272. #t))))
  1273. ;; Binaries that depend on libnet-tools.a don't declare that
  1274. ;; dependency, making it parallel-unsafe.
  1275. #:parallel-build? #f
  1276. #:tests? #f ; no test suite
  1277. #:make-flags (let ((out (assoc-ref %outputs "out")))
  1278. (list "CC=gcc"
  1279. (string-append "BASEDIR=" out)
  1280. (string-append "INSTALLNLSDIR=" out "/share/locale")
  1281. (string-append "mandir=/share/man")))))
  1282. (native-inputs `(("gettext" ,gettext-minimal)
  1283. ("unzip" ,unzip)))
  1284. (synopsis "Tools for controlling the network subsystem in Linux")
  1285. (description
  1286. "This package includes the important tools for controlling the network
  1287. subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
  1288. route. Additionally, this package contains utilities relating to particular
  1289. network hardware types (plipconfig, slattach) and advanced aspects of IP
  1290. configuration (iptunnel, ipmaddr).")
  1291. (license license:gpl2+))))
  1292. (define-public libcap
  1293. (package
  1294. (name "libcap")
  1295. (version "2.25")
  1296. (source (origin
  1297. (method url-fetch)
  1298. (uri (string-append
  1299. "mirror://kernel.org/linux/libs/security/linux-privs/"
  1300. "libcap2/libcap-" version ".tar.xz"))
  1301. (sha256
  1302. (base32
  1303. "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
  1304. (build-system gnu-build-system)
  1305. (arguments '(#:phases
  1306. (modify-phases %standard-phases
  1307. (replace 'configure
  1308. ;; Add $libdir to the RUNPATH of executables.
  1309. (lambda _
  1310. (substitute* "Make.Rules"
  1311. (("LDFLAGS := #-g")
  1312. (string-append "LDFLAGS := -Wl,-rpath="
  1313. %output "/lib")))
  1314. #t)))
  1315. #:tests? #f ; no 'check' target
  1316. #:make-flags (list "lib=lib"
  1317. (string-append "prefix="
  1318. (assoc-ref %outputs "out"))
  1319. "RAISE_SETFCAP=no")))
  1320. (native-inputs `(("perl" ,perl)))
  1321. (inputs `(("attr" ,attr)))
  1322. (home-page "https://sites.google.com/site/fullycapable/")
  1323. (synopsis "Library for working with POSIX capabilities")
  1324. (description
  1325. "Libcap2 provides a programming interface to POSIX capabilities on
  1326. Linux-based operating systems.")
  1327. ;; License is BSD-3 or GPLv2, at the user's choice.
  1328. (license license:gpl2)))
  1329. (define-public bridge-utils
  1330. (package
  1331. (name "bridge-utils")
  1332. (version "1.5")
  1333. (source (origin
  1334. (method url-fetch)
  1335. (uri (string-append "mirror://sourceforge/bridge/bridge/"
  1336. "bridge-utils-" version ".tar.gz"))
  1337. (sha256
  1338. (base32
  1339. "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
  1340. (build-system gnu-build-system)
  1341. ;; The tarball lacks all the generated files.
  1342. (native-inputs `(("autoconf" ,autoconf)
  1343. ("automake" ,automake)))
  1344. (arguments
  1345. '(#:phases
  1346. (modify-phases %standard-phases
  1347. (add-before 'bootstrap 'patch-stuff
  1348. (lambda _
  1349. ;; Fix "field ‘ip6’ has incomplete type" errors.
  1350. (substitute* "libbridge/libbridge.h"
  1351. (("#include <linux/if_bridge.h>")
  1352. "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
  1353. ;; Ensure that the entire build fails if one of the
  1354. ;; sub-Makefiles fails.
  1355. (substitute* "Makefile.in"
  1356. (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
  1357. "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
  1358. #t)))
  1359. #:tests? #f)) ; no 'check' target
  1360. (home-page
  1361. "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
  1362. (synopsis "Manipulate Ethernet bridges")
  1363. (description
  1364. "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
  1365. to connect two Ethernet segments together in a protocol independent way.
  1366. Packets are forwarded based on Ethernet address, rather than IP address (like
  1367. a router). Since forwarding is done at Layer 2, all protocols can go
  1368. transparently through a bridge.")
  1369. (license license:gpl2+)))
  1370. (define-public libnl
  1371. (package
  1372. (name "libnl")
  1373. (version "3.4.0")
  1374. (source (origin
  1375. (method url-fetch)
  1376. (uri (string-append
  1377. "https://github.com/thom311/libnl/releases/download/"
  1378. "libnl" (string-join (string-split version #\.) "_")
  1379. "/libnl-" version ".tar.gz"))
  1380. (sha256
  1381. (base32
  1382. "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
  1383. (build-system gnu-build-system)
  1384. (native-inputs
  1385. `(("bison" ,bison)
  1386. ("flex" ,flex)
  1387. ("pkg-config" ,pkg-config)
  1388. ("swig" ,swig)
  1389. ("libnl3-doc"
  1390. ,(origin
  1391. (method url-fetch)
  1392. (uri (string-append
  1393. "https://github.com/thom311/libnl/releases/download/libnl"
  1394. (string-join (string-split version #\.) "_")
  1395. "/libnl-doc-" version ".tar.gz"))
  1396. (sha256
  1397. (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
  1398. (inputs
  1399. `(("python-2" ,python-2)
  1400. ("python-3" ,python-3)))
  1401. (outputs '("out" "doc" "python2" "python3"))
  1402. (arguments
  1403. `(#:modules ((guix build gnu-build-system)
  1404. (guix build utils)
  1405. (srfi srfi-1))
  1406. #:phases
  1407. (modify-phases %standard-phases
  1408. (add-after 'install 'install-python
  1409. (lambda* (#:key outputs #:allow-other-keys)
  1410. (define (python-inst python)
  1411. (invoke python "setup.py" "build")
  1412. (invoke python "setup.py" "install"
  1413. (string-append "--prefix="
  1414. (assoc-ref %outputs python)))
  1415. (invoke python "setup.py" "clean"))
  1416. (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
  1417. (assoc-ref %outputs "out")))
  1418. (with-directory-excursion "./python"
  1419. (for-each python-inst '("python2" "python3")))
  1420. #t))
  1421. (add-after 'install 'install-doc
  1422. (lambda* (#:key inputs outputs #:allow-other-keys)
  1423. (let ((dest (string-append (assoc-ref outputs "doc")
  1424. "/share/doc/libnl")))
  1425. (mkdir-p dest)
  1426. (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
  1427. "--strip-components=1" "-C" dest)))))))
  1428. (home-page "https://www.infradead.org/~tgr/libnl/")
  1429. (synopsis "NetLink protocol library suite")
  1430. (description
  1431. "The libnl suite is a collection of libraries providing APIs to netlink
  1432. protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
  1433. between the kernel and user space processes. It was designed to be a more
  1434. flexible successor to ioctl to provide mainly networking related kernel
  1435. configuration and monitoring interfaces.")
  1436. ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
  1437. ;; 'nl-addr-add.c'), so the result is GPLv2-only.
  1438. (license license:gpl2)))
  1439. (define-public iw
  1440. (package
  1441. (name "iw")
  1442. (version "4.14")
  1443. (source (origin
  1444. (method url-fetch)
  1445. (uri (string-append
  1446. "mirror://kernel.org/software/network/iw/iw-"
  1447. version ".tar.xz"))
  1448. (sha256
  1449. (base32
  1450. "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
  1451. (build-system gnu-build-system)
  1452. (native-inputs `(("pkg-config" ,pkg-config)))
  1453. (inputs `(("libnl" ,libnl)))
  1454. (arguments
  1455. `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  1456. "CC=gcc")
  1457. #:phases (modify-phases %standard-phases (delete 'configure))))
  1458. (home-page "https://wireless.wiki.kernel.org/")
  1459. (synopsis "Tool for configuring wireless devices")
  1460. (description
  1461. "iw is a new nl80211 based CLI configuration utility for wireless
  1462. devices. It replaces @code{iwconfig}, which is deprecated.")
  1463. (license license:isc)))
  1464. (define-public powertop
  1465. (package
  1466. (name "powertop")
  1467. (version "2.10")
  1468. (source
  1469. (origin
  1470. (method url-fetch)
  1471. (uri (string-append "https://01.org/sites/default/files/downloads/"
  1472. "powertop-v" version ".tar.gz"))
  1473. (sha256
  1474. (base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
  1475. (build-system gnu-build-system)
  1476. (arguments
  1477. '(#:phases
  1478. (modify-phases %standard-phases
  1479. ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
  1480. ;; allow calibrating the network interface in GuixSD.
  1481. (add-after 'unpack 'patch-absolute-file-names
  1482. (lambda* (#:key inputs #:allow-other-keys)
  1483. (let ((kmod (assoc-ref inputs "kmod")))
  1484. (substitute* (find-files "src" "\\.cpp$")
  1485. ;; Give the right 'modprobe' file name so that essential
  1486. ;; modules such as msr.ko can be loaded.
  1487. (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
  1488. ;; These programs are only needed to calibrate, so using
  1489. ;; relative file names avoids adding extra inputs. When they
  1490. ;; are missing powertop gracefully handles it.
  1491. (("/usr/bin/hcitool") "hcitool")
  1492. (("/usr/bin/xset") "xset")
  1493. (("/usr/sbin/hciconfig") "hciconfig"))
  1494. #t))))))
  1495. (inputs
  1496. `(("kmod" ,kmod)
  1497. ("libnl" ,libnl)
  1498. ("ncurses" ,ncurses)
  1499. ("pciutils" ,pciutils)
  1500. ("zlib" ,zlib)))
  1501. (native-inputs
  1502. `(("pkg-config" ,pkg-config)))
  1503. (home-page "https://01.org/powertop/")
  1504. (synopsis "Analyze power consumption on Intel-based laptops")
  1505. (description
  1506. "PowerTOP is a Linux tool to diagnose issues with power consumption and
  1507. power management. In addition to being a diagnostic tool, PowerTOP also has
  1508. an interactive mode where the user can experiment various power management
  1509. settings for cases where the operating system has not enabled these
  1510. settings.")
  1511. (license license:gpl2)))
  1512. (define-public aumix
  1513. (package
  1514. (name "aumix")
  1515. (version "2.9.1")
  1516. (source (origin
  1517. (method url-fetch)
  1518. (uri (string-append
  1519. "http://www.jpj.net/~trevor/aumix/releases/aumix-"
  1520. version ".tar.bz2"))
  1521. (sha256
  1522. (base32
  1523. "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
  1524. (build-system gnu-build-system)
  1525. (inputs `(("ncurses" ,ncurses)))
  1526. (home-page "http://www.jpj.net/~trevor/aumix.html")
  1527. (synopsis "Audio mixer for X and the console")
  1528. (description
  1529. "Aumix adjusts an audio mixer from X, the console, a terminal,
  1530. the command line or a script.")
  1531. (license license:gpl2+)))
  1532. (define-public iotop
  1533. (package
  1534. (name "iotop")
  1535. (version "0.6")
  1536. (source
  1537. (origin
  1538. (method url-fetch)
  1539. (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
  1540. version ".tar.gz"))
  1541. (sha256 (base32
  1542. "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
  1543. (build-system python-build-system)
  1544. (arguments
  1545. ;; The setup.py script expects python-2.
  1546. `(#:python ,python-2
  1547. ;; There are currently no checks in the package.
  1548. #:tests? #f))
  1549. (native-inputs `(("python" ,python-2)))
  1550. (home-page "http://guichaz.free.fr/iotop/")
  1551. (synopsis
  1552. "Displays the IO activity of running processes")
  1553. (description
  1554. "Iotop is a Python program with a top like user interface to show the
  1555. processes currently causing I/O.")
  1556. (license license:gpl2+)))
  1557. (define-public fuse
  1558. (package
  1559. (name "fuse")
  1560. (version "2.9.8")
  1561. (source (origin
  1562. (method url-fetch)
  1563. (uri (string-append "https://github.com/libfuse/libfuse/releases/"
  1564. "download/fuse-" version
  1565. "/fuse-" version ".tar.gz"))
  1566. (sha256
  1567. (base32
  1568. "1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
  1569. (patches (search-patches "fuse-overlapping-headers.patch"))))
  1570. (build-system gnu-build-system)
  1571. (inputs `(("util-linux" ,util-linux)))
  1572. (arguments
  1573. '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
  1574. (assoc-ref %outputs "out")
  1575. "/sbin")
  1576. (string-append "INIT_D_PATH="
  1577. (assoc-ref %outputs "out")
  1578. "/etc/init.d")
  1579. ;; The rule makes /dev/fuse 666.
  1580. (string-append "UDEV_RULES_PATH="
  1581. (assoc-ref %outputs "out")
  1582. "/lib/udev/rules.d"))
  1583. #:phases
  1584. (modify-phases %standard-phases
  1585. (add-before 'build 'set-file-names
  1586. (lambda* (#:key inputs #:allow-other-keys)
  1587. ;; libfuse calls out to mount(8) and umount(8). Make sure
  1588. ;; it refers to the right ones.
  1589. (substitute* '("lib/mount_util.c" "util/mount_util.c")
  1590. (("/bin/(u?)mount" _ maybe-u)
  1591. (string-append (assoc-ref inputs "util-linux")
  1592. "/bin/" maybe-u "mount")))
  1593. (substitute* '("util/mount.fuse.c")
  1594. (("/bin/sh")
  1595. (which "sh")))
  1596. ;; This hack leads libfuse to search for 'fusermount' in
  1597. ;; $PATH, where it may find a setuid-root binary, instead of
  1598. ;; trying solely $out/sbin/fusermount and failing because
  1599. ;; it's not setuid.
  1600. (substitute* "lib/Makefile"
  1601. (("-DFUSERMOUNT_DIR=[[:graph:]]+")
  1602. "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
  1603. #t)))))
  1604. (home-page "https://github.com/libfuse/libfuse")
  1605. (synopsis "Support file systems implemented in user space")
  1606. (description
  1607. "As a consequence of its monolithic design, file system code for Linux
  1608. normally goes into the kernel itself---which is not only a robustness issue,
  1609. but also an impediment to system extensibility. FUSE, for \"file systems in
  1610. user space\", is a kernel module and user-space library that tries to address
  1611. part of this problem by allowing users to run file system implementations as
  1612. user-space processes.")
  1613. (license (list license:lgpl2.1 ;library
  1614. license:gpl2+)))) ;command-line utilities
  1615. (define-public unionfs-fuse
  1616. (package
  1617. (name "unionfs-fuse")
  1618. (version "2.0")
  1619. (source (origin
  1620. (method url-fetch)
  1621. (uri (string-append
  1622. "https://github.com/rpodgorny/unionfs-fuse/archive/v"
  1623. version ".tar.gz"))
  1624. (file-name (string-append name "-" version ".tar.gz"))
  1625. (sha256
  1626. (base32
  1627. "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
  1628. (build-system cmake-build-system)
  1629. (native-inputs
  1630. `(("python" ,python)))
  1631. (inputs `(("fuse" ,fuse)))
  1632. (arguments
  1633. ;; The tests were never actually run ("collected 0 items"), but in recent
  1634. ;; versions of pytest that causes an error.
  1635. '(#:tests? #f))
  1636. (home-page "https://github.com/rpodgorny/unionfs-fuse")
  1637. (synopsis "User-space union file system")
  1638. (description
  1639. "UnionFS-FUSE is a flexible union file system implementation in user
  1640. space, using the FUSE library. Mounting a union file system allows you to
  1641. \"aggregate\" the contents of several directories into a single mount point.
  1642. UnionFS-FUSE additionally supports copy-on-write.")
  1643. (license license:bsd-3)))
  1644. (define fuse-static
  1645. (package (inherit fuse)
  1646. (name "fuse-static")
  1647. (source (origin (inherit (package-source fuse))
  1648. (modules '((guix build utils)))
  1649. (snippet
  1650. '(begin
  1651. ;; Normally libfuse invokes mount(8) so that /etc/mtab is
  1652. ;; updated. Change calls to 'mtab_needs_update' to 0 so
  1653. ;; that it doesn't do that, allowing us to remove the
  1654. ;; dependency on util-linux (something that is useful in
  1655. ;; initrds.)
  1656. (substitute* '("lib/mount_util.c"
  1657. "util/mount_util.c")
  1658. (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
  1659. "0")
  1660. (("/bin/")
  1661. ""))
  1662. #t))))))
  1663. (define-public unionfs-fuse/static
  1664. (package (inherit unionfs-fuse)
  1665. (synopsis "User-space union file system (statically linked)")
  1666. (name (string-append (package-name unionfs-fuse) "-static"))
  1667. (source (origin (inherit (package-source unionfs-fuse))
  1668. (modules '((guix build utils)))
  1669. (snippet
  1670. '(begin
  1671. ;; Add -ldl to the libraries, because libfuse.a needs that.
  1672. (substitute* "src/CMakeLists.txt"
  1673. (("target_link_libraries(.*)\\)" _ libs)
  1674. (string-append "target_link_libraries"
  1675. libs " dl)")))
  1676. #t))))
  1677. (arguments
  1678. '(#:tests? #f
  1679. #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
  1680. #:phases
  1681. (modify-phases %standard-phases
  1682. (add-after 'install 'post-install
  1683. (lambda* (#:key outputs #:allow-other-keys)
  1684. (let* ((out (assoc-ref outputs "out"))
  1685. (exe (string-append out "/bin/unionfs")))
  1686. ;; By default, 'unionfs' keeps references to
  1687. ;; $glibc/share/locale and similar stuff. Remove them.
  1688. (remove-store-references exe)
  1689. ;; 'unionfsctl' has references to glibc as well. Since
  1690. ;; we don't need it, remove it.
  1691. (delete-file (string-append out "/bin/unionfsctl"))
  1692. #t))))))
  1693. (inputs `(("fuse" ,fuse-static)))))
  1694. (define-public sshfs
  1695. (package
  1696. (name "sshfs")
  1697. (version "2.10")
  1698. (source (origin
  1699. (method url-fetch)
  1700. (uri (string-append "https://github.com/libfuse/sshfs/releases/"
  1701. "download/sshfs-" version "/sshfs-" version
  1702. ".tar.gz"))
  1703. (sha256
  1704. (base32
  1705. "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
  1706. (build-system gnu-build-system)
  1707. (inputs
  1708. `(("fuse" ,fuse)
  1709. ("glib" ,glib)))
  1710. (native-inputs
  1711. `(("pkg-config" ,pkg-config)))
  1712. (home-page "https://github.com/libfuse/sshfs")
  1713. (synopsis "Mount remote file systems over SSH")
  1714. (description
  1715. "This is a file system client based on the SSH File Transfer Protocol.
  1716. Since most SSH servers already support this protocol it is very easy to set
  1717. up: on the server side there's nothing to do; on the client side mounting the
  1718. file system is as easy as logging into the server with an SSH client.")
  1719. (license license:gpl2+)))
  1720. (define-public sshfs-fuse
  1721. (package (inherit sshfs)
  1722. (name "sshfs-fuse")
  1723. (properties `((superseded . ,sshfs)))))
  1724. (define-public archivemount
  1725. (package
  1726. (name "archivemount")
  1727. (version "0.8.12")
  1728. (source
  1729. (origin
  1730. (method url-fetch)
  1731. (uri (string-append "https://www.cybernoia.de/software/archivemount/"
  1732. "archivemount-" version ".tar.gz"))
  1733. (sha256
  1734. (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
  1735. (build-system gnu-build-system)
  1736. (inputs `(("fuse" ,fuse)
  1737. ("libarchive" ,libarchive)))
  1738. (native-inputs `(("pkg-config" ,pkg-config)))
  1739. (home-page "https://www.cybernoia.de/software/archivemount.html")
  1740. (synopsis "Tool for mounting archive files with FUSE")
  1741. (description "archivemount is a FUSE-based file system for Unix variants,
  1742. including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
  1743. mount point where it can be read from or written to as with any other file
  1744. system. This makes accessing the contents of the archive, which may be
  1745. compressed, transparent to other programs, without decompressing them.")
  1746. (license license:lgpl2.0+)))
  1747. (define-public numactl
  1748. (package
  1749. (name "numactl")
  1750. (version "2.0.12")
  1751. (source (origin
  1752. (method url-fetch)
  1753. (uri (string-append
  1754. "https://github.com/numactl/numactl/releases/download/v"
  1755. version "/" name "-" version ".tar.gz"))
  1756. (sha256
  1757. (base32
  1758. "0ad7mpi3vacbfnx3aqxnvgsj64yp3mav9yxnaz8ancjv7wvdmfsm"))))
  1759. (build-system gnu-build-system)
  1760. (arguments
  1761. '(;; There's a 'test' target, but it requires NUMA support in the kernel
  1762. ;; to run, which we can't assume to have.
  1763. #:tests? #f))
  1764. ;; NUMA is apparently not supported on armhf, see
  1765. ;; http://www.spinics.net/lists/linux-numa/msg01157.html
  1766. (supported-systems (delete "armhf-linux" %supported-systems))
  1767. (home-page "https://github.com/numactl/numactl")
  1768. (synopsis "Tools for non-uniform memory access (NUMA) machines")
  1769. (description
  1770. "NUMA stands for Non-Uniform Memory Access, in other words a system whose
  1771. memory is not all in one place. The numactl program allows you to run your
  1772. application program on specific CPU's and memory nodes. It does this by
  1773. supplying a NUMA memory policy to the operating system before running your
  1774. program.
  1775. The package contains other commands, such as numademo, numastat and memhog.
  1776. The numademo command provides a quick overview of NUMA performance on your
  1777. system.")
  1778. (license (list license:gpl2 ;programs
  1779. license:lgpl2.1)))) ;library
  1780. (define-public kbd-neo
  1781. (package
  1782. (name "kbd-neo")
  1783. (version "2486")
  1784. (source
  1785. (origin
  1786. (method url-fetch)
  1787. (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
  1788. version "/linux/console/neo.map"))
  1789. (file-name (string-append name "-" version ".map"))
  1790. (sha256
  1791. (base32
  1792. "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
  1793. (build-system trivial-build-system)
  1794. (arguments
  1795. `(#:modules ((guix build utils))
  1796. #:builder (begin
  1797. (use-modules (guix build utils))
  1798. (let ((out (string-append %output "/share/keymaps"))
  1799. (source (assoc-ref %build-inputs "source")))
  1800. (mkdir-p out)
  1801. (copy-file source (string-append out "/neo.map"))
  1802. #t))))
  1803. (home-page "https://neo-layout.org")
  1804. (synopsis "Neo2 console layout")
  1805. (description
  1806. "Kbd-neo provides the Neo2 keyboard layout for use with
  1807. @command{loadkeys(1)} from @code{kbd(4)}.")
  1808. ;; The file is located in an svn directory, the entire content of
  1809. ;; the directory is licensed as GPL3.
  1810. (license license:gpl3+)))
  1811. (define-public kbd
  1812. (package
  1813. (name "kbd")
  1814. (version "2.0.4")
  1815. (source (origin
  1816. (method url-fetch)
  1817. (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
  1818. version ".tar.xz"))
  1819. (sha256
  1820. (base32
  1821. "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
  1822. (modules '((guix build utils)))
  1823. (snippet
  1824. '(begin
  1825. (substitute* "tests/Makefile.in"
  1826. ;; The '%: %.in' rule incorrectly uses @VERSION@.
  1827. (("@VERSION@")
  1828. "[@]VERSION[@]"))
  1829. (substitute* '("src/unicode_start" "src/unicode_stop")
  1830. ;; Assume the Coreutils are in $PATH.
  1831. (("/usr/bin/tty")
  1832. "tty"))
  1833. #t))))
  1834. (build-system gnu-build-system)
  1835. (arguments
  1836. '(#:phases
  1837. (modify-phases %standard-phases
  1838. (add-before 'build 'pre-build
  1839. (lambda* (#:key inputs #:allow-other-keys)
  1840. (let ((gzip (assoc-ref %build-inputs "gzip"))
  1841. (bzip2 (assoc-ref %build-inputs "bzip2")))
  1842. (substitute* "src/libkeymap/findfile.c"
  1843. (("gzip")
  1844. (string-append gzip "/bin/gzip"))
  1845. (("bzip2")
  1846. (string-append bzip2 "/bin/bzip2")))
  1847. #t)))
  1848. (add-after 'install 'post-install
  1849. (lambda* (#:key outputs #:allow-other-keys)
  1850. ;; Make sure these programs find their comrades.
  1851. (let* ((out (assoc-ref outputs "out"))
  1852. (bin (string-append out "/bin")))
  1853. (for-each (lambda (prog)
  1854. (wrap-program (string-append bin "/" prog)
  1855. `("PATH" ":" prefix (,bin))))
  1856. '("unicode_start" "unicode_stop"))
  1857. #t))))))
  1858. (inputs `(("check" ,check)
  1859. ("gzip" ,gzip)
  1860. ("bzip2" ,bzip2)
  1861. ("pam" ,linux-pam)))
  1862. (native-search-paths
  1863. (list (search-path-specification
  1864. (variable "LOADKEYS_KEYMAP_PATH")
  1865. ;; Append ‘/**’ to recursively search all directories. One can then
  1866. ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
  1867. ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
  1868. (files (list "share/keymaps/**")))))
  1869. (native-inputs `(("pkg-config" ,pkg-config)))
  1870. (home-page "http://kbd-project.org/")
  1871. (synopsis "Linux keyboard utilities and keyboard maps")
  1872. (description
  1873. "This package contains keytable files and keyboard utilities compatible
  1874. for systems using the Linux kernel. This includes commands such as
  1875. 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
  1876. (license license:gpl2+)))
  1877. (define-public inotify-tools
  1878. (package
  1879. (name "inotify-tools")
  1880. (version "3.20.1")
  1881. (source (origin
  1882. (method git-fetch)
  1883. (uri (git-reference
  1884. (url "https://github.com/rvoicilas/inotify-tools.git")
  1885. (commit version)))
  1886. (file-name (git-file-name name version))
  1887. (sha256
  1888. (base32
  1889. "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
  1890. (build-system gnu-build-system)
  1891. (native-inputs
  1892. `(("autoconf" ,autoconf)
  1893. ("automake" ,automake)
  1894. ("libtool" ,libtool)))
  1895. (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
  1896. (synopsis "Monitor file accesses")
  1897. (description
  1898. "The inotify-tools packages provides a C library and command-line tools
  1899. to use Linux' inotify mechanism, which allows file accesses to be monitored.")
  1900. (license license:gpl2+)))
  1901. (define-public kmod
  1902. (package
  1903. (name "kmod")
  1904. (version "25")
  1905. (source (origin
  1906. (method url-fetch)
  1907. (uri
  1908. (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
  1909. "kmod-" version ".tar.xz"))
  1910. (sha256
  1911. (base32
  1912. "1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
  1913. (patches (search-patches "kmod-module-directory.patch"))))
  1914. (build-system gnu-build-system)
  1915. (native-inputs
  1916. `(("pkg-config" ,pkg-config)))
  1917. (inputs
  1918. `(("xz" ,xz)
  1919. ("zlib" ,zlib)))
  1920. (arguments
  1921. `(#:tests? #f ; FIXME: Investigate test failures
  1922. #:configure-flags '("--with-xz" "--with-zlib")
  1923. #:phases
  1924. (modify-phases %standard-phases
  1925. (add-after 'install 'install-modprobe&co
  1926. (lambda* (#:key outputs #:allow-other-keys)
  1927. (let* ((out (assoc-ref outputs "out"))
  1928. (bin (string-append out "/bin")))
  1929. (for-each (lambda (tool)
  1930. (symlink "kmod"
  1931. (string-append bin "/" tool)))
  1932. '("insmod" "rmmod" "lsmod" "modprobe"
  1933. "modinfo" "depmod"))
  1934. #t))))))
  1935. (home-page "https://www.kernel.org/")
  1936. (synopsis "Kernel module tools")
  1937. (description "Kmod is a set of tools to handle common tasks with Linux
  1938. kernel modules like insert, remove, list, check properties, resolve
  1939. dependencies and aliases.
  1940. These tools are designed on top of libkmod, a library that is shipped with
  1941. kmod. The aim is to be compatible with tools, configurations and indices
  1942. from the module-init-tools project.")
  1943. (license license:gpl2+))) ; library under lgpl2.1+
  1944. (define-public eudev
  1945. ;; The post-systemd fork, maintained by Gentoo.
  1946. (package
  1947. (name "eudev")
  1948. (version "3.2.7")
  1949. (source (origin
  1950. (method git-fetch)
  1951. (uri (git-reference (url "https://github.com/gentoo/eudev")
  1952. (commit (string-append "v" version))))
  1953. (file-name (git-file-name name version))
  1954. (sha256
  1955. (base32
  1956. "1la7x7v7yqb84wnc7w0kj53sa0an0m9xp6wn01ypi8drh02wjjy2"))
  1957. (patches (search-patches "eudev-rules-directory.patch"))))
  1958. (build-system gnu-build-system)
  1959. (arguments
  1960. '(#:phases
  1961. (modify-phases %standard-phases
  1962. (add-after 'unpack 'make-source-writable
  1963. (lambda _
  1964. ;; XXX: Git checkouts are read-only, but this package needs to
  1965. ;; modify some of its files.
  1966. (for-each make-file-writable (find-files "."))
  1967. #t))
  1968. (add-before 'bootstrap 'patch-file-names
  1969. (lambda* (#:key inputs #:allow-other-keys)
  1970. (substitute* "man/make.sh"
  1971. (("/usr/bin/xsltproc")
  1972. (string-append (assoc-ref inputs "xsltproc")
  1973. "/bin/xsltproc")))
  1974. #t))
  1975. (add-after 'install 'build-hwdb
  1976. (lambda* (#:key outputs #:allow-other-keys)
  1977. ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
  1978. ;; similar tools to display product names.
  1979. (let ((out (assoc-ref outputs "out")))
  1980. (invoke (string-append out "/bin/udevadm")
  1981. "hwdb" "--update")))))
  1982. #:configure-flags (list "--enable-manpages")))
  1983. (native-inputs
  1984. `(("autoconf" ,autoconf)
  1985. ("automake" ,automake)
  1986. ("gperf" ,gperf)
  1987. ("libtool" ,libtool)
  1988. ("pkg-config" ,pkg-config)
  1989. ;; For tests.
  1990. ("perl" ,perl)
  1991. ("python" ,python-wrapper)
  1992. ;; For documentation.
  1993. ("docbook-xml" ,docbook-xml-4.2)
  1994. ("docbook-xsl" ,docbook-xsl)
  1995. ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
  1996. ("xsltproc" ,libxslt)))
  1997. (inputs
  1998. ;; When linked against libblkid, eudev can populate /dev/disk/by-label
  1999. ;; and similar; it also installs the '60-persistent-storage.rules' file,
  2000. ;; which contains the rules to do that.
  2001. `(("util-linux" ,util-linux) ;for blkid
  2002. ("kmod" ,kmod)))
  2003. (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
  2004. (synopsis "Userspace device management")
  2005. (description "Udev is a daemon which dynamically creates and removes
  2006. device nodes from /dev/, handles hotplug events and loads drivers at boot
  2007. time.")
  2008. (license license:gpl2+)))
  2009. (define-public eudev-with-hwdb
  2010. (deprecated-package "eudev-with-hwdb" eudev))
  2011. (define-public lvm2
  2012. (package
  2013. (name "lvm2")
  2014. (version "2.02.177")
  2015. (source (origin
  2016. (method url-fetch)
  2017. (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
  2018. version ".tgz"))
  2019. (sha256
  2020. (base32
  2021. "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
  2022. (modules '((guix build utils)))
  2023. (snippet
  2024. '(begin
  2025. (use-modules (guix build utils))
  2026. ;; Honor sysconfdir.
  2027. (substitute* "make.tmpl.in"
  2028. (("confdir = .*$")
  2029. "confdir = @sysconfdir@\n")
  2030. (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
  2031. "DEFAULT_SYS_DIR = @sysconfdir@"))
  2032. #t))
  2033. (patches (search-patches "lvm2-static-link.patch"))))
  2034. (build-system gnu-build-system)
  2035. (native-inputs
  2036. `(("pkg-config" ,pkg-config)
  2037. ("procps" ,procps))) ;tests use 'pgrep'
  2038. (inputs
  2039. `(("udev" ,eudev)))
  2040. (arguments
  2041. '(#:phases
  2042. (modify-phases %standard-phases
  2043. (add-after 'configure 'set-makefile-shell
  2044. (lambda _
  2045. ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
  2046. ;; expected.
  2047. (setenv "SHELL" (which "sh"))
  2048. ;; Replace /bin/sh with the right file name.
  2049. (patch-makefile-SHELL "make.tmpl")
  2050. #t)))
  2051. #:configure-flags (list (string-append "--sysconfdir="
  2052. (assoc-ref %outputs "out")
  2053. "/etc/lvm")
  2054. "--enable-udev_sync"
  2055. "--enable-udev_rules"
  2056. "--enable-pkgconfig"
  2057. "--enable-cmdlib"
  2058. "--enable-dmeventd" ; Requires '--enable-cmdlib'.
  2059. ;; Make sure programs such as 'dmsetup' can
  2060. ;; find libdevmapper.so.
  2061. (string-append "LDFLAGS=-Wl,-rpath="
  2062. (assoc-ref %outputs "out")
  2063. "/lib,-rpath="
  2064. (assoc-ref %outputs "out")
  2065. "/lib/device-mapper")
  2066. ;; TODO: Patch make.tmpl.in to take LDFLAGS
  2067. ;; into account so that we don't need to also
  2068. ;; set CLDFLAGS.
  2069. (string-append "CLDFLAGS=-Wl,-rpath="
  2070. (assoc-ref %outputs "out")
  2071. "/lib,-rpath="
  2072. (assoc-ref %outputs "out")
  2073. "/lib/device-mapper"))
  2074. ;; The tests use 'mknod', which requires root access.
  2075. #:tests? #f))
  2076. (home-page "https://sourceware.org/lvm2/")
  2077. (synopsis "Logical volume management for Linux")
  2078. (description
  2079. "LVM2 is the logical volume management tool set for Linux-based systems.
  2080. This package includes the user-space libraries and tools, including the device
  2081. mapper. Kernel components are part of Linux-libre.")
  2082. ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
  2083. ;; Command-line tools are GPLv2.
  2084. (license (list license:gpl2 license:lgpl2.1))))
  2085. (define-public lvm2-static
  2086. (package
  2087. (inherit lvm2)
  2088. (name "lvm2-static")
  2089. ;; Propagate udev because libdevmapper.a depends on libudev.
  2090. (inputs (alist-delete "udev" (package-inputs lvm2)))
  2091. (propagated-inputs `(("udev" ,eudev)))
  2092. (arguments
  2093. (substitute-keyword-arguments (package-arguments lvm2)
  2094. ((#:configure-flags flags '())
  2095. ;; LVM2 doesn't use Libtool, hence the custom option.
  2096. `(cons "--enable-static_link" ,flags))))
  2097. (synopsis "Logical volume management for Linux (statically linked)")))
  2098. (define-public wireless-tools
  2099. (package
  2100. (name "wireless-tools")
  2101. (version "30.pre9")
  2102. (source (origin
  2103. (method url-fetch)
  2104. (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
  2105. version ".tar.gz"))
  2106. (sha256
  2107. (base32
  2108. "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
  2109. (snippet
  2110. '(begin
  2111. ;; Remove the older header files that are not free software.
  2112. (for-each (lambda (n)
  2113. (delete-file (format #f "wireless.~a.h" n)))
  2114. '(10 11 12 13 14 15 16 17 18 19 20))
  2115. #t))))
  2116. (build-system gnu-build-system)
  2117. (arguments
  2118. `(#:make-flags
  2119. (list (string-append "PREFIX=" %output)
  2120. (string-append "INSTALL_MAN=" %output "/share/man")
  2121. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
  2122. "BUILD_STATIC=")
  2123. #:phases (modify-phases %standard-phases
  2124. (delete 'configure))
  2125. #:tests? #f))
  2126. (synopsis "Tools for manipulating Linux Wireless Extensions")
  2127. (description "Wireless Tools are used to manipulate the now-deprecated
  2128. Linux Wireless Extensions; consider using 'iw' instead. The Wireless
  2129. Extension was an interface allowing you to set Wireless LAN specific
  2130. parameters and get the specific stats. It is deprecated in favor the nl80211
  2131. interface.")
  2132. (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
  2133. ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
  2134. ;; other files are distributed under gpl2.
  2135. (license (list license:gpl2 license:lgpl2.1+))))
  2136. (define-public crda
  2137. (package
  2138. (name "crda")
  2139. (version "3.18")
  2140. (source (origin
  2141. (method url-fetch)
  2142. (uri (string-append "mirror://kernel.org/software/network/crda/"
  2143. "crda-" version ".tar.xz"))
  2144. (sha256
  2145. (base32
  2146. "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
  2147. (patches (search-patches "crda-optional-gcrypt.patch"))))
  2148. (build-system gnu-build-system)
  2149. (arguments
  2150. '(#:phases (modify-phases %standard-phases
  2151. (delete 'configure)
  2152. (add-after 'unpack 'gzip-determinism
  2153. (lambda _
  2154. (substitute* "Makefile"
  2155. (("gzip") "gzip --no-name"))
  2156. #t))
  2157. (add-before
  2158. 'build 'no-werror-no-ldconfig
  2159. (lambda _
  2160. (substitute* "Makefile"
  2161. (("-Werror") "")
  2162. (("ldconfig") "true"))
  2163. #t))
  2164. (add-before
  2165. 'build 'set-regulator-db-file-name
  2166. (lambda* (#:key inputs #:allow-other-keys)
  2167. ;; Tell CRDA where to find our database.
  2168. (let ((regdb (assoc-ref inputs "wireless-regdb")))
  2169. (substitute* "crda.c"
  2170. (("\"/lib/crda/regulatory.bin\"")
  2171. (string-append "\"" regdb
  2172. "/lib/crda/regulatory.bin\"")))
  2173. #t))))
  2174. #:test-target "verify"
  2175. #:make-flags (let ((out (assoc-ref %outputs "out"))
  2176. (regdb (assoc-ref %build-inputs "wireless-regdb")))
  2177. (list "CC=gcc" "V=1"
  2178. ;; Disable signature-checking on 'regulatory.bin'.
  2179. ;; The reason is that this simplifies maintenance
  2180. ;; on our side (no need to manage a distro key
  2181. ;; pair), and we can guarantee integrity of
  2182. ;; 'regulatory.bin' by other means anyway, such as
  2183. ;; 'guix gc --verify'. See
  2184. ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
  2185. ;; for a discssion.
  2186. "USE_OPENSSL=0"
  2187. (string-append "PREFIX=" out)
  2188. (string-append "SBINDIR=" out "/sbin/")
  2189. (string-append "UDEV_RULE_DIR="
  2190. out "/lib/udev/rules.d")
  2191. (string-append "LDFLAGS=-Wl,-rpath="
  2192. out "/lib -L.")
  2193. (string-append "REG_BIN=" regdb
  2194. "/lib/crda/regulatory.bin")))))
  2195. (native-inputs `(("pkg-config" ,pkg-config)
  2196. ("python" ,python-2)
  2197. ("wireless-regdb" ,wireless-regdb)))
  2198. (inputs `(("libnl" ,libnl)))
  2199. (home-page
  2200. "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
  2201. (synopsis "Central regulatory domain agent (CRDA) for WiFi")
  2202. (description
  2203. "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
  2204. communication between the kernel Linux and user space for regulatory
  2205. compliance.")
  2206. (license license:copyleft-next)))
  2207. (define-public wireless-regdb
  2208. (package
  2209. (name "wireless-regdb")
  2210. (version "2017.03.07")
  2211. (source (origin
  2212. (method url-fetch)
  2213. (uri (string-append
  2214. "mirror://kernel.org/software/network/wireless-regdb/"
  2215. "wireless-regdb-" version ".tar.xz"))
  2216. (sha256
  2217. (base32
  2218. "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
  2219. ;; We're building 'regulatory.bin' by ourselves.
  2220. (snippet '(begin
  2221. (delete-file "regulatory.bin")
  2222. #t))))
  2223. (build-system gnu-build-system)
  2224. (arguments
  2225. '(#:phases (modify-phases %standard-phases
  2226. (add-after 'unpack 'gzip-determinism
  2227. (lambda _
  2228. (substitute* "Makefile"
  2229. (("gzip") "gzip --no-name"))
  2230. #t))
  2231. (delete 'configure))
  2232. ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
  2233. ;; is computed and can be equal to 'maintainer-clean'; when that
  2234. ;; happens, we can end up deleting the 'regulatory.bin' file that we
  2235. ;; just built. Thus, build things sequentially.
  2236. #:parallel-build? #f
  2237. #:tests? #f ;no tests
  2238. #:make-flags (let ((out (assoc-ref %outputs "out")))
  2239. (list (string-append "PREFIX=" out)
  2240. (string-append "LSB_ID=GuixSD")
  2241. (string-append "DISTRO_PUBKEY=/dev/null")
  2242. (string-append "DISTRO_PRIVKEY=/dev/null")
  2243. (string-append "REGDB_PUBKEY=/dev/null")
  2244. ;; Leave that empty so that db2bin.py doesn't try
  2245. ;; to sign 'regulatory.bin'. This allows us to
  2246. ;; avoid managing a key pair for the whole distro.
  2247. (string-append "REGDB_PRIVKEY=")))))
  2248. (native-inputs `(("python" ,python-2)))
  2249. (home-page
  2250. "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
  2251. (synopsis "Wireless regulatory database")
  2252. (description
  2253. "This package contains the wireless regulatory database Central
  2254. Regulatory Database Agent (CRDA) daemon. The database contains information on
  2255. country-specific regulations for the wireless spectrum.")
  2256. (license license:isc)))
  2257. (define-public lm-sensors
  2258. (package
  2259. (name "lm-sensors")
  2260. (version "3.4.0")
  2261. (source (origin
  2262. (method url-fetch)
  2263. (uri (list (string-append
  2264. "https://github.com/groeck/lm-sensors/archive/V"
  2265. (string-join (string-split version #\.) "-")
  2266. ".tar.gz")))
  2267. (file-name (string-append name "-" version ".tar.gz"))
  2268. (sha256
  2269. (base32
  2270. "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
  2271. (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
  2272. (build-system gnu-build-system)
  2273. (inputs `(("rrdtool" ,rrdtool)
  2274. ("perl" ,perl)
  2275. ("kmod" ,kmod)
  2276. ("gnuplot" ,gnuplot)))
  2277. (native-inputs `(("pkg-config" ,pkg-config)
  2278. ("flex" ,flex)
  2279. ("bison" ,bison)
  2280. ("which" ,which)))
  2281. (outputs '("lib" ;avoid perl in closure
  2282. "out"))
  2283. (arguments
  2284. `(#:tests? #f ; no 'check' target
  2285. #:make-flags (list (string-append "PREFIX=" %output)
  2286. (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
  2287. (string-append "INCLUDEDIR="
  2288. (assoc-ref %outputs "lib") "/include")
  2289. (string-append "MANDIR=" %output "/share/man")
  2290. (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
  2291. #:phases
  2292. (modify-phases %standard-phases
  2293. (delete 'configure)
  2294. (add-before 'build 'patch-exec-paths
  2295. (lambda* (#:key inputs outputs #:allow-other-keys)
  2296. (substitute* "prog/detect/sensors-detect"
  2297. (("`uname")
  2298. (string-append "`" (assoc-ref inputs "coreutils")
  2299. "/bin/uname"))
  2300. (("(`|\")modprobe" all open-quote)
  2301. (string-append open-quote
  2302. (assoc-ref inputs "kmod")
  2303. "/bin/modprobe")))
  2304. (substitute* '("prog/pwm/pwmconfig"
  2305. "prog/pwm/fancontrol")
  2306. (("gnuplot")
  2307. (string-append (assoc-ref inputs "gnuplot")
  2308. "/bin/gnuplot"))
  2309. (("cat ")
  2310. (string-append (assoc-ref inputs "coreutils")
  2311. "/bin/cat "))
  2312. (("egrep ")
  2313. (string-append (assoc-ref inputs "grep")
  2314. "/bin/egrep "))
  2315. (("sed -e")
  2316. (string-append (assoc-ref inputs "sed")
  2317. "/bin/sed -e"))
  2318. (("cut -d")
  2319. (string-append (assoc-ref inputs "coreutils")
  2320. "/bin/cut -d"))
  2321. (("sleep ")
  2322. (string-append (assoc-ref inputs "coreutils")
  2323. "/bin/sleep "))
  2324. (("readlink -f")
  2325. (string-append (assoc-ref inputs "coreutils")
  2326. "/bin/readlink -f")))
  2327. #t)))))
  2328. (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
  2329. (synopsis "Utilities to read temperature/voltage/fan sensors")
  2330. (description
  2331. "Lm-sensors is a hardware health monitoring package for Linux. It allows
  2332. you to access information from temperature, voltage, and fan speed sensors.
  2333. It works with most newer systems.")
  2334. (license license:gpl2+)))
  2335. (define-public iucode-tool
  2336. (package
  2337. (name "iucode-tool")
  2338. (version "2.2")
  2339. (source (origin
  2340. (method url-fetch)
  2341. (uri (string-append "https://gitlab.com/iucode-tool/releases"
  2342. "/raw/latest/iucode-tool_" version ".tar.xz"))
  2343. (sha256
  2344. (base32
  2345. "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
  2346. (build-system gnu-build-system)
  2347. (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
  2348. (synopsis "Manipulate Intel microcode bundles")
  2349. (description
  2350. "@command{iucode_tool} is a utility to work with microcode packages for
  2351. Intel processors. It can convert between formats, extract specific versions,
  2352. create a firmware image suitable for the Linux kernel, and more.")
  2353. ;; cpuid.h is available for i686, x86_64, and ia64.
  2354. (supported-systems '("i686-linux" "x86_64-linux"))
  2355. (license license:gpl2+)))
  2356. (define-public i2c-tools
  2357. (package
  2358. (name "i2c-tools")
  2359. (version "3.1.1")
  2360. (source (origin
  2361. (method url-fetch)
  2362. (uri (string-append
  2363. "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
  2364. version ".tar.bz2"))
  2365. (sha256
  2366. (base32
  2367. "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
  2368. (build-system gnu-build-system)
  2369. (arguments
  2370. `(#:tests? #f ; no 'check' target
  2371. #:make-flags (list (string-append "prefix=" %output)
  2372. "CC=gcc")
  2373. ;; no configure script
  2374. #:phases (modify-phases %standard-phases (delete 'configure))))
  2375. (inputs
  2376. `(("perl" ,perl)))
  2377. (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
  2378. (synopsis "I2C tools for Linux")
  2379. (description
  2380. "The i2c-tools package contains a heterogeneous set of I2C tools for
  2381. Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
  2382. EEPROM decoding scripts, EEPROM programming tools, and a python module for
  2383. SMBus access.")
  2384. (license license:gpl2+)))
  2385. (define-public xsensors
  2386. (package
  2387. (name "xsensors")
  2388. (version "0.70")
  2389. (source (origin
  2390. (method url-fetch)
  2391. (uri (string-append
  2392. "http://www.linuxhardware.org/xsensors/xsensors-"
  2393. version ".tar.gz"))
  2394. (sha256
  2395. (base32
  2396. "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
  2397. (build-system gnu-build-system)
  2398. (inputs `(("lm-sensors" ,lm-sensors "lib")
  2399. ("gtk" ,gtk+-2)))
  2400. (native-inputs `(("pkg-config" ,pkg-config)))
  2401. (arguments
  2402. `(#:phases
  2403. (modify-phases %standard-phases
  2404. (add-before 'configure 'enable-deprecated
  2405. (lambda _
  2406. (substitute* "src/Makefile.in"
  2407. (("-DGDK_DISABLE_DEPRECATED") "")
  2408. (("-DGTK_DISABLE_DEPRECATED") ""))
  2409. #t))
  2410. (add-before 'configure 'remove-Werror
  2411. (lambda _
  2412. (substitute* '("configure" "src/Makefile.in")
  2413. (("-Werror") ""))
  2414. #t)))))
  2415. (home-page "http://www.linuxhardware.org/xsensors/")
  2416. (synopsis "Hardware health information viewer")
  2417. (description
  2418. "Xsensors reads data from the libsensors library regarding hardware
  2419. health such as temperature, voltage and fan speed and displays the information
  2420. in a digital read-out.")
  2421. (license license:gpl2+)))
  2422. (define-public perf
  2423. (package
  2424. (name "perf")
  2425. (version (package-version linux-libre))
  2426. (source (package-source linux-libre))
  2427. (build-system gnu-build-system)
  2428. (arguments
  2429. '(#:phases
  2430. (modify-phases %standard-phases
  2431. (replace 'configure
  2432. (lambda* (#:key inputs #:allow-other-keys)
  2433. (setenv "SHELL_PATH" (which "bash"))
  2434. (chdir "tools/perf")
  2435. #t)))
  2436. #:make-flags (list (string-append "prefix="
  2437. (assoc-ref %outputs "out"))
  2438. "WERROR=0"
  2439. ;; By default, 'config/Makefile' uses lib64 on
  2440. ;; x86_64. Work around that.
  2441. "lib=lib")
  2442. #:tests? #f)) ;no tests
  2443. (native-inputs
  2444. `(("pkg-config" ,pkg-config)
  2445. ("bison" ,bison)
  2446. ("flex" ,flex)
  2447. ;; There are build scripts written in these languages.
  2448. ("perl" ,perl)
  2449. ("python" ,python-2)))
  2450. (inputs
  2451. `(("slang" ,slang) ;for the interactive TUI
  2452. ;; ("newt" ,newt)
  2453. ("python" ,python-2) ;'perf' links against libpython
  2454. ("elfutils" ,elfutils)
  2455. ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
  2456. ("libunwind" ,libunwind) ;better stack walking
  2457. ("numactl" ,numactl) ;for 'perf bench numa mem'
  2458. ;; Documentation.
  2459. ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
  2460. ("docbook-xsl" ,docbook-xsl)
  2461. ("xmlto" ,xmlto)
  2462. ("asciidoc" ,asciidoc)))
  2463. (home-page "https://perf.wiki.kernel.org/")
  2464. (synopsis "Linux profiling with performance counters")
  2465. (description
  2466. "perf is a tool suite for profiling using hardware performance counters,
  2467. with support in the Linux kernel. perf can instrument CPU performance
  2468. counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
  2469. of lightweight profiling. This package contains the user-land tools and in
  2470. particular the 'perf' command.")
  2471. (license (package-license linux-libre))))
  2472. (define-public pflask
  2473. (package
  2474. (name "pflask")
  2475. (version "0.2")
  2476. (source (origin
  2477. (method url-fetch)
  2478. (uri (string-append "https://github.com/ghedo/pflask/archive/v"
  2479. version ".tar.gz"))
  2480. (file-name (string-append name "-" version ".tar.gz"))
  2481. (sha256
  2482. (base32
  2483. "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
  2484. (build-system cmake-build-system)
  2485. (arguments
  2486. '(#:tests? #f)) ; no tests
  2487. (home-page "https://ghedo.github.io/pflask/")
  2488. (synopsis "Simple tool for creating Linux namespace containers")
  2489. (description "pflask is a simple tool for creating Linux namespace
  2490. containers. It can be used for running a command or even booting an OS inside
  2491. an isolated container, created with the help of Linux namespaces. It is
  2492. similar in functionality to chroot, although pflask provides better isolation
  2493. thanks to the use of namespaces.")
  2494. (license license:bsd-2)))
  2495. (define-public singularity
  2496. (package
  2497. (name "singularity")
  2498. (version "2.6.1")
  2499. (source (origin
  2500. (method url-fetch)
  2501. (uri (string-append "https://github.com/singularityware/singularity/"
  2502. "releases/download/" version
  2503. "/singularity-" version ".tar.gz"))
  2504. (sha256
  2505. (base32
  2506. "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))))
  2507. (build-system gnu-build-system)
  2508. (arguments
  2509. `(#:configure-flags
  2510. (list "--disable-suid"
  2511. "--localstatedir=/var")
  2512. #:phases
  2513. (modify-phases %standard-phases
  2514. ;; Do not create directories in /var.
  2515. (add-after 'unpack 'disable-install-hook
  2516. (lambda _
  2517. (substitute* "Makefile.in"
  2518. (("\\$\\(MAKE\\) .*install-data-hook") ""))
  2519. #t))
  2520. (add-after 'unpack 'patch-reference-to-squashfs-tools
  2521. (lambda _
  2522. (substitute* "libexec/cli/build.exec"
  2523. (("if ! singularity_which mksquashfs") "if 0")
  2524. (("if ! mksquashfs")
  2525. (string-append "if ! " (which "mksquashfs"))))
  2526. #t)))))
  2527. (inputs
  2528. `(("libarchive" ,libarchive)
  2529. ("python" ,python-wrapper)
  2530. ("nettle" ,nettle)
  2531. ("zlib" ,zlib)
  2532. ("squashfs-tools" ,squashfs-tools)))
  2533. (home-page "https://singularity.lbl.gov/")
  2534. (synopsis "Container platform")
  2535. (description "Singularity is a container platform supporting a number of
  2536. container image formats. It can build SquashFS container images or import
  2537. existing Docker images. Singularity requires kernel support for container
  2538. isolation or root privileges.")
  2539. (license license:bsd-3)))
  2540. (define-public hdparm
  2541. (package
  2542. (name "hdparm")
  2543. (version "9.58")
  2544. (source (origin
  2545. (method url-fetch)
  2546. (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
  2547. "hdparm-" version ".tar.gz"))
  2548. (sha256
  2549. (base32
  2550. "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
  2551. (build-system gnu-build-system)
  2552. (arguments
  2553. `(#:make-flags (let ((out (assoc-ref %outputs "out")))
  2554. (list (string-append "binprefix=" out)
  2555. (string-append "manprefix=" out)
  2556. "CC=gcc"))
  2557. #:phases
  2558. (modify-phases %standard-phases
  2559. (delete 'configure)) ; no configure script
  2560. #:tests? #f)) ; no test suite
  2561. (home-page "https://sourceforge.net/projects/hdparm/")
  2562. (synopsis "View and tune ATA disk drive parameters")
  2563. (description
  2564. "@command{hdparm} is a command-line utility to control ATA controllers and
  2565. disk drives. It can increase performance and/or reliability by careful tuning
  2566. of hardware settings like power and acoustic management, DMA modes, and caching.
  2567. It can also display detailed device information, or be used as a simple
  2568. performance benchmarking tool.
  2569. @command{hdparm} provides a command line interface to various Linux kernel
  2570. interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
  2571. IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
  2572. Translation (@dfn{SAT}) are also supported.")
  2573. (license (license:non-copyleft "file://LICENSE.TXT"))))
  2574. (define-public rfkill
  2575. (package
  2576. (name "rfkill")
  2577. (version "0.5")
  2578. (source (origin
  2579. (method url-fetch)
  2580. (uri (string-append "mirror://kernel.org/software/network/"
  2581. name "/" name "-" version ".tar.xz"))
  2582. (sha256
  2583. (base32
  2584. "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
  2585. (build-system gnu-build-system)
  2586. (arguments
  2587. `(#:make-flags (list "CC=gcc"
  2588. (string-append "PREFIX=" %output))
  2589. #:phases (modify-phases %standard-phases
  2590. (delete 'configure))
  2591. #:tests? #f))
  2592. (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
  2593. (synopsis "Tool for enabling and disabling wireless devices")
  2594. (description
  2595. "rfkill is a simple tool for accessing the rfkill device interface,
  2596. which is used to enable and disable wireless networking devices, typically
  2597. WLAN, Bluetooth and mobile broadband.")
  2598. (license (license:non-copyleft "file://COPYING"
  2599. "See COPYING in the distribution."))
  2600. ;; rfkill is part of util-linux as of 2.31.
  2601. (properties `((superseded . ,util-linux)))))
  2602. (define-public acpi
  2603. (package
  2604. (name "acpi")
  2605. (version "1.7")
  2606. (source (origin
  2607. (method url-fetch)
  2608. (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
  2609. version "/" name "-" version ".tar.gz"))
  2610. (sha256
  2611. (base32
  2612. "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
  2613. (build-system gnu-build-system)
  2614. (home-page "http://acpiclient.sourceforge.net")
  2615. (synopsis "Display information on ACPI devices")
  2616. (description "@code{acpi} attempts to replicate the functionality of the
  2617. \"old\" @code{apm} command on ACPI systems, including battery and thermal
  2618. information. It does not support ACPI suspending, only displays information
  2619. about ACPI devices.")
  2620. (license license:gpl2+)))
  2621. (define-public acpid
  2622. (package
  2623. (name "acpid")
  2624. (version "2.0.31")
  2625. (source (origin
  2626. (method url-fetch)
  2627. (uri (string-append "mirror://sourceforge/acpid2/acpid-"
  2628. version ".tar.xz"))
  2629. (sha256
  2630. (base32
  2631. "1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
  2632. (build-system gnu-build-system)
  2633. (home-page "https://sourceforge.net/projects/acpid2/")
  2634. (synopsis "Daemon for delivering ACPI events to user-space programs")
  2635. (description
  2636. "acpid is designed to notify user-space programs of Advanced
  2637. Configuration and Power Interface (ACPI) events. acpid should be started
  2638. during the system boot, and will run as a background process. When an ACPI
  2639. event is received from the kernel, acpid will examine the list of rules
  2640. specified in /etc/acpi/events and execute the rules that match the event.")
  2641. (license license:gpl2+)))
  2642. (define-public sysfsutils
  2643. (package
  2644. (name "sysfsutils")
  2645. (version "2.1.0")
  2646. (source
  2647. (origin
  2648. (method url-fetch)
  2649. (uri
  2650. (string-append
  2651. "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
  2652. version ".tar.gz"))
  2653. (sha256
  2654. (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
  2655. (build-system gnu-build-system)
  2656. (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
  2657. (synopsis "System utilities based on Linux sysfs")
  2658. (description
  2659. "These are a set of utilities built upon sysfs, a virtual file system in
  2660. Linux kernel versions 2.5+ that exposes a system's device tree. The package
  2661. also contains the libsysfs library.")
  2662. ;; The library is under lgpl2.1+ (all files say "or any later version").
  2663. ;; The rest is mostly gpl2, with a few files indicating gpl2+.
  2664. (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
  2665. (define-public sysfsutils-1
  2666. (package
  2667. (inherit sysfsutils)
  2668. (version "1.3.0")
  2669. (source
  2670. (origin
  2671. (method url-fetch)
  2672. (uri
  2673. (string-append
  2674. "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
  2675. "/sysfsutils-" version ".tar.gz"))
  2676. (sha256
  2677. (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
  2678. (modules '((guix build utils)))
  2679. (snippet
  2680. '(begin
  2681. (substitute* "Makefile.in"
  2682. (("includedir = /usr/include/sysfs")
  2683. "includedir = @includedir@"))
  2684. (substitute* "configure"
  2685. (("includedir='(\\$\\{prefix\\}/include)'" all orig)
  2686. (string-append "includedir='" orig "/sysfs'")))
  2687. #t))))
  2688. (synopsis "System utilities based on Linux sysfs (version 1.x)")))
  2689. (define-public cpufrequtils
  2690. (package
  2691. (name "cpufrequtils")
  2692. (version "0.3")
  2693. (source
  2694. (origin
  2695. (method url-fetch)
  2696. (uri
  2697. (string-append
  2698. "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
  2699. version ".tar.gz"))
  2700. (sha256
  2701. (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
  2702. (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
  2703. (build-system gnu-build-system)
  2704. (native-inputs
  2705. `(("sysfsutils" ,sysfsutils-1)))
  2706. (arguments
  2707. '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  2708. (assoc-ref %outputs "out") "/lib"))))
  2709. (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
  2710. (synopsis "Utilities to get and set CPU frequency on Linux")
  2711. (description
  2712. "The cpufrequtils suite contains utilities to retrieve CPU frequency
  2713. information, and set the CPU frequency if supported, using the cpufreq
  2714. capabilities of the Linux kernel.")
  2715. (license license:gpl2)))
  2716. (define-public libraw1394
  2717. (package
  2718. (name "libraw1394")
  2719. (version "2.1.2")
  2720. (source (origin
  2721. (method url-fetch)
  2722. (uri (string-append
  2723. "mirror://kernel.org/linux/libs/ieee1394/"
  2724. name "-" version ".tar.xz"))
  2725. (sha256
  2726. (base32
  2727. "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
  2728. (build-system gnu-build-system)
  2729. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  2730. (synopsis "Interface library for the Linux IEEE1394 drivers")
  2731. (description
  2732. "Libraw1394 is the only supported interface to the kernel side raw1394 of
  2733. the Linux IEEE-1394 subsystem, which provides direct access to the connected
  2734. 1394 buses to user space. Through libraw1394/raw1394, applications can directly
  2735. send to and receive from other nodes without requiring a kernel driver for the
  2736. protocol in question.")
  2737. (license license:lgpl2.1+)))
  2738. (define-public libavc1394
  2739. (package
  2740. (name "libavc1394")
  2741. (version "0.5.4")
  2742. (source (origin
  2743. (method url-fetch)
  2744. (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
  2745. name "-" version ".tar.gz"))
  2746. (sha256
  2747. (base32
  2748. "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
  2749. (build-system gnu-build-system)
  2750. (native-inputs
  2751. `(("pkg-config" ,pkg-config)))
  2752. (propagated-inputs
  2753. `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
  2754. (home-page "https://sourceforge.net/projects/libavc1394/")
  2755. (synopsis "AV/C protocol library for IEEE 1394")
  2756. (description
  2757. "Libavc1394 is a programming interface to the AV/C specification from
  2758. the 1394 Trade Association. AV/C stands for Audio/Video Control.")
  2759. (license license:lgpl2.1+)))
  2760. (define-public libiec61883
  2761. (package
  2762. (name "libiec61883")
  2763. (version "1.2.0")
  2764. (source (origin
  2765. (method url-fetch)
  2766. (uri (string-append
  2767. "mirror://kernel.org/linux/libs/ieee1394/"
  2768. name "-" version ".tar.xz"))
  2769. (sha256
  2770. (base32
  2771. "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
  2772. (build-system gnu-build-system)
  2773. (native-inputs
  2774. `(("pkg-config" ,pkg-config)))
  2775. (propagated-inputs
  2776. `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
  2777. (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
  2778. (synopsis "Isochronous streaming media library for IEEE 1394")
  2779. (description
  2780. "The libiec61883 library provides a higher level API for streaming DV,
  2781. MPEG-2 and audio over Linux IEEE 1394.")
  2782. (license license:lgpl2.1+)))
  2783. (define-public mdadm
  2784. (package
  2785. (name "mdadm")
  2786. (version "4.1")
  2787. (source (origin
  2788. (method url-fetch)
  2789. (uri (string-append
  2790. "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
  2791. version ".tar.xz"))
  2792. (sha256
  2793. (base32
  2794. "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
  2795. (build-system gnu-build-system)
  2796. (inputs
  2797. `(("udev" ,eudev)))
  2798. (arguments
  2799. `(#:make-flags (let ((out (assoc-ref %outputs "out")))
  2800. (list "CC=gcc"
  2801. "INSTALL=install"
  2802. "CHECK_RUN_DIR=0"
  2803. ;; TODO: tell it where to find 'sendmail'
  2804. ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
  2805. (string-append "BINDIR=" out "/sbin")
  2806. (string-append "MANDIR=" out "/share/man")
  2807. (string-append "UDEVDIR=" out "/lib/udev")))
  2808. #:phases
  2809. (modify-phases %standard-phases
  2810. (add-before 'build 'patch-program-paths
  2811. (lambda* (#:key inputs #:allow-other-keys)
  2812. (let ((coreutils (assoc-ref inputs "coreutils")))
  2813. (substitute* "udev-md-raid-arrays.rules"
  2814. (("/usr/bin/(readlink|basename)" all program)
  2815. (string-append coreutils "/bin/" program))))
  2816. #t))
  2817. (add-before 'build 'remove-W-error
  2818. (lambda _
  2819. ;; We cannot build with -Werror on i686 due to a
  2820. ;; 'sign-compare' warning in util.c.
  2821. (substitute* "Makefile"
  2822. (("-Werror") ""))
  2823. #t))
  2824. (delete 'configure))
  2825. ;;tests must be done as root
  2826. #:tests? #f))
  2827. (home-page "http://neil.brown.name/blog/mdadm")
  2828. (synopsis "Tool for managing Linux Software RAID arrays")
  2829. (description
  2830. "mdadm is a tool for managing Linux Software RAID arrays. It can create,
  2831. assemble, report on, and monitor arrays. It can also move spares between raid
  2832. arrays when needed.")
  2833. (license license:gpl2+)))
  2834. (define-public mdadm-static
  2835. (package
  2836. (inherit mdadm)
  2837. (name "mdadm-static")
  2838. (arguments
  2839. (substitute-keyword-arguments (package-arguments mdadm)
  2840. ((#:make-flags flags)
  2841. `(cons "LDFLAGS = -static" ,flags))
  2842. ((#:phases phases)
  2843. `(modify-phases ,phases
  2844. (add-after 'install 'remove-cruft
  2845. (lambda* (#:key outputs #:allow-other-keys)
  2846. (let* ((out (assoc-ref outputs "out"))
  2847. (precious? (lambda (file)
  2848. (member file '("." ".." "sbin"))))
  2849. (directories (scandir out (negate precious?))))
  2850. (with-directory-excursion out
  2851. (for-each delete-file-recursively directories)
  2852. (remove-store-references "sbin/mdadm")
  2853. (delete-file "sbin/mdmon")
  2854. #t))))))
  2855. ((#:modules modules %gnu-build-system-modules)
  2856. `((ice-9 ftw) ,@modules))
  2857. ((#:strip-flags _ '())
  2858. ''("--strip-all")) ;strip a few extra KiB
  2859. ((#:allowed-references _ '("out"))
  2860. '("out")))) ;refer only self
  2861. (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
  2862. (define-public multipath-tools
  2863. (package
  2864. (name "multipath-tools")
  2865. (version "0.7.9")
  2866. (source (origin
  2867. (method url-fetch)
  2868. (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
  2869. ".git;a=snapshot;h=" version ";sf=tgz"))
  2870. (file-name (string-append name "-" version ".tar.gz"))
  2871. (sha256
  2872. (base32
  2873. "1jhi6bhl4ih75rfmyyjxd35ghgch5ls1gw40cjxwy9d6bd41z6q1"))
  2874. (modules '((guix build utils)))
  2875. (snippet
  2876. '(begin
  2877. ;; Drop bundled valgrind headers.
  2878. (delete-file-recursively "third-party")
  2879. (substitute* '("multipathd/main.c"
  2880. "libmultipath/debug.c")
  2881. (("#include \"../third-party/")
  2882. "#include \""))
  2883. #t))))
  2884. (build-system gnu-build-system)
  2885. (arguments
  2886. '(#:tests? #f ; no tests
  2887. #:make-flags (list "CC=gcc"
  2888. (string-append "DESTDIR="
  2889. (assoc-ref %outputs "out"))
  2890. "SYSTEMDPATH=lib"
  2891. (string-append "LDFLAGS=-Wl,-rpath="
  2892. (assoc-ref %outputs "out")
  2893. "/lib"))
  2894. #:phases
  2895. (modify-phases %standard-phases
  2896. (add-after 'unpack 'patch-source
  2897. (lambda* (#:key inputs #:allow-other-keys)
  2898. (let ((lvm2 (assoc-ref inputs "lvm2"))
  2899. (udev (assoc-ref inputs "udev")))
  2900. (substitute* "Makefile.inc"
  2901. (("\\$\\(prefix\\)/usr") "$(prefix)")
  2902. ;; Do not save timestamp to avoid gzip "timestamp
  2903. ;; out-of-range" warnings.
  2904. (("gzip -9") "gzip -9n"))
  2905. (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
  2906. (("/usr/include/libdevmapper.h")
  2907. (string-append lvm2 "/include/libdevmapper.h"))
  2908. (("/usr/include/libudev.h")
  2909. (string-append udev "/include/libudev.h")))
  2910. #t)))
  2911. (delete 'configure)))) ; no configure script
  2912. (native-inputs
  2913. `(("perl" ,perl)
  2914. ("pkg-config" ,pkg-config)
  2915. ("valgrind" ,valgrind)))
  2916. (inputs
  2917. `(("ceph:lib" ,ceph "lib")
  2918. ("json-c" ,json-c)
  2919. ("libaio" ,libaio)
  2920. ("liburcu" ,liburcu)
  2921. ("lvm2" ,lvm2)
  2922. ("readline" ,readline)
  2923. ("udev" ,eudev)))
  2924. (home-page "http://christophe.varoqui.free.fr/")
  2925. (synopsis "Access block devices through multiple paths")
  2926. (description
  2927. "This package provides the following binaries to drive the
  2928. Linux Device Mapper multipathing driver:
  2929. @enumerate
  2930. @item @command{multipath} - Device mapper target autoconfig.
  2931. @item @command{multipathd} - Multipath daemon.
  2932. @item @command{mpathpersist} - Manages SCSI persistent reservations on
  2933. @code{dm} multipath devices.
  2934. @item @command{kpartx} - Create device maps from partition tables.
  2935. @end enumerate")
  2936. (license (list license:gpl2+ ; main distribution
  2937. license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
  2938. (define-public libaio
  2939. (package
  2940. (name "libaio")
  2941. (version "0.3.111")
  2942. (source (origin
  2943. (method url-fetch)
  2944. (uri (list
  2945. (string-append "https://releases.pagure.org/libaio/"
  2946. name "-" version ".tar.gz")))
  2947. (sha256
  2948. (base32
  2949. "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
  2950. (build-system gnu-build-system)
  2951. (arguments
  2952. '(#:make-flags
  2953. (list "CC=gcc" (string-append "prefix=" %output))
  2954. #:test-target "partcheck" ; need root for a full 'check'
  2955. #:phases
  2956. (modify-phases %standard-phases (delete 'configure)))) ; no configure script
  2957. (home-page "https://pagure.io/libaio")
  2958. (synopsis "Linux-native asynchronous I/O access library")
  2959. (description
  2960. "This library enables userspace to use Linux kernel asynchronous I/O
  2961. system calls, important for the performance of databases and other advanced
  2962. applications.")
  2963. (license license:lgpl2.1+)))
  2964. (define-public sbc
  2965. (package
  2966. (name "sbc")
  2967. (version "1.3")
  2968. (source (origin
  2969. (method url-fetch)
  2970. (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
  2971. name "-" version ".tar.xz"))
  2972. (sha256
  2973. (base32
  2974. "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
  2975. (build-system gnu-build-system)
  2976. (inputs
  2977. `(("libsndfile" ,libsndfile)))
  2978. (native-inputs
  2979. `(("pkg-config" ,pkg-config)))
  2980. (home-page "https://www.kernel.org/pub/linux/bluetooth/")
  2981. (synopsis "Bluetooth subband audio codec")
  2982. (description
  2983. "The SBC is a digital audio encoder and decoder used to transfer data to
  2984. Bluetooth audio output devices like headphones or loudspeakers.")
  2985. (license license:gpl2+)))
  2986. (define-public bluez
  2987. (package
  2988. (name "bluez")
  2989. (version "5.50")
  2990. (source (origin
  2991. (method url-fetch)
  2992. (uri (string-append
  2993. "mirror://kernel.org/linux/bluetooth/bluez-"
  2994. version ".tar.xz"))
  2995. (sha256
  2996. (base32
  2997. "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
  2998. (build-system gnu-build-system)
  2999. (arguments
  3000. `(#:configure-flags
  3001. (let ((out (assoc-ref %outputs "out")))
  3002. (list "--sysconfdir=/etc"
  3003. "--localstatedir=/var"
  3004. "--enable-library"
  3005. "--disable-systemd"
  3006. ;; Install dbus/udev files to the correct location.
  3007. (string-append "--with-dbusconfdir=" out "/etc")
  3008. (string-append "--with-udevdir=" out "/lib/udev")))
  3009. #:phases
  3010. (modify-phases %standard-phases
  3011. ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
  3012. ;; issue (discussion on upstream mailing list:
  3013. ;; https://marc.info/?t=149578476300002&r=1&w=2)
  3014. (add-before 'check 'skip-wonky-test
  3015. (lambda _
  3016. (substitute* "unit/test-gatt.c"
  3017. (("tester_init\\(&argc, &argv\\);") "return 77;"))
  3018. #t))
  3019. (add-after 'install 'post-install
  3020. (lambda* (#:key inputs outputs #:allow-other-keys)
  3021. (let* ((out (assoc-ref outputs "out"))
  3022. (servicedir (string-append out "/share/dbus-1/services"))
  3023. (service "obexd/src/org.bluez.obex.service")
  3024. (rule (string-append
  3025. out "/lib/udev/rules.d/97-hid2hci.rules")))
  3026. ;; Install the obex dbus service file.
  3027. (substitute* service
  3028. (("/bin/false")
  3029. (string-append out "/libexec/bluetooth/obexd")))
  3030. (install-file service servicedir)
  3031. ;; Fix paths in the udev rule.
  3032. (substitute* rule
  3033. (("hid2hci --method")
  3034. (string-append out "/lib/udev/hid2hci --method"))
  3035. (("/sbin/udevadm")
  3036. (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
  3037. #t))))))
  3038. (native-inputs
  3039. `(("pkg-config" ,pkg-config)
  3040. ("gettext" ,gettext-minimal)))
  3041. (inputs
  3042. `(("glib" ,glib)
  3043. ("dbus" ,dbus)
  3044. ("eudev" ,eudev)
  3045. ("libical" ,libical)
  3046. ("readline" ,readline)))
  3047. (home-page "http://www.bluez.org/")
  3048. (synopsis "Linux Bluetooth protocol stack")
  3049. (description
  3050. "BlueZ provides support for the core Bluetooth layers and protocols. It
  3051. is flexible, efficient and uses a modular implementation.")
  3052. (license license:gpl2+)))
  3053. (define-public fuse-exfat
  3054. (package
  3055. (name "fuse-exfat")
  3056. (version "1.3.0")
  3057. (source (origin
  3058. (method url-fetch)
  3059. (uri (string-append
  3060. "https://github.com/relan/exfat/releases/download/v"
  3061. version "/" name "-" version ".tar.gz"))
  3062. (sha256
  3063. (base32
  3064. "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
  3065. (build-system gnu-build-system)
  3066. (native-inputs
  3067. `(("pkg-config" ,pkg-config)))
  3068. (inputs
  3069. `(("fuse" ,fuse)))
  3070. (home-page "https://github.com/relan/exfat")
  3071. (synopsis "Mount exFAT file systems")
  3072. (description
  3073. "This package provides a FUSE-based file system that provides read and
  3074. write access to exFAT devices.")
  3075. (license license:gpl2+)))
  3076. (define-public gpm
  3077. (package
  3078. (name "gpm")
  3079. (version "1.20.7")
  3080. (source (origin
  3081. (method url-fetch)
  3082. (uri (string-append
  3083. "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
  3084. version ".tar.bz2"))
  3085. (patches (search-patches "gpm-glibc-2.26.patch"))
  3086. (sha256
  3087. (base32
  3088. "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
  3089. (build-system gnu-build-system)
  3090. (arguments
  3091. '(#:phases (modify-phases %standard-phases
  3092. (replace 'bootstrap
  3093. (lambda _
  3094. ;; The tarball was not generated with 'make dist' so we
  3095. ;; need to bootstrap things ourselves.
  3096. (substitute* "autogen.sh"
  3097. (("/bin/sh") (which "sh")))
  3098. (invoke "./autogen.sh")
  3099. (patch-makefile-SHELL "Makefile.include.in")
  3100. #t)))
  3101. ;; Make sure programs find libgpm.so.
  3102. #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  3103. (assoc-ref %outputs "out")
  3104. "/lib"))))
  3105. (native-inputs
  3106. `(("texinfo" ,texinfo)
  3107. ("bison" ,bison)
  3108. ("flex" ,flex)
  3109. ("autoconf" ,autoconf)
  3110. ("automake" ,automake)
  3111. ("libtool" ,libtool)))
  3112. (home-page "http://www.nico.schottelius.org/software/gpm/")
  3113. (synopsis "Mouse support for the Linux console")
  3114. (description
  3115. "The GPM (general-purpose mouse) daemon is a mouse server for
  3116. applications running on the Linux console. It allows users to select items
  3117. and copy/paste text in the console and in xterm.")
  3118. (license license:gpl2+)))
  3119. (define-public btrfs-progs
  3120. (package
  3121. (name "btrfs-progs")
  3122. (version "4.17.1")
  3123. (source (origin
  3124. (method url-fetch)
  3125. (uri (string-append "mirror://kernel.org/linux/kernel/"
  3126. "people/kdave/btrfs-progs/"
  3127. "btrfs-progs-v" version ".tar.xz"))
  3128. (sha256
  3129. (base32
  3130. "0x6d53fbrcmzvhv461575fzsv3373427p4srz646w2wcagqk82xz"))))
  3131. (build-system gnu-build-system)
  3132. (outputs '("out"
  3133. "static")) ; static versions of the binaries in "out"
  3134. (arguments
  3135. '(#:phases (modify-phases %standard-phases
  3136. (add-after 'build 'build-static
  3137. (lambda _ (invoke "make" "static")))
  3138. (add-after 'install 'install-bash-completion
  3139. (lambda* (#:key outputs #:allow-other-keys)
  3140. (let* ((out (assoc-ref outputs "out"))
  3141. (bashcomp (string-append out "/etc/bash_completion.d")))
  3142. (mkdir-p bashcomp)
  3143. (copy-file "btrfs-completion"
  3144. (string-append bashcomp "/btrfs"))
  3145. #t)))
  3146. (add-after 'install 'install-static
  3147. (let ((staticbin (string-append (assoc-ref %outputs "static")
  3148. "/bin")))
  3149. (lambda _
  3150. (invoke "make"
  3151. (string-append "bindir=" staticbin)
  3152. "install-static")))))
  3153. #:tests? #f ; XXX: require the 'btrfs' kernel module.
  3154. #:test-target "test"
  3155. #:parallel-tests? #f)) ; tests fail when run in parallel
  3156. (inputs `(("e2fsprogs" ,e2fsprogs)
  3157. ("libblkid" ,util-linux)
  3158. ("libblkid:static" ,util-linux "static")
  3159. ("libuuid" ,util-linux)
  3160. ("libuuid:static" ,util-linux "static")
  3161. ("lzo" ,lzo)
  3162. ("zlib" ,zlib)
  3163. ("zlib:static" ,zlib "static")
  3164. ("zstd" ,zstd)))
  3165. (native-inputs `(("pkg-config" ,pkg-config)
  3166. ("asciidoc" ,asciidoc)
  3167. ("python" ,python)
  3168. ("xmlto" ,xmlto)
  3169. ;; For building documentation.
  3170. ("libxml2" ,libxml2)
  3171. ("docbook-xsl" ,docbook-xsl)
  3172. ;; For tests.
  3173. ("acl" ,acl)
  3174. ("which" ,which)
  3175. ;; The tests need 'grep' with perl regexp support.
  3176. ("grep" ,grep)))
  3177. (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
  3178. (synopsis "Create and manage btrfs copy-on-write file systems")
  3179. (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
  3180. aimed at implementing advanced features while focusing on fault tolerance,
  3181. repair and easy administration.")
  3182. ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
  3183. ;; GPL2: Everything else.
  3184. (license (list license:gpl2 license:gpl2+))))
  3185. (define-public btrfs-progs/static
  3186. (package
  3187. (name "btrfs-progs-static")
  3188. (version (package-version btrfs-progs))
  3189. (source #f)
  3190. (build-system trivial-build-system)
  3191. (inputs
  3192. `(("btrfs-progs:static" ,btrfs-progs "static")))
  3193. (arguments
  3194. `(#:modules ((guix build utils))
  3195. #:builder
  3196. (begin
  3197. (use-modules (guix build utils)
  3198. (ice-9 ftw)
  3199. (srfi srfi-26))
  3200. (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
  3201. (out (assoc-ref %outputs "out"))
  3202. (source (string-append btrfs "/bin/btrfs.static"))
  3203. (target (string-append out "/bin/btrfs")))
  3204. (mkdir-p (dirname target))
  3205. (copy-file source target)
  3206. (remove-store-references target)
  3207. (chmod target #o555)
  3208. #t))))
  3209. (home-page (package-home-page btrfs-progs))
  3210. (synopsis "Statically-linked btrfs command from btrfs-progs")
  3211. (description "This package provides the statically-linked @command{btrfs}
  3212. from the btrfs-progs package. It is meant to be used in initrds.")
  3213. (license (package-license btrfs-progs))))
  3214. (define-public f2fs-tools-1.7
  3215. (package
  3216. (name "f2fs-tools")
  3217. (version "1.7.0")
  3218. (source (origin
  3219. (method url-fetch)
  3220. (uri (string-append
  3221. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  3222. "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
  3223. (sha256
  3224. (base32
  3225. "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
  3226. (build-system gnu-build-system)
  3227. (arguments
  3228. `(#:phases
  3229. (modify-phases %standard-phases
  3230. (add-after 'install 'install-headers
  3231. (lambda* (#:key outputs #:allow-other-keys)
  3232. (let* ((out (assoc-ref outputs "out"))
  3233. (out-include (string-append out "/include")))
  3234. (install-file "include/f2fs_fs.h" out-include)
  3235. (install-file "mkfs/f2fs_format_utils.h" out-include)
  3236. #t))))))
  3237. (native-inputs
  3238. `(("autoconf" ,autoconf)
  3239. ("automake" ,automake)
  3240. ("libtool" ,libtool)
  3241. ("pkg-config" ,pkg-config)))
  3242. (inputs
  3243. `(("libuuid" ,util-linux)
  3244. ("libselinux" ,libselinux)))
  3245. (home-page "https://f2fs.wiki.kernel.org/")
  3246. (synopsis "Userland tools for f2fs")
  3247. (description
  3248. "F2FS, the Flash-Friendly File System, is a modern file system
  3249. designed to be fast and durable on flash devices such as solid-state
  3250. disks and SD cards. This package provides the userland utilities.")
  3251. ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
  3252. ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
  3253. (license (list license:gpl2 license:lgpl2.1))))
  3254. (define-public f2fs-tools
  3255. (package
  3256. (inherit f2fs-tools-1.7)
  3257. (name "f2fs-tools")
  3258. (version "1.11.0")
  3259. (source (origin
  3260. (method url-fetch)
  3261. (uri (string-append
  3262. "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
  3263. "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
  3264. (sha256
  3265. (base32
  3266. "1qvr3hcic1vzfmyl7c0gnjxfsw8zjaadm66y337h49chv9yaq5mr"))))
  3267. (inputs
  3268. `(("libuuid" ,util-linux)))))
  3269. (define-public freefall
  3270. (package
  3271. (name "freefall")
  3272. (version (package-version linux-libre))
  3273. (source (package-source linux-libre))
  3274. (build-system gnu-build-system)
  3275. (arguments
  3276. '(#:phases (modify-phases %standard-phases
  3277. (add-after 'unpack 'enter-subdirectory
  3278. (lambda _
  3279. (chdir "tools/laptop/freefall")
  3280. #t))
  3281. (delete 'configure)
  3282. (add-before 'build 'increase-timeout
  3283. (lambda _
  3284. ;; The default of 2 seconds is too low: it assumes an
  3285. ;; open lid and AC power without actually checking.
  3286. (substitute* "freefall.c"
  3287. (("alarm\\(2\\)") "alarm(5)"))
  3288. #t)))
  3289. #:make-flags (list (string-append "PREFIX="
  3290. (assoc-ref %outputs "out"))
  3291. "CC=gcc")
  3292. #:tests? #f)) ;no tests
  3293. (home-page (package-home-page linux-libre))
  3294. (synopsis "Free-fall protection for spinning laptop hard drives")
  3295. (description
  3296. "Prevents shock damage to the internal spinning hard drive(s) of some
  3297. HP and Dell laptops. When sudden movement is detected, all input/output
  3298. operations on the drive are suspended and its heads are parked on the ramp,
  3299. where they are less likely to cause damage to the spinning disc. Requires a
  3300. drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
  3301. feature, and a laptop with an accelerometer. It has no effect on SSDs.")
  3302. (license license:gpl2)))
  3303. (define-public thinkfan
  3304. (package
  3305. (name "thinkfan")
  3306. (version "0.9.3")
  3307. (source (origin
  3308. (method url-fetch)
  3309. (uri (string-append "mirror://sourceforge/thinkfan/"
  3310. "/thinkfan-" version ".tar.gz"))
  3311. (sha256
  3312. (base32
  3313. "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
  3314. (modules '((guix build utils)))
  3315. ;; Fix erroneous man page location in Makefile leading to
  3316. ;; a compilation failure.
  3317. (snippet '(begin
  3318. (substitute* "CMakeLists.txt"
  3319. (("thinkfan\\.1") "src/thinkfan.1"))
  3320. #t))))
  3321. (build-system cmake-build-system)
  3322. (arguments
  3323. `(#:modules ((guix build cmake-build-system)
  3324. (guix build utils)
  3325. (srfi srfi-26))
  3326. #:tests? #f ;no test target
  3327. #:configure-flags
  3328. ;; Enable reading temperatures from hard disks via S.M.A.R.T.
  3329. `("-DUSE_ATASMART:BOOL=ON")
  3330. #:phases
  3331. (modify-phases %standard-phases
  3332. ;; Install scripts for various foreign init systems. Also fix
  3333. ;; hard-coded path for daemon.
  3334. (add-after 'install 'install-rc-scripts
  3335. (lambda* (#:key outputs #:allow-other-keys)
  3336. (let ((out (assoc-ref outputs "out"))
  3337. (files (find-files
  3338. (string-append "../thinkfan-" ,version "/rcscripts")
  3339. ".*")))
  3340. (substitute* files
  3341. (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
  3342. (string-append out "/sbin/" name)))
  3343. (for-each (cute install-file <>
  3344. (string-append out "/share/thinkfan"))
  3345. files))
  3346. #t)))))
  3347. (inputs
  3348. `(("libatasmart" ,libatasmart)))
  3349. (home-page "http://thinkfan.sourceforge.net/")
  3350. (synopsis "Simple fan control program")
  3351. (description
  3352. "Thinkfan is a simple fan control program. It reads temperatures,
  3353. checks them against configured limits and switches to appropriate (also
  3354. pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
  3355. other @code{hwmon} driver that enables temperature reading and fan control
  3356. from userspace.")
  3357. (license license:gpl3+)))
  3358. (define-public ntfs-3g
  3359. (package
  3360. (name "ntfs-3g")
  3361. (version "2017.3.23")
  3362. (source (origin
  3363. (method url-fetch)
  3364. (uri (string-append "https://tuxera.com/opensource/"
  3365. "ntfs-3g_ntfsprogs-" version ".tgz"))
  3366. (sha256
  3367. (base32
  3368. "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
  3369. (modules '((guix build utils)))
  3370. (snippet '(begin
  3371. ;; Install under $prefix.
  3372. (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
  3373. (("/sbin")
  3374. "@sbindir@"))
  3375. #t))))
  3376. (build-system gnu-build-system)
  3377. (inputs `(("util-linux" ,util-linux)
  3378. ("fuse" ,fuse))) ;libuuid
  3379. (native-inputs `(("pkg-config" ,pkg-config)))
  3380. (arguments
  3381. '(#:configure-flags (list "--exec-prefix=${prefix}"
  3382. "--with-fuse=external" ;use our own FUSE
  3383. "--enable-mount-helper"
  3384. "--enable-posix-acls"
  3385. "--enable-xattr-mappings")
  3386. #:phases
  3387. (modify-phases %standard-phases
  3388. ;; If users install ntfs-3g, they probably want to make it the
  3389. ;; default driver as well, so we opt for sensible defaults and link
  3390. ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
  3391. ;; mount NTFS filesystems.)
  3392. (add-after 'install 'install-link
  3393. (lambda* (#:key outputs #:allow-other-keys)
  3394. (let* ((out (assoc-ref outputs "out"))
  3395. (sbin (string-append out "/sbin")))
  3396. (symlink "mount.ntfs-3g"
  3397. (string-append sbin "/mount.ntfs")))
  3398. #t)))))
  3399. (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
  3400. (synopsis "Read-write access to NTFS file systems")
  3401. (description
  3402. "NTFS-3G provides read-write access to NTFS file systems, which are
  3403. commonly found on Microsoft Windows. It is implemented as a FUSE file system.
  3404. The package provides additional NTFS tools.")
  3405. (license license:gpl2+)))
  3406. (define-public rdma-core
  3407. (package
  3408. (name "rdma-core")
  3409. (version "14")
  3410. (source (origin
  3411. (method url-fetch)
  3412. (uri (string-append "https://github.com/linux-rdma/rdma-core"
  3413. "/releases/download/v" version "/rdma-core-"
  3414. version ".tar.gz"))
  3415. (sha256
  3416. (base32
  3417. "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
  3418. (build-system cmake-build-system)
  3419. (arguments
  3420. '(#:tests? #f ; no tests
  3421. ;; Upstream uses the "ninja" build system and encourage distros
  3422. ;; to do the same for consistency. They also recommend using the
  3423. ;; "Release" build type.
  3424. #:build-type "Release"
  3425. #:configure-flags (list "-GNinja")
  3426. #:phases
  3427. (modify-phases %standard-phases
  3428. (replace 'build
  3429. (lambda _
  3430. (invoke "ninja"
  3431. "-j" (number->string (parallel-job-count)))))
  3432. (replace 'install
  3433. (lambda _
  3434. (invoke "ninja" "install"))))))
  3435. (native-inputs
  3436. `(("ninja" ,ninja)
  3437. ("pkg-config" ,pkg-config)
  3438. ("python" ,python-wrapper)))
  3439. (inputs
  3440. `(("libnl" ,libnl)
  3441. ("udev" ,eudev)))
  3442. (home-page "https://github.com/linux-rdma/rdma-core")
  3443. (synopsis "Utilities and libraries for working with RDMA devices")
  3444. (description
  3445. "This package provides userspace components for the InfiniBand
  3446. subsystem of the Linux kernel. Specifically it contains userspace
  3447. libraries for the following device nodes:
  3448. @enumerate
  3449. @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
  3450. @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
  3451. @item @file{/dev/infiniband/umadX} (@code{libibumad})
  3452. @end enumerate
  3453. The following service daemons are also provided:
  3454. @enumerate
  3455. @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
  3456. @item @code{iwpmd} (for iWARP kernel providers)
  3457. @item @code{ibacm} (for InfiniBand communication management assistant)
  3458. @end enumerate")
  3459. ;; All library code is dual licensed under GPL2 and a custom MIT
  3460. ;; variant. The package also includes some components covered by
  3461. ;; other licenses. Consult COPYING.md for full details.
  3462. (license
  3463. (list license:gpl2
  3464. (license:x11-style "See COPYING.BSD_MIT in the distribution")
  3465. license:bsd-2 ; Files referring to COPYING.BSD_FB
  3466. license:cc0 ; most files in ccan/
  3467. license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
  3468. (define-public perftest
  3469. (package
  3470. (name "perftest")
  3471. (version "4.4-0.4")
  3472. (source
  3473. (origin
  3474. (method url-fetch)
  3475. (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
  3476. version "/perftest-" version ".g0927198.tar.gz"))
  3477. (sha256
  3478. (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
  3479. (build-system gnu-build-system)
  3480. (arguments
  3481. `(#:phases
  3482. (modify-phases %standard-phases
  3483. (add-after 'unpack 'patch-header-paths
  3484. (lambda _
  3485. (substitute* '("src/raw_ethernet_fs_rate.c"
  3486. "src/raw_ethernet_resources.c"
  3487. "src/raw_ethernet_resources.h"
  3488. "src/raw_ethernet_send_burst_lat.c"
  3489. "src/raw_ethernet_send_bw.c"
  3490. "src/raw_ethernet_send_lat.c")
  3491. (("/usr/include/netinet/ip.h") "netinet/ip.h"))
  3492. #t)))))
  3493. (inputs `(("rdma-core" ,rdma-core)))
  3494. (home-page "https://github.com/linux-rdma/perftest/")
  3495. (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
  3496. (description "This is a collection of tests written over uverbs intended for
  3497. use as a performance micro-benchmark. The tests may be used for hardware or
  3498. software tuning as well as for functional testing.
  3499. The collection contains a set of bandwidth and latency benchmark such as:
  3500. @enumerate
  3501. @item Send - @code{ib_send_bw} and @code{ib_send_lat}
  3502. @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
  3503. @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
  3504. @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
  3505. @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
  3506. @end enumerate")
  3507. (license license:gpl2)))
  3508. (define-public rng-tools
  3509. (package
  3510. (name "rng-tools")
  3511. (home-page "https://github.com/nhorman/rng-tools")
  3512. (version "6.7")
  3513. (source (origin
  3514. (method git-fetch)
  3515. (uri (git-reference (url home-page)
  3516. (commit (string-append "v" version))))
  3517. (file-name (git-file-name name version))
  3518. (sha256
  3519. (base32
  3520. "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
  3521. (build-system gnu-build-system)
  3522. (arguments
  3523. `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
  3524. #:configure-flags '("--without-nistbeacon"
  3525. "--without-pkcs11")))
  3526. (native-inputs
  3527. `(("autoconf" ,autoconf)
  3528. ("automake" ,automake)
  3529. ("pkg-config" ,pkg-config)))
  3530. (inputs
  3531. `(("libsysfs" ,sysfsutils)))
  3532. (synopsis "Random number generator daemon")
  3533. (description
  3534. "Monitor a hardware random number generator, and supply entropy
  3535. from that to the system kernel's @file{/dev/random} machinery.")
  3536. ;; The source package is offered under the GPL2+, but the files
  3537. ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
  3538. (license (list license:gpl2 license:gpl2+))))
  3539. (define-public cpupower
  3540. (package
  3541. (name "cpupower")
  3542. (version (package-version linux-libre))
  3543. (source (package-source linux-libre))
  3544. (build-system gnu-build-system)
  3545. (arguments
  3546. '(#:phases (modify-phases %standard-phases
  3547. (add-after 'unpack 'enter-subdirectory
  3548. (lambda _
  3549. (chdir "tools/power/cpupower")
  3550. #t))
  3551. (delete 'configure)
  3552. (add-before 'build 'fix-makefiles
  3553. (lambda _
  3554. (substitute* "Makefile"
  3555. (("/usr/") "/")
  3556. (("/bin/(install|pwd)" _ command) command))
  3557. (substitute* "bench/Makefile"
  3558. (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
  3559. #t)))
  3560. #:make-flags (let ((out (assoc-ref %outputs "out")))
  3561. (list (string-append "DESTDIR=" out)
  3562. (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
  3563. "docdir=/share/doc/cpupower"
  3564. "confdir=$(docdir)/examples"
  3565. ;; The Makefile recommends the following changes
  3566. "DEBUG=false"
  3567. "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
  3568. #:tests? #f)) ;no tests
  3569. (native-inputs `(("gettext" ,gettext-minimal)))
  3570. (inputs `(("pciutils" ,pciutils)))
  3571. (home-page (package-home-page linux-libre))
  3572. (synopsis "CPU frequency and voltage scaling tools for Linux")
  3573. (description
  3574. "cpupower is a set of user-space tools that use the cpufreq feature of the
  3575. Linux kernel to retrieve and control processor features related to power saving,
  3576. such as frequency and voltage scaling.")
  3577. (license license:gpl2)))
  3578. (define-public haveged
  3579. (package
  3580. (name "haveged")
  3581. (version "1.9.4")
  3582. (source
  3583. (origin
  3584. (method git-fetch)
  3585. (uri (git-reference
  3586. (url "https://github.com/jirka-h/haveged.git")
  3587. (commit version)))
  3588. (file-name (git-file-name name version))
  3589. (sha256
  3590. (base32 "1hrwzjd4byq4fdrg8svww3d8x449k80jxxrjy9v6jvzhfv19rvxr"))))
  3591. (build-system gnu-build-system)
  3592. (home-page "http://www.issihosts.com/haveged")
  3593. (synopsis "Entropy source for the Linux random number generator")
  3594. (description
  3595. "haveged generates an unpredictable stream of random numbers for use by
  3596. Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
  3597. standard mechanisms for filling the entropy pool may not be sufficient for
  3598. systems with high needs or limited user interaction, such as headless servers.
  3599. @command{haveged} runs as a privileged daemon, harvesting randomness from the
  3600. indirect effects of hardware events on hidden processor state using the HArdware
  3601. Volatile Entropy Gathering and Expansion (@dfn{HAVEGE}) algorithm. It tunes
  3602. itself to its environment and provides the same built-in test suite for the
  3603. output stream as used on certified hardware security devices.
  3604. The quality of the randomness produced by this algorithm has not been proven.
  3605. It is recommended to run it together with another entropy source like rngd, and
  3606. not as a replacement for it.")
  3607. (license (list (license:non-copyleft "file://nist/mconf.h")
  3608. (license:non-copyleft "file://nist/packtest.c")
  3609. license:public-domain ; nist/dfft.c
  3610. license:gpl3+)))) ; everything else
  3611. (define-public ecryptfs-utils
  3612. (package
  3613. (name "ecryptfs-utils")
  3614. (version "111")
  3615. (source
  3616. (origin
  3617. (method url-fetch)
  3618. (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
  3619. version "/+download/ecryptfs-utils_"
  3620. version ".orig.tar.gz"))
  3621. (sha256
  3622. (base32
  3623. "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
  3624. (build-system gnu-build-system)
  3625. (arguments
  3626. `(#:configure-flags (list "--disable-pywrap")
  3627. #:phases
  3628. (modify-phases %standard-phases
  3629. (add-after 'patch-source-shebangs 'patch-hardcoded-paths
  3630. (lambda* (#:key inputs outputs #:allow-other-keys)
  3631. (let ((out (assoc-ref outputs "out"))
  3632. (utils-linux (assoc-ref inputs "utils-linux"))
  3633. (cryptsetup (assoc-ref inputs "cryptsetup"))
  3634. (linux-pam (assoc-ref inputs "linux-pam"))
  3635. (lvm2 (assoc-ref inputs "lvm2")))
  3636. (substitute* '("src/utils/ecryptfs-mount-private"
  3637. "src/utils/ecryptfs-umount-private"
  3638. "src/utils/ecryptfs-setup-private"
  3639. "src/utils/ecryptfs-setup-swap"
  3640. "src/utils/mount.ecryptfs.c"
  3641. "src/utils/umount.ecryptfs.c"
  3642. "src/pam_ecryptfs/pam_ecryptfs.c"
  3643. "src/desktop/ecryptfs-mount-private.desktop.in"
  3644. "src/desktop/ecryptfs-setup-private.desktop.in")
  3645. (("/bin/mount")
  3646. (string-append utils-linux "/bin/mount"))
  3647. (("/bin/umount")
  3648. (string-append utils-linux "/bin/umount"))
  3649. (("/sbin/mount.ecryptfs_private")
  3650. (string-append out "/sbin/mount.ecryptfs_private"))
  3651. (("/sbin/umount.ecryptfs_private")
  3652. (string-append out "/sbin/umount.ecryptfs_private"))
  3653. (("/usr/bin/ecryptfs-mount-private")
  3654. (string-append out "/bin/ecryptfs-mount-private"))
  3655. (("/usr/bin/ecryptfs-rewrite-file")
  3656. (string-append out "/bin/ecryptfs-rewrite-file"))
  3657. (("/usr/bin/ecryptfs-setup-private")
  3658. (string-append out "/bin/ecryptfs-setup-private"))
  3659. (("/sbin/cryptsetup")
  3660. (string-append cryptsetup "/sbin/cryptsetup"))
  3661. (("/sbin/unix_chkpwd")
  3662. (string-append linux-pam "/sbin/unix_chkpwd"))
  3663. (("/sbin/dmsetup")
  3664. (string-append lvm2 "/sbin/dmsetup")))))))))
  3665. (native-inputs
  3666. `(("intltool" ,intltool)
  3667. ("perl" ,perl) ; for pod2man
  3668. ("pkg-config" ,pkg-config)))
  3669. (inputs
  3670. `(("keyutils" ,keyutils)
  3671. ("linux-pam" ,linux-pam)
  3672. ("utils-linux" ,util-linux)
  3673. ("cryptsetup" ,cryptsetup)
  3674. ("lvm2" ,lvm2)
  3675. ("nss" ,nss)))
  3676. (home-page "http://ecryptfs.org/")
  3677. (synopsis "eCryptfs cryptographic file system utilities")
  3678. (description
  3679. "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
  3680. Each file's cryptographic meta-data is stored inside the file itself, along
  3681. with the encrypted contents. This allows individual encrypted files to be
  3682. copied between hosts and still be decrypted with the proper key. eCryptfs is a
  3683. native Linux file system, and has been part of the Linux kernel since version
  3684. 2.6.19. This package contains the userland utilities to manage it.")
  3685. ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
  3686. ;; grant additional permission to link with OpenSSL.
  3687. (license license:gpl2+)))
  3688. (define-public libnfsidmap
  3689. (package
  3690. (name "libnfsidmap")
  3691. (version "0.27")
  3692. (source
  3693. (origin
  3694. (method url-fetch)
  3695. (uri (string-append "https://fedorapeople.org/~steved/"
  3696. name "/" version "/" name "-" version ".tar.bz2"))
  3697. (sha256
  3698. (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
  3699. (build-system gnu-build-system)
  3700. (arguments
  3701. `(#:configure-flags (list
  3702. (string-append "--with-pluginpath="
  3703. (assoc-ref %outputs "out")
  3704. "/lib/libnfsidmap"))))
  3705. (native-inputs
  3706. `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
  3707. (home-page
  3708. "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
  3709. (synopsis "NFSv4 support library for name/ID mapping")
  3710. (description "Libnfsidmap is a library holding mulitiple methods of
  3711. mapping names to ids and visa versa, mainly for NFSv4. It provides an
  3712. extensible array of mapping functions, currently consisting of two choices:
  3713. the default @code{nsswitch} and the experimental @code{umich_ldap}.")
  3714. (license (license:non-copyleft "file://COPYING"
  3715. "See COPYING in the distribution."))))
  3716. (define-public module-init-tools
  3717. (package
  3718. (name "module-init-tools")
  3719. (version "3.16")
  3720. (source (origin
  3721. (method url-fetch)
  3722. (uri (string-append
  3723. "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
  3724. "module-init-tools-" version ".tar.bz2"))
  3725. (sha256
  3726. (base32
  3727. "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
  3728. (patches (search-patches "module-init-tools-moduledir.patch"))))
  3729. (build-system gnu-build-system)
  3730. (arguments
  3731. ;; FIXME: The upstream tarball lacks man pages, and building them would
  3732. ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
  3733. ;; but they vanished. In the meantime, fake it.
  3734. '(#:phases
  3735. (modify-phases %standard-phases
  3736. (add-before 'configure 'fake-docbook
  3737. (lambda _
  3738. (substitute* "Makefile.in"
  3739. (("^DOCBOOKTOMAN.*$")
  3740. "DOCBOOKTOMAN = true\n"))
  3741. #t)))))
  3742. (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
  3743. (synopsis "Tools for loading and managing Linux kernel modules")
  3744. (description
  3745. "Tools for loading and managing Linux kernel modules, such as `modprobe',
  3746. `insmod', `lsmod', and more.")
  3747. (license license:gpl2+)))
  3748. (define-public mcelog
  3749. (package
  3750. (name "mcelog")
  3751. (version "154")
  3752. (source (origin
  3753. (method url-fetch)
  3754. (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
  3755. "mcelog.git/snapshot/v" version ".tar.gz"))
  3756. (sha256
  3757. (base32
  3758. "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
  3759. (file-name (string-append name "-" version ".tar.gz"))
  3760. (modules '((guix build utils)))
  3761. (snippet
  3762. `(begin
  3763. ;; The snapshots lack a .git directory,
  3764. ;; breaking ‘git describe’.
  3765. (substitute* "Makefile"
  3766. (("\"unknown\"") (string-append "\"v" ,version "\"")))
  3767. #t))))
  3768. (build-system gnu-build-system)
  3769. (arguments
  3770. `(#:phases (modify-phases %standard-phases
  3771. (delete 'configure)) ; no configure script
  3772. #:make-flags (let ((out (assoc-ref %outputs "out")))
  3773. (list "CC=gcc"
  3774. (string-append "prefix=" out)
  3775. (string-append "DOCDIR=" out "/share/doc/mcelog")
  3776. "etcprefix=$(DOCDIR)/examples"))
  3777. ;; The tests will only run as root on certain supported CPU models.
  3778. #:tests? #f))
  3779. (supported-systems (list "i686-linux" "x86_64-linux"))
  3780. (home-page "https://mcelog.org/")
  3781. (synopsis "Machine check monitor for x86 Linux systems")
  3782. (description
  3783. "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
  3784. and other hardware errors on x86 systems. It can also perform user-defined
  3785. tasks, such as bringing bad pages off-line, when configurable error thresholds
  3786. are exceeded.")
  3787. (license license:gpl2)))
  3788. (define-public mtd-utils
  3789. (package
  3790. (name "mtd-utils")
  3791. (version "2.0.2")
  3792. (source (origin
  3793. (method url-fetch)
  3794. (uri (string-append
  3795. "ftp://ftp.infradead.org/pub/mtd-utils/"
  3796. "mtd-utils-" version ".tar.bz2"))
  3797. (sha256
  3798. (base32
  3799. "1f30jszknc5v6ykmil8ajxgksmcg54q3rsp84jsancp9x0dycggv"))))
  3800. (arguments
  3801. '(#:configure-flags '("--enable-unit-tests")))
  3802. (native-inputs
  3803. `(("cmocka" ,cmocka)
  3804. ("pkg-config" ,pkg-config)))
  3805. (inputs
  3806. `(("acl" ,acl) ; for XATTR
  3807. ("libuuid" ,util-linux)
  3808. ("lzo" ,lzo)
  3809. ("zlib" ,zlib)))
  3810. (build-system gnu-build-system)
  3811. (synopsis "MTD Flash Storage Utilities")
  3812. (description "This package provides utilities for testing, partitioning, etc
  3813. of flash storage.")
  3814. (home-page "http://www.linux-mtd.infradead.org/")
  3815. (license
  3816. (list license:gpl2 ; Almost everything is gpl2 or gpl2+
  3817. license:mpl1.1 ; All ftl* files
  3818. license:expat)))) ; libiniparser
  3819. (define-public libseccomp
  3820. (package
  3821. (name "libseccomp")
  3822. (version "2.3.3")
  3823. (source (origin
  3824. (method url-fetch)
  3825. (uri (string-append "https://github.com/seccomp/libseccomp/"
  3826. "releases/download/v" version
  3827. "/libseccomp-" version ".tar.gz"))
  3828. (sha256
  3829. (base32
  3830. "0mdiyfljrkfl50q1m3ws8yfcyfjwf1zgkvcva8ffcwncji18zhkz"))))
  3831. (build-system gnu-build-system)
  3832. (native-inputs
  3833. `(("which" ,which)))
  3834. (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
  3835. (description "The libseccomp library provides an easy to use, platform
  3836. independent, interface to the Linux Kernel's syscall filtering mechanism. The
  3837. libseccomp API is designed to abstract away the underlying BPF based syscall
  3838. filter language and present a more conventional function-call based filtering
  3839. interface that should be familiar to, and easily adopted by, application
  3840. developers.")
  3841. (home-page "https://github.com/seccomp/libseccomp")
  3842. (license license:lgpl2.1)))
  3843. (define-public radeontop
  3844. (package
  3845. (name "radeontop")
  3846. (version "1.1")
  3847. (home-page "https://github.com/clbr/radeontop/")
  3848. (source (origin
  3849. (method url-fetch)
  3850. (uri (string-append home-page "archive/v" version ".tar.gz"))
  3851. (file-name (string-append name "-" version ".tar.gz"))
  3852. (sha256
  3853. (base32
  3854. "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
  3855. (build-system gnu-build-system)
  3856. (arguments
  3857. `(#:phases (modify-phases %standard-phases
  3858. ;; getver.sh uses ‘git --describe’, isn't worth an extra git
  3859. ;; dependency, and doesn't even work on release(!) tarballs.
  3860. (add-after 'unpack 'report-correct-version
  3861. (lambda _
  3862. (substitute* "getver.sh"
  3863. (("ver=unknown")
  3864. (string-append "ver=" ,version)))
  3865. #t))
  3866. (delete 'configure)) ; no configure script
  3867. #:make-flags (list "CC=gcc"
  3868. (string-append "PREFIX=" %output))
  3869. #:tests? #f)) ; no tests
  3870. (native-inputs
  3871. `(("gettext" ,gettext-minimal)
  3872. ("pkg-config" ,pkg-config)))
  3873. (inputs
  3874. `(("libdrm" ,libdrm)
  3875. ("libpciaccess" ,libpciaccess)
  3876. ("libxcb" ,libxcb)
  3877. ("ncurses" ,ncurses)))
  3878. (synopsis "Usage monitor for AMD Radeon graphics")
  3879. (description "RadeonTop monitors resource consumption on supported AMD
  3880. Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
  3881. a terminal or saved to a file for further processing. It measures both the
  3882. activity of the GPU as a whole, which is also accurate during OpenCL
  3883. computations, as well as separate component statistics that are only meaningful
  3884. under OpenGL graphics workloads.")
  3885. (license license:gpl3)))
  3886. (define-public efivar
  3887. (package
  3888. (name "efivar")
  3889. (version "37")
  3890. (source (origin
  3891. (method url-fetch)
  3892. (uri (string-append "https://github.com/rhboot/" name
  3893. "/releases/download/" version "/" name
  3894. "-" version ".tar.bz2"))
  3895. (sha256
  3896. (base32
  3897. "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
  3898. (build-system gnu-build-system)
  3899. (arguments
  3900. `(;; Tests require a UEFI system and is not detected in the chroot.
  3901. #:tests? #f
  3902. #:make-flags (list (string-append "prefix=" %output)
  3903. (string-append "libdir=" %output "/lib")
  3904. "CC_FOR_BUILD=gcc"
  3905. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  3906. #:phases
  3907. (modify-phases %standard-phases
  3908. (delete 'configure))))
  3909. (native-inputs
  3910. `(("pkg-config" ,pkg-config)))
  3911. (inputs
  3912. `(("popt" ,popt)))
  3913. (home-page "https://github.com/rhboot/efivar")
  3914. (synopsis "Tool and library to manipulate EFI variables")
  3915. (description "This package provides a library and a command line
  3916. interface to the variable facility of UEFI boot firmware.")
  3917. (license license:lgpl2.1+)))
  3918. (define-public efibootmgr
  3919. (package
  3920. (name "efibootmgr")
  3921. (version "16")
  3922. (source (origin
  3923. (method url-fetch)
  3924. (uri (string-append "https://github.com/rhinstaller/" name
  3925. "/releases/download/" version "/" name
  3926. "-" version ".tar.bz2"))
  3927. (sha256
  3928. (base32
  3929. "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
  3930. (build-system gnu-build-system)
  3931. (arguments
  3932. `(#:tests? #f ; No tests.
  3933. #:make-flags (list (string-append "prefix=" %output)
  3934. (string-append "libdir=" %output "/lib")
  3935. ;; EFIDIR denotes a subdirectory relative to the
  3936. ;; EFI System Partition where the loader will be
  3937. ;; installed (known as OS_VENDOR in the code).
  3938. ;; GRUB overrides this, as such it's only used if
  3939. ;; nothing else is specified on the command line.
  3940. "EFIDIR=gnu"
  3941. ;; Override CFLAGS to add efivar include directory.
  3942. (string-append "CFLAGS=-O2 -g -flto -I"
  3943. (assoc-ref %build-inputs "efivar")
  3944. "/include/efivar"))
  3945. #:phases (modify-phases %standard-phases (delete 'configure))))
  3946. (native-inputs
  3947. `(("pkg-config" ,pkg-config)))
  3948. (inputs
  3949. `(("efivar" ,efivar)
  3950. ("popt" ,popt)))
  3951. (home-page "https://github.com/rhinstaller/efibootmgr")
  3952. (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
  3953. (description
  3954. "@code{efibootmgr} is a user-space application to modify the Intel
  3955. Extensible Firmware Interface (EFI) Boot Manager. This application can
  3956. create and destroy boot entries, change the boot order, change the next
  3957. running boot option, and more.")
  3958. (license license:gpl2+)))
  3959. (define-public sysstat
  3960. (package
  3961. (name "sysstat")
  3962. (version "11.4.3")
  3963. (source (origin
  3964. (method url-fetch)
  3965. (uri (string-append "http://perso.orange.fr/sebastien.godard/"
  3966. "sysstat-" version ".tar.xz"))
  3967. (sha256
  3968. (base32
  3969. "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
  3970. (build-system gnu-build-system)
  3971. (arguments
  3972. `(#:tests? #f ; No test suite.
  3973. ;; Without this flag, it tries to install the man pages with group 'root'
  3974. ;; and fails because /etc/passwd lacks an entry for the root user.
  3975. #:configure-flags
  3976. (list "--disable-file-attr"
  3977. (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
  3978. #:phases
  3979. (modify-phases %standard-phases
  3980. ;; The build process tries to create '/var/lib/sa', so we skip that
  3981. ;; instruction.
  3982. (add-after 'build 'skip-touching-var
  3983. (lambda _
  3984. (substitute* "Makefile"
  3985. (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
  3986. ""))
  3987. #t)))))
  3988. (home-page "http://sebastien.godard.pagesperso-orange.fr/")
  3989. (synopsis "Performance monitoring tools for Linux")
  3990. (description "The sysstat utilities are a collection of performance
  3991. monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
  3992. @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
  3993. @code{sadf} and @code{sa}.")
  3994. (license license:gpl2+)))
  3995. (define-public light
  3996. (package
  3997. (name "light")
  3998. (version "1.2")
  3999. (source (origin
  4000. (method url-fetch)
  4001. (uri (string-append
  4002. "https://github.com/haikarainen/light/archive/v"
  4003. version ".tar.gz"))
  4004. (sha256
  4005. (base32
  4006. "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
  4007. (file-name (string-append name "-" version ".tar.gz"))))
  4008. (build-system gnu-build-system)
  4009. (native-inputs
  4010. `(("autoconf" ,autoconf)
  4011. ("automake" ,automake)))
  4012. (home-page "https://haikarainen.github.io/light/")
  4013. (synopsis "GNU/Linux application to control backlights")
  4014. (description
  4015. "Light is a program to send commands to screen backlight controllers
  4016. under GNU/Linux. Features include:
  4017. @itemize
  4018. @item It does not rely on X.
  4019. @item Light can automatically figure out the best controller to use, making
  4020. full use of underlying hardware.
  4021. @item It is possible to set a minimum brightness value, as some controllers
  4022. set the screen to be pitch black at a vaĺue of 0 (or higher).
  4023. @end itemize
  4024. Light is the successor of lightscript.")
  4025. (license license:gpl3+)))
  4026. (define-public tlp
  4027. (package
  4028. (name "tlp")
  4029. (version "1.1")
  4030. (source (origin
  4031. (method url-fetch)
  4032. (uri (string-append
  4033. "https://github.com/linrunner/"
  4034. (string-upcase name)
  4035. "/archive/" version ".tar.gz"))
  4036. (file-name (string-append name "-" version ".tar.gz"))
  4037. (sha256
  4038. (base32
  4039. "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
  4040. (inputs `(("bash" ,bash)
  4041. ("dbus" ,dbus)
  4042. ("ethtool" ,ethtool)
  4043. ("eudev" ,eudev)
  4044. ("grep" ,grep)
  4045. ("hdparm" ,hdparm)
  4046. ("inetutils" ,inetutils)
  4047. ("iw" ,iw)
  4048. ("kmod" ,kmod)
  4049. ("pciutils" ,pciutils)
  4050. ("perl" ,perl)
  4051. ("rfkill" ,rfkill)
  4052. ("sed" ,sed)
  4053. ("usbutils" ,usbutils)
  4054. ("util-linux" ,util-linux)
  4055. ("wireless-tools" ,wireless-tools)))
  4056. (build-system gnu-build-system)
  4057. (arguments
  4058. `(#:phases
  4059. (modify-phases %standard-phases
  4060. (delete 'configure) ; no configure script
  4061. (add-before 'build 'setenv
  4062. (lambda* (#:key outputs #:allow-other-keys)
  4063. (let ((out (assoc-ref outputs "out")))
  4064. (setenv "TLP_WITH_SYSTEMD" "0")
  4065. (setenv "TLP_NO_INIT" "1")
  4066. (setenv "TLP_NO_PMUTILS" "1")
  4067. (setenv "TLP_SBIN" (string-append out "/bin"))
  4068. (setenv "TLP_BIN" (string-append out "/bin"))
  4069. (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
  4070. (setenv "TLP_ULIB" (string-append out "/lib/udev"))
  4071. (setenv "TLP_CONF" "/etc/tlp")
  4072. (setenv "TLP_SHCPL"
  4073. (string-append out "/share/bash-completion/completions"))
  4074. (setenv "TLP_MAN" (string-append out "/share/man"))
  4075. (setenv "TLP_META" (string-append out "/share/metainfo"))
  4076. #t)))
  4077. (delete 'check) ; no tests
  4078. (add-before 'install 'fix-installation
  4079. (lambda _
  4080. ;; Stop the Makefile from trying to create system directories.
  4081. (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))
  4082. #t))
  4083. (replace 'install
  4084. (lambda _
  4085. (invoke "make" "install-tlp" "install-man")))
  4086. (add-after 'install 'wrap
  4087. (lambda* (#:key inputs outputs #:allow-other-keys)
  4088. (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
  4089. (bin-files (find-files bin ".*")))
  4090. (define (bin-directory input-name)
  4091. (string-append (assoc-ref inputs input-name) "/bin"))
  4092. (define (sbin-directory input-name)
  4093. (string-append (assoc-ref inputs input-name) "/sbin"))
  4094. (for-each (lambda (program)
  4095. (wrap-program program
  4096. `("PATH" ":" prefix
  4097. ,(append
  4098. (map bin-directory '("bash"
  4099. "coreutils"
  4100. "dbus"
  4101. "eudev"
  4102. "grep"
  4103. "inetutils"
  4104. "kmod"
  4105. "perl"
  4106. "sed"
  4107. "usbutils"
  4108. "util-linux"))
  4109. (map sbin-directory '("ethtool"
  4110. "hdparm"
  4111. "iw"
  4112. "pciutils"
  4113. "rfkill"
  4114. "wireless-tools"))))))
  4115. bin-files)
  4116. #t))))))
  4117. (home-page "http://linrunner.de/en/tlp/tlp.html")
  4118. (synopsis "Power management tool for Linux")
  4119. (description "TLP is a power management tool for Linux. It comes with
  4120. a default configuration already optimized for battery life. Nevertheless,
  4121. TLP is customizable to fulfil system requirements. TLP settings are applied
  4122. every time the power supply source is changed.")
  4123. ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
  4124. ;; rest is GPLv2+.
  4125. (license (list license:gpl2+ license:gpl3+))))
  4126. (define-public lshw
  4127. (package
  4128. (name "lshw")
  4129. (version "B.02.18")
  4130. (source (origin
  4131. (method url-fetch)
  4132. (uri (string-append "https://www.ezix.org/software/"
  4133. "files/lshw-" version
  4134. ".tar.gz"))
  4135. (sha256
  4136. (base32
  4137. "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
  4138. (build-system gnu-build-system)
  4139. (arguments
  4140. `(#:phases (modify-phases %standard-phases (delete 'configure))
  4141. #:tests? #f ; no tests
  4142. #:make-flags
  4143. (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  4144. (synopsis "List hardware information")
  4145. (description
  4146. "@command{lshw} (Hardware Lister) is a small tool to provide
  4147. detailed information on the hardware configuration of the machine.
  4148. It can report exact memory configuration, firmware version, mainboard
  4149. configuration, CPU version and speed, cache configuration, bus speed,
  4150. and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
  4151. machines (PowerMac G4 is known to work).")
  4152. (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
  4153. (license license:gpl2+)))
  4154. (define-public libmnl
  4155. (package
  4156. (name "libmnl")
  4157. (version "1.0.4")
  4158. (source
  4159. (origin
  4160. (method url-fetch)
  4161. (uri (string-append "mirror://netfilter.org/libmnl/"
  4162. "libmnl-" version ".tar.bz2"))
  4163. (sha256
  4164. (base32
  4165. "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
  4166. (build-system gnu-build-system)
  4167. (home-page "https://www.netfilter.org/projects/libmnl/")
  4168. (synopsis "Netlink utility library")
  4169. (description "Libmnl is a minimalistic user-space library oriented to
  4170. Netlink developers. There are a lot of common tasks in parsing, validating,
  4171. constructing of both the Netlink header and TLVs that are repetitive and easy to
  4172. get wrong. This library aims to provide simple helpers that allows you to
  4173. re-use code and to avoid re-inventing the wheel.")
  4174. (license license:lgpl2.1+)))
  4175. (define-public libnftnl
  4176. (package
  4177. (name "libnftnl")
  4178. (version "1.1.1")
  4179. (source
  4180. (origin
  4181. (method url-fetch)
  4182. (uri (string-append "mirror://netfilter.org/libnftnl/"
  4183. "libnftnl-" version ".tar.bz2"))
  4184. (sha256
  4185. (base32
  4186. "1wmgjfcb35mscb2srzia5931srygywrs1aznxmg67v177x0nasjx"))))
  4187. (build-system gnu-build-system)
  4188. (native-inputs
  4189. `(("pkg-config" ,pkg-config)))
  4190. (inputs
  4191. `(("libmnl" ,libmnl)))
  4192. (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
  4193. (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
  4194. (description "Libnftnl is a userspace library providing a low-level netlink
  4195. programming interface to the in-kernel nf_tables subsystem. The library
  4196. libnftnl has been previously known as libnftables. This library is currently
  4197. used by nftables.")
  4198. (license license:gpl2+)))
  4199. (define-public nftables
  4200. (package
  4201. (name "nftables")
  4202. (version "0.8.1")
  4203. (source
  4204. (origin
  4205. (method url-fetch)
  4206. (uri (string-append "http://www.nftables.org/projects/nftables"
  4207. "/files/nftables-" version ".tar.bz2"))
  4208. (sha256
  4209. (base32
  4210. "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
  4211. (build-system gnu-build-system)
  4212. (inputs `(("bison" ,bison)
  4213. ("flex" ,flex)
  4214. ("gmp" ,gmp)
  4215. ("libmnl" ,libmnl)
  4216. ("libnftnl" ,libnftnl)
  4217. ("readline" ,readline)))
  4218. (native-inputs `(("pkg-config" ,pkg-config)))
  4219. (home-page "http://www.nftables.org")
  4220. (synopsis "Userspace utility for Linux packet filtering")
  4221. (description "nftables is the project that aims to replace the existing
  4222. {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
  4223. filtering framework, a new userspace utility and also a compatibility layer for
  4224. {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
  4225. infrastructure such as the existing hooks, the connection tracking system, the
  4226. userspace queueing component and the logging subsystem.")
  4227. (license license:gpl2)))
  4228. (define-public proot
  4229. (package
  4230. (name "proot")
  4231. (version "5.1.0")
  4232. (home-page "https://github.com/proot-me/PRoot")
  4233. (source (origin
  4234. (method url-fetch)
  4235. (uri (string-append home-page "/archive/v" version ".tar.gz"))
  4236. (file-name (string-append name "-" version ".tar.gz"))
  4237. (sha256
  4238. (base32
  4239. "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
  4240. (patches (search-patches "proot-test-fhs.patch"))))
  4241. (build-system gnu-build-system)
  4242. (arguments
  4243. '(#:make-flags '("-C" "src")
  4244. #:phases (modify-phases %standard-phases
  4245. (delete 'configure)
  4246. (add-before 'build 'set-shell-file-name
  4247. (lambda* (#:key inputs #:allow-other-keys)
  4248. (substitute* (find-files "src" "\\.[ch]$")
  4249. (("\"/bin/sh\"")
  4250. (string-append "\""
  4251. (assoc-ref inputs "bash")
  4252. "/bin/sh\"")))
  4253. #t))
  4254. (add-before 'check 'fix-fhs-assumptions-in-tests
  4255. (lambda _
  4256. (substitute* "tests/test-c6b77b77.mk"
  4257. (("/bin/bash") (which "bash"))
  4258. (("/usr/bin/test") (which "test")))
  4259. (substitute* '("tests/test-16573e73.c")
  4260. (("/bin/([a-z-]+)" _ program)
  4261. (which program)))
  4262. (substitute* (find-files "tests" "\\.sh$")
  4263. ;; Some of the tests try to "bind-mount" /bin/true.
  4264. (("-b /bin/true:")
  4265. (string-append "-b " (which "true") ":"))
  4266. ;; Likewise for /bin.
  4267. (("-b /bin:") "-b /gnu:")
  4268. ;; Others try to run /bin/sh.
  4269. (("/bin/sh") (which "sh"))
  4270. ;; Others assume /etc/fstab exists.
  4271. (("/etc/fstab") "/etc/passwd"))
  4272. (substitute* "tests/GNUmakefile"
  4273. (("-b /bin:") "-b /gnu:"))
  4274. ;; XXX: This test fails in an obscure corner case, just
  4275. ;; skip it.
  4276. (delete-file "tests/test-kkkkkkkk.c")
  4277. #t))
  4278. (replace 'check
  4279. (lambda _
  4280. (let ((n (parallel-job-count)))
  4281. ;; For some reason we get lots of segfaults with
  4282. ;; seccomp support (x86_64, Linux-libre 4.11.0).
  4283. (setenv "PROOT_NO_SECCOMP" "1")
  4284. ;; Most of the tests expect "/bin" to be in $PATH so
  4285. ;; they can run things that live in $ROOTFS/bin.
  4286. (setenv "PATH"
  4287. (string-append (getenv "PATH") ":/bin"))
  4288. (invoke "make" "check" "-C" "tests"
  4289. ;;"V=1"
  4290. "-j" (number->string n)))))
  4291. (replace 'install
  4292. (lambda* (#:key outputs #:allow-other-keys)
  4293. ;; The 'install' rule does nearly nothing.
  4294. (let* ((out (assoc-ref outputs "out"))
  4295. (man1 (string-append out "/share/man/man1")))
  4296. ;; TODO: 'make install-care' (does not even
  4297. ;; build currently.)
  4298. (invoke "make" "-C" "src" "install"
  4299. (string-append "PREFIX=" out))
  4300. (mkdir-p man1)
  4301. (copy-file "doc/proot/man.1"
  4302. (string-append man1 "/proot.1"))
  4303. #t))))))
  4304. (native-inputs `(("which" ,which)
  4305. ;; For 'mcookie', used by some of the tests.
  4306. ("util-linux" ,util-linux)))
  4307. (inputs `(("talloc" ,talloc)))
  4308. (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
  4309. (description
  4310. "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
  4311. and @code{binfmt_misc}. This means that users don't need any privileges or
  4312. setup to do things like using an arbitrary directory as the new root
  4313. file system, making files accessible somewhere else in the file system
  4314. hierarchy, or executing programs built for another CPU architecture
  4315. transparently through QEMU user-mode. Also, developers can use PRoot as a
  4316. generic process instrumentation engine thanks to its extension mechanism.
  4317. Technically PRoot relies on @code{ptrace}, an unprivileged system-call
  4318. available in the kernel Linux.")
  4319. (license license:gpl2+)))
  4320. (define-public proot-static
  4321. (package
  4322. (inherit proot)
  4323. (name "proot-static")
  4324. (synopsis
  4325. "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
  4326. (inputs `(("talloc" ,talloc/static)))
  4327. (arguments
  4328. (substitute-keyword-arguments (package-arguments proot)
  4329. ((#:make-flags flags)
  4330. `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
  4331. ((#:phases phases)
  4332. `(modify-phases ,phases
  4333. (add-after 'strip 'remove-store-references
  4334. (lambda* (#:key outputs #:allow-other-keys)
  4335. (let* ((out (assoc-ref outputs "out")))
  4336. (with-directory-excursion out
  4337. (remove-store-references "bin/proot")
  4338. #t))))))
  4339. ((#:allowed-references _ '("out"))
  4340. '("out"))))))
  4341. (define-public cpuid
  4342. (package
  4343. (name "cpuid")
  4344. (version "20180519")
  4345. (source (origin
  4346. (method url-fetch)
  4347. (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
  4348. version ".src.tar.gz"))
  4349. (sha256
  4350. (base32
  4351. "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
  4352. (build-system gnu-build-system)
  4353. (arguments
  4354. '(#:make-flags '("CC=gcc")
  4355. #:tests? #f ; no tests
  4356. #:phases (modify-phases %standard-phases
  4357. (delete 'configure) ; no configure script
  4358. (add-before 'install 'fix-makefile
  4359. (lambda* (#:key outputs #:allow-other-keys)
  4360. (substitute* "Makefile"
  4361. (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
  4362. ;; Make the compressed manpages writable so that the
  4363. ;; reset-gzip-timestamps phase does not error out.
  4364. (substitute* "Makefile"
  4365. (("-m 444") "-m 644"))
  4366. #t)))))
  4367. (inputs `(("perl" ,perl)))
  4368. (supported-systems '("i686-linux" "x86_64-linux"))
  4369. (home-page "http://www.etallen.com/cpuid.html")
  4370. (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
  4371. (description "cpuid dumps detailed information about the CPU(s) gathered
  4372. from the CPUID instruction, and also determines the exact model of CPU(s). It
  4373. supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
  4374. NexGen, Rise, and SiS CPUs.")
  4375. (license license:gpl2+)))
  4376. (define-public jmtpfs
  4377. (package
  4378. (name "jmtpfs")
  4379. (version "0.5")
  4380. (source
  4381. (origin
  4382. (method url-fetch)
  4383. (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
  4384. version ".tar.gz"))
  4385. (file-name (string-append name "-" version ".tar.gz"))
  4386. (sha256
  4387. (base32
  4388. "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
  4389. (build-system gnu-build-system)
  4390. (inputs
  4391. `(("file" ,file)
  4392. ("fuse" ,fuse)
  4393. ("libmtp" ,libmtp)))
  4394. (native-inputs
  4395. `(("pkg-config" ,pkg-config)))
  4396. (home-page "https://github.com/JasonFerrara/jmtpfs")
  4397. (synopsis "Use a FUSE file system to access data over MTP")
  4398. (description "jmtpfs uses FUSE (file system in userspace) to provide access
  4399. to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
  4400. the MTP device as a file system.")
  4401. (license license:gpl3)))
  4402. (define-public procenv
  4403. (package
  4404. (name "procenv")
  4405. (version "0.50")
  4406. (source
  4407. (origin
  4408. (method url-fetch)
  4409. (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
  4410. version ".tar.gz"))
  4411. (file-name (string-append name "-" version ".tar.gz"))
  4412. (sha256
  4413. (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
  4414. (build-system gnu-build-system)
  4415. (arguments `(#:configure-flags '("--disable-silent-rules")))
  4416. (native-inputs `(("pkg-config" ,pkg-config)))
  4417. (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
  4418. ("groff" ,groff) ; for tests
  4419. ("libselinux" ,libselinux)))
  4420. (synopsis "Utility to show process environment")
  4421. (description "Procenv is a command-line tool that displays as much detail about
  4422. itself and its environment as possible. It can be used as a test
  4423. tool, to understand the type of environment a process runs in, and for
  4424. comparing system environments.")
  4425. (home-page "http://github.com/jamesodhunt/procenv/")
  4426. (license license:gpl3+)))
  4427. (define-public libfabric
  4428. (package
  4429. (name "libfabric")
  4430. (version "1.4.1")
  4431. (source
  4432. (origin
  4433. (method url-fetch)
  4434. (uri
  4435. (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
  4436. version "/libfabric-" version ".tar.bz2"))
  4437. (sha256
  4438. (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
  4439. (build-system gnu-build-system)
  4440. (inputs `(("rdma-core" ,rdma-core)
  4441. ,@(match (%current-system)
  4442. ((member (package-supported-systems psm))
  4443. `(("psm" ,psm)))
  4444. (_ `()))
  4445. ("libnl" ,libnl)))
  4446. (home-page "https://ofiwg.github.io/libfabric/")
  4447. (synopsis "Open Fabric Interfaces")
  4448. (description
  4449. "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
  4450. communication services to applications. OFI is best described as a collection
  4451. of libraries and applications used to export fabric services. The key
  4452. components of OFI are: application interfaces, provider libraries, kernel
  4453. services, daemons, and test applications.
  4454. Libfabric is a core component of OFI. It is the library that defines and
  4455. exports the user-space API of OFI, and is typically the only software that
  4456. applications deal with directly. It works in conjunction with provider
  4457. libraries, which are often integrated directly into libfabric.")
  4458. (license (list license:bsd-2 license:gpl2)))) ;dual
  4459. (define-public psm
  4460. (package
  4461. (name "psm")
  4462. (version "3.3.20170428")
  4463. (home-page "https://github.com/intel/psm")
  4464. (source
  4465. (origin
  4466. (method git-fetch)
  4467. (uri (git-reference (url home-page)
  4468. (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
  4469. (file-name (string-append "psm-" version ".tar.gz"))
  4470. (sha256
  4471. (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
  4472. (patches (search-patches
  4473. "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
  4474. "psm-ldflags.patch" ; build shared lib with LDFLAGS
  4475. "psm-repro.patch")))) ; reproducibility
  4476. (build-system gnu-build-system)
  4477. (inputs `(("libuuid" ,util-linux)))
  4478. (arguments
  4479. '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
  4480. ,(string-append "INSTALL_PREFIX=" %output)
  4481. ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  4482. #:tests? #f
  4483. #:phases (modify-phases %standard-phases
  4484. (delete 'configure)
  4485. (add-after 'unpack 'patch-/usr/include
  4486. (lambda _
  4487. (substitute* "Makefile"
  4488. (("\\$\\{DESTDIR}/usr/include")
  4489. (string-append %output "/include")))
  4490. (substitute* "Makefile"
  4491. (("/lib64") "/lib"))
  4492. #t))
  4493. (add-after 'unpack 'patch-sysmacros
  4494. (lambda _
  4495. (substitute* "ipath/ipath_proto.c"
  4496. (("#include <sys/poll.h>" m)
  4497. (string-append m "\n"
  4498. "#include <sys/sysmacros.h>")))
  4499. #t)))))
  4500. (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
  4501. (description
  4502. "The PSM Messaging API, or PSM API, is Intel's low-level user-level
  4503. communications interface for the True Scale family of products. PSM users are
  4504. enabled with mechanisms necessary to implement higher level communications
  4505. interfaces in parallel environments.")
  4506. ;; Only Intel-compatable processors are supported.
  4507. (supported-systems '("i686-linux" "x86_64-linux"))
  4508. (license (list license:bsd-2 license:gpl2)))) ;dual
  4509. (define-public snapscreenshot
  4510. (package
  4511. (name "snapscreenshot")
  4512. (version "1.0.14.3")
  4513. (source
  4514. (origin
  4515. (method url-fetch)
  4516. (uri (string-append "http://bisqwit.iki.fi/src/arch/"
  4517. name "-" version ".tar.bz2"))
  4518. (sha256
  4519. (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
  4520. (build-system gnu-build-system)
  4521. (arguments
  4522. `(#:make-flags
  4523. (let ((out (assoc-ref %outputs "out")))
  4524. (list (string-append "BINDIR=" out "/bin")
  4525. (string-append "MANDIR=" out "/share/man")))
  4526. #:tests? #f ; no test suite
  4527. #:phases
  4528. (modify-phases %standard-phases
  4529. (delete 'configure) ; ./configure is a snarky no-op
  4530. (add-before 'install 'fix-ownership
  4531. ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
  4532. (lambda _
  4533. (substitute* "depfun.mak"
  4534. ((" -o bin -g bin ") " "))
  4535. #t))
  4536. (add-before 'install 'create-output-directories
  4537. (lambda* (#:key outputs #:allow-other-keys)
  4538. (let ((out (assoc-ref outputs "out")))
  4539. (mkdir-p (string-append out "/share/man/man1"))
  4540. #t))))))
  4541. (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
  4542. (synopsis "Take screenshots of one or more Linux text consoles")
  4543. (description
  4544. "snapscreenshot saves a screenshot of one or more Linux text consoles as a
  4545. Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
  4546. relevant @file{/dev/vcs*} file(s).")
  4547. (license license:gpl2)))
  4548. (define-public fbcat
  4549. (package
  4550. (name "fbcat")
  4551. (version "0.5.1")
  4552. (source
  4553. (origin
  4554. (method url-fetch)
  4555. (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
  4556. version "/" name "-" version ".tar.gz"))
  4557. (sha256
  4558. (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
  4559. (build-system gnu-build-system)
  4560. (inputs
  4561. ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
  4562. ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
  4563. ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
  4564. `(("pnmtopng" ,netpbm)))
  4565. (outputs (list "out" "fbgrab"))
  4566. (arguments
  4567. `(#:make-flags
  4568. (list "CC=gcc"
  4569. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  4570. #:tests? #f ; no tests
  4571. #:phases
  4572. (modify-phases %standard-phases
  4573. (delete 'configure) ; no configure script
  4574. (add-after 'build 'qualify-references
  4575. (lambda* (#:key inputs outputs #:allow-other-keys)
  4576. (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
  4577. (out (assoc-ref outputs "out")))
  4578. (substitute* "fbgrab"
  4579. (("fbcat" all)
  4580. (string-append out "/bin/" all))
  4581. (("pnmtopng" all)
  4582. (string-append pnmtopng "/bin/" all)))
  4583. #t)))
  4584. (add-after 'install 'split-fbgrab-output
  4585. (lambda* (#:key outputs #:allow-other-keys)
  4586. (let* ((out (assoc-ref outputs "out"))
  4587. (out:fbgrab (assoc-ref outputs "fbgrab")))
  4588. (for-each (lambda (file)
  4589. (let ((old (string-append out "/" file))
  4590. (new (string-append out:fbgrab "/" file)))
  4591. (mkdir-p (dirname new))
  4592. (rename-file old new)))
  4593. (list "bin/fbgrab"
  4594. "share/man/man1/fbgrab.1"))
  4595. #t))))))
  4596. (home-page "https://jwilk.net/software/fbcat")
  4597. (synopsis "Take a screenshot of the contents of the Linux framebuffer")
  4598. (description
  4599. "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
  4600. a dump therof. It supports a wide range of drivers and pixel formats.
  4601. @command{fbcat} can take screenshots of virtually any application that can be
  4602. made to write its output to the framebuffer, including (but not limited to)
  4603. text-mode or graphical applications that don't use a display server.
  4604. Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
  4605. emulates the behaviour of Gunnar Monell's older fbgrab utility.")
  4606. (license license:gpl2)))
  4607. (define-public libcgroup
  4608. (package
  4609. (name "libcgroup")
  4610. (version "0.41")
  4611. (source
  4612. (origin
  4613. (method url-fetch)
  4614. (uri (string-append
  4615. "mirror://sourceforge/libcg/" name "/"
  4616. version "/" name "-" version ".tar.bz2"))
  4617. (sha256
  4618. (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
  4619. (build-system gnu-build-system)
  4620. (arguments
  4621. `(#:tests? #f))
  4622. (native-inputs
  4623. `(("bison" ,bison)
  4624. ("flex" ,flex)))
  4625. (inputs
  4626. `(("linux-pam" ,linux-pam)))
  4627. (home-page "https://sourceforge.net/projects/libcg/")
  4628. (synopsis "Control groups management tools")
  4629. (description "Control groups is Linux kernel method for process resource
  4630. restriction, permission handling and more. This package provides userspace
  4631. interface to this kernel feature.")
  4632. (license license:lgpl2.1)))
  4633. (define-public mbpfan
  4634. (package
  4635. (name "mbpfan")
  4636. (version "2.1.0")
  4637. (source
  4638. (origin
  4639. (method git-fetch)
  4640. (uri (git-reference
  4641. (url "https://github.com/dgraziotin/mbpfan.git")
  4642. (commit (string-append "v" version))))
  4643. (file-name (git-file-name name version))
  4644. (sha256
  4645. (base32
  4646. "1gysq778rkl6dvvj9a1swxcl15wvz0bng5bn4nwq118cl8p8pask"))))
  4647. (build-system gnu-build-system)
  4648. (arguments
  4649. '(#:tests? #f ; tests ask to be run as root
  4650. #:make-flags (let ((out (assoc-ref %outputs "out")))
  4651. (list (string-append "DESTDIR=" out)
  4652. "CC=gcc"))
  4653. #:phases
  4654. (modify-phases %standard-phases
  4655. (add-after 'unpack 'patch-paths
  4656. (lambda _
  4657. (substitute* "Makefile"
  4658. (("/usr") ""))
  4659. #t))
  4660. (delete 'configure)))) ; there's no configure phase
  4661. (home-page "https://github.com/dgraziotin/mbpfan")
  4662. (synopsis "Control fan speed on Macbooks")
  4663. (description
  4664. "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
  4665. the @code{coretemp} module and sets the fan speed using the @code{applesmc}
  4666. module. It can be executed as a daemon or in the foreground with root
  4667. privileges.")
  4668. (license license:gpl3+)))
  4669. (define-public psm2
  4670. (package
  4671. (name "psm2")
  4672. (version "10.3-46")
  4673. (source (origin
  4674. (method git-fetch)
  4675. (uri (git-reference
  4676. (url "https://github.com/intel/opa-psm2.git")
  4677. (commit (string-append "PSM2_" version))))
  4678. (file-name (git-file-name name version))
  4679. (sha256
  4680. (base32
  4681. "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
  4682. (build-system gnu-build-system)
  4683. (arguments
  4684. '(#:make-flags
  4685. `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  4686. #:tests? #f
  4687. #:phases (modify-phases %standard-phases
  4688. (delete 'configure)
  4689. (add-after 'unpack 'patch-Makefiles
  4690. (lambda _
  4691. (substitute* "Makefile"
  4692. (("/lib64") "/lib")
  4693. (("/usr") ""))
  4694. (substitute* "compat/Makefile"
  4695. (("/lib64") "/lib")
  4696. (("/usr") ""))
  4697. #t))
  4698. (replace 'install
  4699. (lambda _
  4700. (setenv "DESTDIR" %output)
  4701. (invoke "make" "install")
  4702. #t)))))
  4703. (inputs
  4704. `(("rdma-core" ,rdma-core)
  4705. ("numactl" ,numactl)))
  4706. (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
  4707. (description
  4708. "This package is low-level user-level Intel's communications interface.
  4709. The PSM2 API is a high-performance vendor-specific protocol that provides a
  4710. low-level communications interface for the Intel Omni-Path family of
  4711. high-speed networking devices.")
  4712. (home-page "https://github.com/intel/opa-psm2")
  4713. ;; Only the x86_64 architecure is supported.
  4714. (supported-systems '("x86_64-linux"))
  4715. (license (list license:bsd-3 license:gpl2)))) ; dual
  4716. (define-public libpfm4
  4717. (package
  4718. (name "libpfm4")
  4719. (version "4.9.0")
  4720. (source (origin
  4721. (method url-fetch)
  4722. (uri (string-append "mirror://sourceforge/perfmon2/"
  4723. name "/libpfm-" version ".tar.gz"))
  4724. (sha256
  4725. (base32
  4726. "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
  4727. (build-system gnu-build-system)
  4728. (arguments
  4729. '(#:modules ((guix build utils)
  4730. (guix build gnu-build-system))
  4731. #:phases (modify-phases %standard-phases
  4732. (delete 'configure)
  4733. (delete 'check)
  4734. (replace 'build
  4735. (lambda* (#:key inputs outputs #:allow-other-keys)
  4736. (let* ((out (assoc-ref outputs "out")))
  4737. (setenv "CC" "gcc")
  4738. (invoke "make")
  4739. #t)))
  4740. (replace 'install
  4741. (lambda* (#:key outputs #:allow-other-keys)
  4742. (let* ((out (assoc-ref outputs "out")))
  4743. (invoke "make"
  4744. (string-append "PREFIX=" out)
  4745. "install")
  4746. #t))))))
  4747. (synopsis "Performance event monitoring library")
  4748. (description
  4749. "This package provides a library called libpfm4, which is used to develop
  4750. monitoring tools exploiting the performance monitoring events such as those
  4751. provided by the Performance Monitoring Unit (PMU) of modern processors.
  4752. Libpfm4 helps convert from an event name, expressed as a string, to the event
  4753. encoding that is either the raw event as documented by the hardware vendor or
  4754. the OS-specific encoding. In the latter case, the library is able to prepare
  4755. the OS-specific data structures needed by the kernel to setup the event.
  4756. libpfm4 provides support for the @code{perf_events} interface, which was
  4757. introduced in Linux 2.6.31.")
  4758. (home-page "http://perfmon2.sourceforge.net/")
  4759. (license license:expat)))
  4760. (define-public libnfnetlink
  4761. (package
  4762. (name "libnfnetlink")
  4763. (version "1.0.1")
  4764. (source (origin
  4765. (method url-fetch)
  4766. (uri (string-append
  4767. "https://www.netfilter.org/projects/libnfnetlink/files/"
  4768. "libnfnetlink-" version ".tar.bz2"))
  4769. (sha256
  4770. (base32
  4771. "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
  4772. (build-system gnu-build-system)
  4773. (home-page "https://www.netfilter.org/projects/libnfnetlink/")
  4774. (synopsis "Low-level netfilter netlink communication library")
  4775. (description
  4776. "@code{libnfnetlink} is the low-level library for netfilter related
  4777. kernel/userspace communication. It provides a generic messaging
  4778. infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
  4779. nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
  4780. management tools in userspace.")
  4781. (license license:gpl2)))
  4782. (define-public xfsprogs
  4783. (package
  4784. (name "xfsprogs")
  4785. (version "4.19.0")
  4786. (source (origin
  4787. (method url-fetch)
  4788. (uri (string-append
  4789. "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
  4790. "xfsprogs-" version ".tar.gz"))
  4791. (sha256
  4792. (base32
  4793. "0gs39yiyamjw516jbak3nj4dy4h2a2g48c1mmv4wbppsccvwmwh5"))))
  4794. (build-system gnu-build-system)
  4795. (arguments
  4796. `(#:tests? #f)) ; Kernel/user integration tests are in package "xfstests"
  4797. (native-inputs
  4798. `(("gettext" ,gettext-minimal)
  4799. ("util-linux" ,util-linux)))
  4800. (home-page "https://xfs.wiki.kernel.org/")
  4801. (synopsis "XFS file system tools")
  4802. (description "This package provides commands to create and check XFS
  4803. file systems.")
  4804. ;; The library "libhandle" and the headers in "xfslibs-dev" are
  4805. ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
  4806. (license (list license:gpl2 license:lgpl2.1))))
  4807. (define-public genext2fs
  4808. (package
  4809. (name "genext2fs")
  4810. (version "1.4.1")
  4811. (source (origin
  4812. (method git-fetch)
  4813. (uri (git-reference
  4814. (url "https://github.com/jeremie-koenig/genext2fs.git")
  4815. (commit (string-append "genext2fs-" version))))
  4816. (file-name (git-file-name name version))
  4817. (sha256
  4818. (base32
  4819. "1r0n74pyypv63qfqqpvx75dwijcsvcrvqrlv8sldbhv0nwr1gk53"))))
  4820. (build-system gnu-build-system)
  4821. (home-page "https://github.com/jeremie-koenig/genext2fs")
  4822. (synopsis "Generate ext2 filesystem as a normal user")
  4823. (description "This package provides a program to general an ext2
  4824. filesystem as a normal (non-root) user. It does not require you to mount
  4825. the image file to copy files on it, nor does it require that you become
  4826. the superuser to make device nodes.")
  4827. (license license:gpl2)))
  4828. (define-public fakeroot
  4829. (package
  4830. (name "fakeroot")
  4831. (version "1.23")
  4832. (source (origin
  4833. (method url-fetch)
  4834. (uri (string-append "http://ftp.debian.org/debian/pool/main/f/"
  4835. "fakeroot/fakeroot_" version ".orig.tar.xz"))
  4836. (file-name (string-append name "-" version ".tar.gz"))
  4837. (sha256
  4838. (base32
  4839. "1xpl0s2yjyjwlf832b6kbkaa5921liybaar13k7n45ckd9lxd700"))))
  4840. (build-system gnu-build-system)
  4841. (arguments
  4842. `(#:phases
  4843. (modify-phases %standard-phases
  4844. (add-after 'configure 'patch-Makefile
  4845. (lambda _
  4846. ;; Note: The root of the problem is already in "Makefile.am".
  4847. (substitute* "Makefile"
  4848. (("/bin/sh") (which "sh")))
  4849. #t))
  4850. (add-after 'unpack 'patch-getopt
  4851. (lambda* (#:key inputs #:allow-other-keys)
  4852. (substitute* "scripts/fakeroot.in"
  4853. (("getopt")
  4854. (string-append (assoc-ref inputs "util-linux")
  4855. "/bin/getopt")))
  4856. #t))
  4857. (add-before 'configure 'setenv
  4858. (lambda _
  4859. (setenv "LIBS" "-lacl")
  4860. #t))
  4861. (add-before 'check 'prepare-check
  4862. (lambda _
  4863. (setenv "SHELL" (which "bash"))
  4864. (setenv "VERBOSE" "1")
  4865. (substitute* "test/t.touchinstall"
  4866. ;; We don't have the name of the root user, so use ID=0.
  4867. (("grep root") "grep \"\\<0\\>\""))
  4868. (substitute* "test/tartest"
  4869. ;; We don't have the name of the root group, so use ID=0.
  4870. (("ROOTGROUP=root") "ROOTGROUP=0")
  4871. ;; We don't have the name of the daemon user, so use IDs.
  4872. (("daemon:sys") "1:3")
  4873. (("daemon:") "1:"))
  4874. ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
  4875. (substitute* "test/compare-tar"
  4876. (("tar -tvf") "tar --numeric-owner -tvf"))
  4877. #t)))))
  4878. (native-inputs
  4879. `(("acl" ,acl)
  4880. ("sharutils" ,sharutils) ; for the tests
  4881. ("xz" ,xz))) ; for the tests
  4882. (inputs
  4883. `(("libcap" ,libcap)
  4884. ("util-linux" ,util-linux)))
  4885. (synopsis "Provides a fake root environment")
  4886. (description "@command{fakeroot} runs a command in an environment where
  4887. it appears to have root privileges for file manipulation. This is useful
  4888. for allowing users to create archives (tar, ar, .deb etc.) with files in
  4889. them with root permissions/ownership. Without fakeroot one would have to
  4890. have root privileges to create the constituent files of the archives with
  4891. the correct permissions and ownership, and then pack them up, or one would
  4892. have to construct the archives directly, without using the archiver.")
  4893. (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
  4894. (license license:gpl3+)))