Merge pull request #334692 from linj-fork/pr/melpaBuild-cd-pushd-popd
emacs: replace cd with pushd/popd in buildPhase of melpaBuild
This commit is contained in:
@@ -111,7 +111,7 @@ genericBuild ({
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
cd "$NIX_BUILD_TOP"
|
||||
pushd "$NIX_BUILD_TOP"
|
||||
|
||||
emacs --batch -Q \
|
||||
-L "$NIX_BUILD_TOP/package-build" \
|
||||
@@ -119,6 +119,8 @@ genericBuild ({
|
||||
-f melpa2nix-build-package \
|
||||
$ename $melpaVersion $commit
|
||||
|
||||
popd
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ melpaBuild {
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
cd "$sourceRoot"
|
||||
mkfifo test.log
|
||||
cat < test.log &
|
||||
HOME=$(mktemp -d) python -m test.test
|
||||
|
||||
@@ -186,13 +186,13 @@ let
|
||||
buildInputs = old.buildInputs ++ [ pkgs.sqlite ];
|
||||
|
||||
postBuild = ''
|
||||
cd source/sqlite
|
||||
pushd sqlite
|
||||
make
|
||||
cd -
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
install -m=755 -D source/sqlite/emacsql-sqlite \
|
||||
install -m=755 -D sqlite/emacsql-sqlite \
|
||||
$out/share/emacs/site-lisp/elpa/emacsql-${old.version}/sqlite/emacsql-sqlite
|
||||
'';
|
||||
|
||||
@@ -203,13 +203,13 @@ let
|
||||
buildInputs = old.buildInputs ++ [ pkgs.sqlite ];
|
||||
|
||||
postBuild = ''
|
||||
cd source/sqlite
|
||||
pushd sqlite
|
||||
make
|
||||
cd -
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
install -m=755 -D source/sqlite/emacsql-sqlite \
|
||||
install -m=755 -D sqlite/emacsql-sqlite \
|
||||
$out/share/emacs/site-lisp/elpa/emacsql-sqlite-${old.version}/sqlite/emacsql-sqlite
|
||||
'';
|
||||
|
||||
@@ -296,7 +296,7 @@ let
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
install source/hotfuzz-module.so $out/share/emacs/site-lisp/elpa/hotfuzz-*
|
||||
install hotfuzz-module.so $out/share/emacs/site-lisp/elpa/hotfuzz-*
|
||||
'';
|
||||
});
|
||||
|
||||
@@ -304,17 +304,17 @@ let
|
||||
cmakeFlags = old.cmakeFlags or [ ] ++ [ "-DCMAKE_INSTALL_BINDIR=bin" ];
|
||||
env.NIX_CFLAGS_COMPILE = "-UCLANG_RESOURCE_DIR";
|
||||
preConfigure = ''
|
||||
cd server
|
||||
pushd server
|
||||
'';
|
||||
preBuild = ''
|
||||
make
|
||||
install -D bin/irony-server $out/bin/irony-server
|
||||
cd ..
|
||||
popd
|
||||
'';
|
||||
checkPhase = ''
|
||||
cd source/server
|
||||
pushd server
|
||||
make check
|
||||
cd ../..
|
||||
popd
|
||||
'';
|
||||
preFixup = ''
|
||||
rm -rf $out/share/emacs/site-lisp/elpa/*/server
|
||||
@@ -343,18 +343,14 @@ let
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.enchant2 ];
|
||||
|
||||
postBuild = ''
|
||||
pushd working/jinx
|
||||
NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE"
|
||||
$CC -shared -o jinx-mod${libExt} jinx-mod.c -lenchant-2
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
pushd source
|
||||
outd=$(echo $out/share/emacs/site-lisp/elpa/jinx-*)
|
||||
install -m444 --target-directory=$outd jinx-mod${libExt}
|
||||
rm $outd/jinx-mod.c $outd/emacs-module.h
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = old.meta // {
|
||||
@@ -366,17 +362,13 @@ let
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ];
|
||||
|
||||
postBuild = ''
|
||||
pushd working/sqlite3
|
||||
make
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
pushd source
|
||||
outd=$out/share/emacs/site-lisp/elpa/sqlite3-*
|
||||
install -m444 -t $outd sqlite3-api.so
|
||||
rm $outd/*.c $outd/*.h
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = old.meta // {
|
||||
@@ -384,26 +376,6 @@ let
|
||||
};
|
||||
});
|
||||
|
||||
libgit = super.libgit.overrideAttrs(attrs: {
|
||||
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ [ pkgs.cmake ];
|
||||
buildInputs = attrs.buildInputs ++ [ pkgs.libgit2 ];
|
||||
dontUseCmakeBuildDir = true;
|
||||
postPatch = ''
|
||||
sed -i s/'add_subdirectory(libgit2)'// CMakeLists.txt
|
||||
'';
|
||||
postBuild = ''
|
||||
pushd working/libgit
|
||||
make
|
||||
popd
|
||||
'';
|
||||
postInstall = (attrs.postInstall or "") + "\n" + ''
|
||||
outd=$(echo $out/share/emacs/site-lisp/elpa/libgit-**)
|
||||
mkdir $outd/build
|
||||
install -m444 -t $outd/build ./source/src/libegit2.so
|
||||
rm -r $outd/src $outd/Makefile $outd/CMakeLists.txt
|
||||
'';
|
||||
});
|
||||
|
||||
evil-magit = buildWithGit super.evil-magit;
|
||||
|
||||
eopengrok = buildWithGit super.eopengrok;
|
||||
@@ -559,14 +531,14 @@ let
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
cd source/server
|
||||
pushd server
|
||||
make
|
||||
cd -
|
||||
popd
|
||||
'';
|
||||
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
mkdir -p $out/bin
|
||||
install -m755 -Dt $out/bin ./source/server/telega-server
|
||||
install -m755 -Dt $out/bin server/telega-server
|
||||
'';
|
||||
});
|
||||
|
||||
@@ -696,10 +668,8 @@ let
|
||||
# we need the proper out directory to exist, so we do this in the
|
||||
# postInstall instead of postBuild
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
pushd source/build >/dev/null
|
||||
make
|
||||
install -m444 -t $out/share/emacs/site-lisp/elpa/vterm-** ../*.so
|
||||
popd > /dev/null
|
||||
rm -rf $out/share/emacs/site-lisp/elpa/vterm-**/{CMake*,build,*.c,*.h}
|
||||
'';
|
||||
});
|
||||
@@ -737,9 +707,7 @@ let
|
||||
buildInputs =
|
||||
old.buildInputs ++
|
||||
(with pkgs.darwin.apple_sdk.frameworks; [CoreServices Foundation]);
|
||||
dontUnpack = false;
|
||||
buildPhase = (old.buildPhase or "") + ''
|
||||
cd source
|
||||
postBuild = (old.postBuild or "") + ''
|
||||
$CXX -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary-cli
|
||||
'';
|
||||
postInstall = (old.postInstall or "") + "\n" + ''
|
||||
|
||||
Reference in New Issue
Block a user