diff --git a/contrib/build_deb_package.py b/contrib/build_deb_package.py deleted file mode 100644 index 93123b683..000000000 --- a/contrib/build_deb_package.py +++ /dev/null @@ -1,106 +0,0 @@ -from shutil import copy as copyfile -from os.path import exists -from os import scandir -from shutil import rmtree -from os import remove -from os import mkdir -from os import chmod -from math import ceil -import subprocess - - -def get_size(path) -> int: - total = 0 - with scandir(path) as it: - for entry in it: - if entry.is_file(): - total += entry.stat().st_size - elif entry.is_dir(): - total += get_size(entry.path) - return total - -stop = False -if not exists('../target/release/lianad'): - print('Cannot find lianad binaries in target/release/') - stop = True - -if not exists('../target/release/liana-cli'): - print('Cannot find liana-cli binaries in target/release/') - stop = True - -if not exists('../gui/target/release/liana-gui'): - print('Cannot find liana-gui binaries in gui/target/release/') - stop = True - -if not stop: - - print("Liana version:") - version = float(input()) - - arch = subprocess.run("dpkg-architecture -q DEB_TARGET_ARCH", shell=True, - stdout=subprocess.PIPE).stdout.decode('utf-8')[:-1] - arch_multi = subprocess.run("dpkg-architecture -q DEB_TARGET_MULTIARCH", shell=True, - stdout=subprocess.PIPE).stdout.decode('utf-8')[:-1] - - - DIRNAME = f"liana-{version}-{arch_multi}" - - if exists(DIRNAME): - rmtree(DIRNAME) - if exists(f"{DIRNAME}.deb"): - remove(f"{DIRNAME}.deb") - - mkdir(DIRNAME) - mkdir(f"{DIRNAME}/DEBIAN") - mkdir(f"{DIRNAME}/opt") - mkdir(f"{DIRNAME}/opt/liana") - mkdir(f"{DIRNAME}/usr") - mkdir(f"{DIRNAME}/usr/bin") - mkdir(f"{DIRNAME}/usr/share") - mkdir(f"{DIRNAME}/usr/share/applications") - - copyfile('../gui/ui/static/logos/liana-app-icon.png', f"{DIRNAME}/opt/liana/liana-app-icon.png") - copyfile('../target/release/lianad', f"{DIRNAME}/usr/bin/lianad") - copyfile('../target/release/liana-cli', f"{DIRNAME}/usr/bin/liana-cli") - copyfile('../gui/target/release/liana-gui', f"{DIRNAME}/usr/bin/liana-gui") - - - file = open(f"{DIRNAME}/usr/share/applications/Liana.desktop", "w") - lines = """#!/usr/bin/env xdg-open - - [Desktop Entry] - Name=Liana - GenericName=Liana - Exec=/usr/bin/liana-gui - Terminal=False - Type=Application - Icon=/opt/liana/liana-app-icon.png - Categories=Finance;Network;""" - - file.write(lines) - file.close() - - size = ceil(get_size(DIRNAME)/1000) # kB - - file = open(f"{DIRNAME}/DEBIAN/control", "w") - lines = f"Package: Liana\n" - lines += f"Version: {str(version)}\n" - lines += f"Architecture: {arch}\n" - lines += "Essential: no\n" - lines += f"Installed-Size: {size}\n" - lines += "Depends: udev, libfontconfig1-dev,libudev-dev, libc6 (>= 2.34)\n" - lines += "Priority: optionnal\n" - lines += f"Breaks: Liana (<< {str(version)})\n" - lines += f"Replaces: Liana (<< {str(version)})\n" - lines += """Maintainer: A. Poinsot -Homepage: https://www.wizardsardine.com/ -Description: Liana is a Bitcoin wallet -""" - - file.write(lines) - file.close() - - subprocess.run(f"dpkg-deb --build {DIRNAME}", shell=True, check=True) - - rmtree(DIRNAME) - diff --git a/contrib/release/debian/package.zip b/contrib/release/debian/package.zip new file mode 100644 index 000000000..8007257a4 Binary files /dev/null and b/contrib/release/debian/package.zip differ diff --git a/contrib/release/macos/Liana.app.zip b/contrib/release/macos/Liana.app.zip new file mode 100644 index 000000000..a4375cb6f Binary files /dev/null and b/contrib/release/macos/Liana.app.zip differ diff --git a/contrib/release/macos/Liana.app/Contents/Info.plist b/contrib/release/macos/Liana.app/Contents/Info.plist deleted file mode 100644 index 46f57151e..000000000 --- a/contrib/release/macos/Liana.app/Contents/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - CFBundleName - Liana - - CFBundleDisplayName - Liana - - CFBundleIdentifier - com.wizardsardine.liana - - CFBundleVersion - VERSION_PLACEHOLDER - - CFBundleShortVersionString - VERSION_PLACEHOLDER - - CFBundlePackageType - APPL - - CFBundleSignature - ???? - - CFBundleExecutable - Liana - - LSMinimumSystemVersion - 10.15.0 - - CFBundleIconFile - Liana.icns - - NSPrincipalClass - NSApplication - - LSApplicationCategoryType - public.app-category.finance - - - diff --git a/contrib/release/macos/Liana.app/Contents/PkgInfo b/contrib/release/macos/Liana.app/Contents/PkgInfo deleted file mode 100644 index 6f749b0f3..000000000 --- a/contrib/release/macos/Liana.app/Contents/PkgInfo +++ /dev/null @@ -1 +0,0 @@ -APPL???? diff --git a/contrib/release/macos/Liana.app/Contents/Resources/Liana.icns b/contrib/release/macos/Liana.app/Contents/Resources/Liana.icns deleted file mode 100644 index 5fa35a07a..000000000 Binary files a/contrib/release/macos/Liana.app/Contents/Resources/Liana.icns and /dev/null differ diff --git a/contrib/release/release.sh b/contrib/release/release.sh index 7cbfcfa88..87f7f5ecb 100755 --- a/contrib/release/release.sh +++ b/contrib/release/release.sh @@ -34,13 +34,21 @@ create_dir "$BUILD_DIR" OUT_DIR="$BUILD_DIR" ./contrib/reproducible/guix/guix-build.sh TARGET_DIR="$BUILD_DIR" ./contrib/reproducible/docker/docker-build.sh -# Create the Linux archive +# Create the Linux archive and Debian binary package. ( cd "$BUILD_DIR" create_dir "$LINUX_DIR_NAME" cp "$BUILD_DIR/release/lianad" "$BUILD_DIR/release/liana-cli" "$BUILD_DIR/gui/release/liana-gui" ../README.md "$LINUX_DIR_NAME" tar -czf "$LINUX_ARCHIVE" "$LINUX_DIR_NAME" cp "$LINUX_ARCHIVE" "$RELEASE_DIR" + + unzip ../contrib/release/debian/package.zip + sed -i "s/VERSION_PLACEHOLDER/$VERSION/g" ./package/DEBIAN/control + cp "$BUILD_DIR/release/lianad" "$BUILD_DIR/release/liana-cli" "$BUILD_DIR/gui/release/liana-gui" ../README.md ./package/usr/local/bin/ + DIRNAME="liana_$VERSION-1_amd64" + mv ./package "$DIRNAME" + dpkg-deb --build "$DIRNAME" + mv "$DIRNAME.deb" "$RELEASE_DIR" ) # Create the Windows archive and the raw executable @@ -61,7 +69,7 @@ TARGET_DIR="$BUILD_DIR" ./contrib/reproducible/docker/docker-build.sh tar -czf "$MAC_ARCHIVE" "$MAC_DIR_NAME" cp "$MAC_ARCHIVE" "$RELEASE_DIR" - cp -r ../contrib/release/macos/Liana.app ./ + unzip ../contrib/release/macos/Liana.app.zip ./ sed -i "s/VERSION_PLACEHOLDER/$VERSION/g" ./Liana.app/Contents/Info.plist cp "$BUILD_DIR/gui/x86_64-apple-darwin/release/liana-gui" ./Liana.app/Contents/MacOS/Liana zip -ry Liana-noncodesigned.zip Liana.app