Skip to content
Snippets Groups Projects
Unverified Commit 56c32a95 authored by akiraohgaki's avatar akiraohgaki Committed by GitHub
Browse files

Merge pull request #63 from opendesktop/develop

Develop
parents b54fbd74 0523a0de
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 377 deletions
*.pro.user *.pro.user
build_*/ build_*/
lib/qtlib/ lib/qtil/
...@@ -6,6 +6,7 @@ services: ...@@ -6,6 +6,7 @@ services:
branches: branches:
only: only:
- master - master
- /^release\-.+/
script: script:
- mntdir='/mnt/ocs-url' - mntdir='/mnt/ocs-url'
...@@ -14,5 +15,6 @@ script: ...@@ -14,5 +15,6 @@ script:
- docker run --rm -v $(pwd):${mntdir} opensuse:42.1 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh opensuse" - docker run --rm -v $(pwd):${mntdir} opensuse:42.1 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh opensuse"
- docker run --rm -v $(pwd):${mntdir} base/archlinux:latest /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh archlinux" - docker run --rm -v $(pwd):${mntdir} base/archlinux:latest /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh archlinux"
#- docker run --rm -v $(pwd):${mntdir} ubuntu:16.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh snap" #- docker run --rm -v $(pwd):${mntdir} ubuntu:16.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh snap"
#- docker run --rm -v $(pwd):${mntdir} --cap-add SYS_ADMIN --device /dev/fuse ubuntu:14.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh appimage" #- docker run --rm -v $(pwd):${mntdir} ubuntu:16.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh flatpak"
#- docker run --rm -v $(pwd):${mntdir} ubuntu:14.04 /bin/bash -c "sh ${mntdir}/scripts/build-docker.sh appimage"
- cat transfer.log - cat transfer.log
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
An install helper program for items served on OpenCollaborationServices (OCS). An install helper program for items served on OpenCollaborationServices (OCS).
Copyright: 2016-2017, Opendesktop.org Copyright: 2016-2018, Opendesktop.org
License: GPL-3+ License: GPL-3+
......
{ {
"bin": { "bin": {
"name": "Softwares", "name": "Software",
"destination": "$HOME/.local/bin", "destination": "$HOME/.local/bin",
"generic_destination": "$APP_DATA/bin" "generic_destination": "$APP_DATA/bin"
}, },
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
#include <QStringList> #include <QStringList>
#include <QStandardPaths> #include <QStandardPaths>
#include "qtlib_dir.h" #include "qtil_dir.h"
ConfigHandler::ConfigHandler(QObject *parent) ConfigHandler::ConfigHandler(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
appConfig_ = qtlib::Config(":/configs"); appConfig_ = qtil::Config(":/configs");
importAppConfigApplication(); importAppConfigApplication();
importAppConfigInstallTypes(); importAppConfigInstallTypes();
} }
...@@ -55,7 +55,7 @@ QString ConfigHandler::convertPathString(const QString &path) const ...@@ -55,7 +55,7 @@ QString ConfigHandler::convertPathString(const QString &path) const
{ {
auto newPath = path; auto newPath = path;
if (newPath.contains("$HOME")) { if (newPath.contains("$HOME")) {
newPath.replace("$HOME", qtlib::Dir::homePath()); newPath.replace("$HOME", qtil::Dir::homePath());
} }
else if (newPath.contains("$XDG_DOCUMENTS_DIR")) { else if (newPath.contains("$XDG_DOCUMENTS_DIR")) {
newPath.replace("$XDG_DOCUMENTS_DIR", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)); newPath.replace("$XDG_DOCUMENTS_DIR", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
...@@ -73,13 +73,13 @@ QString ConfigHandler::convertPathString(const QString &path) const ...@@ -73,13 +73,13 @@ QString ConfigHandler::convertPathString(const QString &path) const
newPath.replace("$XDG_VIDEOS_DIR", QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)); newPath.replace("$XDG_VIDEOS_DIR", QStandardPaths::writableLocation(QStandardPaths::MoviesLocation));
} }
else if (newPath.contains("$XDG_DATA_HOME")) { else if (newPath.contains("$XDG_DATA_HOME")) {
newPath.replace("$XDG_DATA_HOME", qtlib::Dir::genericDataPath()); newPath.replace("$XDG_DATA_HOME", qtil::Dir::genericDataPath());
} }
else if (newPath.contains("$KDEHOME")) { else if (newPath.contains("$KDEHOME")) {
newPath.replace("$KDEHOME", qtlib::Dir::kdehomePath()); newPath.replace("$KDEHOME", qtil::Dir::kdehomePath());
} }
else if (newPath.contains("$APP_DATA")) { else if (newPath.contains("$APP_DATA")) {
newPath.replace("$APP_DATA", qtlib::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString()); newPath.replace("$APP_DATA", qtil::Dir::genericDataPath() + "/" + getAppConfigApplication()["id"].toString());
} }
return newPath; return newPath;
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <QObject> #include <QObject>
#include <QJsonObject> #include <QJsonObject>
#include "qtlib_config.h" #include "qtil_config.h"
class ConfigHandler : public QObject class ConfigHandler : public QObject
{ {
...@@ -21,7 +21,7 @@ private: ...@@ -21,7 +21,7 @@ private:
void importAppConfigInstallTypes(); void importAppConfigInstallTypes();
QString convertPathString(const QString &path) const; QString convertPathString(const QString &path) const;
qtlib::Config appConfig_; qtil::Config appConfig_;
QJsonObject appConfigApplication_; QJsonObject appConfigApplication_;
QJsonObject appConfigInstallTypes_; QJsonObject appConfigInstallTypes_;
}; };
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#include <QUrlQuery> #include <QUrlQuery>
#include <QDesktopServices> #include <QDesktopServices>
#include "qtlib_file.h" #include "qtil_file.h"
#include "qtlib_dir.h" #include "qtil_dir.h"
#include "qtlib_networkresource.h" #include "qtil_networkresource.h"
#include "qtlib_package.h" #include "qtil_package.h"
#include "handlers/confighandler.h" #include "handlers/confighandler.h"
...@@ -40,9 +40,9 @@ void OcsUrlHandler::process() ...@@ -40,9 +40,9 @@ void OcsUrlHandler::process()
} }
auto url = metadata_["url"].toString(); auto url = metadata_["url"].toString();
auto *resource = new qtlib::NetworkResource(url, QUrl(url), true, this); auto *resource = new qtil::NetworkResource(url, QUrl(url), true, this);
connect(resource, &qtlib::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress); connect(resource, &qtil::NetworkResource::downloadProgress, this, &OcsUrlHandler::downloadProgress);
connect(resource, &qtlib::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished); connect(resource, &qtil::NetworkResource::finished, this, &OcsUrlHandler::networkResourceFinished);
resource->get(); resource->get();
emit started(); emit started();
} }
...@@ -72,7 +72,7 @@ void OcsUrlHandler::openDestination() const ...@@ -72,7 +72,7 @@ void OcsUrlHandler::openDestination() const
QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString())); QDesktopServices::openUrl(QUrl("file://" + configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()));
} }
void OcsUrlHandler::networkResourceFinished(qtlib::NetworkResource *resource) void OcsUrlHandler::networkResourceFinished(qtil::NetworkResource *resource)
{ {
if (!resource->isFinishedWithNoError()) { if (!resource->isFinishedWithNoError()) {
QJsonObject result; QJsonObject result;
...@@ -127,14 +127,14 @@ void OcsUrlHandler::parse() ...@@ -127,14 +127,14 @@ void OcsUrlHandler::parse()
} }
} }
void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource) void OcsUrlHandler::saveDownloadedFile(qtil::NetworkResource *resource)
{ {
QJsonObject result; QJsonObject result;
auto type = metadata_["type"].toString(); auto type = metadata_["type"].toString();
qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()); qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
destDir.make(); destDir.make();
qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString()); qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
if (!resource->saveData(destFile.path())) { if (!resource->saveData(destFile.path())) {
result["status"] = QString("error_save"); result["status"] = QString("error_save");
...@@ -151,11 +151,11 @@ void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource) ...@@ -151,11 +151,11 @@ void OcsUrlHandler::saveDownloadedFile(qtlib::NetworkResource *resource)
resource->deleteLater(); resource->deleteLater();
} }
void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource) void OcsUrlHandler::installDownloadedFile(qtil::NetworkResource *resource)
{ {
QJsonObject result; QJsonObject result;
qtlib::File tempFile(qtlib::Dir::tempPath() + "/" + metadata_["filename"].toString()); qtil::File tempFile(qtil::Dir::tempPath() + "/" + metadata_["filename"].toString());
if (!resource->saveData(tempFile.path())) { if (!resource->saveData(tempFile.path())) {
result["status"] = QString("error_save"); result["status"] = QString("error_save");
...@@ -165,11 +165,11 @@ void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource) ...@@ -165,11 +165,11 @@ void OcsUrlHandler::installDownloadedFile(qtlib::NetworkResource *resource)
return; return;
} }
qtlib::Package package(tempFile.path()); qtil::Package package(tempFile.path());
auto type = metadata_["type"].toString(); auto type = metadata_["type"].toString();
qtlib::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString()); qtil::Dir destDir(configHandler_->getAppConfigInstallTypes()[type].toObject()["destination"].toString());
destDir.make(); destDir.make();
qtlib::File destFile(destDir.path() + "/" + metadata_["filename"].toString()); qtil::File destFile(destDir.path() + "/" + metadata_["filename"].toString());
if (type == "bin" if (type == "bin"
&& package.installAsProgram(destFile.path())) { && package.installAsProgram(destFile.path())) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <QObject> #include <QObject>
#include <QJsonObject> #include <QJsonObject>
namespace qtlib { namespace qtil {
class NetworkResource; class NetworkResource;
} }
...@@ -31,12 +31,12 @@ public slots: ...@@ -31,12 +31,12 @@ public slots:
void openDestination() const; void openDestination() const;
private slots: private slots:
void networkResourceFinished(qtlib::NetworkResource *resource); void networkResourceFinished(qtil::NetworkResource *resource);
private: private:
void parse(); void parse();
void saveDownloadedFile(qtlib::NetworkResource *resource); void saveDownloadedFile(qtil::NetworkResource *resource);
void installDownloadedFile(qtlib::NetworkResource *resource); void installDownloadedFile(qtil::NetworkResource *resource);
QString ocsUrl_; QString ocsUrl_;
ConfigHandler *configHandler_; ConfigHandler *configHandler_;
......
include($${PWD}/qtlib/qtlib.pri) include($${PWD}/qtil/qtil.pri)
message("Please execute scripts/import.sh for build dependencies")
TARGET = ocs-url TARGET = ocs-url
TEMPLATE = app TEMPLATE = app
......
#!/bin/bash
# The purpose of this script is to provide lightweight desktop integration
# into the host system without special help from the host system.
# If you want to have fuller and automatic desktop integration, you might
# consider to use the optional appimaged daemon instead.
# Exit on errors
set -e
# Be verbose if $DEBUG=1 is set
if [ ! -z "$DEBUG" ] ; then
env
set -x
fi
THIS="$0"
args=("$@") # http://stackoverflow.com/questions/3190818/
NUMBER_OF_ARGS="$#"
# Please do not change $VENDORPREFIX as it will allow for desktop files
# belonging to AppImages to be recognized by future AppImageKit components
# such as desktop integration daemons
VENDORPREFIX=appimagekit
APPDIR="$(dirname "$(readlink -f "${THIS}")")"
BIN="${APPDIR}/ocs-url"
export PATH="${APPDIR}/usr/bin:$PATH"
trap atexit EXIT
# Note that the following handles 0, 1 or more arguments (file paths)
# which can include blanks but uses a bashism; can the same be achieved
# in POSIX-shell? (FIXME)
# http://stackoverflow.com/questions/3190818
atexit()
{
if [ $NUMBER_OF_ARGS -eq 0 ] ; then
exec "${BIN}"
else
exec "${BIN}" "${args[@]}"
fi
}
error()
{
if [ -x /usr/bin/zenity ] ; then
LD_LIBRARY_PATH="" zenity --error --text "${1}" 2>/dev/null
elif [ -x /usr/bin/kdialog ] ; then
LD_LIBRARY_PATH="" kdialog --msgbox "${1}" 2>/dev/null
elif [ -x /usr/bin/Xdialog ] ; then
LD_LIBRARY_PATH="" Xdialog --msgbox "${1}" 2>/dev/null
else
echo "${1}"
fi
exit 1
}
yesno()
{
TITLE=$1
TEXT=$2
if [ -x /usr/bin/zenity ] ; then
LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2>/dev/null || exit 0
elif [ -x /usr/bin/kdialog ] ; then
LD_LIBRARY_PATH="" kdialog --caption "" --title "$TITLE" -yesno "$TEXT" || exit 0
elif [ -x /usr/bin/Xdialog ] ; then
LD_LIBRARY_PATH="" Xdialog --title "$TITLE" --clear --yesno "$TEXT" 10 80 || exit 0
else
echo "zenity, kdialog, Xdialog missing. Skipping ${THIS}."
exit 0
fi
}
check_prevent()
{
FILE=$1
if [ -e "$FILE" ] ; then
exit 0
fi
}
# Exit immediately of one of these files is present
# (e.g., because the desktop environment wants to handle desktop integration itself)
check_prevent "$HOME/.local/share/$VENDORPREFIX/no_desktopintegration"
check_prevent "/usr/share/$VENDORPREFIX/no_desktopintegration"
check_prevent "/etc/$VENDORPREFIX/no_desktopintegration"
# Exit immediately if appimaged is running
pidof appimaged 2>/dev/null && exit 0
# Exit immediately if $DESKTOPINTEGRATION is not empty
if [ ! -z "$DESKTOPINTEGRATION" ] ; then
exit 0
fi
check_dep()
{
DEP=$1
if [ -z $(which $DEP) ] ; then
echo "$DEP is missing. Skipping ${THIS}."
exit 0
fi
}
DIRNAME="$APPDIR"
# Check whether dependencies are present in base system (we do not bundle these)
# http://cgit.freedesktop.org/xdg/desktop-file-utils/
check_dep desktop-file-validate
check_dep update-desktop-database
check_dep desktop-file-install
check_dep xdg-icon-resource
check_dep xdg-mime
check_dep xdg-desktop-menu
DESKTOPFILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
# echo "$DESKTOPFILE"
DESKTOPFILE_NAME=$(basename "${DESKTOPFILE}")
if [ ! -f "$DESKTOPFILE" ] ; then
echo "Desktop file is missing. Please run ${THIS} from within an AppImage."
exit 0
fi
if [ -z "$APPIMAGE" ] ; then
APPIMAGE="$APPDIR/AppRun"
# Not running from within an AppImage; hence using the AppRun for Exec=
fi
ABS_APPIMAGE=$(readlink -e "$APPIMAGE")
ICONFILE="$APPDIR/.DirIcon"
# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
# desktop file has to be installed in an applications subdirectory
# of one of the $XDG_DATA_DIRS components
if [ -z "$XDG_DATA_DIRS" ] ; then
XDG_DATA_DIRS=/usr/local/share:/usr/share
fi
# Determine where the desktop file should be installed
if [[ $EUID -ne 0 ]]; then
DESTINATION_DIR_DESKTOP="$HOME/.local/share/applications"
SYSTEM_WIDE=""
else
# TODO: Check $XDG_DATA_DIRS
DESTINATION_DIR_DESKTOP="/usr/local/share/applications"
SYSTEM_WIDE="--mode system" # for xdg-mime and xdg-icon-resource
fi
# Check if the desktop file is already there
# and if so, whether it points to the same AppImage
if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" ] ; then
# echo "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME already there"
EXEC=$(grep "^Exec=" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" | head -n 1 | cut -d " " -f 1)
# echo $EXEC
if [ "Exec=\"$APPIMAGE\"" == "$EXEC" ] ; then
exit 0
fi
fi
# We ask the user only if we have found no reason to skip until here
if [ -z "$SKIP" ] ; then
yesno "Install" "Would you like to integrate $APPIMAGE with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don't do this you can still launch the application by double-clicking on the AppImage."
fi
APP=$(echo "$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
# If the user has agreed, rewrite and install the desktop file, and the MIME information
if [ -z "$SKIP" ] ; then
# desktop-file-install is supposed to install .desktop files to the user's
# applications directory when run as a non-root user,
# and to /usr/share/applications if run as root
# but that does not really work for me...
#
# For Exec we must use quotes
# For TryExec quotes is not supported, so, space must be replaced to \s
# https://askubuntu.com/questions/175404/how-to-add-space-to-exec-path-in-a-thumbnailer-descrption/175567
desktop-file-install --rebuild-mime-info-cache \
--vendor=$VENDORPREFIX --set-key=Exec --set-value="\"${APPIMAGE}\" %u" \
--set-key=X-AppImage-Comment --set-value="Generated by ${THIS}" \
--set-icon="$ICONFILE" --set-key=TryExec --set-value=${APPIMAGE// /\\s} "$DESKTOPFILE" \
--dir "$DESTINATION_DIR_DESKTOP"
chmod a+x "$DESTINATION_DIR_DESKTOP/"*
RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
# echo $RESOURCE_NAME
# Install the icon files for the application; TODO: scalable
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/apps/${APP}.png" 2>/dev/null || true)
for ICON in $ICONS ; do
ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
xdg-icon-resource install --context apps --size ${ICON_SIZE} "${ICON}" "${RESOURCE_NAME}"
done
# Install mime type
find "${APPDIR}/usr/share/mime/" -type f -name *xml -exec xdg-mime install $SYSTEM_WIDE --novendor {} \; 2>/dev/null || true
# Install the icon files for the mime type; TODO: scalable
ICONS=$(find "${APPDIR}/usr/share/icons/" -wholename "*/mimetypes/*.png" 2>/dev/null || true)
for ICON in $ICONS ; do
ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
xdg-icon-resource install --context mimetypes --size ${ICON_SIZE} "${ICON}" $(basename $ICON | sed -e 's/.png//g')
done
xdg-desktop-menu forceupdate
gtk-update-icon-cache # for MIME
fi
...@@ -16,7 +16,7 @@ md5sums=() #autofill using updpkgsums ...@@ -16,7 +16,7 @@ md5sums=() #autofill using updpkgsums
prepare() { prepare() {
#cd "${pkgname}-release-${pkgver}" #cd "${pkgname}-release-${pkgver}"
cd "${pkgname}" cd "${pkgname}"
sh scripts/import.sh sh scripts/prepare.sh
} }
build() { build() {
......
...@@ -18,7 +18,7 @@ An install helper program for items served on OpenCollaborationServices (OCS). ...@@ -18,7 +18,7 @@ An install helper program for items served on OpenCollaborationServices (OCS).
%prep %prep
#%%autosetup -n %{name}-release-%{version} #%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name} %autosetup -n %{name}
sh scripts/import.sh sh scripts/prepare.sh
%build %build
%define debug_package %{nil} %define debug_package %{nil}
......
...@@ -18,7 +18,7 @@ An install helper program for items served on OpenCollaborationServices (OCS). ...@@ -18,7 +18,7 @@ An install helper program for items served on OpenCollaborationServices (OCS).
%prep %prep
#%%autosetup -n %{name}-release-%{version} #%%autosetup -n %{name}-release-%{version}
%autosetup -n %{name} %autosetup -n %{name}
sh scripts/import.sh sh scripts/prepare.sh
%build %build
%define debug_package %{nil} %define debug_package %{nil}
......
...@@ -7,7 +7,4 @@ DISTFILES += \ ...@@ -7,7 +7,4 @@ DISTFILES += \
$${PWD}/ubuntu/debian/ocs-url.install \ $${PWD}/ubuntu/debian/ocs-url.install \
$${PWD}/fedora/ocs-url.spec \ $${PWD}/fedora/ocs-url.spec \
$${PWD}/opensuse/ocs-url.spec \ $${PWD}/opensuse/ocs-url.spec \
$${PWD}/archlinux/PKGBUILD \ $${PWD}/archlinux/PKGBUILD
$${PWD}/snap/snapcraft.yaml \
$${PWD}/snap/snap/gui/ocs-url.desktop \
$${PWD}/appimage/appimage-desktopintegration_ocs-url
[Desktop Entry]
Name=ocs-url
Exec=ocs-url.ocs-url %u
Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/ocs-url.svg
Type=Application
Terminal=false
NoDisplay=true
Categories=Network;Utility;
MimeType=x-scheme-handler/ocs;x-scheme-handler/ocss;x-scheme-handler/xdg;x-scheme-handler/xdgs;
name: ocs-url
version: '0.0.0'
summary: OCS-URL
description: |
An install helper program for items served on OpenCollaborationServices (OCS).
grade: devel
confinement: strict
icon: desktop/ocs-url.svg
parts:
ocs-url:
prepare: |
sh scripts/import.sh
plugin: qmake
source: ./
qt-version: qt5
options:
- PREFIX="/usr"
build-packages:
- build-essential
- qt5-default
- libqt5svg5-dev
- qtdeclarative5-dev
- git
- snapcraft
stage-packages:
- libqt5svg5
- qml-module-qtquick-controls
after:
- desktop-qt5
apps:
ocs-url:
command: usr/bin/ocs-url
plugs:
- home
- network
- opengl
- x11
- unity7
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
dh $@ dh $@
override_dh_auto_configure: override_dh_auto_configure:
sh scripts/import.sh sh scripts/prepare.sh
qmake PREFIX="/usr" qmake PREFIX="/usr"
override_dh_auto_install: override_dh_auto_install:
......
#!/bin/bash #!/bin/bash
################################################################################
# This is wrapper script for build.sh use from inside docker container
################################################################################
PKGNAME='ocs-url' PKGNAME='ocs-url'
PKGUSER='pkgbuilder' PKGUSER='pkgbuilder'
...@@ -97,37 +93,15 @@ build_archlinux() { ...@@ -97,37 +93,15 @@ build_archlinux() {
} }
build_snap() { build_snap() {
# docker-image: ubuntu:16.04 echo 'Not implemented yet'
apt update -qq }
apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
apt -y install git snapcraft
apt -y install curl
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER}
transfer_file "$(find "${PROJDIR}/build_"*${BUILDTYPE} -type f -name "${PKGNAME}*.snap")" build_flatpak() {
echo 'Not implemented yet'
} }
build_appimage() { build_appimage() {
# docker-image: ubuntu:14.04 echo 'Not implemented yet'
apt update -qq
apt -y install build-essential qt5-default libqt5svg5-dev qtdeclarative5-dev
apt -y install git fuse zsync desktop-file-utils
apt -y install curl
modprobe fuse
useradd -m ${PKGUSER}
export HOME="/home/${PKGUSER}"
chown -R ${PKGUSER}:${PKGUSER} "${PROJDIR}"
su -c "sh "${BUILDSCRIPT}" ${BUILDTYPE}" ${PKGUSER}
transfer_file "$(find "${PROJDIR}/build_"*${BUILDTYPE} -type f -name "${PKGNAME}*.AppImage")"
} }
if [ "${BUILDTYPE}" = 'ubuntu' ]; then if [ "${BUILDTYPE}" = 'ubuntu' ]; then
...@@ -140,9 +114,11 @@ elif [ "${BUILDTYPE}" = 'archlinux' ]; then ...@@ -140,9 +114,11 @@ elif [ "${BUILDTYPE}" = 'archlinux' ]; then
build_archlinux build_archlinux
elif [ "${BUILDTYPE}" = 'snap' ]; then elif [ "${BUILDTYPE}" = 'snap' ]; then
build_snap build_snap
elif [ "${BUILDTYPE}" = 'flatpak' ]; then
build_flatpak
elif [ "${BUILDTYPE}" = 'appimage' ]; then elif [ "${BUILDTYPE}" = 'appimage' ]; then
build_appimage build_appimage
else else
echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage]" echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|flatpak|appimage]"
exit 1 exit 1
fi fi
#!/bin/bash #!/bin/bash
################################################################################
# This is utility script to build distribution packages
################################################################################
PKGNAME='ocs-url' PKGNAME='ocs-url'
BUILDTYPE='' BUILDTYPE=''
...@@ -71,48 +67,15 @@ build_archlinux() { ...@@ -71,48 +67,15 @@ build_archlinux() {
} }
build_snap() { build_snap() {
cd "${PROJDIR}" echo 'Not implemented yet'
mkdir -p "${BUILDDIR}" }
export_srcarchive "${SRCARCHIVE}"
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}" build_flatpak() {
cp "${PROJDIR}/pkg/snap/snapcraft.yaml" "${BUILDDIR}/${PKGNAME}" echo 'Not implemented yet'
cp -r "${PROJDIR}/pkg/snap/snap" "${BUILDDIR}/${PKGNAME}"
cd "${BUILDDIR}/${PKGNAME}"
snapcraft
} }
build_appimage() { build_appimage() {
cd "${PROJDIR}" echo 'Not implemented yet'
mkdir -p "${BUILDDIR}"
export_srcarchive "${SRCARCHIVE}"
tar -xzvf "${SRCARCHIVE}" -C "${BUILDDIR}"
cd "${BUILDDIR}/${PKGNAME}"
sh scripts/import.sh
qmake
make
strip "${PKGNAME}"
cd "${BUILDDIR}"
# Replace linuxdeployqt download URL to official download URL when the stable version released
curl -L -o linuxdeployqt https://dl.dropboxusercontent.com/u/150776/temp/linuxdeployqt-799f704-x86-64.appimage
chmod 755 linuxdeployqt
mkdir -p "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin"
install -m 755 -p "${BUILDDIR}/${PKGNAME}/${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}"
install -m 644 -p "${BUILDDIR}/${PKGNAME}/desktop/${PKGNAME}.desktop" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}.desktop"
install -m 644 -p "${BUILDDIR}/${PKGNAME}/desktop/${PKGNAME}.svg" "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}.svg"
install -m 755 -p /usr/bin/update-desktop-database "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/update-desktop-database"
install -m 755 -p /usr/bin/desktop-file-validate "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-validate"
install -m 755 -p /usr/bin/desktop-file-install "${BUILDDIR}/${PKGNAME}.AppDir/usr/bin/desktop-file-install"
./linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}" -qmldir="${BUILDDIR}/${PKGNAME}/app/qml" -verbose=2 -bundle-non-qt-libs # https://github.com/probonopd/linuxdeployqt/issues/25
./linuxdeployqt "${BUILDDIR}/${PKGNAME}.AppDir/${PKGNAME}" -qmldir="${BUILDDIR}/${PKGNAME}/app/qml" -verbose=2 -bundle-non-qt-libs # twice because of #25
rm "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
install -m 755 -p "${BUILDDIR}/${PKGNAME}/pkg/appimage/appimage-desktopintegration_${PKGNAME}" "${BUILDDIR}/${PKGNAME}.AppDir/AppRun"
./linuxdeployqt --appimage-extract
./squashfs-root/usr/bin/appimagetool "${BUILDDIR}/${PKGNAME}.AppDir"
} }
if [ "${BUILDTYPE}" = 'ubuntu' ]; then if [ "${BUILDTYPE}" = 'ubuntu' ]; then
...@@ -125,9 +88,11 @@ elif [ "${BUILDTYPE}" = 'archlinux' ]; then ...@@ -125,9 +88,11 @@ elif [ "${BUILDTYPE}" = 'archlinux' ]; then
build_archlinux build_archlinux
elif [ "${BUILDTYPE}" = 'snap' ]; then elif [ "${BUILDTYPE}" = 'snap' ]; then
build_snap build_snap
elif [ "${BUILDTYPE}" = 'flatpak' ]; then
build_flatpak
elif [ "${BUILDTYPE}" = 'appimage' ]; then elif [ "${BUILDTYPE}" = 'appimage' ]; then
build_appimage build_appimage
else else
echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|appimage]" echo "sh $(basename "${0}") [ubuntu|fedora|archlinux|snap|flatpak|appimage]"
exit 1 exit 1
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment