about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules')
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/series1
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh54
4 files changed, 114 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
new file mode 100644
index 000000000000..654eb94b51ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
@@ -0,0 +1,20 @@
+{ mkDerivation, lib, copyPathsToStore, cmake, pkgconfig }:
+
+mkDerivation {
+  name = "extra-cmake-modules";
+
+  patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
+
+  outputs = [ "out" ];  # this package has no runtime components
+
+  propagatedBuildInputs = [ cmake pkgconfig ];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
+    platforms = platforms.linux ++ platforms.darwin;
+    homepage = http://www.kde.org;
+    license = licenses.bsd2;
+    maintainers = [ maintainers.ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
new file mode 100644
index 000000000000..66f10f4abc1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
@@ -0,0 +1,39 @@
+diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
+index 52b2eb2..a04596c 100644
+--- a/kde-modules/KDEInstallDirs.cmake
++++ b/kde-modules/KDEInstallDirs.cmake
+@@ -232,34 +232,6 @@
+ # GNUInstallDirs code deals with re-configuring, but that is dealt with
+ # by the _define_* macros in this module).
+ set(_LIBDIR_DEFAULT "lib")
+-# Override this default 'lib' with 'lib64' iff:
+-#  - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling
+-#  - we are NOT on debian
+-#  - we are NOT on flatpak
+-#  - we are on a 64 bits system
+-# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
+-# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
+-# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
+-# See http://wiki.debian.org/Multiarch
+-if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
+-   AND NOT CMAKE_CROSSCOMPILING
+-   AND NOT DEFINED ENV{FLATPAK_ID})
+-  if (EXISTS "/etc/debian_version") # is this a debian system ?
+-    if(CMAKE_LIBRARY_ARCHITECTURE)
+-      set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+-    endif()
+-  else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
+-    if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
+-      message(AUTHOR_WARNING
+-        "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. "
+-        "Please enable at least one language before including KDEInstallDirs.")
+-    else()
+-      if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+-        set(_LIBDIR_DEFAULT "lib64")
+-      endif()
+-    endif()
+-  endif()
+-endif()
+ 
+ set(_gnu_install_dirs_vars
+     BINDIR
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/series b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/series
new file mode 100644
index 000000000000..b4569e50a5f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/series
@@ -0,0 +1 @@
+nix-lib-path.patch
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
new file mode 100644
index 000000000000..88091e78a0cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
@@ -0,0 +1,54 @@
+_ecmEnvHook() {
+    addToSearchPath XDG_DATA_DIRS "$1/share"
+    addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
+}
+addEnvHooks "$targetOffset" _ecmEnvHook
+
+_ecmPreConfigureHook() {
+    # 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}/lib/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"
+
+    if [ -n "$qtPluginPrefix" ]; then
+        cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
+        cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
+    fi
+
+    if [ -n "$qtQmlPrefix" ]; then
+        cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
+    fi
+}
+preConfigureHooks+=(_ecmPreConfigureHook)