diff --git a/pkgs/development/libraries/elementary-cmake-modules/default.nix b/pkgs/development/libraries/elementary-cmake-modules/default.nix new file mode 100644 index 000000000000..5287db756094 --- /dev/null +++ b/pkgs/development/libraries/elementary-cmake-modules/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig }: + +stdenv.mkDerivation { + name = "elementary-cmake-modules"; + + src = fetchFromGitHub { + owner = "elementary"; + repo = "cmake-modules"; + rev = "319ec5336e9f05f3f22b886cc2053ef3d4b6599e"; + sha256 = "191hhvdxyqvh9axzndaqld7vrmv7xkn0czks908zhb2zpjhv9rby"; + }; + + prePatch = '' + substituteInPlace CMakeLists.txt \ + --replace ' ''${CMAKE_ROOT}/Modules' " $out/lib/cmake" + ''; + + propagatedBuildInputs = [ cmake pkgconfig ]; + + setupHook = ./setup-hook.sh; + + meta = with lib; { + platforms = platforms.linux ++ platforms.darwin; + homepage = https://github.com/elementary/cmake-modules; + license = licenses.gpl3Plus; + maintainers = [ maintainers.samdroid-apps ]; + }; +} diff --git a/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh b/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh new file mode 100644 index 000000000000..6408ac471577 --- /dev/null +++ b/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh @@ -0,0 +1,4 @@ +_elementaryCMakeEnvHook() { + cmakeFlagsArray+=(-DCMAKE_MODULE_PATH=@out@/lib/cmake) +} +addEnvHooks "$targetOffset" _elementaryCMakeEnvHook diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b79099c28bdf..46be5b2ab7ca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9117,6 +9117,7 @@ with pkgs; gnome-sharp = callPackage ../development/libraries/gnome-sharp {}; granite = callPackage ../development/libraries/granite { }; + elementary-cmake-modules = callPackage ../development/libraries/elementary-cmake-modules { }; gtk2 = callPackage ../development/libraries/gtk+/2.x.nix { cupsSupport = config.gtk2.cups or stdenv.isLinux;