treewide: juce_recommended_lto_flags -> ffat-lto-objects
This commit is contained in:
@@ -48,6 +48,17 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
libXtst
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postPatch = ''
|
||||
@@ -55,8 +66,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE'
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'include(cmake-include/CPM.cmake)' '# No CPM needed'
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
||||
@@ -33,11 +33,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
substituteInPlace Source/CMakeLists.txt \
|
||||
--replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE'
|
||||
''
|
||||
# LTO needs special setup on Linux
|
||||
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
substituteInPlace Source/CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
@@ -68,6 +63,17 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-ljack"
|
||||
]);
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
installPhase =
|
||||
let
|
||||
vst3Dir =
|
||||
|
||||
@@ -108,11 +108,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# Regression tests require big sound files stored in LFS, skip them
|
||||
rm -v tests/RegressionTests.cpp
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
# Remove hardcoded LTO flags: needs extra setup on Linux
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
''
|
||||
+ lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'include(Tests)' '# Not building tests' \
|
||||
@@ -144,6 +139,17 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.cmakeFeature "Catch2_SOURCE_DIR" "${catch2_3.src}")
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
|
||||
@@ -50,7 +50,13 @@ stdenv.mkDerivation rec {
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# Support JACK output in the standalone application:
|
||||
"-DJUCE_JACK"
|
||||
# Accommodate -flto:
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
];
|
||||
|
||||
|
||||
@@ -61,10 +61,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
@@ -61,15 +61,20 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"-lXrandr"
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
];
|
||||
|
||||
# Fontconfig error: Cannot load default config file: No such file: (null)
|
||||
env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
|
||||
|
||||
# LTO needs special setup on Linux
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
|
||||
@@ -52,10 +52,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
installPhase =
|
||||
let
|
||||
|
||||
@@ -76,10 +76,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-rpath ${lib.makeLibraryPath (finalAttrs.runtimeDependencies)}";
|
||||
dontPatchELF = true; # needed or nix will try to optimize the binary by removing "useless" rpath
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString (stdenv.hostPlatform.isLinux) ''
|
||||
# needs special setup on Linux, dunno if it can work on Darwin
|
||||
# Also, I get issues with linking without that, not sure why
|
||||
sed -i -e '/juce::juce_recommended_lto_flags/d' CMakeLists.txt
|
||||
patchShebangs linux/install.sh
|
||||
'';
|
||||
|
||||
|
||||
@@ -31,10 +31,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# LTO needs special setup on Linux
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
|
||||
rm -rf clap-juce-extensions
|
||||
ln -s ${finalAttrs.passthru.clapJuceExtensions} clap-juce-extensions
|
||||
'';
|
||||
@@ -65,6 +61,17 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
(lib.cmakeFeature "USE_SYSTEM_JUCE" "ON")
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
];
|
||||
|
||||
passthru.clapJuceExtensions = fetchFromGitHub {
|
||||
owner = "free-audio";
|
||||
repo = "clap-juce-extensions";
|
||||
|
||||
@@ -75,11 +75,16 @@ clangStdenv.mkDerivation (finalAttrs: {
|
||||
"-lXrandr"
|
||||
]);
|
||||
|
||||
# LTO needs special setup on Linux
|
||||
postPatch = lib.optionalString clangStdenv.hostPlatform.isLinux ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString clangStdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
cmakeFlags = [
|
||||
# see: https://github.com/ZL-Audio/ZlEqualizer#clone-and-build
|
||||
|
||||
@@ -75,11 +75,16 @@ clangStdenv.mkDerivation (finalAttrs: {
|
||||
"-lXrandr"
|
||||
]);
|
||||
|
||||
# LTO needs special setup on Linux
|
||||
postPatch = lib.optionalString clangStdenv.hostPlatform.isLinux ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString clangStdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
cmakeFlags = [
|
||||
# see: https://github.com/ZL-Audio/ZLEqualizer#clone-and-build
|
||||
|
||||
@@ -75,11 +75,16 @@ clangStdenv.mkDerivation (finalAttrs: {
|
||||
"-lXrandr"
|
||||
]);
|
||||
|
||||
# LTO needs special setup on Linux
|
||||
postPatch = lib.optionalString clangStdenv.hostPlatform.isLinux ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO'
|
||||
'';
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString clangStdenv.hostPlatform.isLinux (toString [
|
||||
# juce, compiled in this build as part of a Git submodule, uses `-flto` as
|
||||
# a Link Time Optimization flag, and instructs the plugin compiled here to
|
||||
# use this flag to. This breaks the build for us. Using _fat_ LTO allows
|
||||
# successful linking while still providing LTO benefits. If our build of
|
||||
# `juce` was used as a dependency, we could have patched that `-flto` line
|
||||
# in our juce's source, but that is not possible because it is used as a
|
||||
# Git Submodule.
|
||||
"-ffat-lto-objects"
|
||||
]);
|
||||
|
||||
cmakeFlags = [
|
||||
# see: https://github.com/ZL-Audio/ZlEqualizer#clone-and-build
|
||||
|
||||
Reference in New Issue
Block a user