···1+From 3cc148e878b69fc3e0228f3e3bf1bbe689dad87c Mon Sep 17 00:00:00 2001
2+From: Thomas Tuegel <ttuegel@gmail.com>
3+Date: Fri, 20 Feb 2015 23:17:39 -0600
4+Subject: [PATCH] extra-cmake-modules paths
5+6+---
7+ kde-modules/KDEInstallDirs.cmake | 37 ++++---------------------------------
8+ 1 file changed, 4 insertions(+), 33 deletions(-)
9+10+diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
11+index b7cd34d..2f868ac 100644
12+--- a/kde-modules/KDEInstallDirs.cmake
13++++ b/kde-modules/KDEInstallDirs.cmake
14+@@ -193,37 +193,8 @@
15+ # (To distribute this file outside of extra-cmake-modules, substitute the full
16+ # License text for the above reference.)
17+18+-# Figure out what the default install directory for libraries should be.
19+-# This is based on the logic in GNUInstallDirs, but simplified (the
20+-# GNUInstallDirs code deals with re-configuring, but that is dealt with
21+-# by the _define_* macros in this module).
22++# The default library directory on NixOS is *always* /lib.
23+ set(_LIBDIR_DEFAULT "lib")
24+-# Override this default 'lib' with 'lib64' iff:
25+-# - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling
26+-# - we are NOT on debian
27+-# - we are on a 64 bits system
28+-# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
29+-# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
30+-# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
31+-# See http://wiki.debian.org/Multiarch
32+-if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
33+- AND NOT CMAKE_CROSSCOMPILING)
34+- if (EXISTS "/etc/debian_version") # is this a debian system ?
35+- if(CMAKE_LIBRARY_ARCHITECTURE)
36+- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
37+- endif()
38+- else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
39+- if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
40+- message(AUTHOR_WARNING
41+- "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. "
42+- "Please enable at least one language before including KDEInstallDirs.")
43+- else()
44+- if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
45+- set(_LIBDIR_DEFAULT "lib64")
46+- endif()
47+- endif()
48+- endif()
49+-endif()
50+51+ set(_gnu_install_dirs_vars
52+ BINDIR
53+@@ -445,15 +416,15 @@ if(KDE_INSTALL_USE_QT_SYS_PATHS)
54+ "QtQuick2 imports"
55+ QML_INSTALL_DIR)
56+ else()
57+- _define_relative(QTPLUGINDIR LIBDIR "plugins"
58++ _define_relative(QTPLUGINDIR LIBDIR "qt5/plugins"
59+ "Qt plugins"
60+ QT_PLUGIN_INSTALL_DIR)
61+62+- _define_relative(QTQUICKIMPORTSDIR QTPLUGINDIR "imports"
63++ _define_relative(QTQUICKIMPORTSDIR QTPLUGINDIR "qt5/imports"
64+ "QtQuick1 imports"
65+ IMPORTS_INSTALL_DIR)
66+67+- _define_relative(QMLDIR LIBDIR "qml"
68++ _define_relative(QMLDIR LIBDIR "qt5/qml"
69+ "QtQuick2 imports"
70+ QML_INSTALL_DIR)
71+ endif()
72+--
73+2.3.0
74+
···1+{ kdeFramework, lib, stdenv, cmake, pkgconfig, qttools }:
2+3+kdeFramework {
4+ name = "extra-cmake-modules";
5+ patches = [ ./0001-extra-cmake-modules-paths.patch ];
6+7+ setupHook = ./setup-hook.sh;
8+9+ # It is OK to propagate these inputs as long as
10+ # extra-cmake-modules is never a propagated input
11+ # of some other derivation.
12+ propagatedNativeBuildInputs = [ cmake pkgconfig qttools ];
13+14+ meta = {
15+ license = stdenv.lib.licenses.bsd2;
16+ maintainers = [ lib.maintainers.ttuegel ];
17+ };
18+}
···1+addMimePkg() {
2+ local propagated
3+4+ if [[ -d "$1/share/mime" ]]; then
5+ propagated=
6+ for pkg in $propagatedBuildInputs; do
7+ if [[ "z$pkg" == "z$1" ]]; then
8+ propagated=1
9+ fi
10+ done
11+ if [[ -z $propagated ]]; then
12+ propagatedBuildInputs="$propagatedBuildInputs $1"
13+ fi
14+15+ propagated=
16+ for pkg in $propagatedUserEnvPkgs; do
17+ if [[ "z$pkg" == "z$1" ]]; then
18+ propagated=1
19+ fi
20+ done
21+ if [[ -z $propagated ]]; then
22+ propagatedUserEnvPkgs="$propagatedUserEnvPkgs $1"
23+ fi
24+ fi
25+}
26+27+envHooks+=(addMimePkg)
···1+addServicePkg() {
2+ local propagated
3+ for dir in "share/kservices5" "share/kservicetypes5"; do
4+ if [[ -d "$1/$dir" ]]; then
5+ propagated=
6+ for pkg in $propagatedBuildInputs; do
7+ if [[ "z$pkg" == "z$1" ]]; then
8+ propagated=1
9+ break
10+ fi
11+ done
12+ if [[ -z $propagated ]]; then
13+ propagatedBuildInputs="$propagatedBuildInputs $1"
14+ fi
15+16+ propagated=
17+ for pkg in $propagatedUserEnvPkgs; do
18+ if [[ "z$pkg" == "z$1" ]]; then
19+ propagated=1
20+ break
21+ fi
22+ done
23+ if [[ -z $propagated ]]; then
24+ propagatedUserEnvPkgs="$propagatedUserEnvPkgs $1"
25+ fi
26+27+ break
28+ fi
29+ done
30+}
31+32+envHooks+=(addServicePkg)
33+34+local propagated
35+for pkg in $propagatedBuildInputs; do
36+ if [[ "z$pkg" == "z@out@" ]]; then
37+ propagated=1
38+ break
39+ fi
40+done
41+if [[ -z $propagated ]]; then
42+ propagatedBuildInputs="$propagatedBuildInputs @out@"
43+fi