Skip to content

Commit

Permalink
treewide: support structuredAttrs in setup hooks (part 3) (#340592)
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptaron committed Sep 11, 2024
2 parents 457fc3f + 202bfa4 commit d1d2419
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 141 deletions.
12 changes: 7 additions & 5 deletions pkgs/development/compilers/swift/swiftpm/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# shellcheck shell=bash

# Build using 'swift-build'.
swiftpmBuildPhase() {
runHook preBuild
Expand All @@ -8,10 +10,10 @@ swiftpmBuildPhase() {
fi

local flagsArray=(
-j $buildCores
-j "$buildCores"
-c "${swiftpmBuildConfig-release}"
$swiftpmFlags "${swiftpmFlagsArray[@]}"
)
concatTo flagsArray swiftpmFlags swiftpmFlagsArray

echoCmd 'build flags' "${flagsArray[@]}"
TERM=dumb swift-build "${flagsArray[@]}"
Expand All @@ -33,10 +35,10 @@ swiftpmCheckPhase() {
fi

local flagsArray=(
-j $buildCores
-j "$buildCores"
-c "${swiftpmBuildConfig-release}"
$swiftpmFlags "${swiftpmFlagsArray[@]}"
)
concatTo flagsArray swiftpmFlags swiftpmFlagsArray

echoCmd 'check flags' "${flagsArray[@]}"
TERM=dumb swift-test "${flagsArray[@]}"
Expand All @@ -53,8 +55,8 @@ fi
swiftpmBinPath() {
local flagsArray=(
-c "${swiftpmBuildConfig-release}"
$swiftpmFlags "${swiftpmFlagsArray[@]}"
)
concatTo flagsArray swiftpmFlags swiftpmFlagsArray

swift-build --show-bin-path "${flagsArray[@]}"
}
11 changes: 6 additions & 5 deletions pkgs/development/cuda-modules/setup-hooks/setup-cuda-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ setupCUDAToolkit_ROOT() {
fi
done

export cmakeFlags+=" -DCUDAToolkit_INCLUDE_DIR=$CUDAToolkit_INCLUDE_DIR -DCUDAToolkit_ROOT=$CUDAToolkit_ROOT"
appendToVar cmakeFlags "-DCUDAToolkit_INCLUDE_DIR=$CUDAToolkit_INCLUDE_DIR"
appendToVar cmakeFlags "-DCUDAToolkit_ROOT=$CUDAToolkit_ROOT"
}
preConfigureHooks+=(setupCUDAToolkit_ROOT)

Expand All @@ -72,8 +73,8 @@ setupCUDAToolkitCompilers() {
# https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html
# https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html

export cmakeFlags+=" -DCUDA_HOST_COMPILER=@ccFullPath@"
export cmakeFlags+=" -DCMAKE_CUDA_HOST_COMPILER=@ccFullPath@"
appendToVar cmakeFlags "-DCUDA_HOST_COMPILER=@ccFullPath@"
appendToVar cmakeFlags "-DCMAKE_CUDA_HOST_COMPILER=@ccFullPath@"

# For non-CMake projects:
# We prepend --compiler-bindir to nvcc flags.
Expand All @@ -85,7 +86,7 @@ setupCUDAToolkitCompilers() {
export CUDAHOSTCXX="@ccFullPath@";
fi

export NVCC_PREPEND_FLAGS+=" --compiler-bindir=@ccRoot@/bin"
appendToVar NVCC_PREPEND_FLAGS "--compiler-bindir=@ccRoot@/bin"

# NOTE: We set -Xfatbin=-compress-all, which reduces the size of the compiled
# binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as
Expand All @@ -94,7 +95,7 @@ setupCUDAToolkitCompilers() {
#
# @SomeoneSerge: original comment was made by @ConnorBaker in .../cudatoolkit/common.nix
if [[ -z "${dontCompressFatbin-}" ]]; then
export NVCC_PREPEND_FLAGS+=" -Xfatbin=-compress-all"
appendToVar NVCC_PREPEND_FLAGS "-Xfatbin=-compress-all"
fi
}
preConfigureHooks+=(setupCUDAToolkitCompilers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,53 @@ addEnvHooks "$targetOffset" ecmEnvHook

ecmPostHook() {
# Because we need to use absolute paths here, we must set *all* the paths.
cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin"
cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputBin}/share"
cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
cmakeFlags+=" -DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5"
cmakeFlags+=" -DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5"
cmakeFlags+=" -DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5"
cmakeFlags+=" -DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5"
cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
appendToVar cmakeFlags "-DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
appendToVar cmakeFlags "-DKDE_INSTALL_BINDIR=${!outputBin}/bin"
appendToVar cmakeFlags "-DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
appendToVar cmakeFlags "-DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
appendToVar cmakeFlags "-DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
appendToVar cmakeFlags "-DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
appendToVar cmakeFlags "-DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
appendToVar cmakeFlags "-DKDE_INSTALL_LOCALSTATEDIR=/var"
appendToVar cmakeFlags "-DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
appendToVar cmakeFlags "-DKDE_INSTALL_DATADIR=${!outputBin}/share"
appendToVar cmakeFlags "-DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
appendToVar cmakeFlags "-DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
appendToVar cmakeFlags "-DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
appendToVar cmakeFlags "-DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5"
appendToVar cmakeFlags "-DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5"
appendToVar cmakeFlags "-DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5"
appendToVar cmakeFlags "-DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5"
appendToVar cmakeFlags "-DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
appendToVar cmakeFlags "-DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
appendToVar cmakeFlags "-DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
appendToVar cmakeFlags "-DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
appendToVar cmakeFlags "-DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
appendToVar cmakeFlags "-DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
appendToVar cmakeFlags "-DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
appendToVar cmakeFlags "-DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
appendToVar cmakeFlags "-DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
appendToVar cmakeFlags "-DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
appendToVar cmakeFlags "-DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
appendToVar cmakeFlags "-DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
appendToVar cmakeFlags "-DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
appendToVar cmakeFlags "-DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"

if [ "$(uname)" = "Darwin" ]; then
cmakeFlags+=" -DKDE_INSTALL_BUNDLEDIR=${!outputBin}/Applications/KDE"
appendToVar cmakeFlags "-DKDE_INSTALL_BUNDLEDIR=${!outputBin}/Applications/KDE"
fi

if [ -n "${qtPluginPrefix-}" ]; then
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
fi

if [ -n "${qtQmlPrefix-}" ]; then
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
fi
}
postHooks+=(ecmPostHook)
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/tools/build-managers/gradle/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ gradleConfigureHook() {
}

gradle() {
command gradle $gradleFlags "${gradleFlagsArray[@]}" "$@"
local flagsArray=()
concatTo flagsArray gradleFlags gradleFlagsArray
command gradle "${flagsArray[@]}" "$@"
}

gradleBuildPhase() {
Expand Down
7 changes: 5 additions & 2 deletions pkgs/development/tools/xcbuild/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ xcbuildBuildPhase() {

runHook preBuild

echo "running xcodebuild"
local flagsArray=()
concatTo flagsArray xcbuildFlags

xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates $xcbuildFlags build
echoCmd 'running xcodebuild' "${flagsArray[@]}"

xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates "${flagsArray[@]}" build

runHook postBuild
}
Expand Down
90 changes: 45 additions & 45 deletions pkgs/kde/frameworks/extra-cmake-modules/ecm-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@ ecmPostHook() {
# Because we need to use absolute paths here, we must set *all* the paths.
# Keep this in sync with https://github.com/KDE/extra-cmake-modules/blob/master/kde-modules/KDEInstallDirs6.cmake
if [ "$(uname)" = "Darwin" ]; then
cmakeFlags+=" -DKDE_INSTALL_BUNDLEDIR=${!outputBin}/Applications/KDE"
appendToVar cmakeFlags "-DKDE_INSTALL_BUNDLEDIR=${!outputBin}/Applications/KDE"
fi

cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin"
cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
appendToVar cmakeFlags "-DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
appendToVar cmakeFlags "-DKDE_INSTALL_BINDIR=${!outputBin}/bin"
appendToVar cmakeFlags "-DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
appendToVar cmakeFlags "-DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
appendToVar cmakeFlags "-DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
appendToVar cmakeFlags "-DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"

if [ -n "${qtPluginPrefix-}" ]; then
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
fi

if [ -n "${qtQmlPrefix-}" ]; then
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
appendToVar cmakeFlags "-DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
fi

cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
cmakeFlags+=" -DKDE_INSTALL_SHAREDSTATEDIR=/com" # ???
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputBin}/share"
cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
cmakeFlags+=" -DKDE_INSTALL_KAPPTEMPLATESDIR=${!outputDev}/share/kdevappwizard/templates"
cmakeFlags+=" -DKDE_INSTALL_KFILETEMPLATESDIR=${!outputDev}/share/kdevfiletemplates/templates"
cmakeFlags+=" -DKDE_INSTALL_KXMLGUIDIR=${!outputBin}/share/kxmlgui5" # Yes, this needs to be 5 and not 6. Don't ask.
cmakeFlags+=" -DKDE_INSTALL_KNOTIFYRCDIR=${!outputBin}/share/knotifications6"
cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
cmakeFlags+=" -DKDE_INSTALL_QTQCHDIR=${!outputLib}/share/doc/qch"
cmakeFlags+=" -DKDE_INSTALL_QCHDIR=${!outputLib}/share/doc/qch"
cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
cmakeFlags+=" -DKDE_INSTALL_LOGGINGCATEGORIESDIR=${!outputLib}/share/qlogging-categories6"
cmakeFlags+=" -DKDE_INSTALL_SYSTEMDUNITDIR=${!outputBin}/lib/systemd"
cmakeFlags+=" -DKDE_INSTALL_SYSTEMDUSERUNITDIR=${!outputBin}/share/systemd/user"
appendToVar cmakeFlags "-DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
appendToVar cmakeFlags "-DKDE_INSTALL_LOCALSTATEDIR=/var"
appendToVar cmakeFlags "-DKDE_INSTALL_SHAREDSTATEDIR=/com" # ???
appendToVar cmakeFlags "-DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
appendToVar cmakeFlags "-DKDE_INSTALL_DATADIR=${!outputBin}/share"
appendToVar cmakeFlags "-DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
appendToVar cmakeFlags "-DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
appendToVar cmakeFlags "-DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
appendToVar cmakeFlags "-DKDE_INSTALL_KAPPTEMPLATESDIR=${!outputDev}/share/kdevappwizard/templates"
appendToVar cmakeFlags "-DKDE_INSTALL_KFILETEMPLATESDIR=${!outputDev}/share/kdevfiletemplates/templates"
appendToVar cmakeFlags "-DKDE_INSTALL_KXMLGUIDIR=${!outputBin}/share/kxmlgui5" # Yes, this needs to be 5 and not 6. Don't ask.
appendToVar cmakeFlags "-DKDE_INSTALL_KNOTIFYRCDIR=${!outputBin}/share/knotifications6"
appendToVar cmakeFlags "-DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
appendToVar cmakeFlags "-DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
appendToVar cmakeFlags "-DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
appendToVar cmakeFlags "-DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
appendToVar cmakeFlags "-DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
appendToVar cmakeFlags "-DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
appendToVar cmakeFlags "-DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
appendToVar cmakeFlags "-DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
appendToVar cmakeFlags "-DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
appendToVar cmakeFlags "-DKDE_INSTALL_QTQCHDIR=${!outputLib}/share/doc/qch"
appendToVar cmakeFlags "-DKDE_INSTALL_QCHDIR=${!outputLib}/share/doc/qch"
appendToVar cmakeFlags "-DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
appendToVar cmakeFlags "-DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
appendToVar cmakeFlags "-DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
appendToVar cmakeFlags "-DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
appendToVar cmakeFlags "-DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
appendToVar cmakeFlags "-DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
appendToVar cmakeFlags "-DKDE_INSTALL_LOGGINGCATEGORIESDIR=${!outputLib}/share/qlogging-categories6"
appendToVar cmakeFlags "-DKDE_INSTALL_SYSTEMDUNITDIR=${!outputBin}/lib/systemd"
appendToVar cmakeFlags "-DKDE_INSTALL_SYSTEMDUSERUNITDIR=${!outputBin}/share/systemd/user"
}
postHooks+=(ecmPostHook)

Expand Down
20 changes: 10 additions & 10 deletions pkgs/os-specific/bsd/freebsd/pkgs/freebsdSetupHook/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
setFreeBSDSrcTop() {
makeFlags="SRCTOP=$BSDSRCDIR $makeFlags"
prependToVar makeFlags "SRCTOP=$BSDSRCDIR"
}

addFreeBSDMakeFlags() {
makeFlags="SBINDIR=${!outputBin}/bin $makeFlags"
makeFlags="LIBEXECDIR=${!outputLib}/libexec $makeFlags"
makeFlags="LIBDATADIR=${!outputLib}/data $makeFlags"
makeFlags="INCLUDEDIR=${!outputDev}/include $makeFlags"
makeFlags="CONFDIR=${!outputBin}/etc $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man/man $makeFlags"
prependToVar makeFlags "SBINDIR=${!outputBin}/bin"
prependToVar makeFlags "LIBEXECDIR=${!outputLib}/libexec"
prependToVar makeFlags "LIBDATADIR=${!outputLib}/data"
prependToVar makeFlags "INCLUDEDIR=${!outputDev}/include"
prependToVar makeFlags "CONFDIR=${!outputBin}/etc"
prependToVar makeFlags "MANDIR=${!outputMan}/share/man/man"

if [ -n "$debug" ]; then
makeFlags="DEBUGFILEDIR=${debug}/lib/debug $makeFlags"
prependToVar makeFlags "DEBUGFILEDIR=${debug}/lib/debug"
else
makeFlags="DEBUGFILEDIR=${out}/lib/debug $makeFlags"
prependToVar makeFlags "DEBUGFILEDIR=${out}/lib/debug"
fi

echo $makeFlags
echoCmd 'FreeBSD makeFlags' "${makeFlags[@]}"
}

postUnpackHooks+=(setFreeBSDSrcTop)
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mkDerivation (
# Makefiles only invoke `$OBJCOPY -x/-X`, so cctools strip works here.
"OBJCOPY=${cctools}/bin/strip"
];
RENAME = "-D";
env.RENAME = "-D";

passthru.tests = {
netbsd-install = install;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
addNetBSDMakeFlags() {
makeFlags="INCSDIR=${!outputDev}/include $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man $makeFlags"
prependToVar makeFlags "INCSDIR=${!outputDev}/include"
prependToVar makeFlags "MANDIR=${!outputMan}/share/man"
}

preConfigureHooks+=(addNetBSDMakeFlags)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
addOpenBSDMakeFlags() {
makeFlags="INCSDIR=${!outputDev}/include $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man $makeFlags"
prependToVar makeFlags "INCSDIR=${!outputDev}/include"
prependToVar makeFlags "MANDIR=${!outputMan}/share/man"
}

fixOpenBSDInstallDirs() {
Expand Down
Loading

0 comments on commit d1d2419

Please sign in to comment.