Merge pull request #181731 from ken-matsui/fix-cpm2

cpm: download from GitHub releases instead of GitHub source code
This commit is contained in:
Anderson Torres 2022-07-24 12:33:00 -03:00 committed by GitHub
commit a165c1536c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,28 +1,25 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, fetchurl
}:
stdenvNoCC.mkDerivation rec {
pname = "cpm";
version = "0.35.1";
src = fetchFromGitHub {
owner = "cpm-cmake";
repo = "CPM.cmake";
rev = "v${version}";
hash = "sha256-Oon/5iwkUUASsUDvde69iEwLe8/CAzwYKYsyzH5K+V0=";
src = fetchurl {
url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v${version}/CPM.cmake";
sha256 = "sha256-CMge+NpJRU+G+c+s0tb2EN8UG6E8FE90lIvcULggYXY=";
};
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p ${placeholder "out"}/share/cpm/
cp ./cmake/CPM.cmake ${placeholder "out"}/share/cpm/
install -Dm644 $src $out/share/cpm/CPM.cmake
runHook postInstall
'';