kiss-flatpak

Flatpak for KISS Linux.
git clone https://git.stjo.hn/kiss-flatpak
Log | Files | Refs | README | LICENSE

build (2475B)


      1 #!/bin/sh -e
      2 
      3 for patch in *.patch; do
      4     patch -p1 < "$patch"
      5 done
      6 
      7 # Remove libcap dependency (used solely when bwrap is suid
      8 # root). User namespaces are much better, should be used
      9 # in place of libcap and are free.
     10 sed -e 's/as_fn_error.*libcap/: "/g' \
     11 	-e 's/as_fn_error.*capability\.h/: "/g' \
     12 	configure > _
     13 mv -f _ configure
     14 
     15 # Remove fuse2 dependency (used solely with root "system-helper"
     16 # daemon for file transfer. Unneeded in our case and drops the
     17 # old fuse version.
     18 sed 's/as_fn_error.*fuse/: "/g' configure > _
     19 mv -f _ configure
     20 
     21 # The build keeps failing because it's looking for /usr/local/include
     22 # and I just can't figure out where it's getting that path.
     23 # In lieu of the right config option, we can just not throw an error
     24 # if an include directory is missing.
     25 sed '/-Werror=missing-include-dirs/d' configure > _
     26 mv -f _ configure
     27 
     28 chmod +x configure
     29 
     30 # Turn the fuse2 filesystem into a C program which does nothing.
     31 # This is the easiest way to "turn off" revokefs as there's
     32 # no official support for doing so.
     33 cat <<EOF > revokefs/main.c
     34 int main() { return 0; }
     35 EOF
     36 : > revokefs/writer.c
     37 
     38 # Install python-pyparsing which is solely needed for
     39 # flatpak and thus contained in this build.
     40 {
     41     cd pyparsing
     42 
     43     python3 setup.py build
     44     python3 setup.py install \
     45         --prefix=/usr \
     46         --root="$PWD/dist"
     47 
     48     # Use a glob to avoid having to figure out the Python
     49     # version for the path below.
     50     cd dist/usr/lib/python*/site-packages
     51 
     52     # Set the PYTHONPATH so python knows where to find mako.
     53     # The one liner simply appends the existing path and
     54     # handles the case where an unset PYTHONPATH breaks
     55     # python as it will only contain our new addition.
     56     PYTHONPATH=$PWD:$(python -c "import sys; print(':'.join(sys.path))")
     57 
     58     cd -; cd ..
     59 }
     60 
     61 export PYTHONPATH
     62 
     63 ./configure \
     64     --prefix=/usr \
     65     --sysconfdir=/etc \
     66     --without-systemd \
     67     --disable-system-helper \
     68     --disable-nls \
     69     --disable-seccomp \
     70     --disable-sandboxed-triggers \
     71     --disable-documentation \
     72     --disable-introspection \
     73     --with-priv-mode=none \
     74     --disable-xauth \
     75     --without-system-dbus-proxy
     76 
     77 make
     78 make DESTDIR="$1" install
     79 
     80 # Remove dbus/systemd/libraries (unneeded stuff).
     81 # This is a dumb warning which appears only when /usr/share does.
     82 # shellcheck disable=2115
     83 {
     84     rm -rf "$1/etc"
     85     rm -rf "$1/usr/share"
     86     rm -rf "$1/usr/lib"
     87     rm -rf "$1/usr/include"
     88     rm  -f "$1/usr/libexec/revokefs-fuse"
     89 }