@ -4,6 +4,7 @@
, lib
, fetchFromGitHub
, fetchpatch
, fetchzip
, buildPackages
, ninja
, meson
@ -75,24 +76,24 @@
, withHomed ? false
, withHostnamed ? true
, withHwdb ? true
, withImportd ? true
, withImportd ? ! stdenv . hostPlatform . isMusl
, withLibBPF ? false # currently fails while generating BPF objects
, withLocaled ? true
, withLogind ? true
, withMachined ? true
, withNetworkd ? true
, withNss ? true
, withNss ? ! stdenv . hostPlatform . isMusl
, withOomd ? false
, withPCRE2 ? true
, withPolkit ? true
, withPortabled ? false
, withRemote ? true
, withRemote ? ! stdenv . hostPlatform . isMusl
, withResolved ? true
, withShellCompletions ? true
, withTimedated ? true
, withTimesyncd ? true
, withTpm2Tss ? true
, withUserDb ? true
, withTpm2Tss ? ! stdenv . hostPlatform . isMusl
, withUserDb ? ! stdenv . hostPlatform . isMusl
, libfido2
, p11-kit
@ -163,7 +164,40 @@ stdenv.mkDerivation {
# all our root unit dirs if they are symlinks. This does exactly what we
# need (AFAICT).
./0019-core-handle-lookup-paths-being-symlinks.patch
] ;
] ++ lib . optional stdenv . hostPlatform . isMusl ( let
oe-core = fetchzip {
url = " h t t p s : / / g i t . o p e n e m b e d d e d . o r g / o p e n e m b e d d e d - c o r e / s n a p s h o t / o p e n e m b e d d e d - c o r e - 1 4 c 6 e 5 a 4 b 7 2 d 0 e 4 6 6 5 2 7 9 1 5 8 a 0 7 4 0 d d 1 d c 2 1 f 7 2 f . t a r . b z 2 " ;
sha256 = " 1 j i x y a 4 c z k r 5 p 5 r d c w 3 d 6 i p s 8 z z r 8 2 d v n a n v z v g j h 6 7 7 3 0 s c f l y a " ;
} ;
musl-patches = oe-core + " / m e t a / r e c i p e s - c o r e / s y s t e m d / s y s t e m d " ;
in [
( musl-patches + " / 0 0 0 2 - d o n - t - u s e - g l i b c - s p e c i f i c - q s o r t _ r . p a t c h " )
( musl-patches + " / 0 0 0 3 - m i s s i n g _ t y p e . h - a d d - _ _ c o m p a r e _ f n _ t - a n d - c o m p a r i s o n _ f n _ . p a t c h " )
( musl-patches + " / 0 0 0 4 - a d d - f a l l b a c k - p a r s e _ p r i n t f _ f o r m a t - i m p l e m e n t a t i o n . p a t c h " )
( musl-patches + " / 0 0 0 5 - s r c - b a s i c - m i s s i n g . h - c h e c k - f o r - m i s s i n g - s t r n d u p a . p a t c h " )
( musl-patches + " / 0 0 0 6 - I n c l u d e - n e t i n e t - i f _ e t h e r . h . p a t c h " )
( musl-patches + " / 0 0 0 7 - d o n - t - f a i l - i f - G L O B _ B R A C E - a n d - G L O B _ A L T D I R F U N C - i s - n o t - . p a t c h " )
( musl-patches + " / 0 0 0 8 - a d d - m i s s i n g - F T W _ - m a c r o s - f o r - m u s l . p a t c h " )
( musl-patches + " / 0 0 0 9 - f i x - m i s s i n g - o f - _ _ r e g i s t e r _ a t f o r k - f o r - n o n - g l i b c - b u i l d . p a t c h " )
( musl-patches + " / 0 0 1 0 - U s e - u i n t m a x _ t - f o r - h a n d l i n g - r l i m _ t . p a t c h " )
( musl-patches + " / 0 0 1 1 - t e s t - s i z e o f . c - D i s a b l e - t e s t s - f o r - m i s s i n g - t y p e d e f s - i n - . p a t c h " )
( musl-patches + " / 0 0 1 2 - d o n - t - p a s s - A T _ S Y M L I N K _ N O F O L L O W - f l a g - t o - f a c c e s s a t . p a t c h " )
( musl-patches + " / 0 0 1 3 - D e f i n e - g l i b c - c o m p a t i b l e - b a s e n a m e - f o r - n o n - g l i b c - s y s t e . p a t c h " )
( musl-patches + " / 0 0 1 4 - D o - n o t - d i s a b l e - b u f f e r i n g - w h e n - w r i t i n g - t o - o o m _ s c o r e _ a . p a t c h " )
( musl-patches + " / 0 0 1 5 - d i s t i n g u i s h - X S I - c o m p l i a n t - s t r e r r o r _ r - f r o m - G N U - s p e c i f . p a t c h " )
( musl-patches + " / 0 0 1 6 - H i d e - _ _ s t a r t _ B U S _ E R R O R _ M A P - a n d - _ _ s t o p _ B U S _ E R R O R _ M A P . p a t c h " )
( musl-patches + " / 0 0 1 7 - m i s s i n g _ t y p e . h - a d d - _ _ c o m p a r _ d _ f n _ t - d e f i n i t i o n . p a t c h " )
( musl-patches + " / 0 0 1 8 - a v o i d - r e d e f i n i t i o n - o f - p r c t l _ m m _ m a p - s t r u c t u r e . p a t c h " )
( musl-patches + " / 0 0 1 9 - H a n d l e - m i s s i n g - L O C K _ E X . p a t c h " )
( musl-patches + " / 0 0 2 1 - t e s t - j s o n . c - d e f i n e - M _ P I l . p a t c h " )
( musl-patches + " / 0 0 2 2 - d o - n o t - d i s a b l e - b u f f e r - i n - w r i t i n g - f i l e s . p a t c h " )
( musl-patches + " / 0 0 2 5 - H a n d l e - _ _ c p u _ m a s k - u s a g e . p a t c h " )
( musl-patches + " / 0 0 2 6 - H a n d l e - m i s s i n g - g s h a d o w . p a t c h " )
( musl-patches + " / 0 0 2 8 - m i s s i n g _ s y s c a l l . h - D e f i n e - M I P S - A B I - d e f i n e s - f o r - m u s l . p a t c h " )
# Being discussed upstream: https://lists.openembedded.org/g/openembedded-core/topic/86411771#157056
./musl.diff
] ) ;
postPatch = ''
substituteInPlace src/basic/path-util.h - - replace " @ d e f a u l t P a t h N o r m a l @ " " ${ placeholder " o u t " } / b i n / "
@ -443,7 +477,13 @@ stdenv.mkDerivation {
" - D n s s - s y s t e m d = f a l s e "
] ++ lib . optionals withLibBPF [
" - D b p f - f r a m e w o r k = t r u e "
] ++ lib . optional withTpm2Tss " - D t p m 2 = t r u e " ;
] ++ lib . optionals withTpm2Tss [
" - D t p m 2 = t r u e "
] ++ lib . optionals stdenv . hostPlatform . isMusl [
" - D g s h a d o w = f a l s e "
" - D u t m p = f a l s e "
" - D i d n = f a l s e "
] ;
preConfigure = ''
mesonFlagsArray + = ( - Dntp-servers = " 0 . n i x o s . p o o l . n t p . o r g 1 . n i x o s . p o o l . n t p . o r g 2 . n i x o s . p o o l . n t p . o r g 3 . n i x o s . p o o l . n t p . o r g " )
@ -505,7 +545,7 @@ stdenv.mkDerivation {
- - replace " S Y S T E M D _ C G R O U P _ A G E N T _ P A T H " " _ S Y S T E M D _ C G R O U P _ A G E N T _ P A T H "
'' ;
NIX_CFLAGS_COMPILE = toString [
NIX_CFLAGS_COMPILE = toString ( [
# Can't say ${polkit.bin}/bin/pkttyagent here because that would
# lead to a cyclic dependency.
" - U P O L K I T _ A G E N T _ B I N A R Y _ P A T H "
@ -519,7 +559,10 @@ stdenv.mkDerivation {
" - U S Y S T E M D _ B I N A R Y _ P A T H "
" - D S Y S T E M D _ B I N A R Y _ P A T H = \" / r u n / c u r r e n t - s y s t e m / s y s t e m d / l i b / s y s t e m d / s y s t e m d \" "
] ;
] ++ lib . optionals stdenv . hostPlatform . isMusl [
" - D _ _ U A P I _ D E F _ E T H H D R = 0 "
] ) ;
doCheck = false ; # fails a bunch of tests