Skip to content

Latest commit

 

History

History
executable file
·
160 lines (145 loc) · 8 KB

COMPILING.md

File metadata and controls

executable file
·
160 lines (145 loc) · 8 KB

Running python script directly

1. Install python3

Install python3 from https://www.python.org/

2. Install python modules

Install the required python modules with pip3 install -r requirements-build.txt

3.1 Executables / Binaries (Windows)

NOTE: You may run python3 get_deps.py to get them automatically. Please run as Administrator.

For Windows, the following executables are required:

Place executables inside sticker_convert/bin

3.2 Executables / Binaries (MacOS)

NOTE: You may run python3 get_deps.py to get them automatically. Please run with sudo.

For MacOS, the following binaries are required:

3.3 Execute script directly (Linux) (Tested with Ubuntu 20.04)

Some packages are usually not available in repo. To compile them, install these packages:

sudo apt install gcc make cmake libpng-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-filesystem-dev build-essential curl unzip pkg-config python3-tkinter python3-opencv binutils psmisc

For Linux, the following binaries are required:

  • ffmpeg and ffprobe
    • Available in many distro's package manager (sudo apt install ffmpeg)
  • magick
    • Available in many distro's package manager (sudo apt install imagemagick)
  • optipng
    • Available in many distro's package manager (sudo apt install optipng)
  • pngnq-s9
    • Many distro do not provide such package.
    • Compilation instructions:
    mkdir ~/pngnq-s9
    cd ~/pngnq-s9
    curl -O -L https://github.com/ImageProcessing-ElectronicPublications/pngnq-s9/archive/refs/tags/2.0.2.tar.gz
    tar xvzf 2.0.2.tar.gz
    cd ~/pngnq-s9/pngnq-s9-2.0.2
    # Fix bug that causes compilation to fail
    sed -i '1i#include <string.h>' src/rwpng.c
    ./configure
    make
    sudo make install
    cd
    rm -rf ~/pngnq-s9
    
  • pngquant
    • Available in many distro's package manager (sudo apt install pngquant)
  • apngdis
    • Note that version 2.9 is required. Ubuntu 20.04 and later provides this.
    • Compilation instructions in case you need it:
    mkdir ~/apngdis
    cd ~/apngdis
    curl -O -L https://sourceforge.net/projects/apngdis/files/2.9/apngdis-2.9-src.zip
    unzip apngdis-2.9-src.zip
    make
    sudo cp ~/apngdis/apngdis /usr/local/bin
    cd
    rm -rf ~/apngdis
    
  • apngasm
  • zip
    • Available in many distro's package manager (sudo apt install zip)
  • binutils (For strings command)
    • Available in many distro's package manager (sudo apt install binutils)
  • psmisc (For killall command)
    • Available in many distro's package manager (sudo apt install psmisc)

Note that Arch Linux have all of the required packages in official repository and AUR.

4 Running the script

Change directory into sticker_convert directory and run python3 ./main.py

Compiling

This repository uses pyinstaller for compiling. Install with pip3 install pyinstaller

Compiling on windows

  1. Run python3 get_deps.py to get dependencies automatically. Please run as Administrator.
  2. Run pyinstaller sticker_convert.spec
  3. Compilation result in dist directory

Compiling on MacOS

  1. Run python3 get_deps.py to get dependencies automatically. Please run with sudo.
  2. Run pyinstaller sticker_convert.spec
  3. Compilation result in dist directory

Creating AppImage on Linux

  1. Use Ubuntu 20.04 (May work on newer version if you change sourceline in AppImageBuilder.yml)
  2. Install appimage-builder
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
  1. Install dependencies: sudo apt install curl libpng-dev build-essential pkg-config git cargo libxft-dev libfontconfig1-dev libfreetype6-dev
  2. Clone this repository
  3. Run appimage-builder inside the directory containing AppImageBuilder.yml
  4. If successful, sticker-convert-latest-x86_64.AppImage should be created