netbsd: cleanup bootstrapping
This commit is contained in:
parent
f306270209
commit
1c86f0cc46
@ -10,10 +10,11 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
netBSDDerivation = attrs: stdenv.mkDerivation ((rec {
|
netBSDDerivation = attrs: stdenv.mkDerivation ((rec {
|
||||||
name = "${attrs.pname or (baseNameOf attrs.path)}-netbsd-${attrs.version}";
|
name = "bsd-${attrs.pname or (baseNameOf attrs.path)}-netbsd-${attrs.version}";
|
||||||
src = attrs.src or fetchNetBSD attrs.path attrs.version attrs.sha256;
|
src = attrs.src or fetchNetBSD attrs.path attrs.version attrs.sha256;
|
||||||
|
|
||||||
extraPaths = [ ];
|
extraPaths = [ ];
|
||||||
|
setOutputFlags = false;
|
||||||
|
|
||||||
nativeBuildInputs = [ makeMinimal mandoc groff install stat
|
nativeBuildInputs = [ makeMinimal mandoc groff install stat
|
||||||
yacc flex tsort lorder ];
|
yacc flex tsort lorder ];
|
||||||
@ -25,17 +26,24 @@ let
|
|||||||
DESTDIR = "$(out)";
|
DESTDIR = "$(out)";
|
||||||
TOOLDIR = "$(out)";
|
TOOLDIR = "$(out)";
|
||||||
USETOOLS = "never";
|
USETOOLS = "never";
|
||||||
NOCLANGERROR="yes";
|
NOCLANGERROR = "yes";
|
||||||
NOGCCERROR="yes";
|
NOGCCERROR = "yes";
|
||||||
LEX = "flex";
|
LEX = "flex";
|
||||||
|
MKUNPRIVED = "yes";
|
||||||
|
INSTPRIV = '' ''${INSTPRIV.unpriv}'';
|
||||||
|
HOST_SH = "${bash}/bin/sh";
|
||||||
|
OBJCOPY = if stdenv.isDarwin then "true" else "objcopy";
|
||||||
|
PRESERVE = "-p";
|
||||||
|
MACHINE_ARCH = hostPlatform.parsed.cpu.name;
|
||||||
|
MACHINE_CPU = hostPlatform.parsed.cpu.name;
|
||||||
|
|
||||||
# libs will be provided by cc-wrapper
|
# libs will be provided by cc-wrapper
|
||||||
LIBCRT0="";
|
LIBCRT0 = "";
|
||||||
LIBCRTI="";
|
LIBCRTI = "";
|
||||||
LIBCRTEND="";
|
LIBCRTEND = "";
|
||||||
LIBCRTBEGIN="";
|
LIBCRTBEGIN = "";
|
||||||
LIBC="";
|
LIBC = "";
|
||||||
LIBUTIL="";
|
LIBUTIL = "";
|
||||||
LIBSSL = "";
|
LIBSSL = "";
|
||||||
LIBCRYPTO = "";
|
LIBCRYPTO = "";
|
||||||
LIBCRYPT = "";
|
LIBCRYPT = "";
|
||||||
@ -43,8 +51,6 @@ let
|
|||||||
LIBTERMINFO = "";
|
LIBTERMINFO = "";
|
||||||
LIBM = "";
|
LIBM = "";
|
||||||
LIBL = "";
|
LIBL = "";
|
||||||
"LIBDO.terminfo" = "_external";
|
|
||||||
"LIBDO.curses" = "_external";
|
|
||||||
_GCC_CRTBEGIN = "";
|
_GCC_CRTBEGIN = "";
|
||||||
_GCC_CRTBEGINS = "";
|
_GCC_CRTBEGINS = "";
|
||||||
_GCC_CRTEND = "";
|
_GCC_CRTEND = "";
|
||||||
@ -54,10 +60,14 @@ let
|
|||||||
_GCC_CRTDIR = "";
|
_GCC_CRTDIR = "";
|
||||||
_GCC_CRTN = "";
|
_GCC_CRTN = "";
|
||||||
|
|
||||||
|
"LIBDO.terminfo" = "_external";
|
||||||
|
"LIBDO.curses" = "_external";
|
||||||
|
|
||||||
# all dirs will be prefixed with DESTDIR
|
# all dirs will be prefixed with DESTDIR
|
||||||
BINDIR = "/bin";
|
BINDIR = "/bin";
|
||||||
LIBDIR = "/lib";
|
LIBDIR = "/lib";
|
||||||
SHLIBDIR = "/lib";
|
SHLIBDIR = "/lib";
|
||||||
|
INCSDIR = "/include";
|
||||||
MANDIR = "/share/man";
|
MANDIR = "/share/man";
|
||||||
INFODIR = "/share/info";
|
INFODIR = "/share/info";
|
||||||
DOCDIR = "/share/doc";
|
DOCDIR = "/share/doc";
|
||||||
@ -65,22 +75,12 @@ let
|
|||||||
X11BINDIR = "/bin";
|
X11BINDIR = "/bin";
|
||||||
X11USRLIBDIR = "/lib";
|
X11USRLIBDIR = "/lib";
|
||||||
X11MANDIR = "/share/man";
|
X11MANDIR = "/share/man";
|
||||||
SHLINKDIR = "/usr/libexec";
|
|
||||||
|
|
||||||
HOST_SH = "${bash}/bin/sh";
|
|
||||||
|
|
||||||
SHLIB_WARNTEXTREL = "no";
|
|
||||||
SHLIB_MKMAP = "no";
|
|
||||||
PRESERVE = "-p";
|
|
||||||
OBJCOPY = if stdenv.isDarwin then "true" else "objcopy";
|
|
||||||
|
|
||||||
MACHINE_ARCH = hostPlatform.parsed.cpu.name;
|
|
||||||
MACHINE_CPU = hostPlatform.parsed.cpu.name;
|
|
||||||
|
|
||||||
# NetBSD makefiles should be able to detect this
|
# NetBSD makefiles should be able to detect this
|
||||||
# but without they end up using gcc on Darwin stdenv
|
# but without they end up using gcc on Darwin stdenv
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export HAVE_${if stdenv.cc.isGNU then "GCC" else "LLVM"}=${lib.head (lib.splitString "." (lib.getVersion stdenv.cc.cc))}
|
export HAVE_${if stdenv.cc.isGNU then "GCC" else "LLVM"}=${lib.head (lib.splitString "." (lib.getVersion stdenv.cc.cc))}
|
||||||
|
|
||||||
# Parallel building. Needs the space.
|
# Parallel building. Needs the space.
|
||||||
export makeFlags+=" -j $NIX_BUILD_CORES"
|
export makeFlags+=" -j $NIX_BUILD_CORES"
|
||||||
'';
|
'';
|
||||||
@ -91,6 +91,7 @@ let
|
|||||||
sourceRoot=$PWD/$sourceRoot
|
sourceRoot=$PWD/$sourceRoot
|
||||||
export NETBSDSRCDIR=$sourceRoot
|
export NETBSDSRCDIR=$sourceRoot
|
||||||
export BSDSRCDIR=$NETBSDSRCDIR
|
export BSDSRCDIR=$NETBSDSRCDIR
|
||||||
|
export _SRC_TOP_=$NETBSDSRCDIR
|
||||||
chmod -R u+w $sourceRoot
|
chmod -R u+w $sourceRoot
|
||||||
for path in $extraPaths; do
|
for path in $extraPaths; do
|
||||||
cd $path
|
cd $path
|
||||||
@ -109,15 +110,14 @@ let
|
|||||||
# will be removed in the postInstall.
|
# will be removed in the postInstall.
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
mkdir -p $out$BINDIR $out$LIBDIR $out$INFODIR \
|
mkdir -p $out$BINDIR $out$LIBDIR $out$INFODIR \
|
||||||
$out$DOCDIR $out$LOCALEDIR
|
$out$DOCDIR $out$LOCALEDIR $out$INCSDIR
|
||||||
for i in 1 2 3 4 5 6 7 8 9; do
|
for i in 1 2 3 4 5 6 7 8 9; do
|
||||||
mkdir -p $out$MANDIR/man$i $out$MANDIR/html$i \
|
mkdir -p $out$MANDIR/man$i $out$MANDIR/html$i \
|
||||||
$out$DOCDIR/reference/ref$i
|
$out$DOCDIR/reference/ref$i
|
||||||
done
|
done
|
||||||
mkdir -p $out/usr/include
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
preFixup = ''
|
||||||
# Remove lingering /usr references
|
# Remove lingering /usr references
|
||||||
if [ -d $out/usr ]; then
|
if [ -d $out/usr ]; then
|
||||||
cd $out/usr
|
cd $out/usr
|
||||||
@ -125,6 +125,10 @@ let
|
|||||||
find . -type f -exec mv \{} $out/\{} \;
|
find . -type f -exec mv \{} $out/\{} \;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f $out/METALOG ]; then
|
||||||
|
rm $out/METALOG
|
||||||
|
fi
|
||||||
|
|
||||||
find $out -type d -empty -delete
|
find $out -type d -empty -delete
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -135,7 +139,9 @@ let
|
|||||||
};
|
};
|
||||||
}) // attrs);
|
}) // attrs);
|
||||||
|
|
||||||
# BOOTSTRAPPING
|
##
|
||||||
|
## BOOTSTRAPPING
|
||||||
|
##
|
||||||
makeMinimal = netBSDDerivation rec {
|
makeMinimal = netBSDDerivation rec {
|
||||||
path = "tools/make";
|
path = "tools/make";
|
||||||
sha256 = "0l4794zwj2haark3azf9xwcwqlkbrifhb2glaa9iba4dkg2mklsb";
|
sha256 = "0l4794zwj2haark3azf9xwcwqlkbrifhb2glaa9iba4dkg2mklsb";
|
||||||
@ -144,16 +150,26 @@ let
|
|||||||
buildInputs = [];
|
buildInputs = [];
|
||||||
nativeBuildInputs = [];
|
nativeBuildInputs = [];
|
||||||
|
|
||||||
patchPhase = ''
|
postPatch = ''
|
||||||
patchShebangs configure
|
patchShebangs configure
|
||||||
${make.patchPhase}
|
${make.postPatch}
|
||||||
|
'';
|
||||||
|
buildPhase = ''
|
||||||
|
runHook prePatch
|
||||||
|
|
||||||
|
sh ./buildmake.sh
|
||||||
|
|
||||||
|
runHook postPatch
|
||||||
'';
|
'';
|
||||||
buildPhase = "sh ./buildmake.sh";
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
install -D nbmake $out/bin/nbmake
|
install -D nbmake $out/bin/nbmake
|
||||||
ln -s $out/bin/nbmake $out/bin/make
|
ln -s $out/bin/nbmake $out/bin/make
|
||||||
mkdir -p $out/share
|
mkdir -p $out/share
|
||||||
cp -r ../../share/mk $out/share/mk
|
cp -r $NETBSDSRCDIR/share/mk $out/share/mk
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
extraPaths = [ make.src ] ++ make.extraPaths;
|
extraPaths = [ make.src ] ++ make.extraPaths;
|
||||||
};
|
};
|
||||||
@ -171,7 +187,8 @@ let
|
|||||||
|
|
||||||
# temporarily use gnuinstall for bootstrapping
|
# temporarily use gnuinstall for bootstrapping
|
||||||
# bsdinstall will be built later
|
# bsdinstall will be built later
|
||||||
makeFlags = "INSTALL=${coreutils}/bin/install";
|
makeFlags = [ "INSTALL=${coreutils}/bin/install" ];
|
||||||
|
installFlags = [];
|
||||||
RENAME = "-D";
|
RENAME = "-D";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
@ -219,7 +236,17 @@ let
|
|||||||
extraPaths = [ mtree.src make.src ];
|
extraPaths = [ mtree.src make.src ];
|
||||||
nativeBuildInputs = [ makeMinimal mandoc groff ];
|
nativeBuildInputs = [ makeMinimal mandoc groff ];
|
||||||
buildInputs = [ compat fts ];
|
buildInputs = [ compat fts ];
|
||||||
RENAME = "-D";
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
install -D install.1 $out/share/man/man1/install.1
|
||||||
|
install -D xinstall $out/bin/install
|
||||||
|
ln -s $out/bin/install $out/bin/xinstall
|
||||||
|
ln -s $out/bin/install $out/bin/binstall
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
# INSTALL_FILE = "install -D";
|
||||||
};
|
};
|
||||||
|
|
||||||
fts = netBSDDerivation {
|
fts = netBSDDerivation {
|
||||||
@ -240,10 +267,14 @@ let
|
|||||||
ar -rsc libfts.a lib/libc/gen/fts.o
|
ar -rsc libfts.a lib/libc/gen/fts.o
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
install -D lib/libc/gen/fts.3 $out/share/man/man3/fts.3
|
install -D lib/libc/gen/fts.3 $out/share/man/man3/fts.3
|
||||||
install -D include/fts.h $out/include/fts.h
|
install -D include/fts.h $out/include/fts.h
|
||||||
install -D lib/libc/include/namespace.h $out/include/namespace.h
|
install -D lib/libc/include/namespace.h $out/include/namespace.h
|
||||||
install -D libfts.a $out/lib/libfts.a
|
install -D libfts.a $out/lib/libfts.a
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
setupHook = ./fts-setup-hook.sh;
|
setupHook = ./fts-setup-hook.sh;
|
||||||
};
|
};
|
||||||
@ -268,7 +299,9 @@ let
|
|||||||
sha256 = "0rjf9blihhm0n699vr2bg88m4yjhkbxh6fxliaay3wxkgnydjwn2";
|
sha256 = "0rjf9blihhm0n699vr2bg88m4yjhkbxh6fxliaay3wxkgnydjwn2";
|
||||||
nativeBuildInputs = [ makeMinimal mandoc groff install ];
|
nativeBuildInputs = [ makeMinimal mandoc groff install ];
|
||||||
};
|
};
|
||||||
# END BOOTSTRAPPING
|
##
|
||||||
|
## END BOOTSTRAPPING
|
||||||
|
##
|
||||||
|
|
||||||
libutil = netBSDDerivation {
|
libutil = netBSDDerivation {
|
||||||
path = "lib/libutil";
|
path = "lib/libutil";
|
||||||
@ -292,44 +325,31 @@ let
|
|||||||
path = "usr.bin/make";
|
path = "usr.bin/make";
|
||||||
sha256 = "0srkkg6qdzqlccfi4xh19gl766ks6hpss76bnfvwmd0zg4q4zdar";
|
sha256 = "0srkkg6qdzqlccfi4xh19gl766ks6hpss76bnfvwmd0zg4q4zdar";
|
||||||
version = "7.1.2";
|
version = "7.1.2";
|
||||||
patchPhase = ''
|
postPatch = ''
|
||||||
# make needs this to pick up our sys make files
|
# make needs this to pick up our sys make files
|
||||||
export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\""
|
export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\""
|
||||||
|
|
||||||
# can't set owner or group in Nix build
|
|
||||||
# maybe there is a better way to trick it?
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.prog.mk \
|
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.prog.mk \
|
||||||
--replace '-o ''${SCRIPTSOWN_''${.ALLSRC:T}:U''${SCRIPTSOWN}}' "" \
|
--replace '-Wl,-dynamic-linker=''${_SHLINKER}' "" \
|
||||||
--replace '-g ''${SCRIPTSGRP_''${.ALLSRC:T}:U''${SCRIPTSGRP}}' "" \
|
--replace '-Wl,-rpath,''${SHLIBDIR}' ""
|
||||||
--replace '-o ''${RUMPBINOWN} -g ''${RUMPBINGRP}' "" \
|
|
||||||
--replace '-o ''${BINOWN} -g ''${BINGRP}' "" \
|
|
||||||
--replace '-o ''${RUMPBINOWN} -g ''${RUMPBINGRP}' "" \
|
|
||||||
--replace '-o ''${DEBUGOWN} -g ''${DEBUGGRP}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.doc.mk \
|
|
||||||
--replace '-o ''${DOCOWN} -g ''${DOCGRP}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.links.mk \
|
|
||||||
--replace '-o ''${LINKSOWN_''${.ALLSRC:T}:U''${LINKSOWN}}' "" \
|
|
||||||
--replace '-g ''${LINKSGRP_''${.ALLSRC:T}:U''${LINKSGRP}}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.man.mk \
|
|
||||||
--replace '-o ''${MANOWN} -g ''${MANGRP}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.files.mk \
|
|
||||||
--replace '-o ''${FILESOWN_''${.ALLSRC:T}:U''${FILESOWN}}' "" \
|
|
||||||
--replace '-g ''${FILESGRP_''${.ALLSRC:T}:U''${FILESGRP}}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.inc.mk \
|
|
||||||
--replace '-o ''${BINOWN} -g ''${BINGRP}' ""
|
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \
|
|
||||||
--replace '-o ''${DEBUGOWN} -g ''${DEBUGGRP}' "" \
|
|
||||||
--replace '-o ''${LIBOWN} -g ''${LIBGRP}' ""
|
|
||||||
'' + lib.optionalString stdenv.isDarwin ''
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.sys.mk \
|
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.sys.mk \
|
||||||
--replace '-Wl,--fatal-warnings' ""
|
--replace '-Wl,--fatal-warnings' "" \
|
||||||
|
--replace '-Wl,--warn-shared-textrel' ""
|
||||||
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \
|
substituteInPlace $NETBSDSRCDIR/share/mk/bsd.lib.mk \
|
||||||
--replace '-Wl,-soname,''${_LIB}.so.''${SHLIB_SOVERSION}' "" \
|
--replace '-Wl,-soname,''${_LIB}.so.''${SHLIB_SOVERSION}' "" \
|
||||||
--replace '-Wl,--whole-archive' "" \
|
--replace '-Wl,--whole-archive' "" \
|
||||||
--replace '-Wl,--no-whole-archive' ""
|
--replace '-Wl,--no-whole-archive' "" \
|
||||||
|
--replace '-Wl,--warn-shared-textrel' "" \
|
||||||
|
--replace '-Wl,-Map=''${_LIB}.so.''${SHLIB_SOVERSION}.map' "" \
|
||||||
|
--replace '-Wl,-rpath,''${SHLIBDIR}' ""
|
||||||
|
'';
|
||||||
|
preInstall = ''
|
||||||
|
mkdir -p $out$BINDIR $out$DOCDIR/reference/ref1/make \
|
||||||
|
$out$MANDIR/man1 $out$MANDIR/html1 $out/share/mk
|
||||||
'';
|
'';
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
(cd $NETBSDSRCDIR/share/mk && make install)
|
(cd $NETBSDSRCDIR/share/mk && make FILESDIR=/share/mk install)
|
||||||
'';
|
'';
|
||||||
extraPaths = [
|
extraPaths = [
|
||||||
(fetchNetBSD "share/mk" "7.1.2" "0570v0siv0wygn8ygs1yy9pgk9xjw9x1axr5qg4xrddv3lskf9xa")
|
(fetchNetBSD "share/mk" "7.1.2" "0570v0siv0wygn8ygs1yy9pgk9xjw9x1axr5qg4xrddv3lskf9xa")
|
||||||
@ -346,17 +366,23 @@ let
|
|||||||
path = "usr.bin/who";
|
path = "usr.bin/who";
|
||||||
version = "7.1.2";
|
version = "7.1.2";
|
||||||
sha256 = "17ffwww957m3qw0b6fkgjpp12pd5ydg2hs9dxkkw0qpv11j00d88";
|
sha256 = "17ffwww957m3qw0b6fkgjpp12pd5ydg2hs9dxkkw0qpv11j00d88";
|
||||||
patchPhase = ''
|
postPatch = lib.optionalString stdenv.isLinux ''
|
||||||
|
substituteInPlace $NETBSDSRCDIR/usr.bin/who/utmpentry.c \
|
||||||
|
--replace "utmptime = st.st_mtimespec" "utmptime = st.st_mtim" \
|
||||||
|
--replace "timespeccmp(&st.st_mtimespec, &utmptime, >)" "st.st_mtim.tv_sec == utmptime.tv_sec ? st.st_mtim.tv_nsec > utmptime.tv_nsec : st.st_mtim.tv_sec > utmptime.tv_sec"
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
substituteInPlace $NETBSDSRCDIR/usr.bin/who/utmpentry.c \
|
||||||
|
--replace "timespeccmp(&st.st_mtimespec, &utmpxtime, >)" "st.st_mtimespec.tv_sec == utmpxtime.tv_sec ? st.st_mtimespec.tv_nsec > utmpxtime.tv_nsec : st.st_mtimespec.tv_sec > utmpxtime.tv_sec"
|
||||||
|
'' + ''
|
||||||
substituteInPlace $NETBSDSRCDIR/usr.bin/who/utmpentry.c \
|
substituteInPlace $NETBSDSRCDIR/usr.bin/who/utmpentry.c \
|
||||||
--replace "strncpy(e->name, up->ut_name, sizeof(up->ut_name))" "strncpy(e->name, up->ut_user, sizeof(up->ut_user))" \
|
--replace "strncpy(e->name, up->ut_name, sizeof(up->ut_name))" "strncpy(e->name, up->ut_user, sizeof(up->ut_user))" \
|
||||||
--replace "utmptime = st.st_mtimespec" "utmptime = st.st_mtim" \
|
--replace "timespecclear(&utmptime)" "utmptime.tv_sec = utmptime.tv_nsec = 0" \
|
||||||
--replace "timespeccmp(&st.st_mtimespec, &utmptime, >)" "st.st_mtim.tv_sec == utmptime.tv_sec ? st.st_mtim.tv_nsec > utmptime.tv_nsec : st.st_mtim.tv_sec > utmptime.tv_sec" \
|
--replace "timespecclear(&utmpxtime)" "utmpxtime.tv_sec = utmpxtime.tv_nsec = 0"
|
||||||
--replace "timespecclear(&utmptime)" "utmptime.tv_sec = utmptime.tv_nsec = 0"
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
inherit compat install netBSDDerivation fts;
|
inherit compat install netBSDDerivation fts make;
|
||||||
|
|
||||||
getent = netBSDDerivation {
|
getent = netBSDDerivation {
|
||||||
path = "usr.bin/getent";
|
path = "usr.bin/getent";
|
||||||
@ -375,23 +401,26 @@ in rec {
|
|||||||
path = "share/dict";
|
path = "share/dict";
|
||||||
version = "7.1.2";
|
version = "7.1.2";
|
||||||
sha256 = "0nickhsjwgnr2h9nvwflvgfz93kqms5hzdnpyq02crpj35w98bh4";
|
sha256 = "0nickhsjwgnr2h9nvwflvgfz93kqms5hzdnpyq02crpj35w98bh4";
|
||||||
preBuild = "mkdir -p $out/share/dict";
|
|
||||||
makeFlags = [ "BINDIR=/share" ];
|
makeFlags = [ "BINDIR=/share" ];
|
||||||
|
preInstall = "mkdir -p $out/share/dict";
|
||||||
};
|
};
|
||||||
|
|
||||||
games = netBSDDerivation {
|
games = netBSDDerivation {
|
||||||
path = "games";
|
path = "games";
|
||||||
sha256 = "04wjsang8f8kxsifiayklbxaaxmm3vx9rfr91hfbxj4hk8gkqzy1";
|
sha256 = "04wjsang8f8kxsifiayklbxaaxmm3vx9rfr91hfbxj4hk8gkqzy1";
|
||||||
version = "7.1.2";
|
version = "7.1.2";
|
||||||
patchPhase = ''
|
makeFlags = [ "BINDIR=/bin"
|
||||||
|
"SCRIPTSDIR=/bin"
|
||||||
|
"FILESDIR=/share/games" ];
|
||||||
|
postPatch = ''
|
||||||
sed -i '1i #include <time.h>' adventure/save.c
|
sed -i '1i #include <time.h>' adventure/save.c
|
||||||
|
|
||||||
for f in $(find . -name pathnames.h); do
|
for f in $(find . -name pathnames.h); do
|
||||||
substituteInPlace $f \
|
substituteInPlace $f \
|
||||||
|
--replace /usr/share/games/fortune $out/share/games \
|
||||||
--replace /usr/share/games $out/share/games \
|
--replace /usr/share/games $out/share/games \
|
||||||
--replace /usr/games $out/bin \
|
--replace /usr/games $out/bin \
|
||||||
--replace /usr/libexec $out/libexec \
|
--replace /usr/libexec $out/libexec \
|
||||||
--replace /var/games $out/var/games \
|
|
||||||
--replace /usr/bin/more ${more}/bin/more \
|
--replace /usr/bin/more ${more}/bin/more \
|
||||||
--replace /usr/share/dict ${dict}/share/dict
|
--replace /usr/share/dict ${dict}/share/dict
|
||||||
done
|
done
|
||||||
@ -424,13 +453,11 @@ in rec {
|
|||||||
--replace 2550 550
|
--replace 2550 550
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# HACK strfile needs to be installed first & in the path
|
# HACK strfile needs to be installed first & in the path. The
|
||||||
|
# Makefile should do this for us but haven't gotten it to work
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
pushd fortune/strfile
|
|
||||||
mkdir -p $out/bin $out/share/man/man8 $out/share/man/html8
|
mkdir -p $out/bin $out/share/man/man8 $out/share/man/html8
|
||||||
make
|
(cd fortune/strfile && make && make BINDIR=/bin install)
|
||||||
make BINDIR=/bin install
|
|
||||||
popd
|
|
||||||
export PATH=$out/bin:$PATH
|
export PATH=$out/bin:$PATH
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -447,38 +474,37 @@ in rec {
|
|||||||
"-D__c99inline=__inline"
|
"-D__c99inline=__inline"
|
||||||
];
|
];
|
||||||
|
|
||||||
postBuild = ''
|
preInstall = ''
|
||||||
mkdir -p $out/usr/games $out/usr/share/games/ching \
|
mkdir -p $out/var/games/hackdir \
|
||||||
$out/usr/share/games/fortune \
|
$out/share/games \
|
||||||
$out/usr/share/games/quiz.db \
|
$out$DOCDIR/reference/ref6/rogue \
|
||||||
$out/usr/share/games/boggle \
|
$out$MANDIR/man6 $out$MANDIR/html6
|
||||||
$out/usr/libexec/ching $out/var/games/hackdir
|
|
||||||
touch $out/var/games/hackdir/perm
|
touch $out/var/games/hackdir/perm
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mv $out/games/* $out/bin
|
|
||||||
rmdir $out/games
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildInputs = [ compat libcurses libterminfo libressl ];
|
buildInputs = [ compat libcurses libterminfo libressl ];
|
||||||
extraPaths = [ dict.src who.src ];
|
extraPaths = [ dict.src who.src ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# finger = netBSDDerivation {
|
finger = netBSDDerivation {
|
||||||
# path = "usr.bin/finger";
|
path = "usr.bin/finger";
|
||||||
# sha256 = "0jl672z50f2yf7ikp682b3xrarm6bnrrx9vi94xnp2fav8m8zfyi";
|
sha256 = "0jl672z50f2yf7ikp682b3xrarm6bnrrx9vi94xnp2fav8m8zfyi";
|
||||||
# version = "7.1.2";
|
version = "7.1.2";
|
||||||
# extraPaths = [ who.src ];
|
NIX_CFLAGS_COMPILE = [
|
||||||
# NIX_CFLAGS_COMPILE = [
|
(if stdenv.isLinux then "-DSUPPORT_UTMP" else "-USUPPORT_UTMP")
|
||||||
# "-DSUPPORT_UTMP"
|
(if stdenv.isDarwin then "-DSUPPORT_UTMPX" else "-USUPPORT_UTMPX")
|
||||||
# "-USUPPORT_UTMPX"
|
];
|
||||||
# ];
|
postPatch = ''
|
||||||
# patchPhase = ''
|
NIX_CFLAGS_COMPILE+=" -I$NETBSDSRCDIR/include"
|
||||||
# ${who.patchPhase}
|
|
||||||
# '';
|
substituteInPlace extern.h \
|
||||||
# };
|
--replace psort _psort
|
||||||
|
|
||||||
|
${who.postPatch}
|
||||||
|
'';
|
||||||
|
extraPaths = [ who.src ]
|
||||||
|
++ lib.optional stdenv.isDarwin (fetchNetBSD "include/utmp.h" "7.1.2" "05690fzz0825p2bq0sfyb00mxwd0wa06qryqgqkwpqk9y2xzc7px");
|
||||||
|
};
|
||||||
|
|
||||||
fingerd = netBSDDerivation {
|
fingerd = netBSDDerivation {
|
||||||
path = "libexec/fingerd";
|
path = "libexec/fingerd";
|
||||||
@ -490,8 +516,8 @@ in rec {
|
|||||||
path = "lib/libedit";
|
path = "lib/libedit";
|
||||||
buildInputs = [ libterminfo libcurses ];
|
buildInputs = [ libterminfo libcurses ];
|
||||||
propagatedBuildInputs = [ compat ];
|
propagatedBuildInputs = [ compat ];
|
||||||
postBuild = "mkdir -p $out/usr/include/readline";
|
makeFlags = [ "INCSDIR=/include" ];
|
||||||
patchPhase = ''
|
postPatch = ''
|
||||||
sed -i '1i #undef bool_t' el.h
|
sed -i '1i #undef bool_t' el.h
|
||||||
substituteInPlace config.h \
|
substituteInPlace config.h \
|
||||||
--replace "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" ""
|
--replace "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" ""
|
||||||
@ -511,16 +537,13 @@ in rec {
|
|||||||
sha256 = "06plg0bjqgbb0aghpb9qlk8wkp1l2izdlr64vbr5laqyw8jg84zq";
|
sha256 = "06plg0bjqgbb0aghpb9qlk8wkp1l2izdlr64vbr5laqyw8jg84zq";
|
||||||
buildInputs = [ compat tic nbperf ];
|
buildInputs = [ compat tic nbperf ];
|
||||||
MKPIC = if stdenv.isDarwin then "no" else "yes";
|
MKPIC = if stdenv.isDarwin then "no" else "yes";
|
||||||
patchPhase = ''
|
makeFlags = [ "INCSDIR=/include" ];
|
||||||
substituteInPlace term.c \
|
postPatch = ''
|
||||||
--replace /usr/share $out/share
|
substituteInPlace term.c --replace /usr/share $out/share
|
||||||
'';
|
'';
|
||||||
postBuild = ''
|
postInstall = ''
|
||||||
pushd $NETBSDSRCDIR/share/terminfo
|
|
||||||
mkdir -p $out/share/misc
|
mkdir -p $out/share/misc
|
||||||
make
|
(cd $NETBSDSRCDIR/share/terminfo && make && make BINDIR=/share install)
|
||||||
make BINDIR=/share install
|
|
||||||
popd
|
|
||||||
'';
|
'';
|
||||||
extraPaths = [
|
extraPaths = [
|
||||||
(fetchNetBSD "share/terminfo" "7.1.2" "1z5vzq8cw24j05r6df4vd6r57cvdbv7vbm4h962kplp14xrbg2h3")
|
(fetchNetBSD "share/terminfo" "7.1.2" "1z5vzq8cw24j05r6df4vd6r57cvdbv7vbm4h962kplp14xrbg2h3")
|
||||||
@ -532,6 +555,7 @@ in rec {
|
|||||||
version = "7.1.2";
|
version = "7.1.2";
|
||||||
sha256 = "04djah9dadzw74nswn0xydkxn900kav8xdvxlxdl50nbrynxg9yf";
|
sha256 = "04djah9dadzw74nswn0xydkxn900kav8xdvxlxdl50nbrynxg9yf";
|
||||||
buildInputs = [ libterminfo ];
|
buildInputs = [ libterminfo ];
|
||||||
|
makeFlags = [ "INCSDIR=/include" ];
|
||||||
NIX_CFLAGS_COMPILE = [
|
NIX_CFLAGS_COMPILE = [
|
||||||
"-D__scanflike(a,b)="
|
"-D__scanflike(a,b)="
|
||||||
"-D__va_list=va_list"
|
"-D__va_list=va_list"
|
||||||
@ -540,7 +564,7 @@ in rec {
|
|||||||
propagatedBuildInputs = [ compat ];
|
propagatedBuildInputs = [ compat ];
|
||||||
MKDOC = "no"; # missing vfontedpr
|
MKDOC = "no"; # missing vfontedpr
|
||||||
MKPIC = if stdenv.isDarwin then "no" else "yes";
|
MKPIC = if stdenv.isDarwin then "no" else "yes";
|
||||||
patchPhase = lib.optionalString (!stdenv.isDarwin) ''
|
postPatch = lib.optionalString (!stdenv.isDarwin) ''
|
||||||
substituteInPlace printw.c \
|
substituteInPlace printw.c \
|
||||||
--replace "funopen(win, NULL, __winwrite, NULL, NULL)" NULL \
|
--replace "funopen(win, NULL, __winwrite, NULL, NULL)" NULL \
|
||||||
--replace "__strong_alias(vwprintw, vw_printw)" 'extern int vwprintw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_printw")));'
|
--replace "__strong_alias(vwprintw, vw_printw)" 'extern int vwprintw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_printw")));'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user