kee

Offline IOU signer with QR as transport
git clone git://holbrook.no/kee-gtk4.git
Info | Log | Files | Refs | README | LICENSE

README.qemu.adoc (3137B)


      1 Build kee in qemu debian vm
      2 ===========================
      3 
      4 Instructions to run kee-gtk4 using qemu and Debian Bookworm (v12) network installer.
      5 
      6 Consider these instructions work in progress.
      7 
      8 First install qemu 
      9 
     10 -----
     11 
     12 # make disk image for the OS installation
     13 qemu-img create -f raw debian_12_kee.img 11G
     14 
     15 # run and complete the debian OS installer
     16 # from package choices, choose:
     17 # * gnome desktop
     18 # * ssh server
     19 # * standard system utilities
     20 # install the grub bootloader to the primary drive
     21 qemu-system-x86_64 --enable-kvm -m 2G --cdrom=/path/to/debian-12.5.0-amd64-netinst.iso --hda debian_12_kee.img
     22 
     23 -----
     24 
     25 After reboot, run again with out netinst image:
     26 
     27 -----
     28 
     29 qemu-system-x86_64 --enable-kvm -m 2G --hda debian_12_kee.img -net user,hostfwd=tcp::10022-:22 -net nic,model=rtl8139
     30 
     31 -----
     32 
     33 You can now ssh into the VM using local port 10022.
     34 
     35 Install packages
     36 ----------------
     37 
     38 Below are lists of debian packages required and recommended for working with the project.
     39 
     40 Installing all packages requires around 8.5GB.
     41 
     42 -----
     43 
     44 # build kee
     45 make
     46 gcc
     47 pkg-config
     48 libgtk-4-1
     49 libgtk-4-dev
     50 libgstreamer-plugins-bad1.0-dev
     51 libgstreamer1.0-dev
     52 libb64-dev
     53 libgcrypt-dev
     54 libqrencode-dev
     55 libxdg-basedir-dev
     56 liblmdb-dev
     57 libldap-dev
     58 libzbar-dev
     59 zlib1g-dev
     60 libtasn1-6-dev
     61 libxml2-utils
     62 
     63 ## execute kee tests and make testdata 
     64 python3
     65 python3-venv
     66 python3-dev
     67 
     68 ## build docs
     69 pandoc
     70 
     71 ## build the libcmime dependency
     72 cmake
     73 g++
     74 flex
     75 bison
     76 
     77 ## recommended for poking around
     78 bsdextrautils
     79 lmdb-utils
     80 
     81 -----
     82 
     83 
     84 Prepare environment
     85 -------------------
     86 
     87 First build libcmime
     88 
     89 -----
     90 
     91 mkdir src
     92 cd src
     93 git clone git://holbrook.no/kee-gtk4
     94 git clone -b 0.2.2 git://holbrook.no/ext/c/libcmime
     95 cd libcmime
     96 mkdir build
     97 cd build
     98 cmake ..
     99 make install DESTDIR=$(realpath .)
    100 
    101 -----
    102 
    103 Then the main attraction.
    104 
    105 -----
    106 
    107 cd ../kee-gtk4
    108 # needed for generation of test data
    109 python3 -m venv .venv
    110 source .venv/bin/activate
    111 pip install -r requirements.txt
    112 
    113 -----
    114 
    115 Some environment hacks are needed.
    116 
    117 * include the libcime in the non-standard location.
    118 * find shared libraries in src/aux at runtime.
    119 * enable the application to run with test data.
    120 
    121 The following takes care of that:
    122 
    123 (it can be saved to a file `env.sh` and which can be run with `source` in the terminal before compiling and/or running.
    124 
    125 -----
    126 
    127 #!/bin/bash
    128 
    129 cmime_path=$(realpath ../libcmime/build)
    130 root_path=$(realpath .)
    131 
    132 export PKG_CONFIG_PATH=${cmime_path}/usr/local/lib/pkgconfig:${root_path}
    133 export LIBRARY_PATH=${cmime_path}/usr/local/lib
    134 export LD_LIBRARY_PATH=${cmime_path}/usr/local/lib:${root_path}/src/aux/lib
    135 export C_INCLUDE_PATH=${cmime_path}/usr/local/include
    136 export CFLAGS="-g3 -DBEAMENU_N_EXITS=3 -DBEAMENU_N_DST=6 -DRERR"
    137 export KEE_PATH=${root_path}/testdata
    138 
    139 -----
    140 
    141 Make and verify code as such:
    142 
    143 -----
    144 
    145 # bug makes you have to build twice, fails first time
    146 make gtk
    147 make gtk
    148 
    149 make test_src
    150 
    151 -----
    152 
    153 You need the GNOME desktop environment to run the application itself.
    154 
    155 That means the follwing cannot be run in terminal / `ssh`.
    156 
    157 -----
    158 
    159 # check if everything is all right.
    160 # ...twice, first time fails
    161 make test_gtk
    162 make test_gtk
    163 
    164 # run the application - with logging
    165 make debug
    166 
    167 -----