Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: remove fixCmakeFiles #232522

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkgs/applications/audio/munt/libmt32emu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ stdenv.mkDerivation rec {
cmake
];

dontFixCmake = true;

cmakeFlags = [
"-Dmunt_WITH_MT32EMU_SMF2WAV=OFF"
"-Dmunt_WITH_MT32EMU_QT=OFF"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/applications/audio/munt/mt32emu-qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ mkDerivation rec {
]
++ lib.optional withJack libjack2;

dontFixCmake = true;

cmakeFlags = [
"-Dmt32emu-qt_USE_PULSEAUDIO_DYNAMIC_LOADING=OFF"
"-Dmunt_WITH_MT32EMU_QT=ON"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/applications/audio/munt/mt32emu-smf2wav.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
sed -i -e '/add_subdirectory(mt32emu)/d' CMakeLists.txt
'';

dontFixCmake = true;

nativeBuildInputs = [
cmake
pkg-config
Expand Down
16 changes: 1 addition & 15 deletions pkgs/applications/editors/vim/macvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,7 @@ stdenv.mkDerivation {
# passes arguments to ld that it meant for clang.
+ ''
unset LD
''
# When building with nix-daemon, we need to pass -derivedDataPath or else it tries to use
# a folder rooted in /var/empty and fails. Unfortunately we can't just pass -derivedDataPath
# by itself as this flag requires the use of -scheme or -xctestrun (not sure why), but MacVim
# by default just runs `xcodebuild -project src/MacVim/MacVim.xcodeproj`, relying on the default
# behavior to build the first target in the project. Experimentally, there seems to be a scheme
# called MacVim, so we'll explicitly select that. We also need to specify the configuration too
# as the scheme seems to have the wrong default.
+ ''
configureFlagsArray+=(
XCODEFLAGS="-scheme MacVim -derivedDataPath $NIX_BUILD_TOP/derivedData"
--with-xcodecfg="Release"
)
''
;
'';

# Because we're building with system clang, this means we're building against Xcode's SDK and
# linking against system libraries. The configure script is picking up Nix Libsystem (via ruby)
Expand Down
4 changes: 0 additions & 4 deletions pkgs/applications/emulators/darling/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ in stdenv.mkDerivation {
stdenv.cc.libc.linuxHeaders
];

# Breaks valid paths like
# Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
dontFixCmake = true;

# src/external/objc4 forces OBJC_IS_DEBUG_BUILD=1, which conflicts with NDEBUG
# TODO: Fix in a better way
cmakeBuildType = " ";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ mkDerivation rec {
hash = "sha256-IYUkPGgFGI6889IyromMBobIoqSZtALVsSswQ7O1Bp0=";
};

patches = [
# Fix file cannot create directory: /var/empty/share/polkit-1/actions
./0001-fix-install-phase.patch
];

nativeBuildInputs = [
cmake
ninja
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ stdenv.mkDerivation rec {
# Avoid referencing -dev paths because of debug assertions.
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];

dontFixCmake = true;
dontWrapGApps = true;

shellHook = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ stdenv.mkDerivation rec {
--replace 'DESTINATION usr/share' "DESTINATION share"
'';

postConfigure = ''
substituteInPlace cmake_install.cmake \
--replace "/var/empty" "/usr"
'';

meta = with lib; {
description = "A full configuration manager for JWM";
homepage = "https://joewing.net/projects/jwm";
Expand Down
1 change: 0 additions & 1 deletion pkgs/by-name/cm/cmake/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ stdenv.mkDerivation (finalAttrs: {
propagatedBuildInputs = lib.optional stdenv.isDarwin ps;

preConfigure = ''
fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by libc_bin ${lib.getBin stdenv.cc.libc} \
--subst-var-by libc_dev ${lib.getDev stdenv.cc.libc} \
Expand Down
14 changes: 0 additions & 14 deletions pkgs/by-name/cm/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ addCMakeParams() {
addToSearchPath CMAKE_PREFIX_PATH $1
}

fixCmakeFiles() {
# Replace occurences of /usr and /opt by /var/empty.
echo "fixing cmake files..."
find "$1" \( -type f -name "*.cmake" -o -name "*.cmake.in" -o -name CMakeLists.txt \) -print |
while read fn; do
sed -e 's^/usr\([ /]\|$\)^/var/empty\1^g' -e 's^/opt\([ /]\|$\)^/var/empty\1^g' < "$fn" > "$fn.tmp"
mv "$fn.tmp" "$fn"
done
}

cmakeConfigurePhase() {
runHook preConfigure

Expand All @@ -23,10 +13,6 @@ cmakeConfigurePhase() {
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi

if [ -z "${dontFixCmake-}" ]; then
fixCmakeFiles .
fi

if [ -z "${dontUseCmakeBuildDir-}" ]; then
mkdir -p "$cmakeBuildDir"
cd "$cmakeBuildDir"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/by-name/ne/neovim-unwrapped/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ in {
./system_rplugin_manifest.patch
];

dontFixCmake = true;

inherit lua;
treesitter-parsers = treesitter-parsers //
{ markdown = treesitter-parsers.markdown // { location = "tree-sitter-markdown"; }; } //
Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/compilers/swift/compiler/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ in stdenv.mkDerivation {
done
'';

# We invoke cmakeConfigurePhase multiple times, but only need this once.
dontFixCmake = true;
# We setup custom build directories.
dontUseCmakeBuildDir = true;

Expand Down Expand Up @@ -355,12 +353,6 @@ in stdenv.mkDerivation {
rm swift/test/AutoDiff/compiler_crashers_fixed/issue-56649-missing-debug-scopes-in-pullback-trampoline.swift

patchShebangs .

${lib.optionalString (!stdenv.isDarwin) ''
# NOTE: This interferes with ABI stability on Darwin, which uses the system
# libraries in the hardcoded path /usr/lib/swift.
fixCmakeFiles .
''}
'';

configurePhase = ''
Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/compilers/tvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ cmake ];
# TVM CMake build uses some sources in the project's ./src/target/opt/
# directory which errneously gets mangled by the eager `fixCmakeFiles`
# function in Nix's CMake setup-hook.sh to ./src/target/var/empty/,
# which then breaks the build. Toggling this flag instructs Nix to
# not mangle the legitimate use of the opt/ folder.
dontFixCmake = true;

meta = with lib; {
homepage = "https://tvm.apache.org/";
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/libraries/irrlicht/mac.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ stdenv.mkDerivation rec {
'';

patches = [ ./mac_device.patch ];
dontFixCmake = true;

cmakeFlags = [
"-DIRRLICHT_STATIC_LIBRARY=ON"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/liboqs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ stdenv.mkDerivation rec {
"-DOQS_BUILD_ONLY_LIB=ON"
];

dontFixCmake = true; # fix CMake file will give an error

meta = with lib; {
description = "C library for prototyping and experimenting with quantum-resistant cryptography";
homepage = "https://openquantumsafe.org";
Expand Down
1 change: 0 additions & 1 deletion pkgs/kde/lib/mk-kde-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ in
propagatedBuildInputs = deps ++ extraPropagatedBuildInputs;
strictDeps = true;

dontFixCmake = true;
cmakeFlags = ["-DQT_MAJOR_VERSION=6"] ++ extraCmakeFlags;

separateDebugInfo = true;
Expand Down
1 change: 0 additions & 1 deletion pkgs/servers/foundationdb/cmake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ let
++ lib.optionals useClang [ llvmPackages.lld ];

separateDebugInfo = true;
dontFixCmake = true;

cmakeFlags =
[ (lib.optionalString officialRelease "-DFDB_RELEASE=TRUE")
Expand Down
2 changes: 0 additions & 2 deletions pkgs/servers/nosql/arangodb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ gcc10Stdenv.mkDerivation rec {

buildInputs = [ openssl zlib snappy lzo ];

# prevent failing with "cmake-3.13.4/nix-support/setup-hook: line 10: ./3rdParty/rocksdb/RocksDBConfig.cmake.in: No such file or directory"
dontFixCmake = true;
env.NIX_CFLAGS_COMPILE = "-Wno-error";

postPatch = ''
Expand Down
1 change: 0 additions & 1 deletion pkgs/tools/networking/mozillavpn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ stdenv.mkDerivation {
"-DQT_LUPDATE_EXECUTABLE=${qttools.dev}/bin/lupdate"
"-DQT_LRELEASE_EXECUTABLE=${qttools.dev}/bin/lrelease"
];
dontFixCmake = true;

qtWrapperArgs =
[ "--prefix" "PATH" ":" (lib.makeBinPath [ wireguard-tools ]) ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/tools/package-management/dnf5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ stdenv.mkDerivation (finalAttrs: {
--replace '/etc/bash_completion.d' "$out/etc/bash_completion.d"
'';

dontFixCmake = true;

passthru.tests = {
version = testers.testVersion { package = finalAttrs.finalPackage; };
};
Expand Down