Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: rpc-autogen: module for haskell bindings #1407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions recipes-openxt/dbus-gen-bindings/rpc-autogen_0.1.0.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SUMMARY = "Generated Haskell DBus bindings used by OpenXT components."

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

SECTION = "devel"

DEPENDS = " \
libxch-rpc \
"

SRCREV = "${AUTOREV}"
SRC_URI = "git://github.com/eric-ch/dbus-gen-bindings.git;protocol=https;branch=master"

S = "${WORKDIR}/git/haskell"

inherit haskell
12 changes: 2 additions & 10 deletions recipes-openxt/manager/rpc-proxy_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DEPENDS += " \
hkg-lifted-base \
hkg-monad-control \
hkg-errors \
rpc-autogen \
"
RDEPENDS_${PN} += "glibc-gconv-utf-32 bash"

Expand All @@ -36,20 +37,11 @@ S = "${WORKDIR}/git/rpc-proxy"

HPV = "1.0"
require recipes-openxt/xclibs/xclibs-haskell.inc
inherit update-rc.d haskell xc-rpcgen
inherit update-rc.d haskell

INITSCRIPT_NAME = "rpc-proxy"
INITSCRIPT_PARAMS = "defaults 30"

# ToDo: move xc-rpcgen into compile?

do_configure_append() {
# generate rpc stubs
mkdir -p Rpc/Autogen
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -s -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/rpc_proxy.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/dbus.xml
}

do_install_append() {
install -m 0755 -d ${D}/etc
install -m 0755 -d ${D}/etc/init.d
Expand Down
15 changes: 2 additions & 13 deletions recipes-openxt/manager/updatemgr_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DEPENDS = " \
hkg-monad-control \
hkg-transformers-base \
hkg-monad-loops \
rpc-autogen \
"
RDEPENDS_${PN} += " \
glibc-gconv-utf-32 \
Expand All @@ -37,24 +38,12 @@ SRC_URI += " \

S = "${WORKDIR}/git/updatemgr"

inherit update-rc.d haskell xc-rpcgen
inherit update-rc.d haskell

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "updatemgr"
INITSCRIPT_PARAMS_${PN} = "defaults 80"

do_configure_append() {
# generate rpc stubs
mkdir -p ${S}/Rpc/Autogen
# Server objects
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -s -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/updatemgr.xml
# Client objects
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/db.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/xenmgr.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/xenmgr_vm.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/xenmgr_host.xml
}

do_install_append() {
install -m 0755 -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/updatemgr.initscript ${D}${sysconfdir}/init.d/updatemgr
Expand Down
21 changes: 2 additions & 19 deletions recipes-openxt/manager/xenmgr_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DEPENDS = " \
hkg-mtl \
hkg-split \
xenmgr-data \
rpc-autogen \
"

require manager.inc
Expand All @@ -34,25 +35,7 @@ SRC_URI += " \

S = "${WORKDIR}/git/xenmgr"

inherit haskell update-rc.d xc-rpcgen

do_configure_append() {
# generate rpc stubs
mkdir -p Rpc/Autogen
# Server objects
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -s -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/xenmgr.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -s -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/xenmgr_vm.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -s -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/xenmgr_host.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -s -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/vm_nic.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -s -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/vm_disk.xml"

xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/input_daemon.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/guest.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/dbus.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/network_daemon.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/network.xml"
xc-rpcgen --haskell --templates-dir="${STAGING_RPCGENDATADIR_NATIVE}" -c -o "Rpc/Autogen" --module-prefix="Rpc.Autogen" "${STAGING_IDLDATADIR}/ctxusb_daemon.xml"
}
inherit haskell update-rc.d

do_install_append() {
install -m 0755 ${S}/setup-ica-vm ${D}${bindir}/setup-ica-vm
Expand Down
24 changes: 2 additions & 22 deletions recipes-openxt/network/xenclient-nwd_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,21 @@ DEPENDS = " \
hkg-network \
libxchdb \
libxchxenstore \
rpc-autogen \
"

require network.inc

S = "${WORKDIR}/git/nwd"

inherit haskell update-rc.d xc-rpcgen
inherit haskell update-rc.d

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "network-daemon"
INITSCRIPT_PARAMS_${PN} = "defaults 28 15"

FILES_${PN} += "/usr/bin/network-daemon"

do_configure_append() {
# generate rpc stubs
mkdir -p ${S}/Rpc/Autogen

# Server objects
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_daemon.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_domain.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_nm.xml

# Client objects
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_slave.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_nm.xml

xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/dbus.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/xenmgr.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/xenmgr_vm.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/vm_nic.xml
}

do_install_append() {
install -m 0755 -d ${D}${sysconfdir}/init.d
install -m 0755 ${S}/nwd.initscript ${D}${sysconfdir}/init.d/network-daemon
Expand Down
24 changes: 2 additions & 22 deletions recipes-openxt/network/xenclient-nws_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEPENDS = " \
hkg-text \
hkg-mtl \
hkg-network \
rpc-autogen \
"
RDEPENDS_${PN} += " \
glibc-gconv-utf-32 \
Expand All @@ -23,35 +24,14 @@ require network.inc

S = "${WORKDIR}/git/nws"

inherit haskell update-rc.d xc-rpcgen
inherit haskell update-rc.d

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "network-slave"
INITSCRIPT_PARAMS_${PN} = "defaults 29 15"

FILES_${PN} += "/usr/bin/network-slave"

do_configure_append() {
# generate rpc stubs
mkdir -p ${S}/Rpc/Autogen

# Server objects
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_slave.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network.xml
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --server -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/network_nm.xml

# NetworkManager objects (stored in the network-manager specific directory)
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.xml -n NmManager
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.Device.xml -n NmDevice
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.Device.Wired.xml -n NmDeviceEthernet
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.Device.Wireless.xml -n NmDeviceWifi
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.Device.Modem.xml -n NmDeviceModem
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.AccessPoint.xml -n NmAccessPoint
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} --client -o ${S}/Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_NMIDLDATADIR}/org.freedesktop.NetworkManager.Connection.Active.xml -n NmActiveConnection

xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/dbus.xml
}

do_install_append() {
install -m 0755 -d ${D}${sysconfdir}/network-daemon
install -m 0755 ${S}/dnsmasq-template ${D}${sysconfdir}/network-daemon/dnsmasq-template
Expand Down
8 changes: 1 addition & 7 deletions recipes-openxt/xclibs/libxchdb_git.bb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DESCRIPTION = "helps accessing db daemon"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://../COPYING;md5=321bf41f280cf805086dd5a720b37785"
DEPENDS += "libxch-rpc xenclient-rpcgen-native xenclient-idl hkg-mtl hkg-text hkg-json libxchutils"
DEPENDS += "libxch-rpc xenclient-rpcgen-native xenclient-idl hkg-mtl hkg-text hkg-json libxchutils rpc-autogen"
RDEPENDS_${PN} += "glibc-gconv-utf-32"

require xclibs.inc
Expand All @@ -12,9 +12,3 @@ HPN = "xchdb"
HPV = "0.1"

require xclibs-haskell.inc
inherit xc-rpcgen

do_configure_append() {
mkdir -p Rpc/Autogen
xc-rpcgen --haskell --templates-dir=${STAGING_RPCGENDATADIR_NATIVE} -c -o Rpc/Autogen --module-prefix=Rpc.Autogen ${STAGING_IDLDATADIR}/db.xml
}