kent: add runHooks

This commit is contained in:
natsukium 2023-04-20 15:45:38 +09:00
parent 1e68ff3ee9
commit 5b62152599
No known key found for this signature in database
GPG key ID: 9EA45A31DB994C53

View file

@ -25,14 +25,20 @@ stdenv.mkDerivation rec {
buildInputs = [ libpng libuuid zlib bzip2 xz openssl curl libmysqlclient ]; buildInputs = [ libpng libuuid zlib bzip2 xz openssl curl libmysqlclient ];
patchPhase = '' patchPhase = ''
runHook prePatch
substituteInPlace ./src/checkUmask.sh \ substituteInPlace ./src/checkUmask.sh \
--replace "/bin/bash" "${bash}/bin/bash" --replace "/bin/bash" "${bash}/bin/bash"
substituteInPlace ./src/hg/sqlEnvTest.sh \ substituteInPlace ./src/hg/sqlEnvTest.sh \
--replace "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config" --replace "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config"
runHook postPatch
''; '';
buildPhase = '' buildPhase = ''
runHook preBuild
export MACHTYPE=$(uname -m) export MACHTYPE=$(uname -m)
export CFLAGS="-fPIC" export CFLAGS="-fPIC"
export MYSQLINC=$(mysql_config --include | sed -e 's/^-I//g') export MYSQLINC=$(mysql_config --include | sed -e 's/^-I//g')
@ -56,14 +62,20 @@ stdenv.mkDerivation rec {
cd ../utils cd ../utils
make make
runHook postBuild
''; '';
installPhase = '' installPhase = ''
runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
mkdir -p $out/lib mkdir -p $out/lib
cp $NIX_BUILD_TOP/lib/jkOwnLib.a $out/lib cp $NIX_BUILD_TOP/lib/jkOwnLib.a $out/lib
cp $NIX_BUILD_TOP/lib/jkweb.a $out/lib cp $NIX_BUILD_TOP/lib/jkweb.a $out/lib
cp $NIX_BUILD_TOP/bin/x86_64/* $out/bin cp $NIX_BUILD_TOP/bin/x86_64/* $out/bin
runHook postInstall
''; '';
meta = with lib; { meta = with lib; {