From f95493221c14fe7a1a4d5978202b5bb95be0f550 Mon Sep 17 00:00:00 2001 From: Peter Bakota Date: Sun, 26 Nov 2023 19:15:03 +0100 Subject: [PATCH] Fixed dependencies --- .gitignore | 1 + Makefile | 7 +++-- fix.sh | 9 ++++++ pgadmin4.json | 82 +++++++++++++++++++++++++-------------------------- startup.sh | 7 +++-- 5 files changed, 60 insertions(+), 46 deletions(-) create mode 100755 fix.sh diff --git a/.gitignore b/.gitignore index 5a7692e..454f8fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.AppImage +*-bak* diff --git a/Makefile b/Makefile index 3a776b7..5b4ae5e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ +APPIMAGE=pgadmin4-8.0-glibc_2.35-x86_64.AppImage all: build build: deb2appimage -j pgadmin4.json -o . --debug - +mount: + ./$(APPIMAGE) --appimage-mount run: - ./pgadmin4-8.0-x86_64.AppImage - + ./$(APPIMAGE) clean: rm -f *.AppImage diff --git a/fix.sh b/fix.sh new file mode 100755 index 0000000..21228fe --- /dev/null +++ b/fix.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +APPDIR=~/.cache/deb2appimage/AppDir + +function relpath() { + python3 -c "import os,sys;print(os.path.relpath(*(sys.argv[1:])))" "$@"; +} + +ln -sf $(relpath $APPDIR/usr/bin/python3.11 $APPDIR/usr/pgadmin4/venv/bin) $APPDIR/usr/pgadmin4/venv/bin/python3 diff --git a/pgadmin4.json b/pgadmin4.json index b82f56d..682315b 100644 --- a/pgadmin4.json +++ b/pgadmin4.json @@ -1,52 +1,52 @@ { - "buildinfo": [ + "buildinfo": [ { - "prerun": [ - "curl -sSL -o ~/.cache/deb2appimage/debs/pgadmin4-desktop_8.0_amd64.deb 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm/dists/pgadmin4/main/binary-amd64/pgadmin4-desktop_8.0_amd64.deb'", - "curl -sSL -o ~/.cache/deb2appimage/debs/pgadmin4-server_8.0_amd64.deb 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm/dists/pgadmin4/main/binary-amd64/pgadmin4-server_8.0_amd64.deb'", - "mkdir -p ~/.cache/deb2appimage/AppDir/usr/bin", - "cp ./startup.sh ~/.cache/deb2appimage/AppDir/usr/bin/pgadmin4.sh" - ], - "name": "pgadmin4", - "version": "8.0", - "deps": "python3.11,libpq5,libgssapi-krb5-2,libatomic1,xdg-utils", - "repoarch": "amd64,amd64,amd64,amd64,all", - "distrorepo": "Debian", - "repoversion": "bookworm", - "binarypath": "/usr/pgadmin4/bin/pgadmin4", - "desktoppath": "/usr/share/applications/pgadmin4.desktop", - "iconpath": "/usr/share/icons/hicolor/256x256/apps/pgadmin4.png", - "usewrapper": "false", - "postrun": [ - null - ] + "prerun": [ + "curl -sSL -o ~/.cache/deb2appimage/debs/pgadmin4-desktop_8.0_amd64.deb 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm/dists/pgadmin4/main/binary-amd64/pgadmin4-desktop_8.0_amd64.deb'", + "curl -sSL -o ~/.cache/deb2appimage/debs/pgadmin4-server_8.0_amd64.deb 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/bookworm/dists/pgadmin4/main/binary-amd64/pgadmin4-server_8.0_amd64.deb'", + "mkdir -p ~/.cache/deb2appimage/AppDir/usr/bin", + "cp ./startup.sh ~/.cache/deb2appimage/AppDir/usr/bin/pgadmin4.sh" + ], + "name": "pgadmin4", + "version": "8.0-glibc_2.35", + "deps": "python3.11,python3.11-minimal,libpython3.11-stdlib,libpython3.11-minimal,libkrb5-3,python3-psycopg2,libpq5,libgssapi-krb5-2,libatomic1,libldap-2.5-0,xdg-utils,libsasl2-2,libkrb5support0", + "repoarch": "amd64,amd64,amd64,amd64,amd64,amd64,amd64,amd64,amd64,amd64,all,amd64,amd64", + "distrorepo": "Debian", + "repoversion": "bookworm", + "binarypath": "/usr/pgadmin4/bin/pgadmin4", + "desktoppath": "/usr/share/applications/pgadmin4.desktop", + "iconpath": "/usr/share/icons/hicolor/256x256/apps/pgadmin4.png", + "usewrapper": "false", + "postrun": [ + "~/work/pgadmin4-appimage/fix.sh" + ] } - ], - "apprunconf": [ + ], + "apprunconf": [ { - "setpath": "true", - "setlibpath": "true", - "setpythonpath": "true", - "setpythonhome": "true", - "setpythondontwritebytecode": "false", - "setxdgdatadirs": "false", - "setperllib": "false", - "setgsettingsschemadir": "false", - "setqtpluginpath": "false", - "exec": "/usr/bin/pgadmin4.sh" + "setpath": "true", + "setlibpath": "true", + "setpythonpath": "false", + "setpythonhome": "false", + "setpythondontwritebytecode": "false", + "setxdgdatadirs": "false", + "setperllib": "false", + "setgsettingsschemadir": "false", + "setqtpluginpath": "false", + "exec": "/usr/bin/pgadmin4.sh" } - ], - "authors": [ + ], + "authors": [ { - "type": "Author", - "author": "pgAdmin contributors", - "url": "https://www.pgadmin.org/" + "type": "Author", + "author": "pgAdmin contributors", + "url": "https://www.pgadmin.org/" }, { - "type": "AppImage Maintainer", - "author": "pbakota", - "url": "https://github.com/pbakota/pgadmin4-appimage" + "type": "AppImage Maintainer", + "author": "pbakota", + "url": "https://github.com/pbakota/pgadmin4-appimage" } - ] + ] } diff --git a/startup.sh b/startup.sh index 66e3a25..e5dc9d7 100755 --- a/startup.sh +++ b/startup.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set +x -PYTHONPATH=$APPDIR/usr/pgadmin4/venv/lib/python3.11 $APPDIR/usr/pgadmin4/bin/pgadmin4 +export PYTHONHOME=$APPDIR/usr +export PYTHONPATH=$APPDIR/usr/python3.11 +export LD_LIBRARY_PATH=$APPDIR/usr/lib/x86_64-linux-gnu +$APPDIR/usr/pgadmin4/bin/pgadmin4 exit 0