2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-15 22:18:51 +00:00
|
|
|
, fetchgit
|
|
|
|
, wrapLisp
|
2021-12-06 16:07:01 +00:00
|
|
|
, sbcl
|
2021-01-15 22:18:51 +00:00
|
|
|
, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clpm";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.4.1";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://gitlab.common-lisp.net/clpm/clpm";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-UhaLmbdsIPj6O+s262HUMxuz/5t43JR+TlOjq8Y2CDs=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
(wrapLisp sbcl)
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-01-15 22:18:51 +00:00
|
|
|
openssl
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
# patch cl-plus-ssl to ensure that it finds libssl and libcrypto
|
|
|
|
sed 's|libssl.so|${openssl.out}/lib/libssl.so|' -i ext/cl-plus-ssl/src/reload.lisp
|
|
|
|
sed 's|libcrypto.so|${openssl.out}/lib/libcrypto.so|' -i ext/cl-plus-ssl/src/reload.lisp
|
|
|
|
# patch dexador to avoid error due to dexador being loaded multiple times
|
|
|
|
sed -i 's/defpackage/uiop:define-package/g' ext/dexador/src/dexador.lisp
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildPhase = ''
|
2021-02-17 17:02:09 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# exporting home to avoid using /homeless-shelter/.cache/ as this will cause
|
|
|
|
# ld to complaing about `impure path used in link`.
|
|
|
|
export HOME=$TMP
|
|
|
|
|
|
|
|
common-lisp.sh --script scripts/build-release.lisp
|
2021-02-17 17:02:09 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-17 17:02:09 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
cd build/release-staging/dynamic/clpm-${version}*/
|
|
|
|
INSTALL_ROOT=$out/ bash install.sh
|
2021-02-17 17:02:09 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# fixupPhase results in fatal error in SBCL, `Can't find sbcl.core`
|
|
|
|
dontFixup = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Common Lisp Package Manager";
|
|
|
|
homepage = "https://www.clpm.dev/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.petterstorvik ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
}
|