Skip to content

Latest commit

 

History

History
98 lines (66 loc) · 2.17 KB

BUILD.md

File metadata and controls

98 lines (66 loc) · 2.17 KB

Build from source

Warning

Other build methods like native builds are no more supported. Prefer using Podman (or Docker) for a better experience. You can still set up a development environment by simply installing Go, but won't be able to compile on Windows or MacOS due to the dependencies on ffmpeg.

Docker buildx or any OCI builder can also be used, but we won't help you with that.

Linux (dynamically-linked binaries) or development environment setup

withny-dl uses the shared libraries of ffmpeg (more precisely libavformat, libavcodec and libavutil).

  1. Install the development packages libavformat-dev libavcodec-dev libavutil-dev or ffmpeg-devel depending on your OS distribution.

  2. Install Go

  3. Run:

    go install github.com/Darkness4/withny-dl@latest

    Or git clone this repository and run:

    make

    which basically runs:

    # make
    CGO_ENABLED=1 go build -o "bin/withny-dl" ./main.go

Linux (static binaries)

To build static binaries, we use Podman with Gentoo Musl Linux containers.

You can run:

make target-static

If you wish to build a static executable. Note that it will build an arm64 version too. If you want to build just for your platform you can run:

podman build \
   --target export \
   --output=type=local,dest=./target \
   -f Dockerfile.static .

The binary will be in the target directory.

Windows

It is recommended to use Dockerfile.static-windows instead of doing everything manually.

You can simply run:

make target-static-windows

Which will run:

podman build \
   --target export \
   --output=type=local,dest=./target \
   -f Dockerfile.static-windows .

The binary will be in the target directory.

MacOS (>10.15)

It is recommended to use Dockerfile.static-macos instead of doing everything manually.

You can simply run:

make target-darwin

Which will run:

podman build \
   --target export \
   --output=type=local,dest=./target \
   -f Dockerfile.darwin .

The binary will be in the target directory.