GithubHelp home page GithubHelp logo

piegamesde / gtk4-cross Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mglolenstine/gtk4-cross

0.0 2.0 0.0 55 KB

A Docker container for cross-compiling gtk4 programs to Windows.

Dockerfile 45.13% Shell 54.87%

gtk4-cross's Introduction

GTK4 Cross compile for Windows

Prebuilt images

Images can be found on DockerHub or GitHub container repository.

To pull from DockerHub

Example for GTK 4.8:

docker pull mglolenstine/gtk4-cross:rust-gtk-4.8

To pull from GitHub container repository

Example for GTK 4.8:

docker pull ghcr.io/mglolenstine/gtk4-cross:rust-gtk-4.8

Cross compilation

Rust project

Create a container inside your project and run it

docker run -ti -v `pwd`:/mnt gtk4-cross-rust

If your Docker host uses SELinux and you're getting errors about Cargo.toml not being found when trying to build, you may need to add :z to the end of the volume mount path, like so:

docker run -ti -v `pwd`:/mnt:z gtk4-cross-rust

Then run build to build the project and package to package it into a zip file.

package.zip will be present in your project directory.

Image building

To create required images, clone the repository and cd into the root.

To build any images other than the base one, you will need to have prebuilt the base image.

Build script

There's a file build_image.sh present in the root of the repository. It takes environment variables and one cmdline argument to build the image you want.

ENV Default Description
GTK "main" GTK version to be built
ADW "main" ADW version to be built
BASE "gtk4-cross-base-$GTK-$ADW" Base image name for Docker, only used on images built on top of the base image
TAG "$IMAGE-$GTK-$ADW" A name set for the output image

The script takes one argument, which can be

Argument Description
base Which builds the base image.
rust Which builds the rust image.

Image creation

If you want to create your own project builder

  • create a new directory with your own name gtk4-cross-<language> (<language> should be replaced with whatever your project relies on and makes it recognisable)
  • cd into the new directory
  • create a file build.sh that's going to contain your building code.
  • link package.sh from the root into the directory
ln ../package.sh package.sh
  • create a new Dockerfile, and put in the following boilerplate to have a runnable container.
FROM gtk4-cross-base

ADD build.sh /usr/bin
RUN chmod +x /usr/bin/build.sh

ADD package.sh /usr/bin
RUN chmod +x /usr/bin/package.sh

CMD ["/bin/bash"]
  • build the image
docker build gtk4-cross-<language> -t gtk4-cross-<language>
  • use the image
docker run -ti -v `pwd`:/mnt gtk4-cross-<language>
  • add a section about your new builder to this README.md
  • contribute :)

gtk4-cross's People

Contributors

13hannes11 avatar aknarts avatar mglolenstine avatar newbytee avatar piegamesde avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.