aboutsummaryrefslogtreecommitdiffhomepage
path: root/debian/rules
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-05 01:29:53 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-11-05 12:32:04 +0300
commit9cce7d263ea3f2984a619cdfcb54d264c6a4c51d (patch)
tree363314a72aa4fc3fda435086c8deb522aef247ec /debian/rules
parent36c7526d60319289954bb0b49e9f4cb2c6dfe9da (diff)
downloadsciteco-9cce7d263ea3f2984a619cdfcb54d264c6a4c51d.tar.gz
fully support relocatable binaries, improving AppImages
* You can now specify `--with-scitecodatadir` as a relative path, that will be interpreted relative to the binary's location. * Win32 binaries already were relocatable, but this was a Windows-specific hack. Win32 binaries are now built with `--with-scitecodatadir=.` since everything is in a single directory. * Ubuntu packages are now also built `--with-scitecodatadir=../share/sciteco`. This is not crucial for ordinary installations, but is meant for AppImage creation. * Since AppImages are now built from relocatable packages, we no longer need the unionfs-workaround from pkg2appimage. This should fix the strange root contents when autocompleting in AppImage builds. * This might also fix the appimage.github.io CI issues. I assume that because I could reproduce the issue on FreeBSD's Linuxulator in dependence of pkg2appimage's "union"-setting. See https://github.com/AppImage/appimage.github.io/pull/3402 * Determining the binary location actually turned out be hard and very platform-dependant. There are now implementations for Windows (which could also read argv[0]), Linux and generic UNIX (which works on FreeBSD, but I am not sure about the others). I believe this could also be useful on Mac OS to create app bundles, but this needs to be tested - currently the Mac OS binaries are installed into fixed locations and don't use relocation.
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules9
1 files changed, 7 insertions, 2 deletions
diff --git a/debian/rules b/debian/rules
index fb1d65e..8b8ad11 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,11 +31,15 @@ endif
build build-arch build-indep: build-curses-stamp build-gtk-stamp;
+# NOTE: The datadir will be relative to the binary location at runtime.
+# This makes the binary relocateable, which is important when creating
+# AppImages from the Debian packages.
build-curses-stamp:
dh_testdir
rm -rf build-curses
dh_auto_configure -Bbuild-curses -- \
- --with-interface=ncurses
+ --with-interface=ncurses \
+ --with-scitecodatadir=../share/sciteco
dh_auto_build -Bbuild-curses
dh_auto_test -Bbuild-curses
touch $@
@@ -47,7 +51,8 @@ build-gtk-stamp:
rm -rf build-gtk
dh_auto_configure -Bbuild-gtk -- \
--program-prefix=g \
- --with-interface=gtk
+ --with-interface=gtk \
+ --with-scitecodatadir=../share/sciteco
# NOTE: Since the Gtk+ version of SciTECO is called during the build,
# we need an XServer which may be missing on the build server.
# That's why we use xvfb.