-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from HarborWallet/linux-pacakge
Linux package
- Loading branch information
Showing
6 changed files
with
228 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component type="desktop-application"> | ||
<content_rating type="oars-1.1"> | ||
</content_rating> | ||
<id>cash.harbor.harbor</id> | ||
<metadata_license>MIT</metadata_license> | ||
<project_license>MIT</project_license> | ||
<name>Harbor</name> | ||
<summary>Harbor is an ecash desktop wallet for better bitcoin privacy.</summary> | ||
<description> | ||
<p> | ||
Harbor is an ecash desktop wallet for better bitcoin privacy. Use this tool to interact with ecash mints, | ||
moving money in and out using existing Bitcoin wallets. As you use mints, you may be able to increase the | ||
privacy of your money. Harbor also aims to demystify ecash mints for users and make them easier to use. | ||
</p> | ||
</description> | ||
<launchable type="desktop-id">cash.harbor.harbor.desktop</launchable> | ||
<url type="homepage">Harbor.cash</url> | ||
<url type="bugtracker">https://github.com/HarborWallet/harbor/issues</url> | ||
<screenshots> | ||
<screenshot type="default"> | ||
<caption>harbor logo</caption> | ||
<image> | ||
https://camo.githubusercontent.com/36432bbea8022f7f873a7e5fcf983ed4e3a84a8764be44b5eb2ab5e9056cbaf4/68747470733a2f2f626c6f672e6d7574696e7977616c6c65742e636f6d2f636f6e74656e742f696d616765732f73697a652f77323030302f323032342f30352f686172626f722d707265766965772e6a706567 | ||
</image> | ||
</screenshot> | ||
</screenshots> | ||
<developer_name>Harbor Wallet Devs</developer_name> | ||
<releases> | ||
<release version="0.2.0" | ||
date="2025-02-14"/> | ||
</releases> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Desktop Entry] | ||
Name=Habor | ||
Comment=Fedimint ecash desktop wallet for better bitcoin privacy | ||
Type=Application | ||
Keywords=bitcoin;lightning;ecash;privacy;tor;fedimint; | ||
Categories=Office;Finance; | ||
Exec=harbor-ui %U | ||
Icon=cash.harbor.harbor | ||
StartupWMClass=cash.harbor.harbor | ||
Terminal=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#!/bin/bash | ||
set -e # Exit on any error | ||
|
||
TARGET="harbor-ui" | ||
ARCH="amd64" # Debian uses amd64 instead of x86_64 | ||
RELEASE_DIR="target/release" | ||
ASSETS_DIR="harbor-ui/assets" | ||
ARCHIVE_DIR="$RELEASE_DIR/archive" | ||
VERSION=$(grep -m1 '^version = ' harbor-ui/Cargo.toml | cut -d '"' -f2) | ||
ARCHIVE_NAME="$TARGET-$VERSION-$ARCH-linux.tar.gz" | ||
ARCHIVE_PATH="$RELEASE_DIR/$ARCHIVE_NAME" | ||
DEB_NAME="${TARGET}_${VERSION}_${ARCH}.deb" | ||
DEB_PATH="$RELEASE_DIR/$DEB_NAME" | ||
|
||
build() { | ||
cargo build --release --target=x86_64-unknown-linux-gnu --features vendored -p harbor-ui | ||
} | ||
|
||
archive_name() { | ||
echo $ARCHIVE_NAME | ||
} | ||
|
||
archive_path() { | ||
echo $ARCHIVE_PATH | ||
} | ||
|
||
deb_path() { | ||
echo $DEB_PATH | ||
} | ||
|
||
create_deb() { | ||
local PACKAGE_ROOT="$RELEASE_DIR/debian" | ||
local INSTALL_ROOT="$PACKAGE_ROOT/usr" | ||
|
||
# Create directory structure | ||
mkdir -p "$PACKAGE_ROOT/DEBIAN" | ||
mkdir -p "$INSTALL_ROOT/bin" | ||
mkdir -p "$INSTALL_ROOT/share/applications" | ||
mkdir -p "$INSTALL_ROOT/share/metainfo" | ||
mkdir -p "$INSTALL_ROOT/share/icons/hicolor/512x512/apps" | ||
mkdir -p "$INSTALL_ROOT/share/icons/hicolor/scalable/apps" | ||
|
||
# Create control file | ||
cat > "$PACKAGE_ROOT/DEBIAN/control" << EOF | ||
Package: harbor | ||
Version: $VERSION | ||
Architecture: $ARCH | ||
Maintainer: benthecarman <[email protected]> Paul Miller <[email protected]> | ||
Description: Harbor UI Application | ||
Fedimint ecash desktop wallet for better bitcoin privacy | ||
Section: utils | ||
Priority: optional | ||
Homepage: https://harbor.cash | ||
Depends: libc6 | ||
EOF | ||
|
||
# Copy application binary | ||
install -Dm755 "target/x86_64-unknown-linux-gnu/release/$TARGET" "$INSTALL_ROOT/bin/harbor-ui" | ||
|
||
# Install PNG icon | ||
install -Dm644 "harbor-ui/assets/harbor_icon_512x512.png" \ | ||
"$INSTALL_ROOT/share/icons/hicolor/512x512/apps/cash.harbor.harbor.png" | ||
|
||
# Install SVG icon | ||
install -Dm644 "harbor-ui/assets/harbor_icon.svg" \ | ||
"$INSTALL_ROOT/share/icons/hicolor/scalable/apps/cash.harbor.harbor.svg" | ||
|
||
# Install .desktop file | ||
install -Dm644 "harbor-ui/assets/linux/cash.harbor.harbor.desktop" \ | ||
"$INSTALL_ROOT/share/applications/cash.harbor.harbor.desktop" | ||
|
||
# Install AppStream metadata | ||
install -Dm644 "harbor-ui/assets/linux/cash.harbor.harbor.appdata.xml" \ | ||
"$INSTALL_ROOT/share/metainfo/cash.harbor.harbor.appdata.xml" | ||
|
||
# Add post-installation script to update icon cache | ||
cat > "$PACKAGE_ROOT/DEBIAN/postinst" << 'EOF' | ||
#!/bin/sh | ||
set -e | ||
if [ -x "$(command -v update-desktop-database)" ]; then | ||
update-desktop-database -q | ||
fi | ||
if [ -x "$(command -v gtk-update-icon-cache)" ]; then | ||
gtk-update-icon-cache -f -t /usr/share/icons/hicolor | ||
fi | ||
EOF | ||
|
||
# Make post-installation script executable | ||
chmod 755 "$PACKAGE_ROOT/DEBIAN/postinst" | ||
|
||
# Build deb package | ||
dpkg-deb --build "$PACKAGE_ROOT" "$DEB_PATH" | ||
echo "Created Debian package: $DEB_PATH" | ||
} | ||
|
||
package() { | ||
build || { echo "Build failed"; exit 1; } | ||
|
||
# Create tar.gz archive | ||
install -Dm755 target/x86_64-unknown-linux-gnu/release/$TARGET -t $ARCHIVE_DIR/bin | ||
install -Dm644 $ASSETS_DIR/linux/cash.harbor.harbor.appdata.xml -t $ARCHIVE_DIR/share/metainfo | ||
install -Dm644 $ASSETS_DIR/linux/cash.harbor.harbor.desktop -t $ARCHIVE_DIR/share/applications | ||
cp -r $ASSETS_DIR/icons $ARCHIVE_DIR/share/ | ||
cp -fp "target/x86_64-unknown-linux-gnu/release/$TARGET" "$ARCHIVE_DIR/harbor" | ||
tar czvf $ARCHIVE_PATH -C $ARCHIVE_DIR . | ||
|
||
# Create deb package | ||
create_deb | ||
} | ||
|
||
case "$1" in | ||
"package") package;; | ||
"archive_name") archive_name;; | ||
"archive_path") archive_path;; | ||
"deb_path") deb_path;; | ||
*) | ||
echo "available commands: package, archive_name, archive_path, deb_path" | ||
;; | ||
esac |