Skip to content

Commit

Permalink
Doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzen committed Jan 23, 2024
1 parent efeaebb commit f845d98
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 30 deletions.
48 changes: 30 additions & 18 deletions client/cmd/dexc-desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,47 @@

The dexc-desktop client is a cross-platform desktop application for the DEX client and wallet. The instructions below are for building the client from source. If you are looking for pre-built binaries, see the [releases page](https://github.com/decred/dcrdex/releases).

**Note**: The instructions below are to be run in your CLI from the `dexc-desktop` directory.
**Note**: The instructions below are to be run in your CLI from the `client/cmd/dexc-desktop` directory.

## Debian
Build with `./pkg/pkg-debian.sh`. The deb archive is located in **./build**.
Build with `./pkg/pkg-debian.sh`. The deb archive will be located in **./build**.

For development, you'll need to install the WebKit Development Libraries and the
standard build toolchain:
For development, you'll need to install the WebKit Development Libraries and the standard build toolchain:

```bash
apt install libgtk-3-dev libwebkit2gtk-4.0-dev build-essential
sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev build-essential
```
For production, they are specified as DEPENDS in the control file and the
package manager will install them.
For production, they are specified as DEPENDS in the control file and the package manager will install them.

## Snap
The Snap package can be built on an Ubuntu system using Snapcraft, which can
be installed with `apt-get install snapcraft`. Then run `./pkg/pkg-snap.sh`,
which will build the snap package in **./build**. Note that this is dependent on
the Debian package so be sure to run the deb build first.

The snap can be uploaded to the Snap Store using `./pkg/upload-snap.sh`, after this
the package can be installed on any Ubuntu system using `snap install dexc`.
Snap is a package standard that can be installed on many Linux distributions from the Snap Store, and via software centers in e.g. Fedora, Ubuntu.

Prerequsities:
### Preparing the build environment
```bash
apt-get install snapcraft
# on Ubuntu:
sudo apt-get install snap
# on Debian:
sudo apt-get install snapd
sudo snap install --classic snapcraft
sudo adduser $USER lxd
newgrp lxd
lxd init --auto
sudo ufw disable # if ufw is installed on the host, this is neccessary for lxd to have network access

```

### Running the build

1. Build the Debian package
2. `./pkg/pkg-snap.sh`

### Publishing the snap

The snap can be uploaded to the Snap Store using `./pkg/publish-snap.sh`. This requires [Snapcraft developer account credentials](https://snapcraft.io/docs/releasing-your-app). After this is completed, the package can be installed on any system running `snap` by running `snap install dexc`. The app will be available on the [Snap Store](https://snapcraft.io/store/dexc).




## MacOS (darwin)
Build with `./pkg/pkg-darwin.sh` for `amd64` MacOS machines. If running on an
`arm64` machine, you'll need to build with `TARGETS=darwin/arm64 ./pkg/pkg-darwin.sh` instead.
The `.dmg` click installer can be located in **./pkg/installers** after a successful build.
Build with `./pkg/pkg-darwin.sh` for `amd64` MacOS machines. If running on an `arm64` machine, you'll need to build with `TARGETS=darwin/arm64 ./pkg/pkg-darwin.sh` instead. The `.dmg` click installer can be located in **./pkg/installers** after a successful build.
16 changes: 7 additions & 9 deletions client/cmd/dexc-desktop/pkg/pkg-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ rm -fr "${BUILD_DIR}"
mkdir -p -m 0755 "${CONTROL_DIR}"
mkdir -p "${DOT_DESKTOP_BUILDDIR}"

# check if site bundle is built, if not build it
if [ ! -d ../../webserver/site/dist ]; then
CWD=$(pwd)
cd ../../webserver/site
npm clean-install
npm run build
cd $CWD
fi
# Build site bundle
CWD=$(pwd)
cd ../../webserver/site
npm clean-install
npm run build
cd $CWD

# Build dexc
LDFLAGS="-s -w -X main.Version=${VER}${META:++${META}}"
Expand Down Expand Up @@ -92,7 +90,7 @@ chmod 775 "${POSTINST_PATH}"
# https://specifications.freedesktop.org/desktop-entry-spec/latest/apa.html
cat > "${DOT_DESKTOP_BUILDPATH}" <<EOF
[Desktop Entry]
Version=1.0
Version=1.5
Name=Decred DEX Client
Comment=Multi-wallet backed by Decred DEX
Exec=${BIN_FILENAME}
Expand Down
7 changes: 4 additions & 3 deletions client/cmd/dexc-desktop/snap/local/snapcraft.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ apps:
extensions: [gnome]
environment:
GTK_USE_PORTAL: "1"
#TMPDIR: $XDG_RUNTIME_DIR
#XDG_CURRENT_DESKTOP: Unity
#DISABLE_WAYLAND: 1

# required snap interfaces:
# https://snapcraft.io/docs/interface-management
plugs:
- home
- opengl
Expand Down Expand Up @@ -65,6 +65,7 @@ parts:
# Point icon to the correct location
sed -i -e 's|Icon=.*$|Icon=usr/share/icons/hicolor/scalable/apps/dexc.svg|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/dexc.desktop

# prune unused libs added by .deb dependencies from the .snap
prime:
- -usr/lib/x86_64-linux-gnu/libEGL_mesa*
- -usr/lib/x86_64-linux-gnu/libGLX_mesa*
Expand Down

0 comments on commit f845d98

Please sign in to comment.