This commit is contained in:
Rongsong Shen 2025-11-05 16:50:23 +08:00
parent c28b44152f
commit c9b5820d80
3 changed files with 48 additions and 19 deletions

View file

@ -6,19 +6,28 @@
...
}:
stdenv.mkDerivation {
let
pname = "cetcd";
version = "1.0.0";
meta = with lib; {
description = "c binding of etcd client api";
homepage = "https://github.com/shafreeck/cetcd";
license = lib.license.apsl20;
};
in
stdenv.mkDerivation {
pname = pname;
version = version;
src = fetchFromGitHub {
owner = "shen390s";
repo = "cetcd";
rev = "master";
# sha256 = "sha256-9dzSc3w+yxYzsF/rZe3qIarKOpjt2zvIyjuS5FXngIM=";
sha256 = "sha256-BTJXrJyjPp5ynHH5Ct91PFiWATzBal4rsnX84wJ0nCg=";
};
nativeBuildInputs = [
pkgs.make
pkgs.gnumake
pkgs.curl
pkgs.pkg-config
pkgs.yajl
@ -37,4 +46,21 @@ stdenv.mkDerivation {
make install prefix=$out
runHook postInstall
'';
postInstall = ''
mkdir -p $out/lib/pkgconfig
cat >$out/lib/pkgconfig/cetcd.pc <<EOF
prefix=$out
exec_prefix=\''${prefix}
libdir=$out/lib
includedir=\''${prefix}/include
Name: ${pname}
Description: ${meta.description}
Version: ${version}
Libs: -L\''${libdir} -lcetcd
Cflags: -I\''${includedir}
EOF
'';
}

View file

@ -30,23 +30,26 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ pkgs.roswell ];
doCheck = true;
configurePhase = ''
mkdir -p .roswell
cat >.roswell/init.lisp <<EOF
(format nil "Hell,world~%")
;;(push "$src" asdf:*central-registry*)
EOF
'';
buildPhase = ''
set +e
export HOME=/build
env
ros version
set -x
cat .roswell/init.lisp
ros setup
# find /build/.roswell
# echo running
sh -x ros version
find .
mkdir -p $HOME/.roswell
cat >$HOME/.roswell/init.lisp <<EOF
;; (ql:quickload 'asdf-driver)
(let ((cwd (parse-native-namestring (sb-posix:getcwd)
nil
*default-pathname-defaults*
:as-directory t)))
(push cwd
asdf:*central-registry*))
EOF
ros -l $HOME/.roswell/init.lisp build roswell/uem.ros
find /build/source
# ros build $src/roswell/uem.ros
mkdir -p $out
cp .roswell/init.lisp $out
'';
})